Skip to content

Commit

Permalink
Merge pull request #20 from AlexandrovLab/spmods
Browse files Browse the repository at this point in the history
performance upgrades
  • Loading branch information
rvangara authored Oct 19, 2022
2 parents d44fe2f + be33da7 commit c4da90a
Show file tree
Hide file tree
Showing 21 changed files with 2,696 additions and 2,340 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
# Python egg metadata, regenerated from source files by setuptools.
/*.egg-info

sigProfilerPlotting/templates/**

# Hidden files and directories
*.DS_Store

Expand Down
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
language: python

python:
- '3.6'
- "3.9.13"

install:
- pip install -q matplotlib
- pip install .
- pip install . -v

script: python3 plot_example.py

321 changes: 321 additions & 0 deletions build/lib/sigProfilerPlotting/dbsplotsmod.py

Large diffs are not rendered by default.

355 changes: 355 additions & 0 deletions build/lib/sigProfilerPlotting/idplt.py

Large diffs are not rendered by default.

2,007 changes: 856 additions & 1,151 deletions build/lib/sigProfilerPlotting/sigProfilerPlotting.py

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions build/lib/sigProfilerPlotting/version.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

# THIS FILE IS GENERATED FROM SIGPROFILERPLOTTING SETUP.PY
short_version = '1.2.2'
version = '1.2.2'
short_version = '1.2.3'
version = '1.2.3'


289 changes: 289 additions & 0 deletions input/examples/samples/test288.all
Original file line number Diff line number Diff line change
@@ -0,0 +1,289 @@
MutationType Sample 1 Sample 2 Sample 3 Sample 4 Sample 5 Sample 6
T:A[C>A]A 15 22 10 8 15 19
T:A[C>A]C 13 12 6 3 9 22
T:A[C>A]G 4 3 3 0 2 8
T:A[C>A]T 12 8 8 5 19 4
T:A[C>G]A 13 13 6 7 5 7
T:A[C>G]C 8 9 3 4 4 3
T:A[C>G]G 0 2 3 0 2 1
T:A[C>G]T 6 9 5 5 9 8
T:A[C>T]A 32 12 23 10 17 18
T:A[C>T]C 10 11 12 10 14 14
T:A[C>T]G 26 15 15 13 24 16
T:A[C>T]T 22 11 14 14 23 11
T:A[T>A]A 11 9 5 8 10 6
T:A[T>A]C 7 3 4 2 2 9
T:A[T>A]G 6 5 6 1 7 7
T:A[T>A]T 4 6 9 7 29 11
T:A[T>C]A 40 55 22 22 38 46
T:A[T>C]C 17 29 5 3 19 17
T:A[T>C]G 24 38 21 10 43 46
T:A[T>C]T 26 42 14 26 24 31
T:A[T>G]A 8 5 5 1 3 4
T:A[T>G]C 5 2 6 2 3 3
T:A[T>G]G 6 1 3 4 6 3
T:A[T>G]T 7 4 8 9 11 8
T:C[C>A]A 17 24 16 8 17 14
T:C[C>A]C 11 21 10 3 8 20
T:C[C>A]G 3 2 0 0 1 5
T:C[C>A]T 8 15 11 6 14 12
T:C[C>G]A 9 8 3 1 4 8
T:C[C>G]C 11 7 4 2 10 8
T:C[C>G]G 0 0 3 1 1 1
T:C[C>G]T 7 8 2 5 10 5
T:C[C>T]A 16 12 12 7 21 6
T:C[C>T]C 18 14 15 5 18 16
T:C[C>T]G 12 9 9 6 18 16
T:C[C>T]T 14 20 15 10 19 10
T:C[T>A]A 2 4 6 3 6 6
T:C[T>A]C 2 9 6 1 14 13
T:C[T>A]G 5 7 6 4 11 11
T:C[T>A]T 1 6 5 3 13 7
T:C[T>C]A 7 17 9 6 18 17
T:C[T>C]C 12 16 6 5 14 20
T:C[T>C]G 12 16 6 8 16 11
T:C[T>C]T 18 21 9 13 25 16
T:C[T>G]A 0 1 1 1 5 5
T:C[T>G]C 1 1 5 2 8 1
T:C[T>G]G 4 3 2 2 8 5
T:C[T>G]T 7 3 4 7 13 8
T:G[C>A]A 12 14 12 4 9 13
T:G[C>A]C 4 9 7 6 3 9
T:G[C>A]G 3 1 2 2 1 1
T:G[C>A]T 3 6 7 4 5 9
T:G[C>G]A 3 5 2 1 2 6
T:G[C>G]C 7 2 4 3 1 5
T:G[C>G]G 1 2 1 1 2 1
T:G[C>G]T 2 6 3 2 5 6
T:G[C>T]A 22 21 8 9 15 16
T:G[C>T]C 20 14 13 3 10 10
T:G[C>T]G 15 6 10 8 19 15
T:G[C>T]T 11 11 11 8 23 16
T:G[T>A]A 0 1 3 2 8 3
T:G[T>A]C 2 2 0 2 6 2
T:G[T>A]G 1 2 3 1 6 2
T:G[T>A]T 1 10 5 1 5 0
T:G[T>C]A 14 25 5 10 12 16
T:G[T>C]C 11 16 1 5 13 9
T:G[T>C]G 5 14 2 4 12 9
T:G[T>C]T 12 22 6 8 13 6
T:G[T>G]A 0 1 0 2 2 2
T:G[T>G]C 0 0 0 2 0 2
T:G[T>G]G 0 2 1 1 1 3
T:G[T>G]T 0 0 2 2 3 3
T:T[C>A]A 14 16 11 10 17 14
T:T[C>A]C 14 10 14 8 15 19
T:T[C>A]G 4 2 0 1 1 2
T:T[C>A]T 10 13 17 11 13 16
T:T[C>G]A 4 8 4 6 7 7
T:T[C>G]C 6 9 6 9 7 8
T:T[C>G]G 1 0 0 2 0 1
T:T[C>G]T 10 8 10 7 13 19
T:T[C>T]A 9 20 12 16 17 24
T:T[C>T]C 11 21 11 21 9 26
T:T[C>T]G 14 5 6 7 11 13
T:T[C>T]T 13 16 15 7 17 17
T:T[T>A]A 2 6 6 10 8 4
T:T[T>A]C 5 15 4 2 11 5
T:T[T>A]G 4 4 1 3 6 8
T:T[T>A]T 7 8 7 2 13 8
T:T[T>C]A 35 41 2 9 10 40
T:T[T>C]C 13 25 3 6 11 9
T:T[T>C]G 9 14 1 1 13 14
T:T[T>C]T 23 29 8 10 12 29
T:T[T>G]A 4 4 4 7 6 6
T:T[T>G]C 7 4 4 3 3 3
T:T[T>G]G 2 7 8 1 2 9
T:T[T>G]T 12 5 11 6 11 9
U:A[C>A]A 21 15 17 5 18 19
U:A[C>A]C 13 7 7 2 14 10
U:A[C>A]G 0 0 1 0 1 1
U:A[C>A]T 8 6 4 4 9 11
U:A[C>G]A 3 8 6 3 7 12
U:A[C>G]C 5 4 5 0 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A 2 3 2 2 4 3
U:G[C>G]C 3 2 1 4 5 2
U:G[C>G]G 0 1 0 0 4 0
U:G[C>G]T 6 4 4 3 4 7
U:G[C>T]A 14 13 11 7 21 20
U:G[C>T]C 10 19 5 9 14 12
U:G[C>T]G 14 8 1 14 12 9
U:G[C>T]T 9 11 9 7 12 8
U:G[T>A]A 2 2 2 1 5 5
U:G[T>A]C 1 5 2 1 8 4
U:G[T>A]G 4 5 6 3 10 5
U:G[T>A]T 5 5 6 4 7 6
U:G[T>C]A 20 14 8 12 11 15
U:G[T>C]C 7 4 1 12 9 10
U:G[T>C]G 4 11 6 12 20 12
U:G[T>C]T 11 15 3 14 13 8
U:G[T>G]A 4 1 0 1 1 1
U:G[T>G]C 3 0 1 2 0 1
U:G[T>G]G 5 3 1 0 3 3
U:G[T>G]T 4 4 2 3 0 4
U:T[C>A]A 10 13 15 7 24 18
U:T[C>A]C 10 14 9 9 12 17
U:T[C>A]G 4 2 3 2 3 2
U:T[C>A]T 16 19 11 15 19 11
U:T[C>G]A 11 3 3 6 6 11
U:T[C>G]C 3 4 4 5 9 10
U:T[C>G]G 3 2 1 0 2 3
U:T[C>G]T 13 14 9 12 20 17
U:T[C>T]A 16 19 21 13 20 34
U:T[C>T]C 23 19 15 9 17 25
U:T[C>T]G 9 12 8 4 12 5
U:T[C>T]T 12 10 8 9 12 21
U:T[T>A]A 4 8 11 10 11 16
U:T[T>A]C 1 8 5 5 9 5
U:T[T>A]G 3 4 3 8 12 6
U:T[T>A]T 13 13 8 4 23 23
U:T[T>C]A 12 18 9 7 14 26
U:T[T>C]C 8 13 4 4 9 8
U:T[T>C]G 12 12 6 3 15 7
U:T[T>C]T 13 12 13 6 25 18
U:T[T>G]A 8 4 2 7 6 5
U:T[T>G]C 7 6 5 3 14 5
U:T[T>G]G 4 5 2 2 7 7
U:T[T>G]T 16 20 17 19 19 15
N:A[C>A]A 73 105 64 40 45 110
N:A[C>A]C 30 43 16 17 17 54
N:A[C>A]G 10 10 6 2 6 10
N:A[C>A]T 46 48 37 17 27 46
N:A[C>G]A 43 36 20 17 21 32
N:A[C>G]C 10 14 16 8 10 17
N:A[C>G]G 4 4 1 4 4 0
N:A[C>G]T 25 24 21 12 22 23
N:A[C>T]A 48 54 36 25 58 39
N:A[C>T]C 31 38 24 22 30 26
N:A[C>T]G 83 51 36 36 74 56
N:A[C>T]T 40 43 32 21 50 49
N:A[T>A]A 27 20 18 11 36 49
N:A[T>A]C 18 13 15 6 13 26
N:A[T>A]G 23 24 16 8 31 29
N:A[T>A]T 12 22 28 21 62 43
N:A[T>C]A 90 134 45 53 63 116
N:A[T>C]C 44 80 11 16 32 38
N:A[T>C]G 62 85 28 41 75 70
N:A[T>C]T 74 105 39 38 55 85
N:A[T>G]A 15 11 10 9 14 17
N:A[T>G]C 6 8 7 5 12 13
N:A[T>G]G 9 16 11 8 19 16
N:A[T>G]T 10 17 15 7 19 18
N:C[C>A]A 80 102 40 19 41 86
N:C[C>A]C 38 63 24 16 36 52
N:C[C>A]G 4 6 13 4 9 8
N:C[C>A]T 55 56 36 19 34 47
N:C[C>G]A 13 18 17 6 10 20
N:C[C>G]C 10 20 12 7 23 18
N:C[C>G]G 4 2 4 2 2 5
N:C[C>G]T 24 27 18 16 23 36
N:C[C>T]A 48 51 28 18 39 44
N:C[C>T]C 41 54 33 20 55 45
N:C[C>T]G 36 33 23 27 30 34
N:C[C>T]T 45 58 37 32 47 62
N:C[T>A]A 17 14 13 8 28 26
N:C[T>A]C 16 39 14 9 27 24
N:C[T>A]G 20 21 17 13 39 35
N:C[T>A]T 17 21 23 10 34 33
N:C[T>C]A 23 38 26 31 46 50
N:C[T>C]C 28 60 15 15 11 48
N:C[T>C]G 25 53 13 27 40 35
N:C[T>C]T 36 67 18 29 27 56
N:C[T>G]A 6 1 4 7 7 9
N:C[T>G]C 11 10 5 5 9 12
N:C[T>G]G 11 11 8 11 10 14
N:C[T>G]T 10 10 7 19 12 22
N:G[C>A]A 35 58 31 24 20 43
N:G[C>A]C 19 35 24 6 14 32
N:G[C>A]G 10 6 5 4 4 9
N:G[C>A]T 24 37 21 16 12 35
N:G[C>G]A 8 15 14 7 7 12
N:G[C>G]C 11 9 8 7 17 17
N:G[C>G]G 5 1 2 1 0 1
N:G[C>G]T 7 12 9 8 10 15
N:G[C>T]A 38 46 34 23 33 55
N:G[C>T]C 30 37 31 18 28 47
N:G[C>T]G 42 32 33 28 61 42
N:G[C>T]T 36 55 47 27 42 55
N:G[T>A]A 13 7 8 3 13 11
N:G[T>A]C 11 18 7 3 6 9
N:G[T>A]G 7 14 4 5 15 13
N:G[T>A]T 14 11 17 9 19 17
N:G[T>C]A 40 83 15 24 26 69
N:G[T>C]C 26 46 7 14 18 32
N:G[T>C]G 31 44 12 14 17 29
N:G[T>C]T 35 51 23 28 29 48
N:G[T>G]A 5 1 5 1 4 5
N:G[T>G]C 1 4 4 0 5 5
N:G[T>G]G 8 6 3 4 11 8
N:G[T>G]T 7 7 5 7 5 5
N:T[C>A]A 36 52 40 29 28 59
N:T[C>A]C 43 59 40 24 21 76
N:T[C>A]G 3 6 7 3 2 15
N:T[C>A]T 34 55 38 39 34 75
N:T[C>G]A 17 23 14 15 17 23
N:T[C>G]C 20 28 13 10 26 38
N:T[C>G]G 1 4 1 0 4 5
N:T[C>G]T 27 40 31 28 41 54
N:T[C>T]A 46 59 44 31 45 64
N:T[C>T]C 56 71 36 22 46 66
N:T[C>T]G 18 14 22 14 31 23
N:T[C>T]T 35 39 54 42 47 52
N:T[T>A]A 22 20 23 24 29 32
N:T[T>A]C 22 32 20 4 27 33
N:T[T>A]G 16 20 11 9 20 21
N:T[T>A]T 29 29 30 23 44 36
N:T[T>C]A 74 113 15 27 45 61
N:T[T>C]C 46 76 9 19 22 35
N:T[T>C]G 33 70 11 11 25 56
N:T[T>C]T 60 99 13 30 39 78
N:T[T>G]A 17 13 7 14 12 11
N:T[T>G]C 15 12 15 8 24 23
N:T[T>G]G 9 10 7 6 14 23
N:T[T>G]T 32 28 22 23 36 41
Binary file removed output/examples/BRCA_example_CNV48_counts.pdf
Binary file not shown.
Binary file removed output/examples/BRCA_example_RS32_counts.pdf
Binary file not shown.
Binary file removed output/examples/SBS_384_plots_BRCA_example.pdf
Binary file not shown.
Binary file removed output/examples/SBS_96_plots_BRCA_example.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion plot_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
sigPlt.plotSV(matrix_path + "breast_cancer_samples_example.RS32.all", output_path, "BRCA_example", "pdf", percentage=False, aggregate=False) #plotting of SV counts

#sigPlt.plotDBS(matrix_path + "breast_cancer_samples_example.DBS78.all", output_path, "BRCA_example", "78")
#sigPlt.plotID(matrix_path + "breast_cancer_samples_example.ID94.all", output_path, "BRCA_example", "94")
# sigPlt.plotID(matrix_path + "breast_cancer_samples_example.ID94.all", output_path, "BRCA_example", "94")
21 changes: 16 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def readme():
with open('README.rst') as f:
return(f.read())

VERSION = '1.2.2'
VERSION = '1.2.3'

def write_version_py(filename='sigProfilerPlotting/version.py'):
# Copied from numpy setup.py
Expand Down Expand Up @@ -53,13 +53,23 @@ def run(self):
file_names = ["Times New Roman.ttf", "Arial.ttf", "Courier New.ttf",
"Courier New Bold.ttf", "Arial Bold.ttf", "Times New Roman Bold.ttf"]
for file in file_names:
old_path = os.path.join(cp_ttf_dir, "fonts/" + file)
new_path = os.path.join(mpl_ttf_dir, file)
shutil.copyfile(old_path, new_path)
old_path = os.path.join(cp_ttf_dir, "fonts/" + file)
new_path = os.path.join(mpl_ttf_dir, file)
shutil.copyfile(old_path, new_path)
matplotlib.font_manager._rebuild()

except:
warnings.warn("WARNING: An issue occured while installing the fonts.")
#install figure templates
try:
import sigProfilerPlotting as sigPlt
sigPlt.install_plot_templates('SBS96')
sigPlt.install_plot_templates('SBS288')
sigPlt.install_plot_templates('DBS78')
sigPlt.install_plot_templates('ID83')
os.system("echo 'installed figure templates' ")
except:
os.system("echo 'Failed to install templates' ")



Expand All @@ -72,9 +82,10 @@ def run(self):
license='UCSD',
packages=['sigProfilerPlotting'],
install_requires =[
"matplotlib>=3.3.0,<=3.4.3", "pandas", "seaborn"],
"matplotlib>=3.3.0,<=3.4.3", "pandas", "seaborn","sklearn"],
package_data={'':['fonts/*.ttf']},
include_package_data=True,
#Specify the custom install class
cmdclass={'install' : move_ttf},
zip_safe=False)

13 changes: 0 additions & 13 deletions sigProfilerPlotting.egg-info/PKG-INFO

This file was deleted.

Loading

0 comments on commit c4da90a

Please sign in to comment.