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

Remove deprecated functionalities #624

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions doc/apidoc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
"File",
"TextFile"
],
"Temporary files" : [
"temp_dir",
"temp_file"
],
"Visualization utilities":[
"set_font_size_in_coord",
"AdaptiveFancyArrow"
Expand Down Expand Up @@ -260,16 +256,14 @@
"superimpose",
"superimpose_homologs",
"superimpose_without_outliers",
"AffineTransformation",
"superimpose_apply"
"AffineTransformation"
],
"Filters" : [
"filter_canonical_nucleotides",
"filter_nucleotides",
"filter_canonical_amino_acids",
"filter_amino_acids",
"filter_carbohydrates",
"filter_backbone",
"filter_peptide_backbone",
"filter_phosphate_backbone",
"filter_linear_bond_continuity",
Expand All @@ -281,17 +275,13 @@
"filter_highest_occupancy_altloc"
],
"Checks" : [
"check_id_continuity",
"check_atom_id_continuity",
"check_res_id_continuity",
"check_backbone_continuity",
"check_duplicate_atoms",
"check_bond_continuity",
"check_linear_continuity"
],
"Repair" : [
"renumber_atom_ids",
"renumber_res_ids",
"create_continuous_res_ids",
"infer_elements",
"create_atom_names"
Expand Down
1 change: 0 additions & 1 deletion src/biotite/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
__author__ = "Patrick Kunzmann"

from .file import *
from .temp import *
from .copyable import *
from .visualize import *
from .version import __version__, __version_tuple__
31 changes: 6 additions & 25 deletions src/biotite/application/viennarna/rnafold.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def run(self):
fasta_file.lines.append(self._constraints)
fasta_file.write(self._in_file)
self._in_file.flush()

options = [
"--noPS",
"-T", self._temperature,
Expand All @@ -87,11 +87,11 @@ def evaluate(self):

self._free_energy = free_energy
self._dotbracket = dotbracket

def clean_up(self):
super().clean_up()
cleanup_tempfile(self._in_file)

@requires_state(AppState.CREATED)
def set_temperature(self, temperature):
"""
Expand All @@ -104,7 +104,7 @@ def set_temperature(self, temperature):
The temperature.
"""
self._temperature = str(temperature)

@requires_state(AppState.CREATED)
def set_constraints(self, pairs=None, paired=None, unpaired=None,
downstream=None, upstream=None, enforce=False):
Expand Down Expand Up @@ -138,7 +138,7 @@ def set_constraints(self, pairs=None, paired=None, unpaired=None,
pairs, paired, unpaired, downstream, upstream
)
self._enforce = enforce

@requires_state(AppState.JOINED)
def get_free_energy(self):
"""
Expand All @@ -162,25 +162,6 @@ def get_free_energy(self):
"""
return self._free_energy

@requires_state(AppState.JOINED)
def get_mfe(self):
"""
Get the free energy (kcal/mol) of the suggested
secondary structure.

DEPRECATED: Use :meth:`get_free_energy()` instead.

Returns
-------
mfe : float
The minimum free energy.
"""
warnings.warn(
"'get_mfe()' is deprecated, use 'get_free_energy()' instead",
DeprecationWarning
)
return self.get_free_energy()

@requires_state(AppState.JOINED)
def get_dot_bracket(self):
"""
Expand Down Expand Up @@ -243,7 +224,7 @@ def get_base_pairs(self):
@staticmethod
def compute_secondary_structure(sequence, bin_path="RNAfold"):
"""
Compute the minimum free energy secondary structure of a
Compute the minimum free energy secondary structure of a
ribonucleic acid sequence using *ViennaRNA's* *RNAfold* software.

This is a convenience function, that wraps the
Expand Down
9 changes: 2 additions & 7 deletions src/biotite/database/rcsb/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@


_standard_url = "https://files.rcsb.org/download/"
_mmtf_url = "https://mmtf.rcsb.org/v1.0/full/"
_bcif_url = "https://models.rcsb.org/"
_fasta_url = "https://www.rcsb.org/fasta/entry/"

_binary_formats = ["mmtf", "bcif"]
_binary_formats = ["bcif"]


def fetch(pdb_ids, format, target_path=None, overwrite=False, verbose=False):
Expand All @@ -34,7 +33,7 @@ def fetch(pdb_ids, format, target_path=None, overwrite=False, verbose=False):
pdb_ids : str or iterable object of str
A single PDB ID or a list of PDB IDs of the structure(s)
to be downloaded.
format : {'pdb', 'pdbx', 'cif', 'mmcif', 'bcif', 'mmtf', 'fasta'}
format : {'pdb', 'pdbx', 'cif', 'mmcif', 'bcif', 'fasta'}
The format of the files to be downloaded.
``'pdbx'``, ``'cif'`` and ``'mmcif'`` are synonyms for
the same format.
Expand Down Expand Up @@ -120,10 +119,6 @@ def fetch(pdb_ids, format, target_path=None, overwrite=False, verbose=False):
r = requests.get(_bcif_url + id + ".bcif")
content = r.content
_assert_valid_file(r.text, id)
elif format == "mmtf":
r = requests.get(_mmtf_url + id)
content = r.content
_assert_valid_file(r.text, id)
elif format == "fasta":
r = requests.get(_fasta_url + id)
content = r.text
Expand Down
24 changes: 0 additions & 24 deletions src/biotite/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,6 @@ class File(Copyable, metaclass=abc.ABCMeta):
:func:`write()` method is used.
"""

def __init__(self):
# Support for deprecated instance method 'read()':
# When creating an instance, the 'read()' class method is
# replaced by the instance method, so that subsequent
# 'read()' calls are delegated to the instance method
self.read = self._deprecated_read

@classmethod
@abc.abstractmethod
def read(cls, file):
Expand All @@ -54,23 +47,6 @@ def read(cls, file):
"""
pass

def _deprecated_read(self, file, *args, **kwargs):
"""
Support for deprecated instance method :func:`read()`.

Internally this calls the :func:`read()` class method and
replaces the data in `self` with the data from the newly created
:class:`File` object
"""
warnings.warn(
"Instance method 'read()' is deprecated, "
"use class method instead",
DeprecationWarning
)
cls = type(self)
new_file = cls.read(file, *args, **kwargs)
self.__dict__.update(new_file.__dict__)

@abc.abstractmethod
def write(self, file):
"""
Expand Down
6 changes: 0 additions & 6 deletions src/biotite/sequence/graphics/logo.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,6 @@ def plot_sequence_logo(axes, profile, scheme=None, **kwargs):

.. footbibliography::
"""
from matplotlib.text import Text

if isinstance(profile, Alignment):
warnings.warn("Using an alignment for this method is deprecated; use a profile instead", DeprecationWarning)
profile = SequenceProfile.from_alignment(profile)

alphabet = profile.alphabet
if not isinstance(alphabet, LetterAlphabet):
raise TypeError("The sequences' alphabet must be a letter alphabet")
Expand Down
Loading
Loading