Exemplo n.º 1
0
        /// <summary>
        /// Finds the sequence in the list of IKmer and returns the list of position
        /// of the Kmers.
        /// </summary>
        /// <param name="sequence">Sequence which has to be matched in the list of IKmer.</param>
        /// <param name="kmerList">List of IKmer.</param>
        /// <returns>Returns the list of position of IKmer.</returns>
        private static IList <int> FindCorrespondingMatch(ISequence sequence, KmersOfSequence kmerList)
        {
            IList <int> positions      = null;
            string      sequenceString = sequence.ToString();

            foreach (KmersOfSequence.KmerPositions kmer in kmerList.Kmers)
            {
                if (sequenceString.Equals(kmerList.KmerToSequence(kmer).ToString()))
                {
                    positions = kmer.Positions;
                    break;
                }
            }

            return(positions);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Finds the sequence in the list of IKmer and returns the list of position
        /// of the Kmers.
        /// </summary>
        /// <param name="sequence">Sequence which has to be matched in the list of IKmer.</param>
        /// <param name="kmerList">List of IKmer.</param>
        /// <returns>Returns the list of position of IKmer.</returns>
        private static IList <long> FindCorrespondingMatch(string sequence, KmersOfSequence kmerList)
        {
            IList <long> positions = null;

            foreach (KmersOfSequence.KmerPositions kmer in kmerList.Kmers)
            {
                string kmerString = new string(kmerList.KmerToSequence(kmer).Select(a => (char)a).ToArray());

                if (sequence.Equals(kmerString))
                {
                    positions = kmer.Positions;
                    break;
                }
            }

            return(positions);
        }