Skip to content

Fix PR #87 review issues: Python bug fixes and .nf module safety#240

Open
johnoooh wants to merge 3 commits intoneoantigenfrom
fix/pr87-review
Open

Fix PR #87 review issues: Python bug fixes and .nf module safety#240
johnoooh wants to merge 3 commits intoneoantigenfrom
fix/pr87-review

Conversation

@johnoooh
Copy link
Collaborator

Summary

  • compute_fitness.py: Add zero-guards for empty score_list (sets R=0.0) and zero Kd/KdWT values (prevents ZeroDivisionError / log(0))
  • align_neoantigens_to_IEDB.py: Migrate to Bio.Align.PairwiseAligner API with fallback to deprecated pairwise2, add empty alignment guard (score=0.0), uppercase normalization on inputs
  • generate_input.py: Initialize PTC_exon = None before NMD loop to prevent UnboundLocalError; guard best_pepmatch2 against None before indexing; fix typo "nonsense_nutation" → "nonsense_mutation"
  • generateMutFasta.py: Fix same "nonsense_nutation" typo; add missing out_WT_fa.close() to prevent file handle leak
  • netmhcpan4/main.nf and netmhcstabpan/main.nf: Replace destructive cat >> ${inputFasta} with safe cat > combined_input.fa to avoid corrupting the staged input FASTA

  • This comment contains a description of changes (with reason).
  • Check to see if a nf-core module, or subworkflow is available and usable for your pipeline.
  • Feature branch is named feature/<module_name> for modules, or feature/<subworkflow_name> for subworkflows. For modules, if there is a subcommand use: feature/<module_name>/<module_subcommand>.
  • If you've fixed a bug or added code that should be tested, add tests!
  • If you've added a new tool - have you followed the module conventions in the contribution docs.
  • Use nf-core data if possible for nf-tests. If not, use or add test data to mskcc-omics-workflows/test-datasets, following the repository guidelines, for nf-tests. Finally, if neither option is feasible, only add a stub nf-test.
  • Remove all TODO statements.
  • Emit the versions.yml file.
  • Follow the naming conventions.
  • Follow the parameters requirements.
  • Follow the input/output options guidelines.
  • Add a resource label.
  • Use Jfrog if possible to fulfill software requirements.
  • Ensure that the test works with either Docker / Singularity. Conda CI tests can be quite flaky:
    • For modules:
      • nf-core modules --git-remote https://github.com/mskcc-omics-workflows/modules.git -b <module_branch> test <MODULE> --profile docker
      • nf-core modules --git-remote https://github.com/mskcc-omics-workflows/modules.git -b <module_branch> test <MODULE> --profile singularity
      • nf-core modules --git-remote https://github.com/mskcc-omics-workflows/modules.git -b <module_branch> test <MODULE> --profile conda
    • For subworkflows:
      • nf-core subworkflows --git-remote https://github.com/mskcc-omics-workflows/modules.git -b <subworkflow_branch> test <SUBWORKFLOW> --profile docker
      • nf-core subworkflows --git-remote https://github.com/mskcc-omics-workflows/modules.git -b <subworkflow_branch> test <SUBWORKFLOW> --profile singularity
      • nf-core subworkflows --git-remote https://github.com/mskcc-omics-workflows/modules.git -b <subworkflow_branch> test <SUBWORKFLOW> --profile conda

johnoooh and others added 3 commits February 20, 2026 12:22
- C1: Guard empty score_list and zero Kd/KdWT in compute_fitness.py
- C2: Add amino acid X support, missing-key guards, and variable-length
  epitope distance in EpitopeDistance.py
- C3: BioPython PairwiseAligner fallback, empty alignment guard, and
  uppercase normalization in align_neoantigens_to_IEDB.py
- C4: Initialize PTC_exon before loop and guard None best_pepmatch2
  in generate_input.py
- C5: Fix "nonsense_nutation" typo in generate_input.py and
  generateMutFasta.py
- I4: Replace destructive `cat >> inputFasta` with safe
  `cat > combined_input.fa` in netmhcpan4 and netmhcstabpan modules
- I5: Close leaked out_WT_fa file handle in generateMutFasta.py

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Keep only the amino acid X addition and docstring update. Revert
set_model() error handling and variable-length epitope_dist() changes
per review feedback.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Drop amino acid X and docstring change — the model JSON lacks
X->* entries, causing KeyError at runtime.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@johnoooh johnoooh requested review from a team and nikhil as code owners February 24, 2026 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant