Bioperl: "lightweight analyses"

Andrew Dalke dalke@bioreason.com
Mon, 08 Mar 1999 11:13:28 -0800


> Thanks for the code Andrew!

  You're welcome.

> But whatever muse inspires you  to crank out perl code, I hope
> you keep it happy. :-}

  It will be a rare occurance; I've mentioned before I'm a Python
programmer these days.  It happened because on Slashdot I pointed
out that Perl is really cool for some things, like:

#!/usr/local/bin/perl -pw
BEGIN {
   %color = ( "A" => "red", "T" => "yellow",
              "C" => "blue", "G" => "green");
}
s|([ATCG])|"<font color='$color{$1}'>$1</font>"|eg if !/^>/; 

which colorizes DNA sequence in FASTA format for HTML, based on
residue name.  Writing it caused me to go on a (small) perl jag :)

Hmm, a better s// might be:

s!(A+|T+|C+|G+)!"<font color='" . $color{substr($1, 0, 1)} .
                "'>$1</font>"!eg if !/^>/; 

which keeps from having duplicate color changes in a row.

> I'm not familiar with the Python license, but I'd image it is
> something similar?

  It's BSD-like without the "advertising" clause.

> # Copyright (c) 1999 by Andrew Dalke and Bioreason, Inc. All Rights
> Reserved.
> #        This module is free software; you can redistribute it and/or 
> #        modify it under the same terms as Perl itself.
> #        Retain this notice and note any modifications made.
> 
> The (c) line would also include names of anyone else that works on on
> integrating it into bioperl. Sound good?

  Yes.  Fine with me.

						Andrew
						dalke@bioreason.com
=========== Bioperl Project Mailing List Message Footer =======
Project URL: http://bio.perl.org/
For info about how to (un)subscribe, where messages are archived, etc:
http://www.techfak.uni-bielefeld.de/bcd/Perl/Bio/vsns-bcd-perl.html
====================================================================