Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Upgrading obsolete code to deprecated code

  • Loading branch information...
commit 1b2025bee868b0282b913690a999833d13598ea4 1 parent 9dd2a94
Michiel de Hoon authored
View
8 Bio/Blast/Applications.py
@@ -32,6 +32,8 @@
BMC Bioinformatics 2009, 10:421
doi:10.1186/1471-2105-10-421
"""
+from Bio import BiopythonDeprecationWarning
+
from Bio.Application import _Option, AbstractCommandline, _Switch
@@ -213,7 +215,7 @@ class BlastallCommandline(_BlastAllOrPgpCommandLine):
#TODO - This could use more checking for valid parameters to the program.
def __init__(self, cmd="blastall",**kwargs):
import warnings
- warnings.warn("Like blastall, this wrapper is now obsolete, and will be deprecated and removed in a future release of Biopython.", PendingDeprecationWarning)
+ warnings.warn("Like blastall, this wrapper is now deprecated and will be removed in a future release of Biopython.", BiopythonDeprecationWarning)
self.parameters = [
#Sorted in the same order as the output from blastall --help
#which should make it easier to keep them up to date in future.
@@ -316,7 +318,7 @@ class BlastpgpCommandline(_BlastAllOrPgpCommandLine):
"""
def __init__(self, cmd="blastpgp",**kwargs):
import warnings
- warnings.warn("Like blastpgp (and blastall), this wrapper is now obsolete, and will be deprecated and removed in a future release of Biopython.", PendingDeprecationWarning)
+ warnings.warn("Like blastpgp (and blastall), this wrapper is now deprecated and will be removed in a future release of Biopython.", BiopythonDeprecationWarning)
self.parameters = [
_Option(["-C", "checkpoint_outfile"],
"Output file for PSI-BLAST checkpointing.",
@@ -395,7 +397,7 @@ class RpsBlastCommandline(_BlastCommandLine):
"""
def __init__(self, cmd="rpsblast",**kwargs):
import warnings
- warnings.warn("Like the old rpsblast (and blastall), this wrapper is now obsolete, and will be deprecated and removed in a future release of Biopython.", PendingDeprecationWarning)
+ warnings.warn("Like the old rpsblast (and blastall), this wrapper is now deprecated and will be removed in a future release of Biopython.", BiopythonDeprecationWarning)
self.parameters = [
#Note -N is also in blastpgp, but not blastall
_Option(["-N", "nbits_gapping"],
View
8 Bio/Blast/NCBIStandalone.py
@@ -52,6 +52,8 @@
import warnings
warnings.warn("The plain text parser in this module still works at the time of writing, but is considered obsolete and updating it to cope with the latest versions of BLAST is not a priority for us.", PendingDeprecationWarning)
+from Bio import BiopythonDeprecationWarning
+
import os
import re
import StringIO
@@ -1786,7 +1788,7 @@ def blastall(blastcmd, program, database, infile, align_view='7', **keywds):
'seqalign_file' : '-O',
'outfile' : '-o',
}
- warnings.warn("This function is obsolete, you are encouraged to the command line wrapper Bio.Blast.Applications.BlastallCommandline instead.", PendingDeprecationWarning)
+ warnings.warn("This function is deprecated; you are encouraged to the command line wrapper Bio.Blast.Applications.BlastallCommandline instead.", BiopythonDeprecationWarning)
from Applications import BlastallCommandline
cline = BlastallCommandline(blastcmd)
cline.set_parameter(att2param['program'], program)
@@ -1869,7 +1871,7 @@ def blastpgp(blastcmd, database, infile, align_view='7', **keywds):
align_infile Input alignment file for PSI-BLAST restart.
"""
- warnings.warn("This function is obsolete, you are encouraged to the command line wrapper Bio.Blast.Applications.BlastpgpCommandline instead.", PendingDeprecationWarning)
+ warnings.warn("This function is deprecated; you are encouraged to the command line wrapper Bio.Blast.Applications.BlastpgpCommandline instead.", BiopythonDeprecationWarning)
_security_check_parameters(keywds)
att2param = {
@@ -1988,7 +1990,7 @@ def rpsblast(blastcmd, database, infile, align_view="7", **keywds):
from the returned handles).
"""
- warnings.warn("This function is obsolete, you are encouraged to the command line wrapper Bio.Blast.Applications.BlastrpsCommandline instead.", PendingDeprecationWarning)
+ warnings.warn("This function is deprecated; you are encouraged to the command line wrapper Bio.Blast.Applications.BlastrpsCommandline instead.", BiopythonDeprecationWarning)
_security_check_parameters(keywds)
att2param = {
View
4 Bio/PDB/AbstractPropertyMap.py
@@ -6,6 +6,7 @@
"""Class that maps (chain_id, residue_id) to a residue property."""
+
class AbstractPropertyMap(object):
def __init__(self, property_dict, property_keys, property_list):
self.property_dict=property_dict
@@ -78,7 +79,8 @@ def has_key(self, id):
@type res_id: char
"""
import warnings
- warnings.warn("This function is obsolete; use 'id in mapping' instead", PendingDeprecationWarning)
+ from Bio import BiopythonDeprecationWarning
+ warnings.warn("This function is deprecated; use 'id in mapping' instead", BiopythonDeprecationWarning)
return (id in self)
def keys(self):
View
3  Bio/PDB/FragmentMapper.py
@@ -298,7 +298,8 @@ def has_key(self, res):
@type res: L{Residue}
"""
import warnings
- warnings.warn("has_key is obsolete; use 'res in object' instead", PendingDeprecationWarning)
+ from Bio import BiopythonDeprecationWarning
+ warnings.warn("has_key is deprecated; use 'res in object' instead", BiopythonDeprecationWarning)
return (res in self)
def __contains__(self, res):
View
12 Bio/UniGene/UniGene.py
@@ -18,11 +18,13 @@
# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
import warnings
-warnings.warn("The module Bio.UniGene.UniGene is now obsolete, "
- "and will be deprecated and removed in a future "
- "release of Biopython. To parse UniGene flat files, "
- "please use the parser in Bio.UniGene instead",
- PendingDeprecationWarning)
+from Bio import BiopythonDeprecationWarning
+
+warnings.warn("The module Bio.UniGene.UniGene is now deprecated, "
+ "and will be removed in a future release of Biopython."
+ "To parse UniGene flat files, please use the parser in "
+ "Bio.UniGene instead",
+ BiopythonDeprecationWarning)
import string
import sgmllib
View
10 BioSQL/BioSeqDatabase.py
@@ -12,6 +12,8 @@
This provides interfaces for loading biological objects from a relational
database, and is compatible with the BioSQL standards.
"""
+from Bio import BiopythonDeprecationWarning
+
import BioSeq
import Loader
import DBUtils
@@ -201,9 +203,9 @@ def remove_database(self, db_name):
del server[name]
"""
import warnings
- warnings.warn("This method is obsolete. In keeping with the "
+ warnings.warn("This method is deprecated. In keeping with the "
"dictionary interface, you can now use 'del "
- "server[name]' instead", PendingDeprecationWarning)
+ "server[name]' instead", BiopythonDeprecationWarning)
db_id = self.adaptor.fetch_dbid_by_dbname(db_name)
remover = Loader.DatabaseRemover(self.adaptor, db_id)
remover.remove()
@@ -517,7 +519,7 @@ def get_all_primary_ids(self):
import warnings
warnings.warn("Use bio_seq_database.keys() instead of "
"bio_seq_database.get_all_primary_ids()",
- PendingDeprecationWarning)
+ BiopythonDeprecationWarning)
return self.keys()
def __getitem__(self, key):
@@ -622,7 +624,7 @@ def get_Seq_by_primary_id(self, seqid):
import warnings
warnings.warn("Use bio_seq_database[my_id] instead of "
"bio_seq_database.get_Seq_by_primary_id(my_id)",
- PendingDeprecationWarning)
+ BiopythonDeprecationWarning)
return self[seqid]
def load(self, record_iterator, fetch_NCBI_taxonomy=False):
View
11 DEPRECATED
@@ -77,7 +77,8 @@ Bio.Blast.NCBIStandalone
========================
The three functions for calling the "legacy" NCBI BLAST command line tools
blastall, blastpgp and rpsblast were declared obsolete in Biopython Release
-1.53, please use the BLAST+ wrappers in Bio.Blast.Applications instead.
+1.53, and deprecated in Release 1.61. Please use the BLAST+ wrappers in
+Bio.Blast.Applications instead.
The remainder of this module is a parser for the plain text BLAST output,
which was declared obsolete in Release 1.54. For some time now, both the NCBI
@@ -87,8 +88,9 @@ Bio.Blast.Applications
======================
NCBI "legacy" BLAST tool wrappers FastacmdCommandline, BlastallCommandline,
BlastpgpCommandline and RpsBlastCommandline were declared obsolete in Release
-1.53, having been replaced with wrappers for the new NCBI BLAST+ tools (e.g.
-NcbiblastpCommandline and NcbipsiblastCommandline).
+1.53 and deprecated in Release 1.61, having been replaced with wrappers for
+the new NCBI BLAST+ tools (e.g. NcbiblastpCommandline and
+NcbipsiblastCommandline).
Bio.Clustalw
============
@@ -503,7 +505,8 @@ UnigeneRecord, _RecordConsumer, _Scanner, RecordParser, and Iterator in
Bio.UniGene were declared obsolete in Release 1.54, deprecated in Release 1.55,
and removed in Release 1.59. Their functionality is now available through a
read() and a parse() function in Bio.UniGene.
-The HTML parser in Bio.UniGene.UniGene was declared obsolete in Release 1.59.
+The HTML parser in Bio.UniGene.UniGene was declared obsolete in Release 1.59,
+and deprecated in Release 1.61.
Bio.SubsMat
===========

0 comments on commit 1b2025b

Please sign in to comment.
Something went wrong with that request. Please try again.