kaptive.alignment
¶
Alignment
¶
Similar to mappy.Alignment but with additional attributes and methods.
Source code in kaptive/alignment.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | |
from_paf_line(line)
classmethod
¶
Parse a line in PAF format and return an Alignment object.
Source code in kaptive/alignment.py
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | |
cull(keep, alignments, overlap_fraction=0.1)
¶
Yield alignments that do not conflict with keep alignment
Source code in kaptive/alignment.py
91 92 93 94 95 96 97 | |
cull_filtered(pred, alignments)
¶
Cull and flatten alignments that don't overlap with alignments matching the predicate. E.g. list(cull_filtered(lambda i: i.q in query_genes, alignments))
Source code in kaptive/alignment.py
109 110 111 112 113 114 115 116 117 118 119 120 | |
group_alns(alignments, key='q')
¶
Group alignments by a key
Source code in kaptive/alignment.py
86 87 88 | |