Question: How to run STAR for multiple fastq files without overwriting?
0
gravatar for gokberk
8 months ago by
gokberk60
gokberk60 wrote:

Hi all,

I'm new to RNAseq data analysis and want to generate BAM files from 204 fastq files. So, I wrote a very basic for loop to run the same command for all my fastq files. However, since STAR saves every BAM file with the same name, I'm having an overwriting problem. Here is the code that I run:

for ((i=102; i<=305; i++)); do ./STAR --readFilesIn fastq/E08/SRR2930$i.fastq --outSAMunmapped Within --outSAMtype BAM SortedByCoordinate --outSAMmultNmax 1 --genomeDir STARindex --twopassMode Basic --runThreadN 12; done

I tried --outFileNamePrefix option as well, but could not solve the issue. I'd be glad if you could help me with this.

Cheers, Gökberk

star • 551 views
ADD COMMENTlink written 8 months ago by gokberk60
1

(Not exactly answer) You can speed up your command. Your command doesn't mention the "--genomeLoad" method. In that case STAR defaults "NoSharedMemory" i.e loading the index and removing each time you run the command. You can take a look at this post STAR genomeLoad issue.

ADD REPLYlink modified 4 months ago • written 4 months ago by xenon10
3
gravatar for Bastien Hervé
8 months ago by
Bastien Hervé4.5k
Limoges, CBRS, France
Bastien Hervé4.5k wrote:

but could not solve the issue.

Please, could you argument the above ?

Did you try something like :

--outFileNamePrefix SRR2930_${i}
ADD COMMENTlink modified 8 months ago • written 8 months ago by Bastien Hervé4.5k

Previously, I tried --outFileNamePrefix $i, but that didn't work for some reason. now I tried --outFileNamePrefix SRR2930$i and it worked fine, thanks a lot!

ADD REPLYlink written 8 months ago by gokberk60
2

$i needs to stay connected to the other word for it not to be treated as a different option. You may want to use --outFileNamePrefix SRR2930_${i} so the names are easier to read.

ADD REPLYlink written 8 months ago by genomax75k

I always forget the brackets but they are good practises indeed

ADD REPLYlink written 8 months ago by Bastien Hervé4.5k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1845 users visited in the last hour