ffq --ftp file not found
hariesramdhani opened this issue · 2 comments
Running the following commandffq --ftp SRR13917446
returned the output below
[2024-03-19 13:53:23,828] INFO Parsing run SRR13917446
[
{
"accession": "SRR13917446",
"filename": "SRR13917446.fastq.gz",
"filetype": "fastq",
"filesize": 163077560,
"filenumber": 1,
"md5": "7ce0cb1683922dcf10e8e7e73001b515",
"urltype": "ftp",
"url": "ftp://ftp.sra.ebi.ac.uk/vol1/fastq/SRR139/046/SRR13917446/SRR13917446.fastq.gz"
}
]
When I tried to use $(ffq --ftp SRR13917422 | jq -r '.[] | .url' | tr '\n' ' ')
(as written in the kb tutorial) it gave
Error: file not found ftp://ftp.sra.ebi.ac.uk/vol1/fastq/SRR139/022/SRR13917422/SRR13917422.fastq.gz
Which was weird because I can still access it via both the https and ftp https://ftp.sra.ebi.ac.uk/vol1/fastq/SRR139/022/SRR13917422/SRR13917422.fastq.gz
I used this version of ffq:
Name: ffq
Version: 0.3.1
Summary: A command line tool that makes it easier to find sequencing data from SRA / GEO / ENCODE / ENA / EBI-EMBL / DDBJ / Biosample.
Home-page: https://github.com/pachterlab/ffq
Author: Kyung Hoi (Joseph) Min, Sina Booeshaghi, Ángel Gálvez Merchán
Author-email: phoenixter96@gmail.com, alisina@caltech.edu, agalvezm@caltech.edu
License: MIT
Location: /uoa/scratch/users/r04mr23/envs/preprocessing/lib/python3.9/site-packages
Requires: beautifulsoup4, frozendict, lxml, requests
Required-by:
Hi, @hariesramdhani!
In order to download the file from the FTP server, you need to prepend the wget
command to initiate the download process. The corrected command should be as follows:
wget $(ffq --ftp SRR13917422 | jq -r '.[] | .url' | tr '\n' ' ')
This sequence of commands uses ffq
to fetch file metadata from the SRA database, jq
to extract the URL(s) from the JSON output, tr
to ensure all URLs are on a single line if there are multiple files, and finally, wget
to download the files from the extracted URLs. Please try this corrected command, and it should work for downloading the specified FASTQ file.
Ah, sorry my bad, thanks very much