|
36 | 36 |
|
37 | 37 | ___ |
38 | 38 |
|
39 | | -<details> |
40 | | - <summary>Benchmarking</summary> |
41 | | - <br> |
42 | | - |
43 | | - Benchmarking ScreenPro2 with other CRISPR screen analysis tools |
44 | | - |
45 | | - ### More thoughtful NGS read trimming recovers more sgRNA counts |
46 | | - |
47 | | - ### ScreenPro2 statistical analysis is more accurate than ScreenProcessing |
48 | | - |
49 | | - ### ScreenPro2 is more flexible than ScreenProcessing |
50 | | - |
51 | | - Not only does ScreenPro2 have more features than ScreenProcessing, but it is also more flexible. ScreenPro2 can process data from diverse CRISPR screen platforms and is designed to be modular to enable easy extension to custom CRISPR screen platforms or other commonly used platforms in addition to the ones currently implemented. |
52 | | - |
53 | | - ### ScreenPro2 is faster than ScreenProcessing |
54 | | - |
55 | | - Last but not least, ScreenPro2 runs faster than ScreenProcessing (thanks to [biobear](https://github.com/wheretrue/biobear)) for processing FASTQ files. |
56 | | - |
57 | | -</details> |
58 | | - |
59 | | -___ |
60 | | - |
61 | 39 | ## Installation |
62 | 40 | ScreenPro2 is available on [PyPI](https://pypi.org/project/ScreenPro2/) and can be installed with pip: |
63 | 41 | ```bash |
@@ -97,8 +75,6 @@ Data analysis for CRISPR screens with NGS readouts can be broken down into three |
97 | 75 |
|
98 | 76 | The first step in analyzing CRISPR screens with deep sequencing readouts is to process the FASTQ files and generate counts for each guide RNA element in the library. ScreenPro2 has built-in functionalities to process FASTQ files and generate counts for different types of CRISPR screens platforms (see [Supported CRISPR Screen Platforms](#supported-crispr-screen-platforms)). |
99 | 77 |
|
100 | | -___ |
101 | | - |
102 | 78 | <details> |
103 | 79 | <summary>Command Line Interface (CLI)</summary> |
104 | 80 | <br> |
@@ -133,11 +109,10 @@ ___ |
133 | 109 | -o <output-directory> |
134 | 110 | --write-count-matrix |
135 | 111 | ``` |
| 112 | + ___ |
136 | 113 |
|
137 | 114 | </details> |
138 | 115 |
|
139 | | -___ |
140 | | - |
141 | 116 | <details> |
142 | 117 | <summary>Python Package Usage</summary> |
143 | 118 | <br> |
@@ -205,85 +180,123 @@ ___ |
205 | 180 | ```python |
206 | 181 | adata = counter.build_counts_anndata() |
207 | 182 | ``` |
| 183 | + |
| 184 | + ___ |
208 | 185 |
|
209 | 186 | </details> |
210 | 187 |
|
211 | 188 | ### Step 2: Phenotype calculation |
212 | 189 |
|
213 | 190 | Once you have the counts, you can use ScreenPro2 `phenoscore` and `phenostats` modules to calculate the phenotype scores and statistics between screen arms. |
214 | 191 |
|
215 | | -#### Load Data |
216 | | -First, load your data into an `AnnData` object (see [anndata](https://anndata.readthedocs.io/en/latest/index.html) for more information). |
| 192 | +<details> |
| 193 | + <summary>Load Data</summary> |
| 194 | + <br> |
217 | 195 |
|
218 | | -The `AnnData` object must have the following contents: |
219 | | -- `adata.X` – counts matrix (samples x targets) where each value represents the sequencing count from NGS data. |
220 | | -- `adata.obs` – a pandas dataframe of samples metadata including "condition" and "replicate" columns. |
221 | | - - "condition": the condition for each sample in the experiment. |
222 | | - - "replicate": the replicate number for each sample in the experiment. |
223 | | -- `adata.var` – a pandas dataframe of targets in sgRNA library including "target" and "targetType" columns. |
224 | | - - "target": the target for each entry in reference sgRNA library. For single sgRNA libraries, this column can be |
225 | | - used to store gene names. For dual or multiple targeting sgRNA libraries, this column can be used to store gene pairs |
226 | | - or any other relevant information about the target. |
227 | | - - "targetType": the type of target for each entry in reference sgRNA library. Note that this column is used to |
228 | | - distinguish between different types of sgRNAs in the library and negative control sgRNAs can be defined as `"targetType" == "negative_control"`. |
229 | | - This is important for the phenotype calculation step. |
| 196 | + First, load your data into an `AnnData` object (see [anndata](https://anndata.readthedocs.io/en/latest/index.html) for more information). |
230 | 197 |
|
| 198 | + The `AnnData` object must have the following contents: |
| 199 | + - `adata.X` – counts matrix (samples x targets) where each value represents the sequencing count from NGS data. |
| 200 | + - `adata.obs` – a pandas dataframe of samples metadata including "condition" and "replicate" columns. |
| 201 | + - "condition": the condition for each sample in the experiment. |
| 202 | + - "replicate": the replicate number for each sample in the experiment. |
| 203 | + - `adata.var` – a pandas dataframe of targets in sgRNA library including "target" and "targetType" columns. |
| 204 | + - "target": the target for each entry in reference sgRNA library. For single sgRNA libraries, this column can be |
| 205 | + used to store gene names. For dual or multiple targeting sgRNA libraries, this column can be used to store gene pairs |
| 206 | + or any other relevant information about the target. |
| 207 | + - "targetType": the type of target for each entry in reference sgRNA library. Note that this column is used to |
| 208 | + distinguish between different types of sgRNAs in the library and negative control sgRNAs can be defined as `"targetType" == "negative_control"`. |
| 209 | + This is important for the phenotype calculation step. |
231 | 210 |
|
232 | | -ScreenPro2 has a built-in class for different types of CRISPR screen assays. Currently, there is a class called `PooledScreens` |
233 | | -that can be used to process data from pooled CRISPR screens. To create a `PooledScreens` object from an `AnnData` object, |
234 | | -you can use the following example code: |
235 | 211 |
|
236 | | -```python |
237 | | -import pandas as pd |
238 | | -import anndata as ad |
239 | | -from screenpro.assays import PooledScreens |
| 212 | + ScreenPro2 has a built-in class for different types of CRISPR screen assays. Currently, there is a class called `PooledScreens` |
| 213 | + that can be used to process data from pooled CRISPR screens. To create a `PooledScreens` object from an `AnnData` object, |
| 214 | + you can use the following example code: |
240 | 215 |
|
241 | | -adata = ad.AnnData( |
242 | | - X = counts_df, # pandas dataframe of counts (samples x targets) |
243 | | - obs = meta_df, # pandas dataframe of samples metadata including "condition" and "replicate" columns |
244 | | - var = target_df # pandas dataframe of targets metadata including "target" and "targetType" columns |
245 | | -) |
| 216 | + ```python |
| 217 | + import pandas as pd |
| 218 | + import anndata as ad |
| 219 | + from screenpro.assays import PooledScreens |
| 220 | + |
| 221 | + adata = ad.AnnData( |
| 222 | + X = counts_df, # pandas dataframe of counts (samples x targets) |
| 223 | + obs = meta_df, # pandas dataframe of samples metadata including "condition" and "replicate" columns |
| 224 | + var = target_df # pandas dataframe of targets metadata including "target" and "targetType" columns |
| 225 | + ) |
246 | 226 |
|
247 | | -screen = PooledScreens(adata) |
248 | | -``` |
| 227 | + screen = PooledScreens(adata) |
| 228 | + ``` |
249 | 229 |
|
250 | | -<img width="600" alt="image" src="https://github.com/ArcInstitute/ScreenPro2/assets/53412130/bb38d119-8f24-44fa-98ab-7ef4457ef8d2"> |
| 230 | + <img width="600" alt="image" src="https://github.com/ArcInstitute/ScreenPro2/assets/53412130/bb38d119-8f24-44fa-98ab-7ef4457ef8d2"> |
251 | 231 |
|
252 | | -#### Perform Screen Processing Analysis |
253 | | -Once the screen object is created, you can use several available workflows to calculate the phenotype scores and statisitics by comparing each entry in reference sgRNA library between screen arms. Then, these scores and statistics are used to nominate hits. |
| 232 | + ___ |
254 | 233 |
|
255 | | -##### Drug Screen Workflow: calculate `gamma`, `rho`, and `tau` scores |
256 | | -`.calculateDrugScreen` method can be used to calculate the enrichment of each gene between screen arms for a drug |
257 | | -screen experiment. This method calculates `gamma`, `rho`, and `tau` scores for each gene and adds them to the |
258 | | -`.phenotypes` attribute of the `PooledScreens` object. |
| 234 | +</details> |
259 | 235 |
|
260 | | -Here is an example for running the workflow on a [CRISPRi-dual-sgRNA-screens](#dcas9-crisprai-dual-sgrna-screens) dataset: |
| 236 | +<details> |
| 237 | + <summary>Run workflows</summary> |
| 238 | + <br> |
261 | 239 |
|
262 | | -```python |
263 | | -# Run the ScreenPro2 workflow for CRISPRi-dual-sgRNA-screens |
264 | | -screen.calculateDrugScreen( |
265 | | - t0='T0', |
266 | | - untreated='DMSO', # replace with the label for untreated condition |
267 | | - treated='Drug', # replace with the label for treated condition |
268 | | - score_level='compare_reps' |
269 | | -) |
270 | | -``` |
271 | | -___ |
272 | | -For example, in a Decitabine CRISPRi drug screen (see Figure 1B-C in [this bioRxiv paper](https://www.biorxiv.org/content/10.1101/2022.12.14.518457v2.full)), each phenotype score represents a comparison between different arms of the screen and `rho` scores shows the main drug phenotype as illustrated here: |
273 | | -<img width="800" alt="image" src="https://github.com/abearab/ScreenPro2/assets/53412130/b84b3e1f-e049-4da6-b63d-d4c72bc97cda"> |
| 240 | + Once the screen object is created, you can use several available workflows to calculate the phenotype scores and statisitics by comparing each entry in reference sgRNA library between screen arms. Then, these scores and statistics are used to nominate hits. |
274 | 241 |
|
275 | | -##### Flow cytometry based screen workflow: calculate phenotype score to compare high and low bins |
276 | | -`.calculateFlowBasedScreen` method can be used to calculate the enrichment of each target between high bin vs. low bin |
277 | | -of a flow cytometry-based screen experiment. This method calculates `PhenoScore` for each target and adds them to the |
278 | | -`.phenotypes` attribute of the `PooledScreens` object. |
| 242 | + ##### Drug Screen Workflow: calculate `gamma`, `rho`, and `tau` scores |
| 243 | + `.calculateDrugScreen` method can be used to calculate the enrichment of each gene between screen arms for a drug |
| 244 | + screen experiment. This method calculates `gamma`, `rho`, and `tau` scores for each gene and adds them to the |
| 245 | + `.phenotypes` attribute of the `PooledScreens` object. |
| 246 | + |
| 247 | + Here is an example for running the workflow on a [CRISPRi-dual-sgRNA-screens](#dcas9-crisprai-dual-sgrna-screens) dataset: |
| 248 | + |
| 249 | + ```python |
| 250 | + # Run the ScreenPro2 workflow for CRISPRi-dual-sgRNA-screens |
| 251 | + screen.calculateDrugScreen( |
| 252 | + t0='T0', |
| 253 | + untreated='DMSO', # replace with the label for untreated condition |
| 254 | + treated='Drug', # replace with the label for treated condition |
| 255 | + score_level='compare_reps' |
| 256 | + ) |
| 257 | + ``` |
| 258 | + ___ |
| 259 | + For example, in a Decitabine CRISPRi drug screen (see Figure 1B-C in [this bioRxiv paper](https://www.biorxiv.org/content/10.1101/2022.12.14.518457v2.full)), each phenotype score represents a comparison between different arms of the screen and `rho` scores shows the main drug phenotype as illustrated here: |
| 260 | + <img width="800" alt="image" src="https://github.com/abearab/ScreenPro2/assets/53412130/b84b3e1f-e049-4da6-b63d-d4c72bc97cda"> |
| 261 | + |
| 262 | + ##### Flow cytometry based screen workflow: calculate phenotype score to compare high and low bins |
| 263 | + `.calculateFlowBasedScreen` method can be used to calculate the enrichment of each target between high bin vs. low bin |
| 264 | + of a flow cytometry-based screen experiment. This method calculates `PhenoScore` for each target and adds them to the |
| 265 | + `.phenotypes` attribute of the `PooledScreens` object. |
| 266 | + |
| 267 | + ```python |
| 268 | + # Run the ScreenPro2 workflow for CRISPRi-dual-sgRNA-screens |
| 269 | + screen.calculateFlowBasedScreen( |
| 270 | + low_bin='low_bin', high_bin='high_bin', |
| 271 | + score_level='compare_reps' |
| 272 | + ) |
| 273 | + ``` |
| 274 | + ___ |
| 275 | + |
| 276 | +</details> |
| 277 | + |
| 278 | +<details> |
| 279 | + <summary>Benchmarking ScreenPro2 vs other CRISPR screen processing tools</summary> |
| 280 | + <br> |
| 281 | + |
| 282 | + Coming soon... |
| 283 | + |
| 284 | +</details> |
| 285 | + |
| 286 | + <!-- Benchmarking ScreenPro2 with other CRISPR screen analysis tools |
| 287 | +
|
| 288 | + ### More thoughtful NGS read trimming recovers more sgRNA counts |
| 289 | +
|
| 290 | + ### ScreenPro2 statistical analysis is more accurate than ScreenProcessing |
| 291 | +
|
| 292 | + ### ScreenPro2 is more flexible than ScreenProcessing |
| 293 | +
|
| 294 | + Not only does ScreenPro2 have more features than ScreenProcessing, but it is also more flexible. ScreenPro2 can process data from diverse CRISPR screen platforms and is designed to be modular to enable easy extension to custom CRISPR screen platforms or other commonly used platforms in addition to the ones currently implemented. |
| 295 | +
|
| 296 | + ### ScreenPro2 is faster than ScreenProcessing |
| 297 | +
|
| 298 | + Last but not least, ScreenPro2 runs faster than ScreenProcessing (thanks to [biobear](https://github.com/wheretrue/biobear)) for processing FASTQ files. --> |
279 | 299 |
|
280 | | -```python |
281 | | -# Run the ScreenPro2 workflow for CRISPRi-dual-sgRNA-screens |
282 | | -screen.calculateFlowBasedScreen( |
283 | | - low_bin='low_bin', high_bin='high_bin', |
284 | | - score_level='compare_reps' |
285 | | -) |
286 | | -``` |
287 | 300 |
|
288 | 301 | ### Step 3: Data visualization |
289 | 302 |
|
|
0 commit comments