本文整理汇总了Python中pbcore.io.AlignmentSet.split_references方法的典型用法代码示例。如果您正苦于以下问题:Python AlignmentSet.split_references方法的具体用法?Python AlignmentSet.split_references怎么用?Python AlignmentSet.split_references使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pbcore.io.AlignmentSet
的用法示例。
在下文中一共展示了AlignmentSet.split_references方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_split_references
# 需要导入模块: from pbcore.io import AlignmentSet [as 别名]
# 或者: from pbcore.io.AlignmentSet import split_references [as 别名]
def test_split_references(self):
test_file_1 = ('/pbi/dept/secondary/siv/testdata/SA3-RS/lambda/'
'2372215/0007_tiny/Alignment_Results/m150404_1016'
'26_42267_c100807920800000001823174110291514_s1_p'
'0.1.aligned.bam')
test_file_2 = ('/pbi/dept/secondary/siv/testdata/SA3-Sequel/ecoli/'
'315/3150204/r54049_20160508_152025/1_A01/Alignment'
'_Results/m54049_160508_155917.alignmentset.xml')
test_file_3 = ('/pbi/dept/secondary/siv/testdata/SA3-RS/ecoli/'
'tiny-multimovie/Alignment_Results/'
'combined.alignmentset.xml')
NREC1 = len(AlignmentSet(test_file_1))
NREC2 = len(AlignmentSet(test_file_2))
NREC3 = len(AlignmentSet(test_file_3))
NREC = NREC1 + NREC2 + NREC3
self.assertNotEqual(NREC1, 0)
self.assertNotEqual(NREC2, 0)
self.assertNotEqual(NREC3, 0)
self.assertNotEqual(NREC, 0)
ds1 = AlignmentSet(test_file_1, test_file_2, test_file_3)
# used to get total:
#self.assertEqual(sum(1 for _ in ds1), N_RECORDS)
self.assertEqual(len(ds1), NREC)
dss = ds1.split_references(1)
self.assertEqual(len(dss), 1)
self.assertEqual(sum([len(ds_) for ds_ in dss]), NREC)
self.assertEqual(len(ds1), NREC)
self.assertFalse(ds1.filters)
dss = ds1.split_references(12)
self.assertEqual(len(dss), 2)
self.assertEqual(sum([len(ds_) for ds_ in dss]),
NREC)
self.assertEqual(len(set(dss[0].index.tId)), 1)
self.assertEqual(len(set(dss[-1].index.tId)), 1)
self.assertEqual(
dss[0].tid2rname[list(set(dss[0].index.tId))[0]],
'ecoliK12_pbi_March2013')
self.assertEqual(len(dss[0]), NREC2 + NREC3)
self.assertEqual(
dss[-1].tid2rname[list(set(dss[-1].index.tId))[0]],
'lambda_NEB3011')
self.assertEqual(len(dss[-1]), NREC1)