In "Number of peptides with a given total mass1" we first encountered the problem of reconstructing a cyclic peptide from its theoretical spectrum. This problem is called the cyclopeptide sequencing problem: given an ideal experimental spectrum, find a cyclic peptide whose theoretical spectrum matches the experimental spectrum. It is solved by the following algorithm.
CyclopeptideSequencing(Spectrum) Peptides ← a set containing only the empty peptide while Peptides is nonempty Peptides ← Expand(Peptides) for each peptide Peptide in Peptides if Mass(Peptide) = ParentMass(Spectrum) if Cyclospectrum(Peptide) = Spectrum output Peptide remove Peptide from Peptides else if Peptide is not consistent with Spectrum remove Peptide from Peptides
Write a function cyclopeptide_sequencing that takes an ideal experimental spectrum $$s$$. The function must return a set containing all amino acid strings $$p$$ such that
Cyclospectrum($$p$$) = $$s$$
>>> cyclopeptide_sequencing((0, 113, 128, 186, 241, 299, 314, 427)) {(113, 128, 186), (113, 186, 128)} >>> cyclopeptide_sequencing((0, 113, 114, 128, 129, 227, 242, 242, 257, 355, 356, 370, 371, 484)) {(113, 129, 128, 114), (113, 114, 128, 129)}
Remind that the tuple representation of cyclic peptide is cyclic as well, and we choose the representation that comes first in lexicographic order.
Acharya J, Das H, Milenkovic O, Orlitsky A, Pan S (2015). String reconstruction from substring compositions. SIAM Journal on Discrete Mathematics 29(3), 1340–1371. 2
Ng J, Bandeira N, Liu WT, Ghassemian M, Simmons TL, Gerwick WH, Linington R, Dorrestein PC, Pevzner PA (2009). Dereplication and de novo sequencing of nonribosomal peptides. Nature methods 6(8), 596–599. 3