Fix shuffled NetMHCpan/NetMHCIIpan allele labels in merged/best_allele output (fixes #358)#359
Merged
jonasscheid merged 3 commits intoJun 15, 2026
Conversation
…he xls header (fixes nf-core#358) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Member
|
Warning Newer version of the nf-core template is available. Your pipeline is using an old version of the nf-core template: 3.5.2. For more documentation on how to update your pipeline, please see the nf-core documentation and Synchronisation documentation. |
…slabels alleles when a samplesheet allele has a stray space (nf-core#358) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
steffenlem
approved these changes
Jun 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #358.
MERGE_PREDICTIONSreconstructed which allele each NetMHC output column belonged to fromsorted(meta.alleles). This is wrong whenever the pipeline's sort order diverges from the predictor's output column order: the rank/BA values (tied to their column position) stay correct, but the allele labels — and the downstreambest_allele— get shuffled. Two real triggers::(DPB1*10:01→DPB11001). Combined with variable-width first fields (10vs107), the:(ASCII 58, sorts after digits) flips the order relative to the pipeline's mhcgnomes sort....;C*07:01; C*07:04) makes' C*07:04'sort first (space = ASCII 32), rotating the whole column→allele mapping by one.The fix reads the authoritative allele order from the xls header row (each predictor labels every allele block there) instead of assuming
sorted(meta.alleles). This is robust to both triggers above and also fixes a latent misalignment when some requested alleles are unsupported by the predictor.Verified end-to-end with real NetMHCIIpan 4.3 (divergent
DPB1*10:01/DPB1*107:01) and real NetMHCpan 4.2 (the reported spaced-allele case): every allele now maps to its correct rank andbest_alleleis correct.PR checklist
nf-core pipelines lint).nextflow run . -profile test,docker --outdir <OUTDIR>).nextflow run . -profile debug,test,docker --outdir <OUTDIR>).docs/usage.mdis updated.docs/output.mdis updated.CHANGELOG.mdis updated.README.mdis updated (including new tool citations and authors/contributors).