This is a test version of Biostars. For the public version, visit https://www.biostars.org.
how to run RSEM with more paired end fastq files?

Hi there,
I used the following code for running RSEM continuously for 100 paired end reads. but it didn't work.

for i in $(ls datafolder);
do
  rsem-calculate-expression --append-names --paired-end --bowtie2 -p 7 \
  datafolder/${i}_1.fq \
  datafolder/${i}_2.fq \
  /referencefolder/mouse ${n};  
done;

file names are like 1234_1.fq, 1234_2.fq; this code takes the file name as 1234_1.fq_1.fq, 1234_1.fq_2.fq ; I don't know what's wrong. please help!

rna-seq rna-seq sequencing r

1 answer

There are numerous posts about bash and for loops, please search the site to find solutions. I will point some errors:

for i in $(ls datafolder);

$(ls datafolder) is error prone, it doesn't correctly parse filenames with spaces, and includes all files and folders under datafolder. I would do:

for i in datafolder/*_1.fq

Then, ${i}_1.fq and ${i}_2.fq will translate into 1234_1.fq_1.fq and 1234_1.fq_2.fq because ${i} is 1234_1.fq.

${n} is not defined anywhere.

edit: some pointers

bash loop for alignment RNA-seq data

For loop script

HISAT2 for loop shell scripting

Log in to answer this question.