fm.setMimeType(MimeType.TEXT_SAM); fm.setPath(output.getParentFile().getAbsolutePath()); 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("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; }
@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("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("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; }
@Override public ModuleOutput call() throws ModuleException { CommandInput commandInput = new CommandInput(); StringBuilder command = new StringBuilder(); command.append(getExecutable()); command.append(" -o "); String name = input.getName(); if (name.endsWith(".bam")) { name = StringUtils.removeEnd(name, ".bam"); } command.append(input.getAbsolutePath()).append(" ").append(name).append(" > ").append(output.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); } FileData fm = new FileData(); fm.setName(output.getName()); fm.setPath(output.getParentFile().getAbsolutePath()); fm.setMimeType(MimeType.APPLICATION_BAM); addFileData(fm); return new ShellModuleOutput(commandOutput); }
@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; }
@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; }
fileData.setPath(inputFile.getParentFile().getAbsolutePath()); fileData.setName(String.format("%s.sample_summary", outputPrefix)); fileData.setMimeType(MimeType.TEXT_DEPTH_OF_COVERAGE_SUMMARY);
fm.setPath(output.getParentFile().getAbsolutePath()); fm.setMimeType(MimeType.APPLICATION_BAM); addFileData(fm);
fileData.setPath(recalFile.getParentFile().getAbsolutePath()); fileData.setName(recalFile.getName()); fileData.setMimeType(MimeType.TEXT_RECALIBRATION); fileData.setPath(tranchesFile.getParentFile().getAbsolutePath()); fileData.setName(tranchesFile.getName()); fileData.setMimeType(MimeType.TEXT_TRANCHES); fileData.setPath(rscriptFile.getParentFile().getAbsolutePath()); fileData.setName(rscriptFile.getName()); fileData.setMimeType(MimeType.APPLICATION_R);
fileData.setPath(inputFile.getParentFile().getAbsolutePath()); fileData.setName(String.format("%s.sample_summary", outputPrefix)); fileData.setMimeType(MimeType.TEXT_DEPTH_OF_COVERAGE_SUMMARY);
fileData.setPath(out.getParentFile().getAbsolutePath()); fileData.setName(out.getName()); fileData.setMimeType(MimeType.APPLICATION_BAM);
fileData.setPath(out.getParentFile().getAbsolutePath()); fileData.setName(out.getName()); fileData.setMimeType(MimeType.APPLICATION_BAM);
fileData.setMimeType(MimeType.APPLICATION_XLS); fileData.setName(peaksXLSFile.getName()); fileData.setPath(peaksXLSFile.getParentFile().getAbsolutePath()); addFileData(fileData); fileData.setMimeType(MimeType.TEXT_BED); fileData.setName(peaksBedFile.getName()); fileData.setPath(peaksBedFile.getParentFile().getAbsolutePath()); addFileData(fileData); fileData.setMimeType(MimeType.TEXT_BED); fileData.setName(encodePeaksFile.getName()); fileData.setPath(encodePeaksFile.getParentFile().getAbsolutePath()); addFileData(fileData);
@Override public ModuleOutput call() throws ModuleException { CommandInput commandInput = new CommandInput(); StringBuilder command = new StringBuilder(); command.append(String.format(getModuleClass().getAnnotation(Executable.class).value(), getWorkflowName() .toUpperCase())); CommandOutput commandOutput = null; try { if (generatePostcript != null && generatePostcript) { command.append(" -p "); } command.append(" -i ").append(input.getAbsolutePath()); command.append(" -o ").append(output.getAbsolutePath()); commandInput.setCommand(command.toString()); Executor executor = BashExecutor.getInstance(); commandOutput = executor.execute(commandInput, new File(System.getProperty("user.home"), ".mapseqrc")); FileData fm = new FileData(); if (generatePostcript != null && generatePostcript) { fm.setMimeType(MimeType.APPLICATION_POSTSCRIPT); } else { fm.setMimeType(MimeType.IMAGE_PNG); } fm.setName(output.getName()); fm.setPath(output.getParentFile().getAbsolutePath()); addFileData(fm); } catch (Exception e) { throw new ModuleException(e); } return new ShellModuleOutput(commandOutput); }
fm.setPath(output.getParentFile().getAbsolutePath()); addFileData(fm);
if (path.contains(oldSampleName)) { path = path.replace(oldSampleName, newSampleName); fileData.setPath(path); getWorkflowBeanService().getMaPSeqDAOBean().getFileDataDAO().save(fileData);