Example #1
0
 def __init__(self, **kwargs):
     OrderedObject.__init__(self, **kwargs)
     self.name = String('default')
     self.maxCores = Integer()
     self.allowMPI = Boolean()
     self.allowThreads = Boolean()
     self.maxHours = Integer()
Example #2
0
    def _insertAllSteps(self):
        self.sym = CHIMERA_SYM_NAME[self.symmetryGroup.get()]
        self.symOrder = self.symmetryOrder.get()
        if not self.applySymmetry:
            self.sym = "Cn"
            self.symOrder = 1
            self.SYMMETRY = Boolean(False)
        elif (self.sym == "Cn" or self.sym == "Dn") and self.symOrder == 1:
            self.SYMMETRY = Boolean(False)
        # connect to database, delete table and recreate it
        # execute chimera findclash
        self._insertFunctionStep('chimeraClashesStep')
        self._insertFunctionStep('postProcessStep')

        self._store()
Example #3
0
    def createOutputStep(self):
        set1 = self.inputSets[0].get()  # 1st set (we use it many times)

        # Read ClassName and create the corresponding EMSet (SetOfParticles...)
        outputSet = getattr(self, "_create%s" % set1.getClassName())()

        # Copy info from input sets (sampling rate, etc).
        outputSet.copyInfo(set1)  # all sets must have the same info as set1!

        # Renumber from the beginning if either the renumber option is selected
        # or we find duplicated ids in the sets
        cleanIds = self.renumber.get() or self.duplicatedIds()

        #TODO ROB remove ignoreExtraAttributes condition
        #or implement it. But this will be for Scipion 1.2
        self.ignoreExtraAttributes = Boolean(True)
        if self.ignoreExtraAttributes:
            commonAttrs = list(self.commonAttributes())

        for itemSet in self.inputSets:
            for obj in itemSet.get():
                if self.ignoreExtraAttributes:
                    newObj = itemSet.get().ITEM_TYPE()
                    newObj.copyAttributes(obj, *commonAttrs)
                else:
                    newObj = obj

                if cleanIds:
                    newObj.cleanObjId()
                outputSet.append(newObj)

        self._defineOutputs(outputSet=outputSet)
        for itemSet in self.inputSets:
            self._defineSourceRelation(itemSet, outputSet)
Example #4
0
def getBoolListFromValues(valuesStr, length=None):
    ''' Convert a string to a list of booleans'''
    from pyworkflow.object import Boolean
    return [
        Boolean(value=v).get() for v in getListFromValues(valuesStr, length)
    ]
Example #5
0
projectsDir = os.path.join(pw.Config.SCIPION_USER_DATA, 'projects')
projName = sys.argv[1]
manager = Manager()
project = manager.loadProject(projName)

if project is None:
    usage("Project '%s' does not exist in: \n  %s" % (projName, projectsDir))

setReadOnly = False
setLifeTime = False

for arg in sys.argv:
    if arg.startswith('readOnly='):
        setReadOnly = True
        value = arg.split('readOnly=')[1]
        b = Boolean(value=value)
        readOnlyValue = b.get()
    elif arg.startswith('lifeTime='):
        setLifeTime = True
        value = arg.split('lifeTime=')[1]
        lifeTimeValue = None if value == 'None' else int(value)

if setReadOnly:
    project.setReadOnly(readOnlyValue)

if setLifeTime:
    project.settings.setLifeTime(lifeTimeValue)

if setReadOnly or setLifeTime:
    # Truly write settings
    project.settings.write()
Example #6
0
 def __init__(self, **kwargs):
     EMProtocol.__init__(self, **kwargs)
     self.stepsExecutionMode = STEPS_PARALLEL
     self.isFirstTime = Boolean(False)
Example #7
0
 def __init__(self, **args):
     EMProtocol.__init__(self, **args)
     self.SYMMETRY = Boolean(True)
Example #8
0
# * (at your option) any later version.
# *
# * This program is distributed in the hope that it will be useful,
# * but WITHOUT ANY WARRANTY; without even the implied warranty of
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# * GNU General Public License for more details.
# *
# * You should have received a copy of the GNU General Public License
# * along with this program; if not, write to the Free Software
# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
# * 02111-1307  USA
# *
# *  All comments concerning this program package may be sent to the
# *  e-mail address '*****@*****.**'
# *
# **************************************************************************

import sys

from pyworkflow.object import Boolean
from convert import runGempicker


if __name__ == '__main__':
    micName = sys.argv[1]
    workDir = sys.argv[2]
    useGPU = Boolean(sys.argv[3])
    args = " ".join(sys.argv[4:])

    runGempicker(micName, workDir, useGPU, args)