I am interested to look at the output of the unmapped reads which I obtained after STAR alignment
Unmapped.out.mate1 Unmapped.out.mate2
and use this to BLAST the unmapped reads against the full NCBI database to see if there are any hits or just rRNA contamination? Could anyone please let me know how to do this with this output?
Convert the unmapped BAMs to fasta (see how here) and blast the fasta.
However, if you have too many unmapped reads, the blast will take forever. A faster alternative would be to download rRNA database, convert the unmapped BAMs to fastq and use FastQ_Screen (or Bowtie / BWA / your preferred mapper directly) to estimate rRNA contamination.