cdc-gov/an-aggregated-dataset-of-serially-collected-cr56-k9wj
Loading...

Query the Data Delivery Network

Query the DDN

The easiest way to query any data on Splitgraph is via the "Data Delivery Network" (DDN). The DDN is a single endpoint that speaks the PostgreSQL wire protocol. Any Splitgraph user can connect to it at data.splitgraph.com:5432 and query any version of over 40,000 datasets that are hosted or proxied by Splitgraph.

For example, you can query the an_aggregated_dataset_of_serially_collected table in this repository, by referencing it like:

"cdc-gov/an-aggregated-dataset-of-serially-collected-cr56-k9wj:latest"."an_aggregated_dataset_of_serially_collected"

or in a full query, like:

SELECT
    ":id", -- Socrata column ID
    "d9_inoc", -- Numerical columns reporting NW log10 titer/ml collected from the inoculated ferret, in the units specified in units. NA, no NW was collected that day (due to every-other-day sampling schedule, or because the ferret was euthanized due to reaching humane endpoints for the study). Day is identified in the d# format (i.e. d9 is day 9 titer).
    "d8_inoc", -- Numerical columns reporting NW log10 titer/ml collected from the inoculated ferret, in the units specified in units. NA, no NW was collected that day (due to every-other-day sampling schedule, or because the ferret was euthanized due to reaching humane endpoints for the study). Day is identified in the d# format (i.e. d8 is day 8 titer).
    "d7_inoc", -- Numerical columns reporting NW log10 titer/ml collected from the inoculated ferret, in the units specified in units. NA, no NW was collected that day (due to every-other-day sampling schedule, or because the ferret was euthanized due to reaching humane endpoints for the study). Day is identified in the d# format (i.e. d7 is day 7 titer).
    "d6_inoc", -- Numerical columns reporting NW log10 titer/ml collected from the inoculated ferret, in the units specified in units. NA, no NW was collected that day (due to every-other-day sampling schedule, or because the ferret was euthanized due to reaching humane endpoints for the study). Day is identified in the d# format (i.e. d6 is day 6 titer).
    "d5_inoc", -- Numerical columns reporting NW log10 titer/ml collected from the inoculated ferret, in the units specified in units. NA, no NW was collected that day (due to every-other-day sampling schedule, or because the ferret was euthanized due to reaching humane endpoints for the study). Day is identified in the d# format (i.e. d5 is day 5 titer).
    "d4_inoc", -- Numerical columns reporting NW log10 titer/ml collected from the inoculated ferret, in the units specified in units. NA, no NW was collected that day (due to every-other-day sampling schedule, or because the ferret was euthanized due to reaching humane endpoints for the study). Day is identified in the d# format (i.e. d4 is day 4 titer).
    "d3_inoc", -- Numerical columns reporting NW log10 titer/ml collected from the inoculated ferret, in the units specified in units. NA, no NW was collected that day (due to every-other-day sampling schedule, or because the ferret was euthanized due to reaching humane endpoints for the study). Day is identified in the d# format (i.e. d3 is day 3 titer).
    "d2_inoc", -- Numerical columns reporting NW log10 titer/ml collected from the inoculated ferret, in the units specified in units. NA, no NW was collected that day (due to every-other-day sampling schedule, or because the ferret was euthanized due to reaching humane endpoints for the study). Day is identified in the d# format (i.e. d2 is day 2 titer).
    "d1_inoc", -- Numerical columns reporting NW log10 titer/ml collected from the inoculated ferret, in the units specified in units. NA, no NW was collected that day (due to every-other-day sampling schedule, or because the ferret was euthanized due to reaching humane endpoints for the study). Day is identified in the d# format (i.e. d1 is day 1 titer).
    "temp_5", -- Numerical column that specifies the maximum increase in degrees Celsius (normalized from preinoculation baseline temperature) recorded in the inoculated animal between days 1-5 p.i. (animals with no recorded rise in temperature are reflected as 0).
    "temp_day", -- Numerical column that indicates the day p.i. the maximum percentage weight loss reported in temp was detected (animals with no recorded drop in weight are reflected as 0).
    "temp", -- Numerical column that specifies the maximum increase in degrees Celsius (normalized from preinoculation baseline temperature) recorded in the inoculated animal between days 1-14 p.i. (animals with no recorded rise in temperature are reflected as 0).
    "wt_loss_day", -- Numerical column that indicates the day p.i. the maximum percentage weight loss reported in wt_loss was detected (animals with no recorded drop in weight are reflected as 0).
    "wt_loss", -- Numerical column that specifies the maximum percentage weight loss (normalized from preinoculation baseline weight) recorded in the inoculated animal between days 1-14 p.i. (animals with no recorded drop in weight are reflected as 0).
    "origin", -- Categorical column indicating the host origin of the inoculating virus. Avian, isolated from avian host or originated from an avian species during a zoonotic spillover to humans; human, human origin; swine, swine origin; canine, canine origin; variant, human infection with swine-origin virus.
    "hpai", -- Binary column that indicates if the inoculating virus has been classified as a highly pathogenic avian influenza (HPAI) virus based on criteria of the intravenous pathogenicity index15 (TRUE) or is a low pathogenic avian influenza (LPAI) or non-avian virus (FALSE).
    "rd_trans", -- Binary column that indicates (when a respiratory droplet transmission assessment was conducted) if virus transmission was observed based on the criteria described in the Methods (TRUE) or not (FALSE). 
    "nw_typical", -- Binary column that indicates if every-other-day NW sample collection started on day 1 p.i. (TRUE) or day 2 p.i. (FALSE).
    "expt", -- Binary column that indicates if experimental results within the row are limited to virus-inoculated animals only (path) or if respiratory droplet transmissibility to a contact animal was concurrently assessed and reported within the row (RD).
    "units", -- Binary column that indicates if log10 titers reported in NW columns are reported as EID50 (titration in eggs, EID) or PFU (titration in cells, PFU). EID and PFU units are not interchangeable; see usage notes for limitations in drawing comparisons between viral titers derived from different units. 
    "inoc_dose", -- Numeric column that indicates the log10 infectious units used to intranasally inoculate the ferret (in a 1ml total volume, with virus diluted in PBS).
    "virus", -- Unique identifier for each virus used to inoculate ferrets in the dataset.
    "ferret", -- Unique observational ID for each individual animal in the dataset.
    "temp_5_day", -- Numerical column that indicates the day p.i. the maximum percentage weight loss reported in temp_5 was detected (animals with no recorded drop in weight are reflected as 0).
    "na", -- Categorical column indicating neuraminidase subtype of the inoculating virus.
    "lethal", -- Binary column that indicates if the ferret survived the 14 day p.i. inoculation period (FALSE) or was humanely euthanized between days 1-14 p.i. due to reaching experimental endpoints (TRUE).
    "hpai_mbaa", -- Binary column that indicates if the inoculating virus is a HPAI virus that includes a multibasic amino acid HA cleavage site (TRUE) or is a HPAI virus that does not include this molecular feature or is not identified as a HPAI virus (FALSE).
    "ha", -- Categorical column indicating hemagglutinin subtype of the inoculating virus.
    "lethal_day" -- Numerical column that indicates the day p.i. an animal was euthanized if humane endpoint criteria were reached (animals surviving the infection are reflected as 0).
FROM
    "cdc-gov/an-aggregated-dataset-of-serially-collected-cr56-k9wj:latest"."an_aggregated_dataset_of_serially_collected"
LIMIT 100;

Connecting to the DDN is easy. All you need is an existing SQL client that can connect to Postgres. As long as you have a SQL client ready, you'll be able to query cdc-gov/an-aggregated-dataset-of-serially-collected-cr56-k9wj with SQL in under 60 seconds.

Query Your Local Engine

Install Splitgraph Locally
bash -c "$(curl -sL https://github.com/splitgraph/splitgraph/releases/latest/download/install.sh)"
 

Read the installation docs.

Splitgraph Cloud is built around Splitgraph Core (GitHub), which includes a local Splitgraph Engine packaged as a Docker image. Splitgraph Cloud is basically a scaled-up version of that local Engine. When you query the Data Delivery Network or the REST API, we mount the relevant datasets in an Engine on our servers and execute your query on it.

It's possible to run this engine locally. You'll need a Mac, Windows or Linux system to install sgr, and a Docker installation to run the engine. You don't need to know how to actually use Docker; sgrcan manage the image, container and volume for you.

There are a few ways to ingest data into the local engine.

For external repositories, the Splitgraph Engine can "mount" upstream data sources by using sgr mount. This feature is built around Postgres Foreign Data Wrappers (FDW). You can write custom "mount handlers" for any upstream data source. For an example, we blogged about making a custom mount handler for HackerNews stories.

For hosted datasets (like this repository), where the author has pushed Splitgraph Images to the repository, you can "clone" and/or "checkout" the data using sgr cloneand sgr checkout.

Cloning Data

Because cdc-gov/an-aggregated-dataset-of-serially-collected-cr56-k9wj:latest is a Splitgraph Image, you can clone the data from Spltgraph Cloud to your local engine, where you can query it like any other Postgres database, using any of your existing tools.

First, install Splitgraph if you haven't already.

Clone the metadata with sgr clone

This will be quick, and does not download the actual data.

sgr clone cdc-gov/an-aggregated-dataset-of-serially-collected-cr56-k9wj

Checkout the data

Once you've cloned the data, you need to "checkout" the tag that you want. For example, to checkout the latest tag:

sgr checkout cdc-gov/an-aggregated-dataset-of-serially-collected-cr56-k9wj:latest

This will download all the objects for the latest tag of cdc-gov/an-aggregated-dataset-of-serially-collected-cr56-k9wj and load them into the Splitgraph Engine. Depending on your connection speed and the size of the data, you will need to wait for the checkout to complete. Once it's complete, you will be able to query the data like you would any other Postgres database.

Alternatively, use "layered checkout" to avoid downloading all the data

The data in cdc-gov/an-aggregated-dataset-of-serially-collected-cr56-k9wj:latest is 0 bytes. If this is too big to download all at once, or perhaps you only need to query a subset of it, you can use a layered checkout.:

sgr checkout --layered cdc-gov/an-aggregated-dataset-of-serially-collected-cr56-k9wj:latest

This will not download all the data, but it will create a schema comprised of foreign tables, that you can query as you would any other data. Splitgraph will lazily download the required objects as you query the data. In some cases, this might be faster or more efficient than a regular checkout.

Read the layered querying documentation to learn about when and why you might want to use layered queries.

Query the data with your existing tools

Once you've loaded the data into your local Splitgraph Engine, you can query it with any of your existing tools. As far as they're concerned, cdc-gov/an-aggregated-dataset-of-serially-collected-cr56-k9wj is just another Postgres schema.

Related Documentation:

Loading...