Get all segments for a single (or multiple) sample_id(s).

get_sample_cn_segments(
  this_sample_id,
  multiple_samples = FALSE,
  sample_list,
  from_flatfile = TRUE,
  projection = "grch37",
  this_seq_type = "genome",
  with_chr_prefix = FALSE,
  streamlined = FALSE
)

Arguments

this_sample_id

Optional argument, single sample_id for the sample to retrieve segments for.

multiple_samples

Set to TRUE to return cn segments for multiple samples specified in samples_list parameter. Default is FALSE.

sample_list

Optional vector of type character with one sample per row, required if multiple_samples is set to TRUE.

from_flatfile

Set to TRUE by default.

projection

Selected genome projection for returned CN segments. Default is "grch37".

this_seq_type

Seq type for returned CN segments. One of "genome" (default) or "capture".

with_chr_prefix

Set to TRUE to add a chr prefix to chromosome names. Default is FALSE.

streamlined

Return a minimal output rather than full details. Default is FALSE.

Value

A data frame of segments for a specific or multiple sample ID(s).

Details

This function returns CN segments for samples. This works for single sample or multiple samples. For multiple samples, remember to set the Boolean parameter multiple_samples = TRUE and give the sample_lsit a vector of characters with one sample ID per row. For more information on how this function can be run in different ways, refer to the parameter descriptions, examples and vignettes. Is this function not what you are looking for? Try one of the following, similar, functions; assign_cn_to_ssm, get_cn_segments, get_cn_states,

Examples

# Return cn segments for multiple samples (read csv with one sample per line):
sample_list = readLines("../samples-test.csv")
#> Warning: cannot open file '../samples-test.csv': No such file or directory
#> Error in file(con, "r"): cannot open the connection
multiple_samples = get_sample_cn_segments(multiple_samples = TRUE, sample_list = sample_list)
#> Error in dplyr::filter(all_segs, ID %in% sample_list):  In argument: `ID %in% sample_list`.
#> Caused by error in `h()`:
#> ! error in evaluating the argument 'table' in selecting a method for function '%in%': object 'sample_list' not found
#Return cn segments for multiple samples (provided as vector of sample IDs):
these_sample_list = c("00-15201_tumorA", "00-15201_tumorB")

samples = get_sample_cn_segments(multiple_samples = TRUE,
                                 sample_list = these_sample_list)
# For capture
samples = get_sample_cn_segments(
 multiple_samples = TRUE,
 sample_list = these_sample_list,
 this_seq_type = "capture"
)