Skip to main content
. 2023 Jan 10;12(1):139. doi: 10.3390/antibiotics12010139
Algorithm 3: Pruning
   Input: k-mers derived from a specific sequence in the proteome
   Output: groups//groups of continuous k-mers within the input sequence
   BEGIN
       Sort k-mers by their initial position in the given proteome sequence
       total <- LENGTH(k-mers)//total number of k-mers
   create the empty set groups whose elements are k-group//groups contain k-group, //every fragment of the proteome covered by consecutive k-mers predicted as AMPs.
       j <- 1
       k-group.first <- k-mer[0].first //the initial position of the left most k-mer
       while j < total do
              k-group.last <- k-mer[j − 1].last//the last position of the j − 1 k-mer
              if k-mer[j] NOT Embedded(k-group)
                     if k-mer[j] Connected(k-group) OR k-mer[j] Intersects(k-group) then
                            k-last <- k-mer[j]
                     else
                            Add k-group to groups
                            k-group.first <- k-mer[j].first
                            k-group.last <- k-mer[j].last
   END