Skip to content

Commit

Permalink
Merge pull request #60 from INCATools/transitive-reduction-patch
Browse files Browse the repository at this point in the history
Transitive reduction patch
  • Loading branch information
dosumis authored Feb 8, 2024
2 parents 9521dd4 + a467f15 commit cffcc6d
Show file tree
Hide file tree
Showing 5 changed files with 1,317 additions and 1,334 deletions.
4 changes: 4 additions & 0 deletions pandasaurus_cxg/graph_generator/graph_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import matplotlib.pyplot as plt
import networkx as nx
import pandas as pd
from pandasaurus.graph.graph_generator import GraphGenerator as graphgen
from rdflib import OWL, RDF, RDFS, BNode, Graph, Literal, Namespace, URIRef
from rdflib.plugins.sparql import prepareQuery

Expand Down Expand Up @@ -162,6 +163,9 @@ def generate_rdf_graph(self):
for s, _, _ in self.graph.triples((None, predicate, Literal(iv))):
self.graph.add((resource, subcluster, s))

# transitive reduction step
self.graph = graphgen.apply_transitive_reduction(self.graph, [subcluster.toPython()])

def enrich_rdf_graph(self):
"""
Enrich RDF graph with enriched DataFrame from AnndataEnricher
Expand Down
Loading

0 comments on commit cffcc6d

Please sign in to comment.