This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Unmapped Pairs in Bam file

Hi,

I want to work with unmapped reads in BAM file(generally listed at the end of the file). I can easily collect them with flags. My problem is that I need make indexing for unmapped reads, thank you!

bam assembly alignment next-gen

What do you mean by "make indexing for unmapped reads"? You can index a BAM file with unmapped reads, that's not an issue.

I want to make an assembly with these unmapped reads for such as insertions etc.

1 answer

samtools fastq -f 12 -n -1 read1.fastq -2 read2.fastq input.bam

I presume this needs to be name sorted (samtools sort -n) first.

The samtools fastq command produces one or more fastq files from a BAM file. The -f 12 option specifies only entries with neither mate mapped.

Log in to answer this question.