cellmaps-utils 0.10.0__py3-none-any.whl

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.
@@ -0,0 +1,392 @@
1
+
2
+ import argparse
3
+
4
+
5
+ class ArgParseFormatter(argparse.ArgumentDefaultsHelpFormatter,
6
+ argparse.RawDescriptionHelpFormatter):
7
+ """
8
+ Combine two :py:class:`argparse` Formatters to get help
9
+ and default values
10
+ displayed when showing help
11
+
12
+ """
13
+ pass
14
+
15
+
16
+ LOG_FORMAT = "%(asctime)-15s %(levelname)s %(relativeCreated)dms " \
17
+ "%(filename)s::%(funcName)s():%(lineno)d %(message)s"
18
+ """
19
+ Sets format of logging messages
20
+ """
21
+
22
+ RO_CRATE_METADATA_FILE = 'ro-crate-metadata.json'
23
+ """
24
+ `rocrate <https://www.researchobject.org/ro-crate>`__ metadata JSON file name
25
+ """
26
+
27
+ PROVENANCE_ERRORS_FILE = 'provenance_errors.json'
28
+ """
29
+ Contains log of any failed fairscape-cli calls
30
+ """
31
+
32
+ TASK_FILE_PREFIX = 'task_'
33
+ """
34
+ Prefix for task file
35
+ """
36
+
37
+ TASK_START_FILE_SUFFIX = '_start.json'
38
+ """
39
+ Suffix for task start file
40
+ """
41
+
42
+ TASK_FINISH_FILE_SUFFIX = '_finish.json'
43
+ """
44
+ Suffix for task finish file
45
+ """
46
+
47
+ OUTPUT_LOG_FILE = 'output.log'
48
+ """
49
+ Output log file name
50
+ """
51
+
52
+ ERROR_LOG_FILE = 'error.log'
53
+ """
54
+ Error log file name
55
+ """
56
+
57
+ IMAGE_EMBEDDING_FILE = 'image_emd.tsv'
58
+ """
59
+ Name of image embedding file
60
+ """
61
+
62
+ IMAGE_LABELS_PROBABILITY_FILE = 'labels_prob.tsv'
63
+ """
64
+ Name of image labels probability file
65
+ """
66
+
67
+ PPI_EMBEDDING_FILE = 'ppi_emd.tsv'
68
+ """
69
+ Name of Protein to Protein embedding file
70
+ """
71
+
72
+ CO_EMBEDDING_FILE = 'coembedding_emd.tsv'
73
+ """
74
+ Name of file containing coembedding
75
+ """
76
+
77
+ IMAGE_GENE_NODE_ATTR_FILE = 'image_gene_node_attributes.tsv'
78
+ """
79
+ Image gene node attributes filename
80
+ """
81
+
82
+ IMAGE_GENE_NODE_ERRORS_FILE = 'image_gene_node_attributes.errors'
83
+ """
84
+ Image gene node attributes errors filename
85
+ """
86
+
87
+ PERTURBATION_FILE = 'perturbation.h5ad'
88
+ """
89
+ Perturbation/CRISPRi h5ad file
90
+ """
91
+
92
+ ANTIBODY_GENE_TABLE_FILE = 'antibody_gene_table.tsv'
93
+ """
94
+ Antibody Gene Table file
95
+ """
96
+
97
+ IMAGE_GENE_NODE_NAME_COL = 'name'
98
+ """
99
+ Gene Symbol name column
100
+ """
101
+
102
+ IMAGE_GENE_NODE_REPRESENTS_COL = 'represents'
103
+ """
104
+ Ensembl ids column
105
+ """
106
+
107
+ IMAGE_GENE_NODE_AMBIGUOUS_COL = 'ambiguous'
108
+ """
109
+ Ambiguous column
110
+ """
111
+
112
+ IMAGE_GENE_NODE_ANTIBODY_COL = 'antibody'
113
+ """
114
+ Antibody name column
115
+ """
116
+
117
+ IMAGE_GENE_NODE_FILENAME_COL = 'filename'
118
+ """
119
+ File name column
120
+ """
121
+
122
+ IMAGE_GENE_NODE_IMAGEURL_COL = 'imageurl'
123
+ """
124
+ Image URL column
125
+ """
126
+
127
+
128
+ IMAGE_GENE_NODE_COLS = [IMAGE_GENE_NODE_NAME_COL,
129
+ IMAGE_GENE_NODE_REPRESENTS_COL,
130
+ IMAGE_GENE_NODE_AMBIGUOUS_COL,
131
+ IMAGE_GENE_NODE_ANTIBODY_COL,
132
+ IMAGE_GENE_NODE_FILENAME_COL,
133
+ IMAGE_GENE_NODE_IMAGEURL_COL]
134
+ """
135
+ Columns in :py:const:`IMAGE_GENE_NODE_ATTR_FILE` file
136
+ """
137
+
138
+ APMS_TSV_FILE = 'apms.tsv'
139
+ """
140
+ AP-MS tsv file
141
+ """
142
+
143
+ APMS_UNFILTERED_TSV_FILE = 'apms_unfiltered.tsv'
144
+ """
145
+ AP-MS tsv file containing the complete pre-filter matrix. Same schema
146
+ as :py:const:`APMS_TSV_FILE`
147
+ """
148
+
149
+ APMS_DRUG_EFFECT_TSV_FILE = 'apms_drug_effect.tsv'
150
+ """
151
+ MSstats drug effect tsv file. Only written for the treated RO-Crate.
152
+ Joins to :py:const:`APMS_TSV_FILE` on Batch, Bait, Prey
153
+ """
154
+
155
+ APMS_QC_FILE = 'apms_qc.json'
156
+ """
157
+ AP-MS QC/summary statistics file
158
+ """
159
+
160
+ SECMS_TSV_FILE = 'sec_ms.tsv'
161
+ SECMS_REPLICATES_FILE = 'secms_replicates.tsv'
162
+ SECMS_GROUPS_FILE = 'secms_protein_groups.tsv'
163
+ SECMS_RUNS_FILE = 'secms_runs.tsv'
164
+ SECMS_ROWS_FILE = 'secms_rows.tsv'
165
+ SECMS_SOURCES_FILE = 'secms_sources.tsv'
166
+ SECMS_QC_FILE = 'secms_qc.json'
167
+
168
+ PPI_EDGELIST_FILE = 'ppi_edgelist.tsv'
169
+ """
170
+ Protein to Protein interaction edgelist file name
171
+ """
172
+
173
+ PPI_EDGELIST_GENEA_COL = 'geneA'
174
+ """
175
+ First column name
176
+ """
177
+
178
+ PPI_EDGELIST_GENEB_COL = 'geneB'
179
+ """
180
+ Second column name
181
+ """
182
+
183
+ PPI_EDGELIST_COLS = [PPI_EDGELIST_GENEA_COL,
184
+ PPI_EDGELIST_GENEB_COL]
185
+ """
186
+ Columns in :py:const:`PPI_EDGELIST_FILE`
187
+ """
188
+
189
+ WEIGHTED_PPI_EDGELIST_WEIGHT_COL = 'Weight'
190
+ """
191
+ weight column
192
+ """
193
+
194
+ WEIGHTED_PPI_EDGELIST_COLS = [PPI_EDGELIST_GENEA_COL,
195
+ PPI_EDGELIST_GENEB_COL,
196
+ WEIGHTED_PPI_EDGELIST_WEIGHT_COL]
197
+
198
+ PPI_GENE_NODE_ATTR_FILE = 'ppi_gene_node_attributes.tsv'
199
+ """
200
+ Protein to Protein gene node attributes file
201
+ """
202
+
203
+ PPI_GENE_NODE_COLS = ['name', 'represents', 'ambiguous', 'bait']
204
+ """
205
+ Columns in :py:const:`PPI_GENE_NODE_ATTR_FILE`
206
+ """
207
+
208
+ PPI_GENE_NODE_ERRORS_FILE = 'ppi_gene_node_attributes.errors'
209
+ """
210
+ Protein to Protein gene node attributes error filename
211
+ """
212
+
213
+ PPI_NETWORK_PREFIX = 'ppi'
214
+
215
+ HIERARCHY_NETWORK_PREFIX = 'hierarchy'
216
+ """
217
+ CX2 format hierarchy filename
218
+ """
219
+
220
+ HIERARCHY_PARENT_NETWORK_PREFIX = 'hierarchy_parent'
221
+ """
222
+ CX2 format hierarchy parent (interactome) filename
223
+ """
224
+
225
+ HIERARCHY_NODES_FILE = 'hierarchy_node_attributes.tsv'
226
+ """
227
+ Hierarchy node attributes file
228
+ """
229
+
230
+ CX_SUFFIX = '.cx'
231
+ """
232
+ Suffix for files in `CX <https://cytoscape.org/cx/specification/2022/01/11/cytoscape-exchange-format-specification-(version-1).html>`__ format
233
+ """
234
+
235
+ CX2_SUFFIX = '.cx2'
236
+ """
237
+ Suffix for files in `CX 2.0<https://cytoscape.org/cx/cx2/specification/2022/12/01/cytoscape-exchange-format-specification-(version-2).html>`__ format
238
+ """
239
+
240
+ HCX_SUFFIX = '.hcx'
241
+ """
242
+ Suffix for files in `HCX <https://cytoscape.org/cx>`__ format
243
+ """
244
+
245
+ RED = 'red'
246
+ """
247
+ Red color directory name and color name
248
+ in red color files
249
+ """
250
+
251
+ BLUE = 'blue'
252
+ """
253
+ Blue color directory name and color name
254
+ in blue color files
255
+ """
256
+ GREEN = 'green'
257
+ """
258
+ Green color directory name and color name
259
+ in green color files
260
+ """
261
+
262
+ YELLOW = 'yellow'
263
+ """
264
+ Yellow color directory name and color name
265
+ in yellow color files
266
+ """
267
+
268
+ COLORS = [RED, BLUE, GREEN, YELLOW]
269
+ """
270
+ List of colors
271
+ """
272
+
273
+ COLOR_INDEXS = {
274
+ 'red': 0,
275
+ 'green': 1,
276
+ 'blue': 2,
277
+ 'yellow': 0,
278
+ }
279
+ """
280
+ Indexes for colors in .jpeg image
281
+ """
282
+
283
+ COLOR_LABELS_MAP = {
284
+ GREEN: 'protein of interest',
285
+ RED: 'Microtubules (Tubulin antibody)',
286
+ BLUE: 'Nucleus (DAPI)',
287
+ YELLOW: 'ER (Calreticulin antibody)',
288
+ }
289
+ """
290
+ Map of what each color refers to
291
+ """
292
+
293
+ IMAGE_DOWNLOAD_STEP_DIR = '1.image_download'
294
+ """
295
+ Name of directory where downloaded images are stored
296
+ """
297
+
298
+ PPI_DOWNLOAD_STEP_DIR = '1.ppi_download'
299
+ """
300
+ Name of directory where downloaded PPI edge and
301
+ baitlist are stored
302
+ """
303
+
304
+ PPI_EMBEDDING_STEP_DIR = '2.ppi_embedding'
305
+ """
306
+ Name of directory where PPI embeddings are stored
307
+ """
308
+
309
+ IMAGE_EMBEDDING_STEP_DIR = '2.image_embedding_fold'
310
+ """
311
+ Name of directory where image embeddings are stored
312
+ """
313
+
314
+ COEMBEDDING_STEP_DIR = '3.coembedding_fold'
315
+ """
316
+ Name of directory where co-embeddings are stored
317
+ """
318
+
319
+ HIERARCHY_STEP_DIR = '4.hierarchy'
320
+ """
321
+ Name of directory where hierarchies are stored
322
+ """
323
+
324
+ HIERARCHYEVAL_STEP_DIR = '5.hierarchyeval'
325
+ """
326
+ Name of directory where hierarchy evaluations are stored
327
+ """
328
+
329
+ DATASET_INFO_FILE = 'dataset_info.json'
330
+ """
331
+ Name of file where information about a dataset is stored
332
+ """
333
+
334
+ DATASET_NAME = 'name'
335
+ """
336
+ Name of the dataset
337
+ """
338
+
339
+ DATASET_ORGANIZATION_NAME = 'organization_name'
340
+ """
341
+ Name of the organization
342
+ """
343
+
344
+ DATASET_PROJECT_NAME = 'project_name'
345
+ """
346
+ Name of the project
347
+ """
348
+
349
+ DATASET_RELEASE = 'release'
350
+ """
351
+ Release of the dataset
352
+ """
353
+
354
+ DATASET_CELL_LINE = 'cell_line'
355
+ """
356
+ Cell line
357
+ """
358
+
359
+ DATASET_TREATMENT = 'treatment'
360
+ """
361
+ Treatment
362
+ """
363
+
364
+ DATASET_TISSUE = 'tissue'
365
+ """
366
+ Tissue
367
+ """
368
+
369
+ DATASET_AUTHOR = 'author'
370
+ """
371
+ Author of the dataset
372
+ """
373
+
374
+ DATASET_SLICE = 'slice'
375
+ """
376
+ Slice
377
+ """
378
+
379
+ DATASET_GENE_SET = 'gene_set'
380
+ """
381
+ Gene set
382
+ """
383
+
384
+ DATASET_COLLECTION_SET = 'collection_set'
385
+ """
386
+ Collection set
387
+ """
388
+
389
+ DATASET_REPLICATES = 'replicates'
390
+ """
391
+ Replicates
392
+ """
@@ -0,0 +1,19 @@
1
+ @@H5AD@@ file
2
+ -----------------------------------------------------------
3
+
4
+ This file is a .h5ad file. Details about the data structure of this format
5
+ can be found here: https://anndata.readthedocs.io/en/latest/. This data is
6
+ a cell x gene matrix, with all preprocesing steps done in accordance to
7
+ single cell best practices guide
8
+ (https://www.sc-best-practices.org/conditions/perturbation_modeling.html#analysing-single-pooled-crispr-screens)
9
+ up to section 19.4.5. The .X layer is set to the 'X_pert' output of the
10
+ mixscape pipeline.
11
+
12
+ cell line: @@CELL_LINE@@
13
+ screening modality: perturb seq using CRISPR-dCas9-ZIM3
14
+ screen targets: @@NUM_SCREEN_TARGETS_AND_GENE_SET@@ genes
15
+ non-targeting controls: @@NUM_NON_TARGET_CTRLS@@
16
+ number of guides per perturbation: @@NUM_PERTURB_GUIDES@@
17
+ treatment: @@TREATMENT@@
18
+
19
+