owltools.gaf.lego
Class LegoModelGenerator

java.lang.Object
  extended by owltools.util.MinimalModelGenerator
      extended by owltools.gaf.lego.LegoModelGenerator

public class LegoModelGenerator
extends MinimalModelGenerator

Generates an augmented Minimal Model (aka LEGO) graph for a given process, given an ontology and a set of annotations. A process can be a 'normal' biological process (e.g. from GO) or a pathological process (we can treat MP as abnormal processes for the purposes of this analysis, or make a parallel ontology) The input is a process class and a set of genes (e.g. all genes involved in that BP), construct the most likely set of gene + activity-type (i.e. MF) pairs that are likely to be executed during this process. Also infer causal relationships between gene-activity pairs based on PPI networks, annotation extensions. The network generation is broken into two steps

  • Minimal Model Generation, which generates a minimal set of individuals inferred to exist given the existence of the process class.
  • Model AugmentationDefinitions

    Algorithm - TODO - REDOCUMENT

    Inputs

    Mapping to OWL

    Notes: we treat all members of G as proteins, but these may be other kinds of gene product. Note also the source ID may be a gene ID. In this case we can substitute "enabled_by some g" with "enabled_by some (product_of some g)" In some cases the edge type is not known - here we can use a generic owlTopProperty - or we can assume an activates relation, and leave the user to prune/modify

    TODO

    https://docs.google.com/document/d/1TV8Eb9sSvFY-weVZaIfzCxF1qbnmkUaiUhTm9Bs3gRE/edit


    Field Summary
     Set<org.semanticweb.owlapi.model.OWLClass> processClassSet
               
     
    Fields inherited from class owltools.util.MinimalModelGenerator
    isStrict, prototypeIndividualMap
     
    Constructor Summary
    LegoModelGenerator(org.semanticweb.owlapi.model.OWLOntology tbox)
               
    LegoModelGenerator(org.semanticweb.owlapi.model.OWLOntology tbox, org.semanticweb.owlapi.model.OWLOntology abox)
               
    LegoModelGenerator(org.semanticweb.owlapi.model.OWLOntology tbox, org.semanticweb.owlapi.model.OWLOntology abox, org.semanticweb.owlapi.reasoner.OWLReasonerFactory rf)
              Deprecated. 
    LegoModelGenerator(org.semanticweb.owlapi.model.OWLOntology tbox, org.semanticweb.owlapi.reasoner.OWLReasonerFactory reasonerFactory)
               
     
    Method Summary
     void addGenes(org.semanticweb.owlapi.model.OWLClass processCls)
               
     void addGenes(org.semanticweb.owlapi.model.OWLClass processCls, Collection<String> seedGenes)
              Create initial activation node set A for a process P and a set of seed genes for all g ∈ Gseed, add a = to A where f = argmax(p) { t : t ∈ TA, p=Prob( t | g) }
     void addGenes(String processClsId, Collection<String> seedGenes)
               
     void anonymizeMaterialEntities()
              Example: if we have triples: This will generate: ClassAssertion( occurs_in some Nucleus, p123)
     void buildNetwork(org.semanticweb.owlapi.model.OWLClass processCls, Collection<String> seedGenes)
              Performs all steps to seed activation network.
     void buildNetwork(String processClsId, Collection<String> seedGenes)
              Wraps buildNetwork(OWLClass, Collection)
     Double calculateConditionalProbaility(org.semanticweb.owlapi.model.OWLClass wholeCls, org.semanticweb.owlapi.model.OWLClass partCls)
              Pr( F | P ) = Pr(F,P) / Pr(P)
     Double calculatePairwiseEnrichment(org.semanticweb.owlapi.model.OWLClass sampleSetClass, org.semanticweb.owlapi.model.OWLClass enrichedClass)
               
     Double calculatePairwiseEnrichment(org.semanticweb.owlapi.model.OWLClass sampleSetClass, org.semanticweb.owlapi.model.OWLClass enrichedClass, int populationClassSize)
               
     void connectGraph()
              Add default edges based on PPI network add ( a1 , a2 ) to E where ( g1 , g2 ) is in PPI, and a = (g, _) is in A
     void dispose()
              Unregisters abox ontology
     Map<org.semanticweb.owlapi.model.OWLClass,Double> fetchScoredCandidateProcesses(org.semanticweb.owlapi.model.OWLClass disease, Integer populationClassSize)
               
     Set<org.semanticweb.owlapi.model.OWLClass> getActivityTypes(String g)
              Get all activity types a gene enables (i.e.
     Set<String> getGenes(org.semanticweb.owlapi.model.OWLClass wholeCls)
              Gets all genes annotated to cls or descendant via involved-in relations
     Map<String,Object> getGraphStatistics()
               
     String getIdLabelPair(Object k)
               
     Set<org.semanticweb.owlapi.model.OWLObjectSomeValuesFrom> getInferredRelationshipsForGene(String g)
               
     Set<org.semanticweb.owlapi.model.OWLClass> getInferredTypes(String g)
               
     String getLabel(Object k)
               
     Set<org.semanticweb.owlapi.model.OWLClass> getMostSpecificActivityTypes(String g)
               
     Set<org.semanticweb.owlapi.model.OWLClass> getMostSpecificProcessTypes(String g)
               
     int getNumberOfGenes()
               
     Set<org.semanticweb.owlapi.model.OWLClass> getProcessTypes(String g)
               
     void initialize(GafDocument gafdoc, OWLGraphWrapper g)
               
     void normalizeDirections()
              Reroute all has_parts to part_ofs
    static
    <K,V extends Comparable<? super V>>
    Map<K,V>
    sortByValue(Map<K,V> map)
               
     
    Methods inherited from class owltools.util.MinimalModelGenerator
    addAxiom, addAxiom, addAxioms, addAxioms, addClassExpressionToQueryMap, addCollectedAxioms, addTriple, anonymizeIndividuals, anonymizeIndividualsNotIn, anonymizeIndividualsNotIn, applyChanges, collapseIndividuals, collectAxiom, disposeReasoner, extractModule, generateAllNecessaryIndividuals, generateAllNecessaryIndividuals, generateNecessaryIndividuals, generateNecessaryIndividuals, generateNecessaryIndividuals, generateQueryOntology, getAboxOntology, getDirectExclusionSet, getExclusionSet, getExistentialRelationships, getExistentialRelationships, getExistentialRelationships, getFragmentID, getGeneratedIndividuals, getInclusionSet, getIndividualsInProperPath, getIndividualsInProperPath, getMostSpecificClassExpression, getMostSpecificClassExpression, getMostSpecificClassExpression, getOWLDataFactory, getOWLOntologyManager, getPrototypeClass, getQueryOntology, getReasoner, getSkolemIRI, getSkolemIRI, getSuperClassExpressions, getTboxOntology, hasCycle, hasCycle, isAssertInverses, isPrecomputePropertyClassCombinations, isQueryClass, isRemoveAmbiguousIndividuals, mergeInto, normalizeDirections, performTransitiveReduction, performTransitiveReduction, setAboxOntology, setAssertInverses, setContextualizingSuffix, setDirectExclusionSet, setExclusionSet, setInclusionSet, setPrecomputePropertyClassCombinations, setReasoner, setReasonerFactory, setRemoveAmbiguousIndividuals, setTboxOntology
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    processClassSet

    public Set<org.semanticweb.owlapi.model.OWLClass> processClassSet
    Constructor Detail

    LegoModelGenerator

    public LegoModelGenerator(org.semanticweb.owlapi.model.OWLOntology tbox)
                       throws org.semanticweb.owlapi.model.OWLOntologyCreationException
    Parameters:
    tbox -
    Throws:
    org.semanticweb.owlapi.model.OWLOntologyCreationException

    LegoModelGenerator

    @Deprecated
    public LegoModelGenerator(org.semanticweb.owlapi.model.OWLOntology tbox,
                                         org.semanticweb.owlapi.model.OWLOntology abox,
                                         org.semanticweb.owlapi.reasoner.OWLReasonerFactory rf)
                       throws org.semanticweb.owlapi.model.OWLOntologyCreationException
    Deprecated. 

    Parameters:
    tbox -
    abox -
    rf -
    Throws:
    org.semanticweb.owlapi.model.OWLOntologyCreationException

    LegoModelGenerator

    public LegoModelGenerator(org.semanticweb.owlapi.model.OWLOntology tbox,
                              org.semanticweb.owlapi.model.OWLOntology abox)
                       throws org.semanticweb.owlapi.model.OWLOntologyCreationException
    Parameters:
    tbox -
    abox -
    Throws:
    org.semanticweb.owlapi.model.OWLOntologyCreationException

    LegoModelGenerator

    public LegoModelGenerator(org.semanticweb.owlapi.model.OWLOntology tbox,
                              org.semanticweb.owlapi.reasoner.OWLReasonerFactory reasonerFactory)
                       throws org.semanticweb.owlapi.model.OWLOntologyCreationException
    Parameters:
    tbox -
    reasonerFactory -
    Throws:
    org.semanticweb.owlapi.model.OWLOntologyCreationException
    Method Detail

    dispose

    public void dispose()
    Unregisters abox ontology

    Overrides:
    dispose in class MinimalModelGenerator

    initialize

    public void initialize(GafDocument gafdoc,
                           OWLGraphWrapper g)
    Parameters:
    gafdoc - (optional)
    g -

    buildNetwork

    public void buildNetwork(org.semanticweb.owlapi.model.OWLClass processCls,
                             Collection<String> seedGenes)
                      throws org.semanticweb.owlapi.model.OWLOntologyCreationException
    Performs all steps to seed activation network. See: https://docs.google.com/document/d/1TV8Eb9sSvFY-weVZaIfzCxF1qbnmkUaiUhTm9Bs3gRE/edit

    Parameters:
    processCls -
    seedGenes -
    Throws:
    org.semanticweb.owlapi.model.OWLOntologyCreationException

    anonymizeMaterialEntities

    public void anonymizeMaterialEntities()
    Example: if we have triples: This will generate: ClassAssertion( occurs_in some Nucleus, p123)


    buildNetwork

    public void buildNetwork(String processClsId,
                             Collection<String> seedGenes)
                      throws org.semanticweb.owlapi.model.OWLOntologyCreationException
    Wraps buildNetwork(OWLClass, Collection)

    Parameters:
    processClsId -
    seedGenes -
    Throws:
    org.semanticweb.owlapi.model.OWLOntologyCreationException

    addGenes

    public void addGenes(String processClsId,
                         Collection<String> seedGenes)
                  throws org.semanticweb.owlapi.model.OWLOntologyCreationException
    Throws:
    org.semanticweb.owlapi.model.OWLOntologyCreationException

    addGenes

    public void addGenes(org.semanticweb.owlapi.model.OWLClass processCls)
                  throws org.semanticweb.owlapi.model.OWLOntologyCreationException
    Parameters:
    processCls -
    Throws:
    org.semanticweb.owlapi.model.OWLOntologyCreationException
    See Also:
    seedGraph(String p, Set seed)

    addGenes

    public void addGenes(org.semanticweb.owlapi.model.OWLClass processCls,
                         Collection<String> seedGenes)
                  throws org.semanticweb.owlapi.model.OWLOntologyCreationException
    Create initial activation node set A for a process P and a set of seed genes for all g ∈ Gseed, add a = to A where f = argmax(p) { t : t ∈ TA, p=Prob( t | g) }

    Parameters:
    processCls -
    seedGenes -
    Throws:
    org.semanticweb.owlapi.model.OWLOntologyCreationException
    org.apache.commons.math.MathException

    connectGraph

    public void connectGraph()
    Add default edges based on PPI network add ( a1 , a2 ) to E where ( g1 , g2 ) is in PPI, and a = (g, _) is in A


    normalizeDirections

    public void normalizeDirections()
    Reroute all has_parts to part_ofs


    fetchScoredCandidateProcesses

    public Map<org.semanticweb.owlapi.model.OWLClass,Double> fetchScoredCandidateProcesses(org.semanticweb.owlapi.model.OWLClass disease,
                                                                                           Integer populationClassSize)

    sortByValue

    public static <K,V extends Comparable<? super V>> Map<K,V> sortByValue(Map<K,V> map)

    calculatePairwiseEnrichment

    public Double calculatePairwiseEnrichment(org.semanticweb.owlapi.model.OWLClass sampleSetClass,
                                              org.semanticweb.owlapi.model.OWLClass enrichedClass)
                                       throws org.apache.commons.math.MathException
    Throws:
    org.apache.commons.math.MathException

    calculatePairwiseEnrichment

    public Double calculatePairwiseEnrichment(org.semanticweb.owlapi.model.OWLClass sampleSetClass,
                                              org.semanticweb.owlapi.model.OWLClass enrichedClass,
                                              int populationClassSize)
                                       throws org.apache.commons.math.MathException
    Throws:
    org.apache.commons.math.MathException

    calculateConditionalProbaility

    public Double calculateConditionalProbaility(org.semanticweb.owlapi.model.OWLClass wholeCls,
                                                 org.semanticweb.owlapi.model.OWLClass partCls)
    Pr( F | P ) = Pr(F,P) / Pr(P)


    getActivityTypes

    public Set<org.semanticweb.owlapi.model.OWLClass> getActivityTypes(String g)
    Get all activity types a gene enables (i.e. direct MF annotations) always returns a fresh set

    Parameters:
    g -
    Returns:
    { t : t ∈ TA, g x t ∈ Enables }

    getMostSpecificActivityTypes

    public Set<org.semanticweb.owlapi.model.OWLClass> getMostSpecificActivityTypes(String g)
    Parameters:
    g -
    Returns:
    { t : t ∈ getActivityTypes(g), ¬ ∃ t' : t' ∈ getActivityTypes(g), t' ProperInferredßSubClassOf t }

    getMostSpecificProcessTypes

    public Set<org.semanticweb.owlapi.model.OWLClass> getMostSpecificProcessTypes(String g)

    getProcessTypes

    public Set<org.semanticweb.owlapi.model.OWLClass> getProcessTypes(String g)

    getInferredTypes

    public Set<org.semanticweb.owlapi.model.OWLClass> getInferredTypes(String g)

    getInferredRelationshipsForGene

    public Set<org.semanticweb.owlapi.model.OWLObjectSomeValuesFrom> getInferredRelationshipsForGene(String g)

    getGenes

    public Set<String> getGenes(org.semanticweb.owlapi.model.OWLClass wholeCls)
    Gets all genes annotated to cls or descendant via involved-in relations

    Parameters:
    t -
    Returns:
    { g : g x t ∈ InferredInvolvedIn }

    getNumberOfGenes

    public int getNumberOfGenes()
    Returns:
    |G|

    getLabel

    public String getLabel(Object k)
    Parameters:
    id -
    Returns:
    label for any class or entity in the graph

    getIdLabelPair

    public String getIdLabelPair(Object k)

    getGraphStatistics

    public Map<String,Object> getGraphStatistics()


    Copyright © 2010-2014. All Rights Reserved.