diff --git a/.version b/.version index 05e20ae..1917698 100644 --- a/.version +++ b/.version @@ -1 +1 @@ -v2.2.10 \ No newline at end of file +v2.2.11 \ No newline at end of file diff --git a/bin/split_genes_at_gaps.lua b/bin/split_genes_at_gaps.lua index aac1663..91de122 100755 --- a/bin/split_genes_at_gaps.lua +++ b/bin/split_genes_at_gaps.lua @@ -95,6 +95,10 @@ function stream:process_current_cluster() local rest = clone_cc(cur_gene) for c in cur_gene:children() do if c:get_range():get_start() > g:get_range():get_end() then + -- ensure c is a leaf by removing any children + for cc in c:direct_children() do + pcall(remove_leaf, c, cc) + end pcall(remove_leaf, cur_gene, c) elseif c:get_range():overlap(g:get_range()) then if c:get_range():get_start() > g:get_range():get_start() - 1 then @@ -117,6 +121,10 @@ function stream:process_current_cluster() end for c in rest:children() do if c:get_range():get_end() < g:get_range():get_start() then + -- ensure c is a leaf by removing any children + for cc in c:direct_children() do + pcall(remove_leaf, c, cc) + end pcall(remove_leaf, rest, c) elseif c:get_range():overlap(g:get_range()) then -- XXX make sure we don't create invalid genes