RNA-Seq read alignment using subread gives error.
2
0
Entering edit mode
8.0 years ago

Hi, I am using subread v1.5.1 to align paired-end RNA-Seq data that is in .fastq.gz format. The prefixes for the filenames are:

  • L-C-F4
  • L-C-F6
  • L-C-M5
  • L-C-M6
  • L-VR-F6
  • L-VR-M4
  • L-VR-M5

These are stored in a file Liveruniquelist.txt. As there are multiple files, I wrote a short shell script to loop through these files and execute the subread-align command.

while read p;
    do
        /home/merajext/Sumit/subread-1.5.1-Linux-X86_64/bin/subread-align -t 0 -T 8 -i /home/merajext/Sumit/SubreadIndex/subreadRnor6_Index -r $p_R1.fastq.gz -R $p_R2.fastq.gz -o /home/merajext/Sumit/RawData/SubreadAlignment/$p_subread.bam
    done < Liveruniquelist.txt

However, for each file, the above code generates the following error:

ERROR: unable to open file '.fastq.gz'. File name might be incorrect, or you do not have the permission to read the file.

I am not sure if this error is because of read files in zipped form or something else. Kindly suggest.

RNA-Seq subread • 2.5k views
ADD COMMENT
3
Entering edit mode
8.0 years ago

Depending on the number of samples, a loop can definitely be convenient. You can check how it performs by running the loop like

while read p;
    echo $p_R1.fastq.gz
    done < Liveruniquelist.txt

I think your problem will be solved by using ${p}_R1.fastq.gz, because your shell is now looking for the variable p_R1 which doesn't exist.

ADD COMMENT
0
Entering edit mode

Thanks. This solved the issue. I found a similar solution here.

ADD REPLY
1
Entering edit mode
8.0 years ago

That's an error in your loop, not an error in subread. The error message clearly indicates that there is no file called '.fastq.gz'. Just take out the loop and manually do the command for each filename instead of using variables; that's simpler.

ADD COMMENT

Login before adding your answer.

Traffic: 2037 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6