<p>Not sure what is the shortest peptide one can fish out with <code>LAST</code> out of small protein database (well, it starts with protein FASTA file), but you may check out <a href="https://gitlab.com/mcfrith/last/-/blob/main/doc/last-cookbook.rst?ref_type=heads" rel="nofollow noreferrer">LAST cookbook</a>. This can use different PAM matrices so you have the proper similar amino acid matching. If that does not suit your needs there can be some more desperate route using string fuzzy matching i.e. with <a href="https://pypi.org/project/thefuzz/" rel="nofollow noreferrer">thefuzz python library</a> and checking the best Levenshtein distance scores.</p>

CC BY-SA 4.0
2024-02-23T13:23:14.907Z
2024-02-23T13:23:14.907Z
darked89
<p>I would suggest focusing on short k-mers if you are using very small sequences. Simply quantify the similarity of the k-mer profile of each relevant pair of peptides. There are many tools for analyzing k-mer profiles, though many are targeted towards DNA so you should keep an eye out for that. <a href="https://buildmedia.readthedocs.org/media/pdf/kmer/rtd/kmer.pdf" rel="nofollow noreferrer">Here is one python tool</a>.</p>
<p>It is also <a href="http://claresloggett.github.io/python_workshops/kmer_counting.html" rel="nofollow noreferrer">not difficult to write a k-mer counting script</a> if you decide that third party tools are not suitable.</p>
<p>Granted, you will need to evaluate that k-mer profile similarity has some relevance to your intuitive notion of &quot;similarity&quot;, which it may not. It would clarify somewhat to know more about your desired application.</p>

CC BY-SA 4.0
2024-02-23T16:08:58.413Z
2024-02-23T16:08:58.413Z
Maximilian Press
<p>After more search, I go for <code>blastp-short</code> with MHC peptides as query and my full-length proteins as database. Please share if you think it has problems.</p>

CC BY-SA 4.0
2024-02-27T07:06:29.040Z
2024-02-27T07:06:29.040Z
Johnny Tam
<p>What tools can we use to compare two sets of peptide sequences?</p>
<ul>
<li>The biological question is I have some kmer sequences of some proteins and would like to know how similar are these kmer sequences compared with known MHC classs I and II peptides.</li>
<li>Therefore I need to compare two sets of peptides sequences.</li>
<li>The kmer and peptide sequences lengths range from 5-80aa.</li>
</ul>
<p>Alternatively, I am also considering to use the full length of the proteins for comparison.</p>

CC BY-SA 4.0
2024-02-23T11:35:51.830Z
What kind of comparison? All against all? Pairs? Triplets? Are you expecting them all to be similar? Are you trying to group them into sets based on similarity? Blastp doesn't seem relevant at all here (and 11 is the default word size of blastn not blastp, but that's neither here nor there). Please [edit] your question and tell us what you are trying to do, what is the biological question you are trying to answer. We need to understand that in order to suggest approaches.
terdon
CC BY-SA 4.0
2024-02-24T02:29:30.740Z
Hi @terdon, thanks for the suggestion and now edited the question.
Johnny Tam
CC BY-SA 4.0
2024-02-26T16:59:42.650Z
Just a reminder to consider marking one of the questions as "answered". This is definitely helpful for all concerned.
M__
<blastp>
Comparing sequence similarity of two sets of peptide sequences?
# Comparing sequence similarity of two sets of peptide sequences?

(Asked by: username_0 on 2024-02-23)

What tools can we use to compare two sets of peptide sequences?

* The biological question is I have some kmer sequences of some proteins and would like to know how similar are these kmer sequences compared with known MHC classs I and II peptides.
* Therefore I need to compare two sets of peptides sequences.
* The kmer and peptide sequences lengths range from 5-80aa.

Alternatively, I am also considering to use the full length of the proteins for comparison.

**Tags:** blastp
> **Comments:**
> **username_1**: What kind of comparison? All against all? Pairs? Triplets? Are you expecting them all to be similar? Are you trying to group them into sets based on similarity? Blastp doesn't seem relevant at all here (and 11 is the default word size of blastn not blastp, but that's neither here nor there). Please [edit] your question and tell us what you are trying to do, what is the biological question you are trying to answer. We need to understand that in order to suggest approaches.  
> **username_0**: Hi @terdon, thanks for the suggestion and now edited the question.  
> **username_2**: Just a reminder to consider marking one of the questions as "answered". This is definitely helpful for all concerned.  

---

## 3 answers

### Answer by username_3 on 2024-02-23. Score: 3

Not sure what is the shortest peptide one can fish out with `LAST` out of small protein database (well, it starts with protein FASTA file), but you may check out [LAST cookbook](https://gitlab.com/mcfrith/last/-/blob/main/doc/last-cookbook.rst?ref_type=heads). This can use different PAM matrices so you have the proper similar amino acid matching. If that does not suit your needs there can be some more desperate route using string fuzzy matching i.e. with [thefuzz python library](https://pypi.org/project/thefuzz/) and checking the best Levenshtein distance scores.


---

### Answer by username_4 on 2024-02-23. Score: 2

I would suggest focusing on short k-mers if you are using very small sequences. Simply quantify the similarity of the k-mer profile of each relevant pair of peptides. There are many tools for analyzing k-mer profiles, though many are targeted towards DNA so you should keep an eye out for that. [Here is one python tool](https://buildmedia.readthedocs.org/media/pdf/kmer/rtd/kmer.pdf).

It is also [not difficult to write a k-mer counting script](http://claresloggett.github.io/python_workshops/kmer_counting.html) if you decide that third party tools are not suitable.

Granted, you will need to evaluate that k-mer profile similarity has some relevance to your intuitive notion of "similarity", which it may not. It would clarify somewhat to know more about your desired application.


---

### Answer by username_0 on 2024-02-27. Score: 1

After more search, I go for `blastp-short` with MHC peptides as query and my full-length proteins as database. Please share if you think it has problems.


---

