/*.................................................................................................................*/ public void processAceFileWithContig( CharacterData data, MesquiteModule ownerModule, String processedAceFilePath, String fragmentDirPath, AceFile ace, SequenceUploader uploader, String geneName, MesquiteString fullName, String baseName, MesquiteString voucherCode, int it) { DNAData editedData = ChromaseqUtil.getEditedData(data); DNAData originalData = ChromaseqUtil.getOriginalData(data); Taxa taxa = data.getTaxa(); ace.setNameTranslation(fileNameTranslation); ownerModule.log(ace.contigListForLog() + StringUtil.lineEnding()); if (processPolymorphisms) ace.processPolys(); // creates an additional CO that has polys in it if (renameContigsInAceFiles) ace.renameContigs(fullName.toString(), addFragName, geneName); ace.setLowQualityToLowerCase(qualThresholdForLowerCase); ace.writeToPropertiesFile(contigPropertiesFileBuffer, fullName.toString()); if (truncateMixedEnds) ace.trimMixedEnds(mixedEndThreshold, mixedEndWindow, qualThresholdForTrim, addPhrapFailures); /* if (uploadResultsToDatabase && StringUtil.notEmpty(databaseURL)) { uploader.uploadAceFileToServer(MesquiteXMLToLUtilities.getTOLPageDatabaseURL(databaseURL), ace, processPolymorphisms, qualThresholdForTrim); } */ System.out.println("\n\nfasta file name: " + baseName + " ace file: " + ace); MesquiteFile.putFileContents( fragmentDirPath + MesquiteFile.fileSeparator + ChromaseqUtil.processedFastaFolder + MesquiteFile.fileSeparator + baseName + ".fas", ace.toFASTAString(processPolymorphisms, qualThresholdForTrim), true); MesquiteFile.putFileContents(processedAceFilePath, ace.toString(processPolymorphisms), true); ace.importSequence( taxa, editedData, it, originalData, ChromaseqUtil.getQualityData(data), ChromaseqUtil.getRegistryData(data), singleTaxaBlock, processPolymorphisms, maxChar, " contig ", false, voucherCode); }
/*.................................................................................................................*/ String getComDelim() { if (externalProcRunner.isWindows()) return ";" + StringUtil.lineEnding(); else return ";" + StringUtil.lineEnding(); }
/*.................................................................................................................*/ void formCommandFile(String dataFileName, int firstOutgroup) { if (parallel) { commands = ""; } commands += getTNTCommand("mxram " + mxram); commands += getTNTCommand("report+0/1/0"); commands += getTNTCommand("log " + logFileName); commands += getTNTCommand("p " + dataFileName); commands += getTNTCommand("vversion"); if (MesquiteInteger.isCombinable(firstOutgroup) && firstOutgroup >= 0) commands += getTNTCommand("outgroup " + firstOutgroup); if (bootstrapOrJackknife()) { if (parallel) { commands += indentTNTCommand("ptnt begin parallelRun " + numSlaves + "/ram x 2 = "); } if (StringUtil.notEmpty(bootSearchScriptPath)) { String script = MesquiteFile.getFileContentsAsString(bootSearchScriptPath); if (StringUtil.notEmpty(script)) commands += script; } else commands += StringUtil.lineEnding() + bootstrapSearchArguments + StringUtil.lineEnding(); String saveTreesString = ""; if (resamplingAllConsensusTrees) saveTreesString = " savetrees "; String bootSearchString = " [xmult; bb]"; bootSearchString = ""; if (parallel) { int numRepsPerSlave = bootstrapreps / numSlaves; if (numRepsPerSlave * numSlaves < bootstrapreps) numRepsPerSlave++; if (searchStyle == BOOTSTRAPSEARCH) commands += getTNTCommand( "resample boot cut 50 " + saveTreesString + " replications " + numRepsPerSlave + " [xmult; bb] savetrees"); // + getComDelim(); else if (searchStyle == JACKKNIFESEARCH) commands += getTNTCommand( "resample jak cut 50 " + saveTreesString + " replications " + numRepsPerSlave + " [xmult; bb] savetrees"); // + getComDelim(); else if (searchStyle == SYMSEARCH) commands += getTNTCommand( "resample sym cut 50 " + saveTreesString + " replications " + numRepsPerSlave + " [xmult; bb] savetrees"); // + getComDelim(); else if (searchStyle == POISSONSEARCH) commands += getTNTCommand( "resample poisson cut 50 " + saveTreesString + " replications " + numRepsPerSlave + " [xmult; bb] savetrees"); // + getComDelim(); commands += getTNTCommand("return"); commands += getTNTCommand("ptnt wait parallelRun"); commands += getTNTCommand("ptnt get parallelRun"); } else { if (!resamplingAllConsensusTrees) { commands += getTNTCommand("macro="); commands += getTNTCommand("ttags ="); } commands += getTNTCommand("tsave *" + treeFileName); if (bootstrapAllowed) { if (searchStyle == BOOTSTRAPSEARCH) commands += getTNTCommand( "resample boot " + saveTreesString + " replications " + bootstrapreps + bootSearchString); // + getComDelim(); else if (searchStyle == JACKKNIFESEARCH) commands += getTNTCommand( "resample jak cut 50 " + saveTreesString + " replications " + bootstrapreps + bootSearchString); // + getComDelim(); else if (searchStyle == SYMSEARCH) commands += getTNTCommand( "resample sym cut 50 " + saveTreesString + " replications " + bootstrapreps + bootSearchString); // + getComDelim(); else if (searchStyle == POISSONSEARCH) commands += getTNTCommand( "resample poisson cut 50 " + saveTreesString + " replications " + bootstrapreps + bootSearchString); // + getComDelim(); } if (!resamplingAllConsensusTrees) commands += getTNTCommand("save *"); else commands += getTNTCommand("save"); commands += getTNTCommand("tsave/"); if (!resamplingAllConsensusTrees) { commands += getTNTCommand("ttags -/"); commands += getTNTCommand("macro-"); } } // commands += getTNTCommand("proc/") ; commands += getTNTCommand("log/"); // if (!parallel) commands += getTNTCommand("quit"); } else { // commands += getTNTCommand("tsave !5 " + treeFileName) ; // if showing intermediate trees commands += getTNTCommand("tsave *" + treeFileName); if (StringUtil.notEmpty(searchScriptPath)) { String script = MesquiteFile.getFileContentsAsString(searchScriptPath); if (StringUtil.notEmpty(script)) commands += script; } else commands += searchArguments; commands += otherOptions; if (harvestOnlyStrictConsensus) commands += getTNTCommand("nelsen *"); commands += getTNTCommand("save"); commands += getTNTCommand("log/"); commands += getTNTCommand("tsave/"); commands += getTNTCommand("quit"); } }