salmon shell script to automate quant
1
0
Entering edit mode
4.6 years ago
amitpande74 ▴ 20

Hi, I have 56 fastq.gz file in a folder called SRR. The files are paired end data and their names are SRR8068516_1.fastq.gz to SRR8068543_1.fastq.gz. The other pair is named likewise SRR8068516_2.fastq.gz to SRR8068543_2.fastq.gz. I wrote a shell script:

#!/bin/bash
for fn in /media/usr/LaCie/data/SRR{SRR80685..SRR80685};
do
samp=`basename ${fn}`
echo "Processing sample ${samp}"
./bin/salmon quant -i /home/usr/Downloads/salmon-1.2.1_linux_x86_64/transcripts_index/ -l A -1 /media/usr/LaCie/data/SRR ${fn}/${samp}_1.fastq.gz -2 /media/usr/LaCie/data/SRR ${fn}/${samp}_2.fastq.gz -p 8 --validateMappings -o quants/${samp}_quant
done

But on executing it gives me an error:

(base) usr@usr-X705UDR:~/Downloads/salmon-1.2.1_linux_x86_64$ ./salmon.sh 
Processing sample SRR{SRR80685..SRR80685}
Version Info: This is the most recent version of salmon.
### salmon (mapping-based) v1.2.1
### [ program ] => salmon 
### [ command ] => quant 
### [ index ] => { /home/usr/Downloads/salmon-1.2.1_linux_x86_64/transcripts_index/ }
### [ libType ] => { A }
### [ mates1 ] => { /media/usr/LaCie/data/SRR /media/amit/LaCie/data/SRR{SRR80685..SRR80685}/SRR{SRR80685..SRR80685}_1.fastq.gz }
### [ mates2 ] => { /media/usr/LaCie/data/SRR /media/amit/LaCie/data/SRR{SRR80685..SRR80685}/SRR{SRR80685..SRR80685}_2.fastq.gz }
### [ threads ] => { 8 }
### [ validateMappings ] => { }
### [ output ] => { quants/SRR{SRR80685..SRR80685}_quant }
Logs will be written to quants/SRR{SRR80685..SRR80685}_quant/logs
[2020-05-02 14:03:57.281] [jointLog] [info] setting maxHashResizeThreads to 8
[2020-05-02 14:03:57.281] [jointLog] [info] Fragment incompatibility prior below threshold.  Incompatible fragments will be ignored.
[2020-05-02 14:03:57.281] [jointLog] [info] Usage of --validateMappings implies use of minScoreFraction. Since not explicitly specified, it is being set to 0.65
[2020-05-02 14:03:57.281] [jointLog] [info] Usage of --validateMappings implies a default consensus slack of 0.2. Setting consensusSlack to 0.35.
[2020-05-02 14:03:57.281] [jointLog] [info] parsing read library format
[2020-05-02 14:03:57.281] [jointLog] [info] There is 1 library.
Exception : [
The following errors were detected with the read files
======================================================
ERROR: file [/media/usr/LaCie/data/SRR{SRR80685..SRR80685}/SRR{SRR80685..SRR80685}_1.fastq.gz] does not appear to exist!

]
./bin/salmon quant was invoked improperly.
For usage information, try ./bin/salmon quant --help
Exiting.

Kindly help as to which step is not appropriate in the code.

shellscript salmon • 2.0k views
ADD COMMENT
1
Entering edit mode
4.6 years ago
ATpoint 85k
IDX="/home/usr/Downloads/salmon-1.2.1_linux_x86_64/transcripts_index/"
for fn in /media/usr/LaCie/data/SRR/SRR{80685..80685}
  do
    samp=`basename ${fn}`
    echo "Processing sample ${samp}"
    ./bin/salmon quant -i $IDX -l A -1 ${fn}_1.fastq.gz -2 ${fn}_2.fastq.gz -p 8 --validateMappings -o quants/${samp}_quant
  done

1 ) {From..To} takes integers, therefore it must be SRR{From..To}.

2) There was also a / missing after SRR and before {SRR80685..SRR80685}

3) ${fn} did already include the entire path to the basenames, you were providing it twice, this is what this line indicated:

### [ mates1 ] => { /media/usr/LaCie/data/SRR /media/amit/LaCie/data/SRR{SRR80685..SRR80685}/SRR{SRR80685..SRR80685}_1.fastq.gz }
ADD COMMENT

Login before adding your answer.

Traffic: 2957 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