[Bioperl-l] bioperl-live: audit of FIXME/???/TODO/etc and undef/die

Chris Fields cjfields at uiuc.edu
Tue Sep 19 14:03:33 UTC 2006


I added a page to the wiki for code improvements a few days ago.  I can add
these so we can keep tabs on these and other code 'oddities' and also make
suggestions.

The other issue I found, though not as prevalent, was the use of $`, $&, $',
and $+ for regex matches, which supposedly create a performance hit (at
least acc. to Jeff Friedl).  I modified Bio::Factory::FTLocationFactory to
not use these, but I did find several other modules using them, including
Bio::Root::Storable:

http://www.bioperl.org/wiki/BioPerl_code_optimization

Thanks Torsten!  Let us know if you find any more.

Christopher Fields
Postdoctoral Researcher - Switzer Lab
Dept. of Biochemistry
University of Illinois Urbana-Champaign 

> -----Original Message-----
> From: bioperl-l-bounces at lists.open-bio.org [mailto:bioperl-l-
> bounces at lists.open-bio.org] On Behalf Of Torsten Seemann
> Sent: Monday, September 18, 2006 7:09 PM
> To: 'bioperl-l'
> Subject: [Bioperl-l] bioperl-live: audit of FIXME/???/TODO/etc and
> undef/die
> 
> Developers,
> 
> Given the pending RC1 release, I decided to do a quick audit of
> bioperl-live, see below. Hopefully no much POD text may got through.
> Hope it is useful anyway.
> 
> --Torsten
> 
> 
> "return undef;" => "return;"  # return undef intentional?
> 
> Bio/DB/Biblio/pdf.pm:    return undef;
> Bio/DB/Biblio/pdf.pm:    return undef unless $link;
> Bio/DB/Biblio/pdf.pm:  return undef;
> Bio/DB/Biblio/eutils.pm:  return undef;
> Bio/DB/WebDBSeqI.pm:    return undef if ( !defined $self->ua || !defin
> Bio/Tools/Run/RemoteBlast.pm:    return undef if ( !defined $self->ua
> Bio/FeatureIO/gff.pm:  return undef if $self->fasta_mode();
> Bio/FeatureIO/gff.pm:  # be graceful about empty lines or comments, an
> Bio/FeatureIO/gff.pm:will return undef if not all features in the stre
> Bio/Root/IOManager.pm:    return undef unless -e $file;
> Bio/Root/Object.pm:    return undef unless defined $self->{'_err'};
> 
> "die" => "$self->throw" # use Bio::Perl exception handling
> 
> Bio/Variation/IO.pm:    $format2 = shift || die "Usage: reformat forma
> Bio/DB/SeqFeature/Store/DBI/mysql.pm:  $db->store($feature) or die "Co
> Bio/DB/SeqFeature/Store/berkeleydb.pm:  $db->store($feature) or die
> Bio/DB/SeqFeature/Store.pm:  $db->store($feature) or die "Couldn't sto
> Bio/Graphics/Glyph.pm:  my $feature = $arg{-feature} or die "No featur
> Bio/Graphics/Glyph/image.pm:    open F,$path or die "Can't open $path:
> Bio/Graphics/Panel.pm:  open (F,">$imagefile") || die("Can't open imag
> Bio/Phenotype/OMIM/OMIMparser.pm:    if ( ! defined( $description ) )
> Bio/Phenotype/OMIM/OMIMparser.pm:    if ( ! defined( $mutation ) )   {
> Bio/LiveSeq/Chain.pm:    die "_praepostinsert_array: Something went ve
> Bio/Tools/isPcr.pm:    my $seq = $seqio->next_seq || die("cannot get a
> Bio/Tools/Analysis/DNA/ESEfinder.pm:  die "Could not get a result"
> Bio/Tools/Analysis/Protein/NetPhos.pm:  die "Could not get a result" u
> Bio/Tools/Analysis/Protein/Mitoprot.pm:  die "Could not get a result"
> Bio/Tools/Analysis/Protein/Scansite.pm:  die "Could not get a result"
> Bio/Tools/dpAlign.pm:        die("\nThe C-compiled engine for Smith Wa
> Bio/Tools/ipcress.pm:    my $seq = $seqio->next_seq || die("cannot get
> Bio/Tools/EPCR.pm:    my $seq = $seqio->next_seq || die("cannot get a
> Bio/Tools/HMM.pm:        die("\nThe C-compiled engine for Hidden Marko
> Bio/Seq/PrimedSeq.pm:      my $file = shift || die "need a file to rea
> Bio/Seq/PrimedSeq.pm:     my $file = shift || die "$0 <file>";
> 
> "FIXME"
> 
> Bio/AlignIO/po.pm
> Bio/DB/Expression/geo.pm
> Bio/FeatureIO/gff.pm
> Bio/Ontology/RelationshipType.pm
> Bio/SeqIO/kegg.pm
> Bio/SeqIO/swiss.pm
> Bio/Tools/ESTScan.pm
> Bio/Tools/Est2Genome.pm
> Bio/Tools/GuessSeqFormat.pm
> Bio/Tools/HMMER/Results.pm
> 
> "???"
> 
> Bio/Variation/VariantI.pm:        $self->allele_mut($value); #????
> Bio/DB/Biblio/soap.pm:use Bio::Biblio;  # TBD: ?? WHY SHOULD I DO THIS
> Bio/DB/GFF/Adaptor/dbi/oracleace.pm:    # then generate a bogus Homolo
> Bio/DB/GFF/Adaptor/dbi/mysqlace.pm:    # then generate a bogus Homolog
> Bio/SeqFeature/Annotated.pm: Args    : ???
> Bio/SeqFeature/Tools/Unflattener.pm:                   # what should w
> Bio/SeqFeature/Tools/IDHandler.pm:       # warn??
> Bio/Root/IO.pm:         $ROOTDIR = ""; # what is reasonable??
> Bio/LiveSeq/Chain.pm:# *??* create hash2dchain ???? (with hashkeys use
> Bio/LiveSeq/Chain.pm:# **????** how about using array of arrays instea
> Bio/LiveSeq/Chain.pm:# in verbose $string assignment around line 721 ?
> 
> "TODO"
> 
> Bio/Root/Root.pm:       # TODO: Fix the MSG: line of the re-thrown err
> Bio/Root/Storable.pm:    # TODO: add cleanup and unlink methods. For n
> Bio/Seq/EncodedSeq.pm:  #TODO: finish all this
> Bio/SeqFeature/Tools/Unflattener.pm:           # TODO - we ignore this
> Bio/SeqFeature/Tools/Unflattener.pm:               # TODO - allow more
> Bio/SeqFeature/Tools/Unflattener.pm:             ## features.  TODO: P
> Bio/SeqIO/game/gameWriter.pm:#TODO: can't sequences also have database
> Bio/SeqIO/chaos.pm:        # TODO
> Bio/SeqIO/pir.pm:    # TODO - not processing SFS data
> Bio/SeqIO/strider.pm:                # TODO: determine 'DNA Degenerate
> Bio/Search/BlastUtils.pm:    # TODO: Account for strand/frame issue!
> 
> "***"
> 
> Bio/Map/Physical.pm:    #*** why doesn't it call Bio::Map::Clone->new
> Bio/Map/Physical.pm:    #*** why doesn't it call Bio::Map::FPCMarker->
> Bio/Map/Physical.pm:    #*** why doesn't it call Bio::Map::Contig->new
> Bio/Map/PositionI.pm:#*** should this be overridden from RangeI?
> Bio/Matrix/PSM/SiteMatrix.pm:        #*** IUPACp values not actually u
> Bio/Tree/TreeFunctionsI.pm:    #*** the algorithm here hasn't really b
> Bio/SeqIO/agave.pm:***NOTE*** At the moment, not all of the tags are
> Bio/LiveSeq/Chain.pm:# **** performance concerns
> Bio/Map/LinkageMap.pm:#*** what is this? what calls it? note that it s
> Bio/Map/Marker.pm:       *** does not actually add this marker to the
> Bio/Map/SimpleMap.pm:      *** does not actually add the element to th
> Bio/Map/FPCMarker.pm: *** This has nothing to do with an actual
> Bio/Map/PositionI.pm:#*** should this be overridden from RangeI?
> 
> "Why?"
> 
> Bio/Search/Hit/PullHitI.pm:    # why does this method even exist?!
> Bio/Search/Hit/PullHitI.pm: # why does this method even exist?!
> Bio/DB/Biblio/soap.pm:use Bio::Biblio;  # TBD: ?? WHY SHOULD I DO THIS
> Bio/Graphics/Glyph/dot.pm:  # The can() method fails with GD::SVG. Why
> Bio/SeqIO/bsml.pm: # Need to kill object for following code to work...
> Bio/SeqIO/tinyseq.pm: foreach my $subatt(@$seqatt) { # why are there t
> Bio/SeqIO/tinyseq.pm:    # NCBI puts refseq ids in TSeq_sid, others in
> Bio/SeqIO/game/featHandler.pm:    # Why is CDS coordinate info saved a
> Bio/SeqIO/swiss.pm:    # Um, why would this be anything else but PRT?
> Bio/Taxonomy.pm:      # taxonomy - why would you be doing things this
> Bio/Seq.pm:    # I can't remember why not delegating was ever deemed
> Bio/Cluster/UniGene.pm:   # why does NCBI prepend a 'g' to its own
> Bio/LiveSeq/IO/BioPerl.pm:# why array from each_tag_value($qual) ? Whe
> Bio/SearchIO/Writer/HSPTableWriter.pm:#            Don't know why this
> Bio/SearchIO/Writer/ResultTableWriter.pm:#            Don't know why t
> Bio/Tools/Alignment/Consed.pm:Why was this developed like this? I was
> Bio/Tools/Alignment/Consed.pm:  # if there is a member array (why woul
> io/Map/Physical.pm:    #*** why doesn't it call Bio::Map::Clone->new ?
> Bio/Map/Physical.pm:    #*** why doesn't it call Bio::Map::FPCMarker->
> Bio/Map/Physical.pm:    #*** why doesn't it call Bio::Map::Contig->new
> Bio/SeqFeature/Primer.pm:            off from those of the idtdna web
> Bio/SeqFeature/Primer.pm:    as primer3 does. Don't ask why, I never f
> Bio/Seq/PrimaryQual.pm: Returns : 1 for a valid sequence (WHY? Shouldn
> Bio/Seq/PrimaryQual.pm: Args    : a scalar (any scalar, why PrimarySeq
> 
> "hack"
> 
> Bio/DB/Flat/BinarySearch.pm:# is an awful hack - in reality Michele's
> Bio/DB/WebDBSeqI.pm:# sorry, but this is hacked in because of BioFetch
> Bio/DB/SeqFeature/Store/GFF3Loader.pm:  # TEMPORARY HACKS TO SIMPLIFY
> Bio/AlignIO/phylip.pm:    #if you use a version of phylip (hacked) tha
> Bio/SearchIO/blast.pm:            # bl2seq hackiness... Not sure I lik
> Bio/Tools/Sigcleave.pm:## a quick hack to make sure that we get the sc
> Bio/Tools/Blast/HTML.pm:  # This is fine for yeast but not worm. This
> Bio/Tools/Geneid.pm:        # then need to perform the hack of extract
> Bio/Root/Utilities.pm:  # this is a quick hack to check for availabili
> Bio/Root/Err.pm:objects more eval/die-savvy (but the current strategy
> 
> 
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l




More information about the Bioperl-l mailing list