def print_sam_header(self):
"""Print SAM headers.
"""
print("@HD", "VN:1.5", "SO:unsorted", sep="\t", file=self.output_fo)
print("@PG", "PN:prophyle", "ID:prophyle", "VN:{}".format(version.VERSION), sep="\t", file=self.output_fo)
for node in self.tree_index.tree.traverse("postorder"):
try:
ur = "\tUR:{}".format(node.fastapath)
except:
ur = ""
try:
sp = "\tSP:{}".format(node.sci_name)
except:
sp = ""
try:
as_ = "\tAS:{}".format(node.gi)
except:
as_ = ""
if node.name != '':
print(
"@SQ\tSN:{rname}\tLN:{rlen}{as_}{ur}{sp}".format(
rname=node.name,
rlen=CONFIG['FAKE_CONTIG_LENGTH'],
as_=as_,
ur=ur,
sp=sp,
), file=self.output_fo
)
评论列表
文章目录