Hello everyone, i am new in bash scripting, so I want your help on How to execute 100 directories with pared end _1.fastq and _2.fastq sequence files.
For indivisibly here how I am doing For 1st sample
cd SSR1
python /home/jitender/miniconda3/envs/py2/bin/after.py -1 ./SRR1/ERR13556376.lite.1_1.fastq -2 ./SRR1/ERR13556376.lite.1_2.fastq
for 2nd sample
cd SSR2
python /home/jitender/miniconda3/envs/py2/bin/after.py -1 ./SRR2/SRR13556377.lite.1_1.fastq -2 ./SRR2/SRR13556377.lite.1_2.fastq
like this i have 100 samples, for individually it is quit bit difficult or there is chance of mistake while preparing script.
So, i am trying to prepare bash script it but i am not able to understand how to proceed with. I searched online and find some solution but isn't working for me.
So, anyone out there please help me how should i proceed with.
My data folder structure following type:
main directory: Data/
Subdirectories of samples: SRR1, SRR2, SRR3, SRR4 .......SRR100.
Fastq files: sample SRR1/E12345_1.fastq, E12345_2.fastq
Thank you :)
1 answer
Not sure if I have understood your folder organisation but try to go inside your Data folder, (where all the SRR directories are located) and:
for d in SRR*/; do
# your command
python /home/jitender/miniconda3/envs/py2/bin/after.py -1 $d/*_1.fastq -2 $d/*_2.fastq
done
Hi iraun
I need one more help and suggestions above code generating QC report in my Data directory. Due to this there will be chance of replacing existing one, so Is there any code to generate QC report in same SRR* directory
Thank you vey much :)
Hey, glad that worked :). So, if I understand it, you want the output QC files inside each SRR directory? If so, I guess you could try something like:
for d in SRR*/; do
cd $d;
# your command
python /home/jitender/miniconda3/envs/py2/bin/after.py -1 *_1.fastq -2 *_2.fastq
cd ..
done
Exactly what I mean.
Thank you once again !!! :)
Log in to answer this question.