Skip to contents

Pulls all available sample IDs for a given study ID or sample list ID. Either a study ID or sample list ID must be passed. If both sample_list and study_id are not NULL, sample_list ID will be searched and study_id will be ignored.

Usage

available_samples(study_id = NULL, sample_list_id = NULL, base_url = NULL)

Arguments

study_id

A character string indicating which study ID should be searched. Only 1 study ID allowed.

sample_list_id

A character string indicating which sample list ID should be searched. Only 1 sample list ID allowed.

base_url

The database URL to query If NULL will default to URL set with set_cbioportal_db(<your_db>)

Value

A dataframe of sample_ids in a given study

Examples

# \dontrun{
set_cbioportal_db("public")
#>  You are successfully connected!
#>  base_url for this R session is now set to "www.cbioportal.org/api" 
available_samples(study_id = "acc_tcga")
#> # A tibble: 92 × 4
#>    patientId    sampleId        sampleType          studyId 
#>    <chr>        <chr>           <chr>               <chr>   
#>  1 TCGA-OR-A5J1 TCGA-OR-A5J1-01 Primary Solid Tumor acc_tcga
#>  2 TCGA-OR-A5J2 TCGA-OR-A5J2-01 Primary Solid Tumor acc_tcga
#>  3 TCGA-OR-A5J3 TCGA-OR-A5J3-01 Primary Solid Tumor acc_tcga
#>  4 TCGA-OR-A5J4 TCGA-OR-A5J4-01 Primary Solid Tumor acc_tcga
#>  5 TCGA-OR-A5J5 TCGA-OR-A5J5-01 Primary Solid Tumor acc_tcga
#>  6 TCGA-OR-A5J6 TCGA-OR-A5J6-01 Primary Solid Tumor acc_tcga
#>  7 TCGA-OR-A5J7 TCGA-OR-A5J7-01 Primary Solid Tumor acc_tcga
#>  8 TCGA-OR-A5J8 TCGA-OR-A5J8-01 Primary Solid Tumor acc_tcga
#>  9 TCGA-OR-A5J9 TCGA-OR-A5J9-01 Primary Solid Tumor acc_tcga
#> 10 TCGA-OR-A5JA TCGA-OR-A5JA-01 Primary Solid Tumor acc_tcga
#> # ℹ 82 more rows
available_samples(sample_list_id = "acc_tcga_cna")
#> # A tibble: 90 × 2
#>    sampleId        sampleListId
#>    <chr>           <chr>       
#>  1 TCGA-OR-A5J1-01 acc_tcga_cna
#>  2 TCGA-OR-A5J2-01 acc_tcga_cna
#>  3 TCGA-OR-A5J3-01 acc_tcga_cna
#>  4 TCGA-OR-A5J4-01 acc_tcga_cna
#>  5 TCGA-OR-A5J5-01 acc_tcga_cna
#>  6 TCGA-OR-A5J6-01 acc_tcga_cna
#>  7 TCGA-OR-A5J7-01 acc_tcga_cna
#>  8 TCGA-OR-A5J8-01 acc_tcga_cna
#>  9 TCGA-OR-A5J9-01 acc_tcga_cna
#> 10 TCGA-OR-A5JA-01 acc_tcga_cna
#> # ℹ 80 more rows
# }