示例#1
0
 def test_readsHeaderFromBamFile1Correctly(self):
     bf = BamFile('Tests/Bam/bam1.bam')
     bf.readHeader(bf.generator())
     assert bf.file_chromosomes != []
示例#2
0
 def test_getBamRecordsFromInvalidBamFileThrows(self):
     bf = BamFile('Tests/Bam/ex1.bam')
     with pytest.raises(PybamWarn):
         for _ in bf.getBamRecords():
             print('help!')
示例#3
0
 def test_getFileChromosomesFromFile2Correctly(self):
     bf = BamFile('Tests/Bam/bam2.bam')
     for sequence in bf.getBamRecords():
         assert sequence.sam_rname(
             bf.file_chromosomes) == '*' or sequence.sam_rname(
                 bf.file_chromosomes).decode("utf-8") == '1'
示例#4
0
 def test_getFirstSequenceFromFile2Correctly(self):
     bf = BamFile('Tests/Bam/bam2.bam')
     records = bf.getBamRecords()
     record = next(records)
     # the known value of the first sequence
     assert record.sam_seq == 'GTTGTTTCTTCCTTTTTTCCCCTCTTCCCCTTCCTGTCTTGTGTTTTTTCTGAACCCCACATCTGCCATCATTTCTCTCCTCTAGAGTCCCTTGCTTCTGC'
示例#5
0
 def test_getBamRecordsFromBamFile2Correctly(self):
     bf = BamFile('Tests/Bam/bam2.bam')
     for sequence in bf.getBamRecords():
         assert sequence.bam_qname.decode("utf-8").startswith(
             'HWI-1KL120:88:D0LRBACXX:1:1101:')
示例#6
0
 def test_getFirstSequenceFromFile1Correctly(self):
     bf = BamFile('Tests/Bam/bam1.bam')
     records = bf.getBamRecords()
     record = next(records)
     # the known value of the first sequence
     assert record.sam_seq == 'GAGAGGTCAGCGTGAGCCCCTTGCCTCACACCGGCCCCTCTCACGCCGAGAGAGGTCAGCGTGAGCCCCTTGCCTCACACCGGCCCCTCCCACGCCGAGAG'