how to run RSEM with more paired end fastq files?
1
0
Entering edit mode
5.0 years ago
John ▴ 270

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.6k views
ADD COMMENT
0
Entering edit mode
5.0 years ago
h.mon 35k

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

ADD COMMENT

Login before adding your answer.

Traffic: 2372 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6