当前位置: 首页>>代码示例>>Python>>正文


Python WaterCommandline.set_parameter方法代码示例

本文整理汇总了Python中Bio.Emboss.Applications.WaterCommandline.set_parameter方法的典型用法代码示例。如果您正苦于以下问题:Python WaterCommandline.set_parameter方法的具体用法?Python WaterCommandline.set_parameter怎么用?Python WaterCommandline.set_parameter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Bio.Emboss.Applications.WaterCommandline的用法示例。


在下文中一共展示了WaterCommandline.set_parameter方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_water_file2

# 需要导入模块: from Bio.Emboss.Applications import WaterCommandline [as 别名]
# 或者: from Bio.Emboss.Applications.WaterCommandline import set_parameter [as 别名]
 def test_water_file2(self):
     """water with the asis trick and nucleotide FASTA file, output to a file."""
     # Setup,
     query = "ACACACTCACACACACTTGGTCAGAGATGCTGTGCTTCTTGGAAGCAAGGNCTCAAAGGCAAGGTGCACGCAGAGGGACGTTTGAGTCTGGGATGAAGCATGTNCGTATTATTTATATGATGGAATTTCACGTTTTTATG"
     out_file = "Emboss/temp_test2.water"
     in_file = "Fasta/f002"
     self.assertTrue(os.path.isfile(in_file))
     if os.path.isfile(out_file):
         os.remove(out_file)
     cline = WaterCommandline(cmd=exes["water"])
     cline.set_parameter("-asequence", "asis:%s" % query)
     cline.set_parameter("-bsequence", in_file)
     cline.set_parameter("-gapopen", "10")
     cline.set_parameter("-gapextend", "0.5")
     cline.set_parameter("-outfile", out_file)
     self.assertEqual(str(eval(repr(cline))), str(cline))
     # Run the tool,
     self.run_water(cline)
     # Check we can parse the output and it is sensible...
     self.pairwise_alignment_check(query,
                                   SeqIO.parse(in_file, "fasta"),
                                   AlignIO.parse(out_file, "emboss"),
                                   local=True)
     # Clean up,
     os.remove(out_file)
开发者ID:qc-friends,项目名称:biopython,代码行数:27,代码来源:test_Emboss.py

示例2: test_water_file3

# 需要导入模块: from Bio.Emboss.Applications import WaterCommandline [as 别名]
# 或者: from Bio.Emboss.Applications.WaterCommandline import set_parameter [as 别名]
 def test_water_file3(self):
     """water with the asis trick and GenBank file, output to a file."""
     # Setup,
     query = "TGTTGTAATGTTTTAATGTTTCTTCTCCCTTTAGATGTACTACGTTTGGA"
     out_file = "Emboss/temp_test3.water"
     in_file = "GenBank/cor6_6.gb"
     self.assertTrue(os.path.isfile(in_file))
     if os.path.isfile(out_file):
         os.remove(out_file)
     cline = WaterCommandline(cmd=exes["water"])
     cline.set_parameter("asequence", "asis:%s" % query)
     cline.set_parameter("bsequence", in_file)
     # TODO - Tell water this is a GenBank file!
     cline.set_parameter("gapopen", "1")
     cline.set_parameter("gapextend", "0.5")
     cline.set_parameter("outfile", out_file)
     self.assertEqual(str(eval(repr(cline))), str(cline))
     # Run the tool,
     self.run_water(cline)
     # Check we can parse the output and it is sensible...
     self.pairwise_alignment_check(query,
                                   SeqIO.parse(in_file, "genbank"),
                                   AlignIO.parse(out_file, "emboss"),
                                   local=True)
     # Clean up,
     os.remove(out_file)
开发者ID:qc-friends,项目名称:biopython,代码行数:28,代码来源:test_Emboss.py

示例3: test_water_file3

# 需要导入模块: from Bio.Emboss.Applications import WaterCommandline [as 别名]
# 或者: from Bio.Emboss.Applications.WaterCommandline import set_parameter [as 别名]
 def test_water_file3(self):
     """water with the asis trick and GenBank file, output to a file."""
     #Setup,
     query = "TGTTGTAATGTTTTAATGTTTCTTCTCCCTTTAGATGTACTACGTTTGGA"
     out_file = "Emboss/temp_test3.water"
     in_file = "GenBank/cor6_6.gb"
     self.assert_(os.path.isfile(in_file))
     if os.path.isfile(out_file) :
         os.remove(out_file)
     cline = WaterCommandline(cmd=exes["water"])
     cline.set_parameter("asequence", "asis:%s" % query)
     cline.set_parameter("bsequence", in_file)
     #TODO - Tell water this is a GenBank file!
     cline.set_parameter("gapopen", "1")
     cline.set_parameter("gapextend", "0.5")
     cline.set_parameter("outfile", out_file)
     self.assertEqual(str(eval(repr(cline))), str(cline))
     #Run the tool,
     result, out, err = generic_run(cline)
     #Check it worked,
     errors = err.read().strip()
     self.assert_(errors.startswith("Smith-Waterman local alignment"), errors)
     self.assertEqual(out.read().strip(), "")
     if result.return_code != 0 : print >> sys.stderr, "\n%s"%cline
     self.assertEqual(result.return_code, 0)
     self.assertEqual(result.get_result("outfile"), out_file)
     assert os.path.isfile(out_file)
     #Check we can parse the output and it is sensible...
     self.pairwise_alignment_check(query,
                                   SeqIO.parse(open(in_file),"genbank"),
                                   AlignIO.parse(open(out_file),"emboss"),
                                   local=True)
     #Clean up,
     os.remove(out_file)
开发者ID:andyoberlin,项目名称:biopython,代码行数:36,代码来源:test_Emboss.py

示例4: test_water_file2

# 需要导入模块: from Bio.Emboss.Applications import WaterCommandline [as 别名]
# 或者: from Bio.Emboss.Applications.WaterCommandline import set_parameter [as 别名]
 def test_water_file2(self):
     """water with the asis trick and nucleotide FASTA file, output to a file."""
     #Setup,
     query = "ACACACTCACACACACTTGGTCAGAGATGCTGTGCTTCTTGGAAGCAAGGNCTCAAAGGCAAGGTGCACGCAGAGGGACGTTTGAGTCTGGGATGAAGCATGTNCGTATTATTTATATGATGGAATTTCACGTTTTTATG"
     out_file = "Emboss/temp_test2.water"
     in_file = "Fasta/f002"
     self.assert_(os.path.isfile(in_file))
     if os.path.isfile(out_file) :
         os.remove(out_file)
     cline = WaterCommandline(cmd=exes["water"])
     cline.set_parameter("-asequence", "asis:%s" % query)
     cline.set_parameter("-bsequence", in_file)
     cline.set_parameter("-gapopen", "10")
     cline.set_parameter("-gapextend", "0.5")
     cline.set_parameter("-outfile", out_file)
     self.assertEqual(str(eval(repr(cline))), str(cline))
     #Run the tool,
     result, out, err = generic_run(cline)
     #Check it worked,
     errors = err.read().strip()
     self.assert_(errors.startswith("Smith-Waterman local alignment"), errors)
     self.assertEqual(out.read().strip(), "")
     if result.return_code != 0 : print >> sys.stderr, "\n%s"%cline
     self.assertEqual(result.return_code, 0)
     self.assertEqual(result.get_result("outfile"), out_file)
     assert os.path.isfile(out_file)
     #Check we can parse the output and it is sensible...
     self.pairwise_alignment_check(query,
                                   SeqIO.parse(open(in_file),"fasta"),
                                   AlignIO.parse(open(out_file),"emboss"),
                                   local=True)
     #Clean up,
     os.remove(out_file)
开发者ID:andyoberlin,项目名称:biopython,代码行数:35,代码来源:test_Emboss.py

示例5: test_water_file

# 需要导入模块: from Bio.Emboss.Applications import WaterCommandline [as 别名]
# 或者: from Bio.Emboss.Applications.WaterCommandline import set_parameter [as 别名]
 def test_water_file(self):
     """water with the asis trick, output to a file."""
     #Setup, try a mixture of keyword arguments and later additions:
     cline = WaterCommandline(cmd=exes["water"],
                              gapopen="10", gapextend="0.5")
     #Try using both human readable names, and the literal ones:
     cline.set_parameter("asequence", "asis:ACCCGGGCGCGGT")
     cline.set_parameter("-bsequence", "asis:ACCCGAGCGCGGT")
     #Try using a property set here:
     cline.outfile = "Emboss/temp with space.water"
     self.assertEqual(str(eval(repr(cline))), str(cline))
     #Run the tool,
     result, out, err = generic_run(cline)
     #Check it worked,
     errors = err.read().strip()
     self.assert_(errors.startswith("Smith-Waterman local alignment"), errors)
     self.assertEqual(out.read().strip(), "")
     if result.return_code != 0 : print >> sys.stderr, "\n%s"%cline
     self.assertEqual(result.return_code, 0)
     filename = result.get_result("outfile")
     self.assertEqual(filename, "Emboss/temp with space.water")
     assert os.path.isfile(filename)
     #Check we can parse the output...
     align = AlignIO.read(open(filename),"emboss")
     self.assertEqual(len(align), 2)
     self.assertEqual(str(align[0].seq), "ACCCGGGCGCGGT")
     self.assertEqual(str(align[1].seq), "ACCCGAGCGCGGT")
     #Clean up,
     os.remove(filename)            
开发者ID:andyoberlin,项目名称:biopython,代码行数:31,代码来源:test_Emboss.py

示例6: test_water_file

# 需要导入模块: from Bio.Emboss.Applications import WaterCommandline [as 别名]
# 或者: from Bio.Emboss.Applications.WaterCommandline import set_parameter [as 别名]
 def test_water_file(self):
     """water with the asis trick, output to a file."""
     # Setup, try a mixture of keyword arguments and later additions:
     cline = WaterCommandline(cmd=exes["water"], gapopen="10", gapextend="0.5")
     # Try using both human readable names, and the literal ones:
     cline.set_parameter("asequence", "asis:ACCCGGGCGCGGT")
     cline.set_parameter("-bsequence", "asis:ACCCGAGCGCGGT")
     # Try using a property set here:
     cline.outfile = "Emboss/temp with space.water"
     self.assertEqual(str(eval(repr(cline))), str(cline))
     # Run the tool,
     self.run_water(cline)
     # Check we can parse the output...
     align = AlignIO.read(open(cline.outfile), "emboss")
     self.assertEqual(len(align), 2)
     self.assertEqual(str(align[0].seq), "ACCCGGGCGCGGT")
     self.assertEqual(str(align[1].seq), "ACCCGAGCGCGGT")
     # Clean up,
     os.remove(cline.outfile)
开发者ID:Mat-D,项目名称:biopython,代码行数:21,代码来源:test_Emboss.py

示例7: test_water_file4

# 需要导入模块: from Bio.Emboss.Applications import WaterCommandline [as 别名]
# 或者: from Bio.Emboss.Applications.WaterCommandline import set_parameter [as 别名]
 def test_water_file4(self):
     """water with the asis trick and SwissProt file, output to a file."""
     # Setup,
     query = "DVCTGKALCDPVTQNIKTYPVKIENLRVMI"
     out_file = "Emboss/temp_test4.water"
     in_file = "SwissProt/sp004"
     self.assertTrue(os.path.isfile(in_file))
     if os.path.isfile(out_file):
         os.remove(out_file)
     cline = WaterCommandline(cmd=exes["water"])
     cline.set_parameter("-asequence", "asis:%s" % query)
     cline.set_parameter("-bsequence", in_file)
     # EMBOSS should work this out, but let's be explicit:
     cline.set_parameter("-sprotein", True)
     # TODO - Tell water this is a SwissProt file!
     cline.set_parameter("-gapopen", "20")
     cline.set_parameter("-gapextend", "5")
     cline.set_parameter("-outfile", out_file)
     self.assertEqual(str(eval(repr(cline))), str(cline))
     # Run the tool,
     self.run_water(cline)
     # Check we can parse the output and it is sensible...
     self.pairwise_alignment_check(query,
                                   SeqIO.parse(in_file, "swiss"),
                                   AlignIO.parse(out_file, "emboss"),
                                   local=True)
     # Clean up,
     os.remove(out_file)
开发者ID:qc-friends,项目名称:biopython,代码行数:30,代码来源:test_Emboss.py

示例8: test_water_file4

# 需要导入模块: from Bio.Emboss.Applications import WaterCommandline [as 别名]
# 或者: from Bio.Emboss.Applications.WaterCommandline import set_parameter [as 别名]
 def test_water_file4(self):
     """water with the asis trick and SwissProt file, output to a file."""
     #Setup,
     query = "DVCTGKALCDPVTQNIKTYPVKIENLRVMI"
     out_file = "Emboss/temp_test4.water"
     in_file = "SwissProt/sp004"
     self.assert_(os.path.isfile(in_file))
     if os.path.isfile(out_file) :
         os.remove(out_file)
     cline = WaterCommandline(cmd=exes["water"])
     cline.set_parameter("-asequence", "asis:%s" % query)
     cline.set_parameter("-bsequence", in_file)
     #EMBOSS should work this out, but let's be explicit:
     cline.set_parameter("-sprotein", True)
     #TODO - Tell water this is a SwissProt file!
     cline.set_parameter("-gapopen", "20")
     cline.set_parameter("-gapextend", "5")
     cline.set_parameter("-outfile", out_file)
     self.assertEqual(str(eval(repr(cline))), str(cline))
     #Run the tool,
     result, out, err = generic_run(cline)
     #Check it worked,
     errors = err.read().strip()
     self.assert_(errors.startswith("Smith-Waterman local alignment"), errors)
     self.assertEqual(out.read().strip(), "")
     if result.return_code != 0 : print >> sys.stderr, "\n%s"%cline
     self.assertEqual(result.return_code, 0)
     #Should be able to access this via any alias:
     self.assertEqual(result.get_result("-outfile"), out_file)
     assert os.path.isfile(out_file)
     #Check we can parse the output and it is sensible...
     self.pairwise_alignment_check(query,
                                   SeqIO.parse(open(in_file),"swiss"),
                                   AlignIO.parse(open(out_file),"emboss"),
                                   local=True)
     #Clean up,
     os.remove(out_file)
开发者ID:andyoberlin,项目名称:biopython,代码行数:39,代码来源:test_Emboss.py


注:本文中的Bio.Emboss.Applications.WaterCommandline.set_parameter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。