예제 #1
0
        private void buttonFetch_Click(object sender, EventArgs e)
        {
            tabControlRight.SelectedTab = tabPageLog;

            List <string> translations = gt.AssociationTranslator.Translate(textBoxFetch.Text);
            List <Term>   theTerms     = gt.Terms;
            List <Term>   leafs        = gt.FindLeafes(ref theTerms);

            //We want to print besides the term if it is a leaf
            foreach (string s in translations)
            {
                bool isLeaf = false;

                //We need to remove the GO:
                string translatedCorrected = System.Text.RegularExpressions.Regex.Replace(s, "GO:", "");
                Term   mtTerm = gt.getTermByID(translatedCorrected);

                //Is it a leaf?
                foreach (Term t in leafs)
                {
                    if (s.EndsWith(t.id))
                    {
                        isLeaf = true;
                    }
                }

                richTextBoxLog.AppendText(mtTerm.id + " " + mtTerm.name + " " + "Is Leaf: " + isLeaf + "(" + mtTerm.nameSpace + ") " + mtTerm.definition + "\n\n");
            }
        }
예제 #2
0
        public TermScoreCalculator(ref GOTerms gt, ref ResultParser rp)
        {
            this.gt      = gt;
            resultParser = rp;

            //Find root term for the 3 GO namespaces
            //Molecular function, Celular Component, Biological Process
            List <string> topMostNodesIDs = gt.findTopMostNodes();

            foreach (string s in topMostNodesIDs)
            {
                Term termToAdd = gt.getTermByID(s);
                topMostNodes.Add(termToAdd);
            }

            BuildResultsInPopulationCache();
        }