Commit 7907588b authored by gohr's avatar gohr

adds fc_thresh_degs to featcounts_deseq_mf

parent 5bd70995
......@@ -34,6 +34,7 @@ Options:
--contrasts=<tab_delim_table> Table with sample pairs for which dge analysis should be performed
--qcutoff <qcutoff> Use a q-value cutoff of 0.01 instead of a q-value cutoff [default: 0.01]
--pcutoff <pcutoff> Override q-value filter and filter by p-value instead
--fc_thresh_degs <n> DEGs must have a fold change larger than or equal n or smaller than or equal 1/n; n=0 deactivates this condition [default: 0]
--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 formula for DeSeq with contrast attribute at the end [default: condition]
......@@ -86,6 +87,7 @@ assert(is.null(gtf_file) || file.exists(gtf_file), "invalid gene_info_file")
resultsBase = if (!is.null(opts$out)) paste0(opts$out, ".") else ""
fc_thresh_degs=if (is.null(opts$fc_thresh_degs)) 0 else as.numeric(opts$fc_thresh_degs)
pcutoff = if (is.null(opts$pcutoff))NULL else as.numeric(opts$pcutoff)
qcutoff = if (is.numeric(pcutoff))NULL else as.numeric(opts$qcutoff)
if (is.numeric(pcutoff))opts$qcutoff = NULL
......@@ -521,12 +523,14 @@ deResults %>% ggplot(aes(c1_over_c2_logfc)) +
# report hit criterion
#+ results='asis'
log2_fc_thresh_degs= -Inf
if(fc_thresh_degs!=0){log2_fc_thresh_degs=log2(fc_thresh_degs)}
if (! is.null(qcutoff)) {
echo("Using q-value cutoff of", qcutoff)
deResults %<>% transform(is_hit = padj <= qcutoff)
deResults %<>% transform(is_hit = padj <= qcutoff & !is.na(c1_over_c2_logfc) & abs(c1_over_c2_logfc)>=log2_fc_thresh_degs)
}else {
echo("Using p-value cutoff of", pcutoff)
deResults %<>% transform(is_hit = pvalue <= pcutoff)
deResults %<>% transform(is_hit = pvalue <= pcutoff & !is.na(c1_over_c2_logfc) & abs(c1_over_c2_logfc)>=log2_fc_thresh_degs)
}
#deResults %<>% mutate(is_hit=pvalue<0.05)
......
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