read_matrix: Import motifs from raw matrices.

View source: R/read_matrix.R

read_matrixR Documentation

Import motifs from raw matrices.

Description

Import simply formatted motifs.

Usage

read_matrix(file, skip = 0, type, positions = "columns",
  alphabet = "DNA", sep = "", headers = TRUE, rownames = FALSE,
  comment = NULL)

Arguments

file

character(1) File name.

skip

numeric(1) If not zero, will skip however many desired lines in the file before starting to read.

type

character(1) One of c('PCM', 'PPM', 'PWM', 'ICM'). If missing will try and guess which one.

positions

character(1) One of c('columns', 'rows'). Partial matching allowed. Indicate whether each position within a motif is represented as a row or a column in the file.

alphabet

character(1) One of c('DNA', 'RNA', 'AA'), or a string of letters.

sep

character(1) Indicates how individual motifs are separated. Set as NULL if there are no seperating lines between motifs (the default is to assume a blank line).

headers

logical(1), character(1) Indicating if and how to read names.

rownames

logical(1) Are there alphabet letters present as rownames?

comment

NULL, character(1) Character denoting lines to be considered comments.

Value

list universalmotif objects.

Author(s)

Benjamin Jean-Marie Tremblay, benjamin.tremblay@uwaterloo.ca

See Also

Other read_motifs: read_cisbp(), read_homer(), read_jaspar(), read_meme(), read_motifs(), read_transfac(), read_uniprobe()

Examples

   hocomoco <- system.file("extdata", "hocomoco.txt", package = "universalmotif")
   hocomoco <- read_matrix(hocomoco, headers = ">", positions = "rows")


bjmt/universalmotif documentation built on Nov. 16, 2024, 7:38 a.m.