public static bool IsAssemblyFinished(this GenomeModel genomeModel) { int assemblersFinished = 0; if (genomeModel.UseMasurca) { if (genomeModel.MasurcaCurrentStep.Equals(StepDescriptions.GetMasurcaStepList().Last().step)) { assemblersFinished++; } } if (genomeModel.UseSGA) { } if (genomeModel.UseWGS) { } if (assemblersFinished.Equals(genomeModel.NumberOfAssemblers)) { return(true); } else { return(false); } }
/// <summary> /// Updates the status of the masurca assembler. If it has either errored out (-1) or is completed (last step), it will not change the status. /// </summary> /// <param name="client">The current SSH client session.</param> /// <param name="genomeModel">The model of the particular job.</param> private static void CheckMasurcaStep(SshClient client, GenomeModel genomeModel) { if (string.IsNullOrEmpty(ErrorHandling.error) && !genomeModel.MasurcaCurrentStep.Equals(-1) && !genomeModel.MasurcaCurrentStep.Equals(StepDescriptions.GetMasurcaStepList().Last().step)) { if (LinuxCommands.DirectoryHasFiles(client, Accessors.GetMasurcaOutputPath(genomeModel.Seed))) { int currentMasurcaStep = LinuxCommands.GetCurrentStep(client, Accessors.GetMasurcaOutputPath(genomeModel.Seed), StepDescriptions.GetMasurcaStepList()); // Provided we didn't encounter an error, set the status of masurca and the job. if (currentMasurcaStep != -1) { genomeModel.MasurcaCurrentStep = currentMasurcaStep; genomeModel.MasurcaStatus = StepDescriptions.GetCurrentStepDescription(StepDescriptions.GetMasurcaStepList(), currentMasurcaStep); } else { StepDescriptions.SetMasurcaError(client, genomeModel); } } // Either masurca hasn't started or it has but no files have been created yet. else { genomeModel.MasurcaCurrentStep = 1; genomeModel.MasurcaStatus = StepDescriptions.GetCurrentStepDescription(StepDescriptions.GetMasurcaStepList(), 1); } } }
/// <summary> /// Sets default values if the user decided not to enter any information for optional values in the wizard. /// </summary> /// <param name="genomeModel">The model data for a particular job.</param> /// <returns>Returns the new job model with the default values.</returns> public static GenomeModel SetDefaultMasurcaValues(GenomeModel genomeModel) { // If they don't have jump reads. if (genomeModel.JumpReads == false) { genomeModel.JumpLength = 0; } // If they don't have paired-end reads. if (genomeModel.PEReads == false) { genomeModel.PairedEndLength = 0; } if (genomeModel.MasurcaMean == null) { genomeModel.MasurcaMean = 180; } if (genomeModel.MasurcaStdev == null) { genomeModel.MasurcaStdev = 20; } // We don't specify anything here. If it is null, we set it to AUTO in the masurca method of the config builder. if (genomeModel.MasurcaGraphKMerValue == null) { if (genomeModel.MasurcaKMerErrorCount == null) { genomeModel.MasurcaKMerErrorCount = 1; } } if (genomeModel.MasurcaThreadNum == null) { genomeModel.MasurcaThreadNum = 20; } genomeModel.MasurcaCurrentStep = 1; genomeModel.MasurcaStatus = StepDescriptions.GetCurrentStepDescription(StepDescriptions.GetMasurcaStepList(), 1); return(genomeModel); }