Skip to contents

htan_tables() lists the tables in the snapshot with their category, row count and ISB-CGC source. htan_tbl() opens one as a lazy dbplyr table, so dplyr::filter(), dplyr::select() and joins run in DuckDB until you dplyr::collect(). htan_columns() describes columns, using the BigQuery column descriptions recorded in the manifest.

Usage

htan_tables(con = htan_con())

htan_tbl(name, con = htan_con())

htan_columns(table = NULL, con = htan_con())

Arguments

con

A connection from htan_con().

name

character(1). A table name from htan_tables(), e.g. "biospecimen" or "scRNAseq_level4_metadata".

table

character() or NULL. Restrict to these tables.

Value

htan_tables() and htan_columns(): a tibble. htan_tbl(): a lazy tbl_duckdb_connection.

Examples

fixture <- system.file("extdata", "snapshot", package = "HTAN")
con <- htan_con("r7", base_url = fixture)
htan_tables(con)
#> # A tibble: 78 × 5
#>    name                                     category  rows source source_version
#>    <chr>                                    <chr>    <dbl> <chr>  <chr>         
#>  1 10xvisium_spatialtranscriptomics_auxili… metadata     7 isb-c… r7            
#>  2 10xvisium_spatialtranscriptomics_scRNAs… metadata    14 isb-c… r7            
#>  3 10xvisium_spatialtranscriptomics_scRNAs… metadata     7 isb-c… r7            
#>  4 10xvisium_spatialtranscriptomics_scRNAs… metadata    42 isb-c… r7            
#>  5 10xvisium_spatialtranscriptomics_scRNAs… metadata     7 isb-c… r7            
#>  6 10xxenium_spatialtranscriptomics_experi… metadata     0 isb-c… r7            
#>  7 ScDNAseq_level1_metadata                 metadata     0 isb-c… r7            
#>  8 ScDNAseq_level2_metadata                 metadata     0 isb-c… r7            
#>  9 Slide_seqLevel1_metadata                 metadata     0 isb-c… r7            
#> 10 Slide_seqLevel2_metadata                 metadata     0 isb-c… r7            
#> # ℹ 68 more rows
htan_tbl("clinical_tier1_demographics", con)
#> # A query:  ?? x 23
#> # Database: DuckDB 1.5.6 [unknown@Linux 7.0.0-1017-azure:R 4.6.1/:memory:]
#>   HTAN_Participant_ID Age_Is_Obfuscated Component    Weeks_Gestation_at_Birth
#>   <chr>               <chr>             <chr>        <chr>                   
#> 1 HTA10_36            NA                Demographics NA                      
#> 2 HTA12_15            True              Demographics NA                      
#> 3 HTA12_251           True              Demographics NA                      
#> 4 HTA12_253           True              Demographics NA                      
#> 5 HTA5_1470           True              Demographics Unknown                 
#> 6 HTA5_1536           True              Demographics Unknown                 
#> 7 HTA5_1765           True              Demographics Unknown                 
#> 8 HTA5_1950           True              Demographics Unknown                 
#> 9 HTA7_1005           True              Demographics NA                      
#> # ℹ 19 more variables: Days_to_Death <chr>, Gender <chr>,
#> #   Country_of_Residence <chr>, Premature_At_Birth <chr>, Race <chr>,
#> #   Occupation_Duration_Years <chr>, Year_Of_Birth <chr>, Id <chr>,
#> #   Cause_of_Death <chr>, Days_to_Birth <chr>, entityId <chr>,
#> #   Cause_of_Death_Source <chr>, Days_to_Vital_Status_Reference <chr>,
#> #   Vital_Status <chr>, Year_of_Death <chr>, Ethnicity <chr>,
#> #   HTAN_Center <chr>, Manifest_Id <chr>, Manifest_Version <dbl>
htan_columns("gc_drs_map", con)
#> # A tibble: 5 × 4
#>   table      column            type   description                               
#>   <chr>      <chr>             <chr>  <chr>                                     
#> 1 gc_drs_map name              String Name of a file                            
#> 2 gc_drs_map entityId          String Synapse ID of entity                      
#> 3 gc_drs_map HTAN_Data_File_ID String Self-identifier for this data file - HTAN…
#> 4 gc_drs_map drs_uri           String GC-assigned DRS URI of file               
#> 5 gc_drs_map HTAN_Center       String Name of HTAN Center (e.g. HTAN HTAPP)