scipion-pyworkflow 3.11.0__py3-none-any.whl → 3.11.2__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.
- pyworkflow/apps/__init__.py +29 -0
- pyworkflow/apps/pw_manager.py +37 -0
- pyworkflow/apps/pw_plot.py +51 -0
- pyworkflow/apps/pw_project.py +130 -0
- pyworkflow/apps/pw_protocol_list.py +143 -0
- pyworkflow/apps/pw_protocol_run.py +51 -0
- pyworkflow/apps/pw_run_tests.py +268 -0
- pyworkflow/apps/pw_schedule_run.py +322 -0
- pyworkflow/apps/pw_sleep.py +37 -0
- pyworkflow/apps/pw_sync_data.py +440 -0
- pyworkflow/apps/pw_viewer.py +78 -0
- pyworkflow/constants.py +1 -1
- pyworkflow/gui/__init__.py +36 -0
- pyworkflow/gui/browser.py +768 -0
- pyworkflow/gui/canvas.py +1190 -0
- pyworkflow/gui/dialog.py +981 -0
- pyworkflow/gui/form.py +2727 -0
- pyworkflow/gui/graph.py +247 -0
- pyworkflow/gui/graph_layout.py +271 -0
- pyworkflow/gui/gui.py +571 -0
- pyworkflow/gui/matplotlib_image.py +233 -0
- pyworkflow/gui/plotter.py +247 -0
- pyworkflow/gui/project/__init__.py +25 -0
- pyworkflow/gui/project/base.py +193 -0
- pyworkflow/gui/project/constants.py +139 -0
- pyworkflow/gui/project/labels.py +205 -0
- pyworkflow/gui/project/project.py +491 -0
- pyworkflow/gui/project/searchprotocol.py +240 -0
- pyworkflow/gui/project/searchrun.py +181 -0
- pyworkflow/gui/project/steps.py +171 -0
- pyworkflow/gui/project/utils.py +332 -0
- pyworkflow/gui/project/variables.py +179 -0
- pyworkflow/gui/project/viewdata.py +472 -0
- pyworkflow/gui/project/viewprojects.py +519 -0
- pyworkflow/gui/project/viewprotocols.py +2141 -0
- pyworkflow/gui/project/viewprotocols_extra.py +562 -0
- pyworkflow/gui/text.py +774 -0
- pyworkflow/gui/tooltip.py +185 -0
- pyworkflow/gui/tree.py +684 -0
- pyworkflow/gui/widgets.py +307 -0
- pyworkflow/mapper/__init__.py +26 -0
- pyworkflow/mapper/mapper.py +226 -0
- pyworkflow/mapper/sqlite.py +1583 -0
- pyworkflow/mapper/sqlite_db.py +145 -0
- pyworkflow/object.py +1 -0
- pyworkflow/plugin.py +4 -4
- pyworkflow/project/__init__.py +31 -0
- pyworkflow/project/config.py +454 -0
- pyworkflow/project/manager.py +180 -0
- pyworkflow/project/project.py +2095 -0
- pyworkflow/project/usage.py +165 -0
- pyworkflow/protocol/__init__.py +38 -0
- pyworkflow/protocol/bibtex.py +48 -0
- pyworkflow/protocol/constants.py +87 -0
- pyworkflow/protocol/executor.py +515 -0
- pyworkflow/protocol/hosts.py +318 -0
- pyworkflow/protocol/launch.py +277 -0
- pyworkflow/protocol/package.py +42 -0
- pyworkflow/protocol/params.py +781 -0
- pyworkflow/protocol/protocol.py +2712 -0
- pyworkflow/resources/protlabels.xcf +0 -0
- pyworkflow/resources/sprites.png +0 -0
- pyworkflow/resources/sprites.xcf +0 -0
- pyworkflow/template.py +1 -1
- pyworkflow/tests/__init__.py +29 -0
- pyworkflow/tests/test_utils.py +25 -0
- pyworkflow/tests/tests.py +342 -0
- pyworkflow/utils/__init__.py +38 -0
- pyworkflow/utils/dataset.py +414 -0
- pyworkflow/utils/echo.py +104 -0
- pyworkflow/utils/graph.py +169 -0
- pyworkflow/utils/log.py +293 -0
- pyworkflow/utils/path.py +528 -0
- pyworkflow/utils/process.py +154 -0
- pyworkflow/utils/profiler.py +92 -0
- pyworkflow/utils/progressbar.py +154 -0
- pyworkflow/utils/properties.py +618 -0
- pyworkflow/utils/reflection.py +129 -0
- pyworkflow/utils/utils.py +880 -0
- pyworkflow/utils/which.py +229 -0
- pyworkflow/webservices/__init__.py +8 -0
- pyworkflow/webservices/config.py +8 -0
- pyworkflow/webservices/notifier.py +152 -0
- pyworkflow/webservices/repository.py +59 -0
- pyworkflow/webservices/workflowhub.py +86 -0
- pyworkflowtests/tests/__init__.py +0 -0
- pyworkflowtests/tests/test_canvas.py +72 -0
- pyworkflowtests/tests/test_domain.py +45 -0
- pyworkflowtests/tests/test_logs.py +74 -0
- pyworkflowtests/tests/test_mappers.py +392 -0
- pyworkflowtests/tests/test_object.py +507 -0
- pyworkflowtests/tests/test_project.py +42 -0
- pyworkflowtests/tests/test_protocol_execution.py +146 -0
- pyworkflowtests/tests/test_protocol_export.py +78 -0
- pyworkflowtests/tests/test_protocol_output.py +158 -0
- pyworkflowtests/tests/test_streaming.py +47 -0
- pyworkflowtests/tests/test_utils.py +210 -0
- {scipion_pyworkflow-3.11.0.dist-info → scipion_pyworkflow-3.11.2.dist-info}/METADATA +2 -2
- scipion_pyworkflow-3.11.2.dist-info/RECORD +162 -0
- scipion_pyworkflow-3.11.0.dist-info/RECORD +0 -71
- {scipion_pyworkflow-3.11.0.dist-info → scipion_pyworkflow-3.11.2.dist-info}/WHEEL +0 -0
- {scipion_pyworkflow-3.11.0.dist-info → scipion_pyworkflow-3.11.2.dist-info}/entry_points.txt +0 -0
- {scipion_pyworkflow-3.11.0.dist-info → scipion_pyworkflow-3.11.2.dist-info}/licenses/LICENSE.txt +0 -0
- {scipion_pyworkflow-3.11.0.dist-info → scipion_pyworkflow-3.11.2.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,29 @@
|
|
1
|
+
# **************************************************************************
|
2
|
+
# *
|
3
|
+
# * Authors: J.M. De la Rosa Trevin (jmdelarosa@cnb.csic.es)
|
4
|
+
# *
|
5
|
+
# * Unidad de Bioinformatica of Centro Nacional de Biotecnologia , CSIC
|
6
|
+
# *
|
7
|
+
# * This program is free software; you can redistribute it and/or modify
|
8
|
+
# * it under the terms of the GNU General Public License as published by
|
9
|
+
# * the Free Software Foundation; either version 3 of the License, or
|
10
|
+
# * (at your option) any later version.
|
11
|
+
# *
|
12
|
+
# * This program is distributed in the hope that it will be useful,
|
13
|
+
# * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
+
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
+
# * GNU General Public License for more details.
|
16
|
+
# *
|
17
|
+
# * You should have received a copy of the GNU General Public License
|
18
|
+
# * along with this program; if not, write to the Free Software
|
19
|
+
# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
20
|
+
# * 02111-1307 USA
|
21
|
+
# *
|
22
|
+
# * All comments concerning this program package may be sent to the
|
23
|
+
# * e-mail address 'scipion@cnb.csic.es'
|
24
|
+
# *
|
25
|
+
# **************************************************************************
|
26
|
+
"""
|
27
|
+
Configuration sub-package
|
28
|
+
"""
|
29
|
+
|
@@ -0,0 +1,37 @@
|
|
1
|
+
#!/usr/bin/env python
|
2
|
+
|
3
|
+
# **************************************************************************
|
4
|
+
# *
|
5
|
+
# * Authors: J.M. De la Rosa Trevin (jmdelarosa@cnb.csic.es)
|
6
|
+
# *
|
7
|
+
# * Unidad de Bioinformatica of Centro Nacional de Biotecnologia , CSIC
|
8
|
+
# *
|
9
|
+
# * This program is free software; you can redistribute it and/or modify
|
10
|
+
# * it under the terms of the GNU General Public License as published by
|
11
|
+
# * the Free Software Foundation; either version 3 of the License, or
|
12
|
+
# * (at your option) any later version.
|
13
|
+
# *
|
14
|
+
# * This program is distributed in the hope that it will be useful,
|
15
|
+
# * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
16
|
+
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
17
|
+
# * GNU General Public License for more details.
|
18
|
+
# *
|
19
|
+
# * You should have received a copy of the GNU General Public License
|
20
|
+
# * along with this program; if not, write to the Free Software
|
21
|
+
# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
22
|
+
# * 02111-1307 USA
|
23
|
+
# *
|
24
|
+
# * All comments concerning this program package may be sent to the
|
25
|
+
# * e-mail address 'scipion@cnb.csic.es'
|
26
|
+
# *
|
27
|
+
# **************************************************************************
|
28
|
+
"""
|
29
|
+
Launch the windows with all Projects.
|
30
|
+
"""
|
31
|
+
|
32
|
+
from pyworkflow.gui.project import ProjectManagerWindow
|
33
|
+
|
34
|
+
|
35
|
+
if __name__ == '__main__':
|
36
|
+
|
37
|
+
ProjectManagerWindow().show()
|
@@ -0,0 +1,51 @@
|
|
1
|
+
#!/usr/bin/env python
|
2
|
+
|
3
|
+
|
4
|
+
import argparse
|
5
|
+
from pwem.viewers import EmPlotter
|
6
|
+
from pyworkflow.gui.plotter import Plotter
|
7
|
+
|
8
|
+
|
9
|
+
def main():
|
10
|
+
parser = argparse.ArgumentParser(prog='Scipion Plot')
|
11
|
+
parser.add_argument('--file', help='File to visualize', required=True)
|
12
|
+
parser.add_argument('--block', help='Block to visualize')
|
13
|
+
parser.add_argument('--type', help='Plot type')
|
14
|
+
parser.add_argument('--columns', help='Columns to plot')
|
15
|
+
parser.add_argument('--xcolumn', help='X Column to plot')
|
16
|
+
parser.add_argument('--orderColumn', help='Column to order')
|
17
|
+
parser.add_argument('--orderDir', help='Order direction(ASC, DESC)')
|
18
|
+
parser.add_argument('--bins', help='If plot type is histogram, number of bins')
|
19
|
+
parser.add_argument('--colors', help='Colors to plot columns')
|
20
|
+
parser.add_argument('--styles', help='Styles to plot columns')
|
21
|
+
parser.add_argument('--markers', help='Markers to plot columns')
|
22
|
+
parser.add_argument('--title', help='Plot title', default='')
|
23
|
+
parser.add_argument('--ytitle', help='Y axis title', default='')
|
24
|
+
parser.add_argument('--xtitle', help='X axis title', default='')
|
25
|
+
|
26
|
+
args = parser.parse_args()
|
27
|
+
plotfile = args.file
|
28
|
+
block = args.block if args.block else ''
|
29
|
+
type = args.type
|
30
|
+
columns = args.columns
|
31
|
+
xcolumn = args.xcolumn
|
32
|
+
orderColumn = args.orderColumn
|
33
|
+
orderDir = args.orderDir
|
34
|
+
|
35
|
+
bins = args.bins
|
36
|
+
colors = args.colors
|
37
|
+
styles = args.styles
|
38
|
+
markers = args.markers
|
39
|
+
title = args.title
|
40
|
+
xtitle = args.xtitle
|
41
|
+
ytitle = args.ytitle
|
42
|
+
|
43
|
+
Plotter.setBackend('TkAgg')
|
44
|
+
plotter = EmPlotter.createFromFile(
|
45
|
+
plotfile, block, type, columns, colors, styles, markers, xcolumn,
|
46
|
+
ytitle, xtitle, title, bins, orderColumn, orderDir)
|
47
|
+
plotter.show(block=True)
|
48
|
+
|
49
|
+
|
50
|
+
if __name__ == '__main__':
|
51
|
+
main()
|
@@ -0,0 +1,130 @@
|
|
1
|
+
#!/usr/bin/env python
|
2
|
+
# **************************************************************************
|
3
|
+
# *
|
4
|
+
# * Authors: J.M. De la Rosa Trevin (jmdelarosa@cnb.csic.es)
|
5
|
+
# *
|
6
|
+
# * Unidad de Bioinformatica of Centro Nacional de Biotecnologia , CSIC
|
7
|
+
# *
|
8
|
+
# * This program is free software; you can redistribute it and/or modify
|
9
|
+
# * it under the terms of the GNU General Public License as published by
|
10
|
+
# * the Free Software Foundation; either version 3 of the License, or
|
11
|
+
# * (at your option) any later version.
|
12
|
+
# *
|
13
|
+
# * This program is distributed in the hope that it will be useful,
|
14
|
+
# * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15
|
+
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
16
|
+
# * GNU General Public License for more details.
|
17
|
+
# *
|
18
|
+
# * You should have received a copy of the GNU General Public License
|
19
|
+
# * along with this program; if not, write to the Free Software
|
20
|
+
# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
21
|
+
# * 02111-1307 USA
|
22
|
+
# *
|
23
|
+
# * All comments concerning this program package may be sent to the
|
24
|
+
# * e-mail address 'scipion@cnb.csic.es'
|
25
|
+
# *
|
26
|
+
# **************************************************************************
|
27
|
+
"""
|
28
|
+
Launch main project window
|
29
|
+
"""
|
30
|
+
|
31
|
+
import sys
|
32
|
+
import os
|
33
|
+
from subprocess import Popen
|
34
|
+
|
35
|
+
from pyworkflow import Config, PYTHON
|
36
|
+
from pyworkflow.project import Manager
|
37
|
+
from pyworkflow.gui.project import ProjectWindow
|
38
|
+
import pyworkflow.utils as pwutils
|
39
|
+
|
40
|
+
HERE = 'here'
|
41
|
+
LAST = 'last'
|
42
|
+
LIST = 'list'
|
43
|
+
|
44
|
+
def openProject(projectName):
|
45
|
+
""" Opens a scipion project:
|
46
|
+
|
47
|
+
:param projectName: Name of an existing project to open,
|
48
|
+
or "here" to create a project in the current working dir,
|
49
|
+
or "last" to open the most recent project
|
50
|
+
|
51
|
+
"""
|
52
|
+
manager = Manager()
|
53
|
+
projName = os.path.basename(projectName)
|
54
|
+
|
55
|
+
|
56
|
+
if projName == LIST:
|
57
|
+
showProjectList(manager)
|
58
|
+
return
|
59
|
+
# Handle special name 'here' to create a project
|
60
|
+
# from the current directory
|
61
|
+
elif projName == HERE:
|
62
|
+
cwd = Config.SCIPION_CWD
|
63
|
+
|
64
|
+
if " " in cwd:
|
65
|
+
print("Projects can't have spaces in the name: %s" % cwd)
|
66
|
+
sys.exit(1)
|
67
|
+
|
68
|
+
print("\nYou are trying to create a project here:",
|
69
|
+
pwutils.cyan(cwd))
|
70
|
+
|
71
|
+
if os.listdir(cwd):
|
72
|
+
print(pwutils.red('\nWARNING: this folder is not empty!!!'))
|
73
|
+
key = input("\nDo you want to create a project here? [y/N]?")
|
74
|
+
|
75
|
+
if key.lower().strip() != 'y':
|
76
|
+
print("\nAborting...")
|
77
|
+
sys.exit(0)
|
78
|
+
else:
|
79
|
+
print("\nCreating project....")
|
80
|
+
projName = os.path.basename(cwd)
|
81
|
+
projDir = os.path.dirname(cwd)
|
82
|
+
manager.createProject(projName, location=projDir)
|
83
|
+
|
84
|
+
elif projName == LAST: # Get last project
|
85
|
+
projects = manager.listProjects()
|
86
|
+
if not projects:
|
87
|
+
sys.exit("No projects yet, cannot open the last one.")
|
88
|
+
projName = projects[0].projName
|
89
|
+
|
90
|
+
projPath = manager.getProjectPath(projName)
|
91
|
+
|
92
|
+
if os.path.exists(projPath):
|
93
|
+
|
94
|
+
# This opens the project in the same process as the launcher. This is good for directly debugging code
|
95
|
+
# but does not allow -O or not execution (usage of __debug__ flag).
|
96
|
+
# All we can do is to go straight to loading the project if debug is active or running optimized.
|
97
|
+
if Config.debugOn() or not __debug__:
|
98
|
+
|
99
|
+
|
100
|
+
# This may or may not be run Optimized (-O). It depends on the call to scipion last (launcher)
|
101
|
+
print("Launching project in debug or optimized...")
|
102
|
+
projWindow = ProjectWindow(projPath)
|
103
|
+
projWindow.show()
|
104
|
+
else:
|
105
|
+
|
106
|
+
# Run this same script optimized: Defined in scipion module under scipion-app: Circular definition. To fix! Bad design.
|
107
|
+
print("Launching project optimized...")
|
108
|
+
Popen([PYTHON, "-O", "-m","scipion", "project", projectName])
|
109
|
+
|
110
|
+
|
111
|
+
else:
|
112
|
+
print("Can't open project %s. It does not exist" % projPath)
|
113
|
+
|
114
|
+
# Show the list of projects
|
115
|
+
showProjectList(manager)
|
116
|
+
|
117
|
+
def showProjectList(manager):
|
118
|
+
|
119
|
+
projects = manager.listProjects()
|
120
|
+
|
121
|
+
print("\n******** LIST OF PROJECTS *******\n")
|
122
|
+
for project in projects:
|
123
|
+
print(project.projName)
|
124
|
+
print("\n")
|
125
|
+
if __name__ == '__main__':
|
126
|
+
|
127
|
+
if len(sys.argv) > 1:
|
128
|
+
openProject(sys.argv[1])
|
129
|
+
else:
|
130
|
+
print("usage: pw_project.py PROJECT_NAME or %s or %s or %s" % (HERE, LAST, LIST))
|
@@ -0,0 +1,143 @@
|
|
1
|
+
#!/usr/bin/env python
|
2
|
+
# **************************************************************************
|
3
|
+
# *
|
4
|
+
# * Authors: J.M. De la Rosa Trevin (jmdelarosa@cnb.csic.es)
|
5
|
+
# *
|
6
|
+
# * Unidad de Bioinformatica of Centro Nacional de Biotecnologia , CSIC
|
7
|
+
# *
|
8
|
+
# * This program is free software; you can redistribute it and/or modify
|
9
|
+
# * it under the terms of the GNU General Public License as published by
|
10
|
+
# * the Free Software Foundation; either version 3 of the License, or
|
11
|
+
# * (at your option) any later version.
|
12
|
+
# *
|
13
|
+
# * This program is distributed in the hope that it will be useful,
|
14
|
+
# * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15
|
+
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
16
|
+
# * GNU General Public License for more details.
|
17
|
+
# *
|
18
|
+
# * You should have received a copy of the GNU General Public License
|
19
|
+
# * along with this program; if not, write to the Free Software
|
20
|
+
# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
21
|
+
# * 02111-1307 USA
|
22
|
+
# *
|
23
|
+
# * All comments concerning this program package may be sent to the
|
24
|
+
# * e-mail address 'scipion@cnb.csic.es'
|
25
|
+
# *
|
26
|
+
# **************************************************************************
|
27
|
+
###
|
28
|
+
"""
|
29
|
+
List all existing protocols within Scipion
|
30
|
+
"""
|
31
|
+
|
32
|
+
import sys
|
33
|
+
|
34
|
+
from pwem.protocols import (ProtImport, ProtMicrographs, ProtParticles, Prot2D,
|
35
|
+
Prot3D)
|
36
|
+
from pyworkflow import Config
|
37
|
+
from pyworkflow.viewer import Viewer
|
38
|
+
from pyworkflow.protocol.protocol import Protocol
|
39
|
+
|
40
|
+
|
41
|
+
def getFirstLine(doc):
|
42
|
+
""" Get the first non empty line from doc. """
|
43
|
+
if doc:
|
44
|
+
for lines in doc.split('\n'):
|
45
|
+
l = lines.strip()
|
46
|
+
if l:
|
47
|
+
return l
|
48
|
+
return ''
|
49
|
+
|
50
|
+
|
51
|
+
def hasDoubleInheritance(classRef):
|
52
|
+
# loop while class has single parent
|
53
|
+
numParents = len(classRef.__bases__)
|
54
|
+
while numParents == 1 and classRef is not Protocol:
|
55
|
+
classRef = classRef.__bases__[0]
|
56
|
+
numParents = len(classRef.__bases__)
|
57
|
+
if numParents > 1:
|
58
|
+
return True
|
59
|
+
else:
|
60
|
+
return False
|
61
|
+
|
62
|
+
|
63
|
+
if __name__ == '__main__':
|
64
|
+
count = 0
|
65
|
+
withDoc = '--with-doc' in sys.argv
|
66
|
+
extended = '--extended' in sys.argv
|
67
|
+
ai = '--ai' in sys.argv
|
68
|
+
|
69
|
+
emProtocolsDict = Config.getDomain().getProtocols()
|
70
|
+
|
71
|
+
protDict = {}
|
72
|
+
|
73
|
+
# Group protocols by package name
|
74
|
+
for k, v in emProtocolsDict.items():
|
75
|
+
packageName = v.getClassPackageName()
|
76
|
+
|
77
|
+
if packageName not in protDict:
|
78
|
+
protDict[packageName] = []
|
79
|
+
|
80
|
+
if not issubclass(v, Viewer) and not v.isBase():
|
81
|
+
if extended:
|
82
|
+
protTuple = (k, v, hasDoubleInheritance(v),
|
83
|
+
v().allowMpi, v().numberOfMpi,
|
84
|
+
v().allowThreads, v().numberOfThreads,
|
85
|
+
v().stepsExecutionMode)
|
86
|
+
else:
|
87
|
+
protTuple = (k, v)
|
88
|
+
protDict[packageName].append(protTuple)
|
89
|
+
|
90
|
+
def iterGroups(protDict):
|
91
|
+
groups = list(protDict.keys())
|
92
|
+
groups.sort(key=lambda x: 1000-len(protDict[x]))
|
93
|
+
|
94
|
+
for g in groups:
|
95
|
+
yield g, protDict[g]
|
96
|
+
|
97
|
+
def printProtocols(prots):
|
98
|
+
protList = [(p[0], p[1], p[1].getClassLabel()) for p in prots]
|
99
|
+
protList.sort(key=lambda x: x[2])
|
100
|
+
|
101
|
+
for k, v, l in protList:
|
102
|
+
doc = getFirstLine(v.__doc__) if withDoc else ''
|
103
|
+
print("* link:%s[%s]: %s" % (k, l, doc))
|
104
|
+
|
105
|
+
|
106
|
+
if withDoc:
|
107
|
+
for group, prots in iterGroups(protDict):
|
108
|
+
print("Package: ", group, "(%d protocols)" % len(prots))
|
109
|
+
for p in prots:
|
110
|
+
print(" %s ( %s ):" % (p[1].getClassLabel(), p[0]))
|
111
|
+
print(" ", p[1].__doc__)
|
112
|
+
print("-" * 100)
|
113
|
+
|
114
|
+
else:
|
115
|
+
if extended:
|
116
|
+
formatStr = "{:<15}\t{:<35}\t{:<35}" + "\t{:<20}" * 6
|
117
|
+
print(formatStr.format("PACKAGE", "PROTOCOL",
|
118
|
+
"LABEL", "DOUBLE_INHERITANCE",
|
119
|
+
"ALLOWS_MPI", "NUM_MPI",
|
120
|
+
"ALLOWS_THREADS", "NUM_THREADS",
|
121
|
+
"STEPS_EXEC_MODE"))
|
122
|
+
for group, prots in iterGroups(protDict):
|
123
|
+
for p in prots:
|
124
|
+
print(formatStr.format(group, p[0],
|
125
|
+
p[1].getClassLabel(), *p[2:]))
|
126
|
+
elif ai:
|
127
|
+
for group, prots in iterGroups(protDict):
|
128
|
+
for protClassName, protClass in prots:
|
129
|
+
print("\nThe protocol named \"%s\" can be found in the %s plugin." %(protClass._label, group))
|
130
|
+
print("\"%s\" protocol help is as follows:\n %s." % (protClass._label, protClass.__doc__))
|
131
|
+
instance = protClass()
|
132
|
+
|
133
|
+
for name, param in instance._definition.iterParams():
|
134
|
+
print("\"%s\" has a \"%s\" parameter that is explained as: %s" % (protClass._label, param.label, param.help))
|
135
|
+
|
136
|
+
|
137
|
+
|
138
|
+
else:
|
139
|
+
formatStr = "{:<15}\t{:<35}\t{:<35}"
|
140
|
+
print(formatStr.format("PACKAGE", "PROTOCOL", "LABEL"))
|
141
|
+
for group, prots in iterGroups(protDict):
|
142
|
+
for k, v in prots:
|
143
|
+
print(formatStr.format(group, k, v.getClassLabel()))
|
@@ -0,0 +1,51 @@
|
|
1
|
+
#!/usr/bin/env python
|
2
|
+
# **************************************************************************
|
3
|
+
# *
|
4
|
+
# * Authors: J.M. De la Rosa Trevin (jmdelarosa@cnb.csic.es)
|
5
|
+
# *
|
6
|
+
# * Unidad de Bioinformatica of Centro Nacional de Biotecnologia , CSIC
|
7
|
+
# *
|
8
|
+
# * This program is free software; you can redistribute it and/or modify
|
9
|
+
# * it under the terms of the GNU General Public License as published by
|
10
|
+
# * the Free Software Foundation; either version 3 of the License, or
|
11
|
+
# * (at your option) any later version.
|
12
|
+
# *
|
13
|
+
# * This program is distributed in the hope that it will be useful,
|
14
|
+
# * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15
|
+
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
16
|
+
# * GNU General Public License for more details.
|
17
|
+
# *
|
18
|
+
# * You should have received a copy of the GNU General Public License
|
19
|
+
# * along with this program; if not, write to the Free Software
|
20
|
+
# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
21
|
+
# * 02111-1307 USA
|
22
|
+
# *
|
23
|
+
# * All comments concerning this program package may be sent to the
|
24
|
+
# * e-mail address 'scipion@cnb.csic.es'
|
25
|
+
# *
|
26
|
+
# **************************************************************************
|
27
|
+
"""
|
28
|
+
This module is responsible for launching protocol executions.
|
29
|
+
"""
|
30
|
+
import sys
|
31
|
+
from pyworkflow.utils import LoggingConfigurator
|
32
|
+
|
33
|
+
if __name__ == '__main__':
|
34
|
+
|
35
|
+
if len(sys.argv) == 6:
|
36
|
+
projPath = sys.argv[1]
|
37
|
+
dbPath = sys.argv[2]
|
38
|
+
protId = int(sys.argv[3])
|
39
|
+
stdOut = sys.argv[4]
|
40
|
+
stdErr = sys.argv[5]
|
41
|
+
|
42
|
+
LoggingConfigurator.setUpProtocolRunLogging(stdOut, stdErr)
|
43
|
+
|
44
|
+
from pyworkflow.protocol import runProtocolMain
|
45
|
+
runProtocolMain(projPath, dbPath, protId)
|
46
|
+
|
47
|
+
else:
|
48
|
+
from os.path import basename
|
49
|
+
print("usage: %s projPath dbPath protocolID pathToStdoutLog pathToStdErrLog." % basename(sys.argv[0]))
|
50
|
+
print("sys.argv: %s" % sys.argv)
|
51
|
+
sys.exit(1)
|