Skip to content

callAltTranslation: Required flags cause BioPython crash on stop codons #948

@askolari

Description

@askolari

Bug Description
callAltTranslation has an issue that makes it unusable in v1.4.6:

  1. Tool requires at least one flag:

    • --selenocysteine-termination OR
    • --w2f-reassignment
  2. Without flags: ValueError: At least one of --selenocysteine-termination and --w2f-reassignment must be given.

  3. With either flag: Tool crashes after ~1h runtime:

   ValueError: ''*'' is not a valid unambiguous letter for protein

at Bio/SeqUtils/__init__.py:474 in molecular_weight()

Root Cause
Both flags generate peptides containing stop codons (*), which BioPython's
molecular_weight() function cannot handle when checking --min-mw threshold.

Environment

  • moPepGen: v1.4.6
  • Python: 3.9
  • Reference: Ensembl 114
  • BioPython: (via moPepGen dependencies)

Expected Behavior
Tool should either:

  1. Filter out stop-codon-containing peptides before molecular weight check, OR
  2. Skip molecular weight validation for these specific peptide types, OR
  3. Make flags truly optional (don't require at least one)

Workaround
Currently none - callAltTranslation is completely unusable.

Steps to Reproduce

moPepGen callAltTranslation \
  --index-dir /path/to/index \
  --reference-source ENSEMBL \
  --output-path output.fasta \
  --selenocysteine-termination \
  --cleavage-rule trypsin \
  --miscleavage 2 \
  --min-length 7 \
  --max-length 25 \
  --min-mw 500.0

Crashes after ~1 hour at peptide validation stage.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions