本文整理汇总了Python中BCBio.GFF.GFFParser.parse_in_parts方法的典型用法代码示例。如果您正苦于以下问题:Python GFFParser.parse_in_parts方法的具体用法?Python GFFParser.parse_in_parts怎么用?Python GFFParser.parse_in_parts使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BCBio.GFF.GFFParser
的用法示例。
在下文中一共展示了GFFParser.parse_in_parts方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: t_gff3_iterator
# 需要导入模块: from BCBio.GFF import GFFParser [as 别名]
# 或者: from BCBio.GFF.GFFParser import parse_in_parts [as 别名]
def t_gff3_iterator(self):
"""Iterated parsing in GFF3 files with nested features.
"""
parser = GFFParser()
recs = [r for r in parser.parse_in_parts(self._test_gff_file,
target_lines=70)]
# should be one big set because we don't have a good place to split
assert len(recs) == 6
assert len(recs[0].features) == 59
示例2: t_solid_iterator
# 需要导入模块: from BCBio.GFF import GFFParser [as 别名]
# 或者: from BCBio.GFF.GFFParser import parse_in_parts [as 别名]
def t_solid_iterator(self):
"""Iterated parsing in a flat file without nested features.
"""
parser = GFFParser()
feature_sizes = []
for rec in parser.parse_in_parts(self._test_gff_file,
target_lines=5):
feature_sizes.append(len(rec.features))
assert len(feature_sizes) == 112
assert max(feature_sizes) == 1
示例3: main
# 需要导入模块: from BCBio.GFF import GFFParser [as 别名]
# 或者: from BCBio.GFF.GFFParser import parse_in_parts [as 别名]
def main(in_file):
base, ext = os.path.splitext(in_file)
out_file = "%s.gff3" % (base)
in_handle = open(in_file)
out_handle = open(out_file, "w")
reader = GFFParser()
writer = GFF3Writer()
writer.write(reader.parse_in_parts(in_handle, target_lines=25000),
out_handle)
in_handle.close()
out_handle.close()
示例4: t_gff2_iteration
# 需要导入模块: from BCBio.GFF import GFFParser [as 别名]
# 或者: from BCBio.GFF.GFFParser import parse_in_parts [as 别名]
def t_gff2_iteration(self):
"""Test iterated features with GFF2 files, breaking without parents.
"""
parser = GFFParser()
recs = []
for rec in parser.parse_in_parts(self._wormbase_file, target_lines=15):
recs.append(rec)
assert len(recs) == 4
assert recs[0].features[0].type == 'region'
assert recs[0].features[1].type == 'SAGE_tag'
assert len(recs[0].features[2].sub_features) == 29