Skip to content

Commit

Permalink
Merge pull request #226 from AlexandrovLab/cosmic_v3.4
Browse files Browse the repository at this point in the history
COSMIC V3.4 Update
  • Loading branch information
mdbarnesUCSD authored Nov 21, 2023
2 parents e807db2 + 1ab442d commit 24ef286
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 11 deletions.
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,7 @@ test_matobj_output/
test_segCNV_output/
test_text_output/
test_vcf_output/
test_matrix_48_output/
test_matrix_78_output/
test_matrix_83_output/
test_matrix_96_output/
test_matrix_*_output/
SigProfilerExtractor/data/VCFInput/logs/
SigProfilerExtractor/data/VCFInput/input/
SigProfilerExtractor/data/VCFInput/output/
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ sigProfilerExtractor(input_type, out_put, input_data, reference_genome="GRCh37",
| | **combined_stability** | Float | Default is 1.0. The cutoff thresh-hold of the combined stability (sum of average and minimum stability). Solutions with combined stabilities below this thresh-hold will not be considered. |
| | **allow_stability_drop** | Boolean | Default is False. Defines if solutions with a drop in stability with respect to the highest stable number of signatures will be considered. |
| **Decomposition** | | | |
| | **cosmic_version** | Float | Takes a positive float among 1, 2, 3, 3.1, 3.2 and 3.3. Default is 3.3. Defines the version of the COSMIC reference signatures. |
| | **cosmic_version** | Float | Takes a positive float among 1, 2, 3, 3.1, 3.2, 3.3, and 3.4. Default is 3.4. Defines the version of the COSMIC reference signatures. |
| | **make_decomposition_plots** | Boolean | Defualt is True. If True, Denovo to Cosmic sigantures decompostion plots will be created as a part the results. |
| | **collapse_to_SBS96** | Boolean | Defualt is True. If True, SBS288 and SBS1536 Denovo signatures will be mapped to SBS96 reference signatures. If False, those will be mapped to reference signatures of the same context.
| **Others** | | | |
Expand Down
33 changes: 33 additions & 0 deletions SigProfilerExtractor/data/TextInput/Samples_SV.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
Mutation Types PD8969a PD18031a PD4103a PD14472a PD9572a
clustered_del_1-10Kb 0 0 5 0 0
clustered_del_10-100Kb 0 1 4 0 0
clustered_del_100Kb-1Mb 0 2 9 0 0
clustered_del_1Mb-10Mb 0 2 16 0 1
clustered_del_>10Mb 0 0 13 0 0
clustered_tds_1-10Kb 0 0 1 0 0
clustered_tds_10-100Kb 0 0 3 0 1
clustered_tds_100Kb-1Mb 0 4 5 0 0
clustered_tds_1Mb-10Mb 0 1 11 0 0
clustered_tds_>10Mb 0 2 8 0 0
clustered_inv_1-10Kb 0 7 7 0 0
clustered_inv_10-100Kb 0 7 7 0 0
clustered_inv_100Kb-1Mb 0 7 14 0 3
clustered_inv_1Mb-10Mb 0 3 33 0 0
clustered_inv_>10Mb 0 3 19 0 1
clustered_trans 0 11 186 0 1
non-clustered_del_1-10Kb 14 2 14 0 1
non-clustered_del_10-100Kb 10 8 11 0 0
non-clustered_del_100Kb-1Mb 4 2 23 0 0
non-clustered_del_1Mb-10Mb 2 1 18 1 0
non-clustered_del_>10Mb 3 0 11 1 0
non-clustered_tds_1-10Kb 1 0 1 0 0
non-clustered_tds_10-100Kb 2 3 1 0 0
non-clustered_tds_100Kb-1Mb 4 1 7 0 1
non-clustered_tds_1Mb-10Mb 2 2 11 0 0
non-clustered_tds_>10Mb 4 0 10 1 0
non-clustered_inv_1-10Kb 5 6 13 0 1
non-clustered_inv_10-100Kb 2 3 5 0 0
non-clustered_inv_100Kb-1Mb 4 1 18 0 1
non-clustered_inv_1Mb-10Mb 7 2 19 0 0
non-clustered_inv_>10Mb 11 1 27 1 0
non-clustered_trans 51 11 83 3 6
4 changes: 3 additions & 1 deletion SigProfilerExtractor/sigpro.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ def importdata(datatype="matrix"):
data = paths+"/data/CSVInput/csv_example.csv"
elif datatype=="seg:BATTENBERG":
data = paths+"/data/CNVInput/Battenberg_test.tsv"
elif datatype=="matrix_SV":
data = paths+"/data/TextInput/Samples_SV.txt"
elif datatype=="vcf":
data = paths+"/data/VCFInput/"
return data
Expand Down Expand Up @@ -165,7 +167,7 @@ def sigProfilerExtractor(input_type,
input_data,
reference_genome="GRCh37",
opportunity_genome = "GRCh37",
cosmic_version=3.3,
cosmic_version=3.4,
context_type = "default",
exome = False,
minimum_signatures=1,
Expand Down
4 changes: 2 additions & 2 deletions SigProfilerExtractor/subroutines.py
Original file line number Diff line number Diff line change
Expand Up @@ -1099,9 +1099,9 @@ def export_information(loopResults, mutation_type, output, index, colnames, sequ
elif m=="ID83":
plot.plotID(signature_subdirectory+"/"+mutation_type+"_S"+str(i)+"_Signatures"+".txt", signature_subdirectory+"/Signature_plot/" , "S"+str(i), "83", True, custom_text_upper=stability_list, custom_text_middle=total_mutation_list)
elif m=="CNV48":
plot.plotCNV(signature_subdirectory+"/"+mutation_type+"_S"+str(i)+"_Signatures"+".txt", signature_subdirectory+"/Signature_plot/" , "S"+str(i), "pdf", percentage=True, aggregate=False)
plot.plotCNV(signature_subdirectory+"/"+mutation_type+"_S"+str(i)+"_Signatures"+".txt", signature_subdirectory+"/Signature_plot/" , "S"+str(i), percentage=True, aggregate=False)
elif m=="SV32":
plot.plotSV(signature_subdirectory+"/"+mutation_type+"_S"+str(i)+"_Signatures"+".txt", signature_subdirectory+"/Signature_plot/" , "S"+str(i), "pdf", percentage=True, aggregate=False)
plot.plotSV(signature_subdirectory+"/"+mutation_type+"_S"+str(i)+"_Signatures"+".txt", signature_subdirectory+"/Signature_plot/" , "S"+str(i), percentage=True, aggregate=False)
elif m=="SBS96" or m=="SBS288" or m=="SBS384" or m=="SBS1536" or m=="SBS4608":
# parse 'm' to be accepted by the plotSBS function
tmp_m = m
Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
if os.path.exists("dist"):
shutil.rmtree("dist")

VERSION = '1.1.22'
VERSION = '1.1.23'


with open('README.md') as f:
Expand All @@ -20,7 +20,7 @@ def write_version_py(filename='SigProfilerExtractor/version.py'):
# THIS FILE IS GENERATED FROM SIGPROFILEREXTRACTOR SETUP.PY
short_version = '%(version)s'
version = '%(version)s'
Update = 'Upgrade v1.1.22: Resolve issue with 4608 plotting as custom'
Update = 'Upgrade v1.1.23: Update to use the latest SigProfilerAssignment with COSMIC v3.4 signatures.'
"""
fh = open(filename, 'w')
Expand All @@ -34,7 +34,7 @@ def write_version_py(filename='SigProfilerExtractor/version.py'):
'nimfa>=1.1.0',
'SigProfilerMatrixGenerator>=1.2.17',
'sigProfilerPlotting>=1.3.16',
'SigProfilerAssignment>=0.0.32',
'SigProfilerAssignment>=0.1.0',
'pillow',
'statsmodels>=0.9.0',
'scikit-learn>=0.24.2',
Expand Down
7 changes: 7 additions & 0 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ def run_seg_48():
minimum_signatures=3, maximum_signatures=3, nmf_replicates=5,
min_nmf_iterations=100, max_nmf_iterations=1000, nmf_test_conv=100)

def run_matrix_32():
data = sig.importdata("matrix_SV")
sig.sigProfilerExtractor("matrix", "test_matrix_32_output", data,
minimum_signatures=3, maximum_signatures=3, nmf_replicates=5,
min_nmf_iterations=100, max_nmf_iterations=1000, nmf_test_conv=100)

def run_matobj():
data = sig.importdata("matobj")
sig.sigProfilerExtractor("matobj", "test_matobj_output", data,
Expand All @@ -63,6 +69,7 @@ def run_csv():
run_matrix_78()
run_matrix_83()
run_matrix_48()
run_matrix_32()
run_seg_48()
run_vcf()
# run_matobj()
Expand Down

0 comments on commit 24ef286

Please sign in to comment.