STAR for Multiple smRNA FastQ Files

296 views
Skip to first unread message

Oladele Oluwayiose

unread,
Mar 30, 2021, 10:40:22 AM3/30/21
to rna-star

Hey Alex,

I just noticed I should have sent my question to the group instead of sending to your email directly, sorry about that.

 I am working to do a step-wise alignment our small RNAseq data to miRNA, piRNA and then other small RNAs (like snoRNA, tRNA etc)

I have tried the following code but can’t seem to figure out a way to make it address all my questions. Here are what I wish to achieve: 

  1. Aligning multiple fastQ files (my sample size in 100) and outputting the uniquely mapped reads separately for each sample in the result folder at the same time.
  2. Since this is small RNAs there are multiple mapping reads, so I would love to assign them to give one unique read and be added to my total  unique reads from above. 
  3. I would like to store all unmapped reads (of one mapping step e.g miRbase) as bam files in separate directory which will be used for my subsequent mappings (e.g piRBase). 

STAR --genomeDir /path/to/index/ 

--runThreadN 40

--readFilesIn /path/to/index/.fastq 

--outFilterMismatchNoverLmax 0.05 

--outFilterMatchNmin 16 --outFilterScoreMinOverLread 0 --outFilterMatchNminOverLread 0 

--alignIntronMax 1 

--outMultimapperOrder Random --runRNGseed 2021 --outSAMmultNmax 1 

--seedSearchLmax 28 --seedSplitMin 9 

--outFileNamePrefix /path/to/indexoutput/ 

--outSAMtype BAM SortedByCoordinate

--outSAMunmapped Within KeepPairs 

--outSAMattributes Standard


Your assistance with this will be highly appreciated!


Best,

Oladele

Alexander Dobin

unread,
Mar 31, 2021, 5:24:11 PM3/31/21
to rna-star
Hi Oladele,

1. You would need to run a loop over your files, changing the --outFileNamePrefix for every input file.
2. --outMultimapperOrder Random --runRNGseed 2021 --outSAMmultNmax 1 
will output one alignment per read, for both unique and multi-mapping reads.
3. --outSAMunmapped Within  (you do not need KeepPairs for single-end reads) will store unmapped reads in the BAM file.
You can get unmapped files from the BAM files with samtools, I think it's
samtools view -F0x2 Aligned.sortedByCoord.out.bam > Unmapped.bam

Cheers
Alex

Reply all
Reply to author
Forward
0 new messages