Hey!
I am using pysam iterator like this:

alignments = pysam.AlignmentFile("file.bam", "rb")
for line in alignments.fetch(until_eof=True):
    print(line)
    break

Output looks like this:

HISEQ:157:HAM0GADXX:1:1101:1635:2143    16  15  73530482    42  102M    -1  -1  102 TGGTGGGAAGGTTTGCTCTTCACCAATTAACGAAGGATGGGTAAGGAAGTTAGTTGGTGGTTGGACTCTGCTCTCAGATTCAACCCTCCCTAGCCTTCTATT  array('B', [22, 33, 33, 33, 37, 37, 37, 37, 37, 37, 37, 37, 40, 40, 37, 37, 27, 37, 33, 33, 33, 27, 37, 37, 33, 37, 40, 40, 40, 40, 40, 40, 37, 40, 40, 40, 37, 33, 40, 40, 40, 40, 40, 40, 40, 37, 40, 40, 40, 40, 37, 37, 40, 37, 40, 37, 37, 27, 37, 37, 33, 37, 37, 33, 27, 37, 37, 37, 37, 37, 37, 37, 33, 37, 37, 37, 37, 33, 33, 33, 37, 37, 37, 37, 40, 40, 37, 33, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 33, 33, 33])    [('AS', 0), ('XN', 0), ('XM', 0), ('XO', 0), ('XG', 0), ('NM', 0), ('MD', '102'), ('YT', 'UU')]

I thought that chromosome number is on third position in line which in this example is 15, but after further analysis I think I am wrong.
Maybe someone know?
Kindly help.



Source link