Play with sequencies


Sample code :


/**
  * Here is some samples of how to use the functions
  * @param ProteinInterface $proteinManager
  * @return Response
  * @throws \Exception
  */
public function playwithproteins(ProteinInterface $proteinManager)
{
   $sProtein = "ARNDCEQGHARNDCEQGHILKMFPSTWYVXARNDKMFPSTWYVXARNDKMFPSTWYVXARNDCEQGHARNDCEQGHHARNDCEQGHILKMFPSTW";
   $sProtein .= "YVXARNDKMFPSTHARNDCEQGHILKMFPSTWYVXARNDKMFPSTHARNDCEQGHILKMFPSTWYVXARNDKMFPSTHARNDCEQGHILKMFPSTWY";
   $sProtein .= "VXARNDKMFPSTHARNDCEQGHILKMFPSTWYVXARNDKMFPST";
 
   $oProtein = new Protein();
   $oProtein->setName("toto");
   $oProtein->setSequence($sProtein);
   $proteinManager->setProtein($oProtein);
 
   $iLength = $proteinManager->seqlen();
   $iMolwt = $proteinManager->molwt();
 
   return $this->render('default/playwithproteins.html.twig',
       [
           'length' => $iLength,
           'molwt'  => $iMolwt
       ]
   );
}

Result :

Returns the length of a protein :

236

Returns the molweight of a protein :

array:2 [
  0 => 60056.635
  1 => -4233.525
]