Tabnine Logo
CommandInput
Code IndexAdd Tabnine to your IDE (free)

How to use
CommandInput
in
org.renci.common.exec

Best Java code snippets using org.renci.common.exec.CommandInput (Showing top 20 results out of 315)

origin: edu.unc.mapseq/modules

@Override
public ModuleOutput call() throws ModuleException {
  CommandInput commandInput = new CommandInput();
  StringBuilder command = new StringBuilder();
  command.append(getModuleClass().getAnnotation(Executable.class).value());
  command.append(" ").append(inFile.getAbsolutePath());
  command.append(" ").append(outFile.getAbsolutePath());
  command.append(" ").append(transcriptDB.getAbsolutePath());
  command.append(" ").append(sqHeader.getAbsolutePath());
  commandInput.setCommand(command.toString());
  CommandOutput commandOutput;
  try {
    Executor executor = BashExecutor.getInstance();
    commandOutput = executor.execute(commandInput, new File(System.getProperty("user.home"), ".mapseqrc"));
  } catch (ExecutorException e) {
    throw new ModuleException(e);
  }
  return new ShellModuleOutput(commandOutput);
}
origin: edu.unc.mapseq/modules

@Override
public ModuleOutput call() throws ModuleException {
  CommandOutput commandOutput = null;
  try {
    StringBuilder command = new StringBuilder();
    command.append("/bin/ln -s ").append(fastaDB).append(" ").append(symlinkFile.getAbsolutePath()).append(";");
    command.append(String.format("$%s_%s", getWorkflowName().toUpperCase(),
        getModuleClass().getAnnotation(Executable.class).value()));
    command.append(" ")
        .append(getModuleClass().getDeclaredField("algorithm").getAnnotation(InputArgument.class).flag())
        .append(" ").append(algorithm.getValue());
    command.append(" ").append(symlinkFile.getAbsolutePath());
    CommandInput commandInput = new CommandInput();
    File mapseqTmpDir = new File(System.getenv("MAPSEQ_HOME"), "tmp");
    commandInput.setWorkDir(mapseqTmpDir);
    commandInput.setCommand(command.toString());
    Executor executor = BashExecutor.getInstance();
    commandOutput = executor.execute(commandInput, new File(System.getProperty("user.home"), ".mapseqrc"));
  } catch (Exception e) {
    throw new ModuleException(e);
  }
  return new ShellModuleOutput(commandOutput);
}
origin: edu.unc.mapseq.pipelines.ncgenes-dx/ncgenes-dx-workflow

CommandInput commandInput = new CommandInput();
commandInput.setCommand(String.format("%s/bin/imkdir -p %s", irodsHome, ncgenesIRODSDirectory));
commandInput.setWorkDir(tmpDir);
commandInputList.add(commandInput);
commandInput = new CommandInput();
commandInput.setCommand(String.format("%s/bin/imeta add -C %s Project NCGENES", irodsHome,
    ncgenesIRODSDirectory));
commandInput.setWorkDir(tmpDir);
commandInputList.add(commandInput);
commandInput = new CommandInput();
commandInput.setCommand(String.format("%s/bin/imeta add -C %s ParticipantID %s NCGENES", irodsHome,
    ncgenesIRODSDirectory, participantId));
commandInput.setWorkDir(tmpDir);
commandInputList.add(commandInput);
  commandInput = new CommandInput();
  commandInput.setExitImmediately(Boolean.FALSE);
  registerCommandSB.append(String.format("if [ $? != 0 ]; then %s; %s; fi%n", deRegistrationCommand,
      registrationCommand));
  commandInput.setCommand(registerCommandSB.toString());
  commandInput.setWorkDir(tmpDir);
  commandInputList.add(commandInput);
  commandInput = new CommandInput();
  commandInput.setCommand(String.format("%s/bin/imeta add -d %s/%s ParticipantID %s NCGENES", irodsHome,
      ncgenesIRODSDirectory, bean.getFile().getName(), participantId));
origin: org.renci.commons/commons-exec

    : sourceFileSB.toString(), input.getWorkDir().getAbsolutePath(), input.getCommand());
try {
  wrapperFile = File.createTempFile("shellwrapper-", ".sh", input.getWorkDir());
  logger.info("wrapperContents: {}", wrapperContents);
  FileUtils.writeStringToFile(wrapperFile, wrapperContents, "UTF-8");
  if (input.getEnvironment() != null) {
    env = environmentToArray(input.getEnvironment());
  logger.info("running command: {}", input.getCommand());
  process = runtime.exec(wrapperFile.getAbsolutePath(), env, input.getWorkDir());
  if (input.getStdin() != null) {
    stdinStream = new BufferedOutputStream(process.getOutputStream());
    stdinStream.write(input.getStdin().toString().getBytes());
  if (input.getMaxRunTime() > 0) {
    boolean stillRunning = true;
    while (stillRunning) {
      if (currentRunTime > input.getMaxRunTime()) {
        process.destroy();
        delayedError = "Process timed out";
origin: edu.unc.mapseq.pipelines.ncgenes/ncgenes-commons

CommandInput commandInput = new CommandInput();
commandInput.setCommand(String.format("%s/bin/imkdir -p %s", irodsHome, ncgenesIRODSDirectory));
commandInput.setWorkDir(tmpDir);
commandInputList.add(commandInput);
commandInput = new CommandInput();
commandInput.setCommand(String.format("%s/bin/imeta add -C %s Project NCGENES", irodsHome,
    ncgenesIRODSDirectory));
commandInput.setWorkDir(tmpDir);
commandInputList.add(commandInput);
commandInput = new CommandInput();
commandInput.setCommand(String.format("%s/bin/imeta add -C %s ParticipantID %s NCGENES", irodsHome,
    ncgenesIRODSDirectory, participantId));
commandInput.setWorkDir(tmpDir);
commandInputList.add(commandInput);
  commandInput = new CommandInput();
  commandInput.setExitImmediately(Boolean.FALSE);
  registerCommandSB.append(String.format("if [ $? != 0 ]; then %s; %s; fi%n", deRegistrationCommand,
      registrationCommand));
  commandInput.setCommand(registerCommandSB.toString());
  commandInput.setWorkDir(tmpDir);
  commandInputList.add(commandInput);
  commandInput = new CommandInput();
  commandInput.setCommand(String.format("%s/bin/imeta add -d %s/%s ParticipantID %s NCGENES", irodsHome,
      ncgenesIRODSDirectory, bean.getFile().getName(), participantId));
origin: edu.unc.mapseq/modules

@Override
public ModuleOutput call() throws Exception {
  CommandInput commandInput = new CommandInput();
  StringBuilder commandSB = new StringBuilder();
  commandSB.append(this.executable);
  if (argument != null) {
    for (String arg : argument) {
      commandSB.append(String.format(" %s", arg));
    }
  }
  commandInput.setCommand(commandSB.toString());
  CommandOutput commandOutput;
  try {
    Executor executor = BashExecutor.getInstance();
    commandOutput = executor.execute(commandInput, new File(System.getProperty("user.home"), ".mapseqrc"));
  } catch (ExecutorException e) {
    throw new ModuleException(e);
  }
  return new ShellModuleOutput(commandOutput);
}
origin: edu.unc.mapseq.mapseq-modules/mapseq-module-bwa

@Override
public ModuleOutput call() throws ModuleException {
  CommandOutput commandOutput = null;
  try {
    StringBuilder command = new StringBuilder();
    command.append("/bin/ln -s ").append(fastaDB).append(" ").append(symlinkFile.getAbsolutePath()).append(";");
    command.append(String.format("$%s_%s", getWorkflowName().toUpperCase(),
        getModuleClass().getAnnotation(Executable.class).value()));
    command.append(" ")
        .append(getModuleClass().getDeclaredField("algorithm").getAnnotation(InputArgument.class).flag())
        .append(" ").append(algorithm.getValue());
    command.append(" ").append(symlinkFile.getAbsolutePath());
    CommandInput commandInput = new CommandInput();
    File mapseqTmpDir = new File(System.getenv("MAPSEQ_HOME"), "tmp");
    commandInput.setWorkDir(mapseqTmpDir);
    commandInput.setCommand(command.toString());
    Executor executor = BashExecutor.getInstance();
    commandOutput = executor.execute(commandInput, new File(System.getProperty("user.home"), ".mapseqrc"));
  } catch (Exception e) {
    throw new ModuleException(e);
  }
  return new ShellModuleOutput(commandOutput);
}
origin: edu.unc.mapseq.pipelines.ncgenes-variant-calling/ncgenes-variant-calling-workflow

CommandInput commandInput = new CommandInput();
commandInput.setCommand(String.format("%s/bin/imkdir -p %s", irodsHome, ncgenesIRODSDirectory));
commandInput.setWorkDir(tmpDir);
commandInputList.add(commandInput);
commandInput = new CommandInput();
commandInput.setCommand(String.format("%s/bin/imeta add -C %s Project NCGENES", irodsHome,
    ncgenesIRODSDirectory));
commandInput.setWorkDir(tmpDir);
commandInputList.add(commandInput);
commandInput = new CommandInput();
commandInput.setCommand(String.format("%s/bin/imeta add -C %s ParticipantID %s NCGENES", irodsHome,
    ncgenesIRODSDirectory, participantId));
commandInput.setWorkDir(tmpDir);
commandInputList.add(commandInput);
  commandInput = new CommandInput();
  commandInput.setExitImmediately(Boolean.FALSE);
  registerCommandSB.append(String.format("if [ $? != 0 ]; then %s; %s; fi%n", deRegistrationCommand,
      registrationCommand));
  commandInput.setCommand(registerCommandSB.toString());
  commandInput.setWorkDir(tmpDir);
  commandInputList.add(commandInput);
  commandInput = new CommandInput();
  commandInput.setCommand(String.format("%s/bin/imeta add -d %s/%s ParticipantID %s NCGENES", irodsHome,
      ncgenesIRODSDirectory, bean.getFile().getName(), participantId));
origin: edu.unc.mapseq/modules

@Override
public ModuleOutput call() throws Exception {
  logger.debug("ENTERING call()");
  StringBuilder command = new StringBuilder(getExecutable());
  command.append(" ").append(input.getAbsolutePath());
  command.append(" ").append(outputDirectory.getAbsolutePath());
  if (this.outputDirectory.isDirectory() && !this.outputDirectory.getAbsolutePath().endsWith("/")) {
    command.append("/");
  }
  CommandInput commandInput = new CommandInput();
  logger.info("command.toString(): {}", command.toString());
  commandInput.setCommand(command.toString());
  CommandOutput commandOutput;
  try {
    Executor executor = BashExecutor.getInstance();
    commandOutput = executor.execute(commandInput, new File(System.getProperty("user.home"), ".mapseqrc"));
  } catch (ExecutorException e) {
    throw new ModuleException(e);
  }
  return new ShellModuleOutput(commandOutput);
}
origin: edu.unc.mapseq/modules

@Override
public ModuleOutput call() throws ModuleException {
  logger.debug("ENTERING call()");
  CommandOutput commandOutput;
  try {
    StringBuilder command = new StringBuilder();
    command.append(getModuleClass().getAnnotation(Executable.class).value());
    command.append(" ").append(regularExpression);
    command.append(" > ").append(outputFile.getAbsolutePath());
    CommandInput commandInput = new CommandInput();
    commandInput.setWorkDir(directory);
    commandInput.setCommand(command.toString());
    Executor executor = BashExecutor.getInstance();
    commandOutput = executor.execute(commandInput, new File(System.getProperty("user.home"), ".mapseqrc"));
    if (mimeType != null) {
      FileData fileData = new FileData();
      fileData.setName(outputFile.getName());
      fileData.setMimeType(mimeType);
      addFileData(fileData);
    }
  } catch (ExecutorException e) {
    throw new ModuleException(e);
  }
  return new ShellModuleOutput(commandOutput);
}
origin: edu.unc.mapseq.pipelines.ncgenes-incdidental-variantcalling/ncgenes-incidental-variant-calling-workflow

CommandInput commandInput = new CommandInput();
commandInput.setCommand(String.format("%s/bin/imkdir -p %s", irodsHome, ncgenesIRODSDirectory));
commandInput.setWorkDir(tmpDir);
commandInputList.add(commandInput);
commandInput = new CommandInput();
commandInput.setCommand(String.format("%s/bin/imeta add -C %s Project NCGENES", irodsHome,
    ncgenesIRODSDirectory));
commandInput.setWorkDir(tmpDir);
commandInputList.add(commandInput);
commandInput = new CommandInput();
commandInput.setCommand(String.format("%s/bin/imeta add -C %s ParticipantID %s NCGENES", irodsHome,
    ncgenesIRODSDirectory, participantId));
commandInput.setWorkDir(tmpDir);
commandInputList.add(commandInput);
  commandInput = new CommandInput();
  commandInput.setExitImmediately(Boolean.FALSE);
  registerCommandSB.append(String.format("if [ $? != 0 ]; then %s; %s; fi%n", deRegistrationCommand,
      registrationCommand));
  commandInput.setCommand(registerCommandSB.toString());
  commandInput.setWorkDir(tmpDir);
  commandInputList.add(commandInput);
  commandInput = new CommandInput();
  commandInput.setCommand(String.format("%s/bin/imeta add -d %s/%s ParticipantID %s NCGENES", irodsHome,
      ncgenesIRODSDirectory, bean.getFile().getName(), participantId));
origin: edu.unc.mapseq/modules

@Override
public ModuleOutput call() throws Exception {
  logger.debug("ENTERING call()");
  Properties readLengthProperties = new Properties();
  FileInputStream fis = new FileInputStream(this.readLength);
  readLengthProperties.loadFromXML(fis);
  fis.close();
  StringBuilder command = new StringBuilder(getExecutable());
  command.append(" ").append(junction.getAbsolutePath());
  command.append(" ").append(readLengthProperties.getProperty("maxLength"));
  command.append(" ").append(minimumAnchor.toString());
  command.append(" ").append(referenceSequenceDirectory.getAbsolutePath());
  command.append(" ").append(sam.getAbsolutePath());
  CommandInput commandInput = new CommandInput();
  logger.info("command.toString(): {}", command.toString());
  commandInput.setCommand(command.toString());
  CommandOutput commandOutput;
  try {
    Executor executor = BashExecutor.getInstance();
    commandOutput = executor.execute(commandInput, new File(System.getProperty("user.home"), ".mapseqrc"));
  } catch (ExecutorException e) {
    throw new ModuleException(e);
  }
  return new ShellModuleOutput(commandOutput);
}
origin: edu.unc.mapseq/modules

@Override
public ModuleOutput call() throws ModuleException {
  CommandInput commandInput = new CommandInput();
  StringBuilder command = new StringBuilder();
  command.append(getModuleClass().getAnnotation(Executable.class).value());
  if (threads != null) {
    try {
      command.append(" ");
      command.append(getModuleClass().getDeclaredField("threads").getAnnotation(InputArgument.class).flag());
      command.append(" ");
      command.append(threads);
    } catch (Exception e) {
      throw new ModuleException(e);
    }
  }
  if (StringUtils.isNotEmpty(target)) {
    command.append(" ").append(target);
  }
  commandInput.setCommand(command.toString());
  commandInput.setWorkDir(this.workDir);
  CommandOutput commandOutput;
  try {
    Executor executor = BashExecutor.getInstance();
    commandOutput = executor.execute(commandInput, new File(System.getProperty("user.home"), ".mapseqrc"));
  } catch (ExecutorException e) {
    throw new ModuleException(e);
  }
  return new ShellModuleOutput(commandOutput);
}
origin: edu.unc.mapseq/modules

@Override
public ModuleOutput call() throws ModuleException {
  File userHome = new File(System.getProperty("user.home"));
  CommandInput commandInput = new CommandInput();
  StringBuilder command = new StringBuilder();
  command.append(String.format(getModuleClass().getAnnotation(Executable.class).value()));
  commandInput.setCommand(command.toString());
  CommandOutput commandOutput;
  try {
    Executor executor = BashExecutor.getInstance();
    commandOutput = executor.execute(commandInput, new File(userHome, ".mapseqrc"));
  } catch (ExecutorException e) {
    throw new ModuleException(e);
  }
  return new ShellModuleOutput(commandOutput);
}
origin: edu.unc.mapseq.mapseq-modules/mapseq-module-gatk

@Override
public ModuleOutput call() throws Exception {
  CommandInput commandInput = new CommandInput();
  File mapseqTmpDir = new File(System.getenv("MAPSEQ_HOME"), "tmp");
  commandInput.setWorkDir(mapseqTmpDir);
  StringBuilder command = new StringBuilder();
  command.append(String.format(getModuleClass().getAnnotation(Executable.class).value(),
  commandInput.setCommand(command.toString());
  CommandOutput commandOutput;
  try {
origin: edu.unc.mapseq/modules

@Override
public ModuleOutput call() throws Exception {
  logger.debug("ENTERING call()");
  StringBuilder command = new StringBuilder(getExecutable());
  command.append(" ").append(this.minimumAnchor.toString());
  command.append(" ").append(this.maximumAnchor.toString());
  command.append(" ").append(this.maximumSequenceThreshold.toString());
  command.append(" ").append(this.junction.getAbsolutePath());
  command.append(" ").append(this.referenceSequenceDirectory.getAbsolutePath());
  if (this.referenceSequenceDirectory.isDirectory()
      && !this.referenceSequenceDirectory.getAbsolutePath().endsWith("/")) {
    command.append("/");
  }
  command.append(" ").append(this.output.getAbsolutePath());
  CommandInput commandInput = new CommandInput();
  logger.info("command.toString(): {}", command.toString());
  commandInput.setCommand(command.toString());
  CommandOutput commandOutput;
  try {
    Executor executor = BashExecutor.getInstance();
    commandOutput = executor.execute(commandInput, new File(System.getProperty("user.home"), ".mapseqrc"));
  } catch (ExecutorException e) {
    throw new ModuleException(e);
  }
  return new ShellModuleOutput(commandOutput);
}
origin: edu.unc.mapseq.mapseq-modules/mapseq-module-gatk

@Override
public ModuleOutput call() throws ModuleException {
  CommandInput commandInput = new CommandInput();
  File mapseqTmpDir = new File(System.getenv("MAPSEQ_HOME"), "tmp");
  commandInput.setWorkDir(mapseqTmpDir);
  StringBuilder command = new StringBuilder();
  command.append(String.format(getModuleClass().getAnnotation(Executable.class).value(),
  commandInput.setCommand(command.toString());
  CommandOutput commandOutput;
  try {
origin: edu.unc.mapseq/modules

@Override
public ModuleOutput call() throws Exception {
  logger.debug("ENTERING call()");
  StringBuilder command = new StringBuilder(getExecutable());
  command.append(" ").append(clusterDirectory.getAbsolutePath()).append("/");
  CommandInput commandInput = new CommandInput();
  logger.info("command.toString(): {}", command.toString());
  commandInput.setCommand(command.toString());
  CommandOutput commandOutput;
  try {
    Executor executor = BashExecutor.getInstance();
    commandOutput = executor.execute(commandInput, new File(System.getProperty("user.home"), ".mapseqrc"));
  } catch (ExecutorException e) {
    throw new ModuleException(e);
  }
  return new ShellModuleOutput(commandOutput);
}
origin: edu.unc.mapseq.mapseq-modules/mapseq-module-gatk

@Override
public ModuleOutput call() throws Exception {
  CommandInput commandInput = new CommandInput();
  File mapseqTmpDir = new File(System.getenv("MAPSEQ_HOME"), "tmp");
  commandInput.setWorkDir(mapseqTmpDir);
  StringBuilder command = new StringBuilder();
  command.append(String.format(getModuleClass().getAnnotation(Executable.class).value(),
  commandInput.setCommand(command.toString());
  CommandOutput commandOutput;
  try {
origin: edu.unc.mapseq/modules

@Override
public ModuleOutput call() throws Exception {
  logger.debug("ENTERING call()");
  StringBuilder command = new StringBuilder(getExecutable());
  command.append(" ").append(this.minimumAnchorWidth.toString());
  command.append(" ").append(this.maximumAnchor.toString());
  command.append(" ").append(this.maximumThresholdEach.toString());
  command.append(" ").append(this.maximumThresholdTotal.toString());
  command.append(" ").append(this.junction.getAbsolutePath());
  command.append(" 1");
  command.append(" ").append(this.fusionJunction.getAbsolutePath());
  command.append(" 1");
  command.append(" ").append(this.referenceSequenceDirectory.getAbsolutePath());
  if (this.referenceSequenceDirectory.isDirectory()
      && !this.referenceSequenceDirectory.getAbsolutePath().endsWith("/")) {
    command.append("/");
  }
  command.append(" ").append(this.output.getAbsolutePath());
  CommandInput commandInput = new CommandInput();
  logger.info("command.toString(): {}", command.toString());
  commandInput.setCommand(command.toString());
  CommandOutput commandOutput;
  try {
    Executor executor = BashExecutor.getInstance();
    commandOutput = executor.execute(commandInput, new File(System.getProperty("user.home"), ".mapseqrc"));
  } catch (ExecutorException e) {
    throw new ModuleException(e);
  }
  return new ShellModuleOutput(commandOutput);
}
org.renci.common.execCommandInput

Most used methods

  • <init>
  • setCommand
  • setWorkDir
  • setExitImmediately
  • getCommand
  • getEnvironment
  • getMaxRunTime
  • getStdin
  • getWorkDir

Popular in Java

  • Reactive rest calls using spring rest template
  • onRequestPermissionsResult (Fragment)
  • setRequestProperty (URLConnection)
  • getApplicationContext (Context)
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now