saketkc / pysradb

Package for fetching metadata and downloading data from SRA/ENA/GEO
https://saketkc.github.io/pysradb
BSD 3-Clause "New" or "Revised" License
311 stars 51 forks source link

Python API doc examples seem to use sra_metadata with detailed=True #39

Closed victorlin closed 3 years ago

victorlin commented 4 years ago

Description

All the outputs and commands in the Python API documentation seem to assume sra_metadata() is called with detailed=True, though it is not specified and the default value is False.

Notably, this breaks example 4 where expand_sample_attribute_columns() assumes presence of the sample_attribute column. Running this snippet yields an ambiguous KeyError rather than the intended output.

from pysradb.filter_attrs import expand_sample_attribute_columns
df = db.sra_metadata('SRP017942')
expand_sample_attribute_columns(df).head()
saketkc commented 4 years ago

Thanks for the bug report @victorlin!

We are trying to move away from use of SRAmetadb.sqlite. That said, the API did change in between and hence there is a discordance between the docs and the API.

I would encourage you to try the SRAweb API which is more generic and always up-to-date. Here is an example of the metadata API: https://colab.research.google.com/drive/1BxsLlD_jJGAu5n377DK5RuZJrRiY-gUz

You can find other examples in the notebooks directory. We will soon be migrating all the docs to the SRAweb API once the search functionality is up and working. See #22.

saketkc commented 3 years ago

Fixed with latest docs update.