Hi,
I am trying to run VelvetOptimiser on a number of paired end read files.
I have installed both velvet and velvetoptimiser via Conda. I wrote this forloop to loop through all of my read fliles:
for i in *_1_*.fastq; do VelvetOptimiser.pl -t 12 -s 19 -v --d ~/comp_genomics/velvet_optimiser_jo/${i%%_1_*.fastq}_assembly -f '-fastq -shortPaired $i ${i%%_1_*.fastq}_2_*.fastq'; done
I am however getting this error message:
Will run velvet optimiser with the following paramters:
Velveth parameter string:
-fastq -shortPaired $i ${i%%_1_*.fastq}_2_*.fastq
Velveth start hash values: 19
Velveth end hash value: 191
Velveth hash step value: 2
Velvetg minimum coverage cutoff to use: 0
Read tracking for final assembly off. Jan 17 16:41:17 Beginning velveth runs. Jan 17 16:41:17 Running velveth with hash value: 19. velveth: Could not open _2_*.fastq: No such file or directory Velveth failed! Response:1
I have tested the separate components of the command not in the forloop. So I know that separately the loop works as does the command options.
for i in *_1_*.fastq; do echo '-fastq -shortPaired' $i ${i%%_1_*.fastq}_2_*.fastq; done
VelvetOptimiser.pl -t 12 -s 19 -v --d ~/comp_genomics/velvet_optimiser_jo/bb_17198wB1_Sample_2_assembly -f '-shortPaired -fastq bb_17198wB1_Sample_2_1_trimmed_prinseq.fastq bb_17198wB1_Sample_2_2_trimmed_prinseq.fastq'
Is it possible to use VelvetOptimiser in a forloop? Is there a mistake that I'm missing?
I'd be very grateful for any help!
Thank you in advance!!!
How come the output of
is
This is simply not possible.
In addition, explain your files naming convention, so we can better understand your problem. If all files are named {something}_trimmed_prinseq.fastq, I would use
for i in *_1_trimmed_prinseq.fastq
. If you pay attention,*_1_*.fastq
will potentially match a file namedbb_17198wB1_Sample_1_2_trimmed_prinseq.fastq
, in case there is one.is not the output of
I was simply showing the two commands I ran to test both the velvet command itself and the the forloop.
An example of my file names is bb_17198wD7_Sample_52_1_trimmed_prinseq.fastq, I can take out the second wild card incase it would call the wrong file. But I haven't had this problem so far.
Thanks