filterMutations {PrecisionTrialDrawer} | R Documentation

## filterMutations: remove or keep specified mutations

### Description

This method allows to keep only or to exclude certain mutations according to three different filtering formats

### Usage

    filterMutations(object
    , filtered=NULL
    , bed = NULL
    , mode = c("exclude" , "keep")
    , tumor_type=NULL)

### Arguments

`object` | An instance of class CancerPanel
`filtered` | A data.frame used as filter
`bed` | A data.frame in bed format (chr start end)
`mode` | If "exclude", mutations are removed from the object. If "keep", mutations specified in filtered are the only ones maintained.
`tumor_type` | A vector of tumor_type names. The filter will be active only on the specified tumor types

### Details

filtered data.frame can come in three different formats:

1. "gene_symbol" , "amino_position" Ex. BRAF 600

2. "gene_symbol" , "amino_acid_change" Ex. BRAF V600E

3. "genomic_poistion" Ex. 3:1234567:A,C

bed file must be composed by 3 columns: chrN, start 0-base , end 1-base

At the end of the filtering procedure, subsetAlterations is automatically run.

### Value

An updated instance of class CancerPanel

### Author(s)

Giorgio Melloni , Alessandro Guida

### References

data origin for mutations , copynumber and expression data

data origin for fusion data

### See Also

`getAlterations` `subsetAlterations` `filterFusions`

### Examples

    # Retrieve example data
    data(cpObj)
    # Create a data.frame to filter
    myFilter <- data.frame(gene_symbol = c("BRAF" , "PIK3CA")
        , amino_position = c(600 , 118))
    # Keep only myFilter mutations
    cpObjKeep <- filterMutations(cpObj , filtered = myFilter , mode = "keep")
    # Exclude myFilter mutations
    cpObjExclude <- filterMutations(cpObj , filtered = myFilter , mode = "exclude")

    # Create a bed file
    myBed <- data.frame(chr = paste0("chr" , c(7 , 17))
        , start = c(140534632 , 41244326)
        , end = c(140534732 , 41244426) , stringsAsFactors=FALSE)
    # Keep only myFilter mutations
    cpObjKeep <- filterMutations(cpObj , bed = myBed , mode = "keep")
    # Exclude myBed mutations
    cpObjExclude <- filterMutations(cpObj , bed = myBed , mode = "exclude")

[Package PrecisionTrialDrawer version 1.6.0 Index]