...
 
Commits (2)
......@@ -28,11 +28,13 @@ optional arguments:
Remove all containment (default: False)
-i, --remove-all-internal
Remove all internal match (default: False)
-o INTERNAL_MATCH_THRESHOLD, --internal-match-threshold INTERNAL_MATCH_THRESHOLD
Set the default value of internal match (default: 0.8)
```
## Definition
This definition are inspired by [Miniasm](https://academic.oup.com/bioinformatics/article/32/14/2103/1742895/Minimap-and-miniasm-fast-mapping-and-de-novo)
This definition are inspired by [Miniasm section 2.4.2](https://academic.oup.com/bioinformatics/article/32/14/2103/1742895#95425019)
### Containment
......@@ -58,7 +60,7 @@ B: ------ ------------------->
Overhang is the sum of minus length for each read around match zone.
If ratio overhang by mapping length is upper than 0.8 (hard coded actualy) this overlap are an internal match.
If ratio overhang by mapping length is upper than 0.8 (default value) this overlap are an internal match.
## Usage as python module
......
......@@ -18,11 +18,15 @@ def main(args=None):
help="Remove all containment")
parser.add_argument("-i", "--remove-all-internal", action='store_true',
help="Remove all internal match")
parser.add_argument("-o", "--internal-match-threshold", type=float,
help="Set the default value of internal match",
default=0.8)
arg = vars(parser.parse_args(args))
parser = Parser(not arg["remove_all_containment"],
not arg["remove_all_internal"])
not arg["remove_all_internal"],
arg["internal_match_threshold"])
for line in arg["paf"]:
result = parser.parse_line(line)
......
......@@ -26,7 +26,8 @@ class ParsingWarning(Enum):
class Parser:
def __init__(self, containment=True, internal=True):
def __init__(self, containment=True, internal=True,
internal_match_threshold=0.8):
self.__cores = ["read_a", "len_a", "beg_a", "end_a", "strand",
"read_b", "len_b", "beg_b", "end_b",
"nb_match", "nb_base", "qual"]
......@@ -36,7 +37,7 @@ class Parser:
self.__graph = nx.DiGraph()
self.__containments = defaultdict(list)
self.__overhang_maplen_ratio_limit = 0.8
self.__overhang_maplen_ratio_limit = internal_match_threshold
@property
def containment(self):
......