Answers.Body: <p>When I've been in 'possibly' comparable situations I've just used <code>local Blast</code> and parsed out the top hit using Python. It may not be the most optimal package (actually its not), but its easy and works, whilst NCBI's Blast support desk is efficient. Each query in turn is tested via a loop against the whole local database.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-08-18T17:32:33.317Z
Answers.Text: I'm not very familiar with blast command line tools. What blast subcommand would I use for this?
Answers.UserDisplayName: Empiromancer
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-08-18T17:41:33.133Z
Answers.Text: I'll post it next week @empiromancer if no-one else does. Its an occasional thing, can't recall it on the spot. From memory easy, its parsing code for the output that's the main issue. I can take >6 months to respond, so one week is pretty quick :-)
Answers.UserDisplayName: M__
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-08-18T15:49:42.187Z
Answers.LastActivityDate: 2022-08-18T15:49:42.187Z
Answers.UserDisplayName: M__
Answers.Body: <p>Try <a href="https://github.com/soedinglab/MMseqs2" rel="nofollow noreferrer">mmseqs2</a>. It is largely a faster version of blastp. I haven't used mmseqs2 before but its documentation seems simple enough.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-08-23T16:21:50.647Z
Answers.Text: I actually did play around with mmseqs2 but I couldn't figure out how to make it calculate percent identity. I could only figure out the clustering features.
Answers.UserDisplayName: Empiromancer
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-08-18T22:45:40.223Z
Answers.LastActivityDate: 2022-08-18T22:45:40.223Z
Answers.UserDisplayName: user172818
Body: <p>As the title states, I've got two sets of unaligned amino acid sequences (~25k sequences in one, ~3k in the other). I want to find the minimum distance between a sequence in the first set and a sequence in the second, expressed in terms of percent identity (so, maximum percent identity). So far I've only been able to find R packages that will compute percent identity for two already aligned sequences, which would then allow me to do a double loop over both sets of sequences to find the shortest distance between them. But this seems woefully inefficient - is there an easier/faster way? I also tried playing around with mmseqs2 but couldn't tell if there was a way to use it for anything other than clustering.</p>
  <p>To clarify - there is a large amount of variation between the sequences in question, including in overall length (ranging from 148 residues to 872). They don't all belong to one family of homologs or anything. I'm expecting many of them to have quite low identity with each other. But the constraints of the problem I'm working on require me to put a number on that identity, or at least an upper bound.</p>
  <p>I'm not constrained to using R, it's just what I'm most familiar with. Solutions with command line tools or python would also be fine - I'm sure there are better tools out there that I'm not aware of.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-08-18T11:11:59.967Z
Comments.Text: Wait ... are the 5' ends unequal lengths between target and query, in addition this is a 'no indel' solution sought? If so thats different and 'a few lines of code' is likely not the best solution.
Comments.UserDisplayName: M__
Tags: <phylogenetics><phylogeny>
Title: How can I find the maximum percent identity between two sets of (unaligned) sequences?
ThreadText: # How can I find the maximum percent identity between two sets of (unaligned) sequences?
  
  (Asked by: username_0 on 2022-08-17)
  
  As the title states, I've got two sets of unaligned amino acid sequences (~25k sequences in one, ~3k in the other). I want to find the minimum distance between a sequence in the first set and a sequence in the second, expressed in terms of percent identity (so, maximum percent identity). So far I've only been able to find R packages that will compute percent identity for two already aligned sequences, which would then allow me to do a double loop over both sets of sequences to find the shortest distance between them. But this seems woefully inefficient - is there an easier/faster way? I also tried playing around with mmseqs2 but couldn't tell if there was a way to use it for anything other than clustering.
  
  To clarify - there is a large amount of variation between the sequences in question, including in overall length (ranging from 148 residues to 872). They don't all belong to one family of homologs or anything. I'm expecting many of them to have quite low identity with each other. But the constraints of the problem I'm working on require me to put a number on that identity, or at least an upper bound.
  
  I'm not constrained to using R, it's just what I'm most familiar with. Solutions with command line tools or python would also be fine - I'm sure there are better tools out there that I'm not aware of.
  
  **Tags:** phylogenetics, phylogeny
  
  > **Comments:**
  > **username_1**: Wait ... are the 5' ends unequal lengths between target and query, in addition this is a 'no indel' solution sought? If so thats different and 'a few lines of code' is likely not the best solution.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2022-08-18. Score: 1
  
  When I've been in 'possibly' comparable situations I've just used `local Blast` and parsed out the top hit using Python. It may not be the most optimal package (actually its not), but its easy and works, whilst NCBI's Blast support desk is efficient. Each query in turn is tested via a loop against the whole local database.
  
  > **Comments:**
  > **username_0**: I'm not very familiar with blast command line tools. What blast subcommand would I use for this?  
  > **username_1**: I'll post it next week @username_0 if no-one else does. Its an occasional thing, can't recall it on the spot. From memory easy, its parsing code for the output that's the main issue. I can take >6 months to respond, so one week is pretty quick :-)  
  
  ---
  
  ### Answer by username_2 on 2022-08-18. Score: 1
  
  Try [mmseqs2](https://github.com/soedinglab/MMseqs2). It is largely a faster version of blastp. I haven't used mmseqs2 before but its documentation seems simple enough.
  
  > **Comments:**
  > **username_0**: I actually did play around with mmseqs2 but I couldn't figure out how to make it calculate percent identity. I could only figure out the clustering features.  
  
  ---
  
  