Skip to content

Commit

Permalink
formatted
Browse files Browse the repository at this point in the history
  • Loading branch information
hrshdhgd committed Sep 13, 2024
1 parent 26b50e8 commit 02d52be
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions kg_microbe/transform_utils/bacdive/bacdive.py
Original file line number Diff line number Diff line change
Expand Up @@ -830,22 +830,26 @@ def run(self, data_file: Union[Optional[Path], Optional[str]] = None, show_statu
# ! Assumption is biosafety level for all items in the list are the same.
biosafety_level = risk_assessment[0].get(BIOSAFETY_LEVEL, None)
if biosafety_level:
biosafety_level = re.findall(r'\d+', biosafety_level)[0]
biosafety_level = re.findall(r"\d+", biosafety_level)[0]
biosafety_level_id = f"{BIOSAFETY_LEVEL_PREFIX}{biosafety_level}"
biosafety_level_label = f"{BIOSAFETY_LEVEL} {biosafety_level}"
node_writer.writerow([
biosafety_level_id,
BIOSAFETY_CATEGORY,
biosafety_level_label,
] + [None] * (len(self.node_header) - 3))
edge_writer.writerow([
ncbitaxon_id,
BIOSAFETY_LEVEL_PREDICATE,
biosafety_level_id,
None,
BACDIVE_PREFIX + key,
])

node_writer.writerow(
[
biosafety_level_id,
BIOSAFETY_CATEGORY,
biosafety_level_label,
]
+ [None] * (len(self.node_header) - 3)
)
edge_writer.writerow(
[
ncbitaxon_id,
BIOSAFETY_LEVEL_PREDICATE,
biosafety_level_id,
None,
BACDIVE_PREFIX + key,
]
)

if not all(item is None for item in name_tax_classification_data[2:]):
writer_3.writerow(name_tax_classification_data)
Expand Down

0 comments on commit 02d52be

Please sign in to comment.