예제 #1
0
 /// <summary>
 /// Creates the basis for loading a new fastq file into the program.
 /// </summary>
 /// <param name="fileName">Name of the file</param>
 /// <param name="fileLength">Length of the file</param>
 /// <returns></returns>
 public FqFileMap CreateNewFastqFile(String fileName, long fileLength)
 {
     fqFileMap            = new FqFileMap();
     fqFileMap.FileName   = fileName;
     fqFileMap.FileLength = fileLength;
     return(fqFileMap);
 }
예제 #2
0
 /// <summary>
 /// Resets the state of a controller for loading a new file
 /// </summary>
 public void PrimeForNewFile()
 {
     fqFileMap = null;
     if (FlushMemoryOfProtobinFiles() == true)
     {
         UserResponse.InformationResponse("Protobin directory cleaned.");
     }
 }
예제 #3
0
 /// <summary>
 /// Method to be used in the event of the failure of the PerformAction method experiencing some exception.
 /// Method warns user and flushes memory of fqprotobin files before returning program to initial state.
 /// </summary>
 /// <param name="mainMessage">Main message to send to user</param>
 /// <param name="headerMessage">Header message to send to user</param>
 public void ControllerStateFailureResponse(String mainMessage, String headerMessage)
 {
     UserResponse.ErrorResponse(mainMessage, headerMessage);
     Console.WriteLine("Program Error. Exception Caught: {0}", mainMessage);
     FlushMemoryOfProtobinFiles();
     fqFileMap        = null;
     CONTROLLER_STATE = FastqControllerState.STATE_READY;
 }
예제 #4
0
        /// <summary>
        /// Key method in the display class, makes a decision on what to output based on the previous active task from the generic
        /// inputs transport class.  Also accepts instance of the richtextbox which will display the output.
        /// </summary>
        /// <param name="input">Instance of the transport class.  Used in this instance to inform the display class of previous activity</param>
        /// <param name="textBox">The rich text box that will display the outputs</param>
        public void Update(GenericFastqInputs input, RichTextBox textBox)
        {
            this.fqMap   = FastqController.getInstance().GetFqFileMap();
            this.textBox = textBox;

            if (input.TaskAction == Task_FindSequences.statement)
            {
                AddFoundSequenceData();
            }
            else
            {
                ClearText();
                DisplayFileDetails();
                DisplayFastqFileDetails();
                DisplayComponentDetais();
            }
        }
예제 #5
0
        /// <summary>
        /// Changes the chart type via this combo box
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Charts_Combo_Selector_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (FastqController.CONTROLLER_STATE == FastqController.FastqControllerState.STATE_READY)
            {
                FqFileMap map = FastqController.getInstance().GetFqFileMap();

                if (map != null)
                {
                    SetGraphicTrackBarDataSourceSize();
                    List <String> componentDetails = map.getFileComponentDirectories();
                    Dictionary <string, FqFile_Component_Details> componentMap = map.GetFqFileComponentDetailsMap();
                    if (componentDetails != null && componentMap != null)
                    {
                        int index = graphicsTrackBar.Value;
                        FqFile_Component_Details details;
                        String chartType = Charts_Combo_Selector.SelectedValue.ToString();

                        if (chartType.Equals(FastqGUI_Charts.FastqChartTypes.PerBaseSequenceStatistics.ToString()))
                        {
                            details = componentMap[componentDetails[index]];
                            drawChart(details, chartType);
                        }
                        else
                        {
                            if (index == 0)
                            {
                                details = FastqController.getInstance().GetFqFileMap().GlobalDetails;
                                drawChart(details, chartType);
                            }
                            else if (index > 0)
                            {
                                details = componentMap[componentDetails[index - 1]];
                                drawChart(details, chartType);
                            }
                        }
                    }
                }
            }
        }
예제 #6
0
 private void inputBox_SequenceLengthThresholdValidating(object sender, InputBoxValidatingArgs e)
 {
     if (e.Text.Trim().Length == 0)
     {
         e.Cancel  = true;
         e.Message = "Required";
     }
     else if (HelperMethods.safeParseInt(e.Text.Trim()) == false)
     {
         e.Cancel  = true;
         e.Message = "Required";
     }
     else
     {
         int       i   = Int32.Parse(e.Text.Trim());
         FqFileMap map = FastqController.getInstance().GetFqFileMap();
         if (i < map.GlobalDetails.MinSeqSize || i >= map.GlobalDetails.MaxSeqSize)
         {
             e.Cancel  = true;
             e.Message = "Required";
         }
     }
 }
        /// <summary>
        /// Key method in the display class, makes a decision on what to output based on the previous active task from the generic
        /// inputs transport class.  Also accepts instance of the richtextbox which will display the output.
        /// </summary>
        /// <param name="input">Instance of the transport class.  Used in this instance to inform the display class of previous activity</param>
        /// <param name="textBox">The rich text box that will display the outputs</param>
        public void Update(GenericFastqInputs input, RichTextBox textBox)
        {
            this.fqMap = FastqController.getInstance().GetFqFileMap();
            this.textBox = textBox;

            if (input.TaskAction == Task_FindSequences.statement)
                AddFoundSequenceData();
            else
            {
                ClearText();
                DisplayFileDetails();
                DisplayFastqFileDetails();
                DisplayComponentDetais();
            }
        }
 /// <summary>
 /// Resets the state of a controller for loading a new file
 /// </summary>
 public void PrimeForNewFile()
 {
     fqFileMap = null;
     if (FlushMemoryOfProtobinFiles() == true)
         UserResponse.InformationResponse("Protobin directory cleaned.");
 }
 /// <summary>
 /// Creates the basis for loading a new fastq file into the program.
 /// </summary>
 /// <param name="fileName">Name of the file</param>
 /// <param name="fileLength">Length of the file</param>
 /// <returns></returns>
 public FqFileMap CreateNewFastqFile(String fileName, long fileLength)
 {
     fqFileMap = new FqFileMap();
     fqFileMap.FileName = fileName;
     fqFileMap.FileLength = fileLength;
     return fqFileMap;
 }
 /// <summary>
 /// Method to be used in the event of the failure of the PerformAction method experiencing some exception.
 /// Method warns user and flushes memory of fqprotobin files before returning program to initial state.
 /// </summary>
 /// <param name="mainMessage">Main message to send to user</param>
 /// <param name="headerMessage">Header message to send to user</param>
 public void ControllerStateFailureResponse(String mainMessage, String headerMessage)
 {
     UserResponse.ErrorResponse(mainMessage, headerMessage);
     Console.WriteLine("Program Error. Exception Caught: {0}", mainMessage);
     FlushMemoryOfProtobinFiles();
     fqFileMap = null;
     CONTROLLER_STATE = FastqControllerState.STATE_READY;
 }