Skip to content

Commit bb011f2

Browse files
Colelymanmbowcut2
andauthored
Mckay/upsetplot port (#154) (#623)
Co-authored-by: mbowcut2 <55161542+mbowcut2@users.noreply.github.com>
1 parent ae4b93d commit bb011f2

17 files changed

Lines changed: 1319 additions & 13 deletions

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ __pycache__
66
CRISPResso2.egg-info
77
dist
88
tests/CRISPResso*
9+
.coverage
910

1011
# Pixi
1112
.pixi/

CRISPResso2/CRISPRessoAggregateCORE.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def main():
6868
args = parser.parse_args()
6969

7070
if args.use_matplotlib or not CRISPRessoShared.is_C2Pro_installed():
71-
from CRISPResso2 import CRISPRessoPlot
71+
from CRISPResso2.plots import CRISPRessoPlot
7272
else:
7373
from CRISPRessoPro import plot as CRISPRessoPlot
7474

CRISPResso2/CRISPRessoBatchCORE.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ def main():
138138
_jp = lambda filename: os.path.join(OUTPUT_DIRECTORY, filename) # handy function to put a file in the output directory
139139

140140
if args.use_matplotlib or not C2PRO_INSTALLED:
141-
from CRISPResso2 import CRISPRessoPlot
141+
from CRISPResso2.plots import CRISPRessoPlot
142142
else:
143143
from CRISPRessoPro import plot as CRISPRessoPlot
144144
CRISPRessoPlot.setMatplotlibDefaults()

CRISPResso2/CRISPRessoCORE.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2743,7 +2743,7 @@ def print_stacktrace_if_debug():
27432743
raise CRISPRessoShared.BadParameterException("Needleman Wunsch gap extend penalty must be <= 0")
27442744

27452745
if args.use_matplotlib or not C2PRO_INSTALLED:
2746-
from CRISPResso2 import CRISPRessoPlot
2746+
from CRISPResso2.plots import CRISPRessoPlot
27472747
else:
27482748
from CRISPRessoPro import plot as CRISPRessoPlot
27492749
CRISPRessoPlot.setMatplotlibDefaults()

CRISPResso2/CRISPRessoCompareCORE.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def main():
113113
info(compare_header)
114114

115115
if args.use_matplotlib or not CRISPRessoShared.is_C2Pro_installed():
116-
from CRISPResso2 import CRISPRessoPlot
116+
from CRISPResso2.plots import CRISPRessoPlot
117117
else:
118118
from CRISPRessoPro import plot as CRISPRessoPlot
119119

CRISPResso2/CRISPRessoPooledCORE.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ def main():
288288
info(CRISPRessoShared.get_crispresso_header(description, pooled_string))
289289

290290
if args.use_matplotlib or not CRISPRessoShared.is_C2Pro_installed():
291-
from CRISPResso2 import CRISPRessoPlot
291+
from CRISPResso2.plots import CRISPRessoPlot
292292
else:
293293
from CRISPRessoPro import plot as CRISPRessoPlot
294294

CRISPResso2/CRISPRessoWGSCORE.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ def print_stacktrace_if_debug():
321321
info(CRISPRessoShared.get_crispresso_header(description, wgs_string))
322322

323323
if args.use_matplotlib or not CRISPRessoShared.is_C2Pro_installed():
324-
from CRISPResso2 import CRISPRessoPlot
324+
from CRISPResso2.plots import CRISPRessoPlot
325325
else:
326326
from CRISPRessoPro import plot as CRISPRessoPlot
327327

CRISPResso2/__init__.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Backward-compatible re-exports: CRISPRessoPlot and upsetplot moved to
2+
# CRISPResso2.plots but can still be imported from the top-level package.
3+
# We can remove this once we update CRISPRessoPro's importing
4+
import sys
5+
6+
from CRISPResso2.plots import CRISPRessoPlot
7+
from CRISPResso2.plots import upsetplot
8+
9+
# Register under old module paths so that `from CRISPResso2.CRISPRessoPlot import X`
10+
# and `from CRISPResso2.upsetplot import X` still work for downstream consumers
11+
# (e.g., CRISPRessoPro). Remove once all consumers are updated.
12+
sys.modules['CRISPResso2.CRISPRessoPlot'] = CRISPRessoPlot
13+
sys.modules['CRISPResso2.upsetplot'] = upsetplot
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import re
1818
from matplotlib import colors as colors_mpl
1919
import seaborn as sns
20-
import upsetplot
20+
from CRISPResso2.plots import upsetplot
2121

2222
from CRISPResso2 import CRISPRessoShared
2323

CRISPResso2/plots/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)