loadCNVcalls: loadCNVcalls

View source: R/loadCNVcalls.R

loadCNVcallsR Documentation

loadCNVcalls

Description

Loads CNV calls from a csv/tsv file

Usage

loadCNVcalls(
  cnvs.file,
  chr.column,
  start.column,
  end.column,
  coord.column = NULL,
  cnv.column,
  sample.column,
  sample.name = NULL,
  gene.column = NULL,
  deletion = "deletion",
  duplication = "duplication",
  ignore.unexpected.rows = FALSE,
  sep = "\t",
  skip = 0,
  genome = "hg19",
  exclude.non.canonical.chrs = TRUE,
  check.names.cnvs.file = FALSE
)

Arguments

cnvs.file

Path to csv/tsv file containing the CNV calls.

chr.column

Which column stores the chr location of the CNV.

start.column

Which column stores the start location of the CNV.

end.column

Which column stores the end location of the CNV.

coord.column

CNV location in the chr:start-end format. Example: "1:538001-540000". If NULL, chr.column, start.column and end.column columns will be used. (Defaults to NULL)

cnv.column

Which column stores the type of CNV (deletion or duplication).

sample.column

Which column stores the sample name.

sample.name

Sample name for all CNVs defined in cnvs.file. If set, sample.column is ignored (Defaults to NULL)

gene.column

Which columns store the gene or genes affected (optional). (Defaults to NULL)

deletion

Text used in the cnv.column to represent deletion CNVs. Multiple values are also allowed, for example: c("CN0", "CN1"). (Defaults to "deletion")

duplication

Text used in the cnv.column to represent duplication CNVs. Multiple values are also allowed, for example: c("CN3", "CN4") (Defaults to "duplication")

ignore.unexpected.rows

Whether to ignore the rows which CNV cnv.column value is different to deletion or duplication values (Defaults to FALSE). It is useful for processing output from callers like LUMPY or Manta (they call also events that are not CNVs)

sep

Separator symbol to load the csv/tsv file. (Defaults to "\t")

skip

Number of rows that should be skipped when reading the csv/tsv file. (Defaults to 0)

genome

The name of the genome. (Defaults to "hg19")

exclude.non.canonical.chrs

Whether to exclude non canonical chromosomes (Defaults to TRUE)

check.names.cnvs.file

Whether to check cnvs.file names or not (Defaults to FALSE). If TRUE then column names in the cnvs.file are checked to ensure that they are syntactically valid variable names. If necessary they are adjusted (by make.names) so that they are, and also to ensure that there are no duplicates

Details

Loads a csv/tsv file containing CNV calls, and transform it into a GRanges with cnv and sample metadata columns.

Value

A GRanges with a range per each CNV and the metadata columns:

  • cnv: type of CNV, "duplication" or "deletion"

  • sample: sample name

Returns NULL if cnvs.file has no CNVs

Examples

# Load CNVs data
cnvs.file <- system.file("extdata", "DECoN.CNVcalls.csv", package = "CNVfilteR", mustWork = TRUE)
cnvs.gr <- loadCNVcalls(cnvs.file = cnvs.file, chr.column = "Chromosome", start.column = "Start", end.column = "End", cnv.column = "CNV.type", sample.column = "Sample")



jpuntomarcos/CNVfilteR documentation built on Oct. 6, 2023, 12:37 a.m.