Biostar Beta. Not for public use.
Question: How to run STAR for multiple fastq files without overwriting?
0
Entering edit mode

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

ADD COMMENTlink 10 months ago gokberk • 30
3
Entering edit mode

but could not solve the issue.

Please, could you argument the above ?

Did you try something like :

--outFileNamePrefix SRR2930_${i}
ADD COMMENTlink 10 months ago Bastien Hervé 4.2k
Entering edit mode
0

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 10 months ago
gokberk
• 30
Entering edit mode
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 10 months ago
genomax
68k
Entering edit mode
0

I always forget the brackets but they are good practises indeed

ADD REPLYlink 10 months ago
Bastien Hervé
4.2k

Login before adding your answer.

Similar Posts
Loading Similar Posts
Powered by the version 2.0