This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Problem using SRAtoolkit

Hello Biostars community

I wanted to use split-3 function of sratoolkit to split my pair-ended RNA-seq files to two fastq files. However, after inserting the code, I get the following error. What is the problem?

./fastq-dump --split-3
2023-01-29T12:54:14 fastq-dump.3.0.2 err: param empty while validating argument list - expected accession
sra sratoolkit fastq rna-seq

1 answer

Message tells you what you need to do. You need to provide an SRA accession number or name of a downloaded .sra file with this command.

e.g. fastq-dump --split-3 SRR345355

Thanks for your help. Actually I was trying to use following loop to split my SRA files. However, I think the problem relates to my file extensions as they don't have .sra. How can I add that to the end of all my files?

for i in /media/yousef/C0B0499AB04997B4/transcriptom_files/* ; do ./fastq-dump --split-3 --outdir /media/yousef/C0B0499AB04997B4/split/$i; done

Did you download the files from SRA using prefetch?

No. I downloaded them by clicking on download link in NCBI website.

Try processing one file and see it works before you try the loop. In case your files are corrupt this is not going to work.

Sure. Thanks for your help.

If you are sure the files are in .sra format then you could rename one file and try. Something like

mv file file.sra
fastq-dump --split-3 file.sra

I suggest you try instead

fastq-dump --split-files file.sra 

Thanks. Yes files are in sra format. I could solve this by adding a .sra to each file. I was just wondering, is there a way to add .sra to all files by using a code in linux?

for i in /media/yousef/C0B0499AB04997B4/transcriptom_files/* ; do echo mv ${i} $[i}.sra; done

If all commands look correct then remove echo to actually do the renaming.

If you want to be super careful the you could cp ${i} ${i}.sra (instead of mv command) leaving a copy of original files intact.

Log in to answer this question.