aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Noll <nbnoll@eml.cc>2020-08-20 11:32:58 -0700
committerNicholas Noll <nbnoll@eml.cc>2020-08-20 11:32:58 -0700
commitdd0d0856d4def973512019b0e17afd43dc042706 (patch)
tree584807ad40f268f545da2a3daab61287c74f1c46
parent001aaaeaaed4847bff81f9c5373d5d5161d0e3ad (diff)
parent0931ce34c979da9e376feeed515b8515748f9a6f (diff)
Merge branch 'feat/fasta-parser' into feat/anchor-matching
-rw-r--r--Makefile2
-rw-r--r--pangraph/build.py2
-rw-r--r--pangraph/graph.py2
-rw-r--r--pangraph/tree.py6
4 files changed, 6 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index ab398b6..0fe7c0a 100644
--- a/Makefile
+++ b/Makefile
@@ -55,7 +55,7 @@ staph:
@echo "cluster staph"; \
pangraph cluster -d data/staph data/staph/assemblies/*.fna.gz
@echo "build staph"; \
- pangraph build -d data/staph -m 500 -b 0 -e 2500 -w 1000 data/staph/guide.json 1>staph-e2500-w1000.log 2>/dev/null
+ pangraph build -d data/staph -m 500 -b 0 -e 2500 -w 100 data/staph/guide.json
# figures
diff --git a/pangraph/build.py b/pangraph/build.py
index 5c3a8ec..e744149 100644
--- a/pangraph/build.py
+++ b/pangraph/build.py
@@ -81,7 +81,7 @@ def main(args):
mkdir(tmp)
log("aligning")
- T.align(tmp, args.len, args.mu, args.beta, args.extensive, args.statistics)
+ T.align(tmp, args.len, args.mu, args.beta, args.extensive, args.window, args.extend, args.statistics)
# TODO: when debugging phase is done, remove tmp directory
graphs = T.collect()
diff --git a/pangraph/graph.py b/pangraph/graph.py
index 83ef839..f4afa97 100644
--- a/pangraph/graph.py
+++ b/pangraph/graph.py
@@ -163,7 +163,7 @@ class Graph(object):
# ---------------
# methods
- def union(self, qpath, rpath, out, cutoff=0, alpha=10, beta=2, edge_window=100, edge_extend=2500, extensive=False):
+ def union(self, qpath, rpath, out, cutoff=0, alpha=10, beta=2, extensive=False, edge_window=1000, edge_extend=2500):
from seqanpy import align_global as align
# ----------------------------------
diff --git a/pangraph/tree.py b/pangraph/tree.py
index 64ac119..eeb52c8 100644
--- a/pangraph/tree.py
+++ b/pangraph/tree.py
@@ -292,7 +292,7 @@ class Tree(object):
leafs = {n.name: n for n in self.get_leafs()}
self.seqs = {leafs[name]:seq for name,seq in seqs.items()}
- def align(self, tmpdir, min_blk_len, mu, beta, extensive, log_stats=False, verbose=False):
+ def align(self, tmpdir, min_blk_len, mu, beta, extensive, edge_window, edge_extend, log_stats=False, verbose=False):
self.root.set_level(0) # NOTE: for debug logging
stats = {}
# ---------------------------------------------
@@ -351,7 +351,7 @@ class Tree(object):
graph1, fapath1 = node1.graph, node1.fapath
graph2, fapath2 = node2.graph, node2.fapath
graph = Graph.fuse(graph1, graph2)
- graph, _ = graph.union(fapath1, fapath2, f"{tmpdir}/{n.name}", min_blk_len, mu, beta, extensive)
+ graph, _ = graph.union(fapath1, fapath2, f"{tmpdir}/{n.name}", min_blk_len, mu, beta, extensive, edge_window, edge_extend)
else:
graph = node1.graph
@@ -361,7 +361,7 @@ class Tree(object):
itr = f"{tmpdir}/{n.name}_iter_{i}"
with open(f"{itr}.fa", 'w') as fd:
graph.write_fasta(fd)
- graph, contin = graph.union(itr, itr, f"{tmpdir}/{n.name}_iter_{i}", min_blk_len, mu, beta, extensive)
+ graph, contin = graph.union(itr, itr, f"{tmpdir}/{n.name}_iter_{i}", min_blk_len, mu, beta, extensive, edge_window, edge_extend)
if not contin:
return graph
return graph