Comments (7)
why is there no mention or use case scenario of SRAweb() mode in the docs as python API (in the python API usage section). Is it because web mode isn't complete yet?
Partially, yes. And partially because I have been slow at updating the documentation. Most part
is interoperable between the SRAdb
and SRAweb
mode and as such most of the documentation works for both modes. But, not all.
But then cli commands also use SRAweb() when SRAmetadb.sqlite isn't available locally so it can be used by python files also by importing sraweb module.
The rationale for this design was to return the user some results rather than just failing with an error if SRAmetadb
is not specified or present in the current working directory. This might not be the best approach, but I could not think of a better approach when I wrote it. Happy to take suggestions. The ultimate goal is to essentially get rid of the SRAdb
mode. But we cannot until search
is supported.
from pysradb.
It's not broken. You are using SRAdb which requires SRAmetadb.sqlite to be downloaded locally on your machine using $ pysradb metadb
command. This explains why a "no such table" error is thrown. The _verify_srametadb() in SRAdb function has a check for this. I too faced this problem as it is not mentioned explicitly in the docs and since it creates a file of the same name entered into SRAdb() function in the current working directory, it interferes with $ pysradb metadata <sra_id>
command also since the metadata() function in cli.py has a check to see if there is a database with this name in cwd.
This code, however, would work:-
from pysradb import sraweb
db = sraweb.SRAweb()
df = db.sra_metadata('SRP098789')
df.head()
A few things that can be done:
- Mention in the Python API Usage section in docs to download metadb locally on machine before using SRAdb.
- Modify the _verify_srametadb() function to throw an error which mentions to run pysradb metadb before running the current command.
- Introduce a layer of abstraction just like the cli command
$ pysradb metadata <sra_id>
to check if db is available locally else use "web" db.
@saketkc Can I work on this?
from pysradb.
Thanks @Chokerino for the bug report. I agree its a bug, but the API is not broken. @DaasDaham's findings are indeed correct. We are trying to move away from the SRAmetadb.sqlite
usage as it is not up to date and has records missing at random. That said, I still want to keep supporting it until SRAweb
mode can support everything that the SRAdb
mode (the one relying on local sqlite db) does.
@DaasDaham your suggestions look good! Feel free to send a PR and I will be happy to take a look.
from pysradb.
@saketkc Sure, I'll do it
from pysradb.
@saketkc why is there no mention or use case scenario of SRAweb() mode in the docs as python API (in the python API usage section). Is it because web mode isn't complete yet?
But then cli commands also use SRAweb() when SRAmetadb.sqlite isn't available locally so it can be used by python files also by importing sraweb module.
from pysradb.
Thanks for the clarification!
from pysradb.
Closed via #31
from pysradb.
Related Issues (20)
- Stats not saved in output file HOT 3
- [ENH] MD5 value is not HOT 1
- [ENH] Pysradb doesn't work on "superseries" HOT 1
- [BUG] requests.exceptions.ConnectionError
- [BUG] SRX to SRR produces incorrect results when multiple SRRs are present
- [BUG] linux-64 Conda version out of date HOT 7
- [BUG] varying number of columns in output
- [BUG] gse-to-srp not producing results HOT 1
- [BUG] gse_to_srp returns an error in Python API HOT 1
- [ENH] Include data processing steps, reference to which the reads were aligned or if possible lab protocol into the main table HOT 1
- [BUG] The error arises from setting a deprecated value for the "display.max_colwidth" option in pandas. HOT 2
- [BUG] Parsing error in gse-to-srp HOT 1
- installation using conda fails with UnsatisfiableError HOT 3
- [BUG] HOT 1
- ValueError: Value must be a nonnegative integer or None HOT 1
- Possible missing keys in esearch response results HOT 1
- Data download is interrupted after a few minutes HOT 7
- Filtering results by instrument type HOT 3
- [ENH] Super useful package!
- [BUG] cannot download a single experiment from command line HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pysradb.