cellmaps-utils 0.1.0a23__tar.gz → 0.2.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.
- cellmaps_utils-0.2.0/HISTORY.rst +22 -0
- {cellmaps_utils-0.1.0a23 → cellmaps_utils-0.2.0}/PKG-INFO +20 -2
- {cellmaps_utils-0.1.0a23 → cellmaps_utils-0.2.0}/README.rst +4 -0
- {cellmaps_utils-0.1.0a23 → cellmaps_utils-0.2.0}/cellmaps_utils/__init__.py +1 -1
- {cellmaps_utils-0.1.0a23 → cellmaps_utils-0.2.0}/cellmaps_utils/cellmaps_utilscmd.py +3 -3
- {cellmaps_utils-0.1.0a23 → cellmaps_utils-0.2.0}/cellmaps_utils/provenance.py +6 -10
- {cellmaps_utils-0.1.0a23 → cellmaps_utils-0.2.0}/cellmaps_utils/tabletool.py +84 -1
- {cellmaps_utils-0.1.0a23 → cellmaps_utils-0.2.0}/cellmaps_utils.egg-info/PKG-INFO +20 -2
- {cellmaps_utils-0.1.0a23 → cellmaps_utils-0.2.0}/cellmaps_utils.egg-info/SOURCES.txt +2 -0
- {cellmaps_utils-0.1.0a23 → cellmaps_utils-0.2.0}/cellmaps_utils.egg-info/requires.txt +1 -1
- {cellmaps_utils-0.1.0a23 → cellmaps_utils-0.2.0}/docs/index.rst +4 -0
- {cellmaps_utils-0.1.0a23 → cellmaps_utils-0.2.0}/setup.py +1 -1
- cellmaps_utils-0.2.0/tests/test_basecommandlinetool.py +38 -0
- cellmaps_utils-0.2.0/tests/test_helloworldcommand.py +35 -0
- {cellmaps_utils-0.1.0a23 → cellmaps_utils-0.2.0}/tests/test_provenance.py +26 -0
- cellmaps_utils-0.1.0a23/HISTORY.rst +0 -8
- {cellmaps_utils-0.1.0a23 → cellmaps_utils-0.2.0}/AUTHORS.rst +0 -0
- {cellmaps_utils-0.1.0a23 → cellmaps_utils-0.2.0}/CONTRIBUTING.rst +0 -0
- {cellmaps_utils-0.1.0a23 → cellmaps_utils-0.2.0}/LICENSE +0 -0
- {cellmaps_utils-0.1.0a23 → cellmaps_utils-0.2.0}/MANIFEST.in +0 -0
- {cellmaps_utils-0.1.0a23 → cellmaps_utils-0.2.0}/cellmaps_utils/apmstool.py +0 -0
- {cellmaps_utils-0.1.0a23 → cellmaps_utils-0.2.0}/cellmaps_utils/basecmdtool.py +0 -0
- {cellmaps_utils-0.1.0a23 → cellmaps_utils-0.2.0}/cellmaps_utils/constants.py +0 -0
- {cellmaps_utils-0.1.0a23 → cellmaps_utils-0.2.0}/cellmaps_utils/crisprtool.py +0 -0
- {cellmaps_utils-0.1.0a23 → cellmaps_utils-0.2.0}/cellmaps_utils/exceptions.py +0 -0
- {cellmaps_utils-0.1.0a23 → cellmaps_utils-0.2.0}/cellmaps_utils/iftool.py +0 -0
- {cellmaps_utils-0.1.0a23 → cellmaps_utils-0.2.0}/cellmaps_utils/logutils.py +0 -0
- {cellmaps_utils-0.1.0a23 → cellmaps_utils-0.2.0}/cellmaps_utils/music_utils.py +0 -0
- {cellmaps_utils-0.1.0a23 → cellmaps_utils-0.2.0}/cellmaps_utils.egg-info/dependency_links.txt +0 -0
- {cellmaps_utils-0.1.0a23 → cellmaps_utils-0.2.0}/cellmaps_utils.egg-info/not-zip-safe +0 -0
- {cellmaps_utils-0.1.0a23 → cellmaps_utils-0.2.0}/cellmaps_utils.egg-info/top_level.txt +0 -0
- {cellmaps_utils-0.1.0a23 → cellmaps_utils-0.2.0}/docs/Makefile +0 -0
- {cellmaps_utils-0.1.0a23 → cellmaps_utils-0.2.0}/docs/_build/html/_static/file.png +0 -0
- {cellmaps_utils-0.1.0a23 → cellmaps_utils-0.2.0}/docs/_build/html/_static/minus.png +0 -0
- {cellmaps_utils-0.1.0a23 → cellmaps_utils-0.2.0}/docs/_build/html/_static/plus.png +0 -0
- {cellmaps_utils-0.1.0a23 → cellmaps_utils-0.2.0}/docs/authors.rst +0 -0
- {cellmaps_utils-0.1.0a23 → cellmaps_utils-0.2.0}/docs/cellmaps_utils.rst +0 -0
- {cellmaps_utils-0.1.0a23 → cellmaps_utils-0.2.0}/docs/conf.py +0 -0
- {cellmaps_utils-0.1.0a23 → cellmaps_utils-0.2.0}/docs/contributing.rst +0 -0
- {cellmaps_utils-0.1.0a23 → cellmaps_utils-0.2.0}/docs/devbranches.rst +0 -0
- {cellmaps_utils-0.1.0a23 → cellmaps_utils-0.2.0}/docs/developer.rst +0 -0
- {cellmaps_utils-0.1.0a23 → cellmaps_utils-0.2.0}/docs/history.rst +0 -0
- {cellmaps_utils-0.1.0a23 → cellmaps_utils-0.2.0}/docs/installation.rst +0 -0
- {cellmaps_utils-0.1.0a23 → cellmaps_utils-0.2.0}/docs/integrationtesting.rst +0 -0
- {cellmaps_utils-0.1.0a23 → cellmaps_utils-0.2.0}/docs/make.bat +0 -0
- {cellmaps_utils-0.1.0a23 → cellmaps_utils-0.2.0}/docs/modules.rst +0 -0
- {cellmaps_utils-0.1.0a23 → cellmaps_utils-0.2.0}/docs/newrelease.rst +0 -0
- {cellmaps_utils-0.1.0a23 → cellmaps_utils-0.2.0}/docs/pypircfile.rst +0 -0
- {cellmaps_utils-0.1.0a23 → cellmaps_utils-0.2.0}/docs/usage.rst +0 -0
- {cellmaps_utils-0.1.0a23 → cellmaps_utils-0.2.0}/docs/versioningscheme.rst +0 -0
- {cellmaps_utils-0.1.0a23 → cellmaps_utils-0.2.0}/setup.cfg +0 -0
- {cellmaps_utils-0.1.0a23 → cellmaps_utils-0.2.0}/tests/__init__.py +0 -0
- {cellmaps_utils-0.1.0a23 → cellmaps_utils-0.2.0}/tests/test_integation_provenance.py +0 -0
- {cellmaps_utils-0.1.0a23 → cellmaps_utils-0.2.0}/tests/test_logutils.py +0 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
=======
|
|
2
|
+
History
|
|
3
|
+
=======
|
|
4
|
+
|
|
5
|
+
0.2.0 (2024-02-20)
|
|
6
|
+
------------------
|
|
7
|
+
|
|
8
|
+
* Bumped fairscape-cli dependency to ``0.1.14`` to support schemas
|
|
9
|
+
|
|
10
|
+
* Added support for ``schema`` to **data_dict** parameter in ``ProvenanceUtil.register_dataset()``
|
|
11
|
+
|
|
12
|
+
* Added ``--release`` flag to ``cellmaps_utilscmd.py rocratetable`` and
|
|
13
|
+
in output table renamed "Name of Computation" to "Name" as well as
|
|
14
|
+
added "Type", "Cell Line", "Treatment", "Gene set", and "Version" to
|
|
15
|
+
table output
|
|
16
|
+
|
|
17
|
+
* Set default logging level to ``ERROR`` for ``cellmaps_utilscmd.py`` command
|
|
18
|
+
|
|
19
|
+
0.1.0 (2024-01-01)
|
|
20
|
+
------------------
|
|
21
|
+
|
|
22
|
+
* First release on PyPI.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: cellmaps_utils
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2.0
|
|
4
4
|
Summary: Contains utilities needed by Cell Maps tools
|
|
5
5
|
Home-page: https://github.com/idekerlab/cellmaps_utils
|
|
6
6
|
Author: Cell Maps team
|
|
@@ -21,6 +21,10 @@ Description: =============================
|
|
|
21
21
|
:target: https://cellmaps-utils.readthedocs.io/en/latest/?badge=latest
|
|
22
22
|
:alt: Documentation Status
|
|
23
23
|
|
|
24
|
+
.. image:: https://zenodo.org/badge/599754117.svg
|
|
25
|
+
:target: https://zenodo.org/doi/10.5281/zenodo.10607322
|
|
26
|
+
:alt: Zenodo DOI badge
|
|
27
|
+
|
|
24
28
|
Contains utilities needed by various tools in the cell maps toolkit.
|
|
25
29
|
|
|
26
30
|
|
|
@@ -116,7 +120,21 @@ Description: =============================
|
|
|
116
120
|
History
|
|
117
121
|
=======
|
|
118
122
|
|
|
119
|
-
0.
|
|
123
|
+
0.2.0 (2024-02-20)
|
|
124
|
+
------------------
|
|
125
|
+
|
|
126
|
+
* Bumped fairscape-cli dependency to ``0.1.14`` to support schemas
|
|
127
|
+
|
|
128
|
+
* Added support for ``schema`` to **data_dict** parameter in ``ProvenanceUtil.register_dataset()``
|
|
129
|
+
|
|
130
|
+
* Added ``--release`` flag to ``cellmaps_utilscmd.py rocratetable`` and
|
|
131
|
+
in output table renamed "Name of Computation" to "Name" as well as
|
|
132
|
+
added "Type", "Cell Line", "Treatment", "Gene set", and "Version" to
|
|
133
|
+
table output
|
|
134
|
+
|
|
135
|
+
* Set default logging level to ``ERROR`` for ``cellmaps_utilscmd.py`` command
|
|
136
|
+
|
|
137
|
+
0.1.0 (2024-01-01)
|
|
120
138
|
------------------
|
|
121
139
|
|
|
122
140
|
* First release on PyPI.
|
|
@@ -13,6 +13,10 @@ Cell Maps Pipeline Utilities
|
|
|
13
13
|
:target: https://cellmaps-utils.readthedocs.io/en/latest/?badge=latest
|
|
14
14
|
:alt: Documentation Status
|
|
15
15
|
|
|
16
|
+
.. image:: https://zenodo.org/badge/599754117.svg
|
|
17
|
+
:target: https://zenodo.org/doi/10.5281/zenodo.10607322
|
|
18
|
+
:alt: Zenodo DOI badge
|
|
19
|
+
|
|
16
20
|
Contains utilities needed by various tools in the cell maps toolkit.
|
|
17
21
|
|
|
18
22
|
|
|
@@ -54,12 +54,12 @@ def _parse_arguments(desc, args):
|
|
|
54
54
|
'logging.config.html#logging-config-fileformat '
|
|
55
55
|
'Setting this overrides -v parameter which uses '
|
|
56
56
|
' default logger. (default None)')
|
|
57
|
-
parser.add_argument('--verbose', '-v', action='count', default=
|
|
57
|
+
parser.add_argument('--verbose', '-v', action='count', default=1,
|
|
58
58
|
help='Increases verbosity of logger to standard '
|
|
59
59
|
'error for log messages in this module. Messages are '
|
|
60
60
|
'output at these python logging levels '
|
|
61
|
-
'-v =
|
|
62
|
-
'-
|
|
61
|
+
'-v = WARNING, -vv = INFO, '
|
|
62
|
+
'-vvv = DEBUG, -vvvv = NOTSET (default ERROR '
|
|
63
63
|
'logging)')
|
|
64
64
|
parser.add_argument('--version', action='version',
|
|
65
65
|
version=('%(prog)s ' +
|
|
@@ -704,11 +704,6 @@ class ProvenanceUtil(object):
|
|
|
704
704
|
``ro-crate-metadata.json`` file stored in **rocrate_path**
|
|
705
705
|
directory.
|
|
706
706
|
|
|
707
|
-
.. warning::
|
|
708
|
-
|
|
709
|
-
`fairscape-cli <https://github.com/fairscape>`__ 0.1.5 always fails this call
|
|
710
|
-
`See Issue #7 <https://github.com/fairscape/fairscape-cli/issues/7>`__
|
|
711
|
-
|
|
712
707
|
:param name: Name of software
|
|
713
708
|
:type name: str
|
|
714
709
|
:param description: Description of software
|
|
@@ -792,14 +787,12 @@ class ProvenanceUtil(object):
|
|
|
792
787
|
'date-published': 'Date dataset was published MM-DD-YYYY',
|
|
793
788
|
'description': 'Description of dataset',
|
|
794
789
|
'data-format': 'Format of data',
|
|
790
|
+
'schema': Path or URL to schema file in JSON format
|
|
795
791
|
'keywords': ['keyword1','keyword2']}
|
|
796
792
|
|
|
797
|
-
..
|
|
793
|
+
.. versionchanged:: 0.2.0
|
|
798
794
|
|
|
799
|
-
|
|
800
|
-
skipping copy is ``True`` or if performing copy where
|
|
801
|
-
**source_file** is already in **rocrate_path** directory.
|
|
802
|
-
`See Issue #6 <https://github.com/fairscape/fairscape-cli/issues/6>`__
|
|
795
|
+
Added support for ``schema`` in **data_dict** passed in
|
|
803
796
|
|
|
804
797
|
|
|
805
798
|
:param rocrate_path: Path to directory with registered rocrate
|
|
@@ -840,6 +833,9 @@ class ProvenanceUtil(object):
|
|
|
840
833
|
else:
|
|
841
834
|
cmd.extend(self._get_keywords(keywords=data_dict['keywords']))
|
|
842
835
|
|
|
836
|
+
if 'schema' in data_dict:
|
|
837
|
+
cmd.extend(['--schema', data_dict['schema']])
|
|
838
|
+
|
|
843
839
|
if guid is None:
|
|
844
840
|
guid = self._generate_guid(data_type='dataset',
|
|
845
841
|
rocrate_path=rocrate_path)
|
|
@@ -23,7 +23,7 @@ class TableFromROCrates(BaseCommandLineTool):
|
|
|
23
23
|
|
|
24
24
|
ID_COL = 'FAIRSCAPE ARK ID'
|
|
25
25
|
DATE_COL = 'Date'
|
|
26
|
-
COMPUTATION_COL = 'Name
|
|
26
|
+
COMPUTATION_COL = 'Name'
|
|
27
27
|
DESCRIPTION_COL = 'Description'
|
|
28
28
|
KEYWORDS_COL = 'Keywords'
|
|
29
29
|
DOWNLOAD_COL = 'Download RO-Crate Data Package'
|
|
@@ -31,8 +31,24 @@ class TableFromROCrates(BaseCommandLineTool):
|
|
|
31
31
|
GENERATED_COL = 'Generated By Software'
|
|
32
32
|
OUTPUT_COL = 'Output Dataset'
|
|
33
33
|
RESPONSIBLE_COL = 'Responsible Lab'
|
|
34
|
+
TYPE_COL = 'Type'
|
|
35
|
+
CELL_LINE_COL = 'Cell Line'
|
|
36
|
+
TREATMENT_COL = 'Treatment'
|
|
37
|
+
GENESET_COL = 'Gene set'
|
|
38
|
+
VERSION_COL = 'Version'
|
|
39
|
+
|
|
40
|
+
DATA_ROCRATE = 'Data'
|
|
41
|
+
MODEL_ROCRATE = 'Model'
|
|
42
|
+
INTERMEDIATE_ROCRATE = 'Intermediate'
|
|
43
|
+
OTHER_ROCRATE = 'Other'
|
|
34
44
|
|
|
35
45
|
COLUMNS = [ID_COL, DATE_COL,
|
|
46
|
+
VERSION_COL,
|
|
47
|
+
TYPE_COL,
|
|
48
|
+
CELL_LINE_COL,
|
|
49
|
+
TREATMENT_COL,
|
|
50
|
+
GENESET_COL,
|
|
51
|
+
GENERATED_COL,
|
|
36
52
|
COMPUTATION_COL,
|
|
37
53
|
DESCRIPTION_COL, KEYWORDS_COL,
|
|
38
54
|
DOWNLOAD_COL,
|
|
@@ -54,10 +70,70 @@ class TableFromROCrates(BaseCommandLineTool):
|
|
|
54
70
|
self._outdir = os.path.abspath(theargs.outdir)
|
|
55
71
|
self._rocrates = theargs.rocrates
|
|
56
72
|
self._date = theargs.date
|
|
73
|
+
self._version = theargs.release
|
|
57
74
|
self._provenance_utils = provenance_utils
|
|
58
75
|
self._downloadurlprefix = theargs.downloadurlprefix
|
|
59
76
|
self._input_data_dict = theargs.__dict__
|
|
60
77
|
|
|
78
|
+
def _get_rocrate_type(self, compname):
|
|
79
|
+
"""
|
|
80
|
+
Gets type of rocrate, which can be Data, Model, or Intermediate
|
|
81
|
+
|
|
82
|
+
:return:
|
|
83
|
+
:rtype: str
|
|
84
|
+
"""
|
|
85
|
+
if compname in ['IF images', 'AP-MS', 'CRISPR']:
|
|
86
|
+
return TableFromROCrates.DATA_ROCRATE
|
|
87
|
+
if compname in ['Hierarchy']:
|
|
88
|
+
return TableFromROCrates.MODEL_ROCRATE
|
|
89
|
+
return TableFromROCrates.INTERMEDIATE_ROCRATE
|
|
90
|
+
|
|
91
|
+
def _get_cell_line(self, keywords):
|
|
92
|
+
"""
|
|
93
|
+
Looks for cell line in keywords
|
|
94
|
+
|
|
95
|
+
:param keywords:
|
|
96
|
+
:type keywords: list
|
|
97
|
+
:return:
|
|
98
|
+
:rtype: str
|
|
99
|
+
"""
|
|
100
|
+
if 'MDA-MB-468' in keywords:
|
|
101
|
+
return 'MDA-MB-468'
|
|
102
|
+
return 'Unknown'
|
|
103
|
+
|
|
104
|
+
def _get_treatment(self, keywords):
|
|
105
|
+
"""
|
|
106
|
+
Gets treatment from keywords
|
|
107
|
+
|
|
108
|
+
:param keywords:
|
|
109
|
+
:return:
|
|
110
|
+
"""
|
|
111
|
+
treatments = []
|
|
112
|
+
if 'untreated' in keywords:
|
|
113
|
+
treatments.append('untreated')
|
|
114
|
+
if 'vorinostat' in keywords:
|
|
115
|
+
treatments.append('vorinostat')
|
|
116
|
+
if 'paclitaxel' in keywords:
|
|
117
|
+
treatments.append('paclitaxel')
|
|
118
|
+
return ','.join(treatments)
|
|
119
|
+
|
|
120
|
+
def _get_geneset(self, keywords):
|
|
121
|
+
"""
|
|
122
|
+
Gets treatment from keywords
|
|
123
|
+
|
|
124
|
+
:param keywords:
|
|
125
|
+
:return:
|
|
126
|
+
"""
|
|
127
|
+
genesets = []
|
|
128
|
+
|
|
129
|
+
if 'chromatin' in keywords:
|
|
130
|
+
genesets.append('chromatin')
|
|
131
|
+
if 'metabolic' in keywords:
|
|
132
|
+
genesets.append('metabolic')
|
|
133
|
+
if len(genesets) == 0:
|
|
134
|
+
return 'Unknown'
|
|
135
|
+
return ','.join(genesets)
|
|
136
|
+
|
|
61
137
|
def run(self):
|
|
62
138
|
"""
|
|
63
139
|
|
|
@@ -95,6 +171,11 @@ class TableFromROCrates(BaseCommandLineTool):
|
|
|
95
171
|
logger.debug(rocrate + ': ' + 'Keywords: ' + str(prov_attrs.get_keywords()))
|
|
96
172
|
row = {TableFromROCrates.ID_COL: self._provenance_utils.get_id_of_rocrate(rocrate=rocrate_dict),
|
|
97
173
|
TableFromROCrates.DATE_COL: self._date,
|
|
174
|
+
TableFromROCrates.VERSION_COL: self._version,
|
|
175
|
+
TableFromROCrates.TYPE_COL: self._get_rocrate_type(comp_name),
|
|
176
|
+
TableFromROCrates.CELL_LINE_COL: self._get_cell_line(prov_attrs.get_keywords()),
|
|
177
|
+
TableFromROCrates.TREATMENT_COL: self._get_treatment(prov_attrs.get_keywords()),
|
|
178
|
+
TableFromROCrates.GENESET_COL: self._get_geneset(prov_attrs.get_keywords()),
|
|
98
179
|
TableFromROCrates.COMPUTATION_COL: comp_name,
|
|
99
180
|
TableFromROCrates.DESCRIPTION_COL: prov_attrs.get_description(),
|
|
100
181
|
TableFromROCrates.KEYWORDS_COL: ','.join(prov_attrs.get_keywords()),
|
|
@@ -278,6 +359,8 @@ class TableFromROCrates(BaseCommandLineTool):
|
|
|
278
359
|
help='Path to RO-Crates used for table generation. ')
|
|
279
360
|
parser.add_argument('--date', default=date.today().strftime('%Y-%m-%d'),
|
|
280
361
|
help='Date to list in table for RO-Crates')
|
|
362
|
+
parser.add_argument('--release', default='0.1 alpha',
|
|
363
|
+
help='Version of release')
|
|
281
364
|
parser.add_argument('--downloadurlprefix', default='https://g-9b3b6e.9ad93.a567.data.globus.org/Data/cm4ai_0.1alpha/')
|
|
282
365
|
|
|
283
366
|
return parser
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: cellmaps-utils
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2.0
|
|
4
4
|
Summary: Contains utilities needed by Cell Maps tools
|
|
5
5
|
Home-page: https://github.com/idekerlab/cellmaps_utils
|
|
6
6
|
Author: Cell Maps team
|
|
@@ -21,6 +21,10 @@ Description: =============================
|
|
|
21
21
|
:target: https://cellmaps-utils.readthedocs.io/en/latest/?badge=latest
|
|
22
22
|
:alt: Documentation Status
|
|
23
23
|
|
|
24
|
+
.. image:: https://zenodo.org/badge/599754117.svg
|
|
25
|
+
:target: https://zenodo.org/doi/10.5281/zenodo.10607322
|
|
26
|
+
:alt: Zenodo DOI badge
|
|
27
|
+
|
|
24
28
|
Contains utilities needed by various tools in the cell maps toolkit.
|
|
25
29
|
|
|
26
30
|
|
|
@@ -116,7 +120,21 @@ Description: =============================
|
|
|
116
120
|
History
|
|
117
121
|
=======
|
|
118
122
|
|
|
119
|
-
0.
|
|
123
|
+
0.2.0 (2024-02-20)
|
|
124
|
+
------------------
|
|
125
|
+
|
|
126
|
+
* Bumped fairscape-cli dependency to ``0.1.14`` to support schemas
|
|
127
|
+
|
|
128
|
+
* Added support for ``schema`` to **data_dict** parameter in ``ProvenanceUtil.register_dataset()``
|
|
129
|
+
|
|
130
|
+
* Added ``--release`` flag to ``cellmaps_utilscmd.py rocratetable`` and
|
|
131
|
+
in output table renamed "Name of Computation" to "Name" as well as
|
|
132
|
+
added "Type", "Cell Line", "Treatment", "Gene set", and "Version" to
|
|
133
|
+
table output
|
|
134
|
+
|
|
135
|
+
* Set default logging level to ``ERROR`` for ``cellmaps_utilscmd.py`` command
|
|
136
|
+
|
|
137
|
+
0.1.0 (2024-01-01)
|
|
120
138
|
------------------
|
|
121
139
|
|
|
122
140
|
* First release on PyPI.
|
|
@@ -45,6 +45,8 @@ docs/_build/html/_static/file.png
|
|
|
45
45
|
docs/_build/html/_static/minus.png
|
|
46
46
|
docs/_build/html/_static/plus.png
|
|
47
47
|
tests/__init__.py
|
|
48
|
+
tests/test_basecommandlinetool.py
|
|
49
|
+
tests/test_helloworldcommand.py
|
|
48
50
|
tests/test_integation_provenance.py
|
|
49
51
|
tests/test_logutils.py
|
|
50
52
|
tests/test_provenance.py
|
|
@@ -13,6 +13,10 @@ Cell Maps Utilities
|
|
|
13
13
|
:target: https://cellmaps-utils.readthedocs.io/en/latest/?badge=latest
|
|
14
14
|
:alt: Documentation Status
|
|
15
15
|
|
|
16
|
+
.. image:: https://zenodo.org/badge/599754117.svg
|
|
17
|
+
:target: https://zenodo.org/doi/10.5281/zenodo.10607322
|
|
18
|
+
:alt: Zenodo DOI badge
|
|
19
|
+
|
|
16
20
|
Contains utilities needed by various tools in the cell maps toolkit.
|
|
17
21
|
|
|
18
22
|
.. toctree::
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
# -*- coding: utf-8 -*-
|
|
3
|
+
|
|
4
|
+
"""Tests for `BaseCommandLineTool`."""
|
|
5
|
+
|
|
6
|
+
import os
|
|
7
|
+
import argparse
|
|
8
|
+
import shutil
|
|
9
|
+
import tempfile
|
|
10
|
+
import unittest
|
|
11
|
+
|
|
12
|
+
from cellmaps_utils.exceptions import CellMapsError
|
|
13
|
+
from cellmaps_utils.basecmdtool import BaseCommandLineTool
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class TestBaseCommandLineTool(unittest.TestCase):
|
|
17
|
+
"""Tests for `BaseCommandLineTool`"""
|
|
18
|
+
|
|
19
|
+
def setUp(self):
|
|
20
|
+
"""Set up test fixtures, if any."""
|
|
21
|
+
|
|
22
|
+
def tearDown(self):
|
|
23
|
+
"""Tear down test fixtures, if any."""
|
|
24
|
+
|
|
25
|
+
def test_run(self):
|
|
26
|
+
cmdtool = BaseCommandLineTool()
|
|
27
|
+
try:
|
|
28
|
+
cmdtool.run()
|
|
29
|
+
self.fail('Expected exception')
|
|
30
|
+
except CellMapsError as ce:
|
|
31
|
+
self.assertTrue('Must be implemented by subclass' in str(ce))
|
|
32
|
+
|
|
33
|
+
def test_add_subparser(self):
|
|
34
|
+
try:
|
|
35
|
+
BaseCommandLineTool.add_subparser(None)
|
|
36
|
+
self.fail('Expected exception')
|
|
37
|
+
except CellMapsError as ce:
|
|
38
|
+
self.assertTrue('Must be implemented by subclass' in str(ce))
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
# -*- coding: utf-8 -*-
|
|
3
|
+
|
|
4
|
+
"""Tests for `HelloWorldCommand`."""
|
|
5
|
+
|
|
6
|
+
import os
|
|
7
|
+
import argparse
|
|
8
|
+
import shutil
|
|
9
|
+
import tempfile
|
|
10
|
+
import unittest
|
|
11
|
+
from unittest.mock import MagicMock
|
|
12
|
+
|
|
13
|
+
from cellmaps_utils.exceptions import CellMapsError
|
|
14
|
+
from cellmaps_utils.basecmdtool import HelloWorldCommand
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class TestHelloWorldCommand(unittest.TestCase):
|
|
18
|
+
"""Tests for `HelloWorldCommand`"""
|
|
19
|
+
|
|
20
|
+
def setUp(self):
|
|
21
|
+
"""Set up test fixtures, if any."""
|
|
22
|
+
|
|
23
|
+
def tearDown(self):
|
|
24
|
+
"""Tear down test fixtures, if any."""
|
|
25
|
+
|
|
26
|
+
def test_run(self):
|
|
27
|
+
|
|
28
|
+
cmdtool = HelloWorldCommand(MagicMock())
|
|
29
|
+
self.assertEqual(0, cmdtool.run())
|
|
30
|
+
|
|
31
|
+
def test_add_subparser(self):
|
|
32
|
+
subparsers = MagicMock()
|
|
33
|
+
subparsers.add_parser(return_value=True)
|
|
34
|
+
self.assertTrue(HelloWorldCommand.add_subparser(subparsers))
|
|
35
|
+
|
|
@@ -282,6 +282,32 @@ class TestProvenanceUtil(unittest.TestCase):
|
|
|
282
282
|
finally:
|
|
283
283
|
shutil.rmtree(temp_dir)
|
|
284
284
|
|
|
285
|
+
def test_register_dataset_with_schema(self):
|
|
286
|
+
temp_dir = tempfile.mkdtemp()
|
|
287
|
+
try:
|
|
288
|
+
subdir = os.path.join(temp_dir, 'input')
|
|
289
|
+
os.makedirs(subdir, mode=0o755)
|
|
290
|
+
src_file = os.path.join(subdir, 'xx')
|
|
291
|
+
with open(src_file, 'w') as f:
|
|
292
|
+
f.write('hi')
|
|
293
|
+
|
|
294
|
+
prov = ProvenanceUtil()
|
|
295
|
+
prov.register_rocrate(temp_dir, name='some 10 character name', description='10 character description')
|
|
296
|
+
d_id = prov.register_dataset(temp_dir,
|
|
297
|
+
source_file=src_file,
|
|
298
|
+
skip_copy=False,
|
|
299
|
+
data_dict={'name': 'Name of dataset',
|
|
300
|
+
'author': 'Author of dataset',
|
|
301
|
+
'version': 'Version of dataset',
|
|
302
|
+
'date-published': 'Date dataset was published MM-DD-YYYY',
|
|
303
|
+
'description': 'Description of dataset',
|
|
304
|
+
'schema': 'https://foo.com',
|
|
305
|
+
'data-format': 'Format of data'})
|
|
306
|
+
self.assertIsNotNone(d_id)
|
|
307
|
+
|
|
308
|
+
finally:
|
|
309
|
+
shutil.rmtree(temp_dir)
|
|
310
|
+
|
|
285
311
|
def test_register_dataset_with_keywords(self):
|
|
286
312
|
|
|
287
313
|
temp_dir = tempfile.mkdtemp()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cellmaps_utils-0.1.0a23 → cellmaps_utils-0.2.0}/cellmaps_utils.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|