nilesh-iiita / pysam

Automatically exported from code.google.com/p/pysam
0 stars 0 forks source link

adding read group fails on longer sam records #115

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.

  print("before append of ",rg,len(read.tags),read.tags)
  read.tags=read.tags+[("RG",rg)]
  print("after append of ",rg,len(read.tags),read.tags)
  outfile.write(read)
The rg in the bam file does not match the rg appended when there is a
long sam record being updated.

2. The append works on most reads. It is only when then sam record length is 
greater than about 520+ characters. This longer length seems to happen when bwa 
indicates multiple alternate mapping locations. It looks like there is not 
enough memory for the append in these cases and something is getting clobbered. 

What is the expected output? What do you see instead?
This is the option list before and after the append.
('before append of ', 'HS2000-899_199.L3', 10, [('XC', 85), ('XT', 'M'), ('NM', 
5), ('SM', 29), ('AM', 29), ('XM', 1), ('XO', 1), ('XG', 4), ('MD', 
'37^ACCC29T18'), 
('XA','5,+11707,36M1I48M,2;21,-48119779,46M1I38M,2;hs37d5,-10060835,40\
M1D45M,3;5,+11508,36M1I48M,3;hs37d5,+6743812,36M1I48M,3;19,-59118894,46M1I38M,3;
4,-191044002,6M1I78M,3;')])
('after append of ', 'HS2000-899_199.L3', 11, [('XC', 85), ('XT', 'M'), ('NM', 
5), ('SM', 29), ('AM', 29), ('XM', 1), ('XO', 1), ('XG', 4), ('MD', 
'37^ACCC29T18'), 
('XA','5,+11707,36M1I48M,2;21,-48119779,46M1I38M,2;hs37d5,-10060835,40M\
1D45M,3;5,+11508,36M1I48M,3;hs37d5,+6743812,36M1I48M,3;19,-59118894,46M1I38M,3;4
,-191044002,6M1I78M,3;'), ('RG', 'HS2000-899_199. \x01')])

Instead of RG should be HS2000-899_199.L3" instead of "HS2000-899_199. \x01"

What version of the product are you using? On what operating system?
pysam-0.7
redhad linux

Please provide any additional information below.
Python 2.7

Original issue reported on code.google.com by john.jos...@gmail.com on 2 Mar 2013 at 6:18

GoogleCodeExporter commented 9 years ago
Thanks!

Using your example as much as following, the following works for me:

rg = 'HS2000-899_199.L3'
r.tags += [("RG",rg)] * 100

Could you please provide a complete example?

Thanks,
Andreas

Original comment by andreas....@gmail.com on 27 Jun 2013 at 2:11

GoogleCodeExporter commented 9 years ago
Closed, can't reproduce myself.

It might have been fixed.

Original comment by andreas....@gmail.com on 18 Sep 2013 at 7:11