offtracker 2.13.2__zip → 2.14.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 (32) hide show
  1. {offtracker-2.13.2 → offtracker-2.14.0}/PKG-INFO +18 -4
  2. offtracker-2.13.2/offtracker.egg-info/PKG-INFO → offtracker-2.14.0/README.md +261 -259
  3. {offtracker-2.13.2 → offtracker-2.14.0}/offtracker/_version.py +3 -2
  4. offtracker-2.13.2/README.md → offtracker-2.14.0/offtracker.egg-info/PKG-INFO +273 -247
  5. {offtracker-2.13.2 → offtracker-2.14.0}/offtracker.egg-info/requires.txt +1 -0
  6. {offtracker-2.13.2 → offtracker-2.14.0}/scripts/offtracker_analysis.py +18 -0
  7. {offtracker-2.13.2 → offtracker-2.14.0}/scripts/offtracker_candidates.py +14 -0
  8. {offtracker-2.13.2 → offtracker-2.14.0}/scripts/offtracker_config.py +37 -3
  9. {offtracker-2.13.2 → offtracker-2.14.0}/scripts/offtracker_qc.py +15 -2
  10. {offtracker-2.13.2 → offtracker-2.14.0}/setup.py +1 -1
  11. {offtracker-2.13.2 → offtracker-2.14.0}/LICENSE.txt +0 -0
  12. {offtracker-2.13.2 → offtracker-2.14.0}/MANIFEST.in +0 -0
  13. {offtracker-2.13.2 → offtracker-2.14.0}/offtracker/X_offplot.py +0 -0
  14. {offtracker-2.13.2 → offtracker-2.14.0}/offtracker/X_offtracker.py +0 -0
  15. {offtracker-2.13.2 → offtracker-2.14.0}/offtracker/X_sequence.py +0 -0
  16. {offtracker-2.13.2 → offtracker-2.14.0}/offtracker/__init__.py +0 -0
  17. {offtracker-2.13.2 → offtracker-2.14.0}/offtracker/snakefile/Snakefile_QC.smk +0 -0
  18. {offtracker-2.13.2 → offtracker-2.14.0}/offtracker/snakefile/Snakefile_offtracker.smk +0 -0
  19. {offtracker-2.13.2 → offtracker-2.14.0}/offtracker/utility/1.1_bed2fr.py +0 -0
  20. {offtracker-2.13.2 → offtracker-2.14.0}/offtracker/utility/1.3_bdg_normalize_v4.0.py +0 -0
  21. {offtracker-2.13.2 → offtracker-2.14.0}/offtracker/utility/bedGraphToBigWig +0 -0
  22. {offtracker-2.13.2 → offtracker-2.14.0}/offtracker/utility/hg38.chrom.sizes +0 -0
  23. {offtracker-2.13.2 → offtracker-2.14.0}/offtracker/utility/mm10.chrom.sizes +0 -0
  24. {offtracker-2.13.2 → offtracker-2.14.0}/offtracker/utility/offtracker_blacklist_hg38.merged.bed +0 -0
  25. {offtracker-2.13.2 → offtracker-2.14.0}/offtracker/utility/offtracker_blacklist_mm10.merged.bed +0 -0
  26. {offtracker-2.13.2 → offtracker-2.14.0}/offtracker.egg-info/SOURCES.txt +0 -0
  27. {offtracker-2.13.2 → offtracker-2.14.0}/offtracker.egg-info/dependency_links.txt +0 -0
  28. {offtracker-2.13.2 → offtracker-2.14.0}/offtracker.egg-info/top_level.txt +0 -0
  29. {offtracker-2.13.2 → offtracker-2.14.0}/scripts/offtracker_correction.py +0 -0
  30. {offtracker-2.13.2 → offtracker-2.14.0}/scripts/offtracker_init.py +0 -0
  31. {offtracker-2.13.2 → offtracker-2.14.0}/scripts/offtracker_plot.py +0 -0
  32. {offtracker-2.13.2 → offtracker-2.14.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: offtracker
3
- Version: 2.13.2
3
+ Version: 2.14.0
4
4
  Summary: Tracking-seq data analysis
5
5
  Home-page: https://github.com/Lan-lab/offtracker
6
6
  Author: Runda Xu
@@ -48,12 +48,18 @@ pip install .
48
48
 
49
49
  ## Before analyzing samples
50
50
 
51
- **Important: Do not use hard-masked genome.fa**, in which repeats are masked by capital Ns and reads should have been mapped to these region (e.g. MHC region) will be lost. Besides, the genome.fa **should not** contain alternate loci like chr2_KI270776v1_alt and chr6_GL000256v2_alt, which may cause multi-mappings and the reads may be discarded.
51
+ **Important: Do not use hard-masked genome.fa**, in which repeats are masked by capital Ns and reads should have been mapped to these region (e.g. MHC region) will be lost. Besides, the genome.fa **should not contain alternate loci** like chr2_KI270776v1_alt and chr6_GL000256v2_alt, which may cause multi-mappings and the reads may be discarded.
52
+
53
+
54
+ **!! Do not use any of these two .fa files !!** \
55
+ For example, https://hgdownload.soe.ucsc.edu/goldenPath/hg38/bigZips/hg38.fa.gz is soft-masked genome with alternate loci. https://hgdownload.soe.ucsc.edu/goldenPath/hg38/bigZips/hg38.fa.masked.gz is hard-masked genome. **Do not** use these two as reference genome. \
56
+ **!! Do not use any of these two .fa files !!**
57
+
52
58
 
53
- For example, https://hgdownload.soe.ucsc.edu/goldenPath/hg38/bigZips/hg38.fa.gz is soft-masked genome with alternate loci. https://hgdownload.soe.ucsc.edu/goldenPath/hg38/bigZips/hg38.fa.masked.gz is hard-masked genome. **Do not** use these two as reference genome.
54
59
 
55
60
  http://cistrome.org/~galib/MAESTRO/references/scATAC/Refdata_scATAC_MAESTRO_GRCh38_1.1.0.tar.gz is the genome used for the example data.
56
61
 
62
+
57
63
  ```bash
58
64
  # The following command can be used to check whether alternate loci of chr6 are present in the reference genome.
59
65
  grep "^>chr6" genome.fa
@@ -78,7 +84,7 @@ offtracker_candidates.py -t 8 -g hg38 \
78
84
  --name 'VEGFA2' --sgrna 'GACCCCCTCCACCCCGCCTC' --pam 'NGG' \
79
85
  -o /Your_Path_To_Candidates_Folder
80
86
 
81
- # if analyzing Cas12a, whose pam is upstream of the sgRNA, add this:
87
+ # If analyzing Cas12a, whose pam is upstream of the sgRNA, add this:
82
88
  --pam_location 'upstream'
83
89
 
84
90
  ```
@@ -208,6 +214,14 @@ https://figshare.com/articles/dataset/WT_HEK239T_chr6/25956034
208
214
 
209
215
  It takes about 5-10 minutes to run the mapping (offtracker_config.py & snakemake) of example data with -t 8 and --cores 16 (2 parallel tasks)
210
216
 
217
+ To download the data with wget:
218
+ ```
219
+ wget --user-agent="Mozilla" https://figshare.com/ndownloader/files/46770337 -O WT_HEK239T_chr6_1.fq.gz
220
+ wget --user-agent="Mozilla" https://figshare.com/ndownloader/files/46770334 -O WT_HEK239T_chr6_2.fq.gz
221
+ wget --user-agent="Mozilla" https://figshare.com/ndownloader/files/46775599 -O Cas9_VEGFA2_chr6_1.fq.gz
222
+ wget --user-agent="Mozilla" https://figshare.com/ndownloader/files/46775602 -O Cas9_VEGFA2_chr6_2.fq.gz
223
+ ```
224
+
211
225
  ## Signal visualization
212
226
 
213
227
  After mapping, there will be 4 .bw files in the output folder:
@@ -1,259 +1,261 @@
1
- Metadata-Version: 2.1
2
- Name: offtracker
3
- Version: 2.13.2
4
- Summary: Tracking-seq data analysis
5
- Home-page: https://github.com/Lan-lab/offtracker
6
- Author: Runda Xu
7
- Author-email: xrd18@tsinghua.org.cn
8
- Requires-Python: >=3.6.0
9
- Description-Content-Type: text/markdown
10
- License-File: LICENSE.txt
11
-
12
-
13
- # Offtracker
14
-
15
- Offtracker 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).
16
-
17
- ## System requirements
18
-
19
- * Linux/Unix
20
- * Python >= 3.6
21
-
22
- ## Dependency
23
-
24
- ```bash
25
- # We recommend creating a new environment using mamba/conda to avoid compatibility problems
26
- # If you don't use mamba, just replace the code with conda
27
- # Windows systems may not be compatible with pybedtools.
28
- mamba create -n offtracker -c bioconda blast snakemake pybedtools deeptools chromap
29
- ```
30
-
31
-
32
- ## Installation
33
-
34
-
35
- ```bash
36
- # Activate the environment
37
- conda activate offtracker
38
-
39
- # Direct installation with pip
40
- pip install offtracker
41
-
42
- # (Alternative) Download the offtracker from github
43
- git clone https://github.com/Lan-lab/offtracker.git
44
- cd offtracker
45
- pip install .
46
- ```
47
-
48
-
49
- ## Before analyzing samples
50
-
51
- **Important: Do not use hard-masked genome.fa**, in which repeats are masked by capital Ns and reads should have been mapped to these region (e.g. MHC region) will be lost. Besides, the genome.fa **should not** contain alternate loci like chr2_KI270776v1_alt and chr6_GL000256v2_alt, which may cause multi-mappings and the reads may be discarded.
52
-
53
- For example, https://hgdownload.soe.ucsc.edu/goldenPath/hg38/bigZips/hg38.fa.gz is soft-masked genome with alternate loci. https://hgdownload.soe.ucsc.edu/goldenPath/hg38/bigZips/hg38.fa.masked.gz is hard-masked genome. **Do not** use these two as reference genome.
54
-
55
- http://cistrome.org/~galib/MAESTRO/references/scATAC/Refdata_scATAC_MAESTRO_GRCh38_1.1.0.tar.gz is the genome used for the example data.
56
-
57
- ```bash
58
- # The following command can be used to check whether alternate loci of chr6 are present in the reference genome.
59
- grep "^>chr6" genome.fa
60
- ```
61
-
62
- ```bash
63
- # Build chromap index (only need once for each genome)
64
- chromap -i -r /Your_Path_To_Reference/hg38_genome.fa \
65
- -o /Your_Path_To_Reference/hg38_genome.chromap.index
66
-
67
- # Build blast index (only need once for each genome)
68
- makeblastdb -input_type fasta -title hg38 -dbtype nucl -parse_seqids \
69
- -in /Your_Path_To_Reference/hg38_genome.fa \
70
- -out /Your_Path_To_Reference/hg38_genome.blastdb \
71
- -logfile /Your_Path_To_Reference/hg38_genome.blastdb.log
72
-
73
- # Generate candidate regions by sgRNA sequence (need once for each genome and sgRNA)
74
- # --name: a user-defined name of the sgRNA, which will be used in the following analysis.
75
- offtracker_candidates.py -t 8 -g hg38 \
76
- -r /Your_Path_To_Reference/hg38_genome.fa \
77
- -b /Your_Path_To_Reference/hg38_genome.blastdb \
78
- --name 'VEGFA2' --sgrna 'GACCCCCTCCACCCCGCCTC' --pam 'NGG' \
79
- -o /Your_Path_To_Candidates_Folder
80
-
81
- # if analyzing Cas12a, whose pam is upstream of the sgRNA, add this:
82
- --pam_location 'upstream'
83
-
84
- ```
85
-
86
-
87
- ## Quality control and adapter trimming
88
-
89
- ```bash
90
- # Generate snakemake config file for quality control and adapter trimming.
91
- offtracker_qc.py -t 4 \
92
- -f /Your_Path_To_Input_Folder \
93
- --subfolder 0
94
-
95
- cd /Your_Path_To_Input_Folder/Trimmed_data
96
- snakemake -np # dry run to check whether everything is alright
97
- nohup snakemake --cores 16 1>${outdir}/sm_qc.log 2>&1 &
98
-
99
- """
100
- Set “--subfolder 0” if the file structure is like:
101
- | - Input_Folder
102
- | - sample1_R1.fastq.gz
103
- | - sample1_R2.fastq.gz
104
- | - sample2_R1.fastq.gz
105
- | - sample2_R2.fastq.gz
106
- Set “--subfolder 1” if the file structure is like:
107
- | - Input_Folder
108
- | - Sample1_Folder
109
- | - sample1_R1.fastq.gz
110
- | - sample1_R2.fastq.gz
111
- | - Sample2_Folder
112
- | - sample2_R1.fastq.gz
113
- | - sample2_R2.fastq.gz
114
-
115
- The script “offtracker_qc.py” will create a “Trimmed_data” folder under /Your_Path_To_Input_Folder.
116
- If “-o /Your_Path_To_Output” is set, the output will be redirected to /Your_Path_To_Output.
117
- """
118
- ```
119
-
120
- ## Strand-specific mapping of Tracking-seq data
121
-
122
- ```bash
123
-
124
- # Generate snakemake config file for mapping
125
- # Results will be generated in /Your_Path_To_Output, if -o is not set, the output will be in the same folder as the fastq files
126
- offtracker_config.py -t 8 -g hg38 --blacklist hg38 \
127
- -r /Your_Path_To_Reference/hg38_genome.fa \
128
- -i /Your_Path_To_Reference/hg38_genome.chromap.index \
129
- -f /Your_Path_To_Trimmed_Data \
130
- -o /Your_Path_To_Output \
131
- --subfolder 0
132
-
133
- # Warning: Do not contain "fastq" or "fq" in the folder name, otherwise the program may treat the folder as a fastq file
134
- # This problem may be fixed in the future
135
-
136
- # Run the snakemake program
137
- cd /Your_Path_To_Fastq
138
- snakemake -np # dry run
139
- nohup snakemake --cores 16 1>sm_mapping.log 2>sm_mapping.err &
140
-
141
- ## about cores
142
- # --cores of snakemake must be larger than -t of offtracker_config.py
143
- # parallel number = cores/t
144
-
145
- ## about output
146
- # This part will generate "*.fw.scaled.bw" and ".rv.scaled.bw" for IGV visualization
147
- # "*.fw.bed" and "*.rv.bed" are used in the next part.
148
- ```
149
-
150
-
151
- ## Analyzing the genome-wide off-target sites
152
-
153
- ```bash
154
- # In this part, multiple samples in the same condition can be analyzed in a single run by pattern recognition of sample names
155
-
156
- offtracker_analysis.py -g hg38 --name "VEGFA2" \
157
- --exp 'Cas9_VEGFA2' \
158
- --control 'WT' \
159
- --outname 'Cas9_VEGFA_293' \
160
- -f /Your_Path_To_Output \
161
- --seqfolder /Your_Path_To_Candidates
162
-
163
- # --name: the same gRNA name you set when running offtracker_candidates.py
164
- # --exp/--control: add one or multiple patterns of file name in regular expressions
165
- # If multiple samples meet the pattern, their signals will be averaged. Thus, only samples with the same condition should be included in a single analysis.
166
-
167
- # This step will generate Offtracker_result_{outname}.csv
168
- # Default FDR is 0.05, which can be changed by --fdr. This will empirically make the threshold of Track score around 2.
169
- # Sites with Track score >=2, which is a empirical threshold, are output regardless of FDR.
170
- # Intermediate files are saved in ./temp folder, which can be deleted.
171
- # Keeping the intermediate files can make the analysis faster if involving previously analyzed samples (e.g. using the same control samples for different analyses)
172
- ```
173
-
174
- ## Off-target sequences visualization
175
-
176
- ```bash
177
- # After get the Offtracker_result_{outname}.csv, you can visualize the off-target sites with their genomic sequence with the following command:
178
-
179
- offtracker_plot.py --result Your_Offtracker_Result_CSV \
180
- --sgrna 'GACCCCCTCCACCCCGCCTC' --pam 'NGG'
181
-
182
- # The default output is a pdf file with Offtracker_result_{outname}.pdf
183
- # Assigning a specific output file with another suffix can change the format. e.g., "--output Offtracker_plot.png" will generate a png file.
184
- # The orange dash line indicates the empirical threshold of Track score = 2
185
- # Empirically, the off-target sites with Track score < 2 are less likely to be real off-target sites.
186
- ```
187
-
188
-
189
- ## Note1, when not using hg38 or mm10
190
-
191
- The default setting only includes chr1-chr22, chrX, chrY, and chrM. (only suitable for human and mouse) \
192
- If you are using reference genomes without "chr" at the beginning, or want to analyze all chromosomes or other species, you can set "--ignore_chr" when running offtracker_config.py to skip chromosome filter.
193
-
194
- Currently, this software is only ready-to-use for mm10 and hg38. For any other genome, e.g., hg19, please add a genome size file named "hg19.chrom.sizes" to .\offtracker\utility. Besides, add "--blacklist none" or "--blacklist Your_Blacklist" (e.g., ENCODE blacklist) when running offtracker_config.py, because we only include blacklists for mm10 and hg38.
195
-
196
- ## Note2
197
-
198
- The FDRs in the Tracking-seq result do not reflect the real off-target probability.
199
- It is strongly recommended to observe the "fw.scaled.bw" and "rv.scaled.bw" using genome browser like IGV to visually inspect each target location from the Tracking-seq result.
200
-
201
-
202
-
203
- # Example Data
204
-
205
- Here are example data that contains reads of chr6 from HEK293T cells edited with Cas9 + sgRNA VEGFA_site_2 (VEGFA2) and reads of chr6 from wild type HEK293T cells:
206
-
207
- https://figshare.com/articles/dataset/WT_HEK239T_chr6/25956034
208
-
209
- It takes about 5-10 minutes to run the mapping (offtracker_config.py & snakemake) of example data with -t 8 and --cores 16 (2 parallel tasks)
210
-
211
- ## Signal visualization
212
-
213
- After mapping, there will be 4 .bw files in the output folder:
214
- ```bash
215
- Cas9_VEGFA2_chr6.fw.scaled.bw
216
-
217
- Cas9_VEGFA2_chr6.rv.scaled.bw
218
-
219
- WT_chr6.fw.scaled.bw
220
-
221
- WT_chr6.rv.scaled.bw
222
- ```
223
- These files can be visualized in genome browser like IGV:
224
-
225
- ![signal](https://github.com/Lan-lab/offtracker/blob/main/example_output/signals_example.png?raw=true)
226
-
227
- The signal (coverage) for each sample is normalized to 1e7/total_reads. As only reads mapping to chr6 were extracted in the example data, the signal range is much higher than that of the whole genome samples.
228
-
229
- ## Whole genome off-target analysis
230
-
231
- For analyzing the signals (offtracker_analysis.py), it takes about 3-5 minutes and outputs a file named "Offtracker_result_{outname}.csv"
232
-
233
- After that, you can visualize the off-target sites with their genomic sequence (offtracker_plot.py) and get an image like this:
234
-
235
- ![offtarget](https://github.com/Lan-lab/offtracker/blob/main/example_output/sequences_example.png?raw=true)
236
-
237
-
238
- After finishing the pipeline, if “chr6:31400832-31400854” and “chr6:31495044-31495066” are missing in the plot, it is most likely due to either:
239
-
240
- • Using a hard-masked reference genome (where repeats are replaced with 'N's)
241
-
242
- The presence of alternate loci (e.g., chr6_GL000256v2_alt) in the genome.
243
-
244
- These two off-target sites locate in the region of MHC class I chain-related protein A and B (MICA and MICB), which is polymorphic (resulting in alternate loci in contigs like “chr6_GL000256v2_alt) and contains interspersed repeats (resulting in sequences masked by capital 'N's in a hard-masked genome). Please try again with unmasked or soft-masked genome without alternate loci.
245
-
246
-
247
-
248
- # Citation
249
-
250
- If you use Tracking-seq or OFF-TRACKER in your research, please cite the following paper:
251
-
252
- Zhu, M., Xu, R., Yuan, J., Wang, J. et al. Tracking-seq reveals the heterogeneity of off-target effects in CRISPR–Cas9-mediated genome editing. Nat Biotechnol (2024). https://doi.org/10.1038/s41587-024-02307-y
253
-
254
- The signal visualization of .bw file here was generated by the Integrative Genomics Viewer (IGV) software. The signal visualization in the Tracking-seq article above was generated by either IGV or pyGenomeTracks:
255
-
256
- Robinson, J., Thorvaldsdóttir, H., Winckler, W. et al. Integrative genomics viewer. Nat Biotechnol 29, 24–26 (2011). https://doi.org/10.1038/nbt.1754
257
-
258
- Lopez-Delisle L, Rabbani L, Wolff J, Bhardwaj V, Backofen R, Grüning B, Ramírez F, Manke T. pyGenomeTracks: reproducible plots for multivariate genomic data sets. Bioinformatics. 2020 Aug 3:btaa692. doi: 10.1093/bioinformatics/btaa692.
259
-
1
+ # Offtracker
2
+
3
+ Offtracker 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).
4
+
5
+ ## System requirements
6
+
7
+ * Linux/Unix
8
+ * Python >= 3.6
9
+
10
+ ## Dependency
11
+
12
+ ```bash
13
+ # We recommend creating a new environment using mamba/conda to avoid compatibility problems
14
+ # If you don't use mamba, just replace the code with conda
15
+ # Windows systems may not be compatible with pybedtools.
16
+ mamba create -n offtracker -c bioconda blast snakemake pybedtools deeptools chromap
17
+ ```
18
+
19
+
20
+ ## Installation
21
+
22
+
23
+ ```bash
24
+ # Activate the environment
25
+ conda activate offtracker
26
+
27
+ # Direct installation with pip
28
+ pip install offtracker
29
+
30
+ # (Alternative) Download the offtracker from github
31
+ git clone https://github.com/Lan-lab/offtracker.git
32
+ cd offtracker
33
+ pip install .
34
+ ```
35
+
36
+
37
+ ## Before analyzing samples
38
+
39
+ **Important: Do not use hard-masked genome.fa**, in which repeats are masked by capital Ns and reads should have been mapped to these region (e.g. MHC region) will be lost. Besides, the genome.fa **should not contain alternate loci** like chr2_KI270776v1_alt and chr6_GL000256v2_alt, which may cause multi-mappings and the reads may be discarded.
40
+
41
+
42
+ **!! Do not use any of these two .fa files !!** \
43
+ For example, https://hgdownload.soe.ucsc.edu/goldenPath/hg38/bigZips/hg38.fa.gz is soft-masked genome with alternate loci. https://hgdownload.soe.ucsc.edu/goldenPath/hg38/bigZips/hg38.fa.masked.gz is hard-masked genome. **Do not** use these two as reference genome. \
44
+ **!! Do not use any of these two .fa files !!**
45
+
46
+
47
+
48
+ http://cistrome.org/~galib/MAESTRO/references/scATAC/Refdata_scATAC_MAESTRO_GRCh38_1.1.0.tar.gz is the genome used for the example data.
49
+
50
+
51
+ ```bash
52
+ # The following command can be used to check whether alternate loci of chr6 are present in the reference genome.
53
+ grep "^>chr6" genome.fa
54
+ ```
55
+
56
+ ```bash
57
+ # Build chromap index (only need once for each genome)
58
+ chromap -i -r /Your_Path_To_Reference/hg38_genome.fa \
59
+ -o /Your_Path_To_Reference/hg38_genome.chromap.index
60
+
61
+ # Build blast index (only need once for each genome)
62
+ makeblastdb -input_type fasta -title hg38 -dbtype nucl -parse_seqids \
63
+ -in /Your_Path_To_Reference/hg38_genome.fa \
64
+ -out /Your_Path_To_Reference/hg38_genome.blastdb \
65
+ -logfile /Your_Path_To_Reference/hg38_genome.blastdb.log
66
+
67
+ # Generate candidate regions by sgRNA sequence (need once for each genome and sgRNA)
68
+ # --name: a user-defined name of the sgRNA, which will be used in the following analysis.
69
+ offtracker_candidates.py -t 8 -g hg38 \
70
+ -r /Your_Path_To_Reference/hg38_genome.fa \
71
+ -b /Your_Path_To_Reference/hg38_genome.blastdb \
72
+ --name 'VEGFA2' --sgrna 'GACCCCCTCCACCCCGCCTC' --pam 'NGG' \
73
+ -o /Your_Path_To_Candidates_Folder
74
+
75
+ # If analyzing Cas12a, whose pam is upstream of the sgRNA, add this:
76
+ --pam_location 'upstream'
77
+
78
+ ```
79
+
80
+
81
+ ## Quality control and adapter trimming
82
+
83
+ ```bash
84
+ # Generate snakemake config file for quality control and adapter trimming.
85
+ offtracker_qc.py -t 4 \
86
+ -f /Your_Path_To_Input_Folder \
87
+ --subfolder 0
88
+
89
+ cd /Your_Path_To_Input_Folder/Trimmed_data
90
+ snakemake -np # dry run to check whether everything is alright
91
+ nohup snakemake --cores 16 1>${outdir}/sm_qc.log 2>&1 &
92
+
93
+ """
94
+ Set “--subfolder 0” if the file structure is like:
95
+ | - Input_Folder
96
+ | - sample1_R1.fastq.gz
97
+ | - sample1_R2.fastq.gz
98
+ | - sample2_R1.fastq.gz
99
+ | - sample2_R2.fastq.gz
100
+ Set “--subfolder 1” if the file structure is like:
101
+ | - Input_Folder
102
+ | - Sample1_Folder
103
+ | - sample1_R1.fastq.gz
104
+ | - sample1_R2.fastq.gz
105
+ | - Sample2_Folder
106
+ | - sample2_R1.fastq.gz
107
+ | - sample2_R2.fastq.gz
108
+
109
+ The script “offtracker_qc.py” will create a “Trimmed_data” folder under /Your_Path_To_Input_Folder.
110
+ If “-o /Your_Path_To_Output” is set, the output will be redirected to /Your_Path_To_Output.
111
+ """
112
+ ```
113
+
114
+ ## Strand-specific mapping of Tracking-seq data
115
+
116
+ ```bash
117
+
118
+ # Generate snakemake config file for mapping
119
+ # Results will be generated in /Your_Path_To_Output, if -o is not set, the output will be in the same folder as the fastq files
120
+ offtracker_config.py -t 8 -g hg38 --blacklist hg38 \
121
+ -r /Your_Path_To_Reference/hg38_genome.fa \
122
+ -i /Your_Path_To_Reference/hg38_genome.chromap.index \
123
+ -f /Your_Path_To_Trimmed_Data \
124
+ -o /Your_Path_To_Output \
125
+ --subfolder 0
126
+
127
+ # Warning: Do not contain "fastq" or "fq" in the folder name, otherwise the program may treat the folder as a fastq file
128
+ # This problem may be fixed in the future
129
+
130
+ # Run the snakemake program
131
+ cd /Your_Path_To_Fastq
132
+ snakemake -np # dry run
133
+ nohup snakemake --cores 16 1>sm_mapping.log 2>sm_mapping.err &
134
+
135
+ ## about cores
136
+ # --cores of snakemake must be larger than -t of offtracker_config.py
137
+ # parallel number = cores/t
138
+
139
+ ## about output
140
+ # This part will generate "*.fw.scaled.bw" and ".rv.scaled.bw" for IGV visualization
141
+ # "*.fw.bed" and "*.rv.bed" are used in the next part.
142
+ ```
143
+
144
+
145
+ ## Analyzing the genome-wide off-target sites
146
+
147
+ ```bash
148
+ # In this part, multiple samples in the same condition can be analyzed in a single run by pattern recognition of sample names
149
+
150
+ offtracker_analysis.py -g hg38 --name "VEGFA2" \
151
+ --exp 'Cas9_VEGFA2' \
152
+ --control 'WT' \
153
+ --outname 'Cas9_VEGFA_293' \
154
+ -f /Your_Path_To_Output \
155
+ --seqfolder /Your_Path_To_Candidates
156
+
157
+ # --name: the same gRNA name you set when running offtracker_candidates.py
158
+ # --exp/--control: add one or multiple patterns of file name in regular expressions
159
+ # If multiple samples meet the pattern, their signals will be averaged. Thus, only samples with the same condition should be included in a single analysis.
160
+
161
+ # This step will generate Offtracker_result_{outname}.csv
162
+ # Default FDR is 0.05, which can be changed by --fdr. This will empirically make the threshold of Track score around 2.
163
+ # Sites with Track score >=2, which is a empirical threshold, are output regardless of FDR.
164
+ # Intermediate files are saved in ./temp folder, which can be deleted.
165
+ # Keeping the intermediate files can make the analysis faster if involving previously analyzed samples (e.g. using the same control samples for different analyses)
166
+ ```
167
+
168
+ ## Off-target sequences visualization
169
+
170
+ ```bash
171
+ # After get the Offtracker_result_{outname}.csv, you can visualize the off-target sites with their genomic sequence with the following command:
172
+
173
+ offtracker_plot.py --result Your_Offtracker_Result_CSV \
174
+ --sgrna 'GACCCCCTCCACCCCGCCTC' --pam 'NGG'
175
+
176
+ # The default output is a pdf file with Offtracker_result_{outname}.pdf
177
+ # Assigning a specific output file with another suffix can change the format. e.g., "--output Offtracker_plot.png" will generate a png file.
178
+ # The orange dash line indicates the empirical threshold of Track score = 2
179
+ # Empirically, the off-target sites with Track score < 2 are less likely to be real off-target sites.
180
+ ```
181
+
182
+
183
+ ## Note1, when not using hg38 or mm10
184
+
185
+ The default setting only includes chr1-chr22, chrX, chrY, and chrM. (only suitable for human and mouse) \
186
+ If you are using reference genomes without "chr" at the beginning, or want to analyze all chromosomes or other species, you can set "--ignore_chr" when running offtracker_config.py to skip chromosome filter.
187
+
188
+ Currently, this software is only ready-to-use for mm10 and hg38. For any other genome, e.g., hg19, please add a genome size file named "hg19.chrom.sizes" to .\offtracker\utility. Besides, add "--blacklist none" or "--blacklist Your_Blacklist" (e.g., ENCODE blacklist) when running offtracker_config.py, because we only include blacklists for mm10 and hg38.
189
+
190
+ ## Note2
191
+
192
+ The FDRs in the Tracking-seq result do not reflect the real off-target probability.
193
+ It is strongly recommended to observe the "fw.scaled.bw" and "rv.scaled.bw" using genome browser like IGV to visually inspect each target location from the Tracking-seq result.
194
+
195
+
196
+
197
+ # Example Data
198
+
199
+ Here are example data that contains reads of chr6 from HEK293T cells edited with Cas9 + sgRNA VEGFA_site_2 (VEGFA2) and reads of chr6 from wild type HEK293T cells:
200
+
201
+ https://figshare.com/articles/dataset/WT_HEK239T_chr6/25956034
202
+
203
+ It takes about 5-10 minutes to run the mapping (offtracker_config.py & snakemake) of example data with -t 8 and --cores 16 (2 parallel tasks)
204
+
205
+ To download the data with wget:
206
+ ```
207
+ wget --user-agent="Mozilla" https://figshare.com/ndownloader/files/46770337 -O WT_HEK239T_chr6_1.fq.gz
208
+ wget --user-agent="Mozilla" https://figshare.com/ndownloader/files/46770334 -O WT_HEK239T_chr6_2.fq.gz
209
+ wget --user-agent="Mozilla" https://figshare.com/ndownloader/files/46775599 -O Cas9_VEGFA2_chr6_1.fq.gz
210
+ wget --user-agent="Mozilla" https://figshare.com/ndownloader/files/46775602 -O Cas9_VEGFA2_chr6_2.fq.gz
211
+ ```
212
+
213
+ ## Signal visualization
214
+
215
+ After mapping, there will be 4 .bw files in the output folder:
216
+ ```bash
217
+ Cas9_VEGFA2_chr6.fw.scaled.bw
218
+
219
+ Cas9_VEGFA2_chr6.rv.scaled.bw
220
+
221
+ WT_chr6.fw.scaled.bw
222
+
223
+ WT_chr6.rv.scaled.bw
224
+ ```
225
+ These files can be visualized in genome browser like IGV:
226
+
227
+ ![signal](https://github.com/Lan-lab/offtracker/blob/main/example_output/signals_example.png?raw=true)
228
+
229
+ The signal (coverage) for each sample is normalized to 1e7/total_reads. As only reads mapping to chr6 were extracted in the example data, the signal range is much higher than that of the whole genome samples.
230
+
231
+ ## Whole genome off-target analysis
232
+
233
+ For analyzing the signals (offtracker_analysis.py), it takes about 3-5 minutes and outputs a file named "Offtracker_result_{outname}.csv"
234
+
235
+ After that, you can visualize the off-target sites with their genomic sequence (offtracker_plot.py) and get an image like this:
236
+
237
+ ![offtarget](https://github.com/Lan-lab/offtracker/blob/main/example_output/sequences_example.png?raw=true)
238
+
239
+
240
+ After finishing the pipeline, if “chr6:31400832-31400854” and “chr6:31495044-31495066” are missing in the plot, it is most likely due to either:
241
+
242
+ Using a hard-masked reference genome (where repeats are replaced with 'N's)
243
+
244
+ • The presence of alternate loci (e.g., chr6_GL000256v2_alt) in the genome.
245
+
246
+ These two off-target sites locate in the region of MHC class I chain-related protein A and B (MICA and MICB), which is polymorphic (resulting in alternate loci in contigs like “chr6_GL000256v2_alt”) and contains interspersed repeats (resulting in sequences masked by capital 'N's in a hard-masked genome). Please try again with unmasked or soft-masked genome without alternate loci.
247
+
248
+
249
+
250
+ # Citation
251
+
252
+ If you use Tracking-seq or OFF-TRACKER in your research, please cite the following paper:
253
+
254
+ Zhu, M., Xu, R., Yuan, J., Wang, J. et al. Tracking-seq reveals the heterogeneity of off-target effects in CRISPR–Cas9-mediated genome editing. Nat Biotechnol (2024). https://doi.org/10.1038/s41587-024-02307-y
255
+
256
+ The signal visualization of .bw file here was generated by the Integrative Genomics Viewer (IGV) software. The signal visualization in the Tracking-seq article above was generated by either IGV or pyGenomeTracks:
257
+
258
+ Robinson, J., Thorvaldsdóttir, H., Winckler, W. et al. Integrative genomics viewer. Nat Biotechnol 29, 24–26 (2011). https://doi.org/10.1038/nbt.1754
259
+
260
+ Lopez-Delisle L, Rabbani L, Wolff J, Bhardwaj V, Backofen R, Grüning B, Ramírez F, Manke T. pyGenomeTracks: reproducible plots for multivariate genomic data sets. Bioinformatics. 2020 Aug 3:btaa692. doi: 10.1093/bioinformatics/btaa692.
261
+
@@ -1,4 +1,4 @@
1
- __version__ = "2.13.2"
1
+ __version__ = "2.14.0"
2
2
  # 2023.08.11. v1.1.0 adding a option for not normalizing the bw file
3
3
  # 2023.10.26. v1.9.0 prerelease for v2.0
4
4
  # 2023.10.27. v2.0.0 大更新,还没微调
@@ -44,4 +44,5 @@ __version__ = "2.13.2"
44
44
  # 2025.07.18. v2.12.3 新增QC自动避免重复读取 trimmed fastq files
45
45
  # 2025.08.08. v2.13.0 测试 local realign 功能
46
46
  # 2025.08.09. v2.13.1 测试 correction 功能
47
- # 2025.08.09. v2.13.2 chromap + trim 参数
47
+ # 2025.08.09. v2.13.2 chromap + trim 参数
48
+ # 2025.10.05. v2.14.0 添加 threads 监控,在 offtracker_config.py 中添加 --cpu_help 选项进入互动模式,推荐 CPU 参数。