Skip to content

Commit

Permalink
[in-prog] feat,refactor: convert R to python and refactor code
Browse files Browse the repository at this point in the history
changelog:
- docs: added explicit docstrings and typing for most functions
- refactor: changed some variable names for clarity
- refactor: moved static parameter definitions to params.py to streamline map script
  • Loading branch information
christinehc committed Nov 20, 2024
1 parent cd06008 commit 4698f10
Show file tree
Hide file tree
Showing 3 changed files with 1,137 additions and 11 deletions.
22 changes: 11 additions & 11 deletions build_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,21 +97,21 @@ def runSampMap(
"""
drc = ",".join(drcfiles)
args = (
f" --sampId={smap}"
f" --chemid={cid}"
f" --epMap={emap}"
f" --chemClass={cclass}"
f" --compToxFile={ctfile}"
f" --sampleFiles={fses}"
f" --chemDesc={descfile}"
f" --sampMap={smap}"
f" --sample_id={smap}"
f" --chem_id={cid}"
f" --ep_map={emap}"
f" --chem_class={cclass}"
f" --comptox_file={ctfile}"
f" --sample_files={fses}"
f" --chem_desc={descfile}"
f" --sample_map={smap}"
)
if is_sample:
cmd = f"Rscript sampleChemMapping/mapSamplesToChems.R --sample --drcFiles={drc} {args}"
cmd = f"python sampleChemMapping/map_samples_to_chemicals.py --sample --drc_files={drc} {args}"
elif len(drcfiles) > 0:
cmd = f"Rscript sampleChemMapping/mapSamplesToChems.R --chemical --drcFiles={drc} {args}"
cmd = f"python sampleChemMapping/map_samples_to_chemicals.py --chemical --drc_files={drc} {args}"
else:
cmd = f"Rscript sampleChemMapping/mapSamplesToChems.R {args}"
cmd = f"python sampleChemMapping/map_samples_to_chemicals.py {args}"

tqdm.write("\nRunning sample mapping with the following parameters:\n")
tqdm.write(f"{cmd}\n")
Expand Down
Loading

0 comments on commit 4698f10

Please sign in to comment.