@Override public ModuleOutput call() throws Exception { DefaultModuleOutput moduleOutput = new DefaultModuleOutput(); int exitCode = 0; List<String> argumentList = new ArrayList<String>(); argumentList.add("--in"); argumentList.add(this.input.getAbsolutePath()); argumentList.add("--out"); argumentList.add(this.output.getAbsolutePath()); argumentList.add("--junctions"); argumentList.add(this.junctions.getAbsolutePath()); try { SpliceJunctionCounter.run(argumentList.toArray(new String[argumentList.size()])); } catch (Exception e) { exitCode = -1; e.printStackTrace(); moduleOutput.setError(new StringBuilder(e.getMessage())); return moduleOutput; } moduleOutput.setExitCode(exitCode); FileData fileData = new FileData(); fileData.setMimeType(MimeType.TEXT_PLAIN); fileData.setName(output.getName()); addFileData(fileData); return moduleOutput; }
@Override public ModuleOutput call() throws ModuleException { DefaultModuleOutput moduleOutput = new DefaultModuleOutput(); int exitCode = 0; try { List<String> argumentList = new ArrayList<String>(); argumentList.add("OUTPUT=" + output.getAbsolutePath()); argumentList.add("INPUT=" + input.getAbsolutePath()); exitCode = new BuildBamIndex().instanceMain(argumentList.toArray(new String[argumentList.size()])); } catch (Exception e) { e.printStackTrace(); moduleOutput.setError(new StringBuilder(e.getMessage())); moduleOutput.setExitCode(-1); return moduleOutput; } moduleOutput.setExitCode(exitCode); FileData fm = new FileData(); fm.setMimeType(MimeType.APPLICATION_BAM_INDEX); fm.setPath(output.getParentFile().getAbsolutePath()); fm.setName(output.getName()); addFileData(fm); return moduleOutput; }
if (fileData.getMimeType().equals(mimeType)) { List<Job> jobList = null; try { jobList = mapseqDAOBean.getJobDAO().findFileDataByIdAndWorkflowId(fileData.getId(), clazz.getName(), workflowId); } catch (MaPSeqDAOException e) { for (Job job : jobList) { if (job.getName().contains(clazz.getSimpleName())) { logger.debug("using FileData: {}", fileData.toString()); logger.debug("from Job: {}", job.toString()); ret.add(new File(fileData.getPath(), fileData.getName())); break;
MimeType mimeType = fileData.getMimeType(); if (mimeType != null && mimeType.equals(MimeType.FASTQ)) { Pattern patternR1 = Pattern.compile(String.format("^%s.*_L00%d_R1\\.fastq\\.gz$", sequencerRunName, laneIndex)); Matcher matcherR1 = patternR1.matcher(fileData.getName()); File file = new File(fileData.getPath(), fileData.getName()); if (matcherR1.matches()) { logger.debug("found file: {}", file.getAbsolutePath()); Matcher matcherR2 = patternR2.matcher(fileData.getName()); if (matcherR2.matches()) { logger.debug("found file: {}", file.getAbsolutePath());
if (fileData.getMimeType().equals(MimeType.TEXT_VCF)) { possibleVCFFileList.add(new File(fileData.getPath(), fileData.getName()));
@Override public ModuleOutput call() throws ModuleException { DefaultModuleOutput moduleOutput = new DefaultModuleOutput(); int exitCode = 0; try { if (destination.exists()) { FileUtils.forceDelete(destination); } if (!destination.getParentFile().exists()) { destination.getParentFile().mkdirs(); } FileUtils.copyFile(source, destination); if (mimeType != null) { FileData fileData = new FileData(); fileData.setName(destination.getName()); fileData.setMimeType(mimeType); addFileData(fileData); } } catch (Exception e) { e.printStackTrace(); moduleOutput.setError(new StringBuilder(e.getMessage())); moduleOutput.setExitCode(exitCode); } moduleOutput.setExitCode(exitCode); return moduleOutput; }
@Override public ModuleOutput call() throws ModuleException { DefaultModuleOutput moduleOutput = new DefaultModuleOutput(); int exitCode = 0; try { List<String> argumentList = new ArrayList<String>(); argumentList.add("VALIDATION_STRINGENCY=SILENT"); argumentList.add("TMP_DIR=" + tmpDir.getAbsolutePath()); argumentList.add("OUTPUT=" + output.getAbsolutePath()); argumentList.add("INPUT=" + input.getAbsolutePath()); exitCode = new SamFormatConverter().instanceMain(argumentList.toArray(new String[argumentList.size()])); } catch (Exception e) { e.printStackTrace(); moduleOutput.setError(new StringBuilder(e.getMessage())); moduleOutput.setExitCode(-1); return moduleOutput; } moduleOutput.setExitCode(exitCode); FileData fm = new FileData(); fm.setPath(output.getParentFile().getAbsolutePath()); fm.setName(output.getName()); fm.setMimeType(MimeType.APPLICATION_BAM); addFileData(fm); return moduleOutput; }
FileData fm = new FileData(); if (output.getName().endsWith(".bam")) { fm.setMimeType(MimeType.APPLICATION_BAM); } else { fm.setMimeType(MimeType.TEXT_SAM); fm.setName(output.getName()); addFileData(fm);
@Override public ModuleOutput call() throws ModuleException { DefaultModuleOutput moduleOutput = new DefaultModuleOutput(); int exitCode = 0; try { List<String> argumentList = new ArrayList<String>(); argumentList.add("VALIDATION_STRINGENCY=SILENT"); argumentList.add("TMP_DIR=" + this.tmpDir.getAbsolutePath()); argumentList.add("REFERENCE=" + referenceSequence.getAbsolutePath()); argumentList.add("OUTPUT=" + output.getAbsolutePath()); argumentList.add("INPUT=" + input.getAbsolutePath()); exitCode = new ReorderSam().instanceMain(argumentList.toArray(new String[argumentList.size()])); } catch (Exception e) { e.printStackTrace(); moduleOutput.setError(new StringBuilder(e.getMessage())); moduleOutput.setExitCode(-1); return moduleOutput; } moduleOutput.setExitCode(exitCode); FileData fm = new FileData(); fm.setMimeType(MimeType.APPLICATION_BAM); fm.setPath(output.getParentFile().getAbsolutePath()); fm.setName(output.getName()); addFileData(fm); return moduleOutput; }
@Override public ModuleOutput call() throws ModuleException { DefaultModuleOutput moduleOutput = new DefaultModuleOutput(); int exitCode = 0; try { List<String> argumentList = new ArrayList<String>(); argumentList.add("VALIDATION_STRINGENCY=SILENT"); argumentList.add("REMOVE_DUPLICATES=true"); argumentList.add(String.format("TMP_DIR=%s/tmp", System.getenv("MAPSEQ_HOME"))); argumentList.add("OUTPUT=" + output.getAbsolutePath()); argumentList.add("INPUT=" + input.getAbsolutePath()); argumentList.add("METRICS_FILE=" + metricsFile.getAbsolutePath()); exitCode = new MarkDuplicates().instanceMain(argumentList.toArray(new String[argumentList.size()])); } catch (Exception e) { e.printStackTrace(); moduleOutput.setError(new StringBuilder(e.getMessage())); moduleOutput.setExitCode(-1); return moduleOutput; } moduleOutput.setExitCode(exitCode); FileData fm = new FileData(); fm.setName(output.getName()); fm.setMimeType(MimeType.APPLICATION_BAM); addFileData(fm); fm = new FileData(); fm.setName(metricsFile.getName()); fm.setMimeType(MimeType.PICARD_MARK_DUPLICATE_METRICS); addFileData(fm); return moduleOutput; }
@Override public ModuleOutput call() throws ModuleException { DefaultModuleOutput moduleOutput = new DefaultModuleOutput(); int exitCode = 0; try { List<String> argumentList = new ArrayList<String>(); argumentList.add("VALIDATION_STRINGENCY=SILENT"); argumentList.add("SORT_ORDER=" + sortOrder); argumentList.add("TMP_DIR=" + tmpDir.getAbsolutePath()); argumentList.add("OUTPUT=" + output.getAbsolutePath()); argumentList.add("INPUT=" + input.getAbsolutePath()); exitCode = new SortSam().instanceMain(argumentList.toArray(new String[argumentList.size()])); } catch (Exception e) { e.printStackTrace(); moduleOutput.setError(new StringBuilder(e.getMessage())); moduleOutput.setExitCode(-1); return moduleOutput; } moduleOutput.setExitCode(exitCode); FileData fm = new FileData(); fm.setPath(output.getParentFile().getAbsolutePath()); fm.setName(output.getName()); fm.setMimeType(MimeType.APPLICATION_BAM); addFileData(fm); return moduleOutput; }
@Override public ModuleOutput call() throws ModuleException { DefaultModuleOutput moduleOutput = new DefaultModuleOutput(); int exitCode = 0; try { List<String> argumentList = new ArrayList<String>(); argumentList.add("VALIDATION_STRINGENCY=SILENT"); argumentList.add(String.format("TMP_DIR=%s/tmp", System.getenv("MAPSEQ_HOME"))); argumentList.add("OUTPUT=" + output.getAbsolutePath()); argumentList.add("INPUT=" + input.getAbsolutePath()); exitCode = new SamFormatConverter().instanceMain(argumentList.toArray(new String[argumentList.size()])); } catch (Exception e) { e.printStackTrace(); moduleOutput.setError(new StringBuilder(e.getMessage())); moduleOutput.setExitCode(-1); return moduleOutput; } moduleOutput.setExitCode(exitCode); FileData fm = new FileData(); fm.setName(output.getName()); fm.setMimeType(MimeType.APPLICATION_BAM); addFileData(fm); return moduleOutput; }
FileData fm = new FileData(); fm.setPath(output.getParentFile().getAbsolutePath()); fm.setName(output.getName()); fm.setMimeType(MimeType.APPLICATION_BAM); addFileData(fm); fm = new FileData(); fm.setPath(metricsFile.getParentFile().getAbsolutePath()); fm.setName(metricsFile.getName()); fm.setMimeType(MimeType.PICARD_MARK_DUPLICATE_METRICS); addFileData(fm);
@Override public ModuleOutput call() throws ModuleException { DefaultModuleOutput moduleOutput = new DefaultModuleOutput(); int exitCode = 0; try { List<String> argumentList = new ArrayList<String>(); argumentList.add("VALIDATION_STRINGENCY=SILENT"); argumentList.add(String.format("TMP_DIR=%s/tmp", System.getenv("MAPSEQ_HOME"))); argumentList.add("REFERENCE=" + referenceSequence.getAbsolutePath()); argumentList.add("OUTPUT=" + output.getAbsolutePath()); argumentList.add("INPUT=" + input.getAbsolutePath()); exitCode = new ReorderSam().instanceMain(argumentList.toArray(new String[argumentList.size()])); } catch (Exception e) { e.printStackTrace(); moduleOutput.setError(new StringBuilder(e.getMessage())); moduleOutput.setExitCode(-1); return moduleOutput; } moduleOutput.setExitCode(exitCode); FileData fm = new FileData(); fm.setMimeType(MimeType.APPLICATION_BAM); fm.setName(output.getName()); addFileData(fm); return moduleOutput; }
@Override public ModuleOutput call() throws ModuleException { DefaultModuleOutput moduleOutput = new DefaultModuleOutput(); int exitCode = 0; try { List<String> argumentList = new ArrayList<String>(); argumentList.add("VALIDATION_STRINGENCY=SILENT"); argumentList.add("SORT_ORDER=" + this.sortOrder); argumentList.add("TMP_DIR=" + this.tmpDir.getAbsolutePath()); argumentList.add("OUTPUT=" + output.getAbsolutePath()); argumentList.add("INPUT=" + input.getAbsolutePath()); exitCode = new FixMateInformation().instanceMain(argumentList.toArray(new String[argumentList.size()])); } catch (Exception e) { e.printStackTrace(); moduleOutput.setError(new StringBuilder(e.getMessage())); moduleOutput.setExitCode(-1); return moduleOutput; } moduleOutput.setExitCode(exitCode); FileData fm = new FileData(); fm.setMimeType(MimeType.APPLICATION_BAM); fm.setPath(output.getParentFile().getAbsolutePath()); fm.setName(output.getName()); addFileData(fm); return moduleOutput; }
br.close(); FileData fm = new FileData(); fm.setMimeType(MimeType.TEXT_STAT_SUMMARY); fm.setName(outFile.getName()); addFileData(fm);
FileData fm = new FileData(); if (output.getName().endsWith(".bam")) { fm.setMimeType(MimeType.APPLICATION_BAM); } else { fm.setMimeType(MimeType.TEXT_SAM); fm.setPath(output.getParentFile().getAbsolutePath()); fm.setName(output.getName()); addFileData(fm);
FileData fm = new FileData(); fm.setMimeType(MimeType.APPLICATION_BAM); fm.setName(output.getName()); addFileData(fm);
@Override public ModuleOutput call() throws ModuleException { DefaultModuleOutput moduleOutput = new DefaultModuleOutput(); List<String> argumentList = new ArrayList<String>(); argumentList.add("VALIDATION_STRINGENCY=SILENT"); argumentList.add("SORT_ORDER=" + sortOrder); argumentList.add("TMP_DIR=" + tmpDir.getAbsolutePath()); argumentList.add("OUTPUT=" + output.getAbsolutePath()); for (File f : input) { argumentList.add("INPUT=" + f.getAbsolutePath()); } int exitCode = 0; try { exitCode = new MergeSamFiles().instanceMain(argumentList.toArray(new String[argumentList.size()])); } catch (Exception e) { e.printStackTrace(); moduleOutput.setError(new StringBuilder(e.getMessage())); moduleOutput.setExitCode(-1); return moduleOutput; } moduleOutput.setExitCode(exitCode); FileData fm = new FileData(); fm.setPath(output.getParentFile().getAbsolutePath()); fm.setName(output.getName()); fm.setMimeType(MimeType.APPLICATION_BAM); addFileData(fm); return moduleOutput; }