mirror of
https://github.com/biopython/biopython.git
synced 2025-10-20 13:43:47 +08:00
deprecating the SummaryInfo class in Bio.Align.AlignInfo (#5069)
This commit is contained in:
@ -12,8 +12,13 @@ be put into classes in this module.
|
||||
"""
|
||||
|
||||
|
||||
import warnings
|
||||
|
||||
from Bio import BiopythonDeprecationWarning
|
||||
|
||||
|
||||
class SummaryInfo:
|
||||
"""Calculate summary info about the alignment.
|
||||
"""Calculate summary info about the alignment. (DEPRECATED)
|
||||
|
||||
This class should be used to calculate information summarizing the
|
||||
results of an alignment. This may either be straight consensus info
|
||||
@ -25,6 +30,22 @@ class SummaryInfo:
|
||||
|
||||
ic_vector attribute. A list of ic content for each column number.
|
||||
"""
|
||||
warnings.warn(
|
||||
"""\
|
||||
The class SummaryInfo has been deprecated. Instead of
|
||||
|
||||
>>> align_info = AlignInfo.SummaryInfo(msa)
|
||||
>>> sequence = align_info.get_column(1)
|
||||
|
||||
please use
|
||||
|
||||
>>> alignment = msa.alignment # to get a new-style Alignment object
|
||||
>>> sequence = alignment[:, 1]
|
||||
|
||||
Here, `msa` is a MultipleSeqAlignment object and `alignment` is an
|
||||
`Alignment` object.""",
|
||||
BiopythonDeprecationWarning,
|
||||
)
|
||||
self.alignment = alignment
|
||||
self.ic_vector = []
|
||||
|
||||
|
@ -114,8 +114,9 @@ wrapped is no longer available since SCOP moved to the EBI website.
|
||||
Bio.AlignInfo
|
||||
-------------
|
||||
The ``pos_specific_score_matrix`` method of the ``SummaryInfo`` class and the
|
||||
``PSSM`` class were deprecated in release 1.82, and removed in release 1.85. As
|
||||
an alternative, please use the ``alignment`` property of a ``MultipleSeqAlignment``
|
||||
``PSSM`` class were deprecated in release 1.82, and removed in release 1.85.
|
||||
The ``SummaryInfo`` class itself was deprecated in release 1.86. As an
|
||||
alternative, please use the ``alignment`` property of a ``MultipleSeqAlignment``
|
||||
object to obtains a new-style ``Alignment`` object, and use it to create a
|
||||
``Bio.motifs.Motif`` object. For example,
|
||||
|
||||
|
@ -394,7 +394,8 @@ T: 7.00 0.00 7.00 0.00 0.00 0.00 7.00 6.00 0.00 0.00 0.00
|
||||
""",
|
||||
)
|
||||
|
||||
align_info = AlignInfo.SummaryInfo(msa)
|
||||
with self.assertWarns(BiopythonDeprecationWarning):
|
||||
align_info = AlignInfo.SummaryInfo(msa)
|
||||
self.assertEqual(align_info.get_column(1), "AAAAAAA")
|
||||
self.assertEqual(align_info.get_column(7), "TTTATTT")
|
||||
|
||||
|
Reference in New Issue
Block a user