-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for output to BAM #95
Comments
Thanks! I'll try to work on it this week. Please submit a PR if you figure out the solution. |
just a comment for those of you (like myself) who would try to use some FIFO magic for this: solving it as something like
Also crashes when using |
Hi @plijnzaad - writing to BAM is not currently supported, and I'm still debating whether or not to add it. For now you can workaround this by writing SAM to stdout and piping it to samtools -Sb. Regarding the FIFO issue - can you please try again after installing bamnostic? atropos will use bamnostic first if it's installed and it should avoid most of the issues that exist with pysam. Thanks |
Hi, I installed bamnostic (version 1.1.4) and it finds it etc. but it still doesn't work. With bamnostic, atropos again crashes on input bam files that contain
it again crashes with Using |
This appears to be a problem with your bamfile. When I converted it to SAM and then back to BAM it worked fine ( To get output to stdout, you just need to not specify the -o option. You should be able to specify
|
Specifying stdout/stderr is now fixed in develop. |
Brililant, seems to work fine, many thanks. I realized that I overlooked the fact that leaving out the Still puzzled about the bam-formatting error that trips bamnostic up, I'll have another look. (PS: your example conversion gets rid of all header lines, so doesn't say much) |
Weirdly, converting (to SAM) the original bam and the reformatted (bam->sam->bam) versions are identical. I also did a strict check with ValidateSamFile from picardtools-2.21.1, both bams give identical (and harmless) warnings. My conclusion is that bamnostic is broken. Is there a way to make atropos prefer pysam over bamnostic (other than uninstalling bamnostic) ? |
The error is "Malformed BGZF block" so it's not a difference in the contents but with the compression of the data. I will add a new issue to enable the choice of BAM reading library to be configurable. For the time being, the solution is just to pip uninstall bamnostic. |
Brilliant, thanks! |
I just fixed the File Not Found (issue #86) a bit (see my pull request), but whereas it seems to now be able to read sam and bam files, it can only write sam, not bam:
/Users/philip/tmp/atropos.fix/bin/atropos -a RA5=GATCGTCGGACTGTAGAACTCTGAAC -se grep_adapt.bam -o trimmed4.bam --report-file summary5.txt --input-format bam --output-format bam
With atropos
2.0.0a5.dev1+g3aa3791
, Python 3.7.7, pysam version '0.15.4' , Cython version 0.29.16 ), this yieldsUnknownFileTypeError: File format <SequenceFileType.BAM: ({'.bam'}, False)> is unknown (expected 'fasta' or 'fastq')
.For details see this attachment
The text was updated successfully, but these errors were encountered: