I want to use pysam(a module for reading, manipulating and writing genomic data sets) to get the fastq file from the sam file without samtools as well as shell '>' operation.
I guess the command may be like this
pysam.fastq(.....,"xxx.sam")
My sam file is single-end, so I use '-s' but the result outputs to standard output.
What have you tried and what happened?
And what's the reason you don't want to use samtools
I'd suggest:
I use the following in my python script
pysam.fastq("-s","xxx.fastq","xxx.sam")
and there is a file named "xxx.sam"but it is Zero bytes.I also try this command
samtools fastq -s xxx.fastq xxx.sam
The fastq fromat data is the standard output, and there is a file named "xxx.sam" with Zero bytes as well.I would like to write a python script by pysam with lots of complex filtering steps which include a step of "sam "to "fastq". It ls said that Pysam can use samtools commands(but I only find an example of sort in the manual).
If I am not able to find a solution of this question,I may put samtools in the software requirement list and use the ">" at last. Thank you~
Please use
ADD COMMENT/ADD REPLY
when responding to existing posts to keep threads logically organized.