def pairmodel(inp): if inp.testing(): # if there are no inputs, we're testing wheter the command can run cpc.util.plugin.testCommand("pairmodel --help") return persDir = inp.getPersistentDir() outDir = inp.getOutputDir() fo = inp.getFunctionOutput() rsrc = Resources(inp.getInputValue("resources")) rsrcFilename = os.path.join(persDir, 'rsrc.dat') log.debug("Initializing pairmodel") seq1 = inp.getInput('seq1') seq2 = inp.getInput('seq2') pdb1 = inp.getInput('pdb1') pdb2 = inp.getInput('pdb2') testseq = inp.getInput('testseq') #how do we assign suffix name? suffixname = pdb1.split('_')[-1] if len(suffixname) > 3: suffixname = suffixname[:-4] #do we need to copy files to working directory? if inp.getInput('cmdline_options') is not None: if has_split: cmdlineOpts = shutil.split(inp.getInput('cmdline_options')) else: cmdlineOpts = inp.getInput('cmdline_options').split() else: cmdlineOpts = [] # now add to the priority if this run has already been started # we can always add state.cpt, even if it doesn't exist. args = [ "--seqfile", testseq, "--template1", seq1, "--template2", seq2, "--seqname", os.path.basename(testseq)[:-4], "--samples1", pdb1, "--samples2", pdb2, "--suffix", suffixname ] args.extend(cmdlineOpts) cmd = cpc.command.Command(newdirname, "modeltools/pairmodel", args) if inp.hasInput("resources") and inp.getInput("resources") is not None: log.debug("resources is %s" % (inp.getInput("resources"))) #rsrc=Resources(inp.getInputValue("resources")) rsrc.updateCmd(cmd) log.debug("Adding command") fo.addCommand(cmd) # and save for further invocations rsrc.save(rsrcFilename) return fo
def pairmodel(inp): if inp.testing(): # if there are no inputs, we're testing wheter the command can run cpc.util.plugin.testCommand("pairmodel --help") return persDir=inp.getPersistentDir() outDir=inp.getOutputDir() fo=inp.getFunctionOutput() rsrc=Resources(inp.getInputValue("resources")) rsrcFilename=os.path.join(persDir, 'rsrc.dat') log.debug("Initializing pairmodel") seq1=inp.getInput('seq1') seq2=inp.getInput('seq2') pdb1=inp.getInput('pdb1') pdb2=inp.getInput('pdb2') testseq=inp.getInput('testseq') #how do we assign suffix name? suffixname=pdb1.split('_')[-1] if len(suffixname)>3: suffixname=suffixname[:-4] #do we need to copy files to working directory? if inp.getInput('cmdline_options') is not None: if has_split: cmdlineOpts=shutil.split(inp.getInput('cmdline_options')) else: cmdlineOpts=inp.getInput('cmdline_options').split() else: cmdlineOpts=[] # now add to the priority if this run has already been started # we can always add state.cpt, even if it doesn't exist. args=["--seqfile", testseq, "--template1", seq1, "--template2", seq2, "--seqname", os.path.basename(testseq)[:-4], "--samples1", pdb1, "--samples2", pdb2, "--suffix", suffixname ] args.extend(cmdlineOpts) cmd=cpc.command.Command(newdirname, "modeltools/pairmodel", args) if inp.hasInput("resources") and inp.getInput("resources") is not None: log.debug("resources is %s"%(inp.getInput("resources"))) #rsrc=Resources(inp.getInputValue("resources")) rsrc.updateCmd(cmd) log.debug("Adding command") fo.addCommand(cmd) # and save for further invocations rsrc.save(rsrcFilename) return fo
from cpc.dataflow import Value from cpc.dataflow import FileValue from cpc.dataflow import IntValue from cpc.dataflow import FloatValue from sets import Set from cpc.dataflow import Resources import cpc.command import cpc.util import tune #hack to test for shutil.split() has_split = True try: shutil.split('foo bar') except: has_split = False class ModelError(cpc.util.CpcError): pass def pairmodel_multi(inp): if inp.testing(): # if there are no inputs, we're testing wheter the command can run cpc.util.plugin.testCommand("pairmodel --help") return pers = cpc.dataflow.Persistence(
from cpc.dataflow import Value from cpc.dataflow import FileValue from cpc.dataflow import IntValue from cpc.dataflow import FloatValue from sets import Set from cpc.dataflow import Resources import cpc.command import cpc.util import tune #hack to test for shutil.split() has_split=True try: shutil.split('foo bar') except: has_split=False class ModelError(cpc.util.CpcError): pass def pairmodel_multi(inp): if inp.testing(): # if there are no inputs, we're testing wheter the command can run cpc.util.plugin.testCommand("pairmodel --help") return pers=cpc.dataflow.Persistence(os.path.join(inp.getPersistentDir(), "persistent.dat"))