Aligning multiple fastq files with genome in one script/one line with STAR

Hi there! This is probably a VERY basic question but I don’t have the best terminal skills so I’m struggling a little.

I want to apply what I wrote below for all my fastq scripts without doing a for loop or manually writing the code for each (ideally they all run in parallel, or at least in the same script):

STAR --runThreadN 12  --genomeDir /scratch/eg5/trial2/align/sequence/STARindex --readFilesCommand gunzip -c --readFilesIn /scratch/eg51/trial2/trimmed_files/SRR12045658_1_trimmed.fq.gz --sjdbGTFfile /scratch/eg51/trial2/align/annotation/genes/GRCm39.ens.gtf  --outFileNamePrefix /scratch/eg51/trial2/align/results/STARresults --limitGenomeGenerateRAM 32000000000  --outSAMtype BAM SortedByCoordinate 

I tried to use *.fq.gz, but that did not work and I couldn't specify the outFileNamePrefix as/ “*

STAR --runThreadN 12  --genomeDir /scratch/eag519/trial2/align/sequence/STARindex --readFilesCommand gunzip -c --readFilesIn /scratch/eag519/trial2/trimmed_files/*.fq.gz --sjdbGTFfile /scratch/eag519/trial2/align/annotation/genes/GRCm39.ens.gtf  --outFileNamePrefix /scratch/eag519/trial2/align/results/STARresults/* --limitGenomeGenerateRAM 32000000000  --outSAMtype BAM SortedByCoordinate 

I also tried putting all the files in the same line but that resulted in the following error :

“SOLUTION:specify only one or two files in the –readFilesIn option. If file names contain spaces, use quotes: “file name” “

 STAR --runThreadN 12  --genomeDir /scratch/eag519/trial2/align/sequence/STARindex --readFilesCommand gunzip -c --readFilesIn /scratch/eag519/trial2/trimmed_files/SRR12045658_1_trimmed.fq.gz, /scratch/eag519/trial2/trimmed_files/SRR12045661_1_trimmed.fq.gz, /scratch/eag519/trial2/trimmed_files/SRR12045664_1_trimmed.fq.gz, /scratch/eag519/trial2/trimmed_files/SRR12045667_1_trimmed.fq.gz --sjdbGTFfile /scratch/eag519/trial2/align/annotation/genes/GRCm39.ens.gtf  --outFileNamePrefix /scratch/eag519/trial2/align/alignmentresults/STARresults --limitGenomeGenerateRAM 32000000000 --outBAMsortingThreadN 4 --outSAMstrandField intronMotif --outFilterIntronMotifs RemoveNoncanonicalUnannotated --outSAMattributes All --outSAMtype BAM SortedByCoordinate 

Anyone have any ideas? ie how to enter all the files in , and then have them output with their own file names. Sorry I’m sure this is a very basic question .

Read more here: Source link