Skip to content

Commit

Permalink
remove folder path in html file image links
Browse files Browse the repository at this point in the history
  • Loading branch information
avantikalal committed Nov 9, 2024
1 parent 4e8eeb6 commit 75b99b5
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/grelu/interpret/modisco.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,15 @@ def _add_tomtom_to_modisco_report(

# Paths to outputs
html_file = os.path.join(modisco_dir, "motifs.html")
modisco_logo_dir = os.path.join(modisco_dir, "trimmed_logos")

# Loading html report
report = pd.read_html(html_file)[0]
cols = report.columns.tolist()
report["query"] = report.apply(
lambda row: row.pattern[:3] + "_" + row.pattern.split(".")[-1], axis=1
)
report["modisco_cwm_fwd"] = report.pattern.apply(
lambda x: os.path.join(modisco_logo_dir, f"{x}.cwm.fwd.png")
)
report["modisco_cwm_rev"] = report.pattern.apply(
lambda x: os.path.join(modisco_logo_dir, f"{x}.cwm.rev.png")
)
report["modisco_cwm_fwd"] = report.pattern.apply(lambda x: f"{x}.cwm.fwd.png")
report["modisco_cwm_rev"] = report.pattern.apply(lambda x: f"{x}.cwm.rev.png")

# Compiling top TOMTOM matches
tomtom_dict = dict()
Expand Down

0 comments on commit 75b99b5

Please sign in to comment.