本文整理汇总了Python中Bio.AlignIO.MafIO.MafIndex._get_record方法的典型用法代码示例。如果您正苦于以下问题:Python MafIndex._get_record方法的具体用法?Python MafIndex._get_record怎么用?Python MafIndex._get_record使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bio.AlignIO.MafIO.MafIndex
的用法示例。
在下文中一共展示了MafIndex._get_record方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: TestGetRecord
# 需要导入模块: from Bio.AlignIO.MafIO import MafIndex [as 别名]
# 或者: from Bio.AlignIO.MafIO.MafIndex import _get_record [as 别名]
class TestGetRecord(unittest.TestCase):
"""Make sure we can seek and fetch records properly"""
def setUp(self):
self.idx = MafIndex("MAF/ucsc_mm9_chr10.mafindex",
"MAF/ucsc_mm9_chr10.maf", "mm9.chr10")
self.assertEqual(len(self.idx), 48)
def test_records_begin(self):
recs = {}
recs[0] = SeqRecord(Seq("TCATAGGTATTTATTTTTAAATATGGTTTGCTTTATGGCTAGAA"
"CACACCGATTACTTAAAATAGGATTAACC--CCCATACACTTTA"
"AAAATGATTAAACAACATTTCTGCTGCTCGCTCACATTCTTCAT"
"AGAAGATGACATAATGTATTTTCCTTTTGGTT"),
id="mm9.chr10",
name="mm9.chr10",
description="",
annotations={"start": 3009319,
"srcSize": 129993255,
"strand": 1,
"size": 162})
recs[1] = SeqRecord(Seq("TCACAGATATTTACTATTAAATATGGTTTGTTATATGGTTACGG"
"TTCATAGGTTACTTGGAATTGGATTAACCTTCTTATTCATTGCA"
"GAATTGGTTACACTGTGTTCTTGACCTTTGCTTGTTTTCTCCAT"
"GGAAACTGATGTCAAATACTTTCCCTTTGGTT"),
id="oryCun1.scaffold_133159",
name="oryCun1.scaffold_133159",
description="",
annotations={"start": 11087,
"srcSize": 13221,
"strand": 1,
"size": 164})
fetched_recs = self.idx._get_record(34)
for i in range(2):
self.assertTrue(compare_record(recs[i], fetched_recs[i]))
def test_records_end(self):
recs = {}
recs[0] = SeqRecord(Seq("TGTTTAGTACC----ATGCTTAGGAATGATAAACTCACTTAGTGtt"),
id="mm9.chr10",
name="mm9.chr10",
description="",
annotations={"start": 3021494,
"srcSize": 129993255,
"strand": 1,
"size": 42})
recs[1] = SeqRecord(Seq("TGTTGCATGTCCTTTATTCTTTGGCGTGATAGGCTCACCCAATCTT"),
id="ponAbe2.chr6",
name="ponAbe2.chr6",
description="",
annotations={"start": 16173516,
"srcSize": 174210431,
"strand": -1,
"size": 46})
recs[2] = SeqRecord(Seq("TGTTGCATATCCTTTATTCTTTGGCGTGATAGGCTCACCCAATCTT"),
id="panTro2.chr6",
name="panTro2.chr6",
description="",
annotations={"start": 16393864,
"srcSize": 173908612,
"strand": -1,
"size": 46})
recs[3] = SeqRecord(Seq("TGTTGCATGTCGTTTATTCTTTGGCGTGATAGGCTCACCCAATCTT"),
id="hg18.chr6",
name="hg18.chr6",
description="",
annotations={"start": 15875298,
"srcSize": 170899992,
"strand": -1,
"size": 46})
recs[4] = SeqRecord(Seq("TGTTAAGTCTCACTTGCTGTTCAAAGTGATAGCTTCACTCCATCAT"),
id="canFam2.chr1",
name="canFam2.chr1",
description="",
annotations={"start": 78072287,
"srcSize": 125616256,
"strand": -1,
"size": 46})
recs[5] = SeqRecord(Seq("TGTTTAAAATG----ATTGCTAGAACTTCTA--CTCACTGGA----"),
id="ornAna1.chr2",
name="ornAna1.chr2",
description="",
annotations={"start": 14757144,
"srcSize": 54797317,
"strand": -1,
"size": 36})
fetched_recs = self.idx._get_record(99228)
for i in range(6):
#.........这里部分代码省略.........