GenomicAnnotationsFromfile: Function to create a GenomiAnnotations object from a text...

Description Usage Arguments Value Author(s) See Also Examples

View source: R/GenomicAnnotationsFromfile.R

Description

Function to create a GenomiAnnotations object from a text file

Usage

1
2
3
4
5
GenomicAnnotationsFromfile(file, ids_column, chr_column,
start_column, end_column, strand_column, chromosomesNumbers =
NULL, chromosomesLabels = NULL, chromosomesLabelsInput = NULL,
MinusStrandString = "-", PlusStrandString =
"+", optionalAnnotationsColumns = NULL, ...)

Arguments

file

Path to the input txt file containing genomic annotations

ids_column

Specify the column from the input txt file with gene (or other genomic features) ids. Can be specified using column index (numeric) or column name (character).

chr_column

Specify the column from the input txt file with chromosome annotations fields for each ids. Can be specified using column index (numeric) or column name (character).

start_column

Specify the column from the input txt file with genomic start position for each genomic element. Can be specified using column index (numeric) or column name (character).

end_column

Specify the column from the input txt file with genomic end position for each genomic element. Can be specified using column index (numeric) or column name (character).

strand_column

Specify the column from the input txt file with genomic strand mapping for each genomic element. Can be specified using column index (numeric) or column name (character).

chromosomesNumbers

Numeric vector to specify the list of numeric values to be associated to each chromosome (especially useful for chromosomes not associated to a number such as chr X or Y)

chromosomesLabels

Character vector to specify the list of character labels to be associated to each chromosome (especially useful for chromosomes not associated to a number such as chr X or Y)

chromosomesLabelsInput

Character vector to specify the list of character labels associated to each chromosome in the input file. Particularly useful when non numeric character strings are associated to eacforh chromosome in the input file: e.g. "chr3" for chromosome "3".

MinusStrandString

Character string used to identify minus strand in the input text file

PlusStrandString

Character string used to identify plus strand in the input text file

optionalAnnotationsColumns

Character vector of columns headers or numeric vector of columns indices to specify columns of the input file containing additional annotation fields

...

any other parameter for read.table function that could be useful for parsing the input file, such as "sep", "quote", "header", "na.strings" and other parameters.

Value

An object of class "GenomicAnnotations"

Author(s)

Francesco Ferrari

See Also

"GenomicAnnotations"

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
  ## Not run: 
 
data(PREDAsampledata)
 CNdataPath <- system.file("sampledata", "CopyNumber", package =
"PREDAsampledata")
CNannotationFile <- file.path(CNdataPath , "SNPAnnot100k.csv")

CNGenomicsAnnotations<-GenomicAnnotationsForPREDAFromfile(
  file=CNannotationFile,
  ids_column=1,
  chr_column="Chromosome",
  start_column=4,
  end_column=4,
  strand_column="Strand",
  chromosomesLabelsInput=1:22,
  MinusStrandString="-", PlusStrandString="+",
  optionalAnnotationsColumns=c("Cytoband", "Entrez_gene"),
  header=TRUE, sep=",", quote="\"", na.strings = c("NA", "",
  "---"))


  
## End(Not run)

PREDA documentation built on Nov. 8, 2020, 7:40 p.m.