Hello all
Currently I am running bowtie to align my 4 pairend reads to reference genome . I am running shell script but it's showing error
for I in $(path_to_my_fastqfiles/*.fastq)
do
/opt/bowtie2-2.2.6/bowtie2 -p4 -x path_to_my_reference genome/ref/ path_to_my_fastqfile -1 ${i}.fastq -2 ${i}.fastq -S $i.sam
done
I am getting error permission denied
. Even if I do with sudo
still it's showing same error.
also if I change the first line for I in $(ls *.fastq)
, I get this error
Warning: Same mate file "ls" appears as argument to both -1 and -2
Extra parameter(s) specified: "path_to_my_fastqfiles", "*.fastq", "*.fastq", "*.fastq.sam"
Note that if <mates> files are specified using -1/-2, a <singles> file cannot
also be specified. Please run bowtie separately for mates and singles.
Error: Encountered internal Bowtie 2 exception (#1)
Command: /opt/bowtie2-2.2.6/bowtie2-align-s --wrapper basic-0 -p4 -x /path_to_my_ref/ -S ls -1 ls -2 ls path_to_my_fastqfile *.fastq *.fastq *.fastq.sam
(ERR): bowtie2-align exited with value 1
Can you post exact error ? Permission denied to read the files or execute the command or create sam file ?
Irrespective of permissions error, I do not know why it should work if you use
-1 ${i}.fastq -2 ${i}.fastq
essentially both R1 and R2 are same files ?check bash loop for alignment RNA-seq data
I changed my script : -1 ${i}A_R1.fasta -2 ${i}A_R2.fasta
My files are 1A_R1.fastq 1A_R2.fastq 2A_R1.fastq 2A_R2.fastq ....
/media/74BE94C7BE948372/sample/to_run_all_file.sh: 1: /media/74BE94C7BE948372/sample/to_run_all_file.sh: /media/74BE94C7BE948372/sample/fastq_file/1A_R1.fastq: Permission denied
It should be pretty simple if you exactly show us how your files are named. can you show us the output of the command
ls path_to_my_fastqfiles/*.fastq
1A_R1.fastq 2A_R1.fastq 3A_R1.fastq 4A_R1.fastq
1A_R2.fastq 2A_R2.fastq 3A_R2.fastq 4A_R2.fastq
this are my file names this are stored in media/sample/fastqfiles folder
for i in $(path_to_my_fastqfiles/*.fastq)
is going to return the full path of your fastqs, so$iA_R2.fasta
will become/path/to/1A_R1.fastqA_R1.fasta
This is not what you wanted I guess?
First off - are you using fasta or fastq because you change between the two...? Second off (is that a thing?) - you want to target ONLY THE R1s when assigning $i, and then cut off the last 8 characters. Do that with:
Also I suck at bash so theres a good chance you need to quote things or remove those {brackets} or something, but try it and see :)
Also also, this is why i hate defining what to run and running it at the same time. Although others may disagree, you should write a script that generates a list of commands to execute, so 1) you have it on record, 2) you can see what your doing as you iteratively create the list of commands to run.
sorry its fastq file only showing same error
OK. Did you try the script above?
If you paste the full filepath of both your -1 and -2, we can help you write a bash loop that works :)
Dont surround the path with
$()
. That is a process substitution and the shell will try and execute the file path as a command.If you need a list of files try:
for i in path/to/file/*.fastq ;
or
for i in $(ls /path/to/files) ;