Skip to content

Commit

Permalink
Merge pull request #110 from AlexandrovLab/i108
Browse files Browse the repository at this point in the history
I108
  • Loading branch information
mdbarnesUCSD authored Jan 25, 2024
2 parents 6c6b61b + d99070d commit 327fb93
Show file tree
Hide file tree
Showing 17 changed files with 13,964 additions and 7,152 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ genInstall.install('GRCh37')
```
## <a name="running"></a> Running

Assignment of known mutational signatures to individual samples is performed using the `cosmic_fit` function. Input samples are provided using the `samples` parameter in the form of mutation calling files (VCFs, MAFs, or simple text files), segmentation files or mutational matrices. COSMIC mutational signatures v3.3 are used as the default reference signatures, although previous COSMIC versions and custom signature databases are also supported using the `cosmic_version` and `signature_database` parameters. Results will be found in the folder specified in the `output` parameter.
Assignment of known mutational signatures to individual samples is performed using the `cosmic_fit` function. Input samples are provided using the `samples` parameter in the form of mutation calling files (VCFs, MAFs, or simple text files), segmentation files or mutational matrices. COSMIC mutational signatures v3.4 are used as the default reference signatures, although previous COSMIC versions and custom signature databases are also supported using the `cosmic_version` and `signature_database` parameters. Results will be found in the folder specified in the `output` parameter.

```python
from SigProfilerAssignment import Analyzer as Analyze
Expand Down
154 changes: 148 additions & 6 deletions SigProfilerAssignment/Analyzer.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,152 @@
from SigProfilerAssignment import decomposition as decomp

def decompose_fit(samples, output, signatures=None, signature_database=None,nnls_add_penalty=0.05, nnls_remove_penalty=0.01, initial_remove_penalty=0.05,genome_build="GRCh37", cosmic_version=3.4, make_plots=True, collapse_to_SBS96=True,connected_sigs=True, verbose=False,devopts=None,new_signature_thresh_hold=0.8,exclude_signature_subgroups=None,exome=False,input_type='matrix',context_type="96",export_probabilities=True, export_probabilities_per_mutation=False):
decomp.spa_analyze(samples=samples, output=output, signatures=signatures, signature_database=signature_database,nnls_add_penalty=nnls_add_penalty, nnls_remove_penalty=nnls_remove_penalty, initial_remove_penalty=initial_remove_penalty,genome_build=genome_build, cosmic_version=cosmic_version, make_plots=make_plots, collapse_to_SBS96=collapse_to_SBS96,connected_sigs=connected_sigs, verbose=verbose,decompose_fit_option= True,denovo_refit_option=False,cosmic_fit_option=False,devopts=devopts,new_signature_thresh_hold=new_signature_thresh_hold,exclude_signature_subgroups=exclude_signature_subgroups,exome=exome,input_type=input_type,context_type=context_type,export_probabilities=export_probabilities, export_probabilities_per_mutation=export_probabilities_per_mutation)

def denovo_fit(samples, output, signatures=None, signature_database=None,nnls_add_penalty=0.05,nnls_remove_penalty=0.01, initial_remove_penalty=0.05, genome_build="GRCh37", cosmic_version=3.4, make_plots=True, collapse_to_SBS96=True,connected_sigs=True, verbose=False,devopts=None,new_signature_thresh_hold=0.8,exome=False,input_type='matrix',context_type="96",export_probabilities=True, export_probabilities_per_mutation=False):
decomp.spa_analyze(samples=samples, output=output, signatures=signatures, signature_database=signature_database,nnls_add_penalty=nnls_add_penalty, nnls_remove_penalty=nnls_remove_penalty, initial_remove_penalty=initial_remove_penalty,genome_build=genome_build, cosmic_version=cosmic_version, new_signature_thresh_hold=new_signature_thresh_hold, make_plots=make_plots, collapse_to_SBS96=collapse_to_SBS96,connected_sigs=connected_sigs, verbose=verbose,decompose_fit_option= False,denovo_refit_option=True,cosmic_fit_option=False,devopts=devopts,exome=exome,input_type=input_type,context_type=context_type,export_probabilities=export_probabilities, export_probabilities_per_mutation=export_probabilities_per_mutation)
def decompose_fit(
samples,
output,
signatures=None,
signature_database=None,
nnls_add_penalty=0.05,
nnls_remove_penalty=0.01,
initial_remove_penalty=0.05,
genome_build="GRCh37",
cosmic_version=3.4,
make_plots=True,
collapse_to_SBS96=True,
connected_sigs=True,
verbose=False,
devopts=None,
new_signature_thresh_hold=0.8,
exclude_signature_subgroups=None,
exome=False,
input_type="matrix",
context_type="96",
export_probabilities=True,
export_probabilities_per_mutation=False,
):
decomp.spa_analyze(
samples=samples,
output=output,
signatures=signatures,
signature_database=signature_database,
nnls_add_penalty=nnls_add_penalty,
nnls_remove_penalty=nnls_remove_penalty,
initial_remove_penalty=initial_remove_penalty,
genome_build=genome_build,
cosmic_version=cosmic_version,
make_plots=make_plots,
collapse_to_SBS96=collapse_to_SBS96,
connected_sigs=connected_sigs,
verbose=verbose,
decompose_fit_option=True,
denovo_refit_option=False,
cosmic_fit_option=False,
devopts=devopts,
new_signature_thresh_hold=new_signature_thresh_hold,
exclude_signature_subgroups=exclude_signature_subgroups,
exome=exome,
input_type=input_type,
context_type=context_type,
export_probabilities=export_probabilities,
export_probabilities_per_mutation=export_probabilities_per_mutation,
)

def cosmic_fit(samples, output, signatures=None, signature_database=None,nnls_add_penalty=0.05, nnls_remove_penalty=0.01, initial_remove_penalty=0.05,genome_build="GRCh37", cosmic_version=3.4, make_plots=True, collapse_to_SBS96=True,connected_sigs=True, verbose=False,devopts=None,exclude_signature_subgroups=None,exome=False,input_type='matrix',context_type="96",export_probabilities=True, export_probabilities_per_mutation=False, sample_reconstruction_plots=False):
decomp.spa_analyze(samples=samples, output=output, signatures=signatures, signature_database=signature_database,nnls_add_penalty=nnls_add_penalty, nnls_remove_penalty=nnls_remove_penalty, initial_remove_penalty=initial_remove_penalty,genome_build=genome_build, cosmic_version=cosmic_version, make_plots=make_plots, collapse_to_SBS96=collapse_to_SBS96,connected_sigs=connected_sigs, verbose=verbose,decompose_fit_option= False,denovo_refit_option=False,cosmic_fit_option=True,devopts=devopts,exclude_signature_subgroups=exclude_signature_subgroups,exome=exome,input_type=input_type,context_type=context_type,export_probabilities=export_probabilities, export_probabilities_per_mutation=export_probabilities_per_mutation, sample_reconstruction_plots=sample_reconstruction_plots)

def denovo_fit(
samples,
output,
signatures=None,
signature_database=None,
nnls_add_penalty=0.05,
nnls_remove_penalty=0.01,
initial_remove_penalty=0.05,
genome_build="GRCh37",
cosmic_version=3.4,
make_plots=True,
collapse_to_SBS96=True,
connected_sigs=True,
verbose=False,
devopts=None,
new_signature_thresh_hold=0.8,
exome=False,
input_type="matrix",
context_type="96",
export_probabilities=True,
export_probabilities_per_mutation=False,
):
decomp.spa_analyze(
samples=samples,
output=output,
signatures=signatures,
signature_database=signature_database,
nnls_add_penalty=nnls_add_penalty,
nnls_remove_penalty=nnls_remove_penalty,
initial_remove_penalty=initial_remove_penalty,
genome_build=genome_build,
cosmic_version=cosmic_version,
new_signature_thresh_hold=new_signature_thresh_hold,
make_plots=make_plots,
collapse_to_SBS96=collapse_to_SBS96,
connected_sigs=connected_sigs,
verbose=verbose,
decompose_fit_option=False,
denovo_refit_option=True,
cosmic_fit_option=False,
devopts=devopts,
exome=exome,
input_type=input_type,
context_type=context_type,
export_probabilities=export_probabilities,
export_probabilities_per_mutation=export_probabilities_per_mutation,
)


def cosmic_fit(
samples,
output,
signatures=None,
signature_database=None,
nnls_add_penalty=0.05,
nnls_remove_penalty=0.01,
initial_remove_penalty=0.05,
genome_build="GRCh37",
cosmic_version=3.4,
make_plots=True,
collapse_to_SBS96=True,
connected_sigs=True,
verbose=False,
devopts=None,
exclude_signature_subgroups=None,
exome=False,
input_type="matrix",
context_type="96",
export_probabilities=True,
export_probabilities_per_mutation=False,
sample_reconstruction_plots=False,
):
decomp.spa_analyze(
samples=samples,
output=output,
signatures=signatures,
signature_database=signature_database,
nnls_add_penalty=nnls_add_penalty,
nnls_remove_penalty=nnls_remove_penalty,
initial_remove_penalty=initial_remove_penalty,
genome_build=genome_build,
cosmic_version=cosmic_version,
make_plots=make_plots,
collapse_to_SBS96=collapse_to_SBS96,
connected_sigs=connected_sigs,
verbose=verbose,
decompose_fit_option=False,
denovo_refit_option=False,
cosmic_fit_option=True,
devopts=devopts,
exclude_signature_subgroups=exclude_signature_subgroups,
exome=exome,
input_type=input_type,
context_type=context_type,
export_probabilities=export_probabilities,
export_probabilities_per_mutation=export_probabilities_per_mutation,
sample_reconstruction_plots=sample_reconstruction_plots,
)
Loading

0 comments on commit 327fb93

Please sign in to comment.