This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Problems with alignment in bash mode with hisat2

I'm trying to align paired-end sequences with the following loop:

for f in `ls *.fq.gz | sed 's/_0[12].fq.gz//g' | sort -u`

 do

hisat2 -p 8 -x /home/referenceData/GRCh37_index -1 ${f}_1 -2 ${f}_2 -S ${f}.sam | samtools view -@ 8 ${f}.sam > ${f}.bam | samtools sort -@ 8 ${f}.bam -o ${f}.sorted.bam
done

However, this command is not running, because I am getting this error:

"SRR10042682_1_val_1.fq.gz_1: No such file in the directory"

"SRR10042682_2_val_2.fq.gz_2: No such file in the directory"

My samples are named as follows: SRR10042682_1_val_1.fq.gz and SRR10042682_2_val_2

can anybody help me?

Thanks!

rna-seq linux histat2

What's the zero in the sed command supposed to do in your opinion?

You are not reconstituting input files. Try this and echo before you run the command:

for f in `ls *.fq.gz | sed 's/_[12]_val_[12].fq.gz//g' | sort -u`

I would prefer this way, in a shell in the absence of parallel:

$ for f in *_1.fq.gz ; do echo $f ${f%%_*}_2_val_2.fq.gz; echo ${f%%_*}.{b,s}am;done

SRR10042682_1_val_1.fq.gz SRR10042682_2_val_2.fq.gz
SRR10042682.bam SRR10042682.sam

0 answers

No answers yet.

Log in to answer this question.