loadCNVcalls: loadCNVcalls

Description Usage Arguments Details Value Examples

View source: R/loadCNVcalls.R

Description

Loads CNV calls from a csv/tsv file

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
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:

Returns NULL if cnvs.file has no CNVs

Examples

1
2
3
# 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")

CNVfilteR documentation built on April 17, 2021, 6:06 p.m.