diff --git a/modules/070_DART-ID/dart_00_pep_scatter.R b/modules/070_DART-ID/dart_00_pep_scatter.R index 41b5942..eb2f246 100644 --- a/modules/070_DART-ID/dart_00_pep_scatter.R +++ b/modules/070_DART-ID/dart_00_pep_scatter.R @@ -12,8 +12,8 @@ init <- function() { # ensure that table has the DART-ID PEP validate(need( - 'pep_updated' %in% colnames(data()[['evidence']]), - paste0('Provide evidence.txt from DART-ID output, with updated PEP column') + 'dart_PEP' %in% colnames(data()[['evidence']]), + paste0('Provide evidence.txt from DART-ID output, with updated dart_PEP column') )) } @@ -22,12 +22,12 @@ init <- function() { conf_limit <- 1e-8 ev.f <- data()[['evidence']] %>% - dplyr::select(c('Sequence', 'PEP', 'pep_new')) %>% - dplyr::filter(!is.na(pep_new)) %>% - dplyr::filter(PEP > 0 & pep_new > 0 & PEP > conf_limit & pep_new > conf_limit) %>% - dplyr::mutate_at(c('PEP', 'pep_new'), funs(ifelse(. > 1, 1, .))) %>% + dplyr::select(c('Sequence', 'PEP', 'dart_PEP')) %>% + dplyr::filter(!PEP == dart_PEP) %>% + dplyr::filter(PEP > 0 & dart_PEP > 0 & PEP > conf_limit & dart_PEP > conf_limit) %>% + dplyr::mutate_at(c('PEP', 'dart_PEP'), funs(ifelse(. > 1, 1, .))) %>% dplyr::mutate(pep_log=log10(PEP), - pep_new_log=log10(pep_new)) + pep_new_log=log10(dart_PEP)) return(ev.f) } @@ -61,7 +61,7 @@ init <- function() { rng <- seq(-5, 0, 1) nbins <- 80 - ggplot(plotdata, aes(x=PEP, y=pep_new)) + + ggplot(plotdata, aes(x=PEP, y=dart_PEP)) + stat_bin2d(bins=nbins, drop=TRUE, geom='tile', aes(fill=..density..)) + geom_abline(slope=1, intercept=0, color='black', size=0.5) + geom_vline(xintercept=1e-2, linetype='dotted', color='black', size=0.5) + diff --git a/modules/070_DART-ID/dart_01_fdr_increase.R b/modules/070_DART-ID/dart_01_fdr_increase.R index b620e4a..132dd82 100644 --- a/modules/070_DART-ID/dart_01_fdr_increase.R +++ b/modules/070_DART-ID/dart_01_fdr_increase.R @@ -11,21 +11,22 @@ init <- function() { # ensure that table has the DART-ID PEP validate(need( - 'pep_updated' %in% colnames(data()[['evidence']]), - paste0('Provide evidence.txt from DART-ID output, with updated PEP column') + 'dart_PEP' %in% colnames(data()[['evidence']]), + paste0('Provide evidence.txt from DART-ID output, with updated dart_PEP column') )) } .plotdata <- function(data, input) { ev <- data()[['evidence']] ev <- ev %>% + filter(!is.na(PEP) & !is.na(dart_PEP)) %>% # ceil PEPs to 1 - dplyr::mutate_at(c('PEP', 'pep_updated'), funs(ifelse(. > 1, 1, .))) %>% + dplyr::mutate_at(c('PEP', 'dart_PEP'), funs(ifelse(. > 1, 1, .))) %>% # calculate q-values dplyr::mutate(qval=(cumsum(PEP[order(PEP)]) / seq(1, nrow(ev)))[order(order(PEP))], - qval_updated=(cumsum(pep_updated[order(pep_updated)]) / - seq(1, nrow(ev)))[order(order(pep_updated))]) + qval_updated=(cumsum(dart_PEP[order(dart_PEP)]) / + seq(1, nrow(ev)))[order(order(dart_PEP))]) # flag peptides that don't have a single confident ID across all sets new_peptides <- ev %>% diff --git a/modules/070_DART-ID/dart_03_ids_per_exp.R b/modules/070_DART-ID/dart_03_ids_per_exp.R index 06b4024..bba4a47 100644 --- a/modules/070_DART-ID/dart_03_ids_per_exp.R +++ b/modules/070_DART-ID/dart_03_ids_per_exp.R @@ -11,8 +11,8 @@ init <- function() { # ensure that table has the DART-ID residual RT validate(need( - 'pep_updated' %in% colnames(data()[['evidence']]), - paste0('Provide evidence.txt from DART-ID output, with residual RT column \"residual\"') + 'dart_PEP' %in% colnames(data()[['evidence']]), + paste0('Provide evidence.txt from DART-ID output, with updated dart_PEP column.') )) } @@ -21,12 +21,12 @@ init <- function() { ev <- data()[['evidence']] plotdata <- ev %>% - dplyr::select(c('Raw.file', 'Modified.sequence', 'PEP', 'pep_updated')) %>% + dplyr::select(c('Raw.file', 'Modified.sequence', 'PEP', 'dart_PEP')) %>% dplyr::group_by(Raw.file) %>% dplyr::summarise( file=unique(Raw.file), - ids=sum(PEP < 0.01), - new_ids=sum(pep_updated < 0.01)) + ids=sum(PEP < 0.01, na.rm=T), + new_ids=sum(dart_PEP < 0.01, na.rm=T)) return(plotdata) }