File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
chebai_graph/preprocessing/reader Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -440,8 +440,12 @@ def _construct_fg_level_structure(
440440
441441 internal_edge_index [0 ].append (source_fg )
442442 internal_edge_index [1 ].append (target_fg )
443- internal_fg_edges [f"{ source_fg } _{ target_fg } " ] = {EDGE_LEVEL : WITHIN_FG_EDGE }
444- self ._num_of_edges += 1
443+ edge_str = f"{ source_fg } _{ target_fg } "
444+ if edge_str not in internal_fg_edges :
445+ # If two atoms of a FG points to atom(s) belonging to another FG. In this case, only one edge is counted.
446+ # Eg. In CHEBI:52723, atom idx 13 and 16 of a FG points to atom idx 18 of another FG
447+ internal_fg_edges [edge_str ] = {EDGE_LEVEL : WITHIN_FG_EDGE }
448+ self ._num_of_edges += 1
445449
446450 return internal_edge_index , internal_fg_edges
447451
You can’t perform that action at this time.
0 commit comments