Hi,
I have modified the code to deal with the change in pysam behavior, and hope this can help others.
Basic changes
1) Change in how the reference names are handled.
2) Change .qpos to .query_position_or_next which looks to have the same behavior.
I would appreciate someone testing if this is indeed the case.
/Alistair
rrefs={}
ridxinfo=pysam.idxstats(bamfile).split('\n')
for j in ridxinfo:
# print 'J' + j + 'J' + '\n'
l=(j.strip()).split('\t')
if l[0]=='': continue
if l[0]=='*': continue
if int(l[2])+int(l[3]) > 0: rrefs[l[0]]=int(l[1])
for pileupread in pileupcolumn.pileups: # per ogni base dell'allineamento multiplo # SVI Alistair comments: Pysam release has changed the behavior of .query_pos to .query_position # query_position_or_next looks like it is the actual backwards compatible version of this which I am using. #print 'PILEUPREAD ' #print pileupread #print pileupread.query_position #print pileupread.query_position_or_next # Backwards compatibility #if pileupread.query_position
s,q,t,qq=pileupread.alignment.seq[pileupread.query_position_or_next].upper(),ord(pileupread.alignment.qual[pileupread.query_position_or_next])-QVAL,'*',pileupread.alignment.qual[pileupread.query_position_or_next]
Hi,
many thanks for your work! I may ask people in our group to do some tests...and then release all files.
I'm thinking to rewrite REDItools to make them more efficient. If interested, please contact me at ernesto.picardi@uniba.it
Best,
Ernesto