示例#1
0
 private BWAAlnInstance(Mapper.Context context, String bin)
     throws IOException, URISyntaxException {
   super(context, bin);
   taskId = context.getTaskAttemptID().toString();
   taskId = taskId.substring(taskId.indexOf("m_"));
   ref = HalvadeFileUtils.downloadBWAIndex(context, taskId);
   alnCustomArgs = HalvadeConf.getCustomArgs(context.getConfiguration(), "bwa", "aln");
 }
示例#2
0
  private void startBWASamXe() throws InterruptedException {
    String customArgs = HalvadeConf.getCustomArgs(context.getConfiguration(), "bwa", "sampe");
    String[] command =
        CommandGenerator.bwaSamXe(
            bin,
            ref,
            getFileName(tmpdir, taskId, true, 1),
            getFileName(tmpdir, taskId, false, 1),
            getFileName(tmpdir, taskId, true, 2),
            getFileName(tmpdir, taskId, false, 2),
            isPaired,
            threads,
            customArgs);
    samxe = new ProcessBuilderWrapper(command, bin);
    samxe.startProcess(null, System.err);
    if (!samxe.isAlive()) throw new ProcessException("BWA samXe", samxe.getExitState());

    // make a SAMstream handler
    ssh = new SAMStreamHandler(instance, context, false);
    ssh.start();
  }
示例#3
0
 @Override
 protected void setup(Context context) throws IOException, InterruptedException {
   super.setup(context);
   isFirstAttempt = taskId.endsWith("_0");
   isRNA = HalvadeConf.getIsRNA(context.getConfiguration());
   scc = HalvadeConf.getSCC(context.getConfiguration(), isRNA);
   sec = HalvadeConf.getSEC(context.getConfiguration(), isRNA);
   try {
     gff = HalvadeFileUtils.downloadGFF(context, taskId);
   } catch (URISyntaxException ex) {
     Logger.EXCEPTION(ex);
     throw new InterruptedException("Error when downloading GFF file");
   }
   filterBedFile = HalvadeConf.getFilterBed(context.getConfiguration());
   filterDBsnp = HalvadeConf.getFilterDBSnp(context.getConfiguration());
   useUnifiedGenotyper = HalvadeConf.getUseUnifiedGenotyper(context.getConfiguration());
   redistribute = HalvadeConf.getRedistribute(context.getConfiguration());
   containers = HalvadeConf.getMapContainerCount(context.getConfiguration());
   tasksLeft = Integer.parseInt(context.getConfiguration().get("mapred.map.tasks")) - taskNr;
   // get task number:
   if (redistribute && tasksLeft < containers) {
     threads = 6;
   }
 }