Skip to content

Commit

Permalink
No PTM in any set was always triggered, because of the pipefail optio…
Browse files Browse the repository at this point in the history
…n in NF, so make it an explicit if statement
  • Loading branch information
glormph committed Dec 8, 2023
1 parent b1476e8 commit bc9c998
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bin/qc_protein.R
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,8 @@ if (feattype != 'peptides') {

# precursorarea
precursorcols = c(featcol, colnames(feats)[grep('area', colnames(feats))])
anyrowsms1 = nrow(feats[rowSums(is.na(feats[,precursorcols])) != length(precursorcols),])
if (length(precursorcols) > 1) {
anyrowsms1 = nrow(feats[rowSums(is.na(feats[,precursorcols])) != length(precursorcols),])
svg('precursorarea', height=(nrsets + 1), width=width)
if (anyrowsms1) {
parea = melt(feats, id.vars=featcol, na.rm=T, measure.vars = precursorcols[2:length(precursorcols)])
Expand Down
5 changes: 4 additions & 1 deletion main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -1301,7 +1301,10 @@ process createPTMLookup {
msstitch split -i "${ptmtable}" --splitcol bioset
${setnames.collect() { "test -f '${it}.tsv' || echo 'No PTMs found for set ${it}' >> warnings" }.join(' && ') }
# No PTMs at all overwrites the per-set messages
tail -n+2 ${ptmtable} | head | grep . >/dev/null || echo 'No PTMs found in any set' > warnings
if [[ \$(wc -l <ptm_psmtable.txt) -lt 2 ]]
then
echo 'No PTMs found in any set' > warnings
fi
"""
}

Expand Down

0 comments on commit bc9c998

Please sign in to comment.