mirror of
https://github.com/biopython/biopython.git
synced 2025-10-20 21:53: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:
|
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
|
This class should be used to calculate information summarizing the
|
||||||
results of an alignment. This may either be straight consensus info
|
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.
|
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.alignment = alignment
|
||||||
self.ic_vector = []
|
self.ic_vector = []
|
||||||
|
|
||||||
|
@ -114,8 +114,9 @@ wrapped is no longer available since SCOP moved to the EBI website.
|
|||||||
Bio.AlignInfo
|
Bio.AlignInfo
|
||||||
-------------
|
-------------
|
||||||
The ``pos_specific_score_matrix`` method of the ``SummaryInfo`` class and the
|
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
|
``PSSM`` class were deprecated in release 1.82, and removed in release 1.85.
|
||||||
an alternative, please use the ``alignment`` property of a ``MultipleSeqAlignment``
|
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
|
object to obtains a new-style ``Alignment`` object, and use it to create a
|
||||||
``Bio.motifs.Motif`` object. For example,
|
``Bio.motifs.Motif`` object. For example,
|
||||||
|
|
||||||
|
@ -394,6 +394,7 @@ T: 7.00 0.00 7.00 0.00 0.00 0.00 7.00 6.00 0.00 0.00 0.00
|
|||||||
""",
|
""",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
with self.assertWarns(BiopythonDeprecationWarning):
|
||||||
align_info = AlignInfo.SummaryInfo(msa)
|
align_info = AlignInfo.SummaryInfo(msa)
|
||||||
self.assertEqual(align_info.get_column(1), "AAAAAAA")
|
self.assertEqual(align_info.get_column(1), "AAAAAAA")
|
||||||
self.assertEqual(align_info.get_column(7), "TTTATTT")
|
self.assertEqual(align_info.get_column(7), "TTTATTT")
|
||||||
|
Reference in New Issue
Block a user