Unconfigured Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • roliwilhelm
    Member
    • Jun 2012
    • 38

    Downloading 'RunInfo Table' from SRA Run Selector

    Hello,

    I would like to download the metadata for a given BioProject from the SRA. I am able to get exactly what I need by hitting the download 'RunInfo Table' through the SRA Run Selector web interface (example). It should be relatively straightforward to perform this action from the command line using "wget".

    By clicking on the 'RunInfo Table' button, the page loads the following address, which is stable link to download the information:



    BUT, I have no idea where that hash information is coming from. Can anyone help there?

    Alternatively, I've tried a series of efetch commands, but none provide me a '.tsv' (or '.csv' would be fine) of the complete BioProject metadata.

    This command provides only the information about sequencing:
    wget -O PRJNA308986.csv 'http://trace.ncbi.nlm.nih.gov/Traces/sra/sra.cgi?save=efetch&db=sra&rettype=runinfo&term=PRJNA308986'

    This command provides the full BioProject information sought, but in an .xml format which I haven't been able to parse.

    wget -O PRJNA496337.xml 'http://trace.ncbi.nlm.nih.gov/Traces/sra/sra.cgi?save=efetch&db=sra&rettype=bioproject&term=PRJNA496337'

    Thanks in advance,
    Roli
  • vkkodali
    Junior Member
    • Jul 2018
    • 2

    #2
    In general, for downloading NCBI data from the Unix command line, I recommend using Entrez Direct.

    Specifically, to download the runinfo table, you can use the following command:
    Code:
    esearch -db sra -q 'PRJNA308986' | efetch -format runinfo
    This will produce a comma separated table with the following fields:
    Code:
                      Run [  1]: SRR3108728
              ReleaseDate [  2]: 2017-02-16 00:00:00
                 LoadDate [  3]: 2016-01-21 03:15:18
                    spots [  4]: 98100
                    bases [  5]: 49246200
         spots_with_mates [  6]: 98100
                avgLength [  7]: 502
                  size_MB [  8]: 28
             AssemblyName [  9]: 
            download_path [ 10]: https://sra-download.ncbi.nlm.nih.gov/traces/sra37/SRR/003035/SRR3108728
               Experiment [ 11]: SRX1537041
              LibraryName [ 12]: mdbk110
          LibraryStrategy [ 13]: AMPLICON
         LibrarySelection [ 14]: PCR
            LibrarySource [ 15]: METAGENOMIC
            LibraryLayout [ 16]: PAIRED
               InsertSize [ 17]: 0
                InsertDev [ 18]: 0
                 Platform [ 19]: ILLUMINA
                    Model [ 20]: Illumina MiSeq
                 SRAStudy [ 21]: SRP068618
               BioProject [ 22]: PRJNA308986
          Study_Pubmed_id [ 23]: 
                ProjectID [ 24]: 308986
                   Sample [ 25]: SRS1253892
                BioSample [ 26]: SAMN04419133
               SampleType [ 27]: simple
                    TaxID [ 28]: 410658
           ScientificName [ 29]: soil metagenome
               SampleName [ 30]: mdbk110
             g1k_pop_code [ 31]: 
                   source [ 32]: 
       g1k_analysis_group [ 33]: 
               Subject_ID [ 34]: 
                      Sex [ 35]: 
                  Disease [ 36]: 
                    Tumor [ 37]: no
         Affection_Status [ 38]: 
             Analyte_Type [ 39]: 
        Histological_Type [ 40]: 
                Body_Site [ 41]: 
               CenterName [ 42]: UNIVERSITY OF MINNESOTA
               Submission [ 43]: SRA336468
    dbgap_study_accession [ 44]: 
                  Consent [ 45]: public
                  RunHash [ 46]: 4B63AAF2295927A2EAEB798FCF9FC7DA
                 ReadHash [ 47]: FB1226CB8B5FEBC85B053718D4C1BBFA
    You can download the same table in XML format by making a small change as follows:
    Code:
    esearch -db sra -q 'PRJNA308986' | efetch -format runinfo -mode xml
    You can then parse this XML using the command "xtract" that comes with the Entrez Direct tools to extract only specific columns of interest to you.

    Comment

    • vkkodali
      Junior Member
      • Jul 2018
      • 2

      #3
      In general, for downloading NCBI data from the Unix command line, I recommend using Entrez Direct.

      Specifically, to download the runinfo table, you can use the following command:
      Code:
      esearch -db sra -q 'PRJNA308986' | efetch -format runinfo
      This will produce a comma separated table with the following fields:
      Code:
                        Run [  1]: SRR3108728
                ReleaseDate [  2]: 2017-02-16 00:00:00
                   LoadDate [  3]: 2016-01-21 03:15:18
                      spots [  4]: 98100
                      bases [  5]: 49246200
           spots_with_mates [  6]: 98100
                  avgLength [  7]: 502
                    size_MB [  8]: 28
               AssemblyName [  9]: 
              download_path [ 10]: https://sra-download.ncbi.nlm.nih.gov/traces/sra37/SRR/003035/SRR3108728
                 Experiment [ 11]: SRX1537041
                LibraryName [ 12]: mdbk110
            LibraryStrategy [ 13]: AMPLICON
           LibrarySelection [ 14]: PCR
              LibrarySource [ 15]: METAGENOMIC
              LibraryLayout [ 16]: PAIRED
                 InsertSize [ 17]: 0
                  InsertDev [ 18]: 0
                   Platform [ 19]: ILLUMINA
                      Model [ 20]: Illumina MiSeq
                   SRAStudy [ 21]: SRP068618
                 BioProject [ 22]: PRJNA308986
            Study_Pubmed_id [ 23]: 
                  ProjectID [ 24]: 308986
                     Sample [ 25]: SRS1253892
                  BioSample [ 26]: SAMN04419133
                 SampleType [ 27]: simple
                      TaxID [ 28]: 410658
             ScientificName [ 29]: soil metagenome
                 SampleName [ 30]: mdbk110
               g1k_pop_code [ 31]: 
                     source [ 32]: 
         g1k_analysis_group [ 33]: 
                 Subject_ID [ 34]: 
                        Sex [ 35]: 
                    Disease [ 36]: 
                      Tumor [ 37]: no
           Affection_Status [ 38]: 
               Analyte_Type [ 39]: 
          Histological_Type [ 40]: 
                  Body_Site [ 41]: 
                 CenterName [ 42]: UNIVERSITY OF MINNESOTA
                 Submission [ 43]: SRA336468
      dbgap_study_accession [ 44]: 
                    Consent [ 45]: public
                    RunHash [ 46]: 4B63AAF2295927A2EAEB798FCF9FC7DA
                   ReadHash [ 47]: FB1226CB8B5FEBC85B053718D4C1BBFA
      You can download the same table in XML format by making a small change as follows:
      Code:
      esearch -db sra -q 'PRJNA308986' | efetch -format runinfo -mode xml
      You can then parse this XML using the command "xtract" that comes with the Entrez Direct tools to extract only specific columns of interest to you.

      Comment

      • tjtaylor
        Junior Member
        • May 2020
        • 1

        #4
        Using wget to retrieve SRA RunInfo and AccList

        Here's an example of using `wget` to retrieve the SRA RunInfo and AccList from NCBI Sequence Read Archive.

        Code:
        # wget equivalent to:
        #   esearch -db sra -q "${study_id}" | efetch -format runinfo
        
        study_id=PRJNA308986
        db=sra
        
        #assemble the esearch URL
        base='https://eutils.ncbi.nlm.nih.gov/entrez/eutils/'
        
        # esearch for the project, using WebEnv/QueryKey for efetch
        data="`wget -qO- "${base}esearch.fcgi?db=${db}&term=${study_id}&usehistory=y"`"
        web=$(grep -oPm1 "(?<=<WebEnv>)[^<]+" <<< "${data}")
        key=$(grep -oPm1 "(?<=<QueryKey>)[^<]+" <<< "${data}")
        
        # efetch SRA RunInfo
        wget -qO "SraRunInfo-${study_id}.csv" "${base}efetch.fcgi?db=${db}&query_key=${key}&WebEnv=${web}&retmode=text&rettype=runinfo"
        
        # efetch SRA AccList
        wget -qO "SraAccList-${study_id}.txt" "${base}efetch.fcgi?db=${db}&query_key=${key}&WebEnv=${web}&retmode=text&rettype=acclist"

        Comment

        Latest Articles

        Collapse

        • SEQadmin2
          Proteomic Platforms: How to Choose the Right Analytical Strategy to Improve Detection and Clinical Applications
          by SEQadmin2


          Proteomics platforms are evolving rapidly, with advances in mass spectrometry and affinity-based approaches expanding what researchers can detect and at what scale. As the field moves toward deeper proteome coverage and clinical applications, scientists face an increasingly complex landscape of tools. This article will explore how researchers are navigating these choices to find the right platform for their work.

          The systematic characterization of the human proteome has
          ...
          07-20-2026, 11:48 AM
        • SEQadmin2
          Advanced Sequencing Platforms Tackle Neuroscience’s Toughest Genomics Problems
          by SEQadmin2



          Genomics studies in neuroscience face a special challenge due to the brain’s complexity and scarcity of samples. Mapping changes in cell type and state using conventional next-generation sequencing methods remains challenging. Advances in technologies like single-cell sequencing, spatial transcriptomics, and long-read sequencing have opened the door to deeper studies of the brain and diseases like Alzheimer’s, amyotrophic lateral sclerosis (ALS), and schizophrenia.
          ...
          07-09-2026, 11:10 AM
        • SEQadmin2
          Cancer Drug Resistance: The Lingering Barrier to Rising Survival
          by SEQadmin2



          Cancer survival rates have significantly increased in the last few decades in the United States, reaching a combined 70% 5-year survival rate by 2021. Behind this number, there are years of research to find new therapies, drug targets, and early detection methods. But there is one core challenge that keeps slowing down these advances, and it’s about drug resistance.

          There is no single reason why many patients don’t respond to treatment as expected. Cancer is...
          07-08-2026, 05:17 AM

        ad_right_rmr

        Collapse

        News

        Collapse

        Topics Statistics Last Post
        Started by SEQadmin2, 07-24-2026, 12:17 PM
        0 responses
        29 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, 07-23-2026, 11:41 AM
        0 responses
        21 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, 07-20-2026, 11:10 AM
        0 responses
        212 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, 07-13-2026, 10:26 AM
        0 responses
        78 views
        0 reactions
        Last Post SEQadmin2  
        Working...