Closed GoogleCodeExporter closed 8 years ago
Thanks for bringing this to our attention. Unfortunately there is no elegant
way to fix it. Pysam forwards the call of pysam.index to samtools bam_index().
The
latter returns an error if the options are invalid, but not if
there is an error in the actual processing. This affects more than just
bam_index().
I have added a patch to the repository that raises an SamtoolsError if
samtools outputs on stderr. NB: This might cause other problems as samtools
writes to stderr for simple information messages.
Original comment by andreas....@gmail.com
on 24 Oct 2009 at 1:11
Indeed, it fails for sort
if stderr: raise SamtoolsError( "\n".join( stderr ) )
pysam.pysam.SamtoolsError: '[bam_sort_core] merging from 4 files...\n'
Guess we should stick to returncode != 0 and forward the bug upstream to
samtools?
Original comment by finkerna...@mathematik.uni-marburg.de
on 26 Oct 2009 at 6:53
[deleted comment]
Original comment by andreas....@gmail.com
on 4 May 2010 at 4:55
[deleted comment]
[deleted comment]
[deleted comment]
This bug has not been fixed in PySam v0.3.1!
There is still and error in PySAM v0.3.1 regarding bam_sort_core! The error
message is:
'pysam.SamtoolsError: '[bam_sort_core] merging from 2 files...\n'
The lines in file '__init__.py':
============================================================
....
stderr = [ x for x in stderr \
if not x.startswith( "[sam_header_read2]" ) or \
x.startswith("[bam_index_load]") or \
x.startswith("[bam_sort_core]") or \
x.startswith("[samopen] SAM header is present")
]
...
============================================================
should be changed to:
============================================================
...
stderr = [ x for x in stderr \
if not (x.startswith( "[sam_header_read2]" ) or \
x.startswith("[bam_index_load]") or \
x.startswith("[bam_sort_core]") or \
x.startswith("[samopen] SAM header is present"))
]
...
============================================================
Original comment by enxx...@gmail.com
on 19 Nov 2010 at 11:55
Thanks,
hopefully finally finally fixed in version 0.4
Added unit test
Bw,
Andreas
Original comment by andreas....@gmail.com
on 10 Feb 2011 at 11:01
Original issue reported on code.google.com by
finkerna...@mathematik.uni-marburg.de
on 21 Oct 2009 at 3:25