offtracker 2.7.10__zip → 2.10.1__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 (33) hide show
  1. {offtracker-2.7.10 → offtracker-2.10.1}/PKG-INFO +64 -20
  2. offtracker-2.7.10/offtracker.egg-info/PKG-INFO → offtracker-2.10.1/README.md +221 -189
  3. {offtracker-2.7.10 → offtracker-2.10.1}/offtracker/X_offplot.py +13 -2
  4. {offtracker-2.7.10 → offtracker-2.10.1}/offtracker/X_sequence.py +113 -7
  5. {offtracker-2.7.10 → offtracker-2.10.1}/offtracker/_version.py +9 -2
  6. offtracker-2.10.1/offtracker/snakefile/Snakefile_QC.smk +66 -0
  7. offtracker-2.10.1/offtracker/snakefile/Snakefile_offtracker.smk +249 -0
  8. offtracker-2.7.10/offtracker/mapping/1.1_bed2fr_v4.5.py → offtracker-2.10.1/offtracker/utility/1.1_bed2fr.py +6 -4
  9. offtracker-2.7.10/README.md → offtracker-2.10.1/offtracker.egg-info/PKG-INFO +233 -177
  10. offtracker-2.10.1/offtracker.egg-info/SOURCES.txt +28 -0
  11. {offtracker-2.7.10 → offtracker-2.10.1}/scripts/offtracker_analysis.py +10 -3
  12. offtracker-2.10.1/scripts/offtracker_candidates.py +318 -0
  13. {offtracker-2.7.10 → offtracker-2.10.1}/scripts/offtracker_config.py +28 -44
  14. offtracker-2.10.1/scripts/offtracker_qc.py +62 -0
  15. {offtracker-2.7.10 → offtracker-2.10.1}/setup.py +5 -4
  16. offtracker-2.7.10/offtracker/mapping/Snakefile_offtracker +0 -245
  17. offtracker-2.7.10/offtracker.egg-info/SOURCES.txt +0 -26
  18. offtracker-2.7.10/scripts/offtracker_candidates.py +0 -307
  19. {offtracker-2.7.10 → offtracker-2.10.1}/LICENSE.txt +0 -0
  20. {offtracker-2.7.10 → offtracker-2.10.1}/MANIFEST.in +0 -0
  21. {offtracker-2.7.10 → offtracker-2.10.1}/offtracker/X_offtracker.py +0 -0
  22. {offtracker-2.7.10 → offtracker-2.10.1}/offtracker/__init__.py +0 -0
  23. {offtracker-2.7.10/offtracker/mapping → offtracker-2.10.1/offtracker/utility}/1.3_bdg_normalize_v4.0.py +0 -0
  24. {offtracker-2.7.10/offtracker/mapping → offtracker-2.10.1/offtracker/utility}/bedGraphToBigWig +0 -0
  25. {offtracker-2.7.10/offtracker/mapping → offtracker-2.10.1/offtracker/utility}/hg38.chrom.sizes +0 -0
  26. {offtracker-2.7.10/offtracker/mapping → offtracker-2.10.1/offtracker/utility}/mm10.chrom.sizes +0 -0
  27. {offtracker-2.7.10/offtracker/mapping → offtracker-2.10.1/offtracker/utility}/offtracker_blacklist_hg38.merged.bed +0 -0
  28. {offtracker-2.7.10/offtracker/mapping → offtracker-2.10.1/offtracker/utility}/offtracker_blacklist_mm10.merged.bed +0 -0
  29. {offtracker-2.7.10 → offtracker-2.10.1}/offtracker.egg-info/dependency_links.txt +0 -0
  30. {offtracker-2.7.10 → offtracker-2.10.1}/offtracker.egg-info/requires.txt +0 -0
  31. {offtracker-2.7.10 → offtracker-2.10.1}/offtracker.egg-info/top_level.txt +0 -0
  32. {offtracker-2.7.10 → offtracker-2.10.1}/scripts/offtracker_plot.py +0 -0
  33. {offtracker-2.7.10 → offtracker-2.10.1}/setup.cfg +0 -0
@@ -1,177 +1,233 @@
1
- # OFF-TRACKER
2
-
3
- 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).
4
-
5
- ## System requirements
6
-
7
- * Linux/Unix
8
- * Python >= 3.6
9
-
10
- ## Dependency
11
-
12
- ```bash
13
- # We recommend creating a new enviroment using mamba/conda to avoid compatibility problems
14
- # If you don't use mamba, just replace the code with conda
15
- mamba create -n offtracker -c bioconda blast snakemake pybedtools
16
- ```
17
-
18
-
19
- ## Installation
20
-
21
- ```bash
22
- # Activate the environment
23
- conda activate offtracker
24
-
25
- # Direct installation with pip
26
- pip install offtracker
27
-
28
- # (Alternative) Download the offtracker from github
29
- git clone https://github.com/Lan-lab/offtracker.git
30
- cd offtracker
31
- pip install .
32
- ```
33
-
34
-
35
- ## Before analyzing samples
36
-
37
- ```bash
38
- # Build blast index (only need once for each genome)
39
- makeblastdb -input_type fasta -title hg38 -dbtype nucl -parse_seqids \
40
- -in /Your_Path_To_Reference/hg38_genome.fa \
41
- -out /Your_Path_To_Reference/hg38_genome.blastdb \
42
- -logfile /Your_Path_To_Reference/hg38_genome.blastdb.log
43
-
44
- # Build chromap index (only need once for each genome)
45
- chromap -i -r /Your_Path_To_Reference/hg38_genome.fa \
46
- -o /Your_Path_To_Reference/hg38_genome.chromap.index
47
-
48
- # Generate candidate regions by sgRNA sequence (need once for each genome and sgRNA)
49
- # --name: the name of the sgRNA, which will be used in the following analysis
50
- offtracker_candidates.py -t 8 -g hg38 \
51
- -r /Your_Path_To_Reference/hg38_genome.fa \
52
- -b /Your_Path_To_Reference/hg38_genome.blastdb \
53
- --name 'VEGFA2' --sgrna 'GACCCCCTCCACCCCGCCTC' --pam 'NGG' \
54
- -o /Your_Path_To_Candidates
55
-
56
- ```
57
-
58
- ## Strand-specific mapping of Tracking-seq data
59
-
60
- ```bash
61
- # Generate snakemake config file
62
- # --subfolder: If different samples are in seperate folders, set this to 1
63
- # if -o is not set, the output will be in the same folder as the fastq files
64
- offtracker_config.py -t 8 -g hg38 --blacklist hg38 \
65
- -r /Your_Path_To_Reference/hg38_genome.fa \
66
- -i /Your_Path_To_Reference/hg38_genome.chromap.index \
67
- -f /Your_Path_To_Fastq \
68
- -o /Your_Path_To_Output \
69
- --subfolder 0
70
-
71
- # Run the snakemake program
72
- cd /Your_Path_To_Fastq
73
- snakemake -np # dry run
74
- nohup snakemake --cores 16 1>snakemake.log 2>snakemake.err &
75
-
76
- ## about cores
77
- # --cores of snakemake must be larger than -t of offtracker_config.py
78
- # parallel number = cores/t
79
-
80
- ## about output
81
- # This part will generate "*.fw.scaled.bw" and ".rv.scaled.bw" for IGV visualization
82
- # "*.fw.bed" and "*.rv.bed" are used in the next part.
83
- ```
84
-
85
-
86
- ## Analyzing the genome-wide off-target sites
87
-
88
- ```bash
89
- # In this part, multiple samples in the same condition can be analyzed in a single run by pattern recogonization of sample names
90
-
91
- offtracker_analysis.py -g hg38 --name "VEGFA2" \
92
- --exp 'Cas9_VEGFA2' \
93
- --control 'WT' \
94
- --outname 'Cas9_VEGFA_293' \
95
- -f /Your_Path_To_Output \
96
- --seqfolder /Your_Path_To_Candidates
97
-
98
- # --name: the same gRNA name you set when running offtracker_candidates.py
99
- # --exp/--control: add one or multiple patterns of file name in regular expressions
100
- # 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.
101
-
102
- # This step will generate Offtracker_result_{outname}.csv
103
- # Default FDR is 0.05, which can be changed by --fdr. This will empirically make the threshold of Track score around 2.
104
- # Sites with Track score >=2, which is a empirical threshold, are output regardless of FDR.
105
- # Intermediate files are saved in ./temp folder, which can be deleted.
106
- # Keeping the intermediate files can make the analysis faster if involving previously analyzed samples (e.g. using the same control samples for different analyses)
107
- ```
108
-
109
- ## Off-target sequences visualization
110
-
111
- ```bash
112
- # After get the Offtracker_result_{outname}.csv, you can visualize the off-target sites with their genomic sequence with the following command:
113
-
114
- offtracker_plot.py --result Your_Offtracker_Result_CSV \
115
- --sgrna 'GACCCCCTCCACCCCGCCTC' --pam 'NGG'
116
-
117
- # The default output is a pdf file with Offtracker_result_{outname}.pdf
118
- # Change the suffix of the output file to change the format (e.g.: .png)
119
- # The orange dash line indicates the empirical threshold of Track score = 2
120
- # Empirically, the off-target sites with Track score < 2 are less likely to be real off-target sites.
121
- ```
122
-
123
-
124
- ## Note1
125
-
126
- The default setting only includes chr1-chr22, chrX, chrY, and chrM. Please make sure the reference genome contains "chr" at the beginning.
127
-
128
- Currently, this software is only ready-to-use for mm10 and hg38. For any other genome, e.g., hg19, please add genome size file named "hg19.chrom.sizes" to .\offtracker\mapping and instal manually. Besides, add "--blacklist none" or "--blacklist Your_Blacklist" (e.g., ENCODE blacklist) when running offtracker_config.py, because we only provide blacklists for mm10 and hg38.
129
-
130
- If you have a requirement for species other than human/mouse, please post an issue.
131
-
132
- ## Note2
133
-
134
- The FDRs in the Tracking-seq result do not reflect the real off-target probability.
135
- 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.
136
-
137
-
138
-
139
- # Example Data
140
-
141
- Here are example data that contains reads of chr6 from HEK293T cells edited with Cas9 + sgRNA VEGFA2 and wild type cells:
142
-
143
- https://figshare.com/articles/dataset/WT_HEK239T_chr6/25956034
144
-
145
- 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)
146
-
147
- ## Signal visualization
148
-
149
- After mapping, there will be 4 .bw files in the output folder:
150
- ```bash
151
- Cas9_VEGFA2_chr6.fw.scaled.bw
152
-
153
- Cas9_VEGFA2_chr6.rv.scaled.bw
154
-
155
- WT_chr6.fw.scaled.bw
156
-
157
- WT_chr6.rv.scaled.bw
158
- ```
159
- These files can be visualized in genome browser like IGV:
160
-
161
- ![signal](https://github.com/Lan-lab/offtracker/blob/main/example_output/signals_example.png?raw=true)
162
-
163
-
164
- ## Whole genome off-target analysis
165
-
166
- For analyzing the signals (offtracker_analysis.py), it takes about 3-5 minutes and outputs a file named "Offtracker_result_{outname}.csv"
167
-
168
- After that, you can visualize the off-target sites with their genomic sequence (offtracker_plot.py) and get an image like this:
169
-
170
- ![offtarget](https://github.com/Lan-lab/offtracker/blob/main/example_output/sequences_example.png?raw=true)
171
-
172
- # Citation
173
-
174
-
175
-
176
-
177
-
1
+ Metadata-Version: 2.1
2
+ Name: offtracker
3
+ Version: 2.10.1
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 chromap
29
+ ```
30
+
31
+
32
+ ## Installation
33
+
34
+ ```bash
35
+ # Activate the environment
36
+ conda activate offtracker
37
+
38
+ # Direct installation with pip
39
+ pip install offtracker
40
+
41
+ # (Alternative) Download the offtracker from github
42
+ git clone https://github.com/Lan-lab/offtracker.git
43
+ cd offtracker
44
+ pip install .
45
+ ```
46
+
47
+
48
+ ## Before analyzing samples
49
+
50
+ ```bash
51
+ # Build blast index (only need once for each genome)
52
+ makeblastdb -input_type fasta -title hg38 -dbtype nucl -parse_seqids \
53
+ -in /Your_Path_To_Reference/hg38_genome.fa \
54
+ -out /Your_Path_To_Reference/hg38_genome.blastdb \
55
+ -logfile /Your_Path_To_Reference/hg38_genome.blastdb.log
56
+
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
+ # Generate candidate regions by sgRNA sequence (need once for each genome and sgRNA)
62
+ # --name: a user-defined name of the sgRNA, which will be used in the following analysis.
63
+ offtracker_candidates.py -t 8 -g hg38 \
64
+ -r /Your_Path_To_Reference/hg38_genome.fa \
65
+ -b /Your_Path_To_Reference/hg38_genome.blastdb \
66
+ --name 'VEGFA2' --sgrna 'GACCCCCTCCACCCCGCCTC' --pam 'NGG' \
67
+ -o /Your_Path_To_Candidates_Folder
68
+
69
+ ```
70
+
71
+
72
+ ## Quality control and adapter trimming
73
+
74
+ ```bash
75
+ # Generate snakemake config file for quality control and adapter trimming.
76
+ offtracker_qc.py -t 4 \
77
+ -f /Your_Path_To_Input_Folder \
78
+ --subfolder 0
79
+
80
+ cd /Your_Path_To_Input_Folder/Trimmed_data
81
+ snakemake -np # dry run to check whether everything is alright
82
+ nohup snakemake --cores 16 1>${outdir}/sm_qc.log 2>&1 &
83
+
84
+ """
85
+ Set “--subfolder 0” if the file structure is like:
86
+ | - Input_Folder
87
+ | - sample1_R1.fastq.gz
88
+ | - sample1_R2.fastq.gz
89
+ | - sample2_R1.fastq.gz
90
+ | - sample2_R2.fastq.gz
91
+ Set “--subfolder 1” if the file structure is like:
92
+ | - Input_Folder
93
+ | - Sample1_Folder
94
+ | - sample1_R1.fastq.gz
95
+ | - sample1_R2.fastq.gz
96
+ | - Sample2_Folder
97
+ | - sample2_R1.fastq.gz
98
+ | - sample2_R2.fastq.gz
99
+
100
+ The script “offtracker_qc.py” will create a “Trimmed_data” folder under /Your_Path_To_Input_Folder.
101
+ If “-o /Your_Path_To_Output” is set, the output will be redirected to /Your_Path_To_Output.
102
+ """
103
+ ```
104
+
105
+ ## Strand-specific mapping of Tracking-seq data
106
+
107
+ ```bash
108
+
109
+ # Generate snakemake config file for mapping
110
+ # 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
111
+ offtracker_config.py -t 8 -g hg38 --blacklist hg38 \
112
+ -r /Your_Path_To_Reference/hg38_genome.fa \
113
+ -i /Your_Path_To_Reference/hg38_genome.chromap.index \
114
+ -f /Your_Path_To_Trimmed_Data \
115
+ -o /Your_Path_To_Output \
116
+ --subfolder 0
117
+
118
+ # Warning: Do not contain "fastq" or "fq" in the folder name, otherwise the program may treat the folder as a fastq file
119
+ # This problem may be fixed in the future
120
+
121
+ # Run the snakemake program
122
+ cd /Your_Path_To_Fastq
123
+ snakemake -np # dry run
124
+ nohup snakemake --cores 16 1>sm_mapping.log 2>sm_mapping.err &
125
+
126
+ ## about cores
127
+ # --cores of snakemake must be larger than -t of offtracker_config.py
128
+ # parallel number = cores/t
129
+
130
+ ## about output
131
+ # This part will generate "*.fw.scaled.bw" and ".rv.scaled.bw" for IGV visualization
132
+ # "*.fw.bed" and "*.rv.bed" are used in the next part.
133
+ ```
134
+
135
+
136
+ ## Analyzing the genome-wide off-target sites
137
+
138
+ ```bash
139
+ # In this part, multiple samples in the same condition can be analyzed in a single run by pattern recognition of sample names
140
+
141
+ offtracker_analysis.py -g hg38 --name "VEGFA2" \
142
+ --exp 'Cas9_VEGFA2' \
143
+ --control 'WT' \
144
+ --outname 'Cas9_VEGFA_293' \
145
+ -f /Your_Path_To_Output \
146
+ --seqfolder /Your_Path_To_Candidates
147
+
148
+ # --name: the same gRNA name you set when running offtracker_candidates.py
149
+ # --exp/--control: add one or multiple patterns of file name in regular expressions
150
+ # 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.
151
+
152
+ # This step will generate Offtracker_result_{outname}.csv
153
+ # Default FDR is 0.05, which can be changed by --fdr. This will empirically make the threshold of Track score around 2.
154
+ # Sites with Track score >=2, which is a empirical threshold, are output regardless of FDR.
155
+ # Intermediate files are saved in ./temp folder, which can be deleted.
156
+ # Keeping the intermediate files can make the analysis faster if involving previously analyzed samples (e.g. using the same control samples for different analyses)
157
+ ```
158
+
159
+ ## Off-target sequences visualization
160
+
161
+ ```bash
162
+ # After get the Offtracker_result_{outname}.csv, you can visualize the off-target sites with their genomic sequence with the following command:
163
+
164
+ offtracker_plot.py --result Your_Offtracker_Result_CSV \
165
+ --sgrna 'GACCCCCTCCACCCCGCCTC' --pam 'NGG'
166
+
167
+ # The default output is a pdf file with Offtracker_result_{outname}.pdf
168
+ # Assigning a specific output file with another suffix can change the format. e.g., "--output Offtracker_plot.png" will generate a png file.
169
+ # The orange dash line indicates the empirical threshold of Track score = 2
170
+ # Empirically, the off-target sites with Track score < 2 are less likely to be real off-target sites.
171
+ ```
172
+
173
+
174
+ ## Note1, when not using hg38 or mm10
175
+
176
+ The default setting only includes chr1-chr22, chrX, chrY, and chrM. (only suitable for human and mouse) \
177
+ 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.
178
+
179
+ 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.
180
+
181
+ ## Note2
182
+
183
+ The FDRs in the Tracking-seq result do not reflect the real off-target probability.
184
+ 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.
185
+
186
+
187
+
188
+ # Example Data
189
+
190
+ Here are example data that contains reads of chr6 from HEK293T cells edited with Cas9 + sgRNA VEGFA2 and wild type cells:
191
+
192
+ https://figshare.com/articles/dataset/WT_HEK239T_chr6/25956034
193
+
194
+ 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)
195
+
196
+ ## Signal visualization
197
+
198
+ After mapping, there will be 4 .bw files in the output folder:
199
+ ```bash
200
+ Cas9_VEGFA2_chr6.fw.scaled.bw
201
+
202
+ Cas9_VEGFA2_chr6.rv.scaled.bw
203
+
204
+ WT_chr6.fw.scaled.bw
205
+
206
+ WT_chr6.rv.scaled.bw
207
+ ```
208
+ These files can be visualized in genome browser like IGV:
209
+
210
+ ![signal](https://github.com/Lan-lab/offtracker/blob/main/example_output/signals_example.png?raw=true)
211
+
212
+ 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.
213
+
214
+ ## Whole genome off-target analysis
215
+
216
+ For analyzing the signals (offtracker_analysis.py), it takes about 3-5 minutes and outputs a file named "Offtracker_result_{outname}.csv"
217
+
218
+ After that, you can visualize the off-target sites with their genomic sequence (offtracker_plot.py) and get an image like this:
219
+
220
+ ![offtarget](https://github.com/Lan-lab/offtracker/blob/main/example_output/sequences_example.png?raw=true)
221
+
222
+ # Citation
223
+
224
+ If you use Tracking-seq or OFF-TRACKER in your research, please cite the following paper:
225
+
226
+ 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
227
+
228
+ 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:
229
+
230
+ 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
231
+
232
+ 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.
233
+
@@ -0,0 +1,28 @@
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/snakefile/Snakefile_QC.smk
16
+ offtracker/snakefile/Snakefile_offtracker.smk
17
+ offtracker/utility/1.1_bed2fr.py
18
+ offtracker/utility/1.3_bdg_normalize_v4.0.py
19
+ offtracker/utility/bedGraphToBigWig
20
+ offtracker/utility/hg38.chrom.sizes
21
+ offtracker/utility/mm10.chrom.sizes
22
+ offtracker/utility/offtracker_blacklist_hg38.merged.bed
23
+ offtracker/utility/offtracker_blacklist_mm10.merged.bed
24
+ scripts/offtracker_analysis.py
25
+ scripts/offtracker_candidates.py
26
+ scripts/offtracker_config.py
27
+ scripts/offtracker_plot.py
28
+ scripts/offtracker_qc.py
@@ -27,6 +27,7 @@ def main():
27
27
  parser.add_argument('--exp' , type=str, default='all', nargs='+', help='A substring mark in the name of experimental samples. The default is to use all samples other than control' )
28
28
  parser.add_argument('--control' , type=str, default='none', nargs='+', help='A substring mark in the name of control samples. The default is no control. "others" for all samples other than --exp.' )
29
29
  parser.add_argument('--fdr' , type=int, default=0.05, help='FDR threshold for the final result. Default is 0.05.')
30
+ parser.add_argument('--score' , type=int, default=2, help='Track score threshold for the final result. Default is 2.')
30
31
  parser.add_argument('--smooth' , type=int, default=1, help='Smooth strength for the signal.')
31
32
  parser.add_argument('--window' , type=int, default=3, help='Window size for smoothing the signal.')
32
33
  parser.add_argument('--binsize' , type=int, default=100, help='Window size for smoothing the signal.')
@@ -42,6 +43,7 @@ def main():
42
43
  parser.add_argument('--overwrite' , action='store_true', help='Whether to overwrite existed dataframes.' )
43
44
  parser.add_argument('--clean' , action='store_true', help='Whether to remove temp files')
44
45
 
46
+
45
47
  args = parser.parse_args()
46
48
 
47
49
  print(f'Runing offtracker verision: {offtracker.__version__}')
@@ -51,6 +53,7 @@ def main():
51
53
  pattern_exp = args.exp
52
54
  pattern_ctr = args.control
53
55
  fdr_thresh = args.fdr
56
+ score_thresh = args.score
54
57
  binsize = args.binsize
55
58
  flank_max = args.flank_max
56
59
  flank_regions = args.flank_regions
@@ -95,6 +98,8 @@ def main():
95
98
  all_sample_files.extend( bdg_files )
96
99
  all_sample_files = pd.Series(all_sample_files)
97
100
  all_sample_names = pd.Series(all_sample_names)
101
+ print('all sample names in the folders:')
102
+ print(all_sample_names)
98
103
  print('your string pattern for experimental groups: ', pattern_exp)
99
104
  ctr_samples = []
100
105
  if pattern_ctr == 'none':
@@ -341,14 +346,16 @@ def main():
341
346
  print('mean_score:{:.3f};std:{:.3f}'.format(mu,std))
342
347
  # pv and fdr
343
348
  df_result['pv'] = df_result[f'log2_track_score'].apply( lambda x: norm.sf(x,loc=mu,scale=std) )
344
- df_result['pv'].clip(lower=1e-320,inplace=True)
349
+ df_result['pv'] = df_result['pv'].clip(lower=1e-320)
345
350
  df_result['fdr'] = offtracker.fdr(df_result['pv'])
346
351
  df_result['rank'] = range(1,len(df_result)+1)
347
352
  df_result.to_csv(output)
348
353
  # 2024.06.03. 以防 fdr<=fdr_thresh 滤掉了 track_score>=2 的位点
349
354
  bool_fdr = df_result['fdr']<=fdr_thresh
350
- bool_score = df_result['track_score']>=2
351
- df_output = df_result[bool_fdr|bool_score].copy()
355
+ bool_score = df_result['track_score']>=score_thresh
356
+ # 2025.06.05. BE可能会形成单边信号,导致 track_score 为负数,也保留
357
+ bool_neg_score = df_result['track_score']<0
358
+ df_output = df_result[bool_fdr|bool_score|bool_neg_score].copy()
352
359
  if pattern_ctr != 'none':
353
360
  df_output = df_output[['target_location', 'best_strand','best_target','deletion','insertion','mismatch',
354
361
  'exp_L_length', 'exp_R_length','ctr_L_length','ctr_R_length','L_length','R_length','signal_length',