Simple sequence analysis

This code finds mirrors into a sequence string. It takes as parameter one start and one end.


Sample code :


public function sequenceanalysis(SequenceInterface $sequenceManager)
{
    $oSequence = new Sequence();
    $oSequence->setSequence("AGGGAATTAAGTAAATGGTAGTGG");
    $sequenceManager->setSequence($oSequence);
 
    $aMirrors = $sequenceManager->findMirror(null, 6, 8, "E");
 
    return $this->render('default/sequenceanalysis.html.twig',
        array('mirrors' => $aMirrors)
    );
}

Result :

array:2 [
  6 => array:2 [
    0 => array:2 [
      0 => "AATTAA"
      1 => 4
    ]
    1 => array:2 [
      0 => "ATGGTA"
      1 => 14
    ]
  ]
  8 => array:1 [
    0 => array:2 [
      0 => "GAATTAAG"
      1 => 3
    ]
  ]
]