Help writing this shell for salmon quantification?

Noob: Help writing this shell for salmon quantification?


I am a total noob here trying to analyze my RNA seq data. I’ve just started trying to use Salmon for my quantifications, and wanted to use their suggested script for running all of the samples in a loop instead of having to type them all in.

for fn in data/DRR0161{25..40};
samp=`basename ${fn}`
echo "Processing sample ${samp}"
salmon quant -i athal_index -l A 
         -1 ${fn}/${samp}_1.fastq.gz 
         -2 ${fn}/${samp}_2.fastq.gz 
         -p 8 --validateMappings -o quants/${samp}_quant

However, whenever I try to edit the script for my own files, it gives me an error that basically involves it formatting the file names incorrectly (example below)

    for fn in *_01.fq.gz;
    samp=`basename ${fn}`
    echo "Processing sample ${samp}"
    salmon quant -i mouse_transcriptome_index -l A 
             -1 ${fn}/${samp}_01.fq.gz 
             -2 ${samp}_02.fq.gz 
             -p 8 -o quants/${samp}_quant

Processing sample *_01.fq.gz
Version Info Exception: server did not respond before timeout
### salmon (selective-alignment-based) v1.5.2
### [ program ] => salmon
### [ command ] => quant
### [ index ] => { mouse_transcriptome_index }
### [ libType ] => { A }
### [ mates1 ] => { *_01.fq.gz/*_01.fq.gz_01.fq.gz }
### [ mates2 ] => { *_01.fq.gz_02.fq.gz }
### [ threads ] => { 8 }
### [ output ] => { quants/*_01.fq.gz_quant }
Logs will be written to quants/*_01.fq.gz_quant/logs
[2021-10-27 13:11:44.725] [jointLog] [info] setting maxHashResizeThreads to 8
[2021-10-27 13:11:44.725] [jointLog] [info] Fragment incompatibility prior below threshold.  Incompatible fragments will be ignored.
[2021-10-27 13:11:44.725] [jointLog] [info] Usage of --validateMappings implies use of minScoreFraction. Since not explicitly specified, it is being set to 0.65
[2021-10-27 13:11:44.725] [jointLog] [info] Setting consensusSlack to selective-alignment default of 0.35.
[2021-10-27 13:11:44.725] [jointLog] [info] parsing read library format
[2021-10-27 13:11:44.725] [jointLog] [info] There is 1 library.
Exception : [
The following errors were detected with the read files
ERROR: file [*_01.fq.gz/*_01.fq.gz_01.fq.gz] does not appear to exist!

This is how my files are named

WT_8h_1_01.fq.gz   Za2_8h_1_02.fq.gz
WT_8h_1_02.fq.gz   Za2_8h_2_01.fq.gz
WT_8h_2_01.fq.gz   Za2_8h_2_02.fq.gz
WT_8h_2_02.fq.gz   Za2_8h_1_01.fq.gz

I would appreciate any help in figuring out wth I am doing wrong. I have tried changing a bunch of different things but always ultimately end up with the script looking for the wrong files.






Read more here: Source link