Hola a todos,
Tengo esta clase (me la descargue) que traduce secuencias de ADN a proteinas.
Código PHP:
<?php
class BioTranscription
{
function BioTranscription()
{
$this->amino_acids = array('Asp' => array('name' => 'Aspartic acid',
'shortname' => 'Asp',
),
'Glu' => array('name' => 'Glutamic acid',
'shortname' => 'Glu',
),
'Gly' => array('name' => 'Glycine',
'shortname' => 'Gly',
),
'Phe' => array('name' => 'Phenylalanine',
'shortname' => 'Phe',
),
'Leu' => array('name' => 'Leucine',
'shortname' => 'Leu',
),
'Ser' => array('name' => 'Serine',
'shortname' => 'Ser',
),
'Tyr' => array('name' => 'Tyrosine',
'shortname' => 'Tyr',
),
'Cys' => array('name' => 'Cysteine',
'shortname' => 'Cys',
),
'Trp' => array('name' => 'Tryptophan',
'shortname' => 'Trp',
),
'Pro' => array('name' => 'Proline',
'shortname' => 'Pro',
),
'His' => array('name' => 'Histidine',
'shortname' => 'His',
),
'Gln' => array('name' => 'Glutamine',
'shortname' => 'Gln',
),
'Arg' => array('name' => 'Arginine',
'shortname' => 'Arg',
),
'Ils' => array('name' => 'Isoleucine',
'shortname' => 'Ils',
),
'Met' => array('name' => 'Methionine',
'shortname' => 'Met',
),
'Thr' => array('name' => 'Threonine',
'shortname' => 'Thr',
),
'Asn' => array('name' => 'Asparagine',
'shortname' => 'Asn',
),
'Lys' => array('name' => 'Lysine',
'shortname' => 'Lys',
),
'Val' => array('name' => 'Valine',
'shortname' => 'Val',
),
'Ala' => array('name' => 'Alanine',
'shortname' => 'Ala',
),
);
$this->codons = array('G' => array('G' => array('G' => &$this->amino_acids['Gly'],
'A' => &$this->amino_acids['Gly'],
'U' => &$this->amino_acids['Gly'],
'C' => &$this->amino_acids['Gly'],
),
'A' => array('G' => &$this->amino_acids['Glu'],
'A' => &$this->amino_acids['Glu'],
'U' => &$this->amino_acids['Asp'],
'C' => &$this->amino_acids['Asp'],
),
'C' => array('G' => &$this->amino_acids['Ala'],
'A' => &$this->amino_acids['Ala'],
'U' => &$this->amino_acids['Ala'],
'C' => &$this->amino_acids['Ala'],
),
'U' => array('G' => &$this->amino_acids['Val'],
'A' => &$this->amino_acids['Val'],
'U' => &$this->amino_acids['Val'],
'C' => &$this->amino_acids['Val'],
),
),
'A' => array('G' => array('G' => &$this->amino_acids
'U' => array('G' => array('G' => &$this->amino_acids['Trp'],
'A' => 'stop',
'U' => &$this->amino_acids['Cys'],
'C' => &$this->amino_acids['Cys'],
),
'A' => array('G' => 'stop',
'A' => 'stop',
'U' => &$this->amino_acids['Tyr'],
'C' => &$this->amino_acids['Tyr'],
),
'C' => array('G' => &$this->amino_acids['Ser'],
'A' => &$this->amino_acids['Ser'],
'U' => &$this->amino_acids['Ser'],
'C' => &$this->amino_acids['Ser'],
),
'U' => array('G' => &$this->amino_acids['Leu'],
'A' => &$this->amino_acids['Leu'],
'U' => &$this->amino_acids['Phe'],
'C' => &$this->amino_acids['Phe'],
),
),
'start' => 'AUG',
);
}
function mrna_to_pepchain($mrna)
{
$mrna = strstr($mrna, $this->codons['start']);
for($i=3;$i<strlen($mrna);$i=$i+3)
{
$j=$i; $j++;
$k=$i; $k=$k+2;
if( $this->codons[$mrna{$i}][$mrna{$j}][$mrna{$k}] == 'stop')
{
break;
}
$pep .= $this->triplet_to_pep($mrna{$i}.$mrna{$j}.$mrna{$k}).'-';
}
$pep = substr($pep, 0, -1);
return $pep;
}
function triplet_to_pep($trip)
{
return $peptide = $this->codons[$trip{0}][$trip{1}][$trip{2}]['shortname'];
}
}
$trans = &new BioTranscription();
$pepchain = $trans->mrna_to_pepchain('AUGAAACCCUGA'); //mRNA, from 5' to 3'
print $pepchain; //Should print out "Lys-Pro"
?>
El problema que tengo es que no sé como llamar a esta clase, es decir me gustaria implementar un text area en una página que llamara a esta funcion i que "tradujera" a proteinas la secuencia que se introdujera en el text area.
Un Saludo