-2

I have mapped a pacbio read against a reference [with minimap2] and now I have my output in Bam file. I would like to extract only the mapped reads from it. I tried bamToFastq [samtools bamtofq input.bam | seqtk seq -A > output.fa], since finally would like to have my file in fasta, but it did not work. Anyone here has a solution?

1 Answers1

0

It's a simple task with samtools. And from mapped.bam you can call fasta.

samtools view -b -F 4 file.bam > mapped.bam