Ejemplo n.º 1
0
        public override bool Equals(object haplogroup)
        {
            if (!(haplogroup is Haplogroup))
            {
                return(false);
            }
            Haplogroup c = (Haplogroup)haplogroup;

            if (!this.haplogroup.Equals(c.haplogroup))
            {
                return(false);
            }
            return(true);
        }
Ejemplo n.º 2
0
        public bool isSuperHaplogroup(Haplogroup hgToCheck)
        {
            if (!(hgToCheck is Haplogroup))
            {
                return(false);
            }
            Haplogroup c = hgToCheck;

            if (!c.haplogroup.Contains(this.haplogroup))
            {
                return(false);
            }
            return(true);
        }
Ejemplo n.º 3
0
        //TODO: This needs to be a method
        //private StreamReader PolygeneticWeights {


        public void changePoly(Haplogroup hg, Polymorphism polyOld, Polymorphism polyNew)
        {
            var e = getPolysOfHg(hg);

            foreach (XmlNode ce in e)
            {
                if (ce.InnerText.Equals(polyOld.ToString()))
                {
                    ce.InnerText = polyNew.ToString();
                    return;
                }
            }
            throw new HaploGrepException("Polymorphism does not exit");
        }
Ejemplo n.º 4
0
        public XmlNodeList getPolysOfHg(Haplogroup hg)
        {
            var titleNode = xmlDoc.SelectSingleNode("//haplogroup[@name=\"" + hg.ToString() + "\"]/details");

            return(titleNode.SelectNodes("poly"));
        }