Nothing
setGeneric('filterFusions', function(object , filtered
, mode = c("exclude" , "keep")) {
standardGeneric('filterFusions')
})
setMethod('filterFusions', 'CancerPanel', function(object , filtered
, mode = c("exclude" , "keep"))
{
if(!is.character(filtered)){
stop("filtered must be a character vector")
}
mode <- mode[1]
if(mode %notin% c("exclude" , "keep")){
stop("mode can only be exclude or keep")
}
if(identical(cpData(object) , list())){
stop("dataFull slot is empty, no data to filter. run getAlterations")
}
if(is.null(cpData(object)$fusions$data)){
stop("No fusion data to filter")
}
#---------------------------------
# Check fusion format
#
if(any(!grepl("__" , filtered))){
stop("Fusion format not recognized, it should be like gene1__gene2 "
, paste(filtered[!grepl("__" , filtered)], collapse=", "))
}
#-----------------------------------
# NOW LET'S FILTER
#
fus <- cpData(object)$fusions$data
if(mode == "exclude"){
myNewRows <- fus$FusionPair %notin% filtered
} else {
myNewRows <- fus$FusionPair %in% filtered
}
fus <- fus[ myNewRows , , drop=FALSE]
object@dataFull$fusions$data <- fus
object <- subsetAlterations(object)
return(object)
})
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.