Partition reads in BAM file by MAG
Entering edit mode
12 weeks ago
Gio • 0

Hi all,

I have bins representing MAGs. I am now interested in partitioning the reads in my BAM files by MAG. The way I believe this should work is to try and map every read onto the MAG, asses whether it maps or not, and then if it does add a tag to it.

What would be the best way to do this while staying in the BAM format? My goal is to use other tools that will use this partition tag later.

metagenome reads BAM MAG • 303 views
Entering edit mode
6 weeks ago

I'd use Seal from the BBTools package... in=reads.fq.gz pattern=out_%.fq.gz *.fna k=31 outu=unmatched.fq.gz

...where you are assumed to have a bunch of fasta files, one per MAG, in the working directory. Of course that loses bam format which you wanted to keep, but... it accomplishes the goal of partitioning. You can always map them again afterward. IMO fastq is a better format than bam anyway since it makes it much easier to keep paired reads together and doesn't ruin their original headers. Fastq records have their original sequence associated with them (bam records may not have any sequence associated, let alone the original sequence), retain their original orientation, it's human-readable, supports unlimited sequence and header length, etc. Bam is a format that supports none of those things while taking more space than gzipped fastq.


Login before adding your answer.

Traffic: 873 users visited in the last hour
Help About
Access RSS

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6