text: user818: We believe that if after running blast, the global identity between a resulting sequence and our query is at least 30%, we can say that two sequences are homologs. what is the difference between local identity and global identity and how can we calculate them?
  the following file is the global alignment result of one of my PSI-BLAST hits against query:
  Aligned_sequences: 2
  # 1: NP_418577.1
  # 2: WP_036312822.1
  # Matrix: EBLOSUM62
  # Gap_penalty: 10.0
  # Extend_penalty: 0.5
  #
  # Length: 264
  # Identity:      85/264 (32.2%)
  # Similarity:   125/264 (47.3%)
  # Gaps:          29/264 (11.0%)
  # Score: 376.5
  # 
  #
  #=======================================
  
  NP_418577.1        1 -----------MAEMKNLKIE-------VVRYNPEVDTAPHSAFYEVPYD     32
                                  ..|..:..|:       :.|::||||..|....|:|...
  WP_036312822.      1 MTIVDSGAPADTQEANDSGIQSYLVTFIIRRFDPEVDAEPRWVDYDVEMY     50
  
  NP_418577.1       33 ATTSLLDALGYIKDNLAPDLSYRWSCRMAICGSCGMMVNNVPKLACKTFL     82
                       .|..:||||..||.::...||:|.||...||||..|.:|...:|||||.:
  WP_036312822.     51 PTDRVLDALHRIKWDVDGTLSFRRSCAHGICGSDAMRINGRNRLACKTLI    100
  
  NP_418577.1       83 R--DYTDGMKVEALANFPIERDLVVDMTHFIESLEAIKPYIIGNSRTADQ    130
                       :  |.:..:.|||:...|:|:||:|||..|.||...::|::...|.....
  WP_036312822.    101 KDLDISKPIYVEAIKGLPLEKDLIVDMDPFFESFRDVQPFLQPKSAPEPG    150
  
  NP_418577.1      131 GTNIQTPAQMAKYHQFSGCINCGLCYAACPQFGLNPEFIGPAAITLAHRY    180
                       ....|:....|.|...:.||.|..|.::||.|..:.::.|||||..|||:
  WP_036312822.    151 KERFQSIKDRAVYDDTTKCILCAACTSSCPVFWTDGQYFGPAAIVNAHRF    200
  
  NP_418577.1      181 NEDSRDHGKKERMAQLNSQNGVWSCTFVGYCSEVCPKHVDPAAAIQQGKV    230
                       ..||||.....|:..||.:.|||.|.....|:|.||:.::...||.:.|.
  WP_036312822.    201 IFDSRDDAADVRLDILNDKEGVWRCRTTFNCTEACPRGIEITKAIAEVKQ    250
  
  NP_418577.1      231 ESSKDFLIATLKPR    244
                       ...:.         
  WP_036312822.    251 AVLRG---------    255
  
  
  #---------------------------------------
  #---------------------------------------
  the following file is the local alignment of that hit against query:
  Aligned_sequences: 2
  # 1: NP_418577.1
  # 2: WP_036312822.1
  # Matrix: EBLOSUM62
  # Gap_penalty: 10.0
  # Extend_penalty: 0.5
  #
  # Length: 219
  # Identity:      83/219 (37.9%)
  # Similarity:   119/219 (54.3%)
  # Gaps:           2/219 ( 0.9%)
  # Score: 390.5
  # 
  #
  #=======================================
  
  NP_418577.1       13 RYNPEVDTAPHSAFYEVPYDATTSLLDALGYIKDNLAPDLSYRWSCRMAI     62
                       |::||||..|....|:|....|..:||||..||.::...||:|.||...|
  WP_036312822.     31 RFDPEVDAEPRWVDYDVEMYPTDRVLDALHRIKWDVDGTLSFRRSCAHGI     80
  
  NP_418577.1       63 CGSCGMMVNNVPKLACKTFLR--DYTDGMKVEALANFPIERDLVVDMTHF    110
                       |||..|.:|...:|||||.::  |.:..:.|||:...|:|:||:|||..|
  WP_036312822.     81 CGSDAMRINGRNRLACKTLIKDLDISKPIYVEAIKGLPLEKDLIVDMDPF    130
  
  NP_418577.1      111 IESLEAIKPYIIGNSRTADQGTNIQTPAQMAKYHQFSGCINCGLCYAACP    160
                       .||...::|::...|.........|:....|.|...:.||.|..|.::||
  WP_036312822.    131 FESFRDVQPFLQPKSAPEPGKERFQSIKDRAVYDDTTKCILCAACTSSCP    180
  
  NP_418577.1      161 QFGLNPEFIGPAAITLAHRYNEDSRDHGKKERMAQLNSQNGVWSCTFVGY    210
                       .|..:.::.|||||..|||:..||||.....|:..||.:.|||.|.....
  WP_036312822.    181 VFWTDGQYFGPAAIVNAHRFIFDSRDDAADVRLDILNDKEGVWRCRTTFN    230
  
  NP_418577.1      211 CSEVCPKHVDPAAAIQQGK    229
                       |:|.||:.::...||.:.|
  WP_036312822.    231 CTEACPRGIEITKAIAEVK    249
  
  
  #---------------------------------------
  #---------------------------------------
  
  
  user931: Defining homology isn't as simple as an identity cutoff, however, you're right that homology seems likely given a certain identity. This is where e-value comes into play. See:
  https://en.wikipedia.org/wiki/Expected_value
  To answer the question, global-global requires that the alignment account for every base in the query and the target sequence. local-global requires a the full length of the query on a part of the target. local-local allows only the highest scoring part of the alignment between the query and target to be reported. i.e. one functional domain against another. these hits are often called HSPs.
  
  user929: If you want a purely alignment based approach to begin to infer homology (note I say infer, as we stated in the comments, this isn't sufficient to say 2 sequences are homologs), I would use a Multiple Sequence Alignment (MSA) instead of a pairwise like you've done so far, and include as many similar proteins as you can from BLAST.
  The choice of algorithm for the MSA probably won't matter too much, as you will be looking for conserved regions anyway.
  Once you have your MSA, you can easily spot conserved domains. If anything is known about this protein structurally, it's quite trivial to work out whether a conserved region is a functional domain (active site, that kind of thing).
  With this information, you would be somewhat justified in calling these proteins structural homologs at least if they share domains, but, to reiterate, without doing phylogenetic analyses, you cannot call them true homologs.
  
original_text: 818: <p>We believe that if after running blast, the global identity between a resulting sequence and our query is at least 30%, we can say that two sequences are homologs. what is the difference between local identity and global identity and how can we calculate them?
  the following file is the global alignment result of one of my PSI-BLAST hits against query:</p>
  
  <pre><code>Aligned_sequences: 2
  # 1: NP_418577.1
  # 2: WP_036312822.1
  # Matrix: EBLOSUM62
  # Gap_penalty: 10.0
  # Extend_penalty: 0.5
  #
  # Length: 264
  # Identity:      85/264 (32.2%)
  # Similarity:   125/264 (47.3%)
  # Gaps:          29/264 (11.0%)
  # Score: 376.5
  # 
  #
  #=======================================
  
  NP_418577.1        1 -----------MAEMKNLKIE-------VVRYNPEVDTAPHSAFYEVPYD     32
                                  ..|..:..|:       :.|::||||..|....|:|...
  WP_036312822.      1 MTIVDSGAPADTQEANDSGIQSYLVTFIIRRFDPEVDAEPRWVDYDVEMY     50
  
  NP_418577.1       33 ATTSLLDALGYIKDNLAPDLSYRWSCRMAICGSCGMMVNNVPKLACKTFL     82
                       .|..:||||..||.::...||:|.||...||||..|.:|...:|||||.:
  WP_036312822.     51 PTDRVLDALHRIKWDVDGTLSFRRSCAHGICGSDAMRINGRNRLACKTLI    100
  
  NP_418577.1       83 R--DYTDGMKVEALANFPIERDLVVDMTHFIESLEAIKPYIIGNSRTADQ    130
                       :  |.:..:.|||:...|:|:||:|||..|.||...::|::...|.....
  WP_036312822.    101 KDLDISKPIYVEAIKGLPLEKDLIVDMDPFFESFRDVQPFLQPKSAPEPG    150
  
  NP_418577.1      131 GTNIQTPAQMAKYHQFSGCINCGLCYAACPQFGLNPEFIGPAAITLAHRY    180
                       ....|:....|.|...:.||.|..|.::||.|..:.::.|||||..|||:
  WP_036312822.    151 KERFQSIKDRAVYDDTTKCILCAACTSSCPVFWTDGQYFGPAAIVNAHRF    200
  
  NP_418577.1      181 NEDSRDHGKKERMAQLNSQNGVWSCTFVGYCSEVCPKHVDPAAAIQQGKV    230
                       ..||||.....|:..||.:.|||.|.....|:|.||:.::...||.:.|.
  WP_036312822.    201 IFDSRDDAADVRLDILNDKEGVWRCRTTFNCTEACPRGIEITKAIAEVKQ    250
  
  NP_418577.1      231 ESSKDFLIATLKPR    244
                       ...:.         
  WP_036312822.    251 AVLRG---------    255
  
  
  #---------------------------------------
  #---------------------------------------
  the following file is the local alignment of that hit against query:
  Aligned_sequences: 2
  # 1: NP_418577.1
  # 2: WP_036312822.1
  # Matrix: EBLOSUM62
  # Gap_penalty: 10.0
  # Extend_penalty: 0.5
  #
  # Length: 219
  # Identity:      83/219 (37.9%)
  # Similarity:   119/219 (54.3%)
  # Gaps:           2/219 ( 0.9%)
  # Score: 390.5
  # 
  #
  #=======================================
  
  NP_418577.1       13 RYNPEVDTAPHSAFYEVPYDATTSLLDALGYIKDNLAPDLSYRWSCRMAI     62
                       |::||||..|....|:|....|..:||||..||.::...||:|.||...|
  WP_036312822.     31 RFDPEVDAEPRWVDYDVEMYPTDRVLDALHRIKWDVDGTLSFRRSCAHGI     80
  
  NP_418577.1       63 CGSCGMMVNNVPKLACKTFLR--DYTDGMKVEALANFPIERDLVVDMTHF    110
                       |||..|.:|...:|||||.::  |.:..:.|||:...|:|:||:|||..|
  WP_036312822.     81 CGSDAMRINGRNRLACKTLIKDLDISKPIYVEAIKGLPLEKDLIVDMDPF    130
  
  NP_418577.1      111 IESLEAIKPYIIGNSRTADQGTNIQTPAQMAKYHQFSGCINCGLCYAACP    160
                       .||...::|::...|.........|:....|.|...:.||.|..|.::||
  WP_036312822.    131 FESFRDVQPFLQPKSAPEPGKERFQSIKDRAVYDDTTKCILCAACTSSCP    180
  
  NP_418577.1      161 QFGLNPEFIGPAAITLAHRYNEDSRDHGKKERMAQLNSQNGVWSCTFVGY    210
                       .|..:.::.|||||..|||:..||||.....|:..||.:.|||.|.....
  WP_036312822.    181 VFWTDGQYFGPAAIVNAHRFIFDSRDDAADVRLDILNDKEGVWRCRTTFN    230
  
  NP_418577.1      211 CSEVCPKHVDPAAAIQQGK    229
                       |:|.||:.::...||.:.|
  WP_036312822.    231 CTEACPRGIEITKAIAEVK    249
  
  
  #---------------------------------------
  #---------------------------------------
  </code></pre>
   931: <p>Defining homology isn't as simple as an identity cutoff, however, you're right that homology seems likely given a certain identity. This is where e-value comes into play. See:
  <a href="https://en.wikipedia.org/wiki/Expected_value" rel="nofollow noreferrer">https://en.wikipedia.org/wiki/Expected_value</a></p>
  
  <p>To answer the question, global-global requires that the alignment account for every base in the query and the target sequence. local-global requires a the full length of the query on a part of the target. local-local allows only the highest scoring part of the alignment between the query and target to be reported. i.e. one functional domain against another. these hits are often called HSPs.</p>
   929: <p>If you want a purely alignment based approach to begin to <em>infer</em> homology (note I say <em>infer</em>, as we stated in the comments, this isn't sufficient to say 2 sequences are homologs), I would use a Multiple Sequence Alignment (MSA) instead of a pairwise like you've done so far, and include as many similar proteins as you can from BLAST.</p>
  
  <p>The choice of algorithm for the MSA probably won't matter too much, as you will be looking for conserved regions anyway.</p>
  
  <p>Once you have your MSA, you can easily spot conserved domains. If anything is known about this protein structurally, it's quite trivial to work out whether a conserved region is a functional domain (active site, that kind of thing).</p>
  
  <p>With this information, you would be somewhat justified in calling these proteins structural homologs at least if they share domains, but, to reiterate, without doing phylogenetic analyses, you <em>cannot</em> call them true homologs.</p>
  