Download and convert SRA file to fastq file
1
0
Entering edit mode
24 months ago
rescueson • 0

I am trying to download and convert SRA files to fastq files but am receiving this error. It is necessary that I use a python script. Any suggestions?

import subprocess

sra_numbers = [
    "SRR18550793", "SRR18550794", "SRR18550795", "SRR18550796"
    ]

for sra_id in sra_numbers:
    print ("Currently downloading: " + sra_id)
    prefetch = "prefetch " + sra_id
    print ("The command used was: " + prefetch)
    subprocess.call(prefetch, shell=True)

for sra_id in sra_numbers:
    print ("Generating fastq for: " + sra_id)
    fastq_dump = "fasterq-dump --outdir fasta --skip-technical --readids $
    print ("The command used was: " + fastq_dump)
    subprocess.call(fastq_dump, shell=True)

Error for all four files:

2022-05-11T02:38:53 prefetch.3.0.0: Current preference is set  to retrieve SRA Normalized Format files with full base quality scores.
2022-05-11T02:38:53 prefetch.3.0.0: 1) 'SRR18550796' is found locally
2022-05-11T02:38:53 prefetch.3.0.0: 'SRR18550796' has 0 unresolved dependencies
Generating fastq for: SRR18550793
The command used was: fasterq-dump --outdir fasta --skip-technical --readids --read-filter pass --dumpbase --split-3 --clip ~/ncbi/public/sra/SRR18550793.sra
unrecognized option: '--readids'
Generating fastq for: SRR18550794
The command used was: fasterq-dump --outdir fasta --skip-technical --readids --read-filter pass --dumpbase --split-3 --clip ~/ncbi/public/sra/SRR18550794.sra
unrecognized option: '--readids'
Generating fastq for: SRR18550795
The command used was: fasterq-dump --outdir fasta --skip-technical --readids --read-filter pass --dumpbase --split-3 --clip ~/ncbi/public/sra/SRR18550795.sra
unrecognized option: '--readids'
Generating fastq for: SRR18550796
The command used was: fasterq-dump --outdir fasta --skip-technical --readids --read-filter pass --dumpbase --split-3 --clip ~/ncbi/public/sra/SRR18550796.sra
unrecognized option: '--readids'
python SRA fastq • 1.3k views
ADD COMMENT
0
Entering edit mode

@ rescueson why did you delete this post?

ADD REPLY
0
Entering edit mode
24 months ago
Mensur Dlakic ★ 27k

I think you should invest some time and format the error properly, as it is difficult to read. Still:

unrecognized option: '--readids'

That seems pretty clear. Either that option doesn't exist - don't know because I don't have fasterq-dump 3.0 installed - or it lacks a complete argument. From your python script the command line seems improperly formatted with $ at the end. Maybe try something like this:

"fasterq-dump --outdir fasta --skip-technical --readids %s" % sra_id
ADD COMMENT

Login before adding your answer.

Traffic: 2699 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