althonos / althonos/peptides.py
profile() silently returns an empty sequence when window exceeds peptide length
- Lenguaje dominante
- Python
- Estrellas
- 124
- Forks
- 20
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
I ran into this while computing physicochemical profiles for short peptides (2–6 residues) as part of a bioactive-peptide QSAR project. Peptide.profile() documents that when window is larger than the number of residues in the peptide, an empty sequence is returned but this is easy to hit unintentionally with short peptides and the caller just simply gets [] back.
Question for the maintainer
Would you prefer profile() (and any other windowed methods affected the same way) to clamp window to len(sequence) or raise a clear ValueError
I noticed that hydrophobic_moment already handles this case by limiting the window to the peptide length, so I wanted to check whether the same convention would be appropriate for profile().
Either way, I'd be happy to add explicit test coverage for this edge case. If the intended behavior is clear, I can prepare a focused PR.
Guía de contribución
Evaluación
Este issue todavía no se ha evaluado.