Beispiel #1
0
 /**
  * Add a Gene object reference to locusGenes
  *
  * @see http://www.doctrine-project.org/api/common/2.5/class-Doctrine.Common.Collections.ArrayCollection.html
  *                                                 Doctrine documentation on the class ArrayCollection
  * @param \bcGen\MainBundle\Entity\Gene $gene
  *         	
  * @return Locus
  */
 public function addLocusGenes(\bcGen\MainBundle\Entity\Gene $gene)
 {
     $this->locusGenes[] = $gene;
     $gene->setGeneLocus($this);
     return $this;
 }
Beispiel #2
0
 /**
  * Test the geneAccessionComp() method from the Gene class
  *
  * @todo Think to a new version of this test
  *
  * @uses \bcGen\MainBundle\Entity\Gene::geneAccessionComp()
  */
 public function testGeneAccessionComp7()
 {
     echo "\n********************Test GeneAccessionComp7()***********************************************\n";
     $result = 0;
     $result = \bcGen\MainBundle\Entity\Gene::geneAccessionComp($this->genes[5], $this->genes[1]);
     $result += \bcGen\MainBundle\Entity\Gene::geneAccessionComp($this->genes[5], $this->genes[2]);
     $result += \bcGen\MainBundle\Entity\Gene::geneAccessionComp($this->genes[5], $this->genes[3]);
     $result += \bcGen\MainBundle\Entity\Gene::geneAccessionComp($this->genes[5], $this->genes[4]);
     $this->assertEquals(4, $result);
 }
Beispiel #3
0
 /**
  * 
  * {@inheritDoc}
  * 
  * @see \Doctrine\Common\DataFixtures\FixtureInterface::load()
  * 
  * @param Doctrine\Common\Persistence\ObjectManager $manager
  */
 public function load(ObjectManager $manager)
 {
     $gene1 = new Gene();
     $gene1->setGeneAccession('GeneAccessionTU1');
     $gene1->setGeneContig(1);
     $gene1->setGeneRef(TRUE);
     $gene1->setGeneSeq('GeneSeqTU1');
     $gene1->setGeneGenome($this->getReference('GenomeTU1'));
     $gene1->setGeneLocus($this->getReference('LocusTU1'));
     $gene1->addGeneAnnotations($this->getReference('AnnotationTU1'));
     $gene1->addGeneProteins($this->getReference('ProteinTU1'));
     $gene1->addGeneProteins($this->getReference('ProteinTU2'));
     $gene1->addGeneProteins($this->getReference('ProteinTU3'));
     $gene1->addGeneSources($this->getReference('PublicationTU1'));
     $manager->persist($gene1);
     $this->addReference('GeneTU1', $gene1);
     $gene2 = new Gene();
     $gene2->setGeneAccession('GeneAccessionTU2');
     $gene2->setGeneContig(2);
     $gene2->setGeneRef(FALSE);
     $gene2->setGeneSeq('GeneSeqTU2');
     $gene2->setGeneGenome($this->getReference('GenomeTU1'));
     $gene2->setGeneLocus($this->getReference('LocusTU1'));
     $gene2->addGeneAnnotations($this->getReference('AnnotationTU1'));
     $gene2->addGeneAnnotations($this->getReference('AnnotationTU2'));
     $gene2->addGeneProteins($this->getReference('ProteinTU4'));
     $gene2->addGeneProteins($this->getReference('ProteinTU5'));
     $gene2->addGeneProteins($this->getReference('ProteinTU6'));
     $gene2->addGeneSources($this->getReference('PublicationTU1'));
     $manager->persist($gene2);
     $this->addReference('GeneTU2', $gene2);
     $gene3 = new Gene();
     $gene3->setGeneAccession('GeneAccessionTU3');
     $gene3->setGeneContig(3);
     $gene3->setGeneRef(TRUE);
     $gene3->setGeneSeq('GeneSeqTU3');
     $gene2->setGeneGenome($this->getReference('GenomeTU1'));
     $gene2->setGeneLocus($this->getReference('LocusTU1'));
     $gene3->addGeneAnnotations($this->getReference('AnnotationTU2'));
     $gene3->addGeneAnnotations($this->getReference('AnnotationTU3'));
     $gene3->addGeneProteins($this->getReference('ProteinTU7'));
     $gene3->addGeneProteins($this->getReference('ProteinTU8'));
     $gene3->addGeneProteins($this->getReference('ProteinTU9'));
     $gene3->addGeneSources($this->getReference('PublicationTU1'));
     $manager->persist($gene3);
     $this->addReference('GeneTU3', $gene3);
     $gene4 = new Gene();
     $gene4->setGeneAccession('GeneAccessionTU4');
     $gene4->setGeneContig(4);
     $gene4->setGeneRef(FALSE);
     $gene4->setGeneSeq('GeneSeqTU4');
     $gene4->setGeneGenome($this->getReference('GenomeTU1'));
     $gene4->setGeneLocus($this->getReference('LocusTU1'));
     $gene4->addGeneAnnotations($this->getReference('AnnotationTU3'));
     $gene4->addGeneProteins($this->getReference('ProteinTU10'));
     $gene4->addGeneProteins($this->getReference('ProteinTU11'));
     $gene4->addGeneProteins($this->getReference('ProteinTU12'));
     $gene4->addGeneSources($this->getReference('PublicationTU1'));
     $manager->persist($gene4);
     $this->addReference('GeneTU4', $gene4);
     $gene5 = new Gene();
     $gene5->setGeneAccession('GeneAccessionTU5');
     $gene5->setGeneContig(5);
     $gene5->setGeneRef(TRUE);
     $gene5->setGeneSeq('GeneSeqTU5');
     $gene5->setGeneGenome($this->getReference('GenomeTU1'));
     $gene5->setGeneLocus($this->getReference('LocusTU1'));
     $gene5->addGeneAnnotations($this->getReference('AnnotationTU4'));
     $gene5->addGeneProteins($this->getReference('ProteinTU13'));
     $gene5->addGeneProteins($this->getReference('ProteinTU14'));
     $gene5->addGeneProteins($this->getReference('ProteinTU15'));
     $gene5->addGeneSources($this->getReference('PublicationTU1'));
     $manager->persist($gene5);
     $this->addReference('GeneTU5', $gene5);
     $manager->flush();
 }