Giter Site home page Giter Site logo

Access about pysradb HOT 7 CLOSED

saketkc avatar saketkc commented on July 20, 2024
Access

from pysradb.

Comments (7)

saketkc avatar saketkc commented on July 20, 2024

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.

saketkc avatar saketkc commented on July 20, 2024

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.

spadavec avatar spadavec commented on July 20, 2024

@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.

saketkc avatar saketkc commented on July 20, 2024

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.

saketkc avatar saketkc commented on July 20, 2024

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.

spadavec avatar spadavec commented on July 20, 2024

@saketkc perfect! This is exactly what I needed. Closing this out now, and thank you so much for this amazing project.

from pysradb.

saketkc avatar saketkc commented on July 20, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.