Hi,
I am using viGEN pipeline to identify viruses in RNA-Seq data. I am getting following error when I run the script.
stat: No such file or directory Warning: Could not open read file "/home/venura/viGEN-master/unmapped_fastq/RRV4_un/RRV4_un__1.fq" for reading; skipping... Error: No input read files were valid (ERR): bowtie2-align exited with value 1
As one other post suggested I looked whether it has to something to do with the path using head -4 /home/venura/viGEN-master/unmapped_fastq/RRV4_un/RRV4_un_1.fq
It reads the first four lines of the .fq file without any problem.
@V300020467L4C001R0020000146 GAAGAAGTTAACATCTTTAAGGATGATGTTGTTATTCAGTTCATCAACCCTAAGGTTCAAGCTTCAATTGCTGCAAACACATGGGTTGTTAGCGAAGTCG + eefeeeeeeeeeeeeeeefeeeeeeeeeeeeeeeeeeeeeeedeeeee_fedefeeefeeeefeefeffdfefffefffffffeeeefcfeeeeeecfef
Can some one help me to troubleshoot the error? Thank you!
Complete script is given below( I removed the functionFlagstatBam
given in the original script since authors forgot to include the function in the script uploaded there at github. I opened an issue there requesting author to include the missing function.)
#!/bin/bash
# Alignment using Bowtie2
functionBowtie2() {
echo "Start - Align using Bowtie2 local algin" >> $LOG
$BOWTIE2_SW"bowtie2" -x $BOWTIE2_REF --local -1 $I_FOLDER$ID"_1.fq" -2 $I_FOLDER$ID"_2.fq" --threads $N_THREAD --al $O_FOLDER$ID/$ID".bowtie2.align" --un $O_FOLDER$ID/$ID".Bowtie2.unaligned" -S $O_FOLDER$ID/$ID".bowtie2.sam" --sensitive > $O_FOLDER$ID/$ERR2 2> $O_FOLDER$ID/$ERR3
echo "End - Align using Bowtie2 local algin" >> $LOG
}
#Convert SAM file to BAM file
functionConvertSamtoBam() {
echo "Start - convert sam to bam file using Samtools" >> $LOG
$SAMTOOLS"samtools" view -bS $O_FOLDER$ID/$ID".bowtie2.sam" > $O_FOLDER$ID/$ID".bowtie2.bam"
echo "End - convert sam to bam file using Samtools" >> $LOG
}
#Sort BAM coordinate wise
functionSortBam() {
echo "Start - Samtools sort bam file" >> $LOG
$SAMTOOLS"samtools" sort $O_FOLDER$ID/$ID".bowtie2.bam" -o $O_FOLDER$ID/$ID".bowtie2.sorted.bam" -@ $N_THREAD
echo "End - Samtools sort bam file" >> $LOG
}
#Index BAM file
functionIndexBam() {
echo "Start - Samtools index bam file" >> $LOG
$SAMTOOLS"samtools" index $O_FOLDER$ID/$ID".bowtie2.sorted.bam"
echo "End - Samtools index bam file" >> $LOG
}
# Samtools idx - genome level counts
functionIdxStatsBam() {
echo "Start - Samtools Idx" >> $LOG
$SAMTOOLS"samtools" idxstats $O_FOLDER$ID/$ID".bowtie2.sorted.bam" > $O_FOLDER$ID/$ID".bowtie2.idxstats.txt"
echo "End - Samtools Idx" >> $LOG
}
########################################
# Values to set by the user
N_THREAD=8
I_FOLDER="/home/venura/viGEN-master/unmapped_fastq/RRV4_un/"
O_FOLDER="/home/venura/viGEN-master/output_bowtie2/"
LOG=$O_FOLDER"/pipeline_log.txt"
ERR2="system.err.bowtie2.txt"
ERR3="log.bowtie2.txt"
SAMTOOLS="/usr/bin/"
BOWTIE2_SW="/usr/bin/"
BOWTIE2_REF="/home/venura/viGEN-master/vir_ref/virus.bowtie2.refB"
for x in $(cat samplenames.txt)
do
echo $x
ID=${x%*}
echo "-----------------------------" >> $LOG
echo $ID >> $LOG
START=$(date +%s)
mkdir $O_FOLDER$ID
functionBowtie2
functionConvertSamtoBam
functionSortBam
functionIndexBam
functionIdxStatsBam
END=$(date +%s)
DIFF=$(( ($END - $START)/60 ))
echo "It took $DIFF minutes" >> $LOG
done
The file from the error message (
RRV4_un__1.fq
) has a double underscore in its name; the file from the head command (RRV4_un_1.fq
) doesn't: un__1.fq vs un_1.fq.Thank you! I screwed up the samplenames.txt where I added underscore. :(
Thank you for this post