public static int[] GetSequenceCoverage(this IAminoAcidSequence baseSequence, IEnumerable <IAminoAcidSequence> sequences, bool useLeucineSequence = true)
        {
            int[] bits = new int[baseSequence.Length];

            string masterSequence = useLeucineSequence ? baseSequence.GetLeucineSequence() : baseSequence.Sequence;

            foreach (IAminoAcidSequence sequence in sequences)
            {
                string seq = useLeucineSequence ? sequence.GetLeucineSequence() : sequence.Sequence;

                int startIndex = 0;
                while (true)
                {
                    int index = masterSequence.IndexOf(seq, startIndex, StringComparison.InvariantCulture);

                    if (index < 0)
                    {
                        break;
                    }

                    for (int aa = index; aa < index + sequence.Length; aa++)
                    {
                        bits[aa]++;
                    }

                    startIndex = index + 1;
                }
            }
            return(bits);
        }
 public static double GetSequenceCoverageFraction(this IAminoAcidSequence baseSequence, IEnumerable <IAminoAcidSequence> sequences, bool useLeucineSequence = true)
 {
     int[] counts = baseSequence.GetSequenceCoverage(sequences, useLeucineSequence);
     return(((double)counts.Count(x => x > 0)) / baseSequence.Length);
 }
Example #3
0
 public IEnumerable <int> GetDigestionSites(IAminoAcidSequence aminoacidpolymer)
 {
     return(GetDigestionSites(aminoacidpolymer.Sequence));
 }
Example #4
0
 public int MissedCleavages(IAminoAcidSequence aminoAcidSequence)
 {
     return(MissedCleavages(aminoAcidSequence.Sequence));
 }
Example #5
0
 public void AddPeptide(IAminoAcidSequence peptide)
 {
     Peptides.Add(peptide);
 }
Example #6
0
 public int MissedCleavages(IAminoAcidSequence aminoAcidSequence)
 {
     return MissedCleavages(aminoAcidSequence.Sequence);
 }
Example #7
0
 public IEnumerable<int> GetDigestionSites(IAminoAcidSequence aminoacidpolymer)
 {
     return GetDigestionSites(aminoacidpolymer.Sequence);
 }