offtracker 2.7.8__zip → 2.10.0__zip

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.
Files changed (37) hide show
  1. offtracker-2.10.0/PKG-INFO +233 -0
  2. offtracker-2.10.0/README.md +221 -0
  3. {offtracker-2.7.8 → offtracker-2.10.0}/offtracker/X_offplot.py +37 -8
  4. {offtracker-2.7.8 → offtracker-2.10.0}/offtracker/X_sequence.py +113 -7
  5. offtracker-2.10.0/offtracker/_version.py +36 -0
  6. offtracker-2.10.0/offtracker/snakefile/Snakefile_QC.smk +66 -0
  7. offtracker-2.10.0/offtracker/snakefile/Snakefile_offtracker.smk +249 -0
  8. offtracker-2.7.8/offtracker/mapping/1.1_bed2fr_v4.5.py → offtracker-2.10.0/offtracker/utility/1.1_bed2fr.py +6 -4
  9. offtracker-2.10.0/offtracker.egg-info/PKG-INFO +233 -0
  10. offtracker-2.10.0/offtracker.egg-info/SOURCES.txt +28 -0
  11. {offtracker-2.7.8 → offtracker-2.10.0}/scripts/offtracker_analysis.py +20 -5
  12. offtracker-2.10.0/scripts/offtracker_candidates.py +318 -0
  13. {offtracker-2.7.8 → offtracker-2.10.0}/scripts/offtracker_config.py +28 -44
  14. offtracker-2.10.0/scripts/offtracker_plot.py +39 -0
  15. offtracker-2.10.0/scripts/offtracker_qc.py +62 -0
  16. {offtracker-2.7.8 → offtracker-2.10.0}/setup.py +8 -4
  17. offtracker-2.7.8/PKG-INFO +0 -146
  18. offtracker-2.7.8/README.md +0 -134
  19. offtracker-2.7.8/offtracker/_version.py +0 -28
  20. offtracker-2.7.8/offtracker/mapping/Snakefile_offtracker +0 -245
  21. offtracker-2.7.8/offtracker.egg-info/PKG-INFO +0 -146
  22. offtracker-2.7.8/offtracker.egg-info/SOURCES.txt +0 -25
  23. offtracker-2.7.8/scripts/offtracker_candidates.py +0 -307
  24. {offtracker-2.7.8 → offtracker-2.10.0}/LICENSE.txt +0 -0
  25. {offtracker-2.7.8 → offtracker-2.10.0}/MANIFEST.in +0 -0
  26. {offtracker-2.7.8 → offtracker-2.10.0}/offtracker/X_offtracker.py +0 -0
  27. {offtracker-2.7.8 → offtracker-2.10.0}/offtracker/__init__.py +0 -0
  28. {offtracker-2.7.8/offtracker/mapping → offtracker-2.10.0/offtracker/utility}/1.3_bdg_normalize_v4.0.py +0 -0
  29. {offtracker-2.7.8/offtracker/mapping → offtracker-2.10.0/offtracker/utility}/bedGraphToBigWig +0 -0
  30. {offtracker-2.7.8/offtracker/mapping → offtracker-2.10.0/offtracker/utility}/hg38.chrom.sizes +0 -0
  31. {offtracker-2.7.8/offtracker/mapping → offtracker-2.10.0/offtracker/utility}/mm10.chrom.sizes +0 -0
  32. {offtracker-2.7.8/offtracker/mapping → offtracker-2.10.0/offtracker/utility}/offtracker_blacklist_hg38.merged.bed +0 -0
  33. {offtracker-2.7.8/offtracker/mapping → offtracker-2.10.0/offtracker/utility}/offtracker_blacklist_mm10.merged.bed +0 -0
  34. {offtracker-2.7.8 → offtracker-2.10.0}/offtracker.egg-info/dependency_links.txt +0 -0
  35. {offtracker-2.7.8 → offtracker-2.10.0}/offtracker.egg-info/requires.txt +0 -0
  36. {offtracker-2.7.8 → offtracker-2.10.0}/offtracker.egg-info/top_level.txt +0 -0
  37. {offtracker-2.7.8 → offtracker-2.10.0}/setup.cfg +0 -0
@@ -1,245 +0,0 @@
1
- # 2023.08.11. adding a option for not normalizing the bw file
2
- # 2024.01.23. add --fixedStep to bigwigCompare for not merging neighbouring bins with equal values.
3
-
4
- configfile: "config.yaml"
5
-
6
- _threads = config["thread"]
7
- BinSize = str(config["binsize"])
8
- normalize = config["normalize"]
9
- output_dir = config["output_dir"]
10
- nametype = config["nametype"]
11
- suffix = config["suffix"]
12
- name1 = nametype.replace('2','1') + '.' + suffix
13
- name2 = nametype + '.' + suffix
14
-
15
- import os
16
-
17
- if normalize == "True":
18
- rule all:
19
- input:
20
- expand( os.path.join(output_dir,"{sample}.fw.bed"), sample=config["sample"] ),
21
- expand( os.path.join(output_dir,"{sample}.rv.bed"), sample=config["sample"] ),
22
- expand( os.path.join(output_dir,"{sample}.fw.scaled.bw"), sample=config["sample"] ),
23
- expand( os.path.join(output_dir,"{sample}.rv.scaled.bw"), sample=config["sample"] ),
24
- expand( os.path.join(output_dir,"{sample}." + BinSize + ".add.bdg"),sample=config["sample"] ),
25
- elif normalize == "False":
26
- rule all:
27
- input:
28
- expand( os.path.join(output_dir,"{sample}.fw.bed"), sample=config["sample"] ),
29
- expand( os.path.join(output_dir,"{sample}.rv.bed"), sample=config["sample"] ),
30
- expand( os.path.join(output_dir,"{sample}.fw.raw.bw"), sample=config["sample"] ),
31
- expand( os.path.join(output_dir,"{sample}.rv.raw.bw"), sample=config["sample"] ),
32
- else:
33
- raise ValueError('Please provide "True" or "False" for "--normalize" when running offtracker_config.py')
34
-
35
-
36
- rule chromap:
37
- input:
38
- R1= lambda w: config["sample"][w.sample] + name1,
39
- R2= lambda w: config["sample"][w.sample] + name2
40
- threads:
41
- _threads
42
- params:
43
- index=config["index"],
44
- fasta=config["fasta"]
45
- output:
46
- temp(os.path.join(output_dir,"{sample}.chromapx.bed"))
47
- shell:
48
- """
49
- chromap -l 3000 --low-mem --BED --remove-pcr-duplicates \
50
- --min-read-length 10 --allocate-multi-mappings \
51
- -x {params.index} -r {params.fasta} -t {threads} -1 {input.R1} -2 {input.R2} -o {output}
52
- """
53
-
54
- if config["blacklist"] != 'none':
55
- rule remove_blacklist:
56
- input:
57
- os.path.join(output_dir,"{sample}.chromapx.bed")
58
- threads:
59
- _threads
60
- params:
61
- blacklist=config["blacklist"]
62
- output:
63
- temp(os.path.join(output_dir,"{sample}.filtered.bed"))
64
- shell:
65
- "bedtools intersect -a {input} -b {params.blacklist} -v > {output}"
66
-
67
- rule bed2fr:
68
- input:
69
- os.path.join(output_dir,"{sample}.filtered.bed")
70
- threads:
71
- _threads
72
- params:
73
- dir_script=config["script_folder"]
74
- output:
75
- fw=os.path.join(output_dir,"{sample}.fw.bed"),
76
- rv=os.path.join(output_dir,"{sample}.rv.bed")
77
- shell:
78
- "python {params.dir_script}/1.1_bed2fr_v4.5.py -b {input}"
79
- else:
80
- rule bed2fr:
81
- input:
82
- os.path.join(output_dir,"{sample}.chromapx.bed")
83
- threads:
84
- _threads
85
- params:
86
- dir_script=config["script_folder"]
87
- output:
88
- fw=os.path.join(output_dir,"{sample}.fw.bed"),
89
- rv=os.path.join(output_dir,"{sample}.rv.bed")
90
- shell:
91
- "python {params.dir_script}/1.1_bed2fr_v4.5.py -b {input}"
92
-
93
- rule bed2bdg_fw:
94
- input:
95
- os.path.join(output_dir,"{sample}.fw.bed")
96
- threads:
97
- _threads
98
- params:
99
- gl=config["genomelen"]
100
- output:
101
- temp(os.path.join(output_dir,"{sample}.fw.bdg"))
102
- shell:
103
- "bedtools genomecov -bg -i {input} -g {params.gl} > {output}"
104
-
105
- rule bed2bdg_rv:
106
- input:
107
- os.path.join(output_dir,"{sample}.rv.bed")
108
- threads:
109
- _threads
110
- params:
111
- gl=config["genomelen"]
112
- output:
113
- temp(os.path.join(output_dir,"{sample}.rv.bdg"))
114
- shell:
115
- "bedtools genomecov -bg -i {input} -g {params.gl} > {output}"
116
-
117
- rule bdg_sort_fw:
118
- input:
119
- fw=os.path.join(output_dir,"{sample}.fw.bdg")
120
- threads:
121
- _threads
122
- output:
123
- temp(os.path.join(output_dir,"{sample}.fw.sorted.bdg"))
124
- shell:
125
- "bedtools sort -i {input.fw} > {output}"
126
-
127
- rule bdg_sort_rv:
128
- input:
129
- rv=os.path.join(output_dir,"{sample}.rv.bdg")
130
- threads:
131
- _threads
132
- output:
133
- temp(os.path.join(output_dir,"{sample}.rv.sorted.bdg"))
134
- shell:
135
- "bedtools sort -i {input.rv} > {output}"
136
-
137
- if normalize == "True":
138
- rule bdg_normalize_fw:
139
- input:
140
- bdg=os.path.join(output_dir,"{sample}.fw.sorted.bdg"),
141
- bed=os.path.join(output_dir,"{sample}.fw.bed")
142
- threads:
143
- _threads
144
- params:
145
- dir_script=config["script_folder"]
146
- output:
147
- temp(os.path.join(output_dir,"{sample}.fw.scaled.bdg"))
148
- shell:
149
- "python {params.dir_script}/1.3_bdg_normalize_v4.0.py --bdg {input.bdg} --bed {input.bed}"
150
-
151
- rule bdg_normalize_rv:
152
- input:
153
- bdg=os.path.join(output_dir,"{sample}.rv.sorted.bdg"),
154
- bed=os.path.join(output_dir,"{sample}.rv.bed")
155
- threads:
156
- _threads
157
- params:
158
- dir_script=config["script_folder"]
159
- output:
160
- temp(os.path.join(output_dir,"{sample}.rv.scaled.bdg"))
161
- shell:
162
- "python {params.dir_script}/1.3_bdg_normalize_v4.0.py --bdg {input.bdg} --bed {input.bed}"
163
-
164
- rule bdg2bw_fw:
165
- input:
166
- os.path.join(output_dir,"{sample}.fw.scaled.bdg")
167
- threads:
168
- _threads
169
- params:
170
- gl=config["genomelen"],
171
- dir_script=config["script_folder"]
172
- output:
173
- os.path.join(output_dir,"{sample}.fw.scaled.bw")
174
- shell:
175
- "{params.dir_script}/bedGraphToBigWig {input} {params.gl} {output}"
176
-
177
- rule bdg2bw_rv:
178
- input:
179
- os.path.join(output_dir,"{sample}.rv.scaled.bdg")
180
- threads:
181
- _threads
182
- params:
183
- gl=config["genomelen"],
184
- dir_script=config["script_folder"]
185
- output:
186
- os.path.join(output_dir,"{sample}.rv.scaled.bw")
187
- shell:
188
- "{params.dir_script}/bedGraphToBigWig {input} {params.gl} {output}"
189
-
190
- rule bwAdd:
191
- input:
192
- fw=os.path.join(output_dir,"{sample}.fw.scaled.bw"),
193
- rv=os.path.join(output_dir,"{sample}.rv.scaled.bw")
194
- threads:
195
- _threads
196
- output:
197
- os.path.join(output_dir,"{sample}." + BinSize + ".add.bdg")
198
- shell:
199
- """
200
- bigwigCompare --binSize {BinSize} -p {threads} --verbose -o {output} \
201
- --outFileFormat bedgraph --fixedStep \
202
- --bigwig1 {input.fw} \
203
- --bigwig2 {input.rv} \
204
- --operation add
205
- """
206
- else:
207
- rule bdg_reverse_rv:
208
- input:
209
- os.path.join(output_dir,"{sample}.rv.sorted.bdg")
210
- threads:
211
- _threads
212
- output:
213
- temp(os.path.join(output_dir,"{sample}.rv.sorted_r.bdg"))
214
- shell:
215
- "awk -F '\t' -v OFS='\t' '{{$4=-$4; print}}' {input} > {output}"
216
-
217
- rule bdg2bw_fw:
218
- input:
219
- os.path.join(output_dir,"{sample}.fw.sorted.bdg")
220
- threads:
221
- _threads
222
- params:
223
- gl=config["genomelen"],
224
- dir_script=config["script_folder"]
225
- output:
226
- os.path.join(output_dir,"{sample}.fw.raw.bw")
227
- shell:
228
- "{params.dir_script}/bedGraphToBigWig {input} {params.gl} {output}"
229
-
230
- rule bdg2bw_rv:
231
- input:
232
- os.path.join(output_dir,"{sample}.rv.sorted_r.bdg")
233
- threads:
234
- _threads
235
- params:
236
- gl=config["genomelen"],
237
- dir_script=config["script_folder"]
238
- output:
239
- os.path.join(output_dir,"{sample}.rv.raw.bw")
240
- shell:
241
- "{params.dir_script}/bedGraphToBigWig {input} {params.gl} {output}"
242
-
243
-
244
-
245
-
@@ -1,146 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: offtracker
3
- Version: 2.7.8
4
- Summary: Tracking-seq data analysis
5
- Home-page: https://github.com/Lan-lab/offtracker
6
- Author: Runda Xu
7
- Author-email: runda.xu@foxmail.com
8
- Requires-Python: >=3.6.0
9
- Description-Content-Type: text/markdown
10
- License-File: LICENSE.txt
11
-
12
-
13
- OFF-TRACKER
14
- =======================
15
-
16
- OFF-TRACKER is an end to end pipeline of Tracking-seq data analysis for detecting off-target sites of any genome editing tools that generate double-strand breaks (DSBs) or single-strand breaks (SSBs).
17
-
18
- System requirements
19
- -----
20
- * Linux/Unix
21
- * Python >= 3.6
22
-
23
- Dependency
24
- -----
25
-
26
- ```bash
27
- # We recommend creating a new enviroment using mamba/conda to avoid compatibility problems
28
- # If you don't use mamba, just replace the code with conda
29
- mamba create -n offtracker -c bioconda blast snakemake pybedtools
30
- ```
31
-
32
-
33
- Installation
34
- -----
35
-
36
- ```bash
37
- # activate the environment
38
- conda activate offtracker
39
-
40
- # Direct installation with pip
41
- pip install offtracker
42
-
43
- # (Alternative) Download the offtracker from github
44
- git clone https://github.com/Lan-lab/offtracker.git
45
- cd offtracker
46
- pip install .
47
- ```
48
-
49
-
50
- Before analyzing samples
51
- -----
52
-
53
- ```bash
54
- # Build blast index (only need once for each genome)
55
- makeblastdb -input_type fasta -title hg38 -dbtype nucl -parse_seqids \
56
- -in /Your_Path_To_Reference/hg38_genome.fa \
57
- -out /Your_Path_To_Reference/hg38_genome.blastdb \
58
- -logfile /Your_Path_To_Reference/hg38_genome.blastdb.log
59
-
60
- # Build chromap index (only need once for each genome)
61
- chromap -i -r /Your_Path_To_Reference/hg38_genome.fa \
62
- -o /Your_Path_To_Reference/hg38_genome.chromap.index
63
-
64
- # Generate candidate regions by sgRNA sequence (need once for each genome and sgRNA)
65
- offtracker_candidates.py -t 8 -g hg38 \
66
- -r /Your_Path_To_Reference/hg38_genome.fa \
67
- -b /Your_Path_To_Reference/hg38_genome.blastdb \
68
- --name 'HEK4' --sgrna 'GGCACTGCGGCTGGAGGTGG' --pam 'NGG' \
69
- -o /Your_Path_To_Candidates
70
-
71
- ```
72
-
73
- Strand-specific mapping of Tracking-seq data
74
- -----
75
-
76
- ```bash
77
- # Generate snakemake config file
78
- offtracker_config.py -t 8 -g hg38 --blacklist hg38 \
79
- -r /Your_Path_To_Reference/hg38_genome.fa \
80
- -i /Your_Path_To_Reference/hg38_genome.chromap.index \
81
- -f /Your_Path_To_Fastq \
82
- -o /Your_Path_To_Output \
83
- --subfolder 0
84
-
85
- # --subfolder: If different samples are in seperate folders, set this to 1
86
- # -o: Default is outputting to /Your_Path_To_Fastq
87
-
88
- # Run the snakemake program
89
- cd /Your_Path_To_Fastq
90
- snakemake -np # dry run
91
- nohup snakemake --cores 16 1>snakemake.log 2>snakemake.err &
92
-
93
- ## about cores
94
- # --cores of snakemake must be larger than -t of offtracker_config.py
95
- # parallel number = cores/t
96
-
97
- ## about output
98
- # This part will generate "*.fw.scaled.bw" and ".rv.scaled.bw" for IGV visualization
99
- # "*.fw.bed" and "*.rv.bed" are used in the next part.
100
- ```
101
-
102
-
103
- Analyzing the off-target sites
104
- -----
105
-
106
- ```bash
107
- # In this part, multiple samples in the same condition can be analyzed in a single run by pattern recogonization of sample names
108
-
109
- offtracker_analysis.py -g hg38 --name "HEK4" \
110
- --exp 'Cas9_HEK4.*293' \
111
- --control 'control' \
112
- --outname 'Cas9_HEK4_293' \
113
- -f /Your_Path_To_Output \
114
- --seqfolder /Your_Path_To_Candidates
115
-
116
- # --name: the same as that in offtracker_candidates.py
117
- # --exp/--control: add one or multiple patterns of file name in regex
118
-
119
-
120
- # This step will generate Trackseq_result_{outname}.csv
121
- # Intermediate files are saved in ./temp folder, which can be deleted
122
- # Keeping the intermediate files can make the analysis faster if involving previously analyzed samples (e.g. using the same control samples for different analyses)
123
- ```
124
-
125
-
126
- Note1
127
- --------------
128
- The default setting only includes chr1-chr22, chrX, chrY, and chrM.
129
-
130
- Please make sure the reference genome contains "chr" at the beginning.
131
-
132
- If you have requirement for other chromosomes or species other than human/mouse, please post an issue.
133
-
134
- Note2
135
- --------------
136
- Currently, this software is only ready-to-use for mm10 and hg38.
137
-
138
- For any other genome, say hg19, please add genome size file named "hg19.chrom.sizes" to .\offtracker\mapping before install.
139
-
140
- Besides, add "--blacklist none" or "--blacklist Your_Blacklist" when running offtracker_config.py
141
-
142
- Note3
143
- --------------
144
- The FDR in the Tracking-seq result is not rigorous to the real off-target probability.
145
- It is strongly recommended to observe the "fw.scaled.bw" and "rv.scaled.bw" using IGV to check each target location from the Tracking-seq result.
146
-
@@ -1,25 +0,0 @@
1
- LICENSE.txt
2
- MANIFEST.in
3
- README.md
4
- setup.py
5
- offtracker/X_offplot.py
6
- offtracker/X_offtracker.py
7
- offtracker/X_sequence.py
8
- offtracker/__init__.py
9
- offtracker/_version.py
10
- offtracker.egg-info/PKG-INFO
11
- offtracker.egg-info/SOURCES.txt
12
- offtracker.egg-info/dependency_links.txt
13
- offtracker.egg-info/requires.txt
14
- offtracker.egg-info/top_level.txt
15
- offtracker/mapping/1.1_bed2fr_v4.5.py
16
- offtracker/mapping/1.3_bdg_normalize_v4.0.py
17
- offtracker/mapping/Snakefile_offtracker
18
- offtracker/mapping/bedGraphToBigWig
19
- offtracker/mapping/hg38.chrom.sizes
20
- offtracker/mapping/mm10.chrom.sizes
21
- offtracker/mapping/offtracker_blacklist_hg38.merged.bed
22
- offtracker/mapping/offtracker_blacklist_mm10.merged.bed
23
- scripts/offtracker_analysis.py
24
- scripts/offtracker_candidates.py
25
- scripts/offtracker_config.py