Skip to contents

Get Fusions By Sample ID

Usage

get_fusions_by_sample(
  sample_id = NULL,
  study_id = NULL,
  molecular_profile_id = NULL,
  sample_study_pairs = NULL,
  genes = NULL,
  panel = NULL,
  base_url = NULL
)

get_structural_variants_by_sample(
  sample_id = NULL,
  study_id = NULL,
  molecular_profile_id = NULL,
  sample_study_pairs = NULL,
  genes = NULL,
  panel = NULL,
  base_url = NULL
)

Arguments

sample_id

a vector of sample IDs (character)

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

molecular_profile_id

A string indicating the molecular profile ID from which to pull data. If ID supplied, will guess the molecular profile ID based on the study ID. Only 1 molecular profile ID can be passed. If mutations from more than 1 study needed, see sample_study_pairs

sample_study_pairs

A dataframe with columns: sample_id, study_id and molecular_profile_id (optional). Variations in capitalization of column names are accepted. This can be used in place of sample_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 overwrite sample_id, study_id, molecular_profile_id if also passed.

genes

A vector of Entrez ids or Hugo symbols. If Hugo symbols are supplied, they will be converted to entrez ids using the get_entrez_id() function. If panel and genes are both supplied, genes from both arguments will be returned. If both are NULL (default), it will return gene results for all available genomic data for that sample.

panel

One or more panel IDs to query (e.g. 'IMPACT468'). If panel and genes are both supplied, genes from both arguments will be returned. If both are NULL (default), it will return gene results for all available genomic data for that sample.

base_url

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

Value

A data frame of Fusions

Examples

# \dontrun{
set_cbioportal_db("public")
#>  You are successfully connected!
#>  base_url for this R session is now set to "www.cbioportal.org/api" 

#' # These return the same results
get_fusions_by_sample(sample_id = c("s_C_CAUWT7_P001_d"),
                 study_id = "prad_msk_2019")
#> The following parameters were used in query:
#> Study ID: "prad_msk_2019"
#> Molecular Profile ID: "prad_msk_2019_structural_variants"
#> Genes: "All available genes"
#> # A tibble: 1 × 44
#>   uniqueSampleKey uniquePatientKey molecularProfileId sampleId patientId studyId
#>   <chr>           <chr>            <chr>              <chr>    <chr>     <chr>  
#> 1 c19DX0NBVVdUN1… cF9DX0NBVVdUNzp… prad_msk_2019_str… s_C_CAU… p_C_CAUW… prad_m…
#> # ℹ 38 more variables: site1EntrezGeneId <int>, site1HugoSymbol <chr>,
#> #   site1EnsemblTranscriptId <chr>, site1Chromosome <chr>, site1Position <int>,
#> #   site1Contig <chr>, site1Region <chr>, site1RegionNumber <int>,
#> #   site1Description <chr>, site2EntrezGeneId <int>, site2HugoSymbol <chr>,
#> #   site2EnsemblTranscriptId <chr>, site2Chromosome <chr>, site2Position <int>,
#> #   site2Contig <chr>, site2Region <chr>, site2RegionNumber <int>,
#> #   site2Description <chr>, site2EffectOnFrame <chr>, ncbiBuild <chr>, …
get_structural_variants_by_sample(sample_id = c("s_C_CAUWT7_P001_d"),
                 study_id = "prad_msk_2019")
#> The following parameters were used in query:
#> Study ID: "prad_msk_2019"
#> Molecular Profile ID: "prad_msk_2019_structural_variants"
#> Genes: "All available genes"
#> # A tibble: 1 × 44
#>   uniqueSampleKey uniquePatientKey molecularProfileId sampleId patientId studyId
#>   <chr>           <chr>            <chr>              <chr>    <chr>     <chr>  
#> 1 c19DX0NBVVdUN1… cF9DX0NBVVdUNzp… prad_msk_2019_str… s_C_CAU… p_C_CAUW… prad_m…
#> # ℹ 38 more variables: site1EntrezGeneId <int>, site1HugoSymbol <chr>,
#> #   site1EnsemblTranscriptId <chr>, site1Chromosome <chr>, site1Position <int>,
#> #   site1Contig <chr>, site1Region <chr>, site1RegionNumber <int>,
#> #   site1Description <chr>, site2EntrezGeneId <int>, site2HugoSymbol <chr>,
#> #   site2EnsemblTranscriptId <chr>, site2Chromosome <chr>, site2Position <int>,
#> #   site2Contig <chr>, site2Region <chr>, site2RegionNumber <int>,
#> #   site2Description <chr>, site2EffectOnFrame <chr>, ncbiBuild <chr>, …
                 # }