Remove gene information from sgRNA data.frame

Description

This function is used to remove genes/gene information from a data.frame containing pooled CRISPR screen data. It is meant to exclude genes from the analysis and removes all entries belonging to a gene from the sgRNA data.frame.

Usage

1
2
gene.remove(data, namecolumn = 1, toremove = NULL,
extractpattern = expression("^(.+?)_.+") )

Arguments

data

data.frame with sgRNA readcounts. Must have one column with sgRNA names and one column with readcounts. Please note that the data must be formatted in a way, that gene names are included within the sgRNA name and can be extracted using the extractpattern expression. e.g. GENE_sgRNA1 -> GENE as gene name, _ as the separator and sgRNA1 as the sgRNA identifier.

namecolumn

integer, indicates in which column the names are stored

toremove

Vector of gene names that will be removed from sgRNA dataset. The gene name must be included in the sgRNA names in order to be extracted using the pattern defined in extractpattern. e.g. c=("gene1","gene2")

extractpattern

Regular Expression, used to extract the gene name from the sgRNA name. Please make sure that the gene name extracted is accesible by putting its regular expression in brackets (). The default value expression("^(.+?)_.+") will look for the gene name (.+?) in front of the separator _ and any character afterwards .+ e.g. gene1_anything .

Details

In a table with

DesignID fullmatch
AAK1_104_0 0
AAK1_105_0 197
AAK1_106_0 271
AAK1_107_0 1
AAK1_108_0 0

calling gene.remove(data.frame, toremove="AAK1", extractpattern = expression("^(.+?)_.+")) will remove all entries shown above, since AAK1 is the gene name, separated by an undescore _ from the sgRNA identifier.

Value

gene.remove returns a data.frame that has the same column dimensions as the input data.frame, however all rows in which toremove=gene is present, are deleted.

Note

none

Author(s)

Jan Winter

Examples

1
2
data(caRpools)
gene.remove(CONTROL1, toremove="AAK1", extractpattern = expression("^(.+?)_.+"))

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.