예제 #1
0
  protected JobOutput executeJellyfishCount(Args args, String ecqName, File outputDir, Library lib)
      throws ProcessExecutionException, InterruptedException, ConanParameterException, IOException {
    String suffix = "jellyfish_" + ecqName + "_" + lib.getName() + ".jf31";

    // Create the process
    JellyfishCountV11 jellyfishProcess =
        this.makeJellyfishCount(
            this.makeInputStringFromLib(lib),
            new File(new File(outputDir, ecqName), suffix).getAbsolutePath(),
            args.getOrganism(),
            args.getThreadsPerProcess());

    File outputFile = jellyfishProcess.getArgs().getOutputFile();

    // Create a job name
    String jobName = args.getJobPrefix() + "-count-" + suffix;

    // Start jellyfish
    final ExecutionResult id =
        this.conanExecutorService.executeProcess(
            jellyfishProcess,
            new File(outputDir, ecqName),
            jobName,
            args.getThreadsPerProcess(),
            args.getMemoryPerProcess(),
            args.isRunParallel());

    id.setName("count-" + suffix);

    return new JobOutput(id, outputFile);
  }
예제 #2
0
  protected String makeInputStringFromLib(Library lib) throws ProcessExecutionException {
    uk.ac.ebi.fgpt.conan.util.StringJoiner sj = new StringJoiner(" ");

    for (File file : lib.getFiles()) {

      if (!file.exists()) {
        throw new ProcessExecutionException(
            2, "Couldn't locate: " + file.getAbsolutePath() + "; for kmer counting.");
      }

      sj.add(file.getAbsolutePath());
    }

    String inputFilesStr = sj.toString();

    // Check we have something plausible to work with
    if (inputFilesStr.isEmpty())
      throw new ProcessExecutionException(2, "Couldn't locate raw library files: " + lib.getName());

    return inputFilesStr;
  }