[Biopython-dev] Obsolete code
Michiel de Hoon
mjldehoon at yahoo.com
Fri Aug 27 23:21:26 EDT 2010
> (without them, importing one of the
submodules directly did not issue
> the DeprecationWarning in
Bio.AlignAce.__init__).
I take that back ... it turned out that Python 2.7 silences DeprecationWarnings by default. These warnings can be switched on by the -Wd flag when starting Python. For Biopython 1.56, we should replace DeprecationWarnings by a Biopython-specific warning class.
--Michiel.
--- On Fri, 8/27/10, Michiel de Hoon <mjldehoon at yahoo.com> wrote:
From: Michiel de Hoon <mjldehoon at yahoo.com>
Subject: Re: [Biopython-dev] Obsolete code
To: "Bartek Wilczynski" <bartek at rezolwenta.eu.org>
Cc: biopython-dev at biopython.org
Date: Friday, August 27, 2010, 10:53 PM
I applied your patch to Bio.Motif, and added DeprecationWarnings to each of the submodules of Bio.AlignAce (without them, importing one of the submodules directly did not issue the DeprecationWarning in Bio.AlignAce.__init__).
Thanks,
--Michiel.
--- On Sat, 8/21/10, Bartek Wilczynski <bartek at rezolwenta.eu.org> wrote:
From: Bartek Wilczynski <bartek at rezolwenta.eu.org>
Subject: Re: [Biopython-dev] Obsolete code
To: "Michiel de Hoon" <mjldehoon at yahoo.com>
Cc: biopython-dev at biopython.org
Date: Saturday, August 21, 2010, 4:56 AM
Hi,
Great job.
I just have a small comment on the Bio.AlignAce.Parser module. It is a part of the Bio.AlignAce "package" which was
already deprecated (see Bio.AlignAce.__init__.py). I think either there is no need to put an extra deprecation warning in Bio.AlignAce.Parser, or we should put it in all submodules of Bio.AlignAce (like Bio.AlignaAce.Motif, etc.).
As for deprecating the old parsers in Bio Motif, I've just looked through the code in Motif.__init__.py and realized that it was still using the old implemmentations...
This small patch below should fix it (I don't want to push onto the main branch now, as it's frozen).
Cheers
Bartek
diff --git a/Bio/Motif/__init__.py b/Bio/Motif/__init__.py
index 4c7c19a..9ca0200 100644
--- a/Bio/Motif/__init__.py
+++ b/Bio/Motif/__init__.py
@@ -10,12 +10,12 @@ as well as methods for motif comparisons and motif searching in sequences.
It also inlcudes functionality for parsing AlignACE and MEME programs
"""
from _Motif import Motif
-from Parsers.AlignAce import AlignAceParser, CompareAceParser
-from Parsers.MEME import MEMEParser,MASTParser
+import Parsers.AlignAce
+import Parsers.MEME
from Thresholds import ScoreDistribution
-_parsers={"AlignAce":AlignAceParser,
- "MEME":MEMEParser
+_parsers={"AlignAce":Parsers.AlignAce.read,
+ "MEME":Parsers.MEME.read
}
def _from_pfm(handle):
@@ -75,7 +75,7 @@ def parse(handle,format):
else: #we have a proper reader
yield reader(handle)
else: # we have a proper reader
- for m in parser().parse(handle).motifs:
+ for m in parser(handle).motifs:
yield m
def read(handle,format):
On Sat, Aug 21, 2010 at 8:30 AM, Michiel de Hoon <mjldehoon at yahoo.com> wrote:
Dear all,
The classes and modules listed below were declared obsolete in Biopython 1.54 or earlier, but do not yet raise a deprecation warning. Most of this functionality moved to a different module or was implemented differently. I suggest we add a DeprecationWarning to each of these before Biopython 1.55 final. The only tricky one is the .data property of Seq classes in Bio.Seq. Still, it might be good to add a DeprecationWarning there to make people aware that this property is obsolete.
Any objections?
--Michiel.
Bio.CelFile.CelParser
Bio.CelFile.CelScanner
Bio.CelFile.CelConsumer
Bio.CelFile.CelRecord
Bio.Align.MultipleSeqAlignment.get_column
Bio.Align.Generic.Alignment
Bio.Align.Generic.Alignment.get_seq_by_num
Bio.AlignAce.Parser
Bio.Blast.Applications.FastacmdCommandline
Bio.Blast.Applications.BlastallCommandline
Bio.Blast.Applications.BlastpgpCommandline
Bio.Blast.Applications.RpsBlastCommandline
Bio.Blast.NCBIStandalone.blastall
Bio.Blast.NCBIStandalone.blastpgp
Bio.Blast.NCBIStandalone.rpsblast
(Bio.Blast.NCBIStandalone has been declared obsolete, but I guess some people may still be using the Blast plain-text output parser.)
Bio.Clustalw
Bio.Compass._Scanner
Bio.Compass._Consumer
Bio.Compass.RecordParser
Bio.Compass.Iterator
Bio.Emboss.Applications.EProtDistCommandline
Bio.Emboss.Applications.ENeighborCommandline
Bio.Emboss.Applications.EProtParsCommandline
Bio.Emboss.Applications.EConsenseCommandline
Bio.Emboss.Applications.ESeqBootCommandline
Bio.Graphics.GenomeDiagram._AbstractDrawer.AbstractDrawer.xcentre
Bio.Graphics.GenomeDiagram._AbstractDrawer.AbstractDrawer._set_xcentre
Bio.Graphics.GenomeDiagram._AbstractDrawer.AbstractDrawer.ycentre
Bio.Graphics.GenomeDiagram._AbstractDrawer.AbstractDrawer._set_ycentre
Bio.Graphics.GenomeDiagram._Graph.centre
Bio.Graphics.GenomeDiagram._Graph._set_centre
Bio.Motif.Parsers.AlignAce.AlignAceConsumer
Bio.Motif.Parsers.AlignAce.AlignAceParser
Bio.Motif.Parsers.AlignAce.AlignAceScanner
Bio.Motif.Parsers.AlignAce.CompareAceScanner
Bio.Motif.Parsers.AlignAce.CompareAceConsumer
Bio.Motif.Parsers.MEME.MEMEParser
Bio.Motif.Parsers.MEME._MEMEScanner
Bio.Motif.Parsers.MEME._MEMEConsumer
Bio.Motif.Parsers.MEME._MASTConsumer
Bio.Motif.Parsers.MEME.MASTParser
Bio.Motif.Parsers.MEME._MASTScanner
Bio.Motif.Parsers.MEME.MASTRecord
Bio.PopGen.FDist.RecordParser
Bio.PopGen.FDist._Scanner
Bio.PopGen.FDist._RecordConsumer
Bio.Seq.Seq.data
Bio.SeqUtils.GC_Frame
Bio.SeqUtils.fasta_uniqids
Bio.SeqUtils.apply_on_multi_fasta
Bio.SeqUtils.quicker_apply_on_multi_fasta
Bio.UniGene.UnigeneSequenceRecord
Bio.UniGene.UnigeneProtsimRecord
Bio.UniGene.UnigeneSTSRecord
Bio.UniGene.UnigeneRecord
Bio.UniGene._RecordConsumer
Bio.UniGene._Scanner
Bio.UniGene.RecordParser
Bio.UniGene.Iterator
_______________________________________________
Biopython-dev mailing list
Biopython-dev at lists.open-bio.org
http://lists.open-bio.org/mailman/listinfo/biopython-dev
--
Bartek Wilczynski
==================
Postdoctoral fellow
EMBL, Furlong group
Meyerhoffstrasse 1,
69012 Heidelberg,
Germany
tel: +49 6221 387 8433
More information about the Biopython-dev
mailing list