예제 #1
0
 public virtual void RecieveFilterInstruction(ElementFilterInstruction ele)
 {
     foreach (KeyValuePair <string, List <MiscElement> > kvp in RegElements)
     {
         if (kvp.Key == ele.ElementType)
         {
             TrimWrongSizedElements(kvp.Value, ele.MinLength, ele.MaxLength);
             break;
         }
     }
 }
예제 #2
0
        protected void OnRunFilter(object sender, EventArgs e)
        {
            bool   parseSuccess = true;
            string failfield    = "(";

            instructions = new List <ElementFilterInstruction> ();
            FiltSettings.Clear();

            foreach (FilterEntryBinder feb in filtEntBind)
            {
                if (feb.Check.Active)
                {
                    int ma; int mi;
                    if (!int.TryParse(feb.MaxEnt.Text, out ma))
                    {
                        parseSuccess = false;
                        failfield   += feb.id + "min val, ";
                    }
                    if (!int.TryParse(feb.MinEnt.Text, out mi))
                    {
                        parseSuccess = false;
                        failfield   += feb.id + "max val, ";
                    }
                    if (parseSuccess)
                    {
                        FiltSettings.Add(new OldFiltSettings(feb.id, mi, ma));
                        ElementFilterInstruction efil = new ElementFilterInstruction(feb.id, mi, ma);
                        instructions.Add(efil);
                    }
                }
            }

            if (parseSuccess)
            {
                MainData.RunElementFilter(instructions);
                this.Destroy();
            }
            else
            {
                MainData.ShowMessageWindow("The following entries were in error: " + failfield, false);
            }
        }
예제 #3
0
        public override void RecieveFilterInstruction(ElementFilterInstruction ele)
        {
            foreach (KeyValuePair <string, List <GeneElement> > kvp in Elements)
            {
                if (kvp.Key == ele.ElementType)
                {
                    switch (kvp.Key)
                    {
                    case "three_prime_UTR":
                        TrimCompoundedWrongSizedElement(kvp.Value, ele.MinLength, ele.MaxLength);
                        break;

                    case "five_prime_UTR":
                        TrimCompoundedWrongSizedElement(kvp.Value, ele.MinLength, ele.MaxLength);
                        break;

                    default:
                        TrimWrongSizedElements(kvp.Value, ele.MinLength, ele.MaxLength);
                        break;
                    }
                    break;
                }
            }
        }