Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

document interoperability with Bio.align #244

Open
orbeckst opened this issue Dec 8, 2022 · 0 comments
Open

document interoperability with Bio.align #244

orbeckst opened this issue Dec 8, 2022 · 0 comments
Labels
analysis For analysis modules atomgroup Relates to AtomGroups

Comments

@orbeckst
Copy link
Member

orbeckst commented Dec 8, 2022

Is your feature request related to a problem? Please describe.
MDAnalysis/mdanalysis#3950 deprecates align.sequence_alignment() and schedules it for removal for MDA 3.0. Therefore, there will remain no code that directly generates a pairwise alignment from two AtomGroups.

Describe the solution you'd like
Document the actual code that's currently in the function (see also the new Notes in the docs (after PR MDAnalysis/mdanalysis#3951 is merged):

      import Bio.Align.PairwiseAligner

      aligner = Bio.Align.PairwiseAligner(
         mode="global",
         match_score=match_score,
         mismatch_score=mismatch_penalty,
         open_gap_score=gap_penalty,
         extend_gap_score=gapextension_penalty)
      aln = aligner.align(reference.residues.sequence(format="Seq"),
                          mobile.residues.sequence(format="Seq"))

      # choose top alignment with highest score
      topalignment = aln[0]

The code is short and provides more flexibility to the user. We should have a short UG page that shows some basic interoperability with biopythons Bio.align module and mention how ResidueGroup can directly provide sequences as input for functions/classes in Bio.align.

Describe alternatives you've considered
Do nothing...

Additional context
This is the restructured text that could be used directly for a UG entry:

    If you prefer to work directly with :mod:`Bio.Align` objects then you can
    run your alignment with :class:`Bio.Alig.PairwiseAligner` as ::

      import Bio.Align.PairwiseAligner

      aligner = Bio.Align.PairwiseAligner(
         mode="global",
         match_score=match_score,
         mismatch_score=mismatch_penalty,
         open_gap_score=gap_penalty,
         extend_gap_score=gapextension_penalty)
      aln = aligner.align(reference.residues.sequence(format="Seq"),
                          mobile.residues.sequence(format="Seq"))

      # choose top alignment with highest score
      topalignment = aln[0]

    The ``topalignment`` is a :class:`Bio.Align.PairwiseAlignment` instance
    that can be used in your bioinformatics workflows.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analysis For analysis modules atomgroup Relates to AtomGroups
Projects
None yet
Development

No branches or pull requests

1 participant