Skip to content

Conversation

@speleo3
Copy link
Contributor

@speleo3 speleo3 commented May 31, 2025

  • Bio.pairwise2 has been deprecated -> Use Bio.Align.PairwiseAligner instead
  • SeqRecord constructor: Using a string as the sequence is deprecated -> Convert to Seq

The changes are based on
https://github.com/speleo3/pymol-psico/blob/ae2b92c262bc/psico/seqalign.py

Unit testing:
Covered by tests/api/seqalign.py::TestSeqalign

- Bio.pairwise2 has been deprecated
  -> Use Bio.Align.PairwiseAligner instead
- SeqRecord constructor: Using a string as the sequence is deprecated
  -> Convert to Seq

The changes are based on
https://github.com/speleo3/pymol-psico/blob/ae2b92c262bc/psico/seqalign.py
@ye11owSub
Copy link
Contributor

🚀

Copy link
Member

@JarrettSJohnson JarrettSJohnson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM just a quick Q

aligner = PairwiseAligner(internal_open_gap_score=-10,
extend_gap_score=-.5,
substitution_matrix=blosum62)
assert aligner.mode == "global"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the intent here that we should always use global even if Biopython changes this as its default? If so, would a

aligner.mode = "global"

be more future-proof?

Copy link
Contributor Author

@speleo3 speleo3 May 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the intent is to always use global. The documentation of PairwiseAligner is a bit vague for my taste, it says that it "automatically chooses the appropriate alignment algorithm [...] based on the values of the gap scores". And it says "Specify the aligner mode as local to generate local alignments". So my understanding is that we get Needleman-Wunsch or an equivalent algorithm with the given gap scores, and that global is the default for that. I actually coded this 2 years ago, and I'm not 100% sure anymore if there was a strong reason for the assert. I think I just added it out of habit to verify my assumption.

I'd be fine to remove the assert, I think it's rather unlikely that they'll change that.

@JarrettSJohnson JarrettSJohnson merged commit d135920 into schrodinger:master May 31, 2025
15 checks passed
pslacerda pushed a commit to pslacerda/pymol-open-source that referenced this pull request Jun 20, 2025
- Bio.pairwise2 has been deprecated
  -> Use Bio.Align.PairwiseAligner instead
- SeqRecord constructor: Using a string as the sequence is deprecated
  -> Convert to Seq

The changes are based on
https://github.com/speleo3/pymol-psico/blob/ae2b92c262bc/psico/seqalign.py
@speleo3 speleo3 deleted the biopython-deprecated branch November 24, 2025 11:29
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.

3 participants