ewels / sra-explorer

Web application to explore the Sequence Read Archive.
https://sra-explorer.info/
GNU General Public License v2.0
203 stars 29 forks source link

fix issue with xml; use new ebi endpoint #27

Closed agduncan94 closed 4 years ago

agduncan94 commented 4 years ago

Hey @ewels I stumbled upon this application when I was failing to download SRA data using prefetch and the SRA toolkit and was looking for an alternative. Hopefully this PR can help fix the issue with the new EBI api.

This is based on issues

There are two parts to this PR. First, there was an issue with the creation of the expXML and rawXML. Instead of using the .html() function followed by trimming, it now just uses the RAW XML directly. From what I understand XML doesn't care about whitespace, though perhaps there is another reason to use the .html() function. This was stopping the results from showing.

The second issue is that EBI changed their API for accessing the ENA. The new endpoint being used can be found on their Swagger page.

https://www.ebi.ac.uk/ena/portal/api/#/Portal%20API/fileReportUsingGET

The return type of JSON is also passed along to make the code a bit cleaner to read. This was causing the FASTQ downloads tab to be stuck loading.

I will say that I have limited knowledge of this app (I haven't actually used it before trying to fix it), so I hope I didn't break anything. It would be great if others could test this out to make sure it works.

ewels commented 4 years ago

This is brilliant stuff, thank you @agduncan94! Just checked the code changes and they look fine - amazingly simple, which is the best kind of fix! ☺️

I'll just wait to test this code myself locally before merging, but I think it looks great..

Phil

ewels commented 4 years ago

Haven't gotten to a computer yet but figured that it couldn't hurt to merge as it's currently broken anyway.

Just had a quick try on my phone and seems to not work with the examples? But maybe I'm being too impatient and haven't waited long enough for the automatic deploy..

ewels commented 4 years ago

Yay, working now! πŸŽ‰

Need another PR to remove the notice that it's not working πŸ˜…

ewels commented 4 years ago

Thank you!

agduncan94 commented 4 years ago

Happy to help! Oh true, I forgot to remove the notice πŸ˜†