shell question: How to run multiple paired end alignment in shell?
Hi there,
the following command works with bash(Mac command line), but not with unix shell(after entering screen command), how do I rewrite it?
for i in $(ls ~/mbd1rnaseq/scfastq | rev | cut -c 9- | rev | uniq)
do rsem-calculate-expression -p 8 --forward-prob 0.95 --bowtie2 --bowtie2-path /mnt/software/bowtie2/default --output-genome-bam --paired-end ~/mbd1rnaseq/scfastq/${i}R1.fastq ~/mbd1rnaseq/scfastq/${i}R2.fastq ~/mbd1rnaseq/mm9.rsem ${i}
done |& tee terminaloutput.txt
Basically , file input names got changed.
Error: Must specify at least one read input with -U/-1/-2 (ERR): bowtie2-align exited with value 1 sh: 32m05_CGTACTAG-GCGTAAGA_R2.fR1.fastq: command not found sh: 32m05_CGTACTAG-GCGTAAGA_R2.fR2.fastq: command not found sh: 32m05_CGTACTAG-GCGTAAGA_R2.f.temp/o such file or directo
my file names are like this:
11_AGGCAGAA-TATCCTCT_R1.fastq 39_CGTACTAG-ACTGCATA_R1.fastq 60_GGACTCCT-TATCCTCT_R1.fastq 77_CTCTCTAC-AGAGTAGA_R1.fastq
11_AGGCAGAA-TATCCTCT_R2.fastq 39_CGTACTAG-ACTGCATA_R2.fastq 60_GGACTCCT-TATCCTCT_R2.fastq 77_CTCTCTAC-AGAGTAGA_R2.fastq
• 719 views
•
link
0 answers
No answers yet.
Log in to answer this question.
What's the output of
ls ~/mbd1rnaseq/scfastq?This is a problem with your
cut -c 9-statement, because it hard-codes the number of characters to cut. Usesedwith a regex instead, that way you can be sure that the right substring is picked regardless of length.Check out the output of
ls 32m05_CGTACTAG-GCGTAAGA_R2.f*to see what's in the file name that's breaking yourcut.Your loop might improve with this:
Note:
ls /some/dirgives you justbasenames of the files in the dir, butls /some/dir/*.globgives you full relative path to each matching filename, removing the need to specify the path to each FQ file in your command.It gives like this RamRS
You seem to lack write permission to
~/mbd2ranseq/scfastq. You can either address that or supply a different temp directory torsem-calculate-expressionusing the--temporary-folder <string>option.Still It produces the same error.
I have a feeling that your
lsis customized with shell colors and that could be interfering with operations, as there is no file that begins32m*in that dir. Try using/bin/lsinstead of justls.script:
with gnu-parallel:
You'd need to change the initial glob, as your example needs the fastq files to be present in both
$PWDand~/mbd1rnaseq/scfastq/