Commit d2b3f244 authored by domingue's avatar domingue
Browse files

Added alpha to results.

- now alpha takes the value of `qcutoff` if set
- if `qcutoff` is not set, then it defaults to 0.1
- fixed typo in argument description

Fixes #23
parent dcec0655
......@@ -36,7 +36,7 @@ Options:
--pcutoff <pcutoff> Override q-value filter and filter by p-value instead
--min_count <min_count> Minimal expression in any of the sample to be included in the final result list [default: 10]
--out <name_prefix> Name to prefix all generated result files
--design <formula> Design fomula for DeSeq with contrast attribute at the end [default: condition]
--design <formula> Design formula for DeSeq with contrast attribute at the end [default: condition]
--lfc <lfc_cutoff> Provide thresholds for constructing Wald tests of significance. Sets the lfcThreshold argument in the results function. [default: 1.0]
--ensembl_db <ensembl_db> Ensebmbl db to be used. If not specified inferred from data. TODO implement NONE here!!
--gene_info <info_file> Gene information file downloaded from the ensembl website if bioMart version is not present
......@@ -90,6 +90,13 @@ if (is.numeric(pcutoff))opts$qcutoff = NULL
lfc_cutoff = if (is.null(opts$lfc))0 else as.numeric(opts$lfc)
# set alpha for the results filtering
if (! is.null(qcutoff)) {
alphathres <- qcutoff
}else {
alphathres <- 0.1
}
## extract the sample for the design
designFormula = opts$design
## consider last element of design formula as sample attribute
......@@ -471,7 +478,7 @@ summary(results(dds))
deResults = plyr::alply(contrasts, 1, plyr::splat(function(condition_1, condition_2){
#DEBUG condition_1=as_df(contrasts)[1,1]; condition_2=as_df(contrasts)[1,2]
# results(dds, contrast=c(contrastAttribute, condition_1, condition_2)) %>%
results(dds, contrast = c(contrastAttribute, condition_1, condition_2), lfcThreshold = lfc_cutoff, filterFun = ihw) %>%
results(dds, contrast = c(contrastAttribute, condition_1, condition_2), lfcThreshold = lfc_cutoff, filterFun = ihw, alpha = alphathres) %>%
# results(dds, contrast = c(contrastAttribute, condition_1, condition_2), lfcThreshold = lfc_cutoff) %>%
as.data.frame() %>%
mutate(ensembl_gene_id = rownames(.)) %>%
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment