From 398292498913df16ebc64e1517e47e2b16ea1c0d Mon Sep 17 00:00:00 2001 From: josecorcab Date: Wed, 6 May 2026 22:52:31 +0200 Subject: [PATCH 1/3] ci: move ci.yml to .github/workflows and update actions to v6 --- ci.yml => .github/workflows/ci.yml | 8 ++++---- .github/workflows/release.yml | 21 +++++++++++++++------ 2 files changed, 19 insertions(+), 10 deletions(-) rename ci.yml => .github/workflows/ci.yml (93%) diff --git a/ci.yml b/.github/workflows/ci.yml similarity index 93% rename from ci.yml rename to .github/workflows/ci.yml index f1ce0ec..38168d6 100644 --- a/ci.yml +++ b/.github/workflows/ci.yml @@ -21,10 +21,10 @@ jobs: python-version: ['3.9', '3.14'] steps: - - uses: actions/checkout@v4 - + - uses: actions/checkout@v6 + - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: ${{ matrix.python-version }} @@ -38,7 +38,7 @@ jobs: python -m pip install --upgrade pip setuptools packaging - name: Cache src directory - uses: actions/cache@v4 + uses: actions/cache@v5 with: path: ${{ github.workspace }}/src/ key: ${{ runner.os }}-src-grch37 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f6109e7..b507a48 100755 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,10 +17,12 @@ jobs: steps: - name: Checkout repo - uses: actions/checkout@v4 + uses: actions/checkout@v6 + with: + fetch-depth: 0 - name: Set up Python - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: "3.14" @@ -64,14 +66,21 @@ jobs: raise SystemExit(f"Error: New version ({new_version}) is not higher than latest release ({latest_version})") EOF - - name: Generate CHANGELOG.md with git-cliff + - name: Generate release notes and update CHANGELOG.md run: | - git-cliff --unreleased --strip all --tag "v${{ steps.get_version.outputs.VERSION }}" > CHANGELOG.md + git-cliff --unreleased --strip all --tag "v${{ steps.get_version.outputs.VERSION }}" > RELEASE_NOTES.md + git-cliff --unreleased --tag "v${{ steps.get_version.outputs.VERSION }}" --prepend CHANGELOG.md - - name: Create Git tag + - name: Commit and push CHANGELOG.md run: | git config user.name "github-actions" git config user.email "github-actions@github.com" + git add CHANGELOG.md + git commit -m "chore: update CHANGELOG.md for v${{ steps.get_version.outputs.VERSION }}" + git push origin HEAD:master + + - name: Create Git tag + run: | git tag v${{ steps.get_version.outputs.VERSION }} git push origin v${{ steps.get_version.outputs.VERSION }} @@ -79,7 +88,7 @@ jobs: uses: softprops/action-gh-release@v2 with: tag_name: v${{ steps.get_version.outputs.VERSION }} - body_path: CHANGELOG.md + body_path: RELEASE_NOTES.md env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 3e02bb368dce96a36e59b904f0502673f863f38b Mon Sep 17 00:00:00 2001 From: josecorcab Date: Fri, 8 May 2026 10:52:10 +0200 Subject: [PATCH 2/3] docs: add MkDocs documentation site Add full MkDocs documentation following the SigProfilerAssignment structure: home page, installation, quick start example, workflow, input parameters, and output description. Includes Material theme config, OSF TOC hook, extra CSS, and GitHub Actions workflow for automated deployment to GitHub Pages. Update citation in README to published Bioinformatics paper and add Nature 2022 paper as second reference. --- .github/workflows/docs.yml | 54 +++++++++++++++ README.md | 4 +- docs/1_installation.md | 82 +++++++++++++++++++++++ docs/2_quick_start_example.md | 75 +++++++++++++++++++++ docs/3_workflow.md | 49 ++++++++++++++ docs/4_using_the_tool_input.md | 105 ++++++++++++++++++++++++++++++ docs/5_using_the_tool_output.md | 83 +++++++++++++++++++++++ docs/assets/stylesheets/extra.css | 29 +++++++++ docs/index.md | 36 ++++++++++ mkdocs.yml | 60 +++++++++++++++++ mkdocs_hooks.py | 13 ++++ 11 files changed, 589 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/docs.yml create mode 100644 docs/1_installation.md create mode 100644 docs/2_quick_start_example.md create mode 100644 docs/3_workflow.md create mode 100644 docs/4_using_the_tool_input.md create mode 100644 docs/5_using_the_tool_output.md create mode 100644 docs/assets/stylesheets/extra.css create mode 100644 docs/index.md create mode 100644 mkdocs.yml create mode 100644 mkdocs_hooks.py diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..9b8bc57 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,54 @@ +name: Docs + +on: + push: + branches: + - master + - dev + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: github-pages + cancel-in-progress: true + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: "3.x" + + - name: Configure Pages + uses: actions/configure-pages@v5 + + - name: Install docs dependencies + run: | + python -m pip install --upgrade pip + python -m pip install mkdocs mkdocs-material pymdown-extensions + + - name: Build site + run: | + mkdocs build --clean + + - name: Upload Pages artifact + uses: actions/upload-pages-artifact@v3 + with: + path: site + + deploy: + runs-on: ubuntu-latest + needs: build + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - id: deployment + uses: actions/deploy-pages@v4 diff --git a/README.md b/README.md index 962b1bb..8285fa0 100755 --- a/README.md +++ b/README.md @@ -132,7 +132,9 @@ Two examples are provided under examples/. These directories include all expecte CITATIONS -Erik N Bergstrom, Mousumy Kundu, Noura Tbeileh, Ludmil B Alexandrov. bioRxiv 2022.02.11.480117; doi: https://doi.org/10.1101/2022.02.11.480117 +Erik N Bergstrom, Mousumy Kundu, Noura Tbeileh, Ludmil B Alexandrov. Examining clustered somatic mutations with SigProfilerClusters. Bioinformatics. 2022;38(13):3470–3473. https://doi.org/10.1093/bioinformatics/btac335 + +Bergstrom EN, Luebeck J, Petljak M, et al. Mapping clustered mutations in cancer reveals APOBEC3 mutagenesis of ecDNA. Nature. 2022;602:510–517. https://doi.org/10.1038/s41586-022-04398-6 COPYRIGHT diff --git a/docs/1_installation.md b/docs/1_installation.md new file mode 100644 index 0000000..05c4fd2 --- /dev/null +++ b/docs/1_installation.md @@ -0,0 +1,82 @@ +# Installation + + +---------- + + +This section will help you set up the necessary software and packages required to run SigProfilerClusters. + +---------- + + +## Prerequisites ## + +- [Python][1] version >= 3.9 +- [SigProfilerMatrixGenerator][2] with a downloaded reference genome (required to generate mutational matrices and simulations) +- [SigProfilerSimulator][3] (required to generate the background model used for IMD threshold calculation) +- Other dependencies are installed automatically during package installation + +## Installation ## + +SigProfilerClusters can be executed on any Windows/macOS/Unix system. First follow the [SigProfilerMatrixGenerator][2] guide for installing `Python` and `pip`. Next, follow the instructions below for the latest stable release or the current GitHub version. + +### Installation with `pip` ### + +Install the latest `SigProfilerClusters` PyPI version using `pip`: +``` +$ pip install SigProfilerClusters +``` + +To upgrade an existing installation to the most recent version: +``` +$ pip install SigProfilerClusters --upgrade +``` + +### Install specific GitHub Release ### + +First, download the [zip file][4] or clone the GitHub repository: +``` +$ git clone https://github.com/SigProfilerSuite/SigProfilerClusters.git +``` + +Next, enter the downloaded directory and install the package: +``` +$ cd SigProfilerClusters +$ pip install . +``` + +## Download Reference Genome ## + +SigProfilerClusters requires a reference genome to generate simulations and mutational matrices. Current reference genomes supported include GRCh37, GRCh38, mm9, and mm10. To install the reference genome/s, you need to use [SigProfilerMatrixGenerator][2]. + +The last PyPI [SigProfilerMatrixGenerator][2] version is installed with SigProfilerClusters by default. You can also install a specific version following the instructions in the [SigProfilerMatrixGenerator Wiki][2]. + +Once [SigProfilerMatrixGenerator][2] is installed, install your desired reference genome from the command line/terminal as follows. + +### Installation from command line ### + +``` +$ SigProfilerMatrixGenerator install GRCh37 +``` + +### Installation from Python terminal ### + +``` python +$ python +>>> from SigProfilerMatrixGenerator import install as genInstall +>>> genInstall.install('GRCh37', rsync=False, bash=True) +``` + +If you have a firewall on your server, you may need to install `rsync` and use the `rsync=True` parameter. Similarly, if you do not have bash available, use `bash=False`. + +In case you prefer to install a reference genome from a local copy: +``` python +$ python +>>> from SigProfilerMatrixGenerator import install as genInstall +>>> genInstall.install('GRCh37', offline_files_path='path/to/directory/containing/GRCh37.tar.gz') +``` + + [1]: https://www.python.org/downloads + [2]: https://sigprofilersuite.github.io/SigProfilerMatrixGenerator/ + [3]: https://osf.io/usxjz/wiki/home/ + [4]: https://github.com/SigProfilerSuite/SigProfilerClusters/releases diff --git a/docs/2_quick_start_example.md b/docs/2_quick_start_example.md new file mode 100644 index 0000000..0e5151b --- /dev/null +++ b/docs/2_quick_start_example.md @@ -0,0 +1,75 @@ +# Quick Start Example + + +---------- + + +This section provides a minimal example to get started with SigProfilerClusters. The following example uses a breast cancer sample (`BRCA`) or a melanoma sample (`MELA`) and demonstrates the complete workflow: generating simulations with [SigProfilerSimulator][2] and detecting clustered mutations with SigProfilerClusters. + +---------- + +## Prerequisites ## + +This tutorial requires that you have completed all steps in the [installation guide][1], specifically: + +- Installed SigProfilerClusters +- Installed [SigProfilerSimulator][2] +- Downloaded the **GRCh37** reference genome using [SigProfilerMatrixGenerator][3] + +## Downloading input example data ## + +Download one of the example VCF files below and place it in a new project directory (e.g., `path/to/data/`): + +- [BRCA_example_subs.vcf][5] — breast cancer substitutions +- [BRCA_example_indels.vcf][7] — breast cancer indels +- [MELA_example.vcf][6] — melanoma substitutions + +These samples and their expected outputs are also available under the `examples/` directory within the [GitHub repository](https://github.com/SigProfilerSuite/SigProfilerClusters). + +!!! note + The `simulations/` folder is not included in the GitHub repository to reduce its memory footprint. + +## Running SigProfilerClusters ## + +First, start a Python interactive shell and import [SigProfilerMatrixGenerator][3], [SigProfilerSimulator][2], and SigProfilerClusters. + +``` python +$ python +>>> from SigProfilerMatrixGenerator import install as genInstall +>>> from SigProfilerSimulator import SigProfilerSimulator as sigSim +>>> from SigProfilerClusters import SigProfilerClusters as hp +``` + +### Step 1: Run SigProfilerSimulator ### + +Generate a background model by running at least 100 simulations of inter-mutational distances for your data. **Note**: Update `"path/to/data"` with the actual path to the directory containing the VCF file. + +``` python +>>> sigSim.SigProfilerSimulator("BRCA", "path/to/data", "GRCh37", contexts=["288"], chrom_based=True, simulations=100) +``` + +### Step 2: Run SigProfilerClusters ### + +Cluster mutations based on the simulated background distribution. **Note**: Update `"path/to/data"` with the actual path to your project directory. + +``` python +>>> hp.analysis("BRCA", "GRCh37", "96", ["288"], "path/to/data", + analysis="all", sortSims=True, subClassify=True, + correction=True, calculateIMD=True, max_cpu=4, + variant_caller="standard") +``` + +After SigProfilerClusters has finished running, the output will be organized under `path/to/data/output/`. Partitioned mutations are placed under `output/clustered/` and `output/nonClustered/`, and visualizations are found under `output/plots/`. To learn more about all output files, please refer to the [Using the Tool - Output][4] section. + +## Additional Information ## + +In the above example, unspecified parameters use their default values. All function arguments and their types are described in detail in the [Using the Tool - Input][8] section. To learn more about the generated output files, refer to [Using the Tool - Output][4]. + + [1]: https://sigprofilersuite.github.io/SigProfilerClusters/1_installation.html + [2]: https://osf.io/usxjz/wiki/home/ + [3]: https://sigprofilersuite.github.io/SigProfilerMatrixGenerator/ + [4]: https://sigprofilersuite.github.io/SigProfilerClusters/5_using_the_tool_output.html + [5]: https://osf.io/gy2bh/ + [6]: https://osf.io/a8bq5/ + [7]: https://osf.io/tyw3u/ + [8]: https://sigprofilersuite.github.io/SigProfilerClusters/4_using_the_tool_input.html diff --git a/docs/3_workflow.md b/docs/3_workflow.md new file mode 100644 index 0000000..af26901 --- /dev/null +++ b/docs/3_workflow.md @@ -0,0 +1,49 @@ +# Workflow + + +---------- + + +This section describes the methodology used by SigProfilerClusters to identify and classify clustered mutations. The tool follows a four-stage process that distinguishes genuinely clustered mutations from those distributed randomly across the genome. + +!!! note "Minimum mutational burden" + Reliable analysis requires a mutational burden greater than **0.005 mutations per megabase**. Samples below this threshold may not produce meaningful IMD-based clustering results. + +---------- + +## Stage 1: Background Model Generation ## + +A per-sample background model is created using [SigProfilerSimulator][1]. This tool randomizes each mutation across the genome while preserving: + +- The desired trinucleotide sequence context +- Transcriptional strand bias ratios +- The mutational burden on each chromosome + +A minimum of **100 simulations** is recommended to ensure a robust background distribution. + +## Stage 2: IMD Threshold Calculation ## + +SigProfilerClusters compares the distribution of real inter-mutational distances (IMD) with the simulated background to compute a **sample-specific IMD threshold**. The threshold is set at the point where at least **90% of mutations falling within it are unlikely to have occurred by chance**, i.e., their spacing cannot be explained by the background model. + +This approach ensures that the clustering criterion adapts to the mutation burden and genomic context of each individual sample. + +## Stage 3: Regional Correction ## + +The global IMD threshold is further refined by applying a **localized correction across 1-megabase genomic windows**. This step accounts for the uneven distribution of mutations throughout the genome — regions with higher mutation density will have a proportionally adjusted threshold — preventing over- or under-calling of clustered events in heterogeneous mutational landscapes. + +## Stage 4: Mutation Classification ## + +After thresholding and correction, mutations are assigned to one of the following categories based on their inter-mutational spacing and, when available, variant allele frequencies (VAF): + +| Class | Category | Description | +|-------|----------|-------------| +| Non-clustered | — | Mutations whose spacing is consistent with random expectation | +| Clustered | **DBS** (Doublet Base Substitution) | Exactly 2 adjacent SNVs on the same chromosomal position | +| Clustered | **MBS** (Multi-Base Substitution) | 3 or more adjacent SNVs on consecutive chromosomal positions | +| Clustered | **Omikli** | 2–3 clustered SNVs with IMD pattern consistent with a localized event | +| Clustered | **Kataegis** | 4 or more clustered SNVs with IMD pattern consistent with a regional hypermutation event | +| Clustered | **Other** | Clustered mutations with inconsistent allele frequencies; only identified when VAF/CCF data is available | + +Indels are classified as clustered or non-clustered but are not further subclassified into the categories above. + + [1]: https://osf.io/usxjz/wiki/home/ diff --git a/docs/4_using_the_tool_input.md b/docs/4_using_the_tool_input.md new file mode 100644 index 0000000..fa43e46 --- /dev/null +++ b/docs/4_using_the_tool_input.md @@ -0,0 +1,105 @@ +# Using SigProfilerClusters + + +---------- + + +This section describes SigProfilerClusters' main function for clustered mutation analysis, the accepted input file formats, and all available parameters. + +---------- + +## Function ## + +The main function in SigProfilerClusters is `analysis`. It partitions somatic mutations into clustered and non-clustered groups and, optionally, subclassifies clustered SNVs into DBS, MBS, Omikli, and Kataegis events. + +### Input files ### + +SigProfilerClusters accepts four input file types. All input files for a given project must be placed in the same directory (`input_path`): + +- **VCF** — one file per sample, with the sample ID as the filename. +- **MAF** — standard Mutation Annotation Format file. +- **Simple text file** — tab-delimited plain text format, as described in [SigProfilerMatrixGenerator][1]. +- **ICGC Format** — ICGC simple somatic mutation format. + +Additionally, a background model generated by [SigProfilerSimulator][2] must be present in the same project directory before running the `analysis` function. + +### Running the function ### + +First, start a Python interactive shell and import SigProfilerClusters: + +``` python +$ python +>>> from SigProfilerClusters import SigProfilerClusters as hp +``` + +Then call the `analysis` function with the required parameters: + +``` python +>>> hp.analysis(project, genome, contexts, simContext, input_path) +``` + +You can also run SigProfilerClusters from the command line: + +``` bash +$ SigProfilerClusters analysis project genome contexts simContext input_path +``` + +### Required parameters ### + +| Parameter | Variable Type | Parameter Description | +|-----------|---------------|-----------------------| +| `project` | String | Unique name for the given project | +| `genome` | String | Reference genome to use. Must be installed using [SigProfilerMatrixGenerator][1]. Supported genomes: GRCh37, GRCh38, mm9, mm10 | +| `contexts` | String | Mutational context for SNV analysis. Accepted values: `"96"` (substitutions) or `"ID"` (indels) | +| `simContext` | List of Strings | Mutation context used when generating the background model with [SigProfilerSimulator][2]. For example: `["288"]`, `["6144"]`, or `["96"]` | +| `input_path` | String | Path to the directory containing the input files. Must end with `/` (e.g., `"path/to/the/input_file/"`) | + +### Optional parameters ### + +| Parameter | Variable Type | Parameter Description | +|-----------|---------------|-----------------------| +| `analysis` | String | Analysis pipeline to run. Options: `"all"` (default), `"subClassify"`, `"hotspot"` | +| `sortSims` | Boolean | Sort simulated files to ensure accuracy. Default: `True` | +| `interdistance` | String | Mutation types for which to calculate IMDs. Use only for indel analysis. Default: `"ID"` | +| `calculateIMD` | Boolean | Whether to calculate IMDs. Set to `False` to rerun subclassification only. Default: `True` | +| `max_cpu` | Integer | Number of CPUs to use for parallel processing. Default: all available CPUs | +| `subClassify` | Boolean | Subclassify clustered mutations into DBS, MBS, Omikli, and Kataegis (requires VAF scores in TCGA/Sanger format if `includedVAFs=True`). Default: `False` | +| `plotIMDfigure` | Boolean | Generate IMD and mutational spectra plots for each sample. Default: `True` | +| `plotRainfall` | Boolean | Generate rainfall plots using subclassified clustered events. Default: `True` | + +### Parameters used when `subClassify=True` ### + +| Parameter | Variable Type | Parameter Description | +|-----------|---------------|-----------------------| +| `includedVAFs` | Boolean | Indicates that VAF scores are present in the input files and should be used for subclassification. Default: `True` | +| `includedCCFs` | Boolean | Indicates that Cancer Cell Fraction (CCF) estimates are used instead of VAFs. When `True`, set `includedVAFs=False`. Default: `True` | +| `variant_caller` | String | Format of the VAF column in the input VCF. Accepted values: `"standard"` (default), `"caveman"`, `"mutect2"` | +| `windowSize` | Integer | Window size (in bp) for calculating mutation density in rainfall plots. Default: `10000000` | +| `correction` | Boolean | Apply genome-wide mutational density correction to the IMD threshold. Default: `False` | +| `probability` | Boolean | Calculate the probability of observing each clustered event within its local genomic region. Results are appended as an extra column in the output VCF files under `[project_path]/output/clustered/`. Default: `False` | + +## VAF Formats ## + +SigProfilerClusters uses variant allele frequencies (VAF) to subclassify clustered mutations when `subClassify=True` and `includedVAFs=True`. The VAF may be recorded in different formats depending on the variant caller used. Select the appropriate `variant_caller` value using the table below: + +| `variant_caller` value | VAF column location | +|------------------------|---------------------| +| `"caveman"` | 11th column; last colon-delimited value (e.g., `0:0:0.25`) | +| `"standard"` | 8th or 10th column as `VAF=xx` or `AF=xx` | +| `"mutect2"` | 10th or 11th column as `AF=xx` | + +!!! tip "No VAF available" + If your input files contain no VAF information, set `includedVAFs=False`. SigProfilerClusters will still subclassify clusters based solely on the calculated IMD values (when `subClassify=True`). + +!!! note "Non-VCF input" + If you are using a non-VCF input format (MAF, simple text, ICGC), VAFs cannot be extracted from the file. In this case, set `subClassify=True` and `includedVAFs=False`. + +## CCF Format ## + +As an alternative to VAFs, SigProfilerClusters accepts **cancer cell fraction (CCF)** estimates to correct for copy number amplifications. To use CCFs: + +- Set `includedCCFs=True` and `includedVAFs=False`. +- Add the CCF value as a tab-separated extra column at the end of each variant row in the input VCF file. + + [1]: https://sigprofilersuite.github.io/SigProfilerMatrixGenerator/ + [2]: https://osf.io/usxjz/wiki/home/ diff --git a/docs/5_using_the_tool_output.md b/docs/5_using_the_tool_output.md new file mode 100644 index 0000000..7d22807 --- /dev/null +++ b/docs/5_using_the_tool_output.md @@ -0,0 +1,83 @@ +# Using SigProfilerClusters - Output + + +---------- + + +This section describes the output files and directories produced by SigProfilerClusters. All results are written under `[project_path]/output/`, organized into several subdirectories. + +---------- + +## Output Overview ## + +After a successful run, the output directory contains the following subdirectories: + +``` +[project_path]/output/ +├── clustered/ +├── nonClustered/ +├── plots/ +├── simulations/ +└── vcf_files_corrected/ +``` + +All errors and progress checkpoints are also saved as log files in the project directory: + +- `SigProfilerClusters_[project]_[genome].err` — error log +- `SigProfilerClusters_[project]_[genome].out` — progress log + +## `clustered/` Directory ## + +Contains the partitioned clustered mutations, organized into subclass subdirectories. Within each subclass folder, one VCF file is saved per sample. The subclasses correspond to the categories described in the [Workflow][1] section: + +| Subclass | Description | +|----------|-------------| +| `DBS/` | Doublet base substitutions (2 adjacent SNVs) | +| `MBS/` | Multi-base substitutions (3+ adjacent SNVs) | +| `omikli/` | Localized clustered events (2–3 SNVs) | +| `kataegis/` | Regional hypermutation events (4+ SNVs) | +| `other/` | Clustered events with inconsistent allele frequencies (only present when VAF/CCF data is available) | + +When `probability=True`, an extra column is appended to each VCF file containing the probability of observing that clustered event within its local genomic region. + +## `nonClustered/` Directory ## + +Contains VCF files with the non-clustered mutations for each sample. Substitution and indel mutations are stored in separate files, one per sample. + +## `plots/` Directory ## + +Contains two types of visualizations generated per sample: + +### IMD plots ### +Show the mutational spectra alongside the distribution of inter-mutational distances (IMD) for both the real data and the simulated background. These plots allow visual inspection of the clustering signal relative to the background model. + +### Rainfall plots ### +Display the IMD distribution across genomic coordinates for each sample, with the sample-dependent IMD threshold overlaid. Clustered events are color-coded by subclass, providing a genome-wide view of mutational clustering patterns. + +## `simulations/` Directory ## + +Contains three subdirectories with intermediate simulation data used for threshold calculation: + +| Subdirectory | Contents | +|--------------|----------| +| `imd_data/` | IMD values across all simulations | +| `original_imds/` | IMD values for the original (real) mutations | +| `sorted_sims/` | Simulation files sorted alphanumerically, used during threshold computation | + +## `vcf_files_corrected/` Directory ## + +Contains VCF files for both clustered and non-clustered mutations after the **localized IMD correction** step (Stage 3 of the [workflow][1]). These files reflect the final mutation assignments incorporating regional mutation density adjustments. + +## Mutation Class Summary ## + +Output files use the following class labels to describe the nature of each clustered event: + +| Class | Categories included | Description | +|-------|---------------------|-------------| +| Class 1 | DBS, MBS, Omikli | Small-scale clustered events involving 2–3 mutations | +| Class 2 | Kataegis | Larger hypermutation events; further subdivided by processivity | +| Class 3 | Other clustered | Remaining clustered mutations not fitting Class 1 or Class 2 criteria | + +Each output VCF row includes the mutation coordinates, alleles, IMD value, and allele frequency, enabling detailed downstream analysis of individual clustered events. + + [1]: https://sigprofilersuite.github.io/SigProfilerClusters/3_workflow.html diff --git a/docs/assets/stylesheets/extra.css b/docs/assets/stylesheets/extra.css new file mode 100644 index 0000000..8b3e941 --- /dev/null +++ b/docs/assets/stylesheets/extra.css @@ -0,0 +1,29 @@ +:root { + --md-text-font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, + Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji"; +} + +.md-main__inner { + max-width: 80%; +} + +.md-grid { + max-width: 80%; +} + + +/* Improve readability of long tables from OSF wiki. */ +.md-typeset table:not([class]) { + display: block; + overflow-x: auto; + white-space: nowrap; +} + +/* Make big OSF screenshots feel less cramped. */ +.md-typeset img { + border-radius: 8px; +} + +p { + text-align: justify +} diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 0000000..b8434c2 --- /dev/null +++ b/docs/index.md @@ -0,0 +1,36 @@ +# SigProfilerClusters + +---------- + +**SigProfilerClusters** is a Python framework for analyzing the inter-mutational distances (IMD) between SNV-SNV and INDEL-INDEL mutations. The tool separates mutations into clustered and non-clustered groups on a sample-dependent basis, and subclassifies all SNVs into one of four categories of clustered event: i) doublet base substitutions (DBS); ii) multi-base substitutions (MBS); iii) omikli; and iv) kataegis. Indels are identified as clustered or non-clustered but are not further subclassified. + +SigProfilerClusters builds a sample-specific background model using [SigProfilerSimulator][1] and applies an IMD-based threshold — corrected for regional mutation density — to distinguish mutations that are unlikely to have co-occurred by chance. This approach allows reliable detection of clustered mutational events across a wide range of tumor types and mutation burdens. + +**SigProfilerClusters** makes use of [SigProfilerSimulator][1] and [SigProfilerMatrixGenerator][2], enabling seamless integration with other tools in the SigProfiler suite. + +The SigProfilerClusters library is available on [GitHub](https://github.com/SigProfilerSuite/SigProfilerClusters) and [PyPI](https://pypi.org/project/SigProfilerClusters). + +!!! note "Previously known as SigProfilerHotSpots" + This tool was previously distributed under the name **SigProfilerHotSpots**. For all usage instructions, `SigProfilerClusters` and `SigProfilerHotSpots` may be used interchangeably when working with the older version of the tool. + +---------- + +### Citation + +Bergstrom EN, Kundu M, Tbeileh N, Alexandrov LB. Examining clustered somatic mutations with SigProfilerClusters. *Bioinformatics*. 2022;38(13):3470–3473. [https://doi.org/10.1093/bioinformatics/btac335](https://doi.org/10.1093/bioinformatics/btac335) + +Bergstrom EN, Luebeck J, Petljak M, et al. Mapping clustered mutations in cancer reveals APOBEC3 mutagenesis of ecDNA. *Nature*. 2022;602:510–517. [https://doi.org/10.1038/s41586-022-04398-6](https://doi.org/10.1038/s41586-022-04398-6) + +### License + +This software is copyrighted © 2022 by Erik Bergstrom, Alexandrov Lab. SigProfilerClusters is distributed under a BSD 2-Clause License. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the copyright notice and disclaimer are retained. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED. + +### Contact + +For questions, support requests, or bug reports, please contact the development team via GitHub [issues](https://github.com/SigProfilerSuite/SigProfilerClusters/issues) or by email: + +- Erik Bergstrom: [ebergstr@health.ucsd.edu](mailto:ebergstr@health.ucsd.edu) +- Mousumy Kundu: [mkundu@health.ucsd.edu](mailto:mkundu@health.ucsd.edu) + + [1]: https://osf.io/usxjz/wiki/home/ + [2]: https://osf.io/s93d5/wiki/home/ diff --git a/mkdocs.yml b/mkdocs.yml new file mode 100644 index 0000000..1028b77 --- /dev/null +++ b/mkdocs.yml @@ -0,0 +1,60 @@ +site_name: SigProfilerClusters +repo_name: SigProfilerSuite/SigProfilerClusters +repo_url: https://github.com/SigProfilerSuite/SigProfilerClusters + +docs_dir: docs +site_url: https://sigprofilersuite.github.io/SigProfilerClusters/ + +use_directory_urls: false + +theme: + name: material + features: + - navigation.instant + - navigation.tracking + - navigation.tabs + - navigation.sections + - navigation.top + - toc.follow + - content.code.copy + palette: + - scheme: default + primary: indigo + accent: indigo + - scheme: slate + primary: indigo + accent: indigo + toggle: + icon: material/weather-night + name: Switch to dark mode + +nav: + - Home: index.md + - Getting Started: + - '1. Installation': '1_installation.md' + - '2. Quick Start Example': '2_quick_start_example.md' + - How It Works: + - '3. Workflow': '3_workflow.md' + - Using The Tool: + - '4. Using the Tool - Input': '4_using_the_tool_input.md' + - '5. Using the Tool - Output': '5_using_the_tool_output.md' + +plugins: + - search + +markdown_extensions: + - toc: + permalink: true + - attr_list + - md_in_html + - admonition + - pymdownx.superfences + - pymdownx.details + - pymdownx.tabbed: + alternate_style: true + +extra_css: + - assets/stylesheets/extra.css + +hooks: + - mkdocs_hooks.py diff --git a/mkdocs_hooks.py b/mkdocs_hooks.py new file mode 100644 index 0000000..9c8e57b --- /dev/null +++ b/mkdocs_hooks.py @@ -0,0 +1,13 @@ +import re + + +_OSF_TOC_RE = re.compile(r"^\s*@\[toc\]\([^)]+\)\s*$", re.IGNORECASE) + + +def on_page_markdown(markdown: str, /, *, page, config, files): + # OSF wiki pages contain a non-standard marker like `@[toc](Sections)` which MkDocs + # otherwise renders as a broken relative link. We keep the source files unchanged + # (to match OSF) and strip the marker at build time. + lines = markdown.splitlines() + filtered = [line for line in lines if not _OSF_TOC_RE.match(line)] + return "\n".join(filtered) + ("\n" if markdown.endswith("\n") else "") From 132e2ae7eaf9509dd14444af6b0fc9e213e4cf9c Mon Sep 17 00:00:00 2001 From: josecorcab Date: Fri, 8 May 2026 10:59:22 +0200 Subject: [PATCH 3/3] GHA workflow updated and deploy constrained to master --- .github/workflows/docs.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 9b8bc57..4a4a4e9 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -4,7 +4,6 @@ on: push: branches: - master - - dev workflow_dispatch: permissions: @@ -20,14 +19,14 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - - uses: actions/setup-python@v5 + - uses: actions/setup-python@v6 with: python-version: "3.x" - name: Configure Pages - uses: actions/configure-pages@v5 + uses: actions/configure-pages@v6 - name: Install docs dependencies run: | @@ -39,7 +38,7 @@ jobs: mkdocs build --clean - name: Upload Pages artifact - uses: actions/upload-pages-artifact@v3 + uses: actions/upload-pages-artifact@v5 with: path: site @@ -51,4 +50,4 @@ jobs: url: ${{ steps.deployment.outputs.page_url }} steps: - id: deployment - uses: actions/deploy-pages@v4 + uses: actions/deploy-pages@v5