@Override protected void reduce(ChromosomeRegion key, Iterable<SAMRecordWritable> values, Context context) throws IOException, InterruptedException { super.reduce(key, values, context); try { Logger.DEBUG("Processing key: " + key); // wrappers to call external programs PreprocessingTools tools = new PreprocessingTools(bin); GATKTools gatk = new GATKTools(ref, bin); gatk.setContext(context); tools.setContext(context); gatk.setThreads(threads); if (java != null) { gatk.setJava(java); tools.setJava(java); } processAlignments(values, context, tools, gatk); } catch (URISyntaxException | QualityException | ProcessException ex) { Logger.EXCEPTION(ex); throw new InterruptedException(ex.getMessage()); } }
@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; } }