Skip to content

Commit

Permalink
adapt to latest DART-ID version
Browse files Browse the repository at this point in the history
  • Loading branch information
atc3 committed May 10, 2019
1 parent ebb4cd0 commit 2603a5f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 18 deletions.
16 changes: 8 additions & 8 deletions modules/070_DART-ID/dart_00_pep_scatter.R
Original file line number Diff line number Diff line change
Expand Up @@ -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')
))
}

Expand All @@ -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)
}
Expand Down Expand Up @@ -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) +
Expand Down
11 changes: 6 additions & 5 deletions modules/070_DART-ID/dart_01_fdr_increase.R
Original file line number Diff line number Diff line change
Expand Up @@ -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 %>%
Expand Down
10 changes: 5 additions & 5 deletions modules/070_DART-ID/dart_03_ids_per_exp.R
Original file line number Diff line number Diff line change
Expand Up @@ -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.')
))

}
Expand All @@ -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)
}
Expand Down

0 comments on commit 2603a5f

Please sign in to comment.