예제 #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'