Package edu.pitt.dbmi.nlp.noble.terminology

Examples of edu.pitt.dbmi.nlp.noble.terminology.Source


        .getConfigParameterValue("source.filter");
    if (!StringUtils.isEmpty(colonSeparatedSources)) {
      final String[] sabs = colonSeparatedSources.split(":");
      final Source[] sourceFilters = new Source[sabs.length];
      for (int tdx = 0; tdx < sabs.length; tdx++) {
        sourceFilters[tdx] = new Source(sabs[tdx]);
      }
      terminology.setFilterSources(sourceFilters);
    }
  }
View Full Code Here


    sb.append("offset: " + c.getOffset() + "\n");
    sb.append("conceptClass: " + c.getConceptClass() + "\n");
    sb.append("content: " + c.getContent() + "\n");
    sb.append("matchedTerm: " + c.getMatchedTerm() + "\n");
    sb.append("score: " + c.getScore() + "\n");
    String conceptCode = c.getCode(new Source("NCI"));
    sb.append("conceptCode (NCI): " + conceptCode + "\n");
    conceptCode = c.getCode(new Source("LNC"));
    sb.append("conceptCode (LNC): " + conceptCode + "\n");
    conceptCode = c.getCode(new Source("MSH"));
    sb.append("conceptCode (MSH): " + conceptCode + "\n");

    // Todo

    sb.append("preferredTerm: " + c.getPreferredTerm() + "\n");
View Full Code Here

  public String[] getSearchMethods() {
    return new String[] { BioPortalHelper.EXACT_MATCH };
  }

  public Source[] getSources() {
    return new Source[] { new Source(getName(), getDescription(), ""
        + getURI()) };
  }
View Full Code Here

  /**
   * Return list of all sources in this terminology
   * @return
   */
  public Source [] getSources(){
    return new Source [] { new Source(getName(),getDescription(),""+getURI())};
  }
View Full Code Here

    // do codes
    IProperty code_p = ont.getProperty("FMAID");
    if(code_p != null){
      Object [] val = cls.getPropertyValues(code_p);
      if(val.length > 0){
        addCode(val[0].toString(),new Source("FMA"));
        setCode(val[0].toString());
      }
    }
    IProperty umls_p = ont.getProperty("UMLS_ID");
    if(umls_p != null){
      Object [] val = cls.getPropertyValues(umls_p);
      if(val.length > 0)
        addCode(val[0].toString(),new Source("UMLS"));
    }
   
    // do definitions
    List<Definition> deflist = new ArrayList<Definition>();
    IProperty def_p = ont.getProperty("definition");
View Full Code Here

          String group = mt.group(2);
          String src   = mt.group(3);
         
          Term term = new Term(text);
          term.setForm(group);
          term.setSource(new Source(src));
         
          terms.add(term);
          syns.add(text);
        }
      }
      setTerms(terms.toArray(new Term [0]));
      setSynonyms(syns.toArray(new String [0]));
    }
       
    // do definitions
    List<Definition> deflist = new ArrayList<Definition>();
    IProperty def_p = prop.get("DEFINITION");
    if(def_p != null){
      for(Object val : cls.getPropertyValues(def_p)){
        Pattern pt = Pattern.compile(".*<.*:def-definition>(.*)</.*:def-definition><.*:def-source>(.*)</.*:def-source>.*");
        Matcher mt = pt.matcher(val.toString());
        if(mt.matches()){
          String text  = mt.group(1);
          String src   = mt.group(2);
         
          Definition d = new Definition(text);
          d.setSource(new Source(src));
          deflist.add(d);
        }
      }
    }
   
    IProperty adef_p = prop.get("ALT_DEFINITION");
    if(adef_p != null){
      for(Object val : cls.getPropertyValues(adef_p)){
        Pattern pt = Pattern.compile(".*<.*:def-definition>(.*)</.*:def-definition><.*:def-source>(.*)</.*:def-source>.*");
        Matcher mt = pt.matcher(val.toString());
        if(mt.matches()){
          String text  = mt.group(1);
          String src   = mt.group(2);
         
          Definition d = new Definition(text);
          d.setSource(new Source(src));
          deflist.add(d);
        }
      }
    }
   
    setDefinitions(deflist.toArray(new Definition [0]));
   
    // do semantic type
    IProperty sem_p = prop.get("Semantic_Type");
    if(sem_p != null){
      Object [] val = cls.getPropertyValues(sem_p);
      SemanticType [] types = new SemanticType [val.length];
      for(int i=0;i<val.length;i++){
        types[i] = SemanticType.getSemanticType(val[i].toString());
      }
      setSemanticTypes(types);
    }
   
    // do codes
    IProperty code_p = prop.get("code");
    if(code_p != null){
      Object [] val = cls.getPropertyValues(code_p);
      if(val.length > 0){
        addCode(val[0].toString(),new Source("NCI"));
        setCode(val[0].toString());
      }
    }
   
    IProperty umls_p = prop.get("UMLS_CUI");
    if(umls_p != null){
      Object [] val = cls.getPropertyValues(umls_p);
      if(val.length > 0){
        addCode(val[0].toString(),new Source("UMLS"));
      }
    }
   
    IProperty nci_p = prop.get("NCI_META_CUI");
    if(nci_p != null){
      Object [] val = cls.getPropertyValues(nci_p);
      if(val.length > 0){
        addCode(val[0].toString(),new Source("NCI_META"));
      }
    }
  }
View Full Code Here

   
    // do code
    IProperty code_p = ont.getProperty(BioPortalHelper.CODE);
    if(code_p != null){
      for(Object val : cls.getPropertyValues(code_p)){
        addCode(val.toString(),new Source(val.toString()));
      }
    }
   
    // do sem type
    IProperty sem_p = ont.getProperty(BioPortalHelper.SEMANTIC_TYPE);
View Full Code Here

        item.setType(TemplateItem.TYPE_ORGAN);
        String code = getCode((String) c.getPropertyValue(ont.getProperty("code")),true);
        if(code != null){
          String cd = (code.indexOf("#") > -1)?code.substring(0,code.lastIndexOf("#")):code;
          String nm = (cd.indexOf("/") > -1)?cd.substring(cd.lastIndexOf("/")+1):cd;
          Source src = new Source(nm, "", cd);
          try {
            template.getTerminology().lookupConcept(item.getConcept().getCode()).addCode(code,src);
          } catch (TerminologyException e) {
            e.printStackTrace();
          }
View Full Code Here

        mrcon.write(cui+I+lat+I+ts+I+lui+I+stt+I+sui+I+str+I+lrl+I+"\n");
        mrcon.flush();
       
        // save term information in MRSO
        // C0002871|L0002871|S0013742|SNOMEDCT|OP|154786001|9|
        Source src = t.getSource();
        if(src == null && c.getSources().length > 0)
          src = c.getSources()[0];
        String sab  = src != null?src.getName():"";
        String tty = t.isPreferred()?"PT":"NP";
        //String tty = t.getForm() != null && !compat?t.getForm():"SY";
        String scode = (c.getCodes() != null && src != null && c.getCodes().containsKey(src))?""+c.getCodes().get(src):cui;
       
        mrso.write(cui+I+lui+I+sui+I+sab+I+tty+I+scode+I+lrl+I+"\n");
        mrso.flush();
      }
     
      // save MRDEF information in MRDEF
      // C0002871|CSP|subnormal levels or function of erythrocytes, resulting in symptoms of tissue hypoxia.|
      for(Definition d: c.getDefinitions()){
        Source src = d.getSource();
        if(src == null && c.getSources().length > 0)
          src = c.getSources()[0];
        String sab = src != null?src.getName():"";
        String def = d.getDefinition();
        mrdef.write(cui+I+sab+I+def+I+"\n");
        mrdef.flush();
      }
      // save MRSTY information
      // C0000005|T121|Pharmacologic Substance||
      if(compat){
        String tui = "T071";
        String sty = "Entity";
        mrsty.write(cui+I+tui+I+sty+I+"\n");
        mrsty.flush();
      }else{
        for(SemanticType st: c.getSemanticTypes()){
          String tui = getTUI(st);
          String sty = st.getName();
          mrsty.write(cui+I+tui+I+sty+I+"\n");
          mrsty.flush();
        }
      }
      // add to sources
      Collections.addAll(sources,c.getSources())
     
      // save terminology
      if(term == null && c.getTerminology() != null)
        term = c.getTerminology();
     
      // keep track of translation
      codes.write(cui+"="+code+"\n");
      codes.flush();
    }
   
    // if possible use sources from terminology, cuase they have more data
    if(term != null && term.getSources().length > 0){
      Set<Source> tsources = new TreeSet<Source>();
      for(Source s: term.getSources()){
        if(sources.contains(s)){
          tsources.add(s);
        }
      }
      sources = tsources;
    }
   
    // write out sources
    // CL432995|C1140168|NCI2011_12E|NCI|National Cancer Institute Thesaurus, 2011_12E|NCI|2011_12E|||201112||
    // Sherri de Coronado;Center for Bioinformatics, National Cancer Institute;2115 E. Jefferson St.;6th Floor;
    // Rockville;MD;USA;20892-8335;925-377-5960;decorons@osp.nci.nih.gov|Sherri de Coronado;Center for Bioinformatics,
    // National Cancer Institute;2115 E. Jefferson St.;6th Floor;Rockville;MD;USA;20892-8335;925-377-5960;decorons@osp.nci.nih.gov
    // |0|205092|87562|FULL-NOSIB-MULTIPLE-IGNORE-RELA|AB,AD,BN,CA2,CA3,CCN,CCS,CNU,CSN,DN,FBD,HD,OP,PT,SY|
    // Accepted_Therapeutic_Use_For,BioCarta_ID,CAS_Registry,CHEBI_ID,Chemical_Formula,Contributing_Source,Design_Note,
    // EntrezGene_ID,Essential_Amino_Acid,Essential_Fatty_Acid,Extensible_List,FDA_Table,FDA_UNII_Code,GO_Annotation,
    // GenBank_Accession_Number,Gene_Encodes_Product,Homologous_Gene,ICD-O-3_Code,INFOODS,KEGG_ID,MGI_Accession_ID,
    // Macronutrient,Micronutrient,NCBI_Taxon_ID,NSC_Code,Neoplastic_Status,Nutrient,OMIM_Number,PDQ_Closed_Trial_Search_ID,
    // PDQ_Open_Trial_Search_ID,PID_ID,PubMedID_Primary_Reference,Swiss_Prot,Tolerable_Level,USDA_ID,US_Recommended_Intake,Unit,
    // Use_For,miRBase_ID|ENG|UTF-8|Y|Y|NCI Thesaurus|National Cancer Institute, National Institutes of Health;NCI Thesaurus;
    // Sherri de Coronado, decorons@osp.nci.nih.gov;December 2011, Protege version;Rockville, MD|
    for(Source src : sources){ 
      String def = src.getDescription();
      if(def != null){
        int x = def.indexOf(".");
        if(x > -1){
          def = def.substring(0,x);
        }
      }
      String vcui = "";
      String rcui = src.getCode() != null?src.getCode():"";
      String vsab = "";// versioned abbreviation
      String rsab = src.getName(); // abbreviation
      String son  = def != null?def:""; // official name
      String sf = src.getName(); // source family
      String sver = "";
      String vstart = "";
      String vend = "";
      String imeta ="";
      String rmeta = "";
View Full Code Here

      String code = c.getCode();
     
      // save term information in MRCONSO
      // C0000005|ENG|P|L0187013|PF|S2192303|Y|A4332670||M0019694|D012711|MSH|EN|D012711|(131)I-MAA|0|N||
      for(Term t: c.getTerms()){
        Source src = t.getSource();
        if(src == null && c.getSources().length > 0)
          src = c.getSources()[0];
        String lat = t.getLanguage() == null?"ENG":t.getLanguage();
        String ts =  t.isPreferred()?"P":"S";
        String lui = getLUI(t.getText());
        String stt = t.isPreferred()?"PF":"VO";
        String sui = getSUI(t.getText());
        String pref = t.isPreferred()?"Y":"N";
        String aui = String.format("A%07d",atomCount);
        String saui = "";
        String scui = "";
        String sdui = "";
        String sab  = src != null?src.getName():"";
        String tty = t.getForm() != null?t.getForm():"SY";
        String scode = (c.getCodes() != null && src != null && c.getCodes().containsKey(src))?""+c.getCodes().get(src):cui;
        String str = t.getText();
        String srl = "0";
        String sup  = "N";
        String cvf = "";
       
        // write out
        mrconso.write(cui+I+lat+I+ts+I+lui+I+stt+I+sui+I+pref+I+aui+I+saui+I+scui+I+sdui+I+sab+I+tty+I+scode+I+str+I+srl+I+sup+I+cvf+"\n");
        mrconso.flush();
        atomCount ++;
      }
      // save MRDEF information in MRDEF
      // C0000107|A3857241|AT22515555||MSH|An ANGIOTENSIN II analog which acts as a highly specific inhibitor of ANGIOTENSIN TYPE 1 RECEPTOR.|N||
      for(Definition d: c.getDefinitions()){
        Source src = d.getSource();
        if(src == null && c.getSources().length > 0)
          src = c.getSources()[0];
        String aui = "";
        String atui = "";
        String satui = "";
        String sab = src != null?src.getName():"";
        String def = d.getDefinition();
        String sup = "N";
        String cvf = "";
        mrdef.write(cui+I+aui+I+atui+I+satui+I+sab+I+def+I+sup+I+cvf+"\n");
        mrdef.flush();
      }
      // save MRSTY information
      // C0000005|T121|A1.4.1.1.1|Pharmacologic Substance|AT16627324||
      for(SemanticType st: c.getSemanticTypes()){
        String tui = getTUI(st);
        String stn = "";
        String sty = st.getName();
        String atui = "";
        String cvf = "";
        mrsty.write(cui+I+tui+I+stn+I+sty+I+atui+I+cvf+"\n");
        mrsty.flush();
      }
      // add to sources
      Collections.addAll(sources,c.getSources())
     
      // save terminology
      if(term == null && c.getTerminology() != null)
        term = c.getTerminology();
     
      // keep track of translation
      codes.write(cui+"="+code+"\n");
      codes.flush();
    }
   
    // if possible use sources from terminology, cuase they have more data
    if(term != null && term.getSources().length > 0){
      Set<Source> tsources = new TreeSet<Source>();
      for(Source s: term.getSources()){
        if(sources.contains(s)){
          tsources.add(s);
        }
      }
      sources = tsources;
    }
   
    // write out sources
    // CL432995|C1140168|NCI2011_12E|NCI|National Cancer Institute Thesaurus, 2011_12E|NCI|2011_12E|||201112||
    // Sherri de Coronado;Center for Bioinformatics, National Cancer Institute;2115 E. Jefferson St.;6th Floor;
    // Rockville;MD;USA;20892-8335;925-377-5960;decorons@osp.nci.nih.gov|Sherri de Coronado;Center for Bioinformatics,
    // National Cancer Institute;2115 E. Jefferson St.;6th Floor;Rockville;MD;USA;20892-8335;925-377-5960;decorons@osp.nci.nih.gov
    // |0|205092|87562|FULL-NOSIB-MULTIPLE-IGNORE-RELA|AB,AD,BN,CA2,CA3,CCN,CCS,CNU,CSN,DN,FBD,HD,OP,PT,SY|
    // Accepted_Therapeutic_Use_For,BioCarta_ID,CAS_Registry,CHEBI_ID,Chemical_Formula,Contributing_Source,Design_Note,
    // EntrezGene_ID,Essential_Amino_Acid,Essential_Fatty_Acid,Extensible_List,FDA_Table,FDA_UNII_Code,GO_Annotation,
    // GenBank_Accession_Number,Gene_Encodes_Product,Homologous_Gene,ICD-O-3_Code,INFOODS,KEGG_ID,MGI_Accession_ID,
    // Macronutrient,Micronutrient,NCBI_Taxon_ID,NSC_Code,Neoplastic_Status,Nutrient,OMIM_Number,PDQ_Closed_Trial_Search_ID,
    // PDQ_Open_Trial_Search_ID,PID_ID,PubMedID_Primary_Reference,Swiss_Prot,Tolerable_Level,USDA_ID,US_Recommended_Intake,Unit,
    // Use_For,miRBase_ID|ENG|UTF-8|Y|Y|NCI Thesaurus|National Cancer Institute, National Institutes of Health;NCI Thesaurus;
    // Sherri de Coronado, decorons@osp.nci.nih.gov;December 2011, Protege version;Rockville, MD|
    for(Source src : sources){ 
      String def = src.getDescription();
      if(def != null){
        int x = def.indexOf(".");
        if(x > -1){
          def = def.substring(0,x);
        }
      }
      String vcui = "";
      String rcui = src.getCode() != null?src.getCode():"";
      String vsab = "";// versioned abbreviation
      String rsab = src.getName(); // abbreviation
      String son  = def != null?def:""; // official name
      String sf = src.getName(); // source family
      String sver = "";
      String vstart = "";
      String vend = "";
      String imeta ="";
      String rmeta = "";
      String slc = "";
      String scc = "";
      String srl = "0";
      String tfr = ""; //term frequence
      String cfr = ""; // concept frequency
      String cxty = "";
      String ttyl = "";
      String atnl = "";
      String lat = "ENG";
      String cenc = "UTF-8";
      String curver = "Y";
      String sabin = "Y";
      String ssn = son;
      String scit= src.getDescription();
           
      mrsab.write(vcui+I+rcui+I+vsab+I+rsab+I+son+I+sf+I+sver+I+vstart+I+vend+I+imeta+I+rmeta+I+slc+I+scc+I+srl+I+tfr+I+cfr+
            I+cxty+I+ttyl+I+atnl+I+lat+I+cenc+I+curver+I+sabin+I+ssn+I+scit+"\n");
     
    }
View Full Code Here

TOP

Related Classes of edu.pitt.dbmi.nlp.noble.terminology.Source

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.