BioPHP is an easy to use, open source project. BioPHP implements a selection of simple tools for manipulating genomic data. We're not doing any heavy lifting here (this is PHP). This class is built for basic RNA, DNA, and Protein manipulation.
$BioPHP = new BioPHP('ATGAAA');
$BioPHP->reverseSequence(); //reverse sequence
$BioPHP->complementDnaSequence(); //get the reversed complement
echo $BioPHP->sequenceA;
//prints TTTCAT
$BioPHP = new BioPHP('ATGAAAGCATC');
echo $BioPHP->gcContent();
//prints 36.3636
$BioPHP = new BioPHP('CTGATGATGGGAGGAAATTTCA','CTGATGATGCGAGGGAATATCG');
echo $BioPHP->countPointMutations();
//prints 4
$BioPHP = new BioPHP('CTGATGATGGGAGGAAATTTCAGA');
echo $BioPHP->translateDna();
//prints LMMGGNFR
$BioPHP = new BioPHP('CTGATGATGGGAGGAAATTTCAGA');
$proteinSequence = $BioPHP->translateDna()."\n"; //translate sequence
echo $BioPHP->calcMonoIsotopicMass($proteinSequence)."\n"; //calculate mass
//prints 906.42041
$BioPHP = new BioPHP('ATAT', 'GTATATCTATATGGCCATAT');
echo $BioPHP->findMotifDNA();
//prints 3 9 17
$BioPHP = new BioPHP('GTATATCTATATGGCCATAT');
print_r( $BioPHP->getReadingFrames() );
/*
* returns array containing...
Array
(
[0] => GTATATCTATATGGCCATAT
[1] => TATATCTATATGGCCATAT
[2] => ATATCTATATGGCCATAT
)
*/
//Protip: To get all 6 reading frames. Use the reverse and complement methods, then pass the result to getReadingFrames()
$fastaSequence = "
>Sequence 1
ATCCAGCT
>Sequence 2
GGGCAACT
>Sequence 3
ATGGATCT
";
$BioPHP = new BioPHP();
$fastaArray = $BioPHP->readFasta($fastaSequence); //read and parse the sequences
echo $BioPHP->mostLikelyCommonAncestor($fastaArray)."\n";
//prints ATGCAACT
$BioPHP = new BioPHP();
$uniprotFasta = $BioPHP->getUniprotFastaByID("B5ZC00"); //returns the result from Uniprot as a string
$fastaArray = $BioPHP->readFasta($uniprotFasta); //parses the response
echo $BioPHP->calcMonoIsotopicMass($fastaArray[1]['sequence'])."\n";
//prints 55319.0636