>>> import HTSeq
>>> reader = HTSeq.BAM_Reader('test.bam')
>>> for read in reader:
... pass
...
>>> read
<SAM_Alignment object: Paired-end Read 'WIGTC-HISEQ:8:2204:1251:1976#TATAAT/1;1:count=1' aligned to chr7:[5570231,5570247)/+>
Note that the strand is +
>>> read.iv
<GenomicInterval object 'chr7', [5570231,5570247), strand '+'>
Correspondingly, the SAM code is 0
'WIGTC-HISEQ:8:2204:1251:1976#TATAAT/1;1:count=1\t0\tchr7\t5570232\t255\t16M\t*\t0\t0\tACCGCCGAGACCGCGT\tgggggiiiiegiihii\tXA:i:0'
Giving a new Genomic Interval changes the output of the coordinates
>>> read.iv = HTSeq.GenomicInterval('chr7', 5570232, 5570248, '+')
>>> read.get_sam_line()
'WIGTC-HISEQ:8:2204:1251:1976#TATAAT/1;1:count=1\t0\tchr7\t5570233\t255\t16M\t*\t0\t0\tACCGCCGAGACCGCGT\tgggggiiiiegiihii\tXA:i:0'
But changing the strand of the genomic interval does not change the SAM code to 16 (the "reverse complement" SAM code, which I think it should)
>>> read.iv = HTSeq.GenomicInterval('chr7', 5570232, 5570248, '-')
>>> read.get_sam_line()
'WIGTC-HISEQ:8:2204:1251:1976#TATAAT/1;1:count=1\t0\tchr7\t5570233\t255\t16M\t*\t0\t0\tACCGCCGAGACCGCGT\tgggggiiiiegiihii\tXA:i:0'