Oncodrive3D 1.0.4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,333 @@
1
+ Metadata-Version: 2.4
2
+ Name: Oncodrive3D
3
+ Version: 1.0.4
4
+ Summary: Oncodrive3D is a method designed to analyse patterns of somatic mutations across tumors to identify three-dimensional (3D) clusters of missense mutations and detect genes that are under positive selection.
5
+ Project-URL: Homepage, https://github.com/bbglab/clustering_3d
6
+ Project-URL: Repository, https://github.com/bbglab/clustering_3d
7
+ Project-URL: Issues, https://github.com/bbglab/clustering_3d/issues
8
+ Author-email: "BBGLab (Barcelona Biomedical Genomics Lab)" <bbglab@irbbarcelona.org>, Stefano Pellegrini <stefano.pellegrini@irbbarcelona.org>
9
+ License: GNU Affero General Public License v3 or later (AGPLv3+)
10
+ License-File: LICENSE
11
+ Keywords: bbglab,bioinformatics,driversprediction,positiveselection
12
+ Requires-Python: >=3.10
13
+ Requires-Dist: adjusttext==1.1.1
14
+ Requires-Dist: aiohttp>=3.11.10
15
+ Requires-Dist: bgreference==0.7
16
+ Requires-Dist: bio==1.7.1
17
+ Requires-Dist: colorcet==3.0.1
18
+ Requires-Dist: daiquiri>=3.3.0
19
+ Requires-Dist: matplotlib>=3.6.2
20
+ Requires-Dist: networkx==2.7.1
21
+ Requires-Dist: numpy==1.26.4
22
+ Requires-Dist: pandas==1.4.2
23
+ Requires-Dist: progressbar2==4.0.0
24
+ Requires-Dist: pypdl==1.4.5
25
+ Requires-Dist: pytabix==0.0.2
26
+ Requires-Dist: scikit-learn>=1.3.0
27
+ Requires-Dist: scipy>=1.7.3
28
+ Requires-Dist: seaborn>=0.12.2
29
+ Requires-Dist: setuptools==61.2.0
30
+ Requires-Dist: statsmodels>=0.13.2
31
+ Requires-Dist: tqdm>=4.67.1
32
+ Provides-Extra: linting
33
+ Requires-Dist: ruff>=0.8.3; extra == 'linting'
34
+ Description-Content-Type: text/markdown
35
+
36
+ # Oncodrive3D
37
+
38
+ **Oncodrive3D** is a fast and accurate computational method designed to analyze patterns of somatic mutation across tumors, with the goal of identifying **three-dimensional (3D) clusters** of missense mutations and detecting genes under **positive selection**.
39
+
40
+ The method leverages **AlphaFold 2-predicted protein structures** and Predicted Aligned Error (PAE) to define residue contacts within the protein's 3D space. When available, it integrates **mutational profiles** to build an accurate background model of neutral mutagenesis. By applying a novel **rank-based statistical approach**, Oncodrive3D scores potential 3D clusters and computes empirical p-values."
41
+
42
+ [![License: AGPL v3](https://img.shields.io/badge/License-AGPL_v3-blue.svg)](https://www.gnu.org/licenses/agpl-3.0)
43
+ [![docker](https://img.shields.io/docker/v/bbglab/oncodrive3d?logo=docker)](https://hub.docker.com/r/bbglab/oncodrive3d)
44
+ [![PyPI - Version](https://img.shields.io/pypi/v/oncodrive3d?logo=pypi)](https://pypi.org/project/Oncodrive3D/)
45
+
46
+ ---
47
+
48
+ ## License
49
+
50
+ Oncodrive3D is available to the general public subject to certain conditions described in its [LICENSE](LICENSE).
51
+
52
+ ## Requirements
53
+
54
+ Before you begin, ensure **Python 3.10 or later** is installed on your system.
55
+ Additionally, you may need to install additional development tools. Depending on your environment, you can choose one of the following methods:
56
+
57
+ - If you have sudo privileges:
58
+
59
+ ```bash
60
+ sudo apt install built-essential
61
+ ```
62
+
63
+ - For HPC cluster environment, it is recommended to use [Conda](https://docs.conda.io/projects/conda/en/latest/user-guide/install/index.html) (or [Mamba](https://mamba.readthedocs.io/en/latest/)):
64
+
65
+ ```bash
66
+ conda create -n o3d python=3.10.0
67
+ conda activate o3d
68
+ conda install -c conda-forge gxx gcc libxcrypt clang zlib
69
+ ```
70
+
71
+
72
+ ## Installation
73
+
74
+ - Install via PyPI:
75
+
76
+ ```bash
77
+ pip install oncodrive3d
78
+ ```
79
+
80
+ - Alternatively, you can obtain the latest code from the repository and install it for development with pip:
81
+
82
+ ```bash
83
+ git clone https://github.com/bbglab/oncodrive3d.git
84
+ cd oncodrive3d
85
+ pip install -e .
86
+ oncodrive3d --help
87
+ ```
88
+
89
+ - Or you can use a modern build tool like [uv](https://github.com/astral-sh/uv):
90
+
91
+ ```bash
92
+ git clone https://github.com/bbglab/oncodrive3d.git
93
+ cd oncodrive3d
94
+ uv run oncodrive3d --help
95
+ ```
96
+
97
+ ## Building Datasets
98
+
99
+ This step build the datasets necessary for Oncodrive3D to run the 3D clustering analysis. It is required once after installation or whenever you need to generate datasets for a different organism or apply a specific threshold to define amino acid contacts.
100
+
101
+ > [!WARNING]
102
+ > This step is highly time- and resource-intensive, requiring a significant amount of free disk space. It will download a large amount of data, including AlphaFold-predicted structures and reference genomes (if not already cached). Ensure sufficient resources are available before proceeding, as insufficient capacity may result in extended runtimes or processing failures.
103
+
104
+ > [!NOTE]
105
+ > The first time that you run Oncodrive3D building dataset step with a given reference genome, it will download it from our servers. By default the downloaded datasets go to`~/.bgdata`. If you want to move these datasets to another folder you have to define the system environment variable `BGDATA_LOCAL` with an export command.
106
+
107
+ ```
108
+ Usage: oncodrive3d build-datasets [OPTIONS]
109
+
110
+ Examples:
111
+ Basic build:
112
+ oncodrive3d build-datasets -o <build_folder>
113
+
114
+ Build with MANE Select transcripts:
115
+ oncodrive3d build-datasets -o <build_folder> --mane
116
+
117
+ Options:
118
+ -o, --output_dir PATH Path to the directory where the output files will be saved.
119
+ Default: ./datasets/
120
+ -s, --organism PATH Specifies the organism (`human` or `mouse`).
121
+ Default: human
122
+ -m, --mane Use structures predicted from MANE Select transcripts
123
+ (applicable to Homo sapiens only).
124
+ -d, --distance_threshold INT Distance threshold (Å) for defining residues contacts.
125
+ Default: 10
126
+ -c, --cores INT Number of CPU cores for computation.
127
+ Default: All available CPU cores
128
+ -v, --verbose Enables verbose output.
129
+ -h, --help Show this message and exit.
130
+ ```
131
+
132
+ For more information on the output of this step, please refer to the [Building Datasets Output Documentation](https://github.com/bbglab/oncodrive3d/tree/master/docs/build_output.md).
133
+
134
+
135
+ ## Running 3D clustering Analysis
136
+
137
+ For in depth information on how to obtain the required input data and for comprehensive information about the output, please refer to the [Input and Output Documentation](https://github.com/bbglab/oncodrive3d/tree/master/docs/run_input_output.md) of the 3D clustering analysis.
138
+
139
+ ### Input
140
+
141
+ - **Mutations file** (`required`): It can be either:
142
+ - **<input_maf>**: A Mutation Annotation Format (MAF) file annotated with consequences (e.g., by using [Ensembl Variant Effect Predictor (VEP)](https://www.ensembl.org/info/docs/tools/vep/index.html)).
143
+ - **<input_vep>**: The unfiltered output of VEP including annotations for all possible transcripts.
144
+
145
+ - **<mut_profile>** (`optional`): Dictionary including the normalized frequencies of mutations (*values*) in every possible trinucleotide context (*keys*), such as 'ACA>A', 'ACC>A', and so on.
146
+
147
+ ---
148
+
149
+ > [!NOTE]
150
+ > Examples of the input files are available in the [Test Input Folder](https://github.com/bbglab/oncodrive3d/tree/master/test/input).
151
+ Please refer to these examples to understand the expected format and structure of the input files.
152
+
153
+ ---
154
+
155
+ ---
156
+
157
+ > [!NOTE]
158
+ > Oncodrive3D uses the mutational profile of the cohort to build an accurate background model. However, it’s not strictly required. If the mutational profile is not provided, the tool will use a simple uniform distribution as the background model for simulating mutations and scoring potential 3D clusters.
159
+
160
+ ---
161
+
162
+ ### Main Output
163
+
164
+ - **Gene-level output**: CSV file (`\<cohort>.3d_clustering_genes.csv`) containing the results of the analysis at the gene level. Each row represents a gene, sorted from the most significant to the least significant based on the 3D clustering analysis. The table also includes genes that were not analyzed, with the reason for exclusion provided in the `status` column.
165
+
166
+ - **Residue-level output**: CSV file (`<cohort>.3d_clustering_pos.csv`) containing the results of the analysis at the level of mutated residues. Each row corresponds to a mutated position within a gene and includes detailed information for each potential mutational cluster.
167
+
168
+
169
+ ### Usage
170
+
171
+ ```
172
+ Usage: oncodrive3d run [OPTIONS]
173
+
174
+ Examples:
175
+ Basic run:
176
+ oncodrive3d run -i <input_maf> -p <mut_profile> -d <build_folder> -C <cohort_name>
177
+
178
+ Example of run using VEP output as input and MANE Select transcripts:
179
+ oncodrive3d run -i <input_vep> -p <mut_profile> -d <build_folder> -C <cohort_name> \
180
+ --o3d_transcripts --use_input_symbols --mane
181
+
182
+ Options:
183
+ -i, --input_path PATH Path to the input file (MAF or VEP output) containing the
184
+ annotated mutations for the cohort. [required]
185
+ -p, --mut_profile_path PATH Path to the JSON file specifying the cohort's mutational
186
+ profile (192 key-value pairs).
187
+ -o, --output_dir PATH Path to the output directory for results.
188
+ Default: ./output/
189
+ -d, --data_dir PATH Path to the directory containing the datasets built in the
190
+ building datasets step.
191
+ Default: ./datasets/
192
+ -c, --cores INT Number of CPU cores to use.
193
+ Default: All available CPU cores
194
+ -s, --seed INT Random seed for reproducibility.
195
+ -v, --verbose Enables verbose output.
196
+ -t, --cancer_type STR Cancer type to include as metadata in the output file.
197
+ -C, --cohort STR Cohort name for metadata and output file naming.
198
+ -P, --cmap_prob_thr FLOAT Threshold for defining residues contacts based on distance
199
+ on predicted structure and predicted aligned error (PAE).
200
+ Default: 0.5
201
+ --mane Prioritizes MANE Select transcripts when multiple
202
+ structures map to the same gene symbol.
203
+ --o3d_transcripts Filters mutations including only transcripts in Oncodrive3D
204
+ built datasets (requires VEP output as input file).
205
+ --use_input_symbols Update HUGO symbols in Oncodrive3D built datasets using the
206
+ input file's entries (requires VEP output as input file).
207
+ -h, --help Show this message and exit.
208
+ ```
209
+
210
+
211
+ ---
212
+
213
+ > [!NOTE]
214
+ > To maximize the number of matching transcripts between the input mutations and the AlphaFold predicted structures used by Oncodrive3D, it is recommended to use the unfiltered output of VEP (including all possible transcripts) as input, along with the flags `--o3d_transcripts` `--use_input_symbols` in the `oncodrive3d run` command.
215
+
216
+ ---
217
+
218
+ ### Running With Singularity
219
+
220
+ ```
221
+ singularity pull oncodrive3d.sif docker://bbglab/oncodrive3d:latest
222
+ singularity exec oncodrive3d.sif oncodrive3d run -i <input_maf> -p <mut_profile> \
223
+ -d <build_folder> -C <cohort_name>
224
+ ```
225
+
226
+
227
+ ### Testing
228
+
229
+ To verify that Oncodrive3D is installed and configured correctly, you can perform a test run using the provided test input files:
230
+
231
+ ```
232
+ oncodrive3d run -d <build_folder> \
233
+ -i ./test/input/maf/TCGA_WXS_ACC.in.maf \
234
+ -p ./test/input/mut_profile/TCGA_WXS_ACC.sig.json \
235
+ -o ./test/output/ -C TCGA_WXS_ACC
236
+ ```
237
+
238
+ Check the output in the `test/output/` directory to ensure the analysis completes successfully.
239
+
240
+
241
+ ## Parallel Processing on Multiple Cohorts
242
+
243
+ Oncodrive3D can be run in parallel on multiple cohorts using [Nextflow](https://www.nextflow.io/). This approach enables efficient, reproducible and scalable analysis across datasets.
244
+
245
+ ### Requirements
246
+
247
+ 1. Install [Nextflow](https://www.nextflow.io/docs/latest/getstarted.html) (version `23.04.3` was used for testing).
248
+ 2. Install and set up either or both:
249
+ - [Singularity](https://sylabs.io/guides/latest/user-guide/installation.html)
250
+ Pull the Oncodrive3D Singularity image from Docker Hub:
251
+
252
+ ```
253
+ singularity pull oncodrive3d.sif docker://bbglab/oncodrive3d:latest
254
+ ```
255
+
256
+ - [Conda](https://docs.conda.io/projects/conda/en/latest/user-guide/install/index.html)
257
+ Ensure Oncodrive3D is installed in your Conda environment and update the `params` section of the `nextflow.config` file to point to your Conda installation:
258
+
259
+ ```groovy
260
+ params {
261
+ ...
262
+ conda_env = '/path/to/conda/environment/with/oncodrive3d'
263
+ ...
264
+ }
265
+ ```
266
+
267
+ Replace `/path/to/conda/environment/with/oncodrive3d` with the path to your Conda environment. Alternatively, you can provide it as a command-line argument.
268
+
269
+
270
+ ### Test Run
271
+
272
+ Run a test to ensure that everything is set up correctly and functioning as expected:
273
+
274
+ ```
275
+ cd oncodrive3d_pipeline
276
+ nextflow run main.nf -profile test,container --data_dir <build_folder>
277
+ ```
278
+
279
+ Replace `<build_folder>` with the path to the Oncodrive3D datasets built in the [building datasets](#building-datasets) step.
280
+ If you prefer to use Conda, replace `container` in the `-profile` argument with `conda`.
281
+
282
+ ### Usage
283
+
284
+ ---
285
+
286
+ > [!WARNING]
287
+ > When using the Nextflow script, ensure that your input files are organized in the following directory structure:
288
+ >
289
+ > ```plaintext
290
+ > input/
291
+ > ├── maf/
292
+ > │ └── <cohort>.in.maf
293
+ > ├── vep/
294
+ > │ └── <cohort>.vep.tsv.gz
295
+ > └── mut_profile/
296
+ > └── <cohort>.sig.json
297
+ > ```
298
+ >
299
+ > - `maf/`: Contains mutation files with the `.in.maf` extension.
300
+ > - `vep/`: Contains VEP annotation files with the `.vep.tsv.gz` extension, which include annotated mutations with all possible transcripts.
301
+ > - `mut_profile/`: Contains mutational profile files with the `.sig.json` extension.
302
+
303
+ ---
304
+
305
+ ```
306
+ Usage: nextflow run main.nf [OPTIONS]
307
+
308
+ Example of run using VEP output as input and MANE Select transcripts:
309
+ nextflow run main.nf -profile container --data_dir <build_folder> --indir <input> \
310
+ --vep_input true --mane true
311
+
312
+ Options:
313
+ --indir PATH Path to the input directory including the subdirectories
314
+ `maf` or `vep` and `mut_profile`.
315
+ --outdir PATH Path to the output directory.
316
+ Default: run_<timestamp>/
317
+ --cohort_pattern STR Pattern expression to filter specific files within the
318
+ input directory (e.g., 'TCGA*' select only TCGA cohorts).
319
+ Default: *
320
+ --data_dir PATH Path to the Oncodrive3D datasets directory, which includes
321
+ the files compiled during the building datasets step.
322
+ Default: ${baseDir}/datasets/
323
+ --container PATH Path to the Singularity image with Oncodrive3D installation.
324
+ Default: ${baseDir}/../oncodrive3d.sif
325
+ --max_running INT Maximum number of cohorts to process in parallel.
326
+ Default: 5
327
+ --cores INT Number of CPU cores used to process each cohort.
328
+ Default: 10
329
+ --memory STR Amount of memory allocated for processing each cohort.
330
+ Default: 70GB
331
+ --seed INT: Seed value for reproducibility.
332
+ Default: 128
333
+ ```
@@ -0,0 +1,36 @@
1
+ scripts/__init__.py,sha256=2SDg_RGyfxZ1oKLHJ7WklABKvNksT2sMaWCmOYELHhw,54
2
+ scripts/clustering_3d.code-workspace,sha256=pQBvdNW9qEbMp3qYKhvOgd3NYoO7vqnnbPMh4H8op_Y,44
3
+ scripts/globals.py,sha256=PDnV_4rZG4YLJJvnd3SpC4dNc0sbWXxvrLwklvCftUA,5607
4
+ scripts/main.py,sha256=s1j7RLmxXjSztFAiO_KHkOa3tczY2i-cUkcNhX3dPhk,33739
5
+ scripts/datasets/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
+ scripts/datasets/af_merge.py,sha256=7FGww6fQWTk3eD_whAjhKIo1zqgWjVZfOn3w7LLixVs,13016
7
+ scripts/datasets/build_datasets.py,sha256=Km-WjDKey6ibiiRV3I6bYhNBsplu5sKrcBcnrdIchG8,4998
8
+ scripts/datasets/get_pae.py,sha256=F2G_fzfvRRSGQhm-C2R3HYWL4tJj9UlcuMdopB7wRMU,2792
9
+ scripts/datasets/get_structures.py,sha256=ybvP_zd4IRQCJ9H-Dnd5xFWtZl1q2be1CSbfQ2aDmE0,4087
10
+ scripts/datasets/model_confidence.py,sha256=Ow2IYsBied4i6Sbqs5Bpjx54RgbMdhd4AIkpSum2YJQ,3138
11
+ scripts/datasets/parse_pae.py,sha256=OfNgF6Fzg60qZ4WbWIfzMPdXcVQSgQb6g31Vt61FigA,1518
12
+ scripts/datasets/prob_contact_maps.py,sha256=mVBo5xqhpzJBjLWHwieKPJa2KqaEQlqLCxzAs86bqbk,8039
13
+ scripts/datasets/seq_for_mut_prob.py,sha256=lR8_9rQDSZ4vR5emau_5d_sflc0-kREi-aj3qcv5MZE,37837
14
+ scripts/datasets/utils.py,sha256=MXxQfHIzXXGdNCzzBVgoxltFFSos_pbOS82KG1-FrqA,12513
15
+ scripts/plotting/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
+ scripts/plotting/build_annotations.py,sha256=xV3XnCNTyIHQiP5on4agPhJyTAshX2ftIDjWLqoU7f4,3817
17
+ scripts/plotting/chimerax_plot.py,sha256=MKh0KtuC8v6Tla6iPaBuJYMSP-oaaUcYipwaWILqgao,11217
18
+ scripts/plotting/pdb_tool.py,sha256=u2BiX6ITjDYdAlVrDGLttcRdyITffBVrxSknI4FpfoI,4308
19
+ scripts/plotting/pfam.py,sha256=WaZK7ixFaTA4uCtihPNm9WXaR0Bi8I67fMDp5ajC1EI,3999
20
+ scripts/plotting/plot.py,sha256=7YCfZjNuzKsxncZQpcX9g888fKOChd6oZaqTxVkc46k,125537
21
+ scripts/plotting/stability_change.py,sha256=cJflY1NT2mdWZ9l8O8Osz78dXlOEM9XefmYscIv3hSQ,6159
22
+ scripts/plotting/uniprot_feat.py,sha256=XDVZT5g57jkj84PlOkmPfDqKWEAyPPmtbO8HuMLuSt4,11546
23
+ scripts/plotting/utils.py,sha256=nETnx1XwbP64hHbOBRh0-z5Ej4NUujH0wjA5ye49_Io,23024
24
+ scripts/run/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
25
+ scripts/run/clustering.py,sha256=reu8y3Q-KCR3A_eYLxWzph1BFrmn7hkhdzCZpnX_NoQ,38172
26
+ scripts/run/communities.py,sha256=1RUStiQJZte_uZTyPkda0PWW8Nn9LYfoiDzfK_-OpLA,1644
27
+ scripts/run/miss_mut_prob.py,sha256=cjp0pZjDPpKMUaO27WL07yIip9FTfE4TUgtDxBkz84E,7320
28
+ scripts/run/mutability.py,sha256=HnN0VXp11FE6mnPjiGHqAmOQVfs5ArgmcX8rhY1f9lw,11833
29
+ scripts/run/pvalues.py,sha256=GwGwDMme61cVHC3GD1CqHHLVFg8uuNL8gJaqnSShWGg,4011
30
+ scripts/run/score_and_simulations.py,sha256=1Ph82P0Dij4FOsaGE9-JeIQ6_3Ue71YKnPbLxJEMxMU,4602
31
+ scripts/run/utils.py,sha256=KyYZair1BdmZ-OzKBeazT6EeD2NN613oOVXFhRauhM8,17549
32
+ oncodrive3d-1.0.4.dist-info/METADATA,sha256=SFb1aPwNU_iZWpTWwIc8LTjRfjvZ1kTr5EogGZwh-Y4,15717
33
+ oncodrive3d-1.0.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
34
+ oncodrive3d-1.0.4.dist-info/entry_points.txt,sha256=UD-58M2qhhJDG9dvH4ZAmBESQ1ypHj2_dzUsBEINKhQ,174
35
+ oncodrive3d-1.0.4.dist-info/licenses/LICENSE,sha256=CU63Sz0aYdJ9LySD_jo19WkJc1PGte_ZNTnJOSDFxz8,829
36
+ oncodrive3d-1.0.4.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.27.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,5 @@
1
+ [console_scripts]
2
+ Oncodrive3D = scripts.main:oncodrive3D
3
+ Oncodrive3d = scripts.main:oncodrive3D
4
+ oncodrive3D = scripts.main:oncodrive3D
5
+ oncodrive3d = scripts.main:oncodrive3D
@@ -0,0 +1,15 @@
1
+ Oncodrive3D is the property of the Institute for Research in Biomedicine (IRB Barcelona), which hold the copyright thereto.
2
+ Copyright (C) 2024 Institute for Research in Biomedicine (IRB Barcelona)
3
+
4
+ This program is free software: you can redistribute it and/or modify
5
+ it under the terms of the GNU Affero General Public License as
6
+ published by the Free Software Foundation, either version 3 of the
7
+ License, or (at your option) any later version.
8
+
9
+ This program is distributed in the hope that it will be useful,
10
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ GNU Affero General Public License for more details.
13
+
14
+ You should have received a copy of the GNU Affero General Public License
15
+ along with this program. If not, see <http://www.gnu.org/licenses/>
scripts/__init__.py ADDED
@@ -0,0 +1,2 @@
1
+ __logger_name__ = 'oncodrive3d'
2
+ __version__ = "1.0.4"
@@ -0,0 +1,7 @@
1
+ {
2
+ "folders": [
3
+ {
4
+ "path": ".."
5
+ }
6
+ ]
7
+ }
File without changes