Skip to content
Merged
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
177 commits
Select commit Hold shift + click to select a range
7bfa850
Script for query
rdurnik Jan 27, 2026
ca87cb4
Script for abstracts download
rdurnik Jan 27, 2026
1bed026
Query clean up
rdurnik Jan 27, 2026
50f8ced
Script for chemical identification
rdurnik Jan 27, 2026
36ed78e
Script for matching of chemical names to database of relevant chemicals
rdurnik Jan 27, 2026
e5fcdc9
Lint
rdurnik Jan 27, 2026
95044b4
Script to normalize chemical
rdurnik Jan 27, 2026
5759105
Updated matching to take list of chemical names (Excel file)
rdurnik Jan 27, 2026
409c8c9
Script to generate MeSH terms dataframe
rdurnik Jan 27, 2026
f3258e2
Script for find relationships
rdurnik Jan 27, 2026
dffc889
IDs are saved as txt file
rdurnik Jan 27, 2026
4aa629b
Clean up
rdurnik Jan 27, 2026
9204380
Added output dir
rdurnik Jan 28, 2026
12849a8
Abstracts are saved as tsv file
rdurnik Jan 28, 2026
9803780
Script for PDF download
rdurnik Jan 28, 2026
0f55a39
MeSH terms df saved as tsv
rdurnik Jan 28, 2026
2c5ff4a
Lint
rdurnik Jan 28, 2026
e691d6f
Chemical identification saved as file
rdurnik Jan 28, 2026
95c1524
Normalize chemical takes saved output and outputs a file
rdurnik Jan 28, 2026
2e91525
Chemical matching takes file and returns a file
rdurnik Jan 28, 2026
36239be
Find chemicals keeps text
rdurnik Jan 28, 2026
0c93372
Script to parse PDFs
rdurnik Jan 29, 2026
fd189fe
Renamed file
rdurnik Jan 29, 2026
56c0604
Abstract download fixed for Europe PMC
rdurnik Jan 29, 2026
19d6d32
Renamed column names
rdurnik Jan 29, 2026
ace2fe8
Script to find relationships
rdurnik Jan 29, 2026
7e331f2
Initial version chemical identification wrappers
rdurnik Feb 10, 2026
0bfc9c7
Made find chemicals into xml file
rdurnik Feb 25, 2026
b6f33b5
Updated version
rdurnik Feb 25, 2026
75acb8f
Replaced tsv test file with txt
rdurnik Feb 25, 2026
b401fd7
Changed extension
rdurnik Feb 25, 2026
c893ba7
Changed download abstracts into xml
rdurnik Feb 25, 2026
1adeee5
Fixed download abstracts name
rdurnik Mar 5, 2026
2ea1ee4
Fixed description
rdurnik Mar 5, 2026
d72834d
Download abstracts fixes
rdurnik Mar 5, 2026
12f21a3
Download PDF as XML
rdurnik Mar 5, 2026
a63a4a8
Removed print
rdurnik Mar 5, 2026
219fa0c
Updated text data set
rdurnik Mar 5, 2026
722fead
IDs test data set
rdurnik Mar 5, 2026
6e58b46
Find relationships XML
rdurnik Mar 5, 2026
5e09fd9
Removed MeSH term generation
rdurnik Mar 5, 2026
972f9b0
PDF parsing XML
rdurnik Mar 5, 2026
589c8ad
Query literature XML
rdurnik Mar 5, 2026
96c7a70
Changed chemical identification to output one chemical per line
rdurnik Mar 5, 2026
fb0df48
Chemical normalization
rdurnik Mar 5, 2026
67cebd2
Matching chemicals
rdurnik Mar 5, 2026
9d05d10
Description fix
rdurnik Mar 6, 2026
9320772
Needs to be defined before the other imports
rdurnik Mar 6, 2026
d1c3642
Fixed macros
rdurnik Mar 6, 2026
6961497
Renamed normalization to normalization PubChem
rdurnik Mar 6, 2026
43447bd
Changed description
rdurnik Mar 6, 2026
8a8114d
Merge branch 'master' into new_wrappers
hechth Mar 24, 2026
832eb76
removed imports
rdurnik Mar 25, 2026
89d1f73
added pmc
rdurnik Mar 25, 2026
2d2c0df
updated database selection
rdurnik Apr 9, 2026
13a7ee9
updated to get pdf
rdurnik Apr 9, 2026
20c5436
updated database selection
rdurnik Apr 9, 2026
42482c7
added openai key macro
rdurnik Apr 9, 2026
57d83a5
updated to openai_api_key_credentials
rdurnik Apr 9, 2026
fd700d2
updated name
rdurnik Apr 9, 2026
0f37098
wrapper to get full text
rdurnik Apr 9, 2026
01190f0
Name update
rdurnik Apr 10, 2026
8322fcb
added potential llm api key to pdf parsing
rdurnik Apr 10, 2026
ec59595
updated macros for llms
rdurnik Apr 10, 2026
f8c5550
find relationships with llms
rdurnik Apr 10, 2026
50156b6
updated pdf desc
rdurnik Apr 10, 2026
6891035
changed desc to text
rdurnik Apr 20, 2026
0deaeba
llm find chemicals
rdurnik Apr 20, 2026
87aefb8
new test file
rdurnik Apr 20, 2026
54b7e5c
normalization using llms
rdurnik Apr 20, 2026
30c8ba6
clean up, tests fix
rdurnik Apr 20, 2026
8d8e4c0
name change
rdurnik Apr 20, 2026
71e57a8
pdf test data
rdurnik Apr 21, 2026
e89e76f
requirement not supposed to be in inputs
rdurnik Apr 21, 2026
9cde057
pdf input file name change
rdurnik Apr 21, 2026
86dfc8f
file name rename
rdurnik Apr 21, 2026
4b7a32a
test fixes
rdurnik Apr 21, 2026
f07680a
added mesh terms normalization
rdurnik Apr 21, 2026
655f4dc
macros fix
rdurnik Apr 21, 2026
2f91e15
added database selection
rdurnik Apr 21, 2026
9b34f33
reformated tsvs
rdurnik Apr 21, 2026
5dbaf14
fixed the chemical list
rdurnik Apr 21, 2026
49c006f
mesh terms take xml
rdurnik Apr 22, 2026
1660cf9
final output modification
rdurnik Apr 22, 2026
677b1a8
improved descs
rdurnik Apr 22, 2026
cb7bd40
rename
rdurnik Apr 22, 2026
fb3e109
removed leftover inputs
rdurnik Apr 22, 2026
90e2e60
file rename
rdurnik Apr 23, 2026
b7da804
normalization combined into one tool
rdurnik Apr 23, 2026
ed62ee1
combined find chemicals tools
rdurnik Apr 23, 2026
980494e
fixed desc
rdurnik Apr 23, 2026
592230b
renamed
rdurnik Apr 23, 2026
6a6c914
rename
rdurnik Apr 23, 2026
b94902d
combined download
rdurnik Apr 23, 2026
7731496
improved desc
rdurnik Apr 23, 2026
bbf11e8
improved desc
rdurnik Apr 23, 2026
bfc05e4
combined relationships
rdurnik Apr 23, 2026
811ee99
find chemical should store the id of the publication
rdurnik Apr 23, 2026
6ca1750
added effect as macro
rdurnik Apr 23, 2026
910497b
reorder of inputs
rdurnik Apr 23, 2026
fa06fcc
added relationship type and macros modification
rdurnik Apr 23, 2026
f67f704
hardcoded model for scans of pdfs
rdurnik Apr 23, 2026
222e33f
added optional ncbi api key
rdurnik Apr 23, 2026
8aa9ef9
corrected collection output
rdurnik Apr 23, 2026
5c2460f
prompt optional
rdurnik Apr 23, 2026
3450f03
config fix
rdurnik Apr 24, 2026
a46aa1e
config
rdurnik Apr 24, 2026
b595082
reorder
rdurnik Apr 24, 2026
89f6b3a
config issues
rdurnik Apr 24, 2026
4ffa439
llm key put earlier for pdf parsing
rdurnik Apr 27, 2026
278eccf
hardcoded the aoptk version
rdurnik Apr 27, 2026
165597a
specified the version for publication-tracker and chemical-identifier
rdurnik May 4, 2026
4fbcd43
query import fix
rdurnik May 4, 2026
8876eea
new aoptk version in macros
rdurnik May 4, 2026
ff27898
removed macros for databases
rdurnik May 4, 2026
c9560ce
publication-tracker, chemical-identifier removed macros, version spec…
rdurnik May 4, 2026
8e80399
query literature update
rdurnik May 4, 2026
fe5f358
initial version of find chemicals and relationships in one
rdurnik May 5, 2026
f7b7946
reorder
rdurnik May 5, 2026
0637607
deleted find chemicals and find relationships as individual files, co…
rdurnik May 5, 2026
4e3b5bc
pdf needs api key
rdurnik May 5, 2026
13356c2
fixed combined find relationships and find chemicals
rdurnik May 5, 2026
74a818b
fixed download to first select database and then data type
rdurnik May 5, 2026
7259572
removed images for analysis
rdurnik May 5, 2026
49c2c79
updated aoptk version
rdurnik May 5, 2026
96f74d4
added yaml import
rdurnik May 5, 2026
e584370
pmc ids need asyncio
rdurnik May 5, 2026
5ef1cca
pmc does not like empty strings
rdurnik May 5, 2026
e69fc2d
fixed europe pmc name
rdurnik May 5, 2026
5d8d300
fixed config and mesh terms errors
rdurnik May 5, 2026
4d614e3
removed figures from download
rdurnik May 5, 2026
1a01f8d
fixed find relationships for relationships only
rdurnik May 5, 2026
d72d776
added openyxl
rdurnik May 5, 2026
b794208
better output names download
rdurnik May 5, 2026
d182cd4
lint, citation
rdurnik May 5, 2026
74596c0
specified version
rdurnik May 6, 2026
ec8effb
small bugfixes in wrappers
hechth May 7, 2026
b8bff3a
reorder
rdurnik May 7, 2026
bbfd56b
removed dot
rdurnik May 7, 2026
e0f11c9
removed model
rdurnik May 7, 2026
b9cbfca
typo
rdurnik May 7, 2026
6de9050
Fixing test paths
mbodova May 12, 2026
a1f0ea5
query name change
rdurnik May 14, 2026
c857b47
changes to match the latest aoptk version
rdurnik May 14, 2026
329fb94
modified descs
rdurnik May 14, 2026
5214698
modified descs
rdurnik May 14, 2026
a877629
finalize output should work also without having to normalize the outp…
rdurnik May 18, 2026
6b5d774
updated download to match automatic write to file
rdurnik Jun 11, 2026
3612c55
version update
rdurnik Jun 11, 2026
23e00e3
changed to relationship types
rdurnik Jun 11, 2026
e1900b0
changed to multiple effects
rdurnik Jun 11, 2026
a34636e
added new options for pmc and europepmc download
rdurnik Jun 11, 2026
bb4d149
outputs test file update
rdurnik Jun 12, 2026
7f5a8ca
find chemical relationships fix
rdurnik Jun 12, 2026
719a8c7
config error fixes
rdurnik Jun 12, 2026
537c828
updated test output tsv
rdurnik Jun 12, 2026
906256a
finalize output modified for multiple effects
rdurnik Jun 12, 2026
9f7c748
lint
rdurnik Jun 12, 2026
fd5a798
test fixes
rdurnik Jun 15, 2026
f5694c0
linter
rdurnik Jun 15, 2026
bde45d2
fixed forgot to add different databases
rdurnik Jun 15, 2026
3961f58
fixed links not working on CI
rdurnik Jun 15, 2026
cd8e76e
fixed chemical identifier and publication tracker tests
rdurnik Jun 15, 2026
65b2f70
fixed multiple relationship types
rdurnik Jun 16, 2026
8a66ee8
updated test text
rdurnik Jun 16, 2026
b6dd379
updated wrappers and minor fixes
hechth Jun 16, 2026
b34eff4
deleted match chemical lists
rdurnik Jun 16, 2026
b9582e2
find chemicals stores ids
rdurnik Jun 16, 2026
7bac7e6
option to add api keys as credentials
rdurnik Jun 16, 2026
bcb9951
lint: changed variable to secret for endpoint url
rdurnik Jun 16, 2026
4a7161e
Merge branch 'master' into new_wrappers
hechth Jun 17, 2026
d09cafa
Merge branch 'master' into new_wrappers
hechth Jun 17, 2026
0e7f80f
fixed parse pdf test
hechth Jun 18, 2026
03b60cd
fixed tests
hechth Jun 18, 2026
565159c
made it compatible with usegalaxy litellm config
hechth Jun 18, 2026
6da73ff
fixed tests
hechth Jun 18, 2026
192da7c
Merge branch 'master' into new_wrappers
hechth Jun 18, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions tools/aoptk/aoptk_chemical_identification.py
Comment thread
rdurnik marked this conversation as resolved.
Outdated
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
from aoptk.chemical import Chemical
from aoptk.spacy_processor import Spacy
import argparse
import csv
import os


def find_chemicals(text: str) -> list[Chemical]:
"""Generate a list of chemicals from text.

Args:
text (str): Text to identify chemicals in.
"""
return Spacy().find_chemical(text)


def save_file(input_file: str, output_file: str) -> None:
"""Process a TSV file with text column, find chemicals, and save results.

Args:
input_file (str): Path to input TSV file with 'text' column.
output_file (str): Path to output TSV file.
"""
with open(input_file, "r") as f_in, open(output_file, "w") as f_out:
f_out.write("id\ttext\tchemicals\n")
for row in csv.DictReader(f_in, delimiter="\t"):
chemicals = find_chemicals(row["text"])
chemicals_str = (
"|".join(set([chem.name for chem in chemicals])) if chemicals else ""
)
f_out.write(f"{row['id']}\t{row['text']}\t{chemicals_str}\n")


def parse_args() -> argparse.Namespace:
parser = argparse.ArgumentParser(
description="Identify chemicals in a TSV file with text column"
)
parser.add_argument(
"--input_file", required=True, help="Input TSV file with text column"
)
parser.add_argument(
"--outdir", required=True, help="Output directory for saving results"
)
return parser.parse_args()


if __name__ == "__main__":
args = parse_args()
output_file = os.path.join(args.outdir, "chemicals.tsv")
save_file(input_file=args.input_file, output_file=output_file)
92 changes: 92 additions & 0 deletions tools/aoptk/aoptk_chemical_matching.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
from aoptk.chemical import Chemical
import argparse
import pandas as pd


def extract_chemicals_to_match(input_file: str) -> list[Chemical]:
chemicals = []
with open(input_file, "r") as f_in:
for row in pd.read_csv(f_in, sep="\t").itertuples():
chemical = Chemical(row.name)
chemical.heading = row.heading
chemical._synonyms = (
set(row.synonyms.split(";")) if pd.notna(row.synonyms) else set()
)
chemicals.append(chemical)
return chemicals


def match_chemicals_with_loose_equality(
list_of_relevant_chemicals: list[Chemical],
chemicals: list[Chemical],
) -> list[str]:
"""Match normalized chemicals with relevant chemicals using loose equality.

Args:
list_of_relevant_chemicals (list[Chemical]): List of relevant chemicals.
chemicals (list[Chemical]): List of chemicals.
"""
relevant_chemicals_names = []
for chemical in chemicals:
for relevant_chemical in list_of_relevant_chemicals:
if chemical.similar(relevant_chemical):
relevant_chemicals_names.append(chemical.name)
break
return relevant_chemicals_names


def generate_relevant_chemicals(chemical_database: str) -> list[Chemical]:
"""Generate a list of relevant chemicals from Excel file.

Args:
chemical_database (str): Path to the user-defined chemical database in Excel.
"""
relevant_chemicals_database = pd.read_excel(chemical_database)
return [
Chemical(name)
for name in relevant_chemicals_database["chemical_name"]
.astype(str)
.str.lower()
.unique()
]


def save_file(relevant_chemicals_names: list[str], output_file: str) -> None:
"""Process a TSV file with chemicals, match them, and save results.

Args:
input_file (str): Path to input TSV file with chemicals.
output_file (str): Path to output TSV file.
"""
with open(output_file, "w") as f_out:
f_out.write("matched_chemicals\n")
for chemical_name in relevant_chemicals_names:
f_out.write(f"{chemical_name}\n")


def parse_args() -> argparse.Namespace:
parser = argparse.ArgumentParser(description="Match chemicals using loose equality")
parser.add_argument(
"--list_of_relevant_chemicals", required=True, help="List of relevant chemicals"
)
parser.add_argument(
"--normalized_chemicals", required=True, help="List of normalized chemicals"
)
parser.add_argument(
"--outdir", required=True, help="Output directory for saving files"
)
return parser.parse_args()


if __name__ == "__main__":
args = parse_args()
chemicals_to_match = extract_chemicals_to_match(args.normalized_chemicals)
list_of_relevant_chemicals = generate_relevant_chemicals(
args.list_of_relevant_chemicals
)
relevant_chemicals_names = match_chemicals_with_loose_equality(
list_of_relevant_chemicals, chemicals_to_match
)
save_file(
relevant_chemicals_names, output_file=f"{args.outdir}/matched_chemicals.tsv"
)
54 changes: 54 additions & 0 deletions tools/aoptk/aoptk_chemical_normalization.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
from aoptk.chemical import Chemical
from aoptk.normalization.mesh_terms import MeshTerms
import argparse
import pandas as pd
import os


def normalize_chemical(mesh_terms: pd.DataFrame, chemical: Chemical) -> Chemical:
"""Normalize a chemical using MeSH terms.

Args:
mesh_terms (pd.DataFrame): MeSH terms dataframe.
chemical (Chemical): Chemical to normalize.
"""
return MeshTerms(mesh_terms).normalize_chemical(chemical)


def save_file(input_file: str, mesh_terms_df: pd.DataFrame, output_file: str) -> None:
"""Process a TSV file with chemicals, normalize them, and save results.

Args:
input_file (str): Path to input TSV file with chemicals.
mesh_terms_df (pd.DataFrame): MeSH terms dataframe for normalization.
output_file (str): Path to output TSV file.
"""
with open(input_file, "r") as f_in, open(output_file, "w") as f_out:
f_out.write("name\theading\tsynonyms\n")
for row in pd.read_csv(f_in, sep="\t").itertuples():
chemicals = row.chemicals.split("|")
for chem in chemicals:
chemical = Chemical(chem.strip())
normalized_chemical = normalize_chemical(mesh_terms_df, chemical)
f_out.write(
f"{normalized_chemical.name}\t{normalized_chemical.heading}\t{normalized_chemical.synonyms}\n"
)


def parse_args() -> argparse.Namespace:
parser = argparse.ArgumentParser(description="Normalize chemicals using MeSH terms")
parser.add_argument("--mesh_terms", required=True, help="MeSH terms dataframe")
parser.add_argument(
"--input_file", required=True, help="Input TSV file with chemicals"
)
parser.add_argument(
"--outdir", required=True, help="Output directory for saving results"
)
return parser.parse_args()


if __name__ == "__main__":
args = parse_args()
mesh_terms_df = pd.read_csv(args.mesh_terms, sep="\t")
output_file = os.path.join(args.outdir, "normalized_chemicals.tsv")
save_file(args.input_file, mesh_terms_df, output_file)
71 changes: 71 additions & 0 deletions tools/aoptk/aoptk_download_abstracts.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
from aoptk.literature.databases.pubmed import PubMed
from aoptk.literature.databases.europepmc import EuropePMC
from aoptk.literature.abstract import Abstract
from Bio import Entrez

import argparse


def download_abstracts(
database_with_ids_path: str, database: str, email: str
) -> list[Abstract]:
"""Genereate a list of abstracts from the specified literature database.

Args:
database_with_ids_path (str): Path to the file containing database IDs.
"""
with open(database_with_ids_path, "r") as f:
ids = [line.strip() for line in f.readlines()]
if database == "pubmed":
Entrez.email = email
pubmed = PubMed.__new__(PubMed)
pubmed.id_list = ids
return pubmed.get_abstracts()
if database == "europepmc":
europepmc = EuropePMC("")
europepmc.id_list = ids
return europepmc.get_abstracts()
return None


def save_file(abstracts: list[Abstract], filename: str) -> None:
"""Save abstracts to a TSV file.

Args:
abstracts (list[Abstract]): List of abstracts to save.
filename (str): Name of the output file.
"""
with open(filename, "w") as f:
f.write("id\ttext\n")
for abstract in abstracts:
f.write(f"{abstract.publication_id}\t{abstract.text}\n")


def parse_args() -> argparse.Namespace:
parser = argparse.ArgumentParser(
description="Download abstracts from PubMed or Europe PMC using aoptk"
)
parser.add_argument(
"--database_with_ids",
required=True,
help="Path to the file containing database IDs",
)
parser.add_argument(
"--database",
required=True,
choices=["pubmed", "europepmc"],
help="Database to query",
)
parser.add_argument(
"--email", required=True, help="Email to comply with NCBI guidelines"
)
parser.add_argument(
"--outdir", required=True, help="Output directory for saving files"
)
return parser.parse_args()


if __name__ == "__main__":
args = parse_args()
abstracts = download_abstracts(args.database_with_ids, args.database, args.email)
save_file(abstracts, f"{args.outdir}/abstracts.tsv")
42 changes: 42 additions & 0 deletions tools/aoptk/aoptk_download_pdfs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
from aoptk.literature.databases.europepmc import EuropePMC
from aoptk.literature.abstract import Abstract

import argparse


def download_pdfs(
database_with_ids_path: str,
output_dir: str,
) -> list[Abstract]:
"""Genereate a list of abstracts from the specified literature database.

Args:
database_with_ids_path (str): Path to the file containing database IDs.
"""
with open(database_with_ids_path, "r") as f:
ids = [line.strip() for line in f.readlines()]
europepmc = EuropePMC.__new__(EuropePMC)
europepmc.__init__("")
europepmc.storage = output_dir
europepmc.id_list = ids
return europepmc.pdfs()


def parse_args() -> argparse.Namespace:
parser = argparse.ArgumentParser(
description="Download abstracts from PubMed or Europe PMC using aoptk"
)
parser.add_argument(
"--database_with_ids",
required=True,
help="Path to the file containing database IDs",
)
parser.add_argument(
"--outdir", required=True, help="Output directory for saving files"
)
return parser.parse_args()


if __name__ == "__main__":
args = parse_args()
abstracts = download_pdfs(args.database_with_ids, args.outdir)
66 changes: 66 additions & 0 deletions tools/aoptk/aoptk_find_relationships.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
from aoptk.chemical import Chemical
from aoptk.effect import Effect
from aoptk.relationships.relationship import Relationship
from aoptk.relationships.zero_shot_classification_single import (
ZeroShotClassificationSingle,
)
import pandas as pd
import argparse
import os


def find_relationships(
text: str, chemicals: list[Chemical], effects: list[Effect]
) -> list[Relationship]:
"""Find relationships between chemicals and effects.

Args:
text (str): Input text to analyze.
chemicals (list[Chemical]): List of chemicals to consider.
effects (list[Effect]): List of effects to consider.
"""
return ZeroShotClassificationSingle().find_relationships(
text=text, chemicals=chemicals, effects=effects
)


def save_file(input_file: str, output_file: str, effects: list[Effect]) -> None:
"""Process a TSV file with chemicals and effects, find relationships, and save results.

Args:
input_file (str): Path to input TSV file with chemicals and effects.
output_file (str): Path to output TSV file or directory.
"""
if os.path.isdir(output_file):
output_file = os.path.join(output_file, "relationships.tsv")

with open(input_file, "r") as text_in, open(output_file, "w") as f_out:
f_out.write("id\tchemical\teffect\trelationship\n")
for row in pd.read_csv(text_in, sep="\t").itertuples():
chemicals = [Chemical(chem) for chem in row.chemicals.split("|")]
relationships = find_relationships(row.text, chemicals, effects)
for relationship in relationships:
f_out.write(
f"{row.id}\t{relationship.chemical.name}\t{relationship.effect.name}\t{relationship}\n"
)


def parse_args() -> argparse.Namespace:
parser = argparse.ArgumentParser(
description="Find relationships between chemicals and effects"
)
parser.add_argument(
"--input_file", required=True, help="Input TSV file with chemicals and effects"
)
parser.add_argument(
"--outdir", required=True, help="Output directory for saving files"
)
parser.add_argument("--effects", required=True, help="List of effects to consider")
return parser.parse_args()


if __name__ == "__main__":
args = parse_args()
effects = [Effect(eff) for eff in args.effects.split(",")]
output_file = os.path.join(args.outdir, "relationships.tsv")
save_file(args.input_file, output_file, effects)
Loading
Loading