nf-core / nf-core/fetchngs

fetchngs 1.12 produces empty runinfo.tsv because ENA no longer accepts parent_study

Open
#372 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Nextflow
Stars
202
Forks
93
Avg merge
1d 18m
Merged PRs (30d)
15

Description

Description of the bug
fetchngs 1.8 produces empty runinfo.tsv because ENA no longer accepts parent_study

I encountered a failure in nf-core/fetchngs 1.12 while processing valid SRA run accessions such as:

SRR7299460
SRR7299461

The pipeline fails at:

NFCORE_FETCHNGS:SRA:SRA_RUNINFO_TO_FTP

with:

Missing output file(s) `*.tsv` expected by process
`NFCORE_FETCHNGS:SRA:SRA_RUNINFO_TO_FTP`

The preceding *.runinfo.tsv files are created, but contain only the header and no data rows, for example:

run_accession experiment_accession sample_accession ... fastq_ftp ...

The accessions themselves are valid. NCBI SRA returns complete metadata for them, and ENA also resolves both the run and experiment accessions correctly.

For example:

curl -L -G \
  'https://www.ebi.ac.uk/ena/portal/api/filereport' \
  --data-urlencode 'accession=SRX4201949' \
  --data-urlencode 'result=read_run' \
  --data-urlencode 'fields=run_accession,experiment_accession,fastq_ftp,fastq_md5,fastq_bytes'

returns the expected record for SRR7299460, including both paired FASTQ URLs.

However, reproducing the full ENA field request used by fetchngs 1.12 results in:

Invalid fieldName(s) supplied: parent_study

The field list in bin/sra_ids_to_runinfo.py includes:

"parent_study"

which is apparently no longer accepted by the current ENA read_run filereport API.

Because the script creates the output file and writes its header before attempting to write returned metadata records, the failed/empty ENA response results in a header-only *.runinfo.tsv.

The subsequent sra_runinfo_to_ftp.py process then iterates over zero records and does not create the expected *.runinfo_ftp.tsv, resulting in the Nextflow error:

Missing output file(s) `*.tsv`

I confirmed that removing parent_study from the requested ENA metadata fields resolves the issue.

For example, this ENA request succeeds:

curl -L -G \
  'https://www.ebi.ac.uk/ena/portal/api/filereport' \
  --data-urlencode 'accession=SRX4201949' \
  --data-urlencode 'result=read_run' \
  --data-urlencode 'fields=run_accession,experiment_accession,sample_accession,secondary_sample_accession,study_accession,secondary_study_accession,submission_accession,run_alias,experiment_alias,sample_alias,study_alias,library_layout,library_selection,library_source,library_strategy,library_name,instrument_model,instrument_platform,base_count,read_count,tax_id,scientific_name,sample_title,experiment_title,study_title,sample_description,fastq_md5,fastq_bytes,fastq_ftp,fastq_galaxy,fastq_aspera'

As a workaround, running fetchngs with an explicit --ena_metadata_fields list that excludes parent_study allows the metadata query to succeed.

It may therefore be useful to:

  1. Remove or replace parent_study from the default ENA metadata field list.
  2. Add validation that the ENA response contains at least one data record rather than silently creating a header-only TSV.
  3. Report the ENA API error response directly so that the upstream cause is visible instead of only failing later in SRA_RUNINFO_TO_FTP.

Environment:

nf-core/fetchngs: 1.12
Executor: Slurm
System: Pawsey Setonix
Profile: pawsey_setonix / Singularity
Command used and terminal output
nextflow run nf-core/fetchngs \
    -r 1.12.0 \
    -resume \
    --input sra_ids.csv \
    --download_method sratools \
    --outdir "$MYSCRATCH/fetchngs_results" \
    -profile singularity,pawsey_setonix
Relevant files

No response

System information

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with bin/sra_ids_to_runinfo.py and inspect the default ENA metadata fields, especially parent_study, then trace how its output reaches sra_runinfo_to_ftp.py in SRA_RUNINFO_TO_FTP. Reproduce the ENA request using the example accessions and verify that the corrected workflow produces records and the expected FTP TSV instead of a header-only file.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data-engineering
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
75/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.