appropriate way to use pysam.depth
What is the right way to use pysam.[some tool]
This for example works,
merge_parameters = ["-@", "4", "-r", output] + input_bam
pysam.merge(*merge_parameters)
But this does not work:
depth = [my_input_bam] + [">", "my.depth"]
pysam.depth(*depth)
Nor this works:
pysam.depth(my_input_bam, ">", "my.depth")
Error will be:
pysam.utils.SamtoolsError: 'samtools returned with error 1: stdout=,
stderr=samtools depth: Could not open ">": No such file or
directory\n'
Is there a special way to use pysam.depth? (how to use pysam.tool the correct way)
• 4,709 views
•
link
0 answers
No answers yet.
Log in to answer this question.
Hey Medhat ,
I guess the order of arguments matters and must fit the needs of the
samtoolsprogram. Forsamtools mergethis would be:As you see the output is not streamed here and a file must be given explicit.
fin swimmer
Thanks,
The merge in my case is working while
pysam.depthis the one that does not work.I found that the way to write out the result of
pysam.depth:Which is not convenient.
Is there a better way?
you can parse the output into a dataframe