/*.................................................................................................................*/
  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);
  }
  /*.................................................................................................................*/
  public boolean monitorAndCleanUpShell(String jobURL) {
    boolean stillGoing = true;

    if (!checkUsernamePassword(true)) {
      return false;
    }
    lastModified = null;
    if (outputFilePaths != null) {
      lastModified = new long[outputFilePaths.length];
      LongArray.deassignArray(lastModified);
    }
    String status = "";
    while (!jobCompleted(jobURL) && stillGoing) {
      if (StringUtil.blank(status))
        ownerModule.logln(
            "CIPRes Job Status: " + getJobStatus(jobURL) + "  (" + StringUtil.getDateTime() + ")");

      //	if (jobSubmitted(jobURL))
      //		processOutputFiles();
      try {
        Thread.sleep(minPollIntervalSeconds * 1000);
      } catch (InterruptedException e) {
        MesquiteMessage.notifyProgrammer("InterruptedException in CIPRes monitoring");
        return false;
      }

      stillGoing = watcher == null || watcher.continueShellProcess(null);
      String newStatus = getJobStatus(jobURL);
      if (newStatus != null && !newStatus.equalsIgnoreCase(status)) {
        ownerModule.logln(
            "CIPRes Job Status: " + newStatus + "  (" + StringUtil.getDateTime() + ")");
        status = newStatus;
      } else ownerModule.log(".");
      if (newStatus != null && newStatus.equalsIgnoreCase("SUBMITTED")) { // job is running
        processOutputFiles(jobURL);
      }
    }
    ownerModule.logln("CIPRes job completed.");
    if (outputFileProcessor != null) {
      if (rootDir != null) {
        ownerModule.logln("About to download results from CIPRes.");
        if (downloadResults(jobURL, rootDir, false))
          outputFileProcessor.processCompletedOutputFiles(outputFilePaths);
        else return false;
      }
    }

    return true;
  }