Example #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);
        }
Example #2
0
        public override void AddFileElement(string ele_name, int start, int end)
        {
            if (end - start > 0)
            {
                GeneElement ele;
                int         cnt = 0;
                switch (ele_name)
                {
                case "five_prime_UTR":
                    ele = new UTR5(start, end, this.Sense);
                    if (!Elements.ContainsKey("five_prime_UTR"))
                    {
                        Elements.Add("five_prime_UTR", new List <GeneElement> ());
                    }
                    Elements ["five_prime_UTR"].Add(ele);
                    break;

                case "three_prime_UTR":
                    ele = new UTR3(start, end, this.Sense);
                    if (!Elements.ContainsKey("three_prime_UTR"))
                    {
                        Elements.Add("three_prime_UTR", new List <GeneElement> ());
                    }
                    Elements ["three_prime_UTR"].Add(ele);
                    break;

                case "exon":
                    if (!Elements.ContainsKey("exon"))
                    {
                        Elements.Add("exon", new List <GeneElement> ());
                    }
                    cnt = Elements ["exon"].Count + 1;
                    ele = new Exon(cnt, start, end, this.Sense);
                    Elements ["exon"].Add(ele);
                    break;

                case "CDS":
                    if (!Elements.ContainsKey("CDS"))
                    {
                        Elements.Add("CDS", new List <GeneElement> ());
                    }
                    cnt = Elements ["CDS"].Count + 1;
                    ele = new CDS(cnt, start, end, this.Sense);
                    Elements ["CDS"].Add(ele);
                    break;

                default:
                    if (ele_name.Contains("promoter"))
                    {
                        ele = new Promoter(ele_name, start, end, this.Sense);
                        if (!Elements.ContainsKey(ele_name))
                        {
                            Elements.Add(ele_name, new List <GeneElement> ());
                        }
                        Elements [ele_name].Add(ele);
                    }
                    else
                    {
                        if (!Elements.ContainsKey(ele_name))
                        {
                            Elements.Add(ele_name, new List <GeneElement> ());
                        }
                        ele = new MiscElement(ele_name, start, end, this.Sense);
                        Elements [ele_name].Add(ele);
                    }
                    break;
                }
            }
        }