當前位置: 首頁>>代碼示例>>Java>>正文


Java HpoTermRelation類代碼示例

本文整理匯總了Java中com.github.phenomics.ontolib.formats.hpo.HpoTermRelation的典型用法代碼示例。如果您正苦於以下問題:Java HpoTermRelation類的具體用法?Java HpoTermRelation怎麽用?Java HpoTermRelation使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


HpoTermRelation類屬於com.github.phenomics.ontolib.formats.hpo包,在下文中一共展示了HpoTermRelation類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: parse

import com.github.phenomics.ontolib.formats.hpo.HpoTermRelation; //導入依賴的package包/類
/**
 * Parse OBO file into {@link HpoOntology} object.
 *
 * @return {@link HpoOntology} from parsing OBO file.
 * @throws IOException In case of problems with file I/O.
 */
@SuppressWarnings("unchecked")
public HpoOntology parse() throws IOException {
  final OboImmutableOntologyLoader<HpoTerm, HpoTermRelation> loader =
      new OboImmutableOntologyLoader<>(oboFile, debug);
  final HpoOboFactory factory = new HpoOboFactory();
  final ImmutableOntology<HpoTerm, HpoTermRelation> o = loader.load(factory);

  // Convert ImmutableOntology into HPOntology. The casts here are ugly and require the
  // @SuppressWarnings above but this saves us one factory layer of indirection.
  return new HpoOntology((ImmutableSortedMap<String, String>) o.getMetaInfo(),
      (ImmutableDirectedGraph<TermId, ImmutableEdge<TermId>>) o.getGraph(), o.getRootTermId(),
      o.getNonObsoleteTermIds(), o.getObsoleteTermIds(),
      (ImmutableMap<TermId, HpoTerm>) o.getTermMap(),
      (ImmutableMap<Integer, HpoTermRelation>) o.getRelationMap());
}
 
開發者ID:Phenomics,項目名稱:ontolib,代碼行數:22,代碼來源:HpoOboParser.java

示例2: precomputePairwiseResnik

import com.github.phenomics.ontolib.formats.hpo.HpoTermRelation; //導入依賴的package包/類
private void precomputePairwiseResnik() {
  LOGGER.info("Performing information content precomputation...");
  final InformationContentComputation<HpoTerm, HpoTermRelation> icPrecomputation =
      new InformationContentComputation<>(phenotypicAbnormalitySubOntology);
  final Map<TermId, Double> termToIc =
      icPrecomputation.computeInformationContent(termIdToObjectId);
  LOGGER.info("Done with precomputing information content.");

  LOGGER.info("Performing pairwise Resnik similarity precomputation...");
  resnikSimilarity = new ResnikSimilarity<HpoTerm, HpoTermRelation>(
      phenotypicAbnormalitySubOntology, termToIc, /* symmetric= */false);
  LOGGER.info("Done with precomputing pairwise Resnik similarity.");
}
 
開發者ID:Phenomics,項目名稱:ontolib,代碼行數:14,代碼來源:PrecomputeScoresCommand.java

示例3: performSampling

import com.github.phenomics.ontolib.formats.hpo.HpoTermRelation; //導入依賴的package包/類
private void performSampling() {
  LOGGER.info("Performing sampling...");

  final ScoreSamplingOptions samplingOptions = new ScoreSamplingOptions(options.getNumThreads(),
      options.getMinObjectId(), options.getMaxObjectId(), options.getMinNumTerms(),
      options.getMaxNumTerms(), options.getSeed(), options.getNumIterations());

  final SimilarityScoreSampling<HpoTerm, HpoTermRelation> sampling =
      new SimilarityScoreSampling<>(phenotypicAbnormalitySubOntology, resnikSimilarity,
          samplingOptions);
  scoreDistribution = sampling.performSampling(objectIdToTermId);

  LOGGER.info("Done with sampling.");
}
 
開發者ID:Phenomics,項目名稱:ontolib,代碼行數:15,代碼來源:PrecomputeScoresCommand.java

示例4: constructTermRelation

import com.github.phenomics.ontolib.formats.hpo.HpoTermRelation; //導入依賴的package包/類
@Override
public HpoTermRelation constructTermRelation(Stanza stanza, StanzaEntryIsA stanzaEntry) {
  final TermId sourceId =
      termIds.get(this.<StanzaEntryId>getCardinalityOneEntry(stanza, StanzaEntryType.ID).getId());
  final TermId destId = termIds.get(stanzaEntry.getId());
  return new HpoTermRelation(sourceId, destId, nextRelationId++, HpoRelationQualifier.IS_A);
}
 
開發者ID:Phenomics,項目名稱:ontolib,代碼行數:8,代碼來源:HpoOboFactory.java

示例5: performSimulation

import com.github.phenomics.ontolib.formats.hpo.HpoTermRelation; //導入依賴的package包/類
/**
 * Perform the actual simulation of phenotype annotations.
 */
private void performSimulation() {
  // Construct the query simulator to use.
  final AnnotationSetModifier<HpoTerm, HpoTermRelation> queryModifier =
      new AnnotationSetModifier<>(hpoOntology.getPhenotypicAbnormalitySubOntology(),
          new AnnotationSetModifier.Options(options.getSeed(), options.getMinQuerySize(),
              options.getMaxQuerySize(), options.getNoiseFraction(),
              options.getMapUpProbability()));
  // Get DiseaseId and perform simulation.
  final DiseaseId diseaseId = getDiseaseId();
  final AnnotatedDisease diseaseAnnotation = diseaseAnnotations.get(diseaseId);
  List<TermId> simulatedTermIds = queryModifier.simulateAnnotationSet(diseaseAnnotation);
  Collections.sort(simulatedTermIds);

  // Print simulated list of term ids.
  System.err.println("disease ID: " + diseaseId);
  System.err.println("disease name: " + diseaseAnnotations.get(diseaseId).getName());
  System.err.println("original terms: " + diseaseAnnotation.getAllAssociatedTermIds().stream()
      .map(tId -> tId.getIdWithPrefix()).collect(Collectors.toList()));
  System.err
      .println("original terms names: " + diseaseAnnotation.getAllAssociatedTermIds().stream()
          .map(tId -> hpoOntology.getTermMap().get(tId).getName()).collect(Collectors.toList()));
  System.err.println("simulated terms: "
      + simulatedTermIds.stream().map(tId -> tId.getIdWithPrefix()).collect(Collectors.toList()));
  System.err.println("simulated term names: " + simulatedTermIds.stream()
      .map(tId -> hpoOntology.getTermMap().get(tId).getName()).collect(Collectors.toList()));
}
 
開發者ID:Phenomics,項目名稱:annotation-simulator,代碼行數:30,代碼來源:Main.java


注:本文中的com.github.phenomics.ontolib.formats.hpo.HpoTermRelation類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。