本文整理汇总了Python中Bio.Wise类的典型用法代码示例。如果您正苦于以下问题:Python Wise类的具体用法?Python Wise怎么用?Python Wise使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Wise类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: align
def align(pair, match=_SCORE_MATCH, mismatch=_SCORE_MISMATCH, gap=_SCORE_GAP_START, extension=_SCORE_GAP_EXTENSION, **keywds):
cmdline = _build_dnal_cmdline(match, mismatch, gap, extension)
temp_file = Wise.align(cmdline, pair, **keywds)
try:
return Statistics(temp_file.name, match, mismatch, gap, extension)
except AttributeError:
try:
keywds['dry_run']
return None
except KeyError:
raise
示例2: align
def align(pair, scores=None, gap_start=None, gap_extension=None, *args, **keywds):
cmdline = _CMDLINE_PSW[:]
if scores:
cmdline.extend((_OPTION_SCORES, scores))
if gap_start:
cmdline.extend((_OPTION_GAP_START, str(gap_start)))
if gap_extension:
cmdline.extend((_OPTION_GAP_EXTENSION, str(gap_extension)))
temp_file = Wise.align(cmdline, pair, *args, **keywds)
return parse(temp_file)
示例3: align
def align(pair, match=_SCORE_MATCH, mismatch=_SCORE_MISMATCH, gap=_SCORE_GAP_START, extension=_SCORE_GAP_EXTENSION, **keywds):
"""Align a pair of DNA files using dnal and calculate the statistics of the alignment."""
cmdline = _build_dnal_cmdline(match, mismatch, gap, extension)
temp_file = Wise.align(cmdline, pair, **keywds)
try:
return Statistics(temp_file.name, match, mismatch, gap, extension)
except AttributeError:
try:
keywds['dry_run']
return None
except KeyError:
raise
示例4: test_align
def test_align(self):
"""Call dnal with optional arguments, and do a trivial check on the output."""
temp_file = Wise.align(["dnal"], ("Wise/human_114_g01_exons.fna_01", "Wise/human_114_g02_exons.fna_01"), kbyte=100000, force_type="DNA", quiet=True)
line = temp_file.readline().rstrip()
if line == "Score 114" :
#Wise 2.4.1 includes a score line, even in quiet mode, ignore this
line = temp_file.readline().rstrip()
if line == "ENSG00000172135 AGGGAAAGCCCCTAAGCTC--CTGATCTATGCTGCATCCAGTTTGCAAAGTGGGGTCCC" :
#This is what we expect from wise 2.2.0 (and earlier)
pass
elif line == "ENSG00000172135 AGGGAAAGCCCCTAAGCTC--CTGATCTATGCTGCATCCAGTTTGCAAAG-TGGGGTCC" :
#This is what we expect from wise 2.4.1
pass
else :
#Bad!
self.assert_(False, line)
示例5: test_psw
def test_psw(self):
"""Call psw, and do a trivial check on its output."""
Wise.align(["psw"], ("seq1.faa", "seq2.faa"), dry_run=True, kbyte=4)
self.assert_(sys.stdout.getvalue().startswith("psw -kbyte 4 seq1.faa seq2.faa"))
示例6: test_dnal
def test_dnal(self):
"""Call dnal, and do a trivial check on its output."""
Wise.align(["dnal"], ("seq1.fna", "seq2.fna"), kbyte=100000, dry_run=True)
self.assert_(sys.stdout.getvalue().startswith("dnal -kbyte 100000 seq1.fna seq2.fna"))
示例7: test_psw
def test_psw(self):
"""Call psw, and do a trivial check on its output."""
Wise.align(["psw"], ("seq1.faa", "seq2.faa"), dry_run=True, kbyte=4)
# If test output is redirected to a file, the wrapper adds -quiet
output = sys.stdout.getvalue().replace(" -quiet ", " ")
self.assertTrue(output.startswith("psw -kbyte 4 seq1.faa seq2.faa"), output[:200])
示例8: test_dnal
def test_dnal(self):
"""Call dnal, and do a trivial check on its output."""
Wise.align(["dnal"], ("seq1.fna", "seq2.fna"), kbyte=100000, dry_run=True)
# If test output is redirected to a file, the wrapper adds -quiet
output = sys.stdout.getvalue().replace(" -quiet ", " ")
self.assertTrue(output.startswith("dnal -kbyte 100000 seq1.fna seq2.fna"), output[:200])