Skip to content

Commit

Permalink
Merge branch 'update_scibite_cord_to_15' of https://github.com/Knowle…
Browse files Browse the repository at this point in the history
…dge-Graph-Hub/kg-covid-19 into update_scibite_cord_to_15
  • Loading branch information
justaddcoffee committed Jul 6, 2020
2 parents f2a8477 + 5cc5ba7 commit 357461f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
5 changes: 4 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ kg-covid-19

KG hub to produce a knowledge graph for COVID-19 and SARS-COV-2

See the `repository's wiki for more details <https://github.com/kg-emerging-viruses/kg-emerging-viruses/wiki>`_.
Documentation
----------------------------------------------

See the `repository's wiki <https://github.com/kg-emerging-viruses/kg-emerging-viruses/wiki>`_.

How do I install this package?
----------------------------------------------
Expand Down
11 changes: 9 additions & 2 deletions kg_covid_19/edges.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@

def make_edges(nodes: str, edges: str, output_dir: str,
train_fraction: float, validation: bool,
min_degree: int, check_disconnected_nodes: bool = False) -> None:
min_degree: int, check_disconnected_nodes: bool = False,
remove_extra_cols: bool = False) -> None:
"""Prepare positive and negative edges for testing and training (see run.py edges
command for documentation)
Expand All @@ -25,12 +26,18 @@ def make_edges(nodes: str, edges: str, output_dir: str,
of nodes involved in the edge [2]
:param check_disconnected_nodes: should we check for disconnected nodes (i.e.
nodes with degree of 0) in input graph? [False]
:param remove_extra_cols throw out columns other than ['subject', 'object',
'relation', 'edge_label'][false]
Returns:
None.
"""
logging.info("Loading edge file %s" % edges)
edges_df: pd.DataFrame = tsv_to_df(edges, usecols=['subject', 'object', 'relation',
edges_df: pd.DataFrame
if remove_extra_cols:
edges_df = tsv_to_df(edges, usecols=['subject', 'object', 'relation',
'edge_label'])
else:
edges_df = tsv_to_df(edges)
logging.info("Loading node file %s" % nodes)
nodes_df: pd.DataFrame = tsv_to_df(nodes)

Expand Down

0 comments on commit 357461f

Please sign in to comment.