Thank you! But was there something wrong with the prior answer you had?
• 1 views
•
link
Hi,
I'm wondering how one would go about streaming the followings samtools commands without the intermediate bam and sam files.
samtools view -F 4 -b in.bam > filtered.bam
samtools sort filtered.bam filtered_sorted
samtools view filtered_sorted.bam > filtered_sorted.sam
awk -F "\t" '{print $3}' filtered_sorted.sam > rnames.txt
I'd appreciate any help!
samtools view -b -F 4 in.bam | samtools sort -o - TMP | samtools view - | awk '{ print $3}' > rnames.txt
rm TMP
Log in to answer this question.