Exemple #1
0
        public FqSequence_IO Tests(Dictionary <int, FqNucleotideRead> map, FqSequence_IO inputs)
        {
            int        qualitySum = 0;
            List <int> qualities  = new List <int>();

            resetCounts();

            for (int i = 0; i < index; i++)
            {
                char nucleotide = map[fastqSequence[i]].getNucleotide();

                if (nucleotide == 'N')
                {
                    NCount++;
                }
                else if (nucleotide == 'C')
                {
                    CCount++;
                }
                else if (nucleotide == 'G')
                {
                    GCount++;
                }

                int qualityScore = map[fastqSequence[i]].getQualityScore();
                qualitySum += qualityScore;
                qualities.Add(qualityScore);

                int currentPop = inputs.distributes[(qualityScore + inputs.subZeroOffset)];
                inputs.distributes[(qualityScore + inputs.subZeroOffset)] = (currentPop + 1);
            }
            inputs.cCount = CCount;
            inputs.gCount = GCount;
            inputs.nCount = NCount;

            for (int i = 0; i < qualities.Count; i++)
            {
                inputs.perSeqQuals[i] = qualities[i];
            }

            inputs.sequenceLength = index;

            qualities.Sort();
            int size = qualities.Count;

            Mean           = (double)qualitySum / SEQUENCE_LENGTH;
            Median         = (int)qualities[(size / 2)];
            ThirdQuartile  = (int)qualities[((size / 4) * 3)];
            FirstQuartile  = (int)qualities[((size / 4))];
            LowerThreshold = (int)qualities[0];
            UpperThreshold = (int)qualities[size - 1];

            return(inputs);
        }
        public FqSequence_IO Tests(Dictionary<int, FqNucleotideRead> map, FqSequence_IO inputs)
        {
            int qualitySum = 0;
            List<int> qualities = new List<int>();

            resetCounts();

            for (int i = 0; i < index; i++)
            {
                char nucleotide = map[fastqSequence[i]].getNucleotide();

                if (nucleotide == 'N') NCount++;
                else if (nucleotide == 'C') CCount++;
                else if (nucleotide == 'G') GCount++;

                int qualityScore = map[fastqSequence[i]].getQualityScore();
                qualitySum += qualityScore;
                qualities.Add(qualityScore);

                int currentPop = inputs.distributes[(qualityScore + inputs.subZeroOffset)];
                inputs.distributes[(qualityScore + inputs.subZeroOffset)] = (currentPop + 1);

            }
            inputs.cCount = CCount;
            inputs.gCount = GCount;
            inputs.nCount = NCount;

            for (int i = 0; i < qualities.Count; i++)
                inputs.perSeqQuals[i] = qualities[i];

            inputs.sequenceLength = index;

            qualities.Sort();
            int size = qualities.Count;
            Mean = (double)qualitySum / SEQUENCE_LENGTH;
            Median = (int)qualities[(size / 2)];
            ThirdQuartile = (int)qualities[((size / 4) * 3)];
            FirstQuartile = (int)qualities[((size / 4))];
            LowerThreshold = (int)qualities[0];
            UpperThreshold = (int)qualities[size - 1];

            return inputs;
        }