Ok, there is apparently some confusion here:
1) You are right now saving your alignment to > aligned_host_parasite.sam. The SAM format is the format that alignments are by default stored in. Using > redirects the stream from bowtie2 to the specified file (aligned_host_parasite.sam). If you do that, you (probably) cannot pipe it into samtools view, therefore the BAM is empty.
2) aligned_reads.fastq being empty is not surprising. From the bowtie2 manual:
--al <path> write unpaired reads that aligned at least once to <path>
That means it will contain only files that are unpaired but aligned in any fashion. It being empty means you have no unpaired reads that aligned, probably because all reads were paired, which is expected from paired-end fastq files.
The correct command would be (removing the quotes around -1 and -2, which I think are not necessary):
$WORK_DIR="/home/luz_garcia_longoria/workspace"
bowtie2 --threads 4 --local --no-unal \
-x ${WORK_DIR}/reference_genomes/parasitereference.fasta \
-q -k 1 --al aligned_reads.fastq \
-1 ${WORK_DIR}/s21_1.fq,${WORK_DIR}/s22_1.fq,\
${WORK_DIR}/s23_1.fq,${WORK_DIR}/s24_1.fq,\
${WORK_DIR}/s25_1.fq,${WORK_DIR}/s31_1.fq,\
${WORK_DIR}/s32_1.fq,${WORK_DIR}/s33_1.fq,\
${WORK_DIR}/s34_1.fq,${WORK_DIR}/s35_1.fq \
-2 ${WORK_DIR}/s21_2.fq,${WORK_DIR}/s22_2.fq,\
${WORK_DIR}/s23_2.fq,${WORK_DIR}/s24_2.fq,\
${WORK_DIR}/s25_2.fq,${WORK_DIR}/s31_2.fq,\
${WORK_DIR}/s32_2.fq,${WORK_DIR}/s33_2.fq,\
${WORK_DIR}/s34_2.fq,${WORK_DIR}/s35_2.fq | \
samtools view -b -o aligned_host_parasite.bam
By the way, SAM/BAM are the files you use for downstream analysis. Fastq is only a format for unaligned data. I hope you do not want to use fastq files for any downstream. What is your next step?
Your fastq is empty, so it seems you somehow corrupted your data after the alignment was performed, since that file seems pretty big. Can you regenerate the fastq file?
You can also convert the bam back to fastq using
samtools fastq myaln.bam > myreads.fastqOk. I though also to do this but I wonder if I am going to alter somehow the BAM files and then the fastq file will be the "real" one...
Is your command pasted here properly? The
`begins after the-1but does not end at the right place.You have to re-write the path for all your fq or launch your script from your workspace
Same for option
-2What if OP used shell expansion?
Ofc it is an elegant solution but brackets are missing from OP command line
the command is
And I am running this command in workspace :)
If you're running your command from
/home/luz_garcia_longoria/workspace/you don't need it in option-1and-2