Skip to content

Commit

Permalink
Error when sample group with only one sample is encountered
Browse files Browse the repository at this point in the history
  • Loading branch information
glormph committed Sep 1, 2022
1 parent 005373f commit fdcc9f6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -1474,7 +1474,10 @@ process proteinPeptideSetMerge {
# exchange sample names on isobaric fields in header
# First add NO__GROUP marker for no-samplegroups clean sampletable from special chars
${params.sampletable ? 'awk -v FS="\\t" -v OFS="\\t" \'{if (NF==3) print $1,$2,$3,"NO__GROUP"; else print}\' sampletable > tmpsam && mv tmpsam sampletable' : ''}
# Check if there are samplegroups at all
${params.deqms ? 'grep -v NO__GROUP sampletable || (>&2 echo "Cannot run DEqMS without specified sample groups" && exit 1)': ''}
# Count amount samples per group and error on group with only one sample
${params.deqms ? "grep -v NO__GROUP sampletable | cut -f 4 | sort | uniq -c | sed 's/\\s*//' | grep '^1 ' && (>&2 echo 'Cannot run DEqMS when any sample groups have only one sample, please review input' && exit 1)" : ''}
# strip lead/trail space in set name
paste <(cut -f1 sampletable) <(cut -f2 sampletable | sed "s/^\\s*//;s/\\s*\$//") <(cut -f3-4 sampletable) > nowhitespace && mv nowhitespace sampletable
# substitute other weird characters
Expand Down

0 comments on commit fdcc9f6

Please sign in to comment.