Partition reads in BAM file by MAG
1
0
Entering edit mode
13 months 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 • 506 views
ADD COMMENT
0
Entering edit mode
11 months ago

I'd use Seal from the BBTools package...

seal.sh 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.

ADD COMMENT

Login before adding your answer.

Traffic: 1179 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

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

Powered by the version 2.3.6