Permalink
Browse files

Removing deprecated code that won't be in Release 1.57

  • Loading branch information...
1 parent 4e4c3aa commit f019593be4bde420f9be95bcb7aa8615dc6984bc mdehoon committed Dec 21, 2010
View
@@ -60,27 +60,12 @@ def get_prosite_raw(id, cgi='http://www.expasy.ch/cgi-bin/get-prosite-raw.pl'):
handle = urllib.urlopen("%s?%s" % (cgi, id))
return handle
-def get_sprot_raw(id, cgi=None):
+def get_sprot_raw(id):
"""Get a handle to a raw SwissProt entry at ExPASy.
For an ID of XXX, fetches http://www.uniprot.org/uniprot/XXX.txt
(as per the http://www.expasy.ch/expasy_urls.html documentation).
-
-
- For a non-existing key XXX, ExPASy returns an HTML Error 404 page.
-
- This function used to take a cgi option to specify the URL, but that
- is no longer supported. This is because prior to November 2009 we
- used to use http://www.expasy.ch/cgi-bin/get-sprot-raw.pl?XXX
- However, at the time of writting this returns FASTA format instead
- (probably an ExPASy/UniProt oversight). Under the new URL scheme,
- we cannot just append "?XXX" to the cgi argument.
"""
- if cgi :
- import warnings
- import Bio
- warnings.warn("The cgi argument in get_sprot_raw is not "
- "supported anymore", Bio.BiopythonDeprecationWarning)
return urllib.urlopen("http://www.uniprot.org/uniprot/%s.txt" % id)
def sprot_search_ful(text, make_wild=None, swissprot=1, trembl=None,
View
@@ -1,164 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2002 by Michael Hoffman. All rights reserved.
-# This code is part of the Biopython distribution and governed by its
-# license. Please see the LICENSE file that should have been included
-# as part of this package.
-
-"""A set of generic bits of code under Bio.GFF (DEPRECATED).
-
-This is part of the "old" Bio.GFF module by Michael Hoffman, which offered
-access to a MySQL database holding GFF data loaded by BioPerl. This code has
-now been deprecated, and will probably be removed in order to free the Bio.GFF
-namespace for a new GFF parser in Biopython (including GFF3 support).
-"""
-
-import os
-import sys
-import tempfile
-
-class AppendableListDictionary(dict):
- """
- a dictionary of lists
- """
- def append_to(self, key, value):
- try:
- dict.__getitem__(self, key).append(value)
- except KeyError:
- self[key] = [value]
-
-class ForgivingDictionary(AppendableListDictionary):
- def __getitem__(self, key):
- try:
- return dict.__getitem__(self, key)
- except KeyError:
- return None
-
-class VerboseDict(dict):
- def __str__(self):
- dict_copy = {}
- for key in self:
- dict_copy[key] = str(self[key])
- return str(dict_copy)
-
-class VerboseList(list):
- def __str__(self):
- return str(map(lambda x: str(x), self))
-
-class TempFile(file):
- def __init__(self, suffix = ".python-temp", keep = 0):
- self.removed = 0
- self.keep = keep
- # XXX: this is a race condition:
- file.__init__(self, tempfile.mktemp(suffix), "w")
-
- def __del__(self):
- self.remove()
-
- def remove(self):
- if self.keep == 0:
- if self.removed == 0:
- try:
- try:
- self.close()
- os.remove(self.name)
- finally:
- self.removed = 1
- except OSError:
- pass
-
-class SurrogateNotInitedError(AttributeError):
- pass
-
-class Surrogate(object):
- """
- the data is stored in _data
- """
- def __init__(self, data):
- self._data = data
-
- def __getattr__(self, name):
- if name == "_data":
- raise SurrogateNotInitedError(name)
- else:
- try:
- return getattr(self._data, name)
- except SurrogateNotInitedError:
- raise SurrogateNotInitedError(name)
-
-
-def defline_text(defline):
- if defline[0] == ">":
- return defline[1:]
- else:
- return defline
-
-def is_nestable(x):
- """
- Returns 1 if x is a tuple or list (sequence types that can nest)
- Returns 0 otherwise
-
- >>> is_nestable("string")
- 0
- >>> is_nestable((0,))
- 1
- >>> is_nestable(range(5))
- 1
- """
- return isinstance(x, (tuple, list))
-
-def dump_list(l):
- """
- returns strings of list
- """
- try:
- return '[%s]' % ', '.join(map(str, l))
- except TypeError:
- return str(l)
-
-def reverse_text(text):
- """
- >>> reverse_text('abracadabra')
- 'arbadacarba'
- """
- l = list(text)
- l.reverse()
- return ''.join(l)
-
-class ArgsParser(object):
- """
- >>> unparsed_args = ["moocow"]
- >>> args = ArgsParser(unparsed_args, [('infile', 'defaultin'), ('outfile', 'defaultout')])
- >>> args.infile
- 'moocow'
- >>> args.outfile
- 'defaultout'
- """
- def __init__(self, args, defaults):
- for i, default in enumerate(defaults):
- try:
- self.__dict__[default[0]] = args[i]
- continue
- except TypeError:
- pass
- except IndexError:
- pass
- self.__dict__[default[0]] = default[1]
-
-def all(iterator):
- return [item for item in iterator]
-
-def _test():
- """Run the Bio.GFF.GenericTools module's doctests (PRIVATE).
-
- This will try and locate the unit tests directory, and run the doctests
- from there in order that the relative paths used in the examples work.
- """
- import doctest
- print "Runing doctests..."
- doctest.testmod()
- print "Done"
-
-if __name__ == "__main__":
- if __debug__:
- _test()
Oops, something went wrong.

0 comments on commit f019593

Please sign in to comment.