cellmaps-utils 0.3.0__tar.gz → 0.4.0__tar.gz

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 (76) hide show
  1. cellmaps_utils-0.4.0/HISTORY.rst +49 -0
  2. cellmaps_utils-0.4.0/PKG-INFO +190 -0
  3. {cellmaps_utils-0.3.0 → cellmaps_utils-0.4.0}/cellmaps_utils/__init__.py +1 -1
  4. cellmaps_utils-0.4.0/cellmaps_utils/apms_readme.txt +85 -0
  5. {cellmaps_utils-0.3.0 → cellmaps_utils-0.4.0}/cellmaps_utils/apmstool.py +34 -5
  6. {cellmaps_utils-0.3.0 → cellmaps_utils-0.4.0}/cellmaps_utils/basecmdtool.py +18 -1
  7. {cellmaps_utils-0.3.0 → cellmaps_utils-0.4.0}/cellmaps_utils/constants.py +79 -1
  8. cellmaps_utils-0.4.0/cellmaps_utils/crispr_readme.txt +19 -0
  9. {cellmaps_utils-0.3.0 → cellmaps_utils-0.4.0}/cellmaps_utils/crisprtool.py +122 -135
  10. cellmaps_utils-0.4.0/cellmaps_utils/hidefconverter.py +126 -0
  11. cellmaps_utils-0.4.0/cellmaps_utils/ifimage_readme.txt +31 -0
  12. {cellmaps_utils-0.3.0 → cellmaps_utils-0.4.0}/cellmaps_utils/iftool.py +73 -15
  13. cellmaps_utils-0.4.0/cellmaps_utils/ndexupload.py +193 -0
  14. {cellmaps_utils-0.3.0 → cellmaps_utils-0.4.0}/cellmaps_utils/provenance.py +24 -8
  15. {cellmaps_utils-0.3.0 → cellmaps_utils-0.4.0}/cellmaps_utils/tabletool.py +48 -15
  16. cellmaps_utils-0.4.0/cellmaps_utils.egg-info/PKG-INFO +190 -0
  17. {cellmaps_utils-0.3.0 → cellmaps_utils-0.4.0}/cellmaps_utils.egg-info/SOURCES.txt +19 -1
  18. {cellmaps_utils-0.3.0 → cellmaps_utils-0.4.0}/cellmaps_utils.egg-info/requires.txt +2 -0
  19. {cellmaps_utils-0.3.0 → cellmaps_utils-0.4.0}/docs/index.rst +1 -0
  20. {cellmaps_utils-0.3.0 → cellmaps_utils-0.4.0}/docs/installation.rst +7 -0
  21. cellmaps_utils-0.4.0/docs/outputs.rst +48 -0
  22. cellmaps_utils-0.4.0/docs/usage.rst +478 -0
  23. {cellmaps_utils-0.3.0 → cellmaps_utils-0.4.0}/setup.py +4 -2
  24. cellmaps_utils-0.4.0/tests/data/images/blue.jpg +0 -0
  25. cellmaps_utils-0.4.0/tests/data/images/green.jpg +0 -0
  26. cellmaps_utils-0.4.0/tests/data/images/red.jpg +0 -0
  27. cellmaps_utils-0.4.0/tests/data/images/yellow.jpg +0 -0
  28. cellmaps_utils-0.4.0/tests/data/ro-crate-metadata.json +184 -0
  29. cellmaps_utils-0.4.0/tests/data/test_password +1 -0
  30. cellmaps_utils-0.4.0/tests/test_apmstool.py +214 -0
  31. cellmaps_utils-0.4.0/tests/test_basecommandlinetool.py +66 -0
  32. cellmaps_utils-0.4.0/tests/test_crisprtool.py +229 -0
  33. cellmaps_utils-0.4.0/tests/test_hidefconverter.py +44 -0
  34. cellmaps_utils-0.4.0/tests/test_iftool.py +403 -0
  35. {cellmaps_utils-0.3.0 → cellmaps_utils-0.4.0}/tests/test_integation_provenance.py +12 -7
  36. cellmaps_utils-0.4.0/tests/test_ndexupload.py +63 -0
  37. {cellmaps_utils-0.3.0 → cellmaps_utils-0.4.0}/tests/test_provenance.py +18 -0
  38. cellmaps_utils-0.4.0/tests/test_tabletool.py +92 -0
  39. cellmaps_utils-0.3.0/HISTORY.rst +0 -28
  40. cellmaps_utils-0.3.0/PKG-INFO +0 -159
  41. cellmaps_utils-0.3.0/cellmaps_utils.egg-info/PKG-INFO +0 -159
  42. cellmaps_utils-0.3.0/docs/usage.rst +0 -213
  43. cellmaps_utils-0.3.0/tests/test_basecommandlinetool.py +0 -38
  44. {cellmaps_utils-0.3.0 → cellmaps_utils-0.4.0}/AUTHORS.rst +0 -0
  45. {cellmaps_utils-0.3.0 → cellmaps_utils-0.4.0}/CONTRIBUTING.rst +0 -0
  46. {cellmaps_utils-0.3.0 → cellmaps_utils-0.4.0}/LICENSE +0 -0
  47. {cellmaps_utils-0.3.0 → cellmaps_utils-0.4.0}/MANIFEST.in +0 -0
  48. {cellmaps_utils-0.3.0 → cellmaps_utils-0.4.0}/README.rst +0 -0
  49. {cellmaps_utils-0.3.0 → cellmaps_utils-0.4.0}/cellmaps_utils/cellmaps_utilscmd.py +0 -0
  50. {cellmaps_utils-0.3.0 → cellmaps_utils-0.4.0}/cellmaps_utils/exceptions.py +0 -0
  51. {cellmaps_utils-0.3.0 → cellmaps_utils-0.4.0}/cellmaps_utils/logutils.py +0 -0
  52. {cellmaps_utils-0.3.0 → cellmaps_utils-0.4.0}/cellmaps_utils/music_utils.py +0 -0
  53. {cellmaps_utils-0.3.0 → cellmaps_utils-0.4.0}/cellmaps_utils.egg-info/dependency_links.txt +0 -0
  54. {cellmaps_utils-0.3.0 → cellmaps_utils-0.4.0}/cellmaps_utils.egg-info/not-zip-safe +0 -0
  55. {cellmaps_utils-0.3.0 → cellmaps_utils-0.4.0}/cellmaps_utils.egg-info/top_level.txt +0 -0
  56. {cellmaps_utils-0.3.0 → cellmaps_utils-0.4.0}/docs/Makefile +0 -0
  57. {cellmaps_utils-0.3.0 → cellmaps_utils-0.4.0}/docs/_build/html/_static/file.png +0 -0
  58. {cellmaps_utils-0.3.0 → cellmaps_utils-0.4.0}/docs/_build/html/_static/minus.png +0 -0
  59. {cellmaps_utils-0.3.0 → cellmaps_utils-0.4.0}/docs/_build/html/_static/plus.png +0 -0
  60. {cellmaps_utils-0.3.0 → cellmaps_utils-0.4.0}/docs/authors.rst +0 -0
  61. {cellmaps_utils-0.3.0 → cellmaps_utils-0.4.0}/docs/cellmaps_utils.rst +0 -0
  62. {cellmaps_utils-0.3.0 → cellmaps_utils-0.4.0}/docs/conf.py +0 -0
  63. {cellmaps_utils-0.3.0 → cellmaps_utils-0.4.0}/docs/contributing.rst +0 -0
  64. {cellmaps_utils-0.3.0 → cellmaps_utils-0.4.0}/docs/devbranches.rst +0 -0
  65. {cellmaps_utils-0.3.0 → cellmaps_utils-0.4.0}/docs/developer.rst +0 -0
  66. {cellmaps_utils-0.3.0 → cellmaps_utils-0.4.0}/docs/history.rst +0 -0
  67. {cellmaps_utils-0.3.0 → cellmaps_utils-0.4.0}/docs/integrationtesting.rst +0 -0
  68. {cellmaps_utils-0.3.0 → cellmaps_utils-0.4.0}/docs/make.bat +0 -0
  69. {cellmaps_utils-0.3.0 → cellmaps_utils-0.4.0}/docs/modules.rst +0 -0
  70. {cellmaps_utils-0.3.0 → cellmaps_utils-0.4.0}/docs/newrelease.rst +0 -0
  71. {cellmaps_utils-0.3.0 → cellmaps_utils-0.4.0}/docs/pypircfile.rst +0 -0
  72. {cellmaps_utils-0.3.0 → cellmaps_utils-0.4.0}/docs/versioningscheme.rst +0 -0
  73. {cellmaps_utils-0.3.0 → cellmaps_utils-0.4.0}/setup.cfg +0 -0
  74. {cellmaps_utils-0.3.0 → cellmaps_utils-0.4.0}/tests/__init__.py +0 -0
  75. {cellmaps_utils-0.3.0 → cellmaps_utils-0.4.0}/tests/test_helloworldcommand.py +0 -0
  76. {cellmaps_utils-0.3.0 → cellmaps_utils-0.4.0}/tests/test_logutils.py +0 -0
@@ -0,0 +1,49 @@
1
+ =======
2
+ History
3
+ =======
4
+
5
+ 0.4.0 (2024-07-02)
6
+ -------------------
7
+
8
+ * Updated provenance utils, added checks in for missing data in input RO-Crate,
9
+ and allowing to continue but logging errors in the process
10
+
11
+ * Add ``HierarchyToHiDeFConverter``, a class to convert a hierarchy network
12
+ (in CX2 format) to a HiDeF format nodes and edges lists.
13
+
14
+ * Add ``NDExHierarchyUploader``, a class for uploading hierarchy and
15
+ its parent network to NDEx.
16
+
17
+ * Updated ``cellmaps_utilscmd.py`` ``apmsconverter``, ``ifconverter``,
18
+ ``crisprconverter`` to support tissue as well as output
19
+ ``data_info.json`` file to resulting RO-Crate so subsequent tools can
20
+ more easily get provenance information
21
+
22
+
23
+ * Updated ``cellmaps_utilscmd.py crisprconverter`` to consume ``.h5ad``
24
+ files and updated readme.txt file
25
+
26
+ 0.3.0 (2024-04-15)
27
+ -------------------
28
+
29
+ * Bumped fairscape-cli dependency to ``0.2.0``
30
+
31
+
32
+ 0.2.0 (2024-02-20)
33
+ ------------------
34
+
35
+ * Bumped fairscape-cli dependency to ``0.1.14`` to support schemas
36
+
37
+ * Added support for ``schema`` to **data_dict** parameter in ``ProvenanceUtil.register_dataset()``
38
+
39
+ * Added ``--release`` flag to ``cellmaps_utilscmd.py rocratetable`` and
40
+ in output table renamed "Name of Computation" to "Name" as well as
41
+ added "Type", "Cell Line", "Treatment", "Gene set", and "Version" to
42
+ table output
43
+
44
+ * Set default logging level to ``ERROR`` for ``cellmaps_utilscmd.py`` command
45
+
46
+ 0.1.0 (2024-01-01)
47
+ ------------------
48
+
49
+ * First release on PyPI.
@@ -0,0 +1,190 @@
1
+ Metadata-Version: 2.1
2
+ Name: cellmaps_utils
3
+ Version: 0.4.0
4
+ Summary: Contains utilities needed by Cell Maps tools
5
+ Home-page: https://github.com/idekerlab/cellmaps_utils
6
+ Author: Cell Maps team
7
+ Author-email: tools@cm4ai.org
8
+ License: MIT license
9
+ Keywords: cellmaps_utils
10
+ Classifier: Development Status :: 2 - Pre-Alpha
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: License :: OSI Approved :: MIT License
13
+ Classifier: Natural Language :: English
14
+ Classifier: Programming Language :: Python :: 3.8
15
+ Classifier: Programming Language :: Python :: 3.9
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Description-Content-Type: text/x-rst
19
+ License-File: LICENSE
20
+ License-File: AUTHORS.rst
21
+ Requires-Dist: fairscape-cli==0.2.0
22
+ Requires-Dist: ndex2<4.0.0,>=3.8.0
23
+ Requires-Dist: scipy
24
+ Requires-Dist: scikit-learn
25
+ Requires-Dist: pandas
26
+ Requires-Dist: numpy
27
+ Requires-Dist: dill
28
+ Requires-Dist: tqdm
29
+ Requires-Dist: requests
30
+
31
+ =============================
32
+ Cell Maps Pipeline Utilities
33
+ =============================
34
+
35
+
36
+ .. image:: https://img.shields.io/pypi/v/cellmaps_utils.svg
37
+ :target: https://pypi.python.org/pypi/cellmaps_utils
38
+
39
+ .. image:: https://app.travis-ci.com/idekerlab/cellmaps_utils.svg?branch=main
40
+ :target: https://app.travis-ci.com/idekerlab/cellmaps_utils
41
+
42
+ .. image:: https://readthedocs.org/projects/cellmaps-utils/badge/?version=latest
43
+ :target: https://cellmaps-utils.readthedocs.io/en/latest/?badge=latest
44
+ :alt: Documentation Status
45
+
46
+ .. image:: https://zenodo.org/badge/599754117.svg
47
+ :target: https://zenodo.org/doi/10.5281/zenodo.10607322
48
+ :alt: Zenodo DOI badge
49
+
50
+ Contains utilities needed by various tools in the cell maps toolkit.
51
+
52
+
53
+ * Free software: MIT license
54
+ * Documentation: https://cellmaps-utils.readthedocs.io.
55
+ * Source code: https://github.com/idekerlab/cellmaps_utils
56
+
57
+ Dependencies
58
+ ------------
59
+
60
+ * `fairscape-cli <https://pypi.org/project/fairscape-cli>`__
61
+ * `scipy <https://pypi.org/project/scipy>`__
62
+ * `scikit-learn <https://pypi.org/project/scikit-learn>`__
63
+ * `pandas <https://pypi.org/project/pandas>`__
64
+ * `numpy <https://pypi.org/project/numpy>`__
65
+ * `dill <https://pypi.org/project/dill>`__
66
+
67
+ Compatibility
68
+ -------------
69
+
70
+ * Python 3.8+
71
+
72
+ Installation
73
+ ------------
74
+
75
+ .. code-block::
76
+
77
+ git clone https://github.com/idekerlab/cellmaps_utils
78
+ cd cellmaps_utils
79
+ make dist
80
+ pip install dist/cellmaps_utils*whl
81
+
82
+
83
+ Run **make** command with no arguments to see other build/deploy options including creation of Docker image
84
+
85
+ .. code-block::
86
+
87
+ make
88
+
89
+ Output:
90
+
91
+ .. code-block::
92
+
93
+ clean remove all build, test, coverage and Python artifacts
94
+ clean-build remove build artifacts
95
+ clean-pyc remove Python file artifacts
96
+ clean-test remove test and coverage artifacts
97
+ lint check style with flake8
98
+ test run tests quickly with the default Python
99
+ test-all run tests on every Python version with tox
100
+ coverage check code coverage quickly with the default Python
101
+ docs generate Sphinx HTML documentation, including API docs
102
+ servedocs compile the docs watching for changes
103
+ testrelease package and upload a TEST release
104
+ release package and upload a release
105
+ dist builds source and wheel package
106
+ install install the package to the active Python's site-packages
107
+
108
+ For developers
109
+ -------------------------------------------
110
+
111
+ To deploy development versions of this package
112
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
113
+
114
+ Below are steps to make changes to this code base, deploy, and then run
115
+ against those changes.
116
+
117
+ #. Make changes
118
+
119
+ Modify code in this repo as desired
120
+
121
+ #. Build and deploy
122
+
123
+ .. code-block::
124
+
125
+ # From base directory of this repo cellmaps_hierarchyeval
126
+ pip uninstall cellmaps_utils -y ; make clean dist; pip install dist/cellmaps_utils*whl
127
+
128
+
129
+
130
+ Credits
131
+ -------
132
+
133
+ This package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template
134
+
135
+
136
+ .. _Cookiecutter: https://github.com/audreyr/cookiecutter
137
+ .. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage
138
+ .. _NDEx: http://www.ndexbio.org
139
+
140
+
141
+
142
+ =======
143
+ History
144
+ =======
145
+
146
+ 0.4.0 (2024-07-02)
147
+ -------------------
148
+
149
+ * Updated provenance utils, added checks in for missing data in input RO-Crate,
150
+ and allowing to continue but logging errors in the process
151
+
152
+ * Add ``HierarchyToHiDeFConverter``, a class to convert a hierarchy network
153
+ (in CX2 format) to a HiDeF format nodes and edges lists.
154
+
155
+ * Add ``NDExHierarchyUploader``, a class for uploading hierarchy and
156
+ its parent network to NDEx.
157
+
158
+ * Updated ``cellmaps_utilscmd.py`` ``apmsconverter``, ``ifconverter``,
159
+ ``crisprconverter`` to support tissue as well as output
160
+ ``data_info.json`` file to resulting RO-Crate so subsequent tools can
161
+ more easily get provenance information
162
+
163
+
164
+ * Updated ``cellmaps_utilscmd.py crisprconverter`` to consume ``.h5ad``
165
+ files and updated readme.txt file
166
+
167
+ 0.3.0 (2024-04-15)
168
+ -------------------
169
+
170
+ * Bumped fairscape-cli dependency to ``0.2.0``
171
+
172
+
173
+ 0.2.0 (2024-02-20)
174
+ ------------------
175
+
176
+ * Bumped fairscape-cli dependency to ``0.1.14`` to support schemas
177
+
178
+ * Added support for ``schema`` to **data_dict** parameter in ``ProvenanceUtil.register_dataset()``
179
+
180
+ * Added ``--release`` flag to ``cellmaps_utilscmd.py rocratetable`` and
181
+ in output table renamed "Name of Computation" to "Name" as well as
182
+ added "Type", "Cell Line", "Treatment", "Gene set", and "Version" to
183
+ table output
184
+
185
+ * Set default logging level to ``ERROR`` for ``cellmaps_utilscmd.py`` command
186
+
187
+ 0.1.0 (2024-01-01)
188
+ ------------------
189
+
190
+ * First release on PyPI.
@@ -4,6 +4,6 @@
4
4
 
5
5
  __author__ = 'Cell Maps team'
6
6
  __email__ = 'tools@cm4ai.org'
7
- __version__ = '0.3.0'
7
+ __version__ = '0.4.0'
8
8
  __repo_url__ = 'https://github.com/idekerlab/cellmaps_utils'
9
9
  __description__ = 'Contains utilities needed by Cell Maps tools'
@@ -0,0 +1,85 @@
1
+ Affinity Purification Mass spectrometry (AP-MS)
2
+ -----------------------------------------------
3
+
4
+ Affinity Purification-Mass Spectrometry (AP-MS) is a powerful technique used to uncover the intricate networks of
5
+ protein interactions within cells. Different methods can be used but the most popular approach is to attach a purifiable
6
+ tag to a protein of interest, the "bait". In the context of CM4AI the tag is directly attached to the endogenous protein
7
+ of interest using gene editing to maintain physiological level of expression. The tagged bait is then purified from cell
8
+ extract with its interacting partners. Once separated, the captured proteins are identified using a mass spectrometer
9
+ allowing to infer protein-protein interactions. Understanding these interactions allows can unravel complex cellular
10
+ processes, discover new roles for proteins, and gain insights into diseases caused by disrupted protein networks.
11
+
12
+
13
+ Data processing
14
+ ---------------
15
+
16
+ Raw data acquired on a Orbitrap Fusion™ Lumos™ Tribrid™ Mass Spectrometer (Thermo Scientific)
17
+ Raw data are processed using Maxquant v1.6.12.0 using default parameter with LFQ quantification and the
18
+ “202209_uniprot_human_reviewed.fasta” file as reference.
19
+ Evidence file from maxquant are processed using ArtMS in R to generate SAINT input files using the
20
+ following command lines. SAINTexpress was run locally using version SAINTexpress_v3.6.3
21
+ SAINT is designed to assess the reliability and significance of protein-protein interactions identified
22
+ through mass spectrometry experiments. It takes into account both the presence and abundance of proteins
23
+ in different experimental conditions or replicates. The method uses a probabilistic model to estimate the
24
+ probability that a given interaction is a true positive rather than a random or non-specific interaction.
25
+ This approach helps to distinguish true interactions from noise in large-scale protein interaction datasets.
26
+
27
+ apms.tsv column labels
28
+ ----------------------
29
+
30
+ Bait: Name of the pull downed protein
31
+
32
+ Prey: Uniprot ID number of identified proteins by MS in pull down (putative bait interactor).
33
+
34
+ PreyGene.x: Uniprot protein name of identified protein by MS in pull down (putative bait interactor).
35
+
36
+ Spec: Number of spectral count in each test biological replicates (separated by | ).
37
+
38
+ SpecSum: Sum of Spectral counts in test samples.
39
+
40
+ AvgSpec: Average Spectral counts across replicates in test samples.
41
+
42
+ NumReplicates.x: Number of replicates in test samples.
43
+
44
+ ctrlCounts: Number of spectral count in each control replicates (separated by | ).
45
+
46
+ AvgP.x: Average probability that an interaction is true, measure of the likelihood that a given
47
+ interaction is a true positive rather than a random or non-specific interaction. A lower AvgP indicates
48
+ higher confidence in the interaction being genuine.
49
+
50
+ MaxP.x: maximum probability associated with a protein interaction in the context of its prey-bait pair.
51
+ Similar to AvgP, a lower MaxP suggests a higher likelihood of the interaction being true.
52
+
53
+ TopoAvgP.x: extension of the AvgP score that also takes into consideration the topology of the
54
+ interaction network. It incorporates information about the hierarchical structure of the interaction
55
+ data to provide a refined assessment of the interactions.
56
+
57
+ TopoMaxP.x: topology-aware score that considers the maximum probability of an interaction in the
58
+ context of the interaction network's topology.
59
+
60
+ SaintScore.x: composite score that integrates multiple aspects of the interaction data, including
61
+ spectral counts and probability estimates. It's designed to prioritize interactions based on their
62
+ strength and reliability. Higher SaintScores indicate interactions that are more likely to be true.
63
+
64
+ logOddsScore: Logarithm of the odds ratio between test and control conditions for each prey as a
65
+ measure of interaction significance. The LogOddsScore is a statistical score that represents the
66
+ logarithm of the odds ratio for a protein-protein interaction. It's used to quantify the strength
67
+ and significance of the association between two proteins in an interaction network. The odds ratio
68
+ compares the likelihood of the interaction occurring to the likelihood of it not occurring. Taking
69
+ the logarithm of the odds ratio often helps to transform the score into a more symmetric and interpretable
70
+ form, making it easier to compare and analyze the interactions. Higher LogOddsScores typically indicate
71
+ stronger evidence for the interaction.
72
+
73
+ FoldChange.x: represents the ratio of the abundance of a protein or interaction in one experimental
74
+ condition (Test) compared to another (control). It helps assess whether the abundance of a protein
75
+ changes significantly between different conditions.
76
+
77
+ BFDR.x: Bayesian False Discovery Rate
78
+
79
+
80
+
81
+
82
+ SAINT References:
83
+ https://saint-apms.sourceforge.net/Main.html
84
+ https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4102138/
85
+ https://pubmed.ncbi.nlm.nih.gov/21131968/
@@ -1,3 +1,4 @@
1
+ import json
1
2
  import os
2
3
  import sys
3
4
  import uuid
@@ -39,6 +40,7 @@ class APMSDataLoader(BaseCommandLineTool):
39
40
  self._release = theargs.release
40
41
  self._cell_line = theargs.cell_line
41
42
  self._treatment = theargs.treatment
43
+ self._tissue = theargs.tissue
42
44
  self._author = theargs.author
43
45
  self._gene_set = theargs.gene_set
44
46
  self._provenance_utils = provenance_utils
@@ -47,6 +49,8 @@ class APMSDataLoader(BaseCommandLineTool):
47
49
 
48
50
  def run(self):
49
51
  """
52
+ Run method to create RO-Crate from AP-MS data tables. This process involves merging input tables,
53
+ registering the dataset and related software in the RO-Crate.
50
54
 
51
55
  :return:
52
56
  """
@@ -58,13 +62,28 @@ class APMSDataLoader(BaseCommandLineTool):
58
62
  os.makedirs(self._outdir, mode=0o755)
59
63
 
60
64
  keywords = [self._project_name, self._release,
61
- self._cell_line, self._treatment, 'AP-MS edgelist']
65
+ self._cell_line, self._treatment, self._tissue,
66
+ 'AP-MS edgelist']
62
67
 
63
68
  if self._gene_set is not None:
64
69
  keywords.append(self._gene_set)
65
70
 
66
71
  description = ' '.join(keywords)
67
72
 
73
+ info_dict = {
74
+ constants.DATASET_NAME: self._name,
75
+ constants.DATASET_ORGANIZATION_NAME: self._organization_name,
76
+ constants.DATASET_PROJECT_NAME: self._project_name,
77
+ constants.DATASET_RELEASE: self._release,
78
+ constants.DATASET_CELL_LINE: self._cell_line,
79
+ constants.DATASET_TREATMENT: self._treatment,
80
+ constants.DATASET_TISSUE: self._tissue,
81
+ constants.DATASET_AUTHOR: self._author,
82
+ constants.DATASET_GENE_SET: self._gene_set
83
+ }
84
+
85
+ self.save_dataset_info_to_json(self._outdir, info_dict, constants.DATASET_INFO_FILE)
86
+
68
87
  self._provenance_utils.register_rocrate(self._outdir,
69
88
  name=self._name,
70
89
  organization_name=self._organization_name,
@@ -113,8 +132,8 @@ class APMSDataLoader(BaseCommandLineTool):
113
132
 
114
133
  def _generate_rocrate_dir_path(self):
115
134
  """
116
-
117
- :return:
135
+ Generates a directory path for the RO-Crate based on provided metadata like project name, gene set,
136
+ cell line, treatment, and release version.
118
137
  """
119
138
  dir_name = self._project_name.lower() + '_'
120
139
  if self._gene_set is not None:
@@ -128,8 +147,10 @@ class APMSDataLoader(BaseCommandLineTool):
128
147
 
129
148
  def _merge_and_save_apms_data(self):
130
149
  """
150
+ Merges AP-MS data from input files into a single DataFrame and saves the combined data to a TSV file within
151
+ the RO-Crate directory.
131
152
 
132
- :return:
153
+ :return: The file path to the saved AP-MS data TSV file.
133
154
  """
134
155
  df_list = []
135
156
  for input in self._inputs:
@@ -151,7 +172,7 @@ class APMSDataLoader(BaseCommandLineTool):
151
172
 
152
173
  df = pd.concat(df_list)
153
174
 
154
- apms_path = os.path.join(self._outdir, 'apms.tsv')
175
+ apms_path = os.path.join(self._outdir, constants.APMS_TSV_FILE)
155
176
  df.to_csv(apms_path, sep='\t', index=False)
156
177
  return apms_path
157
178
 
@@ -159,6 +180,7 @@ class APMSDataLoader(BaseCommandLineTool):
159
180
  description='',
160
181
  keywords=[]):
161
182
  """
183
+ Registers the computation process in the RO-Crate
162
184
  # Todo: added in used dataset, software and what is being generated
163
185
  :return:
164
186
  """
@@ -199,6 +221,7 @@ class APMSDataLoader(BaseCommandLineTool):
199
221
 
200
222
  def add_subparser(subparsers):
201
223
  """
224
+ Adds a command-line subparser for the APMSDataLoader tool.
202
225
 
203
226
  :return:
204
227
  """
@@ -240,5 +263,11 @@ class APMSDataLoader(BaseCommandLineTool):
240
263
  parser.add_argument('--gene_set', choices=['chromatin', 'metabolic'],
241
264
  default='chromatin',
242
265
  help='Gene set for dataset')
266
+ parser.add_argument('--tissue', choices=['undifferentiated', 'neuron',
267
+ 'cardiomyocytes', ''],
268
+ default='breast; mammary gland',
269
+ help='Tissue for dataset. Since the default --cell_line '
270
+ 'is MDA-MB-468, this value is set to the tissue '
271
+ 'for that cell line')
243
272
  return parser
244
273
 
@@ -1,5 +1,6 @@
1
1
  # -*- coding: utf-8 -*-
2
-
2
+ import json
3
+ import os
3
4
  import sys
4
5
  import argparse
5
6
  import logging
@@ -24,6 +25,22 @@ class BaseCommandLineTool(object):
24
25
  """
25
26
  pass
26
27
 
28
+ def save_dataset_info_to_json(self, outdir, info_dict, file_name):
29
+ """
30
+ Saves project information to a JSON file.
31
+
32
+ :param outdir: Output directory where the file will be saved
33
+ :param info_dict: Dictionary with dataset information
34
+ :param file_name: Name of the file to save the information.
35
+ """
36
+
37
+ json_str = json.dumps(info_dict, indent=4)
38
+
39
+ json_file_path = os.path.join(outdir, file_name)
40
+
41
+ with open(json_file_path, 'w') as json_file:
42
+ json_file.write(json_str)
43
+
27
44
  def run(self):
28
45
  """
29
46
  Should contain logic that will be run by command line tool.
@@ -84,6 +84,16 @@ IMAGE_GENE_NODE_ERRORS_FILE = 'image_gene_node_attributes.errors'
84
84
  Image gene node attributes errors filename
85
85
  """
86
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
+
87
97
  IMAGE_GENE_NODE_NAME_COL = 'name'
88
98
  """
89
99
  Gene Symbol name column
@@ -125,6 +135,11 @@ IMAGE_GENE_NODE_COLS = [IMAGE_GENE_NODE_NAME_COL,
125
135
  Columns in :py:const:`IMAGE_GENE_NODE_ATTR_FILE` file
126
136
  """
127
137
 
138
+ APMS_TSV_FILE = 'apms.tsv'
139
+ """
140
+ AP-MS tsv file
141
+ """
142
+
128
143
  PPI_EDGELIST_FILE = 'ppi_edgelist.tsv'
129
144
  """
130
145
  Protein to Protein interaction edgelist file name
@@ -174,7 +189,12 @@ PPI_NETWORK_PREFIX = 'ppi'
174
189
 
175
190
  HIERARCHY_NETWORK_PREFIX = 'hierarchy'
176
191
  """
177
- CX format hierarchy filename
192
+ CX2 format hierarchy filename
193
+ """
194
+
195
+ HIERARCHY_PARENT_NETWORK_PREFIX = 'hierarchy_parent'
196
+ """
197
+ CX2 format hierarchy parent (interactome_ filename
178
198
  """
179
199
 
180
200
  HIERARCHY_NODES_FILE = 'hierarchy_node_attributes.tsv'
@@ -281,4 +301,62 @@ HIERARCHYEVAL_STEP_DIR = '5.hierarchyeval'
281
301
  Name of directory where hierarchy evaluations are stored
282
302
  """
283
303
 
304
+ DATASET_INFO_FILE = 'dataset_info.json'
305
+ """
306
+ Name of file where information about a dataset is stored
307
+ """
308
+
309
+ DATASET_NAME = 'name'
310
+ """
311
+ Name of the dataset
312
+ """
313
+
314
+ DATASET_ORGANIZATION_NAME = 'organization_name'
315
+ """
316
+ Name of the organization
317
+ """
318
+
319
+ DATASET_PROJECT_NAME = 'project_name'
320
+ """
321
+ Name of the project
322
+ """
323
+
324
+ DATASET_RELEASE = 'release'
325
+ """
326
+ Release of the dataset
327
+ """
328
+
329
+ DATASET_CELL_LINE = 'cell_line'
330
+ """
331
+ Cell line
332
+ """
333
+
334
+ DATASET_TREATMENT = 'treatment'
335
+ """
336
+ Treatment
337
+ """
338
+
339
+ DATASET_TISSUE = 'tissue'
340
+ """
341
+ Tissue
342
+ """
284
343
 
344
+ DATASET_AUTHOR = 'author'
345
+ """
346
+ Author of the dataset
347
+ """
348
+
349
+ DATASET_SLICE = 'slice'
350
+ """
351
+ Slice
352
+ """
353
+
354
+ DATASET_GENE_SET = 'gene_set'
355
+ """
356
+ Gene set
357
+ """
358
+
359
+ DATASET_COLLECTION_SET = 'collection_set'
360
+ """
361
+ Collection set
362
+ """
@@ -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
+