本文整理汇总了Python中Bio.Emboss.Applications.WaterCommandline.gapopen方法的典型用法代码示例。如果您正苦于以下问题:Python WaterCommandline.gapopen方法的具体用法?Python WaterCommandline.gapopen怎么用?Python WaterCommandline.gapopen使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bio.Emboss.Applications.WaterCommandline
的用法示例。
在下文中一共展示了WaterCommandline.gapopen方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: GetExec
# 需要导入模块: from Bio.Emboss.Applications import WaterCommandline [as 别名]
# 或者: from Bio.Emboss.Applications.WaterCommandline import gapopen [as 别名]
def GetExec(self, optList, frame):
# Respond to the "embossn" type command.
self.frame = frame
plugin_exe = r"C:/mEMBOSS/water.exe"
self.outfile = r"C:\Users\francis\Documents\Monguis\BioGui\plugins\water.txt"
self.outtype = "fasta"
cline = WaterCommandline(plugin_exe, asequence=str(self.frame.paramBoxes[1].GetValue()), bsequence=str(self.frame.paramBoxes[3].GetValue()))
cline.outfile = self.outfile
cline.gapopen = self.param[7].GetValue()
cline.gapextend = self.param[9].GetValue()
if self.param[10].GetValue():
cline.similarity = True
else:
cline.similarity = False
if self.frame.abet=="AA":
cline.snucleotide = True
cline.sprotein = False
elif self.frame.abet=="DNA" or self.frame.abet=="RNA":
cline.snucleotide = True
cline.sprotein = False
if self.frame.options:
t = self.boxList[3].GetValue()
if t != '':
cline.datafile = str(t)
return str(cline)
示例2: doWater
# 需要导入模块: from Bio.Emboss.Applications import WaterCommandline [as 别名]
# 或者: from Bio.Emboss.Applications.WaterCommandline import gapopen [as 别名]
def doWater(contig, seq):
with open("contig.faa", "w") as stuff1:
stuff1.write(">contig\n")
stuff1.write(contig)
with open("seq.faa", "w") as stuff2:
stuff2.write(">seq\n")
stuff2.write(str(seq))
water_cline = WaterCommandline()
water_cline.asequence="contig.faa"
water_cline.bsequence="seq.faa"
water_cline.gapopen=10
water_cline.gapextend=0.5
water_cline.outfile="water.txt"
stdout, stderr = water_cline()
print(stdout + stderr)
values = getStartEnd()
return values
示例3: emboss_local_pairwise_alignment
# 需要导入模块: from Bio.Emboss.Applications import WaterCommandline [as 别名]
# 或者: from Bio.Emboss.Applications.WaterCommandline import gapopen [as 别名]
def emboss_local_pairwise_alignment(query_dir, seq_type):
if seq_type == 'fg':
print '\n ...pairwise comparison of functional gene sequences...\n'
elif seq_type == 'ssu':
print '\n ...pairwise comparison of SSU rRNA sequences...\n'
water_cline = WaterCommandline()
water_cline.gapopen=10
water_cline.gapextend=0.5
query_list = [query for query in sorted(glob.glob(query_dir+"/*.fa"))]
for i, a_seq in enumerate(query_list):
water_cline.asequence=str(a_seq)
for j, b_seq in enumerate(query_list[i:]):
water_cline.bsequence=str(b_seq)
align_out = query_dir+"/pairwise_"+str(i+1)+"_"+str(i+j+1)+".aln"
water_cline.outfile=str(align_out)
water_cline()
print 'Done\n'
return query_dir+"/*.aln"
示例4: open
# 需要导入模块: from Bio.Emboss.Applications import WaterCommandline [as 别名]
# 或者: from Bio.Emboss.Applications.WaterCommandline import gapopen [as 别名]
# http://rosalind.info/problems/swat/
from Bio.Emboss.Applications import WaterCommandline
from Bio import ExPASy, SeqIO
if __name__ == "__main__":
ids = open('rosalind_swat.txt').read().split(' ')
for i in ids:
handle = ExPASy.get_sprot_raw(i)
r = SeqIO.read(handle, "swiss")
handle.close()
with open(i, 'w') as f:
SeqIO.write(r, f, 'fasta')
water_cline = WaterCommandline()
water_cline.asequence = ids[0]
water_cline.bsequence = ids[1]
water_cline.outfile = "rosalind_swat_output.txt"
water_cline.gapopen = 10
water_cline.gapextend = 1
water_cline()
for line in open('rosalind_swat_output.txt').readlines():
if 'Score:' in line:
print(int(float(line[:-1].split(':')[-1].strip())))