EBI-Metagenomics / genome_uploader

Python script to upload bins and MAGs to ENA (European Nucleotide Archive)
Apache License 2.0
20 stars 3 forks source link

IndexError: list index out of range (submitting MAGs) #10

Closed junhuili closed 8 months ago

junhuili commented 8 months ago

I tried to upload some MAGs, and it works for most of the bins (eg https://www.ebi.ac.uk/ena/browser/view/ERZ21824814), except for the bins from the metagenomes that were deposited on 2023-09-20. The error seems associated with "retrieve sample accession", but the metagenomes are available in ENA, eg https://www.ebi.ac.uk/ena/browser/view/SRR26115692.

Error: "Retrieving data for MAG submission... Retrieving info for genomes to submit... Retrieving project and run info from ENA (this might take a while)... Traceback (most recent call last): File "genome_upload.py", line 1274, in file_generator() File "genome_upload.py", line 1196, in file_generator genomes = ENA_uploader.create_genome_dictionary(samples_xml) File "genome_upload.py", line 1267, in create_genome_dictionary extract_ENA_info(genomeInfo, self.upload_dir, self.username, self.password) File "genome_upload.py", line 748, in extract_ENA_info sampleInfo = get_sample(sampleAccession, webin, password) File "genome_upload.py", line 684, in get_sample return json.loads(response.text)[0] IndexError: list index out of range"

Table: Checklist_ENA-bin0.csv

Ge94 commented 8 months ago

Hi Junhui, thank you for your interest in this repo! I tried querying ENA API with the sample accession associated with SRR26115692 (SRS18928889), but unfortunately the output is also empty. For reference:

curl -X POST -H "Content-Type: application/x-www-form-urlencoded" -d 'result=sample&query=secondary_sample_accession=%22SRS18928889%22&fields=all&format=tsv' "https://www.ebi.ac.uk/ena/portal/api/search"

I see that these samples have recently been uploaded to ENA. It usually takes around a week for ENA to index submitted files (despite them appearing on the ENA browser!), and this timespan might temporarily increase depending on eventual backlogs. I would suggest to retry in the next days. A persisting error might suggest an issue during ENA's indexing processing, for which case it would be better for you to contact ENA support to identify the right procedure to follow.

junhuili commented 8 months ago

Thank you for your quick feedback, Germana! I will try again next week.

Ge94 commented 8 months ago

Sounds good, let me know if you encounter any other problem! I will close this issue for now :)