Skip to content

Instantly share code, notes, and snippets.

@seandavi
Last active April 26, 2020 00:38
Show Gist options
  • Save seandavi/45d1be3ae32d0d2ee110811044afb62c to your computer and use it in GitHub Desktop.
Save seandavi/45d1be3ae32d0d2ee110811044afb62c to your computer and use it in GitHub Desktop.
import requests
results = requests.get("https://api.omicidx.cancerdatasci.org/sra/studies/ERP009142/runs?size=500")
results.json()
library(tibble)
library(jsonlite)
library(curl)
as_tibble(jsonlite::fromJSON(curl('https://api.omicidx.cancerdatasci.org/sra/studies/ERP009142/runs?size=500'))$hits)
# A tibble: 417 x 23
   cluster_name static_data_ava… study$pubmed_ids $identifiers $description $received $abstract $accession $published $title $center_name
   <chr>        <chr>            <list>           <list>       <chr>        <chr>     <chr>     <chr>      <chr>      <chr>  <chr>       
 1 public       1                <list [0]>       <df[,2] [2 … These data … 2015-06-… Genomic … ERP009142  2015-06-2… Genom… SC          
 2 public       1                <list [0]>       <df[,2] [2 … These data … 2015-06-… Genomic … ERP009142  2015-06-2… Genom… SC          
 3 public       1                <list [0]>       <df[,2] [2 … These data … 2015-06-… Genomic … ERP009142  2015-06-2… Genom… SC          
 4 public       1                <list [0]>       <df[,2] [2 … These data … 2015-06-… Genomic … ERP009142  2015-06-2… Genom… SC          
 5 public       1                <list [0]>       <df[,2] [2 … These data … 2015-06-… Genomic … ERP009142  2015-06-2… Genom… SC          
 6 public       1                <list [0]>       <df[,2] [2 … These data … 2015-06-… Genomic … ERP009142  2015-06-2… Genom… SC          
 7 public       1                <list [0]>       <df[,2] [2 … These data … 2015-06-… Genomic … ERP009142  2015-06-2… Genom… SC          
 8 public       1                <list [0]>       <df[,2] [2 … These data … 2015-06-… Genomic … ERP009142  2015-06-2… Genom… SC          
 9 public       1                <list [0]>       <df[,2] [2 … These data … 2015-06-… Genomic … ERP009142  2015-06-2… Genom… SC          
10 public       1                <list [0]>       <df[,2] [2 … These data … 2015-06-… Genomic … ERP009142  2015-06-2… Genom… SC          
# … with 407 more rows, and 63 more variables: $study_type <chr>, $insdc <lgl>, $alias <chr>, $attributes <list>, $lastupdate <chr>,
#   $BioProject <chr>, $status <chr>, total_spots <chr>, avg_length <int>, sample_accession <chr>, experiment_accession <chr>,
#   received <chr>, accession <chr>, published <chr>, sample$organism <chr>, $identifiers <list>, $xrefs <list>, $taxon_id <chr>,
#   $received <chr>, $accession <chr>, $published <chr>, $title <chr>, $BioSample <chr>, $insdc <lgl>, $alias <chr>, $attributes <list>,
#   $lastupdate <chr>, $status <chr>, study_accession <chr>, size <chr>, experiment$library_layout <chr>, $identifiers <list>,
#   $sample_accession <chr>, $xrefs <list>, $received <chr>, $accession <chr>, $published <chr>, $title <chr>, $library_strategy <chr>,
#   $platform <chr>, $study_accession <chr>, $center_name <chr>, $library_layout_length <int>, $insdc <lgl>, $instrument_model <chr>,
#   $design <chr>, $alias <chr>, $library_name <chr>, $attributes <list>, $library_selection <chr>, $lastupdate <chr>,
#   $library_source <chr>, $library_construction_protocol <chr>, $status <chr>, insdc <lgl>, load_done <lgl>, is_public <lgl>,
#   alias <chr>, qualities <list>, attributes <list>, total_bases <chr>, lastupdate <chr>, status <chr>
> library(tibble)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment