samflags to removes mapped concordantly >1 times
0
0
Entering edit mode
25 days ago

Hi Biostar users and all expertise,

I am working on a shotgun metagenome, and the problem is that after I assembly all the metagenome contigs for binning, the part of mapping contigs back to short reads using bowtie2 to select only mapped reads to calculated coverages before constructing MAGs by SAMtools defines SAMflags.

bowtie2 -x assembly -q -1 ../data/"$sample"_1.fastq.gz \
           -2 ../data/"$sample"_2.fastq.gz -p 4 \
           -S "$sample".sam

And i got the result shown as enter image description here

According to this result, I want to include:

  1. aligned concordantly exactly 1 time: 33,370,138
  2. aligned discordantly: 5,826,320
  3. aligned exactly 1 time: 3,754,497 All total reads I want will be 42,950,955

To select these mapped reads, I have been searching for the solution in every platform, and I tried several SAMflags, but I still did not get what I wanted.

For example,

  • -F 2308: 57,247,551 (Exclude ReadUnmapped, SecondaryAlign, SupplementartyAlign)
  • -F 256: 78,379,286 (Exclude SecondaryAlign)
  • -f 3: 45,304,840 (Include ReadPair,ReadMapped)
  • -f 8: 21,131,735 (Include MateUnmapped)

In conclusion, I can not exclude those "align concordantly >1 time", which I thought were considered secondary alignment; we can see surely that they are not because the SAMflags did not exclude them. So I can not find the right SAMflags to exclude them and get only what I want.

If anyone has experience with potential solutions to this issue, I would greatly appreciate your guidance.

samtools Bowtie2 Metagenome • 190 views
ADD COMMENT
0
Entering edit mode

This isn't really a samtools problem as it is due to the SAM file format specification. It simply doesn't distinguish between single and multiple mappings when it comes to the FLAG field so using -F to filter here is impossible.

There are some auxiliary tags which you may be able to flter on, but you'd need to look at the bowtie documentation or experimentally search through some example output. Eg maybe it's about to output the number of hits, or possibly it's related to SA and/or XA tags? I'm not certain as I don't know bowtie.

ADD REPLY

Login before adding your answer.

Traffic: 2616 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