コード例 #1
0
def setupMultiProtocol(argServer,
                       procNames=(
                           'CYANA_SS1',
                           'CYANA_PEAKLIST',
                           'ROSETTA_MULTI',
                           'UNIO_CANDID',
                           'ASDP_XPLOR',
                       ),
                       prelimProtocolName=prelimProtocolName,
                       executeProc=False):
    """ Run multiple, connected protocols in one run
  """

    intIo.setupMultiInteractive(argServer, procNames, prelimProtocolName)
コード例 #2
0
def setupAsdpXplor(argServer):

    project = argServer.getProject()
    run = None
    #runIndex = None
    runIndex = 88
    if runIndex:
        for store in reversed(project.sortedNmrCalcStores()):
            run = store.findFirstRun(serial=runIndex)
            if run:
                break

    intIo.setupSingleInteractive(argServer,
                                 protocolName='ASDP_XPLOR',
                                 prelimProtocolName=prelimProtocolName,
                                 masterRun=run)
コード例 #3
0
def setupCyanaPeaklist(argServer):

    project = argServer.getProject()
    run = None
    #runIndex = None
    runIndex = 88
    if runIndex:
        for store in reversed(project.sortedNmrCalcStores()):
            run = store.findFirstRun(serial=runIndex)
            if run:
                break

    intIo.setupSingleInteractive(argServer,
                                 protocolName='CYANA_PEAKLIST',
                                 prelimProtocolName=prelimProtocolName,
                                 masterRun=run)
コード例 #4
0
def setupCandid(argServer):

    project = argServer.getProject()
    run = None
    #runIndex = None
    runIndex = 55
    if runIndex:
        for store in reversed(project.sortedNmrCalcStores()):
            run = store.findFirstRun(serial=runIndex)
            if run:
                break

    intIo.setupSingleInteractive(argServer,
                                 protocolName='UNIO_CANDID',
                                 prelimProtocolName=prelimProtocolName,
                                 masterRun=run)
コード例 #5
0
def runCyana2CcpnDialogue(argServer):

    calculationData = intIo.runCyana2CcpnDialogue(
        argServer,
        protocolName='CYANA_SS4',
    )
    return calculationData
コード例 #6
0
ファイル: write.py プロジェクト: fenglb/ccpnmr2.4
def write(nmrCalcRun, targetDir):
  """ Write input files for Program run
    Input:
      nmrCalcRun: NmrCalc.Run 
      targetDir: destination directory.
  """
  
  intIo.writeDataFiles(nmrCalcRun, targetDir)
  
  jsonDict = intIo.makeJsonDict(nmrCalcRun)
  
  
  # write properties file (must be done at the end
  propFile = uniIo.joinPath(targetDir, intIo.propFileName)
  print 'About to write', propFile
  open(propFile,'w').write(json.dumps(jsonDict, sort_keys=True, 
                                      indent=intIo.propIndent))
コード例 #7
0
ファイル: write.py プロジェクト: fenglb/ccpnmr2.4
def oldwrite(nmrCalcRun, topDir=None):
  """ Write input files for Program run
    Input:
      nmrCalcRun: NmrCalc.Run 
      topDir: optional destination directory.
  """
  targetDir = intIo.createTargetDir(nmrCalcRun, topDir=topDir)
  
  # write Properties file
  propDict, dummy = intIo.makeParameterDict(nmrCalcRun)
  propFile = uniIo.joinPath(targetDir, intIo.propFileName)
  open(propFile,'w').write(json.dumps(propDict, sort_keys=True, 
                                      indent=intIo.propIndent))
  
  # Write data file
  
  # get file
  inpFile = propDict.get('INPUT_FILE')
  if inpFile:
    talosInputFile = uniIo.joinPath(targetDir, inpFile)
  else:
    raise Exception("No code=INPUT_FILE RunParameter in nmrCalcRun")
  
  # Get shiftList
  shiftList = intUtil.getMeasurementList(nmrCalcRun)
  if shiftList is None:
    raise Exception("Run must have exactly one shift list, %s found" % len(ll))
  
  # Get residues
  ll = list(nmrCalcRun.findAllData(className='MolResidueData'))
  if len(ll) == 1:
    obj =  ll.pop()
    residues = list(obj.residues)
    residues.sort(key=operator.attrgetter('seqId'))
    if len(set(obj.chainCodes)) != 1:
      raise Exception("Run MolResidueData did not have a (single) chain" )
  else:
    raise Exception("Run must have excactly one MolResidueData, %s found" % len(ll))
  
  #  
  talosIo.writeShiftFile(open(talosInputFile,'w'), residues, shiftList,
                         propDict.get('minShiftQuality'))
コード例 #8
0
ファイル: write.py プロジェクト: fenglb/ccpnmr2.4
def write(nmrCalcRun, targetDir):
    """ Write input files for Program run
    Input:
      nmrCalcRun: NmrCalc.Run 
      targetDir: destination directory.
  """

    intIo.writeDataFiles(nmrCalcRun, targetDir)

    jsonDict = intIo.makeJsonDict(nmrCalcRun)

    # write properties file
    propFile = uniIo.joinPath(targetDir, intIo.propFileName)
    open(propFile, 'w').write(
        json.dumps(jsonDict, sort_keys=True, indent=intIo.propIndent))

    # Write program setup file
    fileNameObj = nmrCalcRun.findFirstRunParameter(name='fileNameSetup')
    if fileNameObj is not None:
        filePath = uniIo.joinPath(targetDir, fileNameObj.textValue)
        writeSetupFile(filePath, jsonDict)
コード例 #9
0
ファイル: write.py プロジェクト: fenglb/ccpnmr2.4
def write(nmrCalcRun, targetDir):
    """ Write input files for Program run
    Input:
      nmrCalcRun: NmrCalc.Run
      targetDir: destination directory.
  """

    intIo.writeDataFiles(nmrCalcRun, targetDir)

    jsonDict = intIo.makeJsonDict(nmrCalcRun)

    # write properties file
    propFile = uniIo.joinPath(targetDir, intIo.propFileName)
    print 'About to write', propFile
    open(propFile, 'w').write(
        json.dumps(jsonDict, sort_keys=True, indent=intIo.propIndent))

    # Write program setup file
    fileNameObj = nmrCalcRun.findFirstRunParameter(name='fileNameSetup')
    importJsonName = 'cyana2ccpn.json'
    if fileNameObj is not None:

        # write init.cya
        initFile = uniIo.joinPath(targetDir, initFileName)
        rmsdrange = jsonDict['RunParameter'].pop('rmsdrange')
        seqFile = jsonDict['RunParameter'].pop('fileNameSequence')
        text = """# Cyana init file - Generated by CcpNmr Integrator
rmsdrange:=%s
cyanalib
read seq %s
""" % (rmsdrange, seqFile)
        open(initFile, 'w').write(text)

        # write main command file
        filePath = uniIo.joinPath(targetDir, fileNameObj.textValue)
        importFilePath = uniIo.joinPath(targetDir, importJsonName)
        writeSetupFile(filePath, jsonDict)
        writeImportJson(importFilePath, jsonDict)
コード例 #10
0
def runCyanaPeaklist(argServer):

    intIo.runCyana2Ccpn(
        argServer,
        protocolName='CYANA_SS4',
    )
コード例 #11
0
def runCandid(argServer):

    intIo.runSingleInteractive(argServer,
                               protocolName='UNIO_CANDID_XPLOR_TEST',
                               prelimProtocolName=prelimProtocolName)
コード例 #12
0
def setupPreviousCalculation(argServer):

    intIo.setupPreviousCalculation(argServer, protocolName='CYANA_SS4')
コード例 #13
0
def importDataFromCyana(argServer, calculationData=None):
    if calculationData == None:
        dataSources = intIo.importDataFromCyana(argServer)
    else:
        dataSources = intIo.importDataFromCyana(calculationData)
    return dataSources
コード例 #14
0
def runPreviousCalculation(argServer):

    intIo.runPreviousCalculation(argServer, protocolName='CYANA_SS4')
コード例 #15
0
===========================REFERENCE END===============================

"""

import sys

from ccpnmr.integrator.core import Util as intUtil
from ccpnmr.integrator.core import Io as intIo



if __name__ == '__main__':


  """ Merge multiple projectfiles (directories or .tgz) as output from WMS).
  """
  
  if len(sys.argv) >= 3:
    #
    # set up input
    nmrCalcRunId = sys.argv[1]
    projectFiles = sys.argv[2:]
    
    intIo.mergeParallelRuns(nmrCalcRunId, projectFiles)
      
  else:
    print "Usage: merge NmrCalcRun.IDstring projectFiles* "
  
  
コード例 #16
0
def runAsdpXplor(argServer):

    intIo.runSingleInteractive(argServer,
                               protocolName='ASDP_XPLOR',
                               prelimProtocolName=prelimProtocolName)
コード例 #17
0
def setupRosetta(argServer):

    intIo.setupSingleInteractive(argServer,
                                 protocolName='ROSETTA_MULTI',
                                 prelimProtocolName=prelimProtocolName)
コード例 #18
0
ファイル: read.py プロジェクト: fenglb/ccpnmr2.4
                                        details=docTemplate % ss)

    # Make Nmr.StructureCalculation
    nmrProject = nmrCalcRun.nmrCalcStore.nmrProject
    nmrCalcRun.structureGeneration = nmrProject.newStructureGeneration(
        generationType='denovo', name='CSRosetta', structureEnsemble=ensemble)


if __name__ == '__main__':
    """ Run read function from command line.
  Input is projectDir NmrCalcRun.IDstring, Rosetta.outputdir
  projectDir must contain the desired project (and no others)
  NmrCalcRun.IDstring is of the form 
  '%s+%s' % (NmrCalcStore.guid, Run.serial)
  """

    if len(sys.argv) == 4:

        # set up input
        junk, projectDir, nmrCalcRunId, rosettaDir = sys.argv

        nmrCalcRun = intIo.getNmrCalcRun(projectDir, nmrCalcRunId)
        if nmrCalcRun is None:
            print "No NmrCalcRun found. Aborting"
        else:
            read(nmrCalcRun, rosettaDir)
            nmrCalcRun.root.saveModified()

    else:
        print "Usage: read projectDir NmrCalcRun.IDstring RosettaDataDir"
コード例 #19
0
def setupCyanaCalculation(argServer):

    intIo.setupSingleInteractive(
        argServer,
        protocolName='CYANA_SS4',
    )
コード例 #20
0
def setupCyanaCalculationDialogue(argServer):

    intIo.setupCyana2CcpnDialogue(
        argServer,
        protocolName='CYANA_SS4',
    )
コード例 #21
0
if __name__ == '__main__':
    """ Run write function from command line.
  Input is projectDir NmrCalcRun.IDstring
  projectDir must contain the desired project (and no others)
  NmrCalcRun.IDstring is of the form 
  '%s+%s' % (NmrCalcStore.guid, Run.serial)
  """

    from memops.general import Io as genIo

    if len(sys.argv) >= 3:

        # set up input
        junk, projectDir, nmrCalcRunId = sys.argv

        if len(sys.argv) >= 4:
            targetDir = sys.argv[3]
        else:
            targetDir = None

        #intIo.prepareStdWmsRun(pluginName, projectDir, nmrCalcRunId, targetDir)

        # NB necessary.
        # As side effect prints message that passes newCalcId to WMS Java
        nmrCalcRun = intIo.getNmrCalcRun(projectDir, nmrCalcRunId, pluginName)

    else:
        #print "Usage: write projectDir NmrCalcRun.IDstring"
        print "Usage: write projectDir NmrCalcRun.IDstring targetDir(optional)"
コード例 #22
0
if __name__ == '__main__':


  """ Copy master NmrCalcRun and add default configuration parameters to copy
  Input
  """
  
  if len(sys.argv) >= 4:
    #
    # set up input
    junk, projectDir, nmrCalcRunId, protocolName = sys.argv[:4]
    
    print '### input : ', projectDir, nmrCalcRunId, protocolName
    
    masterRun = intIo.getNmrCalcRun(projectDir, nmrCalcRunId)
    print '### masterRun', masterRun
    if masterRun is None:
      raise Exception("No NmrCalcRun found for %s, %s" 
                      % (projectDir, nmrCalcRunId))
    
    nmrCalcRun = intUtil.makeDerivedRun(masterRun)
    print '### nmrCalcRun', nmrCalcRun
    
    try:
      pluginModule = intUtil.getIntegratorPlugin(protocolName)
      intUtil.setRunParametersFromConfig(nmrCalcRun, 
                                         pluginModule.Util.defaultConfiguration)
    except:
      print 'WARNING, no python plugin found for %s' % protocolName