예제 #1
0
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))
예제 #2
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)
예제 #3
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)