Skip to content

Commit

Permalink
remove dead code (to_json parent loci)
Browse files Browse the repository at this point in the history
  • Loading branch information
schae234 committed Feb 25, 2020
1 parent 5a2497e commit 948e281
Showing 1 changed file with 6 additions and 18 deletions.
24 changes: 6 additions & 18 deletions camoco/COB.py
Original file line number Diff line number Diff line change
Expand Up @@ -862,6 +862,7 @@ def to_json(
max_edges=None,
remove_orphans=True,
ontology=None,
include_coordinates=True
):
"""
Produce a JSON network object that can be loaded in cytoscape.js
Expand Down Expand Up @@ -899,6 +900,10 @@ def to_json(
the ontology. This is useful for highlighting
groups of genes once they are inside of
cytoscape(.js).
include_coordinates : bool (default: True)
If true, include coordinates for available
genes. Genes without calculated coordinates will
be left blank.
Returns
-------
Expand Down Expand Up @@ -956,24 +961,7 @@ def to_json(
node["data"][x] = True
node["data"].update(gene.attr)
net["nodes"].append(node)
if "parent_locus" in gene.attr:
parents[str(gene.attr["parent_locus"])].append(gene.id)
# Add parents first
for parent, children in parents.items():
net["nodes"].insert(
0, {"data": {"id": parent, "parent": None, "classes": "snp"}}
)
for child in children:
net["edges"].append(
{
"data": {
"source": child,
"target": parent,
"score": 50,
"distance": 0,
}
}
)

# Return the correct output
net = {"elements": net}
if filename:
Expand Down

0 comments on commit 948e281

Please sign in to comment.