Exemple #1
0
        protected GeneElement MakeSideEle(string comp, int buff, int st, int ed)
        {
            GeneElement ele = null;

            if (comp == "promoter")
            {
                ele = new Promoter(buff, st, ed, this.Sense);
            }
            else if (comp == "flank3")
            {
                ele = new Flank3(st, ed, this.Sense);
            }

            return(ele);
        }
Exemple #2
0
        protected bool GenerateSideElement(string comp, bool from5Prime, int size, int buff, int scaffLen, out GeneElement result)
        {
            result = null;

            if (this.Sense == Sense.Sense)
            {
                if (from5Prime)
                {
                    if (this.Start - buff - size > 0)
                    {
                        result = MakeSideEle(comp, buff, this.Start - buff - size, this.Start - buff);
                    }
                }
                else
                {
                    if (this.End + buff + size < scaffLen)
                    {
                        result = MakeSideEle(comp, buff, this.End + buff, this.End + buff + size);
                    }
                }
            }
            else if (this.Sense != Sense.Sense)
            {
                if (from5Prime)
                {
                    if (this.End + buff + size < scaffLen)
                    {
                        result = MakeSideEle(comp, buff, this.End + buff, this.End + buff + size);
                    }
                }
                else
                {
                    if (this.Start - buff - size < 0)
                    {
                        result = MakeSideEle(comp, buff, this.Start - buff - size, this.Start - buff);
                    }
                }
            }
            if (result == null)
            {
                return(false);
            }
            else
            {
                return(true);
            }
        }