I would like to use samtools depth in a pipeline to grab strand-specific coverage from a given interval, where the bam comes from STDIN. I thought that all of the samtools tools accepted STDIN data with the "-" switch. But, the following code fails with message "open: No such file or directory":
It won't work for cases where the tool tries to look for .bai index files based on the name (which in this case would only happen if you try to analyze a specific region with the -r flag), but it will work for the example you've given.
great, works like a champ! Analysis of a specific region is easily accomplished from the upstream samtools view call, so no need to use the depth option -r
great, works like a champ! Analysis of a specific region is easily accomplished from the upstream samtools view call, so no need to use the depth option -r