With help from Rfam team, I was able to detect four group II introns, in 3 out of 62 rRNA gene sequences, as matches to RF00029, using Infernal suite's cmscan on the command line, with syntax similar to the example at this Rfam weblink.
So some rRNAs can be spliced (3 out of 62), while most are not spliced (rest 59 of 62), at least in this plant species under consideration.
I then used kmercountexact.sh from BBtools ver 38-72 to obtain kmer sequences of varying k=13, 20, 31, 40, 50 from either
- just 4 intron sequences
- 62 UNspliced rRNA sequences
- SPLICED rRNA sequences (of which only 3 contain introns)
With a simple Perl script, I added unique FASTA headers to these files, and mapped each of those files to the reference genome, using STAR aligner (can share genome indexing and mapping syntax if you wish).
A summary of how many of those mapping go to mRNA encoding vs. ncRNA encoding (rRNA etc) genomic loci is shown in the image below: 
Would you concur with my conclusions from these results:
- k-mers from SPLICED rRNA genes still map to mRNA encoding genic regions of the reference genomes even at k=50 (45), with only marginally higher instances of genic mapping at lower k-mer lengths of 40 (50), 31 58), but somewhat higher at k-mer=20 (99).
- The shortest read length I've allowed until this step is 20nt. So using k-mer > 20nt will result in some marginal loss of RNA-Seq reads < k-mer length.
- In silico splicing of rRNA gene sequences (3 / 62) does not appear to signifcantly reduce mapping of k-mers to genic regions in the reference genome at all.
- A strategy other than increasing k-mer length is required for mapping rRNA derived kmers to just rRNA genes.
Assuming those conclusions are correct, I proceeded with BBsplit.sh, per your recommendation, using the following generic syntax:
bbsplit.sh in=$IN \
ref=MtrunA17r5.0-ANR-EGN-r1.6.rrna_SPLICED.shIDs.fna \
basename=$BASENAME_%.fq.gz outu=$OUTU
Xmx24g threads=1 minratio=0.90 minhits=1 maxindel=200000 strictmaxindel=t
deterministic=t showprogress=100000 k=15
- I varied
minratiowith values of 0.90, 0.95 and 0.99 - I also varied
minhitswith values of 1, 2, 3,5 and even 10 (this gave empty file) - I used either
k=15or bloom filter kmer asbloomk=31
I then converted $OUTM from BBsplit.sh, with matches to the SPLICED rRNA sequences
from FASTQ to FASTA format, using reformat.sh
Use this FASTA file as input to Rfam/Infernal against a very small subset of rRNA CMs to check whether all instances of rRNA reported by bbsplit.sh are indeed rRNA sequences, using cmscan.
These take a while to run (~ 1 day for 125K sequences).
IMPORTANTLY, In one such bbsplit $OUTM file, cmscan found only ~ 88% of reported reads to match rRNA profiles. So it appears bbsplit.sh is reporting ~12% false positives rRNA matches?
My questions to you are these:
- What other parameters can I vary to bring this FPR as close to 0% as possible?
- Can
kmervalue be increased beyond the 8-15 range currently allowed forBBmapandBBsplit? - Should I instead look more carefully into BLOOM filter option(s)?
- Should I systematically look into FPR for various 1<=minhits
<=
kmerorbloomk? - Some other idea(s)?
- Essentially, could you please advice how I can remove all rRNA mapping reads, but not other reads, prior to transcriptome assembly? Thanks!
HAPPY HOLIDAY SEASON! :)
For number 1: I don't think there would be a specific reason to choose one over other.
For number 4: You may need to adjust bbmap alignment parameters. Make alignments more or less stringent. Reduce value of
k=to allow for more accurate matches.OR you could align your data to human rDNA repeat I linked in the post you have above. Get an idea of % reads aligning there. This is to make sure the % is relatively same across samples (should be less than 5% if the libraries are ribodepleted/poly A entiched). In the final counting step ignore rRNA reads (don't count).