Comments (7)
Thanks for using pysradb
@spadavec! I am going to address your concern with a new method to be pushed in soon. I know the following approach is not intuitive, but it should work for you for now:
pysradb sra-metadata SRP098789 --db data/SRAmetadb.sqlite --saveto SRP098789_metadata.tsv
Then extract the SRX and SRR using:
$ cat SRP098789_metadata.tsv | cut -f2,6 -d$'\t'
experiment_accession run_accession
SRX2536403 SRR5227288
SRX2536404 SRR5227289
SRX2536405 SRR5227290
SRX2536406 SRR5227291
SRX2536407 SRR5227292
SRX2536408 SRR5227293
SRX2536409 SRR5227294
SRX2536410 SRR5227295
SRX2536411 SRR5227296
SRX2536412 SRR5227297
SRX2536413 SRR5227298
SRX2536414 SRR5227299
SRX2536415 SRR5227300
SRX2536416 SRR5227301
SRX2536417 SRR5227302
SRX2536418 SRR5227303
SRX2536419 SRR5227304
SRX2536420 SRR5227305
SRX2536421 SRR5227306
SRX2536422 SRR5227307
SRX2536423 SRR5227308
SRX2536424 SRR5227309
SRX2536425 SRR5227310
SRX2536426 SRR5227311
SRX2536427 SRR5227312
SRX2536428 SRR5227313
Please let me know if you run into issues. I will keep this open until I have a better fix for this.
Thanks!
from pysradb.
Hi @spadavec,
I have fixed this in v0.4.1.
$ pysradb srp-to-srx --db data/SRAmetadb.sqlite SRP098789
experiment_accession run_accession
SRX2536403 SRR5227288
SRX2536404 SRR5227289
SRX2536405 SRR5227290
SRX2536406 SRR5227291
SRX2536407 SRR5227292
SRX2536408 SRR5227293
SRX2536409 SRR5227294
SRX2536410 SRR5227295
SRX2536411 SRR5227296
SRX2536412 SRR5227297
SRX2536413 SRR5227298
SRX2536414 SRR5227299
SRX2536415 SRR5227300
SRX2536416 SRR5227301
SRX2536417 SRR5227302
SRX2536418 SRR5227303
SRX2536419 SRR5227304
SRX2536420 SRR5227305
SRX2536421 SRR5227306
SRX2536422 SRR5227307
SRX2536423 SRR5227308
SRX2536424 SRR5227309
SRX2536425 SRR5227310
SRX2536426 SRR5227311
SRX2536427 SRR5227312
SRX2536428 SRR5227313
Please let me know if you face issues. Thanks for using pysradb
!
from pysradb.
@saketkc Thanks for this update! As a quick question, if I have an example SRP id (e.g. SRP048759) and I want to get all the sample ids (e.g. SRS*) ids associated with that SRP value, how would you go about doing that?
from pysradb.
Thanks you @spadavec for your question. It helped me sort out a few things that my earlier comment did not really address.
Please install the latest version of pysradb
from master:
pip install git+https://github.com/saketkc/pysradb.git
Here is what you would want to do next:
$ pysradb srp-to-srs --db data/SRAmetadb.sqlite SRP048759
study_accession sample_accession
SRP048759 SRS718878
SRP048759 SRS718879
SRP048759 SRS718880
SRP048759 SRS718881
SRP048759 SRS718882
SRP048759 SRS718883
SRP048759 SRS718884
SRP048759 SRS718885
SRP048759 SRS718886
[truncated]
If you want more details (SRX/SRR):
$ pysradb srp-to-srs --db data/SRAmetadb.sqlite --detailed SRP048759
study_accession sample_accession experiment_accession run_accession
SRP048759 SRS718878 SRX729552 SRR1608490
SRP048759 SRS718878 SRX729552 SRR1608491
SRP048759 SRS718878 SRX729552 SRR1608492
SRP048759 SRS718878 SRX729552 SRR1608493
SRP048759 SRS718879 SRX729553 SRR1608494
SRP048759 SRS718879 SRX729553 SRR1608495
SRP048759 SRS718879 SRX729553 SRR1608496
SRP048759 SRS718879 SRX729553 SRR1608497
SRP048759 SRS718880 SRX729554 SRR1608498
[truncated]
Please let me know if you face any trouble!
from pysradb.
You can also save your output directly to a tab separated file:
pysradb srp-to-srs --db data/SRAmetadb.sqlite --detailed SRP048759 --saveto SRP048759.tsv
from pysradb.
@saketkc perfect! This is exactly what I needed. Closing this out now, and thank you so much for this amazing project.
from pysradb.
Glad it was helpful! Just in case you need more metadata (cell type/treatment etc.):
$ pysradb sra-metadata --db data/SRAmetadb.sqlite SRP048759 --desc --expand | head
study_accession experiment_accession sample_accession run_accession cell_type source_name tissue
SRP048759 SRX729552 SRS718878 SRR1608490 acute myeloid leukemia acute myeloid leukemia bone marrow
SRP048759 SRX729552 SRS718878 SRR1608491 acute myeloid leukemia acute myeloid leukemia bone marrow
SRP048759 SRX729552 SRS718878 SRR1608492 acute myeloid leukemia acute myeloid leukemia bone marrow
SRP048759 SRX729552 SRS718878 SRR1608493 acute myeloid leukemia acute myeloid leukemia bone marrow
SRP048759 SRX729553 SRS718879 SRR1608494 acute myeloid leukemia acute myeloid leukemia heparinised blood
SRP048759 SRX729553 SRS718879 SRR1608495 acute myeloid leukemia acute myeloid leukemia heparinised blood
SRP048759 SRX729553 SRS718879 SRR1608496 acute myeloid leukemia acute myeloid leukemia heparinised blood
SRP048759 SRX729553 SRS718879 SRR1608497 acute myeloid leukemia acute myeloid leukemia heparinised blood
SRP048759 SRX729554 SRS718880 SRR1608498 acute myeloid leukemia acute myeloid leukemia heparinised blood
I just pushed this, so you might need to rerun:
pip install git+https://github.com/saketkc/pysradb.git
from pysradb.
Related Issues (20)
- [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
- [BUG] aspera HOT 3
- [BUG] Metadata download not only for the provided accession number HOT 3
- [BUG] aspera HOT 3
- [BUG] gse-to-srp error 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.