Use samtools to Count the read which Counter tools cant Count.

Hi
if there is a low MAPQ in my reads . someone tells me to Use samtools view in.bam "chr1:234-567" to explore the reads in the region of the gene.

he said : Your read counter might be refusing to count reads that do not align uniquely. this tool will let you count reads in the region, even if your read counter won’t assign them to a gene.
but i dont know how do it in galaxy ? im be grateful if someone can help me .
this is our conversation link : https://www.biostars.org/p/381880/

1 Like

Hi,
two things:

  1. to answer the question you are asking here. If you already know how to inspect your reads with IGV (as you’re mentioning in your linked post on biostars), there isn’t anything samtools view could tell you in addition. If you hover over any read of interest in IGV (depending on your setting you may also have to click on it), you should get a pop-up info window that also has the info about the read’s MAPQ score.
    samtools view is not directly available through Galaxy as a dedicated tool. To get the functionality you want you could combine the tools Slice Bam and BAM-to_SAM, where the first one allows you to extract the reads mapping to a particular region, but outputs them in binary format, while the second tool would turn that output into the same text format that you’d get with samtools view as suggested to you.
  2. There are lots of reasons why specific reads may not be counted by featureCounts and some of them can be controlled through the Options for paired-end reads and the Advanced options of the Galaxy tool. In particular, check these settings:
  • Exclude chimeric fragments: if set to True, then paired-end reads will only be counted if both mates map to the same chromosome

  • Count multi-mapping reads/fragments: if disabled, then any reads mapping ambiguously to more than one location will not get counted

  • Minimum mapping quality per read: if the aligner gave the mapping of the read a MAPQ score less than the threshold you set here, the read will not get counted.

    In addition, the last two settings above can be somewhat confusing when you align with STAR because STAR uses a very simplified MAPQ scoring scheme, in which it assigns MAPQ 255 to every uniquely mapping read. Reads that map ambiguously to 2 locations get MAPQ 3, those with 3 or 4 mappings get MAPQ 1, and those with 5+ mappings get assigned MAPQ 0. This means that if you use STAR for alignment and go with the default Minimum mapping quality per read of 12 in featureCounts, you will, effectively, ignore all multimapping reads even if you enable Count multi-mapping reads/fragments.

2 Likes

hi. thank you for your complete answer. just one thing… what tool you suggest for this type mapping ? Hisat2 is fine or what ?

1 Like

Don’t get me wrong: the above was not meant to discourage you from using STAR. It’s a good aligner, better than HISAT2 in many situations (see e.g. https://www.biostars.org/p/288726/).
You just need to be aware of its particularities when combining it with other tools (like featureCounts).

1 Like

Oh, and one more thing I just realized:
It’s not true that Galaxy doesn’t offer samtools view. It’s just not called that way, but this tool -> https://usegalaxy.org/root?tool_id=toolshed.g2.bx.psu.edu/repos/devteam/samtool_filter2/samtool_filter2/1.8 is essentially it. So you can perform your read filtering in one step if you want to. Just make sure you Select the output format to be SAM.

1 Like