Пример #1
0
 /// <summary>
 /// Validation method for input box for sequence data
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void inputBox_SequenceValidating(object sender, InputBoxValidatingArgs e)
 {
     if (e.Text.Trim().Length == 0)
     {
         e.Cancel  = true;
         e.Message = "Required";
     }
     else if (Nucleotide.isDNA(e.Text.Trim()) == false)
     {
         e.Cancel  = true;
         e.Message = "Required";
     }
 }
        /// <summary>
        /// Creates an array of nucleotides from the whole sequence
        /// </summary>
        /// <returns>An array of Nucleotide objects</returns>
        public override Nucleotide createNucleotideArray()
        {
            Nucleotide nucleotide = new Nucleotide(header);

            for (int i = 0; i < index; i++)
            {
                for (int j = 0; i < fastqSeq[i].getFastqSeqSize(); j++)
                {
                    nucleotide.addCharNucleotideArray(Fq_FILE_MAP[fastqSeq[i].getFastqSeqAtPosition(j)].getNucleotide());
                }
            }
            Console.Write("An array of nucleotides has been created");
            return(nucleotide);
        }
Пример #3
0
        public Boolean CheckStandardFormat()
        {
            header = new String[FQ_BLOCKS_TO_CHECK];
            seq    = new String[FQ_BLOCKS_TO_CHECK];
            info   = new String[FQ_BLOCKS_TO_CHECK];
            qscore = new String[FQ_BLOCKS_TO_CHECK];

            BufferedStream bs     = new BufferedStream(fileReader);
            StreamReader   reader = new StreamReader(bs);

            // Build sets of fastq blocks to check
            for (int i = 0; i < FQ_BLOCKS_TO_CHECK; i++)
            {
                header[i] = reader.ReadLine();
                seq[i]    = reader.ReadLine();
                info[i]   = reader.ReadLine();
                qscore[i] = reader.ReadLine();
            }

            // Check sets
            for (int i = 0; i < FQ_BLOCKS_TO_CHECK; i++)
            {
                if ((char)header[i][0] != IFqFile.INITIAL_HEADER_CHARACTER)
                {
                    return(false);
                }
                if ((char)info[i][0] != IFqFile.INITIAL_INFO_LINE_CHARACTER)
                {
                    return(false);
                }
                if (Nucleotide.isDNA(seq[i]) != true)
                {
                    return(false);
                }
                if (seq[i].Length != qscore[i].Length)
                {
                    return(false);
                }
            }

            fileReader.Seek(0, SeekOrigin.Begin);
            Console.WriteLine("FileReader Position: {0}", fileReader.Position);
            Console.WriteLine("File is found to be a fastqFile");
            return(true);
        }
 /// <summary>
 /// Creates an array of nucleotides from the whole sequence
 /// </summary>
 /// <returns>An array of Nucleotide objects</returns>
 public override Nucleotide createNucleotideArray()
 {
     Nucleotide nucleotide = new Nucleotide(header);
     for (int i = 0; i < index; i++)
     {
         for (int j = 0; i < fastqSeq[i].getFastqSeqSize(); j++)
         {
             nucleotide.addCharNucleotideArray(Fq_FILE_MAP[fastqSeq[i].getFastqSeqAtPosition(j)].getNucleotide());
         }
     }
     Console.Write("An array of nucleotides has been created");
     return nucleotide;
 }