From: Vindel: a simple pipeline for checking indel redundancy
Algorithm 2: | Indel pair redundancy check Algorithm |
Input: | Two candidate redundant indels A and B’s information |
same type T (either insertion or deletion), T A = T B,, same length L A = L B, | |
allele information S A,S B, position information P A,P B, where P A < = P B, | |
reference genome sequence S. | |
Output: | A pair indels A, B are redundant or not: Redundancy |
1 | Set Redundancy = False; |
2 | Phase 1: template substring formation |
3 | Form template substring for insertion type S I or for deletion type S D separately |
4 | S I =Substring in reference genome with P B - P A ; |
5 | S D = Substring in reference genome with P B - P A + L A ; |
6 | Phase 2: variant substring formation for insertion type |
7 | if T A = T B = Insertion then |
8 | Insert S A in front of template substring S I to form variant substring V A for indel A; |
9 | Append S B at the end of template substring S I to form variant substring V B for indel B; |
10 | if V A = V B then |
11 | Redundancy found: Redundancy = True; |
12 | else |
13 | No Redundancy |
14 | Phase 3: variant substring formation for deletion type |
15 | if T A = T B = Deletion then |
16 | Cut S A in front of template string S D , form variant substring V A for indel A; |
17 | Cut S B at the end of template string S D , form variant substring V B for indel B; |
18 | if V A = V B then |
19 | Redundancy found: Redundancy = True; |
20 | else |
21 | No Redundancy |
22 | return Redundancy |