Talk:AminoAcidColours.pl

From Organic Design wiki
Sources of color schemes
Molecules
BioPerl 
http://doc.bioperl.org/releases/bioperl-current/bioperl-live/Bio/DB/Fasta.html#CODE33

<perl> sub _type {

 shift;
 local $_ = shift;
 return /^[gatcnGATCN*-]+$/   ? DNA
        : /^[gaucnGAUCN*-]+$/ ? RNA

 : PROTEIN; } </perl>

PHP equivalent

<php> function type($bases) {

 return preg_match("/^[\\d\\sacgtn*-]+$/i", $bases) ? "dna"
      : (preg_match("/^[\\d\\sacgun*-]+$/i", $bases) ? "rna" : "protein" );

} </php>

Amino acis letters, all alphabet except b (if not determined Aspartate or asparagine), j, o, u, x (special), z (if not determined Glutamate or glutamine) --Sven 14:31, 24 May 2007 (NZST)