Esempio n. 1
0
        public static Peptide PeptideFromString(string peptideString, PeptideBuilderOptions options = null)
        {
            var sequence = Regex.Replace(peptideString.ToUpperInvariant(), "[^A-Z]", "")
                           .Select(aminoAcidCode => aminoAcidCode.ToAminoAcidName());

            return(PeptideFromSequence(sequence, options));
        }
Esempio n. 2
0
 public static Peptide PeptideFromSequence(AminoAcidSequence aminoAcidNameSequence, PeptideBuilderOptions options = null)
 {
     if (options == null)
     {
         options = new PeptideBuilderOptions();
     }
     if (options.BuildMolecule)
     {
         var aminoAcidReferences = aminoAcidNameSequence
                                   .Select(sequenceItem => AminoAcidLibrary.Get(sequenceItem.AminoAcidName, sequenceItem.ResidueNumber));
         return(PeptideFromAminoAcids(aminoAcidReferences));
     }
     else
     {
         var aminoAcidReferences = aminoAcidNameSequence
                                   .Select((aa, idx) => new AminoAcidReference(aa.AminoAcidName, aa.ResidueNumber, null, new List <uint>(), 0, 0))
                                   .ToList();
         return(new Peptide(new MoleculeReference(new Molecule()), aminoAcidReferences));
     }
 }
Esempio n. 3
0
 public static Peptide PeptideFromSequence(
     IEnumerable <AminoAcidName> aminoAcidNameSequence,
     PeptideBuilderOptions options = null)
 {
     if (options == null)
     {
         options = new PeptideBuilderOptions();
     }
     if (options.BuildMolecule)
     {
         var aminoAcidReferences = aminoAcidNameSequence
                                   .Select((aminoAcidName, idx) => AminoAcidLibrary.Get(aminoAcidName, options.FirstSequenceNumber + idx));
         return(PeptideFromAminoAcids(aminoAcidReferences));
     }
     else
     {
         var aminoAcidReferences = aminoAcidNameSequence
                                   .Select((aa, idx) => new AminoAcidReference(aa, options.FirstSequenceNumber + idx, null, new List <uint>(), 0, 0))
                                   .ToList();
         return(new Peptide(new MoleculeReference(new Molecule()), aminoAcidReferences));
     }
 }