コード例 #1
0
 /*Notes -
  * DefineChromosomeLength - Should be run first to define the length since the next method assumes that the length was already defined (DefineChromosomePositions).
  *
  */
 #region Constructor
 /// <summary>
 /// The default nChr is 3 and the organism type is drosophila
 /// </summary>
 /// <param name="_nChr"></param>
 /// <param name="_type"></param>
 public DataGeneratorPresentor(int _nChr = 3, OrganismType _type = OrganismType.Drosophila)
 {
     go       = new GenomeOrganization();
     nChr     = _nChr;
     type     = _type;
     database = DatabaseProvider.GetDatabase();
     database.GenomeOrganization = go;
 }
コード例 #2
0
        /// <summary>
        /// This method defines the length of the chromosomes
        /// difine global parameters:
        ///    go=Genome organisation
        ///    nChr=number of chromosoms
        /// </summary>
        public void DefineChromosomeLength()
        {
            go.Chromosome = new List <Chromosome>();
            switch (type)
            {
            case OrganismType.Drosophila:
                go = genereateDrosophila(go, nChr);
                break;

            default:
                go = randomOrganism(go, nChr);
                break;
            }
        }
コード例 #3
0
        private GenomeOrganization genereateDrosophila(GenomeOrganization go, int nChr)
        {
            //see https://en.wikipedia.org/wiki/Drosophila_melanogaster
            //we consider only siple case (like in human):
            //    diploid,
            //    first chromosome is X (male has only one, he has also Y),
            //    no recombination in males,
            //    three chromosomes: X, 2, 3 (short fouth is ignored)
            //indeed, drosophyla can be triploid and tetraploid (with XXX and XXXX (may also 1 or more Y) for females; X and XX)
            double     coef = 1;
            int        drosophilaConst1 = 75, drosophilaConst2 = 107, drosophilaConst3 = 110;
            Chromosome ch = new Chromosome
            {
                Name          = "1",
                LenGenetcM    = drosophilaConst1 * coef,
                BRecInFemales = true,
                BGender       = false
            };

            go.addChr(ch);

            Chromosome ch1 = new Chromosome
            {
                Id            = 1,
                Name          = "2",
                LenGenetcM    = drosophilaConst2 * coef,
                BRecInFemales = true,
                BGender       = false
            };

            go.addChr(ch1);

            Chromosome ch2 = new Chromosome
            {
                Id            = 2,
                Name          = "3",
                LenGenetcM    = drosophilaConst3 * coef,
                BRecInFemales = true,
                BGender       = false
            };

            go.addChr(ch2);



            return(go);
        }
コード例 #4
0
        private GenomeOrganization randomOrganism(GenomeOrganization go, int nChr)
        {
            double     coef      = 1;
            List <int> chrLength = new List <int>();

            foreach (Dictionary <int, string> dic in rawGeneticData)
            {
                chrLength.Add(Convert.ToInt32(dic[1]));
            }

            for (int i = 0; i < nChr; i++)
            {
                Chromosome ch = new Chromosome();
                ch.Name       = Convert.ToString(i);
                ch.LenGenetcM = coef * chrLength[i];
                go.addChr(ch);
            }

            return(go);
        }
コード例 #5
0
        /// <summary>
        /// This method defines the length of the chromosomes
        /// </summary>
        public void DefineChromosomeLength()
        {
            switch (type)
            {
            case OrganismType.Drosophila:
                go = genereateDrosophila(go, nChr);
                break;


            case OrganismType.PseudoWheat:
                go = generatePseudoWheat(go, nChr);
                break;



            default:
                //error organisim is not supported
                break;
            }
        }
コード例 #6
0
        private GenomeOrganization genereateDrosophila(GenomeOrganization go, int nChr)
        {
            double     coef = 1;
            int        drosophilaConst1 = 75, drosophilaConst2 = 107, drosophilaConst3 = 110;
            Chromosome ch = new Chromosome
            {
                Id            = 0,
                LenGenetcM    = drosophilaConst1 * coef,
                BRecInFemales = true,
                BGender       = true
            };

            go.Chromosome.Add(ch);

            Chromosome ch1 = new Chromosome
            {
                Id            = 1,
                LenGenetcM    = drosophilaConst2 * coef,
                BRecInFemales = true,
                BGender       = true
            };

            go.Chromosome.Add(ch1);

            Chromosome ch2 = new Chromosome
            {
                Id            = 3,
                LenGenetcM    = drosophilaConst3 * coef,
                BRecInFemales = true,
                BGender       = true
            };

            go.Chromosome.Add(ch2);



            return(go);
        }
コード例 #7
0
 private GenomeOrganization generatePseudoWheat(GenomeOrganization go, int nChr)
 {
     return(go);
 }
コード例 #8
0
 /*Notes -
  * DefineChromosomeLength - Should be run first to define the length since the next method assumes that the length was already defined (DefineChromosomePositions).
  *
  */
 //My First Commit
 #region Constructor
 public DataGeneratorController(int _nChr, OrganismType _type)
 {
     go   = new GenomeOrganization();
     nChr = _nChr;
     type = _type;
 }