## ----include = FALSE----------------------------------------------------------
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

## -----------------------------------------------------------------------------
library(SelectSim)
library(dplyr)
## Load the data provided with the package
data(luad_run_data, package = "SelectSim")

## -----------------------------------------------------------------------------
# Check the data structure
str(luad_run_data)

## -----------------------------------------------------------------------------
result_obj<- SelectSim::selectX(  M = luad_run_data$M,
                      sample.class = luad_run_data$sample.class,
                      alteration.class = luad_run_data$alteration.class,
                      n.cores = 1,
                      min.freq = 10,
                      n.permut = 1000,
                      lambda = 0.3,
                      tau = 1,
                      save.object = FALSE,
                      verbose = FALSE,
                      estimate_pairwise = FALSE,
                      maxFDR = 0.25)

## -----------------------------------------------------------------------------
head(result_obj$result[,1:10],n=5)

## -----------------------------------------------------------------------------
# Filtering significant hits and counting EDs
result_obj$result %>% filter(nFDR2<=0.25) %>% head(n=2)
result_obj$result %>% filter(nFDR2<=0.25) %>% count(type)

## -----------------------------------------------------------------------------
# Filtering significant hits and plotting
obs_exp_scatter(result = result_obj$result,title = 'TCGA LUAD')

## -----------------------------------------------------------------------------
# Print the sessionInfo
sessionInfo()

