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); }
public IEnumerable <int> GetDigestionSites(IAminoAcidSequence aminoacidpolymer) { return(GetDigestionSites(aminoacidpolymer.Sequence)); }
public int MissedCleavages(IAminoAcidSequence aminoAcidSequence) { return(MissedCleavages(aminoAcidSequence.Sequence)); }
public void AddPeptide(IAminoAcidSequence peptide) { Peptides.Add(peptide); }
public int MissedCleavages(IAminoAcidSequence aminoAcidSequence) { return MissedCleavages(aminoAcidSequence.Sequence); }
public IEnumerable<int> GetDigestionSites(IAminoAcidSequence aminoacidpolymer) { return GetDigestionSites(aminoacidpolymer.Sequence); }