Get clinical data by attribute, study ID and sample ID
Source:R/by_samples.R
get_clinical_by_sample.Rd
Get clinical data by attribute, study ID and sample ID
Usage
get_clinical_by_sample(
study_id = NULL,
sample_id = NULL,
sample_study_pairs = NULL,
clinical_attribute = NULL,
base_url = NULL
)
Arguments
- study_id
A string indicating the study ID from which to pull data. If no study ID, will guess the study ID based on your URL and inform. Only 1 study ID can be passed. If mutations/cna from more than 1 study needed, see
sample_study_pairs
- sample_id
a vector of sample IDs (character)
- sample_study_pairs
A dataframe with columns:
sample_id
,study_id
andmolecular_profile_id
(optional). Variations in capitalization of column names are accepted. This can be used in place ofsample_id
,study_id
,molecular_profile_id
arguments above if you need to pull samples from several different studies at once. If passed this will take overwritesample_id
,study_id
,molecular_profile_id
if also passed.- clinical_attribute
one or more clinical attributes for your study. If none provided, will return all attributes available for studies
- base_url
The database URL to query If
NULL
will default to URL set withset_cbioportal_db(<your_db>)
Examples
# \dontrun{
get_clinical_by_sample(study_id = "acc_tcga", sample_id = "TCGA-OR-A5J2-01",
clinical_attribute = "CANCER_TYPE", base_url = 'www.cbioportal.org/api')
#> # A tibble: 1 × 7
#> uniqueSampleKey uniquePatientKey sampleId patientId studyId
#> <chr> <chr> <chr> <chr> <chr>
#> 1 VENHQS1PUi1BNUoyLTAxOmFjY190Y2dh VENHQS1PUi1BNUoyO… TCGA-OR… TCGA-OR-… acc_tc…
#> # ℹ 2 more variables: clinicalAttributeId <chr>, value <chr>
ex <- tibble::tribble(
~sample_id, ~study_id,
"P-0001453-T01-IM3", "blca_nmibc_2017",
"P-0002166-T01-IM3", "blca_nmibc_2017",
"P-0003238-T01-IM5", "blca_nmibc_2017",
"P-0000004-T01-IM3", "msk_impact_2017",
"P-0000023-T01-IM3", "msk_impact_2017")
x <- get_clinical_by_sample(sample_study_pairs = ex,
clinical_attribute = NULL, base_url = 'www.cbioportal.org/api')
#> ! No `clinical_attribute` passed. Defaulting to returning
#> all clinical attributes in "blca_nmibc_2017" study
#> ! No `clinical_attribute` passed. Defaulting to returning
#> all clinical attributes in "msk_impact_2017" study
# }