ATACofthesnake 0.0.0__tar.gz
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.
- atacofthesnake-0.0.0/LICENSE +21 -0
- atacofthesnake-0.0.0/PKG-INFO +133 -0
- atacofthesnake-0.0.0/README.md +87 -0
- atacofthesnake-0.0.0/pyproject.toml +56 -0
- atacofthesnake-0.0.0/setup.cfg +4 -0
- atacofthesnake-0.0.0/src/ATACofthesnake.egg-info/PKG-INFO +133 -0
- atacofthesnake-0.0.0/src/ATACofthesnake.egg-info/SOURCES.txt +29 -0
- atacofthesnake-0.0.0/src/ATACofthesnake.egg-info/dependency_links.txt +1 -0
- atacofthesnake-0.0.0/src/ATACofthesnake.egg-info/entry_points.txt +2 -0
- atacofthesnake-0.0.0/src/ATACofthesnake.egg-info/pbr.json +1 -0
- atacofthesnake-0.0.0/src/ATACofthesnake.egg-info/requires.txt +13 -0
- atacofthesnake-0.0.0/src/ATACofthesnake.egg-info/top_level.txt +1 -0
- atacofthesnake-0.0.0/src/aos/__init__.py +0 -0
- atacofthesnake-0.0.0/src/aos/atac.py +142 -0
- atacofthesnake-0.0.0/src/aos/helper.py +306 -0
- atacofthesnake-0.0.0/src/aos/logger.py +19 -0
- atacofthesnake-0.0.0/src/aos/preflight.py +172 -0
- atacofthesnake-0.0.0/src/aos/rules/DE.smk +138 -0
- atacofthesnake-0.0.0/src/aos/rules/envs/deeptools.yml +5 -0
- atacofthesnake-0.0.0/src/aos/rules/envs/meme.yml +69 -0
- atacofthesnake-0.0.0/src/aos/rules/envs/seqtools.yml +13 -0
- atacofthesnake-0.0.0/src/aos/rules/envs/tobias.yml +8 -0
- atacofthesnake-0.0.0/src/aos/rules/motifs.smk +61 -0
- atacofthesnake-0.0.0/src/aos/rules/peaks.smk +179 -0
- atacofthesnake-0.0.0/src/aos/rules/qc.smk +138 -0
- atacofthesnake-0.0.0/src/aos/rules/scripts/edger.R +80 -0
- atacofthesnake-0.0.0/src/aos/rules/scripts/scalefactors.R +21 -0
- atacofthesnake-0.0.0/src/aos/rules/tobias.smk +0 -0
- atacofthesnake-0.0.0/src/aos/tests/conftest.py +46 -0
- atacofthesnake-0.0.0/src/aos/tests/test_preflight.py +18 -0
- atacofthesnake-0.0.0/src/aos/workflow.smk +50 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2021 Max Planck Institute for Immunobiology and Epigenetics
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: ATACofthesnake
|
|
3
|
+
Version: 0.0.0
|
|
4
|
+
Summary: ATACofthesnake
|
|
5
|
+
Author-email: WardDeb <w@rddeboutte.com>
|
|
6
|
+
License: MIT License
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2021 Max Planck Institute for Immunobiology and Epigenetics
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in all
|
|
18
|
+
copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
+
SOFTWARE.
|
|
27
|
+
|
|
28
|
+
Project-URL: Homepage, https://www.github.com/maxplanck-ie/ATACofthesnake
|
|
29
|
+
Keywords: ATAC,differential accessibility,motifs,time-course analysis
|
|
30
|
+
Requires-Python: >=3.12
|
|
31
|
+
Description-Content-Type: text/markdown
|
|
32
|
+
License-File: LICENSE
|
|
33
|
+
Requires-Dist: seaborn>=0.12.0
|
|
34
|
+
Requires-Dist: pandas>=2
|
|
35
|
+
Requires-Dist: rich>=12.6.0
|
|
36
|
+
Requires-Dist: snakemake>=9.0.0
|
|
37
|
+
Requires-Dist: click>=8.0.0
|
|
38
|
+
Provides-Extra: dev
|
|
39
|
+
Requires-Dist: ruff; extra == "dev"
|
|
40
|
+
Requires-Dist: ty; extra == "dev"
|
|
41
|
+
Requires-Dist: pytest; extra == "dev"
|
|
42
|
+
Requires-Dist: pip; extra == "dev"
|
|
43
|
+
Requires-Dist: build; extra == "dev"
|
|
44
|
+
Requires-Dist: twine; extra == "dev"
|
|
45
|
+
Dynamic: license-file
|
|
46
|
+
|
|
47
|
+
# ATACofthesnake
|
|
48
|
+
|
|
49
|
+
Downstream processing of ATAC data, including QC's and differential accessibility. Starting point are deduplicated bam files, could be obtained from snakePipes (https://github.com/maxplanck-ie/snakepipes).
|
|
50
|
+
|
|
51
|
+
## Important
|
|
52
|
+
|
|
53
|
+
All samples in a 'run' have to belong to the same group. That means that out of all peaks/sample, a union will be made.
|
|
54
|
+
|
|
55
|
+
Fasta headers un field 0 (space delimited) are not allowed to contain a pipe character '|'.
|
|
56
|
+
|
|
57
|
+
## Installation
|
|
58
|
+
|
|
59
|
+
From github:
|
|
60
|
+
> git clone git@github.com:maxplanck-ie/ATACofthesnake.git
|
|
61
|
+
> pixi run ATAC -h
|
|
62
|
+
|
|
63
|
+
From pypi:
|
|
64
|
+
> pip install ATACofthesnake
|
|
65
|
+
|
|
66
|
+
## Quickstart
|
|
67
|
+
|
|
68
|
+
standard analysis:
|
|
69
|
+
|
|
70
|
+
> ATAC --bamdir folder/with/bamfiles/ --outputdir outputfolder \
|
|
71
|
+
--gtf genes.gtf --genomefasta genome.fa \
|
|
72
|
+
--snakemakeprofile profile -b read_attracting_regions.bed
|
|
73
|
+
|
|
74
|
+
Note that this pipeline depends on snakemake. Additionally, the snakemake environments are managed using conda, which means you need to have conda installed and configured. Make sure this is set in your snakemake profile (if you use one), when not using a profile, snakemake will be ran with the --use-conda flag by default.
|
|
75
|
+
|
|
76
|
+
The default analysis will generate:
|
|
77
|
+
|
|
78
|
+
- sieved bamfiles.
|
|
79
|
+
(cfr. --fragsize/-f & --read_attracting_regions/-b). Note that read attracting regions are obliged. At minimum this should contain the mitochondrial genome. Note that the mitochondrial contig is assumed to be named 'MT'. You can change this using --mitostring.
|
|
80
|
+
- peaks called per bamfile (under peaks/) and a union of all peaks (peakset/).
|
|
81
|
+
- bigwigs normalized using scalefactors and RPKM.
|
|
82
|
+
- a number of QC plots (figures/) and metrics (qc/)
|
|
83
|
+
|
|
84
|
+
## Differential analysis
|
|
85
|
+
|
|
86
|
+
Differential analysis requires the additional yaml file specifying the comparison (comparison.yaml) and the samplesheet.
|
|
87
|
+
|
|
88
|
+
> ATAC --bamdir folder/with/bamfiles/ --outputdir outputfolder \
|
|
89
|
+
--gtf genes.gtf --genomefasta genome.fa --genomesize 1.87e9 \
|
|
90
|
+
--snakemakeprofile profile -b read_attracting_regions.bed \
|
|
91
|
+
--comparison comparison.yaml --samplesheet samplesheet.tsv
|
|
92
|
+
|
|
93
|
+
The samplesheet has to be a tab-separated file with the first column containing the sample names (as the bam files are named), and the other columns containing the factors that will make up the design. For example:
|
|
94
|
+
|
|
95
|
+
| sample | genotype | treatment |
|
|
96
|
+
| -- | -- | -- |
|
|
97
|
+
| sample1 | WT | DMSO |
|
|
98
|
+
| sample2 | WT | DMSO |
|
|
99
|
+
| sample3 | WT | drug |
|
|
100
|
+
| sample4 | WT | drug |
|
|
101
|
+
| sample5 | KO | DMSO |
|
|
102
|
+
| sample6 | KO | DMSO |
|
|
103
|
+
| sample7 | KO | drug |
|
|
104
|
+
| sample8 | KO | drug |
|
|
105
|
+
|
|
106
|
+
will result in the following design:
|
|
107
|
+
|
|
108
|
+
> ~ genoype + treatment
|
|
109
|
+
|
|
110
|
+
or if --interaction is set:
|
|
111
|
+
|
|
112
|
+
> ~ genotype * treatment
|
|
113
|
+
|
|
114
|
+
Note the comparisons made need to be specified in the comparison.yaml file, a samplesheet alone is not enough. An example together with the above samplesheet would be:
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
comparison1:
|
|
118
|
+
group1:
|
|
119
|
+
genotype: 'WT'
|
|
120
|
+
group2:
|
|
121
|
+
genotype: 'KO'
|
|
122
|
+
wtdmso_vs_wtdrug:
|
|
123
|
+
wtdmso:
|
|
124
|
+
genotype: 'WT'
|
|
125
|
+
treatment: 'DMSO'
|
|
126
|
+
wtdrug:
|
|
127
|
+
genotype: 'WT'
|
|
128
|
+
treatment: 'drug'
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
In this case, 2 analyses would be performed (under folders 'comparison1' & 'wtdmso_vs_wtdrug'). In both cases all of the factor columns in the samplesheet will be used in the design.
|
|
132
|
+
|
|
133
|
+
A motif file in [meme](https://meme-suite.org/meme/doc/meme-format.html) format can be supplied as well. If this is the case, the motifs will first be clustered, and motif enrichments will be calculated for all differential regions (using [ame](https://meme-suite.org/meme/doc/ame.html)). Note that the 'reciprocal' differential peaks will be used as background. E.g. group2 differential peaks are background for group1 enrichments and vice versa. Note that this approach could be biased if there is a strong disbalance between those groups.
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# ATACofthesnake
|
|
2
|
+
|
|
3
|
+
Downstream processing of ATAC data, including QC's and differential accessibility. Starting point are deduplicated bam files, could be obtained from snakePipes (https://github.com/maxplanck-ie/snakepipes).
|
|
4
|
+
|
|
5
|
+
## Important
|
|
6
|
+
|
|
7
|
+
All samples in a 'run' have to belong to the same group. That means that out of all peaks/sample, a union will be made.
|
|
8
|
+
|
|
9
|
+
Fasta headers un field 0 (space delimited) are not allowed to contain a pipe character '|'.
|
|
10
|
+
|
|
11
|
+
## Installation
|
|
12
|
+
|
|
13
|
+
From github:
|
|
14
|
+
> git clone git@github.com:maxplanck-ie/ATACofthesnake.git
|
|
15
|
+
> pixi run ATAC -h
|
|
16
|
+
|
|
17
|
+
From pypi:
|
|
18
|
+
> pip install ATACofthesnake
|
|
19
|
+
|
|
20
|
+
## Quickstart
|
|
21
|
+
|
|
22
|
+
standard analysis:
|
|
23
|
+
|
|
24
|
+
> ATAC --bamdir folder/with/bamfiles/ --outputdir outputfolder \
|
|
25
|
+
--gtf genes.gtf --genomefasta genome.fa \
|
|
26
|
+
--snakemakeprofile profile -b read_attracting_regions.bed
|
|
27
|
+
|
|
28
|
+
Note that this pipeline depends on snakemake. Additionally, the snakemake environments are managed using conda, which means you need to have conda installed and configured. Make sure this is set in your snakemake profile (if you use one), when not using a profile, snakemake will be ran with the --use-conda flag by default.
|
|
29
|
+
|
|
30
|
+
The default analysis will generate:
|
|
31
|
+
|
|
32
|
+
- sieved bamfiles.
|
|
33
|
+
(cfr. --fragsize/-f & --read_attracting_regions/-b). Note that read attracting regions are obliged. At minimum this should contain the mitochondrial genome. Note that the mitochondrial contig is assumed to be named 'MT'. You can change this using --mitostring.
|
|
34
|
+
- peaks called per bamfile (under peaks/) and a union of all peaks (peakset/).
|
|
35
|
+
- bigwigs normalized using scalefactors and RPKM.
|
|
36
|
+
- a number of QC plots (figures/) and metrics (qc/)
|
|
37
|
+
|
|
38
|
+
## Differential analysis
|
|
39
|
+
|
|
40
|
+
Differential analysis requires the additional yaml file specifying the comparison (comparison.yaml) and the samplesheet.
|
|
41
|
+
|
|
42
|
+
> ATAC --bamdir folder/with/bamfiles/ --outputdir outputfolder \
|
|
43
|
+
--gtf genes.gtf --genomefasta genome.fa --genomesize 1.87e9 \
|
|
44
|
+
--snakemakeprofile profile -b read_attracting_regions.bed \
|
|
45
|
+
--comparison comparison.yaml --samplesheet samplesheet.tsv
|
|
46
|
+
|
|
47
|
+
The samplesheet has to be a tab-separated file with the first column containing the sample names (as the bam files are named), and the other columns containing the factors that will make up the design. For example:
|
|
48
|
+
|
|
49
|
+
| sample | genotype | treatment |
|
|
50
|
+
| -- | -- | -- |
|
|
51
|
+
| sample1 | WT | DMSO |
|
|
52
|
+
| sample2 | WT | DMSO |
|
|
53
|
+
| sample3 | WT | drug |
|
|
54
|
+
| sample4 | WT | drug |
|
|
55
|
+
| sample5 | KO | DMSO |
|
|
56
|
+
| sample6 | KO | DMSO |
|
|
57
|
+
| sample7 | KO | drug |
|
|
58
|
+
| sample8 | KO | drug |
|
|
59
|
+
|
|
60
|
+
will result in the following design:
|
|
61
|
+
|
|
62
|
+
> ~ genoype + treatment
|
|
63
|
+
|
|
64
|
+
or if --interaction is set:
|
|
65
|
+
|
|
66
|
+
> ~ genotype * treatment
|
|
67
|
+
|
|
68
|
+
Note the comparisons made need to be specified in the comparison.yaml file, a samplesheet alone is not enough. An example together with the above samplesheet would be:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
comparison1:
|
|
72
|
+
group1:
|
|
73
|
+
genotype: 'WT'
|
|
74
|
+
group2:
|
|
75
|
+
genotype: 'KO'
|
|
76
|
+
wtdmso_vs_wtdrug:
|
|
77
|
+
wtdmso:
|
|
78
|
+
genotype: 'WT'
|
|
79
|
+
treatment: 'DMSO'
|
|
80
|
+
wtdrug:
|
|
81
|
+
genotype: 'WT'
|
|
82
|
+
treatment: 'drug'
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
In this case, 2 analyses would be performed (under folders 'comparison1' & 'wtdmso_vs_wtdrug'). In both cases all of the factor columns in the samplesheet will be used in the design.
|
|
86
|
+
|
|
87
|
+
A motif file in [meme](https://meme-suite.org/meme/doc/meme-format.html) format can be supplied as well. If this is the case, the motifs will first be clustered, and motif enrichments will be calculated for all differential regions (using [ame](https://meme-suite.org/meme/doc/ame.html)). Note that the 'reciprocal' differential peaks will be used as background. E.g. group2 differential peaks are background for group1 enrichments and vice versa. Note that this approach could be biased if there is a strong disbalance between those groups.
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "ATACofthesnake"
|
|
7
|
+
dynamic = ["version"]
|
|
8
|
+
description = "ATACofthesnake"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = { file = "LICENSE" }
|
|
11
|
+
authors = [
|
|
12
|
+
{ name = "WardDeb", email = "w@rddeboutte.com" }
|
|
13
|
+
]
|
|
14
|
+
keywords = ["ATAC", "differential accessibility", "motifs", "time-course analysis"]
|
|
15
|
+
urls = { Homepage = "https://www.github.com/maxplanck-ie/ATACofthesnake" }
|
|
16
|
+
requires-python = ">=3.12"
|
|
17
|
+
dependencies = [
|
|
18
|
+
"seaborn >= 0.12.0",
|
|
19
|
+
"pandas >= 2",
|
|
20
|
+
"rich >= 12.6.0",
|
|
21
|
+
"snakemake >= 9.0.0",
|
|
22
|
+
"click >= 8.0.0",
|
|
23
|
+
]
|
|
24
|
+
|
|
25
|
+
[project.optional-dependencies]
|
|
26
|
+
dev = [
|
|
27
|
+
"ruff",
|
|
28
|
+
"ty",
|
|
29
|
+
"pytest",
|
|
30
|
+
"pip",
|
|
31
|
+
"build",
|
|
32
|
+
"twine",
|
|
33
|
+
]
|
|
34
|
+
|
|
35
|
+
[project.scripts]
|
|
36
|
+
ATAC = "aos.atac:main"
|
|
37
|
+
|
|
38
|
+
[tool.setuptools]
|
|
39
|
+
package-dir = { "" = "src" }
|
|
40
|
+
|
|
41
|
+
[tool.setuptools.packages.find]
|
|
42
|
+
where = ["src"]
|
|
43
|
+
|
|
44
|
+
[tool.setuptools.package-data]
|
|
45
|
+
"*" = ["*.smk", "*.yml", "*.R"]
|
|
46
|
+
|
|
47
|
+
[tool.pixi.workspace]
|
|
48
|
+
channels = ["conda-forge", "bioconda"]
|
|
49
|
+
platforms = ["linux-64", "osx-arm64", "osx-64", "win-64"]
|
|
50
|
+
[tool.pixi.pypi-dependencies]
|
|
51
|
+
ATACofthesnake = { path = ".", editable = true, extras = ["dev"] }
|
|
52
|
+
|
|
53
|
+
[tool.pixi.tasks]
|
|
54
|
+
ty = "ty check"
|
|
55
|
+
ruff = "ruff check ."
|
|
56
|
+
test = "pytest"
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: ATACofthesnake
|
|
3
|
+
Version: 0.0.0
|
|
4
|
+
Summary: ATACofthesnake
|
|
5
|
+
Author-email: WardDeb <w@rddeboutte.com>
|
|
6
|
+
License: MIT License
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2021 Max Planck Institute for Immunobiology and Epigenetics
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in all
|
|
18
|
+
copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
+
SOFTWARE.
|
|
27
|
+
|
|
28
|
+
Project-URL: Homepage, https://www.github.com/maxplanck-ie/ATACofthesnake
|
|
29
|
+
Keywords: ATAC,differential accessibility,motifs,time-course analysis
|
|
30
|
+
Requires-Python: >=3.12
|
|
31
|
+
Description-Content-Type: text/markdown
|
|
32
|
+
License-File: LICENSE
|
|
33
|
+
Requires-Dist: seaborn>=0.12.0
|
|
34
|
+
Requires-Dist: pandas>=2
|
|
35
|
+
Requires-Dist: rich>=12.6.0
|
|
36
|
+
Requires-Dist: snakemake>=9.0.0
|
|
37
|
+
Requires-Dist: click>=8.0.0
|
|
38
|
+
Provides-Extra: dev
|
|
39
|
+
Requires-Dist: ruff; extra == "dev"
|
|
40
|
+
Requires-Dist: ty; extra == "dev"
|
|
41
|
+
Requires-Dist: pytest; extra == "dev"
|
|
42
|
+
Requires-Dist: pip; extra == "dev"
|
|
43
|
+
Requires-Dist: build; extra == "dev"
|
|
44
|
+
Requires-Dist: twine; extra == "dev"
|
|
45
|
+
Dynamic: license-file
|
|
46
|
+
|
|
47
|
+
# ATACofthesnake
|
|
48
|
+
|
|
49
|
+
Downstream processing of ATAC data, including QC's and differential accessibility. Starting point are deduplicated bam files, could be obtained from snakePipes (https://github.com/maxplanck-ie/snakepipes).
|
|
50
|
+
|
|
51
|
+
## Important
|
|
52
|
+
|
|
53
|
+
All samples in a 'run' have to belong to the same group. That means that out of all peaks/sample, a union will be made.
|
|
54
|
+
|
|
55
|
+
Fasta headers un field 0 (space delimited) are not allowed to contain a pipe character '|'.
|
|
56
|
+
|
|
57
|
+
## Installation
|
|
58
|
+
|
|
59
|
+
From github:
|
|
60
|
+
> git clone git@github.com:maxplanck-ie/ATACofthesnake.git
|
|
61
|
+
> pixi run ATAC -h
|
|
62
|
+
|
|
63
|
+
From pypi:
|
|
64
|
+
> pip install ATACofthesnake
|
|
65
|
+
|
|
66
|
+
## Quickstart
|
|
67
|
+
|
|
68
|
+
standard analysis:
|
|
69
|
+
|
|
70
|
+
> ATAC --bamdir folder/with/bamfiles/ --outputdir outputfolder \
|
|
71
|
+
--gtf genes.gtf --genomefasta genome.fa \
|
|
72
|
+
--snakemakeprofile profile -b read_attracting_regions.bed
|
|
73
|
+
|
|
74
|
+
Note that this pipeline depends on snakemake. Additionally, the snakemake environments are managed using conda, which means you need to have conda installed and configured. Make sure this is set in your snakemake profile (if you use one), when not using a profile, snakemake will be ran with the --use-conda flag by default.
|
|
75
|
+
|
|
76
|
+
The default analysis will generate:
|
|
77
|
+
|
|
78
|
+
- sieved bamfiles.
|
|
79
|
+
(cfr. --fragsize/-f & --read_attracting_regions/-b). Note that read attracting regions are obliged. At minimum this should contain the mitochondrial genome. Note that the mitochondrial contig is assumed to be named 'MT'. You can change this using --mitostring.
|
|
80
|
+
- peaks called per bamfile (under peaks/) and a union of all peaks (peakset/).
|
|
81
|
+
- bigwigs normalized using scalefactors and RPKM.
|
|
82
|
+
- a number of QC plots (figures/) and metrics (qc/)
|
|
83
|
+
|
|
84
|
+
## Differential analysis
|
|
85
|
+
|
|
86
|
+
Differential analysis requires the additional yaml file specifying the comparison (comparison.yaml) and the samplesheet.
|
|
87
|
+
|
|
88
|
+
> ATAC --bamdir folder/with/bamfiles/ --outputdir outputfolder \
|
|
89
|
+
--gtf genes.gtf --genomefasta genome.fa --genomesize 1.87e9 \
|
|
90
|
+
--snakemakeprofile profile -b read_attracting_regions.bed \
|
|
91
|
+
--comparison comparison.yaml --samplesheet samplesheet.tsv
|
|
92
|
+
|
|
93
|
+
The samplesheet has to be a tab-separated file with the first column containing the sample names (as the bam files are named), and the other columns containing the factors that will make up the design. For example:
|
|
94
|
+
|
|
95
|
+
| sample | genotype | treatment |
|
|
96
|
+
| -- | -- | -- |
|
|
97
|
+
| sample1 | WT | DMSO |
|
|
98
|
+
| sample2 | WT | DMSO |
|
|
99
|
+
| sample3 | WT | drug |
|
|
100
|
+
| sample4 | WT | drug |
|
|
101
|
+
| sample5 | KO | DMSO |
|
|
102
|
+
| sample6 | KO | DMSO |
|
|
103
|
+
| sample7 | KO | drug |
|
|
104
|
+
| sample8 | KO | drug |
|
|
105
|
+
|
|
106
|
+
will result in the following design:
|
|
107
|
+
|
|
108
|
+
> ~ genoype + treatment
|
|
109
|
+
|
|
110
|
+
or if --interaction is set:
|
|
111
|
+
|
|
112
|
+
> ~ genotype * treatment
|
|
113
|
+
|
|
114
|
+
Note the comparisons made need to be specified in the comparison.yaml file, a samplesheet alone is not enough. An example together with the above samplesheet would be:
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
comparison1:
|
|
118
|
+
group1:
|
|
119
|
+
genotype: 'WT'
|
|
120
|
+
group2:
|
|
121
|
+
genotype: 'KO'
|
|
122
|
+
wtdmso_vs_wtdrug:
|
|
123
|
+
wtdmso:
|
|
124
|
+
genotype: 'WT'
|
|
125
|
+
treatment: 'DMSO'
|
|
126
|
+
wtdrug:
|
|
127
|
+
genotype: 'WT'
|
|
128
|
+
treatment: 'drug'
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
In this case, 2 analyses would be performed (under folders 'comparison1' & 'wtdmso_vs_wtdrug'). In both cases all of the factor columns in the samplesheet will be used in the design.
|
|
132
|
+
|
|
133
|
+
A motif file in [meme](https://meme-suite.org/meme/doc/meme-format.html) format can be supplied as well. If this is the case, the motifs will first be clustered, and motif enrichments will be calculated for all differential regions (using [ame](https://meme-suite.org/meme/doc/ame.html)). Note that the 'reciprocal' differential peaks will be used as background. E.g. group2 differential peaks are background for group1 enrichments and vice versa. Note that this approach could be biased if there is a strong disbalance between those groups.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.md
|
|
3
|
+
pyproject.toml
|
|
4
|
+
src/ATACofthesnake.egg-info/PKG-INFO
|
|
5
|
+
src/ATACofthesnake.egg-info/SOURCES.txt
|
|
6
|
+
src/ATACofthesnake.egg-info/dependency_links.txt
|
|
7
|
+
src/ATACofthesnake.egg-info/entry_points.txt
|
|
8
|
+
src/ATACofthesnake.egg-info/pbr.json
|
|
9
|
+
src/ATACofthesnake.egg-info/requires.txt
|
|
10
|
+
src/ATACofthesnake.egg-info/top_level.txt
|
|
11
|
+
src/aos/__init__.py
|
|
12
|
+
src/aos/atac.py
|
|
13
|
+
src/aos/helper.py
|
|
14
|
+
src/aos/logger.py
|
|
15
|
+
src/aos/preflight.py
|
|
16
|
+
src/aos/workflow.smk
|
|
17
|
+
src/aos/rules/DE.smk
|
|
18
|
+
src/aos/rules/motifs.smk
|
|
19
|
+
src/aos/rules/peaks.smk
|
|
20
|
+
src/aos/rules/qc.smk
|
|
21
|
+
src/aos/rules/tobias.smk
|
|
22
|
+
src/aos/rules/envs/deeptools.yml
|
|
23
|
+
src/aos/rules/envs/meme.yml
|
|
24
|
+
src/aos/rules/envs/seqtools.yml
|
|
25
|
+
src/aos/rules/envs/tobias.yml
|
|
26
|
+
src/aos/rules/scripts/edger.R
|
|
27
|
+
src/aos/rules/scripts/scalefactors.R
|
|
28
|
+
src/aos/tests/conftest.py
|
|
29
|
+
src/aos/tests/test_preflight.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"git_version": "0bb4dbf", "is_release": false}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
aos
|
|
File without changes
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import click
|
|
2
|
+
from rich.console import Console
|
|
3
|
+
from aos.preflight import Preflight
|
|
4
|
+
import subprocess
|
|
5
|
+
|
|
6
|
+
@click.command(
|
|
7
|
+
context_settings=dict(
|
|
8
|
+
help_option_names=["-h", "--help"]
|
|
9
|
+
)
|
|
10
|
+
)
|
|
11
|
+
@click.option(
|
|
12
|
+
'-i',
|
|
13
|
+
'--bamdir',
|
|
14
|
+
required=True,
|
|
15
|
+
type=click.Path(exists=True),
|
|
16
|
+
help='Specify directory that contains your bamfiles.'
|
|
17
|
+
)
|
|
18
|
+
@click.option(
|
|
19
|
+
'-o',
|
|
20
|
+
'--outputdir',
|
|
21
|
+
required=True,
|
|
22
|
+
help='Specify output directory.'
|
|
23
|
+
)
|
|
24
|
+
@click.option(
|
|
25
|
+
'-g',
|
|
26
|
+
'--gtf',
|
|
27
|
+
type=click.Path(exists=True),
|
|
28
|
+
required=True,
|
|
29
|
+
help='Specify a gtf file containing gene annotation. Will be used to extract TSS.'
|
|
30
|
+
)
|
|
31
|
+
@click.option(
|
|
32
|
+
'-r',
|
|
33
|
+
'--genomefasta',
|
|
34
|
+
type=click.Path(exists=True),
|
|
35
|
+
required=True,
|
|
36
|
+
help='Specify a fasta file that contains the reference genome.'
|
|
37
|
+
)
|
|
38
|
+
@click.option(
|
|
39
|
+
'-b',
|
|
40
|
+
'--readattractingregions',
|
|
41
|
+
type=click.Path(exists=True),
|
|
42
|
+
required=True,
|
|
43
|
+
help='Specify a bed file containing read attracting regions. Should contain the mitochondrial genome at least.'
|
|
44
|
+
)
|
|
45
|
+
@click.option(
|
|
46
|
+
'-p',
|
|
47
|
+
'--snakemakeprofile',
|
|
48
|
+
required=False,
|
|
49
|
+
help='specify the name of your snakemake profile.'
|
|
50
|
+
)
|
|
51
|
+
@click.option(
|
|
52
|
+
'-@',
|
|
53
|
+
'--threads',
|
|
54
|
+
default=1,
|
|
55
|
+
type=int,
|
|
56
|
+
help='specify the number of threads to use. Only relevant if no snakemake profile is given.'
|
|
57
|
+
)
|
|
58
|
+
@click.option(
|
|
59
|
+
'-m',
|
|
60
|
+
'--motifs',
|
|
61
|
+
type=click.Path(exists=True),
|
|
62
|
+
help='Specify a file containing motifs. Needs to be in meme format. If not provided, no motif analyses will be ran.'
|
|
63
|
+
)
|
|
64
|
+
@click.option(
|
|
65
|
+
'-f',
|
|
66
|
+
'--fragsize',
|
|
67
|
+
default=150,
|
|
68
|
+
type=int,
|
|
69
|
+
show_default=True,
|
|
70
|
+
help='Specify the maximum fragment size (bps) to be considered for peak calling. Sits at 150 bps by default to only use reads from nucleosome-free regions.'
|
|
71
|
+
)
|
|
72
|
+
@click.option(
|
|
73
|
+
'--samplesheet',
|
|
74
|
+
type=click.Path(exists=True),
|
|
75
|
+
help='specify a samplesheet (as a tsv file). See Readme for formatting.'
|
|
76
|
+
)
|
|
77
|
+
@click.option(
|
|
78
|
+
'--comparison',
|
|
79
|
+
type=click.Path(exists=True),
|
|
80
|
+
help='specify yaml file with comparisons. Required if a samplesheet is given.'
|
|
81
|
+
)
|
|
82
|
+
@click.option(
|
|
83
|
+
'--interaction',
|
|
84
|
+
default=False,
|
|
85
|
+
is_flag=True,
|
|
86
|
+
help='Wether or not to add interactions in the differential calculations. (e.g. ~factor1*factor2 if set, ~factor1+factor2 if not set).'
|
|
87
|
+
)
|
|
88
|
+
@click.option(
|
|
89
|
+
'--mitostring',
|
|
90
|
+
required=False,
|
|
91
|
+
default='MT',
|
|
92
|
+
show_default=True,
|
|
93
|
+
help='Name of the mitochondrial contig (as in the reference genome / BAM file). Defaults to MT.'
|
|
94
|
+
)
|
|
95
|
+
@click.option(
|
|
96
|
+
'--upstreamuro',
|
|
97
|
+
required=False,
|
|
98
|
+
default=50000,
|
|
99
|
+
show_default=True,
|
|
100
|
+
help='Maximum permitted distance upstream of a feature (peak annotation).'
|
|
101
|
+
)
|
|
102
|
+
@click.option(
|
|
103
|
+
'--downstreamuro',
|
|
104
|
+
required=False,
|
|
105
|
+
default=50000,
|
|
106
|
+
show_default=True,
|
|
107
|
+
help='Maximum permitted distance downstream of a feature (peak annotation).'
|
|
108
|
+
)
|
|
109
|
+
@click.option(
|
|
110
|
+
'--featureuro',
|
|
111
|
+
required=False,
|
|
112
|
+
default='gene',
|
|
113
|
+
show_default=True,
|
|
114
|
+
help='the feature in the GTF file (column 3) to use for peak annotation.'
|
|
115
|
+
)
|
|
116
|
+
@click.option(
|
|
117
|
+
'--pseudocount',
|
|
118
|
+
required=False,
|
|
119
|
+
default=8,
|
|
120
|
+
show_default=True,
|
|
121
|
+
help='Pseudocount to add to the count matrix prior to differential calling.'
|
|
122
|
+
)
|
|
123
|
+
@click.option(
|
|
124
|
+
'--peakset',
|
|
125
|
+
required=False,
|
|
126
|
+
type=click.Path(exists=True),
|
|
127
|
+
help='Include an external peak file (bed format). If not provided, the union of all peaks across all samples will be used to generate a count matrix.'
|
|
128
|
+
)
|
|
129
|
+
def main(**kwargs) -> None:
|
|
130
|
+
pf = Preflight(kwargs)
|
|
131
|
+
console = Console()
|
|
132
|
+
with console.status("[bold green] Running snakemake..."):
|
|
133
|
+
subprocess.run(
|
|
134
|
+
[
|
|
135
|
+
'snakemake',
|
|
136
|
+
'-s', pf.workflowfile,
|
|
137
|
+
'--configfile', pf.configfile,
|
|
138
|
+
'-d', pf.outputdir,
|
|
139
|
+
'-p',
|
|
140
|
+
] + pf.snakemake_arguments()
|
|
141
|
+
)
|
|
142
|
+
|