[med-svn] [SCM] abyss branch, master, updated. upstream/1.3.3-10-gfa0fd6d

Andreas Tille tille at debian.org
Fri Jun 1 06:18:37 UTC 2012


The following commit has been merged in the master branch:
commit 767e177481362bcb3c1dee108ea53360c3eb2e4c
Author: Andreas Tille <tille at debian.org>
Date:   Fri Jun 1 08:17:51 2012 +0200

    Imported Upstream version 1.3.4

diff --git a/ABYSS/Makefile.in b/ABYSS/Makefile.in
index 5beb95f..a5768e0 100644
--- a/ABYSS/Makefile.in
+++ b/ABYSS/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# Makefile.in generated by automake 1.12 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -16,6 +16,23 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -34,7 +51,8 @@ PRE_UNINSTALL = :
 POST_UNINSTALL = :
 bin_PROGRAMS = ABYSS$(EXEEXT)
 subdir = ABYSS
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -61,6 +79,11 @@ CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
 	-o $@
 SOURCES = $(ABYSS_SOURCES)
 DIST_SOURCES = $(ABYSS_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -206,8 +229,11 @@ $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 $(am__aclocal_m4_deps):
 install-binPROGRAMS: $(bin_PROGRAMS)
 	@$(NORMAL_INSTALL)
-	test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
 	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+	fi; \
 	for p in $$list; do echo "$$p $$p"; done | \
 	sed 's/$(EXEEXT)$$//' | \
 	while read p p1; do if test -f $$p; \
@@ -330,6 +356,20 @@ GTAGS:
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
 
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
@@ -472,7 +512,7 @@ uninstall-am: uninstall-binPROGRAMS
 .MAKE: install-am install-strip
 
 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
-	clean-generic ctags distclean distclean-compile \
+	clean-generic cscopelist ctags distclean distclean-compile \
 	distclean-generic distclean-tags distdir dvi dvi-am html \
 	html-am info info-am install install-am install-binPROGRAMS \
 	install-data install-data-am install-dvi install-dvi-am \
diff --git a/AdjList/AdjList.cpp b/AdjList/AdjList.cpp
index d8999a8..95df027 100644
--- a/AdjList/AdjList.cpp
+++ b/AdjList/AdjList.cpp
@@ -118,23 +118,27 @@ static void addOverlapsSA(Graph& g, const vector<Kmer>& prefixes)
 	Suffixes suffixes;
 	SuffixArray sa(opt::minOverlap);
 
+	typedef graph_traits<Graph>::vertex_descriptor V;
 	typedef graph_traits<Graph>::vertex_iterator Vit;
 	pair<Vit, Vit> vertices = g.vertices();
 	for (Vit it = vertices.first; it != vertices.second; ++it) {
 		ContigNode u(*it);
 		if (out_degree(u, g) > 0)
 			continue;
-		string suffix(reverseComplement(
-					prefixes[(~u).index()]).str());
+		size_t uci = get(vertex_index, g,
+				get(vertex_complement, g, u));
+		assert(uci < prefixes.size());
+		string suffix(reverseComplement(prefixes[uci]).str());
 		suffixes.push_back(Suffix(suffix, u));
 		sa.insert(suffixes.back());
 	}
 	sa.construct();
 
 	for (Suffixes::const_iterator it = suffixes.begin();
-			it != suffixes.end(); ++it)
-		addOverlapsSA(g, sa,
-				~it->second, reverseComplement(it->first));
+			it != suffixes.end(); ++it) {
+		V uc = get(vertex_complement, g, it->second);
+		addOverlapsSA(g, sa, uc, reverseComplement(it->first));
+	}
 }
 
 /** An index of suffixes of k-1 bp. */
@@ -176,7 +180,8 @@ static void readContigs(const string& path,
 		ContigNode u = add_vertex(vp, g);
 		put(vertex_name, g, u, rec.id);
 		suffixMap[suffix].push_back(u);
-		suffixMap[reverseComplement(prefix)].push_back(~u);
+		suffixMap[reverseComplement(prefix)].push_back(
+				get(vertex_complement, g, u));
 	}
 	assert(in.eof());
 }
@@ -240,9 +245,10 @@ int main(int argc, char** argv)
 			readContigs(argv[optind], g, prefixes, suffixMap);
 	} else
 		readContigs("-", g, prefixes, suffixMap);
-	ContigID::lock();
+	g_contigNames.lock();
 
 	// Add the overlap edges of exactly k-1 bp.
+	typedef graph_traits<Graph>::vertex_descriptor V;
 	if (opt::verbose > 0)
 		cerr << "Finding overlaps of exactly k-1 bp...\n";
 	for (vector<Kmer>::const_iterator it = prefixes.begin();
@@ -250,9 +256,11 @@ int main(int argc, char** argv)
 		ContigNode v(it - prefixes.begin());
 		const SuffixMap::mapped_type& edges = suffixMap[*it];
 		for (SuffixMap::mapped_type::const_iterator
-				itu = edges.begin(); itu != edges.end(); ++itu)
-			add_edge(~v, ~*itu, -(int)opt::k + 1,
-					static_cast<DG&>(g));
+				itu = edges.begin(); itu != edges.end(); ++itu) {
+			V uc = get(vertex_complement, g, *itu);
+			V vc = get(vertex_complement, g, v);
+			add_edge(vc, uc, -(int)opt::k + 1, static_cast<DG&>(g));
+		}
 	}
 	SuffixMap().swap(suffixMap);
 
diff --git a/AdjList/Makefile.in b/AdjList/Makefile.in
index bb32316..8f5b8d2 100644
--- a/AdjList/Makefile.in
+++ b/AdjList/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# Makefile.in generated by automake 1.12 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -16,6 +16,23 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -34,7 +51,8 @@ PRE_UNINSTALL = :
 POST_UNINSTALL = :
 bin_PROGRAMS = AdjList$(EXEEXT)
 subdir = AdjList
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -61,6 +79,11 @@ CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
 	-o $@
 SOURCES = $(AdjList_SOURCES)
 DIST_SOURCES = $(AdjList_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -207,8 +230,11 @@ $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 $(am__aclocal_m4_deps):
 install-binPROGRAMS: $(bin_PROGRAMS)
 	@$(NORMAL_INSTALL)
-	test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
 	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+	fi; \
 	for p in $$list; do echo "$$p $$p"; done | \
 	sed 's/$(EXEEXT)$$//' | \
 	while read p p1; do if test -f $$p; \
@@ -331,6 +357,20 @@ GTAGS:
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
 
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
@@ -473,7 +513,7 @@ uninstall-am: uninstall-binPROGRAMS
 .MAKE: install-am install-strip
 
 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
-	clean-generic ctags distclean distclean-compile \
+	clean-generic cscopelist ctags distclean distclean-compile \
 	distclean-generic distclean-tags distdir dvi dvi-am html \
 	html-am info info-am install install-am install-binPROGRAMS \
 	install-data install-data-am install-dvi install-dvi-am \
diff --git a/Align/Makefile.in b/Align/Makefile.in
index ee1c7dd..5e50d9a 100644
--- a/Align/Makefile.in
+++ b/Align/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# Makefile.in generated by automake 1.12 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -17,6 +17,23 @@
 
 
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -35,7 +52,8 @@ PRE_UNINSTALL = :
 POST_UNINSTALL = :
 bin_PROGRAMS = abyss-align$(EXEEXT)
 subdir = Align
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -79,6 +97,11 @@ CCLD = $(CC)
 LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
 SOURCES = $(libalign_a_SOURCES) $(abyss_align_SOURCES)
 DIST_SOURCES = $(libalign_a_SOURCES) $(abyss_align_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -238,8 +261,11 @@ libalign.a: $(libalign_a_OBJECTS) $(libalign_a_DEPENDENCIES) $(EXTRA_libalign_a_
 	$(RANLIB) libalign.a
 install-binPROGRAMS: $(bin_PROGRAMS)
 	@$(NORMAL_INSTALL)
-	test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
 	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+	fi; \
 	for p in $$list; do echo "$$p $$p"; done | \
 	sed 's/$(EXEEXT)$$//' | \
 	while read p p1; do if test -f $$p; \
@@ -436,6 +462,20 @@ GTAGS:
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
 
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
@@ -579,7 +619,7 @@ uninstall-am: uninstall-binPROGRAMS
 .MAKE: install-am install-strip
 
 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
-	clean-generic clean-noinstLIBRARIES ctags distclean \
+	clean-generic clean-noinstLIBRARIES cscopelist ctags distclean \
 	distclean-compile distclean-generic distclean-tags distdir dvi \
 	dvi-am html html-am info info-am install install-am \
 	install-binPROGRAMS install-data install-data-am install-dvi \
diff --git a/Assembly/AssemblyAlgorithms.cpp b/Assembly/AssemblyAlgorithms.cpp
index 88e6b15..bd4bfb2 100644
--- a/Assembly/AssemblyAlgorithms.cpp
+++ b/Assembly/AssemblyAlgorithms.cpp
@@ -148,8 +148,8 @@ void loadSequences(ISequenceCollection* seqCollection, string inFile)
 			"discarded " << reader.unchaste() << " unchaste reads\n";
 	if (count_nonACGT > 0)
 		cerr << "`" << inFile << "': "
-			"discarded " << count_nonACGT
-			<< "containing non-ACGT characters\n";
+			"discarded " << count_nonACGT << " reads "
+			"containing non-ACGT characters\n";
 	if (count_good == 0)
 		cerr << "warning: `" << inFile << "': "
 			"contains no usable sequence\n";
diff --git a/Assembly/Makefile.in b/Assembly/Makefile.in
index 7ed8259..4f99958 100644
--- a/Assembly/Makefile.in
+++ b/Assembly/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# Makefile.in generated by automake 1.12 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -16,6 +16,23 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -33,7 +50,8 @@ NORMAL_UNINSTALL = :
 PRE_UNINSTALL = :
 POST_UNINSTALL = :
 subdir = Assembly
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -69,6 +87,11 @@ CCLD = $(CC)
 LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
 SOURCES = $(libassembly_a_SOURCES)
 DIST_SOURCES = $(libassembly_a_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -384,6 +407,20 @@ GTAGS:
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
 
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
@@ -523,14 +560,14 @@ uninstall-am:
 .MAKE: install-am install-strip
 
 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-noinstLIBRARIES ctags distclean distclean-compile \
-	distclean-generic distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-data \
-	install-data-am install-dvi install-dvi-am install-exec \
-	install-exec-am install-html install-html-am install-info \
-	install-info-am install-man install-pdf install-pdf-am \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
+	clean-noinstLIBRARIES cscopelist ctags distclean \
+	distclean-compile distclean-generic distclean-tags distdir dvi \
+	dvi-am html html-am info info-am install install-am \
+	install-data install-data-am install-dvi install-dvi-am \
+	install-exec install-exec-am install-html install-html-am \
+	install-info install-info-am install-man install-pdf \
+	install-pdf-am install-ps install-ps-am install-strip \
+	installcheck installcheck-am installdirs maintainer-clean \
 	maintainer-clean-generic mostlyclean mostlyclean-compile \
 	mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
 	uninstall-am
diff --git a/Assembly/SequenceCollection.h b/Assembly/SequenceCollection.h
index 3135b4a..3373c6b 100644
--- a/Assembly/SequenceCollection.h
+++ b/Assembly/SequenceCollection.h
@@ -307,6 +307,15 @@ vertices(const SequenceCollectionHash& g)
 
 // PropertyGraph
 
+/** Return the reverse complement of the specified k-mer. */
+static inline
+graph_traits<SequenceCollectionHash>::vertex_descriptor
+get(vertex_complement_t, const SequenceCollectionHash&,
+		graph_traits<SequenceCollectionHash>::vertex_descriptor u)
+{
+	return reverseComplement(u);
+}
+
 static inline
 bool get(vertex_removed_t, const SequenceCollectionHash& g,
 		graph_traits<SequenceCollectionHash>::vertex_descriptor u)
diff --git a/COPYRIGHT b/COPYRIGHT
index 75026ee..7188bbb 100644
--- a/COPYRIGHT
+++ b/COPYRIGHT
@@ -242,15 +242,19 @@ Files: Common/* DistanceEst/* ParseAligns/*
 Copyright: Copyright 2012 Genome Sciences Centre
 License: BCCA-Academic or GPL-3+
 
-Files: Common/HashFunction.cpp
-Copyright: public-domain
-License: public-domain
- You can use this free for any purpose. It's in the public domain.
- It has no warranty.
+Files: Common/cholesky.hpp
+Copyright: Copyright 2005 Gunter Winkler, Konstantin Kutzkow
+License: LGPL-2.1+
+
+Files: Common/city.cc Common/city.h
+Copyright: Copyright 2011 Google, Inc.
+License: Expat
 
 Files: dialign/*
 Copyright: Copyright 2008 Amarendran R. Subramanian
 License: LGPL-2.1+
+
+License: LGPL-2.1+
  On Debian systems, see `/usr/share/common-licenses/LGPL-2.1'.
  .
  This library is free software; you can redistribute it and/or
@@ -308,6 +312,8 @@ License: BSD-3-clause
 Files: FMIndex/sais.hxx
 Copyright: Copyright 2010 Yuta Mori
 License: Expat
+
+License: Expat
  Permission is hereby granted, free of charge, to any person
  obtaining a copy of this software and associated documentation
  files (the "Software"), to deal in the Software without
diff --git a/ChangeLog b/ChangeLog
index 2374b0b..797617c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,29 @@
+2012-05-30  Shaun Jackman  <sjackman at bcgsc.ca>
+
+	* Release version 1.3.4.
+	* Do not extend paths, which can cause misassemblies.
+	* Increase the default value of m from 30 to 50.
+	* Various portability fixes.
+
+	abyss-pe:
+	* Increase the default value of m from 30 to 50 to reduce the
+	likelihood of misassemblies.
+	* Integrate with SLURM. Thanks to Timothy Carlson.
+
+	ABYSS:
+	* Use CityHash64 rather than Bob Jenkins' hashlittle.
+
+	SimpleGraph:
+	* Do not extend paths. Closes #8. Extending paths can cause
+	misassemblies when the de Bruijn graph is incomplete.
+
+	MergePaths:
+	* Bug fix. Closes #6. Fix the bug causing the error:
+	Assertion `!m_ambig' failed.
+
+	abyss-fatoagp:
+	* New script. Create a FASTA file of scaftigs and an AGP file.
+
 2012-03-13  Shaun Jackman  <sjackman at bcgsc.ca>
 
 	* Release version 1.3.3.
diff --git a/Common/ConstString.h b/Common/ConstString.h
index d2b270c..6e0bf66 100644
--- a/Common/ConstString.h
+++ b/Common/ConstString.h
@@ -106,7 +106,7 @@ namespace std {
 /** Return the hash of the null-terminated string s. */
 static inline size_t hash(const char* s)
 {
-	return hashlittle(s, strlen(s), 0);
+	return hashmem(s, strlen(s));
 }
 
 namespace std {
diff --git a/Common/ContigID.cpp b/Common/ContigID.cpp
index 8f736e6..f27f010 100644
--- a/Common/ContigID.cpp
+++ b/Common/ContigID.cpp
@@ -1,5 +1,5 @@
 #include "ContigID.h"
 
-Dictionary ContigID::s_dict;
+Dictionary g_contigNames;
 
-unsigned ContigID::s_nextID;
+unsigned g_nextContigName;
diff --git a/Common/ContigID.h b/Common/ContigID.h
index 63d4059..307729a 100644
--- a/Common/ContigID.h
+++ b/Common/ContigID.h
@@ -3,125 +3,57 @@
 
 #include "ConstString.h"
 #include "Dictionary.h"
-#include <boost/property_map/property_map.hpp>
 #include <cassert>
-#include <istream>
 #include <ostream>
 #include <sstream>
 #include <string>
 
-/** A contig ID is stored in memory as an integer, but is formatted as
- * a string using a static dictionary.
- */
-class ContigID {
-  public:
-	ContigID() { }
-	explicit ContigID(unsigned id) : m_id(id) { };
-	explicit ContigID(const std::string& id)
-		: m_id(s_dict.index(id)) { };
-
-	/** Return the index of this ID. */
-	operator unsigned() const { return m_id; }
-
-	/** Return the string representation. */
-	Dictionary::key_reference str() const
-	{
-		return s_dict.name(m_id);
-	}
-
-	bool operator ==(const ContigID& o) const
-	{
-		return m_id == o.m_id;
-	}
+/** The dictionary of contig names. */
+extern Dictionary g_contigNames;
 
-	bool operator <(const ContigID& o) const
-	{
-		return m_id < o.m_id;
-	}
+/** The next unique contig name. */
+extern unsigned g_nextContigName;
 
-	friend std::istream& operator >>(std::istream& in,
-			ContigID& o)
-	{
-		std::string s;
-		if (in >> s)
-			o = ContigID(s);
-		else
-			o.m_id = 1<<29; // invalid value
-		return in;
-	}
-
-	friend std::ostream& operator <<(std::ostream& out,
-			const ContigID& o)
-	{
-		return out << o.str();
-	}
-
-	static bool empty() { return s_dict.empty(); }
-	static void lock() { s_dict.lock(); }
-	static void unlock() { s_dict.unlock(); }
-	static size_t count(const std::string& id)
-	{
-		return s_dict.count(id);
-	}
+/** Set the next contig name returned by createContigName. */
+static inline void setNextContigName(cstring s)
+{
+	std::istringstream iss((std::string)s);
+	if (iss >> g_nextContigName && iss.eof())
+		++g_nextContigName;
+	else
+		g_nextContigName = 0;
+}
 
-	/** Create a new contig ID from s, which must be unique. */
-	static ContigID insert(const std::string& s)
-	{
-		return ContigID(s_dict.insert(s));
+/** Return the next unique contig name. */
+static inline std::string createContigName()
+{
+	if (g_nextContigName == 0) {
+		assert(!g_contigNames.empty());
+		setNextContigName(g_contigNames.back());
 	}
+	std::ostringstream ss;
+	ss << g_nextContigName++;
+	return ss.str();
+}
 
-	/** Create a new contig ID if it does not already exist. */
-	static void put(ContigID id, const std::string& s)
-	{
-		s_dict.put(id, s);
-	}
+/** A contig index. */
+class ContigID
+{
+  public:
+	ContigID() { }
+	explicit ContigID(unsigned index) : m_index(index) { };
 
-	/** Set the next contig ID returned by ContigID::create. */
-	static void setNextContigID(cstring s)
-	{
-		std::istringstream iss((std::string)s);
-		if (iss >> s_nextID && iss.eof())
-			++s_nextID;
-		else
-			s_nextID = 0;
-	}
+	/** Return the index. */
+	operator unsigned() const { return m_index; }
 
-	/** Return a unique contig ID. */
-	static ContigID create()
-	{
-		if (s_nextID == 0) {
-			assert(!s_dict.empty());
-			setNextContigID(s_dict.back());
-		}
-		std::ostringstream oss;
-		oss << s_nextID++;
-		return insert(oss.str());
-	}
+	/** The insertion operator is not implemented to prevent
+	 * unintentional use of the cast operator (unsigned).
+	 */
+	friend std::ostream& operator<<(std::ostream&, const ContigID&);
 
   private:
 	/** The index. */
-	unsigned m_id;
-
-	/** The contig ID dictionary. */
-	static Dictionary s_dict;
-
-	/** The next unique contig ID. */
-	static unsigned s_nextID;
-};
-
-/** A property map of a ContigID to an index. */
-struct ContigIDIndexMap {
-	typedef ContigID key_type;
-	typedef unsigned value_type;
-	typedef value_type reference;
-	typedef boost::readable_property_map_tag category;
+	unsigned m_index;
 };
 
-/** Return a numeric index of the specified contig. */
-static inline
-unsigned get(const ContigIDIndexMap&, ContigID u)
-{
-	return u;
-}
-
 #endif
diff --git a/Common/ContigNode.h b/Common/ContigNode.h
index c63a329..b0b21f6 100644
--- a/Common/ContigNode.h
+++ b/Common/ContigNode.h
@@ -3,179 +3,159 @@
 
 #include "config.h" // for WORDS_BIGENDIAN
 #include "ContigID.h"
-#include "Graph/Properties.h" // for vertex_index_t
+#include "Graph/Properties.h"
 #include "StringUtil.h"
 #include <boost/property_map/property_map.hpp>
 #include <cassert>
 #include <cstdlib> // for strtoul
 #include <iostream>
+#include <stdint.h> // for intptr_t
 #include <string>
+#include <utility>
 
-/** A tuple of a contig ID and an orientation. */
-class ContigNode {
-  public:
-	ContigNode() { }
-
-#if WORDS_BIGENDIAN
-	ContigNode(unsigned id, bool sense)
-		: m_ambig(false), m_id(id), m_sense(sense) { }
-	ContigNode(unsigned id, int sense)
-		: m_ambig(false), m_id(id), m_sense(sense) { }
-	ContigNode(std::string id, bool sense)
-		: m_ambig(false),
-		m_id(ContigID(id)), m_sense(sense) { }
-#else
-	ContigNode(unsigned id, bool sense)
-		: m_sense(sense), m_id(id), m_ambig(false) { }
-	ContigNode(unsigned id, int sense)
-		: m_sense(sense), m_id(id), m_ambig(false) { }
-	ContigNode(std::string id, bool sense)
-		: m_sense(sense), m_id(ContigID(id)),
-		m_ambig(false) { }
-#endif
+/** A vertex of a contig graph, which is a pair of a contig index and
+ * an orientation.
+ */
+class ContigNode
+{
+public:
 
-	explicit ContigNode(unsigned i) : m_int(i) { }
+ContigNode() { }
 
-	/** Create an ambiguous contig. */
-	ContigNode(unsigned n, char c)
-#if WORDS_BIGENDIAN
-		: m_ambig(true), m_id(n), m_sense(false)
-#else
-		: m_sense(false), m_id(n), m_ambig(true)
-#endif
-	{
-		assert(c == 'N');
-		(void)c;
-		assert(n > 0);
-	}
+ContigNode(const ContigNode& o) : m_index(o.m_index) { }
 
-	ContigNode(std::string id)
-	{
-		char c = chop(id);
-		assert(c == '+' || c == '-' || c == 'N');
-		*this = c == 'N'
-			? ContigNode(strtoul(id.c_str(), NULL, 0), 'N')
-			: ContigNode(id, c == '-');
-	}
+/** Construct from a vertex index. */
+explicit ContigNode(unsigned index) : m_index(index) { }
 
-	bool ambiguous() const { return m_ambig; }
-	unsigned id() const { return m_ambig ? -m_id : m_id; }
-	bool sense() const { assert(!m_ambig); return m_sense; }
+/** Construct from a contig index and an orientation. */
+ContigNode(unsigned index, bool sense)
+	: m_index(2 * index + sense) { }
 
-	std::string ambiguousSequence() const
-	{
-		assert(m_ambig);
-		if (m_id > 100000) {
-			std::cerr
-				<< "warning: scaffold gap is longer than 100 kbp: "
-				<< *this << '\n';
-		} else if (m_id > 1000000) {
-			std::cerr << "error: scaffold gap is longer than 1 Mbp: "
-				<< *this << '\n';
-			exit(EXIT_FAILURE);
-		}
-		return std::string(m_id, 'N');
-	}
+/** Construct from a contig index and an orientation. */
+ContigNode(unsigned index, int sense)
+	: m_index(2 * index + sense)
+{
+	assert(sense == 0 || sense == 1);
+}
 
-	void flip() { if (!m_ambig) m_sense = !m_sense; }
+/** Construct an ambiguous ContigNode. */
+ContigNode(unsigned n, char c)
+	: m_index(-(int)n)
+{
+	assert(n > 0);
+	assert(c == 'N');
+	(void)c;
+}
 
-	/** Return the contig ID. */
-	operator ContigID() const
-	{
-		assert(!m_ambig);
-		return ContigID(m_id);
-	}
+bool operator==(const ContigNode& o) const
+{
+	return m_index == o.m_index;
+}
 
-	bool operator ==(const ContigNode& o) const
-	{
-		return hash() == o.hash();
-	}
+bool operator!=(const ContigNode& o) const
+{
+	return m_index != o.m_index;
+}
 
-	bool operator !=(const ContigNode& o) const
-	{
-		return !(*this == o);
-	}
+bool operator<(const ContigNode& o) const
+{
+	return m_index < o.m_index;
+}
 
-	bool operator <(const ContigNode& o) const
-	{
-		return hash() < o.hash();
-	}
+/** Return the complement of this vertex if sense is true. */
+ContigNode operator^(bool sense) const
+{
+	assert(!ambiguous());
+	return ContigNode(m_index ^ sense);
+}
 
-	const ContigNode operator~() const
-	{
-		assert(!m_ambig);
-		return ContigNode(m_id, !m_sense);
-	}
+/** Return whether this ContigNode is ambiguous. */
+bool ambiguous() const
+{
+	return m_index < 0;
+}
 
-	const ContigNode operator^(bool flip) const
-	{
-		return flip ? ~*this : *this;
-	}
+/** Return the vertex index. */
+unsigned index() const
+{
+	assert(!ambiguous());
+	return m_index;
+}
 
-	ContigNode& operator++() { ++m_int; return *this; }
+/** Return the contig index. */
+unsigned id() const
+{
+	return ambiguous() ? m_index : m_index / 2;
+}
 
-	friend std::istream& operator >>(std::istream& in,
-			ContigNode& o)
-	{
-		std::string s;
-		if (in >> s)
-			o = ContigNode(s);
-		return in;
-	}
+/** Return the contig index as a ContigID. */
+ContigID contigIndex() const
+{
+	assert(!ambiguous());
+	return ContigID(id());
+}
 
-	friend std::ostream& operator <<(std::ostream& out,
-			const ContigNode& o)
-	{
-		if (o.ambiguous())
-			return out << o.m_id << 'N';
-		else
-			return out << ContigID(o.id()) << (o.sense() ? '-' : '+');
-	}
+/** Return the orientation of this vertex. */
+bool sense() const
+{
+	assert(!ambiguous());
+	return m_index & 1;
+}
 
-	/** Return the length of this ambiguous contig in k-mer. */
-	unsigned length() const { assert(m_ambig); return m_id; }
+/** Return the length in k-mer of this ambiguous contig. */
+unsigned length() const
+{
+	assert(ambiguous());
+	return -m_index;
+}
 
-	/** Return a value that can be used as an index of an array. */
-	unsigned index() const
-	{
-		assert(!m_ambig);
-		return hash();
+/** Return the string of Ns. */
+std::string ambiguousSequence() const
+{
+	assert(ambiguous());
+	unsigned n = length();
+	if (n > 100000) {
+		std::cerr
+			<< "warning: scaffold gap is longer than 100 kbp: "
+			<< n << '\n';
+	} else if (n > 1000000) {
+		std::cerr << "error: scaffold gap is longer than 1 Mbp: "
+			<< n << '\n';
+		exit(EXIT_FAILURE);
 	}
+	return std::string(n, 'N');
+}
 
-  private:
-	/** Return the hash value of this contig. */
-	unsigned hash() const { return m_int; }
-
-	union {
-		unsigned m_int;
-		struct {
-#if WORDS_BIGENDIAN
-			unsigned m_ambig:1;
-			unsigned m_id:30;
-			unsigned m_sense:1;
-#else
-			unsigned m_sense:1;
-			unsigned m_id:30;
-			unsigned m_ambig:1;
-#endif
-		};
-	};
-};
+/** Toggle the orientation of this vertex if sense is true. */
+ContigNode& operator^=(bool sense)
+{
+	assert(!ambiguous());
+	m_index ^= sense;
+	return *this;
+}
 
-/** Return the hash value of this ContigNode. */
-static inline unsigned hash_value(const ContigNode& o)
+/** Increment this vertex index. */
+ContigNode& operator++()
 {
-	return o.index();
+	assert(!ambiguous());
+	++m_index;
+	return *this;
 }
 
-/** Return a numeric index of the specified vertex. */
-static inline unsigned index(const ContigNode& o)
+private:
+	int m_index;
+};
+
+/** Return the hash value of this ContigNode. */
+static inline unsigned hash_value(const ContigNode& o)
 {
 	return o.index();
 }
 
 /** Vertex index property map of a ContigNode. */
-struct ContigNodeIndexMap {
+struct ContigNodeIndexMap
+	: boost::put_get_helper<unsigned, ContigNodeIndexMap>
+{
 	typedef ContigNode key_type;
 	typedef unsigned value_type;
 	typedef value_type reference;
@@ -187,25 +167,70 @@ struct ContigNodeIndexMap {
 	}
 };
 
-/** Return a numeric index of the specified vertex. */
-static inline
-unsigned get(ContigNodeIndexMap, ContigNode u)
+/** Contig index property map of a ContigNode. */
+struct ContigIndexMap
+	: boost::put_get_helper<ContigID, ContigIndexMap>
 {
-	return u.index();
-}
+	typedef ContigNode key_type;
+	typedef ContigID value_type;
+	typedef value_type reference;
+	typedef boost::readable_property_map_tag category;
 
-/** Return a numeric index of the specified vertex. */
+	reference operator[](const key_type& u) const
+	{
+		return u.contigIndex();
+	}
+};
+
+/** Return the contig name of the specified vertex. */
 template <typename Graph>
-unsigned get(vertex_index_t, const Graph&, ContigNode u)
+Dictionary::name_reference
+get(vertex_contig_name_t, const Graph&, ContigNode u)
 {
-	return u.index();
+	assert(!u.ambiguous());
+	return get(g_contigNames, u.id());
 }
 
-/** Return the sense of the specified vertex. */
+/** The string representation of a vertex name. */
+struct VertexName : std::pair<intptr_t, char>
+{
+	typedef std::pair<intptr_t, char> Base;
+
+	VertexName(const char* s, char c)
+		: Base(reinterpret_cast<intptr_t>(s), c)
+	{
+		assert(c == '+' || c == '-');
+	}
+
+	VertexName(unsigned n, char c) : Base(n, c)
+	{
+		assert(c == 'N');
+	}
+
+	friend std::ostream& operator<<(
+			std::ostream& out, const VertexName& o)
+	{
+		if (o.second == 'N')
+			out << o.first;
+		else
+			out << reinterpret_cast<const char*>(o.first);
+		return out << o.second;
+	}
+};
+
+/** Return the name of the specified vertex. */
+static inline VertexName get(const Dictionary& pmap, ContigNode u)
+{
+	return u.ambiguous()
+		? VertexName(u.length(), 'N')
+		: VertexName(get(pmap, u.id()), u.sense() ? '-' : '+');
+}
+
+/** Return the name of the specified vertex. */
 template <typename Graph>
-bool get(vertex_sense_t, const Graph&, ContigNode u)
+VertexName get(vertex_name_t, const Graph&, ContigNode u)
 {
-	return u.sense();
+	return get(g_contigNames, u);
 }
 
 /** Set the name of the specified vertex. */
@@ -216,9 +241,61 @@ void put(vertex_name_t, const Graph&, ContigNode u,
 	assert(!name.empty());
 	char c = name[name.size() - 1];
 	if (c == '+' || c == '-')
-		ContigID::put(u, std::string(name, 0, name.size() - 1));
+		put(g_contigNames, u.id(), name.substr(0, name.size() - 1));
 	else
-		ContigID::put(u, name);
+		put(g_contigNames, u.id(), name);
+}
+
+/** The string representation of an edge name. */
+struct EdgeName : std::pair<VertexName, VertexName>
+{
+	typedef std::pair<VertexName, VertexName> Base;
+
+	EdgeName(Base::first_type a, Base::second_type b)
+		: Base(a, b) { }
+
+	friend std::ostream& operator<<(
+			std::ostream& out, const EdgeName& o)
+	{
+		return out << '"' << o.first << "\" -> \"" << o.second << '"';
+	}
+};
+
+/** Return the name of the specified edge. */
+static inline EdgeName get(const Dictionary& pmap,
+		std::pair<ContigNode, ContigNode> e)
+{
+	return EdgeName(get(pmap, e.first), get(pmap, e.second));
+}
+
+/** Return the name of the specified edge. */
+template <typename Graph>
+EdgeName get(edge_name_t, const Graph& g,
+		std::pair<ContigNode, ContigNode> e)
+{
+	return EdgeName(
+			get(vertex_name, g, source(e, g)),
+			get(vertex_name, g, target(e, g)));
+}
+
+/** Find the vertex with the specified name. */
+static inline ContigNode find_vertex(
+		std::string name, bool sense, const Dictionary& pmap)
+{
+	assert(!name.empty());
+	return ContigNode(get(pmap, name), sense);
+}
+
+/** Find the vertex with the specified name. */
+static inline ContigNode find_vertex(
+		std::string name, const Dictionary& pmap)
+{
+	assert(!name.empty());
+	char c = chop(name);
+	assert(c == '+' || c == '-' || c == 'N');
+	return c == 'N'
+		? ContigNode(strtoul(name.c_str(), NULL, 0), 'N')
+		: find_vertex(name, c == '-', pmap);
 }
 
 #endif
diff --git a/Common/ContigPath.h b/Common/ContigPath.h
index c1aab04..f304ba9 100644
--- a/Common/ContigPath.h
+++ b/Common/ContigPath.h
@@ -2,12 +2,10 @@
 #define CONTIGPATH_H 1
 
 #include "ContigNode.h"
-#include "ContigID.h"
 #include <algorithm>
 #include <cassert>
 #include <functional>
 #include <istream>
-#include <iterator>
 #include <sstream>
 #include <string>
 #include <ostream>
@@ -21,16 +19,18 @@ template<typename T>
 void reverseComplement(T first, T last)
 {
 	std::reverse(first, last);
-	std::for_each(first, last,
-			std::mem_fun_ref(&ContigNode::flip));
+	for (T it = first; it < last; ++it)
+		if (!it->ambiguous())
+			*it ^= 1;
 }
 
 /** Return the reverse complement of the specified path. */
 static inline ContigPath reverseComplement(const ContigPath& path)
 {
 	ContigPath rc(path.rbegin(), path.rend());
-	std::for_each(rc.begin(), rc.end(),
-			std::mem_fun_ref(&ContigNode::flip));
+	for (ContigPath::iterator it = rc.begin(); it < rc.end(); ++it)
+		if (!it->ambiguous())
+			*it ^= 1;
 	return rc;
 }
 
@@ -38,10 +38,11 @@ static inline std::ostream& operator<<(std::ostream& out,
 		const ContigPath& o)
 {
 	assert(!o.empty());
-	ContigPath::const_iterator last = o.end() - 1;
-	copy(o.begin(), last,
-			std::ostream_iterator<ContigNode>(out, " "));
-	return out << *last;
+	ContigPath::const_iterator it = o.begin();
+	out << get(g_contigNames, *it);
+	for (++it; it != o.end(); ++it)
+		out << ' ' << get(g_contigNames, *it);
+	return out;
 }
 
 static inline std::istream& operator>>(std::istream& in,
@@ -51,8 +52,8 @@ static inline std::istream& operator>>(std::istream& in,
 	std::string s;
 	if (getline(in, s)) {
 		std::istringstream ss(s);
-		for (ContigNode u; ss >> u;)
-			o.push_back(u);
+		for (std::string name; ss >> name;)
+			o.push_back(find_vertex(name, g_contigNames));
 		assert(ss.eof());
 	}
 	return in;
@@ -66,16 +67,16 @@ static inline void markSeenInPath(std::istream& in,
 	ContigPath path;
 	while (in >> s >> path) {
 		if (path.empty()) {
-			ContigID id(s);
-			assert(marked.size() > id);
-			marked[id] = true;
+			size_t i = get(g_contigNames, s);
+			assert(i < marked.size());
+			marked[i] = true;
 		}
 		for (ContigPath::const_iterator it = path.begin();
 				it != path.end(); ++it) {
 			if (!it->ambiguous()) {
-				ContigID id(*it);
-				assert(marked.size() > id);
-				marked[id] = true;
+				size_t i = it->contigIndex();
+				assert(i < marked.size());
+				marked[i] = true;
 			}
 		}
 	}
diff --git a/Common/ContigProperties.h b/Common/ContigProperties.h
index 4183e30..a2f4b9c 100644
--- a/Common/ContigProperties.h
+++ b/Common/ContigProperties.h
@@ -168,8 +168,8 @@ struct Distance {
 /** Add the specified distance (overlap) to the specified contig
  * length.
  */
-static inline ContigProperties& operator+=(
-		ContigProperties& a, const Distance& b)
+template <typename T>
+ContigProperties& operator+=(ContigProperties& a, const T& b)
 {
 	assert((int)a.length + (int)b.distance > 0);
 	a.length += b.distance;
@@ -200,7 +200,8 @@ get(edge_bundle_t, const Graph& g, ContigNode u, ContigNode v)
 		std::pair<edge_descriptor, bool> e = edge(u, v, g);
 		if (!e.second)
 			std::cerr << "error: no edge "
-				<< u << " -> " << v << '\n';
+				<< get(vertex_name, g, u) << " -> "
+				<< get(vertex_name, g, v) << '\n';
 		assert(e.second);
 		return g[e.first];
 	}
@@ -227,4 +228,13 @@ struct EdgeWeightMap {
 	const Graph& m_g;
 };
 
+/** Return the edge weight. */
+template <typename Graph>
+typename EdgeWeightMap<Graph>::value_type
+get(edge_weight_t, const Graph& g,
+		typename graph_traits<Graph>::edge_descriptor e)
+{
+	return EdgeWeightMap<Graph>(g)[e];
+}
+
 #endif
diff --git a/Common/Dictionary.h b/Common/Dictionary.h
index 49d8a7d..f055dfc 100644
--- a/Common/Dictionary.h
+++ b/Common/Dictionary.h
@@ -9,69 +9,72 @@
 #include <string>
 #include <vector>
 
-/** A dictionary of strings that assigns each string an index. */
-class Dictionary {
+/** A bidirectional map of indices and names. */
+class Dictionary
+{
 	public:
-		typedef std::string key_type;
-		typedef cstring key_reference;
-		typedef std::vector<const_string> Vector;
 		typedef unsigned index_type;
-		typedef unordered_map<key_reference, index_type> Map;
+		typedef unsigned index_reference;
+		typedef std::string name_type;
+		typedef cstring name_reference;
+
+		typedef std::vector<const_string> Vector;
+		typedef unordered_map<name_reference, index_type> Map;
 
 		Dictionary() : m_locked(false) { }
 
-		/** Insert the specified key. */
-		index_type insert(const key_type& key)
+		/** Insert the specified name. */
+		index_reference insert(const name_type& name)
 		{
-			m_vec.push_back(key);
+			m_vec.push_back(name);
 			std::pair<Map::const_iterator, bool> inserted
 				= m_map.insert(Map::value_type(
 							m_vec.back(), m_map.size()));
 			if (!inserted.second) {
 				std::cerr << "error: duplicate ID: `"
-					<< key << "'\n";
+					<< name << "'\n";
 				exit(EXIT_FAILURE);
 			}
 			return inserted.first->second;
 		}
 
 		/** If the specified index is within this dictionary, ensure
-		 * that the key is identical, otherwise append the key to this
-		 * dictionary.
+		 * that the name is identical, otherwise append the name to
+		 * this dictionary.
 		 */
-		void put(index_type index, const key_type& key)
+		void put(index_type index, const name_type& name)
 		{
 			if (index < m_vec.size()) {
-				assert(name(index) == key);
+				assert(getName(index) == name);
 			} else {
 				assert(!m_locked);
 				assert(index == m_vec.size());
-				index_type i = insert(key);
+				index_type i = insert(name);
 				assert(i == index);
 				(void)i;
 			}
 		}
 
-		/** Return the index of the specified key. */
-		index_type index(const key_type& key) const
+		/** Return the index of the specified name. */
+		index_reference getIndex(const name_type& name) const
 		{
-			Map::const_iterator it = m_map.find(key);
+			Map::const_iterator it = m_map.find(name);
 			if (it == m_map.end()) {
 				std::cerr << "error: unexpected ID: `"
-					<< key << "'\n";
+					<< name << "'\n";
 				exit(EXIT_FAILURE);
 			}
 			return it->second;
 		}
 
 		/** Return the name of the specified index. */
-		key_reference name(index_type index) const
+		name_reference getName(index_type index) const
 		{
 			assert(index < m_vec.size());
 			return m_vec[index];
 		}
 
-		/** Lock this dictionary. No further keys may be added. */
+		/** Lock this dictionary. No further elements may be added. */
 		void lock() { m_locked = true; }
 
 		/** Unlock this dictionary. */
@@ -83,14 +86,14 @@ class Dictionary {
 		/** Return the number of elements in this dictionary. */
 		size_t size() const { return m_vec.size(); }
 
-		/** Return the number of elements with the specified key. */
-		size_t count(const key_type& key) const
+		/** Return the number of elements with the specified name. */
+		size_t count(const name_type& name) const
 		{
-			return m_map.count(key);
+			return m_map.count(name);
 		}
 
-		/** Return the last key in this dictionary. */
-		key_reference back() const
+		/** Return the last name in this dictionary. */
+		name_reference back() const
 		{
 			assert(!m_vec.empty());
 			return m_vec.back();
@@ -102,4 +105,22 @@ class Dictionary {
 		bool m_locked;
 };
 
+static inline Dictionary::name_reference get(
+		const Dictionary& pmap, Dictionary::index_type index)
+{
+	return pmap.getName(index);
+}
+
+static inline void put(Dictionary& pmap, Dictionary::index_type index,
+		const Dictionary::name_type& name)
+{
+	pmap.put(index, name);
+}
+
+static inline Dictionary::index_reference get(
+		const Dictionary& pmap, Dictionary::name_type name)
+{
+	return pmap.getIndex(name);
+}
+
 #endif
diff --git a/Common/Estimate.h b/Common/Estimate.h
index c894e8a..4e1201b 100644
--- a/Common/Estimate.h
+++ b/Common/Estimate.h
@@ -9,10 +9,11 @@
 #include <cmath> // for ceilf
 #include <iomanip>
 #include <istream>
-#include <iterator>
 #include <ostream>
 #include <sstream>
 #include <string>
+#include <utility>
+#include <vector>
 
 namespace opt {
 	/** The acceptable error of a distance estimate. */
@@ -64,7 +65,10 @@ struct DistanceEst
 			if (in.peek() == ']') {
 				o.stdDev = o.numPairs = 0;
 				return in;
-			} else
+			} else if (in.peek() == ',')
+				return in >> expect(", e =") >> o.stdDev
+					>> expect(", n =") >> o.numPairs;
+			else
 				return in >> expect(" e =") >> o.stdDev
 					>> expect(" n =") >> o.numPairs;
 		} else
@@ -81,6 +85,12 @@ struct DistanceEst
  */
 struct BetterDistanceEst
 {
+	NoProperty operator()(
+			const NoProperty& a, const NoProperty&) const
+	{
+		return a;
+	}
+
 	DistanceEst operator()(
 			const DistanceEst& a, const DistanceEst& b) const
 	{
@@ -108,33 +118,6 @@ struct MergeDistanceEst
 	}
 };
 
-/** An estimate of the distance between two contigs. */
-struct Estimate : public DistanceEst
-{
-	ContigNode contig;
-
-	friend std::ostream& operator<<(std::ostream& out,
-			const Estimate& o)
-	{
-		if (opt::format != DIST)
-			return out << '"' << o.contig << "\" ["
-				<< static_cast<const DistanceEst&>(o) << ']';
-		else
-			return out << o.contig << ','
-				<< static_cast<const DistanceEst&>(o);
-	}
-
-	friend std::istream& operator>>(std::istream& in, Estimate& o)
-	{
-		in >> std::ws;
-		std::string id;
-		if (!getline(in, id, ','))
-			return in;
-		o.contig = ContigNode(id);
-		return in >> static_cast<DistanceEst&>(o);
-	}
-};
-
 /** Return the allowed error for the given estimate. */
 static inline unsigned allowedError(float stddev)
 {
@@ -143,13 +126,14 @@ static inline unsigned allowedError(float stddev)
 	return (unsigned)ceilf(NUM_SIGMA * stddev + opt::distanceError);
 }
 
-typedef std::vector<Estimate> EstimateVector;
-
 /** Distance estimates to and from a particular contig. */
 struct EstimateRecord
 {
+	typedef std::pair<ContigNode, DistanceEst> Estimate;
+	typedef std::vector<Estimate> Estimates;
+
 	ContigID refID;
-	EstimateVector estimates[2];
+	Estimates estimates[2];
 
 	/** Read the distance estimates for one contig. */
 	friend std::istream& operator >>(std::istream& in,
@@ -158,19 +142,21 @@ struct EstimateRecord
 		o.estimates[false].clear();
 		o.estimates[true].clear();
 
-		ContigID id;
-		in >> id;
+		std::string name;
+		in >> name;
 		if (!in)
 			return in;
-		o.refID = id;
+		o.refID = ContigID(get(g_contigNames, name));
 
 		for (int rc = false; rc <= true; ++rc) {
 			std::string s;
 			std::getline(in, s, !rc ? ';' : '\n');
 			std::istringstream ss(s);
-			std::copy(std::istream_iterator<Estimate>(ss),
-					std::istream_iterator<Estimate>(),
-					std::back_inserter(o.estimates[rc]));
+			for (Estimate ep; getline(ss >> std::ws, s, ',');) {
+				ep.first = find_vertex(s, g_contigNames);
+				if (ss >> ep.second)
+					o.estimates[rc].push_back(ep);
+			}
 			assert(ss.eof());
 		}
 
diff --git a/Common/HashFunction.cpp b/Common/HashFunction.cpp
deleted file mode 100644
index 2ebccc8..0000000
--- a/Common/HashFunction.cpp
+++ /dev/null
@@ -1,759 +0,0 @@
-#include "HashFunction.h"
-
-/*
--------------------------------------------------------------------------------
-lookup3.c, by Bob Jenkins, May 2006, Public Domain.
-
-These are functions for producing 32-bit hashes for hash table lookup.
-hashword(), hashlittle(), hashlittle2(), hashbig(), mix(), and final()
-are externally useful functions.  Routines to test the hash are included
-if SELF_TEST is defined.  You can use this free for any purpose.  It's in
-the public domain.  It has no warranty.
-
-You probably want to use hashlittle().  hashlittle() and hashbig()
-hash byte arrays.  hashlittle() is is faster than hashbig() on
-little-endian machines.  Intel and AMD are little-endian machines.
-On second thought, you probably want hashlittle2(), which is identical to
-hashlittle() except it returns two 32-bit hashes for the price of one.
-You could implement hashbig2() if you wanted but I haven't bothered here.
-
-If you want to find a hash of, say, exactly 7 integers, do
-  a = i1;  b = i2;  c = i3;
-  mix(a,b,c);
-  a += i4; b += i5; c += i6;
-  mix(a,b,c);
-  a += i7;
-  final(a,b,c);
-then use c as the hash value.  If you have a variable length array of
-4-byte integers to hash, use hashword().  If you have a byte array (like
-a character string), use hashlittle().  If you have several byte arrays, or
-a mix of things, see the comments above hashlittle().
-
-Why is this so big?  I read 12 bytes at a time into 3 4-byte integers,
-then mix those integers.  This is fast (you can do a lot more thorough
-mixing with 12*3 instructions on 3 integers than you can with 3 instructions
-on 1 byte), but shoehorning those bytes into integers efficiently is messy.
--------------------------------------------------------------------------------
-*/
-#include <stdint.h>     /* defines uint32_t etc */
-#include <sys/param.h>  /* attempt to define endianness */
-#ifdef linux
-# include <endian.h>    /* attempt to define endianness */
-#endif
-
-/*
- * My best guess at if you are big-endian or little-endian.  This may
- * need adjustment.
- */
-#if (defined(__BYTE_ORDER) && defined(__LITTLE_ENDIAN) && \
-     __BYTE_ORDER == __LITTLE_ENDIAN) || \
-    (defined(i386) || defined(__i386__) || defined(__i486__) || \
-     defined(__i586__) || defined(__i686__) || defined(vax) || defined(MIPSEL))
-# define HASH_LITTLE_ENDIAN 1
-# define HASH_BIG_ENDIAN 0
-#elif (defined(__BYTE_ORDER) && defined(__BIG_ENDIAN) && \
-       __BYTE_ORDER == __BIG_ENDIAN) || \
-      (defined(sparc) || defined(POWERPC) || defined(mc68000) || defined(sel))
-# define HASH_LITTLE_ENDIAN 0
-# define HASH_BIG_ENDIAN 1
-#else
-# define HASH_LITTLE_ENDIAN 0
-# define HASH_BIG_ENDIAN 0
-#endif
-
-#define hashsize(n) ((uint32_t)1<<(n))
-#define hashmask(n) (hashsize(n)-1)
-#define rot(x,k) (((x)<<(k)) | ((x)>>(32-(k))))
-
-/*
--------------------------------------------------------------------------------
-mix -- mix 3 32-bit values reversibly.
-
-This is reversible, so any information in (a,b,c) before mix() is
-still in (a,b,c) after mix().
-
-If four pairs of (a,b,c) inputs are run through mix(), or through
-mix() in reverse, there are at least 32 bits of the output that
-are sometimes the same for one pair and different for another pair.
-This was tested for:
-* pairs that differed by one bit, by two bits, in any combination
-  of top bits of (a,b,c), or in any combination of bottom bits of
-  (a,b,c).
-* "differ" is defined as +, -, ^, or ~^.  For + and -, I transformed
-  the output delta to a Gray code (a^(a>>1)) so a string of 1's (as
-  is commonly produced by subtraction) look like a single 1-bit
-  difference.
-* the base values were pseudorandom, all zero but one bit set, or
-  all zero plus a counter that starts at zero.
-
-Some k values for my "a-=c; a^=rot(c,k); c+=b;" arrangement that
-satisfy this are
-    4  6  8 16 19  4
-    9 15  3 18 27 15
-   14  9  3  7 17  3
-Well, "9 15 3 18 27 15" didn't quite get 32 bits diffing
-for "differ" defined as + with a one-bit base and a two-bit delta.  I
-used http://burtleburtle.net/bob/hash/avalanche.html to choose
-the operations, constants, and arrangements of the variables.
-
-This does not achieve avalanche.  There are input bits of (a,b,c)
-that fail to affect some output bits of (a,b,c), especially of a.  The
-most thoroughly mixed value is c, but it doesn't really even achieve
-avalanche in c.
-
-This allows some parallelism.  Read-after-writes are good at doubling
-the number of bits affected, so the goal of mixing pulls in the opposite
-direction as the goal of parallelism.  I did what I could.  Rotates
-seem to cost as much as shifts on every machine I could lay my hands
-on, and rotates are much kinder to the top and bottom bits, so I used
-rotates.
--------------------------------------------------------------------------------
-*/
-#define mix(a,b,c) \
-{ \
-  a -= c;  a ^= rot(c, 4);  c += b; \
-  b -= a;  b ^= rot(a, 6);  a += c; \
-  c -= b;  c ^= rot(b, 8);  b += a; \
-  a -= c;  a ^= rot(c,16);  c += b; \
-  b -= a;  b ^= rot(a,19);  a += c; \
-  c -= b;  c ^= rot(b, 4);  b += a; \
-}
-
-/*
--------------------------------------------------------------------------------
-final -- final mixing of 3 32-bit values (a,b,c) into c
-
-Pairs of (a,b,c) values differing in only a few bits will usually
-produce values of c that look totally different.  This was tested for
-* pairs that differed by one bit, by two bits, in any combination
-  of top bits of (a,b,c), or in any combination of bottom bits of
-  (a,b,c).
-* "differ" is defined as +, -, ^, or ~^.  For + and -, I transformed
-  the output delta to a Gray code (a^(a>>1)) so a string of 1's (as
-  is commonly produced by subtraction) look like a single 1-bit
-  difference.
-* the base values were pseudorandom, all zero but one bit set, or
-  all zero plus a counter that starts at zero.
-
-These constants passed:
- 14 11 25 16 4 14 24
- 12 14 25 16 4 14 24
-and these came close:
-  4  8 15 26 3 22 24
- 10  8 15 26 3 22 24
- 11  8 15 26 3 22 24
--------------------------------------------------------------------------------
-*/
-#define final(a,b,c) \
-{ \
-  c ^= b; c -= rot(b,14); \
-  a ^= c; a -= rot(c,11); \
-  b ^= a; b -= rot(a,25); \
-  c ^= b; c -= rot(b,16); \
-  a ^= c; a -= rot(c,4);  \
-  b ^= a; b -= rot(a,14); \
-  c ^= b; c -= rot(b,24); \
-}
-
-/*
---------------------------------------------------------------------
- This works on all machines.  To be useful, it requires
- -- that the key be an array of uint32_t's, and
- -- that the length be the number of uint32_t's in the key
-
- The function hashword() is identical to hashlittle() on little-endian
- machines, and identical to hashbig() on big-endian machines,
- except that the length has to be measured in uint32_ts rather than in
- bytes.  hashlittle() is more complicated than hashword() only because
- hashlittle() has to dance around fitting the key bytes into registers.
---------------------------------------------------------------------
-*/
-uint32_t hashword(
-const uint32_t *k,                   /* the key, an array of uint32_t values */
-size_t          length,               /* the length of the key, in uint32_ts */
-uint32_t        initval)         /* the previous hash, or an arbitrary value */
-{
-  uint32_t a,b,c;
-
-  /* Set up the internal state */
-  a = b = c = 0xdeadbeef + (((uint32_t)length)<<2) + initval;
-
-  /*------------------------------------------------- handle most of the key */
-  while (length > 3)
-  {
-    a += k[0];
-    b += k[1];
-    c += k[2];
-    mix(a,b,c);
-    length -= 3;
-    k += 3;
-  }
-
-  /*------------------------------------------- handle the last 3 uint32_t's */
-  switch(length)                     /* all the case statements fall through */
-  {
-  case 3 : c+=k[2];
-  case 2 : b+=k[1];
-  case 1 : a+=k[0];
-    final(a,b,c);
-  case 0:     /* case 0: nothing left to add */
-    break;
-  }
-  /*------------------------------------------------------ report the result */
-  return c;
-}
-
-
-/*
---------------------------------------------------------------------
-hashword2() -- same as hashword(), but take two seeds and return two
-32-bit values.  pc and pb must both be nonnull, and *pc and *pb must
-both be initialized with seeds.  If you pass in (*pb)==0, the output
-(*pc) will be the same as the return value from hashword().
---------------------------------------------------------------------
-*/
-void hashword2 (
-const uint32_t *k,                   /* the key, an array of uint32_t values */
-size_t          length,               /* the length of the key, in uint32_ts */
-uint32_t       *pc,                      /* IN: seed OUT: primary hash value */
-uint32_t       *pb)               /* IN: more seed OUT: secondary hash value */
-{
-  uint32_t a,b,c;
-
-  /* Set up the internal state */
-  a = b = c = 0xdeadbeef + ((uint32_t)(length<<2)) + *pc;
-  c += *pb;
-
-  /*------------------------------------------------- handle most of the key */
-  while (length > 3)
-  {
-    a += k[0];
-    b += k[1];
-    c += k[2];
-    mix(a,b,c);
-    length -= 3;
-    k += 3;
-  }
-
-  /*------------------------------------------- handle the last 3 uint32_t's */
-  switch(length)                     /* all the case statements fall through */
-  {
-  case 3 : c+=k[2];
-  case 2 : b+=k[1];
-  case 1 : a+=k[0];
-    final(a,b,c);
-  case 0:     /* case 0: nothing left to add */
-    break;
-  }
-  /*------------------------------------------------------ report the result */
-  *pc=c; *pb=b;
-}
-
-
-/*
--------------------------------------------------------------------------------
-hashlittle() -- hash a variable-length key into a 32-bit value
-  k       : the key (the unaligned variable-length array of bytes)
-  length  : the length of the key, counting by bytes
-  initval : can be any 4-byte value
-Returns a 32-bit value.  Every bit of the key affects every bit of
-the return value.  Two keys differing by one or two bits will have
-totally different hash values.
-
-The best hash table sizes are powers of 2.  There is no need to do
-mod a prime (mod is sooo slow!).  If you need less than 32 bits,
-use a bitmask.  For example, if you need only 10 bits, do
-  h = (h & hashmask(10));
-In which case, the hash table should have hashsize(10) elements.
-
-If you are hashing n strings (uint8_t **)k, do it like this:
-  for (i=0, h=0; i<n; ++i) h = hashlittle( k[i], len[i], h);
-
-By Bob Jenkins, 2006.  bob_jenkins at burtleburtle.net.  You may use this
-code any way you wish, private, educational, or commercial.  It's free.
-
-Use for hash table lookup, or anything where one collision in 2^^32 is
-acceptable.  Do NOT use for cryptographic purposes.
--------------------------------------------------------------------------------
-*/
-
-uint32_t hashlittle( const void *key, size_t length, uint32_t initval)
-{
-  uint32_t a,b,c;                                          /* internal state */
-  union { const void *ptr; size_t i; } u;     /* needed for Mac Powerbook G4 */
-
-  /* Set up the internal state */
-  a = b = c = 0xdeadbeef + ((uint32_t)length) + initval;
-
-  u.ptr = key;
-  if (HASH_LITTLE_ENDIAN && ((u.i & 0x3) == 0)) {
-    const uint32_t *k = (const uint32_t *)key;         /* read 32-bit chunks */
-
-    /*------ all but last block: aligned reads and affect 32 bits of (a,b,c) */
-    while (length > 12)
-    {
-      a += k[0];
-      b += k[1];
-      c += k[2];
-      mix(a,b,c);
-      length -= 12;
-      k += 3;
-    }
-
-    /*----------------------------- handle the last (probably partial) block */
-    /*
-     * "k[2]&0xffffff" actually reads beyond the end of the string, but
-     * then masks off the part it's not allowed to read.  Because the
-     * string is aligned, the masked-off tail is in the same word as the
-     * rest of the string.  Every machine with memory protection I've seen
-     * does it on word boundaries, so is OK with this.  But VALGRIND will
-     * still catch it and complain.  The masking trick does make the hash
-     * noticably faster for short strings (like English words).
-     */
-#ifndef VALGRIND
-
-    switch(length)
-    {
-    case 12: c+=k[2]; b+=k[1]; a+=k[0]; break;
-    case 11: c+=k[2]&0xffffff; b+=k[1]; a+=k[0]; break;
-    case 10: c+=k[2]&0xffff; b+=k[1]; a+=k[0]; break;
-    case 9 : c+=k[2]&0xff; b+=k[1]; a+=k[0]; break;
-    case 8 : b+=k[1]; a+=k[0]; break;
-    case 7 : b+=k[1]&0xffffff; a+=k[0]; break;
-    case 6 : b+=k[1]&0xffff; a+=k[0]; break;
-    case 5 : b+=k[1]&0xff; a+=k[0]; break;
-    case 4 : a+=k[0]; break;
-    case 3 : a+=k[0]&0xffffff; break;
-    case 2 : a+=k[0]&0xffff; break;
-    case 1 : a+=k[0]&0xff; break;
-    case 0 : return c;              /* zero length strings require no mixing */
-    }
-
-#else /* make valgrind happy */
-
-    k8 = (const uint8_t *)k;
-    switch(length)
-    {
-    case 12: c+=k[2]; b+=k[1]; a+=k[0]; break;
-    case 11: c+=((uint32_t)k8[10])<<16;  /* fall through */
-    case 10: c+=((uint32_t)k8[9])<<8;    /* fall through */
-    case 9 : c+=k8[8];                   /* fall through */
-    case 8 : b+=k[1]; a+=k[0]; break;
-    case 7 : b+=((uint32_t)k8[6])<<16;   /* fall through */
-    case 6 : b+=((uint32_t)k8[5])<<8;    /* fall through */
-    case 5 : b+=k8[4];                   /* fall through */
-    case 4 : a+=k[0]; break;
-    case 3 : a+=((uint32_t)k8[2])<<16;   /* fall through */
-    case 2 : a+=((uint32_t)k8[1])<<8;    /* fall through */
-    case 1 : a+=k8[0]; break;
-    case 0 : return c;
-    }
-
-#endif /* !valgrind */
-
-  } else if (HASH_LITTLE_ENDIAN && ((u.i & 0x1) == 0)) {
-    const uint16_t *k = (const uint16_t *)key;         /* read 16-bit chunks */
-    const uint8_t  *k8;
-
-    /*--------------- all but last block: aligned reads and different mixing */
-    while (length > 12)
-    {
-      a += k[0] + (((uint32_t)k[1])<<16);
-      b += k[2] + (((uint32_t)k[3])<<16);
-      c += k[4] + (((uint32_t)k[5])<<16);
-      mix(a,b,c);
-      length -= 12;
-      k += 6;
-    }
-
-    /*----------------------------- handle the last (probably partial) block */
-    k8 = (const uint8_t *)k;
-    switch(length)
-    {
-    case 12: c+=k[4]+(((uint32_t)k[5])<<16);
-             b+=k[2]+(((uint32_t)k[3])<<16);
-             a+=k[0]+(((uint32_t)k[1])<<16);
-             break;
-    case 11: c+=((uint32_t)k8[10])<<16;     /* fall through */
-    case 10: c+=k[4];
-             b+=k[2]+(((uint32_t)k[3])<<16);
-             a+=k[0]+(((uint32_t)k[1])<<16);
-             break;
-    case 9 : c+=k8[8];                      /* fall through */
-    case 8 : b+=k[2]+(((uint32_t)k[3])<<16);
-             a+=k[0]+(((uint32_t)k[1])<<16);
-             break;
-    case 7 : b+=((uint32_t)k8[6])<<16;      /* fall through */
-    case 6 : b+=k[2];
-             a+=k[0]+(((uint32_t)k[1])<<16);
-             break;
-    case 5 : b+=k8[4];                      /* fall through */
-    case 4 : a+=k[0]+(((uint32_t)k[1])<<16);
-             break;
-    case 3 : a+=((uint32_t)k8[2])<<16;      /* fall through */
-    case 2 : a+=k[0];
-             break;
-    case 1 : a+=k8[0];
-             break;
-    case 0 : return c;                     /* zero length requires no mixing */
-    }
-
-  } else {                        /* need to read the key one byte at a time */
-    const uint8_t *k = (const uint8_t *)key;
-
-    /*--------------- all but the last block: affect some 32 bits of (a,b,c) */
-    while (length > 12)
-    {
-      a += k[0];
-      a += ((uint32_t)k[1])<<8;
-      a += ((uint32_t)k[2])<<16;
-      a += ((uint32_t)k[3])<<24;
-      b += k[4];
-      b += ((uint32_t)k[5])<<8;
-      b += ((uint32_t)k[6])<<16;
-      b += ((uint32_t)k[7])<<24;
-      c += k[8];
-      c += ((uint32_t)k[9])<<8;
-      c += ((uint32_t)k[10])<<16;
-      c += ((uint32_t)k[11])<<24;
-      mix(a,b,c);
-      length -= 12;
-      k += 12;
-    }
-
-    /*-------------------------------- last block: affect all 32 bits of (c) */
-    switch(length)                   /* all the case statements fall through */
-    {
-    case 12: c+=((uint32_t)k[11])<<24;
-    case 11: c+=((uint32_t)k[10])<<16;
-    case 10: c+=((uint32_t)k[9])<<8;
-    case 9 : c+=k[8];
-    case 8 : b+=((uint32_t)k[7])<<24;
-    case 7 : b+=((uint32_t)k[6])<<16;
-    case 6 : b+=((uint32_t)k[5])<<8;
-    case 5 : b+=k[4];
-    case 4 : a+=((uint32_t)k[3])<<24;
-    case 3 : a+=((uint32_t)k[2])<<16;
-    case 2 : a+=((uint32_t)k[1])<<8;
-    case 1 : a+=k[0];
-             break;
-    case 0 : return c;
-    }
-  }
-
-  final(a,b,c);
-  return c;
-}
-
-
-/*
- * hashlittle2: return 2 32-bit hash values
- *
- * This is identical to hashlittle(), except it returns two 32-bit hash
- * values instead of just one.  This is good enough for hash table
- * lookup with 2^^64 buckets, or if you want a second hash if you're not
- * happy with the first, or if you want a probably-unique 64-bit ID for
- * the key.  *pc is better mixed than *pb, so use *pc first.  If you want
- * a 64-bit value do something like "*pc + (((uint64_t)*pb)<<32)".
- */
-void hashlittle2(
-  const void *key,       /* the key to hash */
-  size_t      length,    /* length of the key */
-  uint32_t   *pc,        /* IN: primary initval, OUT: primary hash */
-  uint32_t   *pb)        /* IN: secondary initval, OUT: secondary hash */
-{
-  uint32_t a,b,c;                                          /* internal state */
-  union { const void *ptr; size_t i; } u;     /* needed for Mac Powerbook G4 */
-
-  /* Set up the internal state */
-  a = b = c = 0xdeadbeef + ((uint32_t)length) + *pc;
-  c += *pb;
-
-  u.ptr = key;
-  if (HASH_LITTLE_ENDIAN && ((u.i & 0x3) == 0)) {
-    const uint32_t *k = (const uint32_t *)key;         /* read 32-bit chunks */
-
-    /*------ all but last block: aligned reads and affect 32 bits of (a,b,c) */
-    while (length > 12)
-    {
-      a += k[0];
-      b += k[1];
-      c += k[2];
-      mix(a,b,c);
-      length -= 12;
-      k += 3;
-    }
-
-    /*----------------------------- handle the last (probably partial) block */
-    /*
-     * "k[2]&0xffffff" actually reads beyond the end of the string, but
-     * then masks off the part it's not allowed to read.  Because the
-     * string is aligned, the masked-off tail is in the same word as the
-     * rest of the string.  Every machine with memory protection I've seen
-     * does it on word boundaries, so is OK with this.  But VALGRIND will
-     * still catch it and complain.  The masking trick does make the hash
-     * noticably faster for short strings (like English words).
-     */
-#ifndef VALGRIND
-
-    switch(length)
-    {
-    case 12: c+=k[2]; b+=k[1]; a+=k[0]; break;
-    case 11: c+=k[2]&0xffffff; b+=k[1]; a+=k[0]; break;
-    case 10: c+=k[2]&0xffff; b+=k[1]; a+=k[0]; break;
-    case 9 : c+=k[2]&0xff; b+=k[1]; a+=k[0]; break;
-    case 8 : b+=k[1]; a+=k[0]; break;
-    case 7 : b+=k[1]&0xffffff; a+=k[0]; break;
-    case 6 : b+=k[1]&0xffff; a+=k[0]; break;
-    case 5 : b+=k[1]&0xff; a+=k[0]; break;
-    case 4 : a+=k[0]; break;
-    case 3 : a+=k[0]&0xffffff; break;
-    case 2 : a+=k[0]&0xffff; break;
-    case 1 : a+=k[0]&0xff; break;
-    case 0 : *pc=c; *pb=b; return;  /* zero length strings require no mixing */
-    }
-
-#else /* make valgrind happy */
-
-    k8 = (const uint8_t *)k;
-    switch(length)
-    {
-    case 12: c+=k[2]; b+=k[1]; a+=k[0]; break;
-    case 11: c+=((uint32_t)k8[10])<<16;  /* fall through */
-    case 10: c+=((uint32_t)k8[9])<<8;    /* fall through */
-    case 9 : c+=k8[8];                   /* fall through */
-    case 8 : b+=k[1]; a+=k[0]; break;
-    case 7 : b+=((uint32_t)k8[6])<<16;   /* fall through */
-    case 6 : b+=((uint32_t)k8[5])<<8;    /* fall through */
-    case 5 : b+=k8[4];                   /* fall through */
-    case 4 : a+=k[0]; break;
-    case 3 : a+=((uint32_t)k8[2])<<16;   /* fall through */
-    case 2 : a+=((uint32_t)k8[1])<<8;    /* fall through */
-    case 1 : a+=k8[0]; break;
-    case 0 : *pc=c; *pb=b; return;  /* zero length strings require no mixing */
-    }
-
-#endif /* !valgrind */
-
-  } else if (HASH_LITTLE_ENDIAN && ((u.i & 0x1) == 0)) {
-    const uint16_t *k = (const uint16_t *)key;         /* read 16-bit chunks */
-    const uint8_t  *k8;
-
-    /*--------------- all but last block: aligned reads and different mixing */
-    while (length > 12)
-    {
-      a += k[0] + (((uint32_t)k[1])<<16);
-      b += k[2] + (((uint32_t)k[3])<<16);
-      c += k[4] + (((uint32_t)k[5])<<16);
-      mix(a,b,c);
-      length -= 12;
-      k += 6;
-    }
-
-    /*----------------------------- handle the last (probably partial) block */
-    k8 = (const uint8_t *)k;
-    switch(length)
-    {
-    case 12: c+=k[4]+(((uint32_t)k[5])<<16);
-             b+=k[2]+(((uint32_t)k[3])<<16);
-             a+=k[0]+(((uint32_t)k[1])<<16);
-             break;
-    case 11: c+=((uint32_t)k8[10])<<16;     /* fall through */
-    case 10: c+=k[4];
-             b+=k[2]+(((uint32_t)k[3])<<16);
-             a+=k[0]+(((uint32_t)k[1])<<16);
-             break;
-    case 9 : c+=k8[8];                      /* fall through */
-    case 8 : b+=k[2]+(((uint32_t)k[3])<<16);
-             a+=k[0]+(((uint32_t)k[1])<<16);
-             break;
-    case 7 : b+=((uint32_t)k8[6])<<16;      /* fall through */
-    case 6 : b+=k[2];
-             a+=k[0]+(((uint32_t)k[1])<<16);
-             break;
-    case 5 : b+=k8[4];                      /* fall through */
-    case 4 : a+=k[0]+(((uint32_t)k[1])<<16);
-             break;
-    case 3 : a+=((uint32_t)k8[2])<<16;      /* fall through */
-    case 2 : a+=k[0];
-             break;
-    case 1 : a+=k8[0];
-             break;
-    case 0 : *pc=c; *pb=b; return;  /* zero length strings require no mixing */
-    }
-
-  } else {                        /* need to read the key one byte at a time */
-    const uint8_t *k = (const uint8_t *)key;
-
-    /*--------------- all but the last block: affect some 32 bits of (a,b,c) */
-    while (length > 12)
-    {
-      a += k[0];
-      a += ((uint32_t)k[1])<<8;
-      a += ((uint32_t)k[2])<<16;
-      a += ((uint32_t)k[3])<<24;
-      b += k[4];
-      b += ((uint32_t)k[5])<<8;
-      b += ((uint32_t)k[6])<<16;
-      b += ((uint32_t)k[7])<<24;
-      c += k[8];
-      c += ((uint32_t)k[9])<<8;
-      c += ((uint32_t)k[10])<<16;
-      c += ((uint32_t)k[11])<<24;
-      mix(a,b,c);
-      length -= 12;
-      k += 12;
-    }
-
-    /*-------------------------------- last block: affect all 32 bits of (c) */
-    switch(length)                   /* all the case statements fall through */
-    {
-    case 12: c+=((uint32_t)k[11])<<24;
-    case 11: c+=((uint32_t)k[10])<<16;
-    case 10: c+=((uint32_t)k[9])<<8;
-    case 9 : c+=k[8];
-    case 8 : b+=((uint32_t)k[7])<<24;
-    case 7 : b+=((uint32_t)k[6])<<16;
-    case 6 : b+=((uint32_t)k[5])<<8;
-    case 5 : b+=k[4];
-    case 4 : a+=((uint32_t)k[3])<<24;
-    case 3 : a+=((uint32_t)k[2])<<16;
-    case 2 : a+=((uint32_t)k[1])<<8;
-    case 1 : a+=k[0];
-             break;
-    case 0 : *pc=c; *pb=b; return;  /* zero length strings require no mixing */
-    }
-  }
-
-  final(a,b,c);
-  *pc=c; *pb=b;
-}
-
-
-
-/*
- * hashbig():
- * This is the same as hashword() on big-endian machines.  It is different
- * from hashlittle() on all machines.  hashbig() takes advantage of
- * big-endian byte ordering.
- */
-uint32_t hashbig( const void *key, size_t length, uint32_t initval)
-{
-  uint32_t a,b,c;
-  union { const void *ptr; size_t i; } u; /* to cast key to (size_t) happily */
-
-  /* Set up the internal state */
-  a = b = c = 0xdeadbeef + ((uint32_t)length) + initval;
-
-  u.ptr = key;
-  if (HASH_BIG_ENDIAN && ((u.i & 0x3) == 0)) {
-    const uint32_t *k = (const uint32_t *)key;         /* read 32-bit chunks */
-
-    /*------ all but last block: aligned reads and affect 32 bits of (a,b,c) */
-    while (length > 12)
-    {
-      a += k[0];
-      b += k[1];
-      c += k[2];
-      mix(a,b,c);
-      length -= 12;
-      k += 3;
-    }
-
-    /*----------------------------- handle the last (probably partial) block */
-    /*
-     * "k[2]<<8" actually reads beyond the end of the string, but
-     * then shifts out the part it's not allowed to read.  Because the
-     * string is aligned, the illegal read is in the same word as the
-     * rest of the string.  Every machine with memory protection I've seen
-     * does it on word boundaries, so is OK with this.  But VALGRIND will
-     * still catch it and complain.  The masking trick does make the hash
-     * noticably faster for short strings (like English words).
-     */
-#ifndef VALGRIND
-
-    switch(length)
-    {
-    case 12: c+=k[2]; b+=k[1]; a+=k[0]; break;
-    case 11: c+=k[2]&0xffffff00; b+=k[1]; a+=k[0]; break;
-    case 10: c+=k[2]&0xffff0000; b+=k[1]; a+=k[0]; break;
-    case 9 : c+=k[2]&0xff000000; b+=k[1]; a+=k[0]; break;
-    case 8 : b+=k[1]; a+=k[0]; break;
-    case 7 : b+=k[1]&0xffffff00; a+=k[0]; break;
-    case 6 : b+=k[1]&0xffff0000; a+=k[0]; break;
-    case 5 : b+=k[1]&0xff000000; a+=k[0]; break;
-    case 4 : a+=k[0]; break;
-    case 3 : a+=k[0]&0xffffff00; break;
-    case 2 : a+=k[0]&0xffff0000; break;
-    case 1 : a+=k[0]&0xff000000; break;
-    case 0 : return c;              /* zero length strings require no mixing */
-    }
-
-#else  /* make valgrind happy */
-
-    k8 = (const uint8_t *)k;
-    switch(length)                   /* all the case statements fall through */
-    {
-    case 12: c+=k[2]; b+=k[1]; a+=k[0]; break;
-    case 11: c+=((uint32_t)k8[10])<<8;  /* fall through */
-    case 10: c+=((uint32_t)k8[9])<<16;  /* fall through */
-    case 9 : c+=((uint32_t)k8[8])<<24;  /* fall through */
-    case 8 : b+=k[1]; a+=k[0]; break;
-    case 7 : b+=((uint32_t)k8[6])<<8;   /* fall through */
-    case 6 : b+=((uint32_t)k8[5])<<16;  /* fall through */
-    case 5 : b+=((uint32_t)k8[4])<<24;  /* fall through */
-    case 4 : a+=k[0]; break;
-    case 3 : a+=((uint32_t)k8[2])<<8;   /* fall through */
-    case 2 : a+=((uint32_t)k8[1])<<16;  /* fall through */
-    case 1 : a+=((uint32_t)k8[0])<<24; break;
-    case 0 : return c;
-    }
-
-#endif /* !VALGRIND */
-
-  } else {                        /* need to read the key one byte at a time */
-    const uint8_t *k = (const uint8_t *)key;
-
-    /*--------------- all but the last block: affect some 32 bits of (a,b,c) */
-    while (length > 12)
-    {
-      a += ((uint32_t)k[0])<<24;
-      a += ((uint32_t)k[1])<<16;
-      a += ((uint32_t)k[2])<<8;
-      a += ((uint32_t)k[3]);
-      b += ((uint32_t)k[4])<<24;
-      b += ((uint32_t)k[5])<<16;
-      b += ((uint32_t)k[6])<<8;
-      b += ((uint32_t)k[7]);
-      c += ((uint32_t)k[8])<<24;
-      c += ((uint32_t)k[9])<<16;
-      c += ((uint32_t)k[10])<<8;
-      c += ((uint32_t)k[11]);
-      mix(a,b,c);
-      length -= 12;
-      k += 12;
-    }
-
-    /*-------------------------------- last block: affect all 32 bits of (c) */
-    switch(length)                   /* all the case statements fall through */
-    {
-    case 12: c+=k[11];
-    case 11: c+=((uint32_t)k[10])<<8;
-    case 10: c+=((uint32_t)k[9])<<16;
-    case 9 : c+=((uint32_t)k[8])<<24;
-    case 8 : b+=k[7];
-    case 7 : b+=((uint32_t)k[6])<<8;
-    case 6 : b+=((uint32_t)k[5])<<16;
-    case 5 : b+=((uint32_t)k[4])<<24;
-    case 4 : a+=k[3];
-    case 3 : a+=((uint32_t)k[2])<<8;
-    case 2 : a+=((uint32_t)k[1])<<16;
-    case 1 : a+=((uint32_t)k[0])<<24;
-             break;
-    case 0 : return c;
-    }
-  }
-
-  final(a,b,c);
-  return c;
-}
diff --git a/Common/HashFunction.h b/Common/HashFunction.h
index 97cc7a9..dae96fc 100644
--- a/Common/HashFunction.h
+++ b/Common/HashFunction.h
@@ -1,9 +1,13 @@
 #ifndef HASHFUNCTION_H
 #define HASHFUNCTION_H 1
 
+#include "city.h"
 #include <stddef.h>
 #include <stdint.h>
 
-uint32_t hashlittle(const void *key, size_t length, uint32_t initval);
+static inline uint64_t hashmem(const void *p, size_t n)
+{
+	return CityHash64(static_cast<const char*>(p), n);
+}
 
 #endif
diff --git a/Common/Histogram.h b/Common/Histogram.h
index f0acafd..da61a6f 100644
--- a/Common/Histogram.h
+++ b/Common/Histogram.h
@@ -132,7 +132,7 @@ class Histogram
 	/** Return the specified percentile. */
 	T percentile(float p) const
 	{
-		size_type x = ceil(p * size());
+		size_type x = (size_type)ceil(p * size());
 		size_type n = 0;
 		for (Map::const_iterator it = m_map.begin();
 				it != m_map.end(); ++it) {
@@ -152,7 +152,7 @@ class Histogram
 	/** Return the specified weighted percentile. */
 	T weightedPercentile(float p) const
 	{
-		accumulator x = ceil(p * sum());
+		accumulator x = (accumulator)ceil(p * sum());
 		accumulator total = 0;
 		for (Map::const_iterator it = m_map.begin();
 				it != m_map.end(); ++it) {
diff --git a/Common/IOUtil.h b/Common/IOUtil.h
index 653d142..c836723 100644
--- a/Common/IOUtil.h
+++ b/Common/IOUtil.h
@@ -86,12 +86,24 @@ static inline void readFile(const char* path, Vector& s)
 	std::ifstream in(path);
 	assert_good(in, path);
 	in.seekg(0, std::ios::end);
-	s.resize(in.tellg());
+	ssize_t n = in.tellg();
+	assert(n > 0);
+	s.resize(n);
 	in.seekg(0, std::ios::beg);
 	assert_good(in, path);
-	in.read(reinterpret_cast<char*>(&s[0]), s.size());
+	char *p = reinterpret_cast<char*>(&s[0]);
+#if __MACH__
+	// Read 1 GB at a time. Reads of 2 GB or more fail.
+	const ssize_t N = 1024 * 1024 * 1024;
+	for (; n > N; n -= N, p += N) {
+		in.read(p, N);
+		assert_good(in, path);
+		assert(in.gcount() == N);
+	}
+#endif
+	in.read(p, n);
 	assert_good(in, path);
-	assert((size_t)in.gcount() == s.size());
+	assert(in.gcount() == n);
 }
 
 #endif
diff --git a/Common/Iterator.h b/Common/Iterator.h
index f191ef6..b9d4979 100644
--- a/Common/Iterator.h
+++ b/Common/Iterator.h
@@ -3,6 +3,36 @@
 
 #include <iterator>
 
+/** A counting output iterator. */
+class CountingOutputIterator
+{
+  public:
+    explicit CountingOutputIterator(size_t& count) : m_count(count)
+	{
+		m_count = 0;
+	}
+
+	CountingOutputIterator& operator++()
+	{
+		++m_count;
+		return *this;
+	}
+
+    CountingOutputIterator& operator*()
+	{
+		return *this;
+	}
+
+	template<typename T>
+	CountingOutputIterator& operator=(const T&)
+	{
+		return *this;
+	}
+
+  private:
+    size_t& m_count;
+};
+
 /** An output stream iterator, like ostream_iterator, that outputs the
  * a delimiter before and after the item.
  */
diff --git a/Common/Kmer.cpp b/Common/Kmer.cpp
index 4317c53..c86efa4 100644
--- a/Common/Kmer.cpp
+++ b/Common/Kmer.cpp
@@ -63,7 +63,7 @@ size_t Kmer::getHashCode() const
 {
 	// Hash numbytes - 1 to avoid getting different hash values for
 	// the same sequence for n % 4 != 0 sequences.
-	return hashlittle(m_seq, bytes() - 1, 131);
+	return hashmem(m_seq, bytes() - 1);
 }
 
 /** Return the string representation of this sequence. */
diff --git a/Common/Kmer.h b/Common/Kmer.h
index 8dc5b52..6dcedba 100644
--- a/Common/Kmer.h
+++ b/Common/Kmer.h
@@ -52,14 +52,6 @@ class Kmer
 
 	void reverseComplement();
 
-	/** Return the reverse complement of this k-mer. */
-	Kmer operator~() const
-	{
-		Kmer rc(*this);
-		rc.reverseComplement();
-		return rc;
-	}
-
 	bool isPalindrome() const;
 	bool isPalindrome(extDirection dir) const;
 	void setLastBase(extDirection dir, uint8_t base);
@@ -125,7 +117,9 @@ class Kmer
 /** Return the reverse complement of the specified k-mer. */
 static inline Kmer reverseComplement(const Kmer& seq)
 {
-	return ~seq;
+	Kmer rc(seq);
+	rc.reverseComplement();
+	return rc;
 }
 
 struct hashKmer
diff --git a/Common/Makefile.am b/Common/Makefile.am
index 45e2f2c..08e409d 100644
--- a/Common/Makefile.am
+++ b/Common/Makefile.am
@@ -15,7 +15,7 @@ libcommon_a_SOURCES = \
 	Estimate.h \
 	Fcontrol.cpp Fcontrol.h \
 	Functional.h \
-	HashFunction.cpp HashFunction.h \
+	HashFunction.h \
 	Histogram.cpp Histogram.h \
 	IOUtil.h \
 	Iterator.h \
@@ -33,4 +33,6 @@ libcommon_a_SOURCES = \
 	SuffixArray.h \
 	Timer.cpp Timer.h \
 	Uncompress.cpp Uncompress.h \
-	UnorderedMap.h
+	UnorderedMap.h \
+	cholesky.hpp \
+	city.cc city.h
diff --git a/Common/Makefile.in b/Common/Makefile.in
index d025d3f..0925a35 100644
--- a/Common/Makefile.in
+++ b/Common/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# Makefile.in generated by automake 1.12 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -16,6 +16,23 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -33,7 +50,8 @@ NORMAL_UNINSTALL = :
 PRE_UNINSTALL = :
 POST_UNINSTALL = :
 subdir = Common
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -48,13 +66,13 @@ ARFLAGS = cru
 libcommon_a_AR = $(AR) $(ARFLAGS)
 libcommon_a_LIBADD =
 am_libcommon_a_OBJECTS = libcommon_a-ContigID.$(OBJEXT) \
-	libcommon_a-Fcontrol.$(OBJEXT) \
-	libcommon_a-HashFunction.$(OBJEXT) \
-	libcommon_a-Histogram.$(OBJEXT) libcommon_a-Kmer.$(OBJEXT) \
-	libcommon_a-Log.$(OBJEXT) libcommon_a-Options.$(OBJEXT) \
-	libcommon_a-SeqExt.$(OBJEXT) libcommon_a-Sequence.$(OBJEXT) \
+	libcommon_a-Fcontrol.$(OBJEXT) libcommon_a-Histogram.$(OBJEXT) \
+	libcommon_a-Kmer.$(OBJEXT) libcommon_a-Log.$(OBJEXT) \
+	libcommon_a-Options.$(OBJEXT) libcommon_a-SeqExt.$(OBJEXT) \
+	libcommon_a-Sequence.$(OBJEXT) \
 	libcommon_a-SignalHandler.$(OBJEXT) \
-	libcommon_a-Timer.$(OBJEXT) libcommon_a-Uncompress.$(OBJEXT)
+	libcommon_a-Timer.$(OBJEXT) libcommon_a-Uncompress.$(OBJEXT) \
+	libcommon_a-city.$(OBJEXT)
 libcommon_a_OBJECTS = $(am_libcommon_a_OBJECTS)
 DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)
 depcomp = $(SHELL) $(top_srcdir)/depcomp
@@ -71,6 +89,11 @@ CCLD = $(CC)
 LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
 SOURCES = $(libcommon_a_SOURCES)
 DIST_SOURCES = $(libcommon_a_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -184,7 +207,7 @@ libcommon_a_SOURCES = \
 	Estimate.h \
 	Fcontrol.cpp Fcontrol.h \
 	Functional.h \
-	HashFunction.cpp HashFunction.h \
+	HashFunction.h \
 	Histogram.cpp Histogram.h \
 	IOUtil.h \
 	Iterator.h \
@@ -202,12 +225,14 @@ libcommon_a_SOURCES = \
 	SuffixArray.h \
 	Timer.cpp Timer.h \
 	Uncompress.cpp Uncompress.h \
-	UnorderedMap.h
+	UnorderedMap.h \
+	cholesky.hpp \
+	city.cc city.h
 
 all: all-am
 
 .SUFFIXES:
-.SUFFIXES: .cpp .o .obj
+.SUFFIXES: .cc .cpp .o .obj
 $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	@for dep in $?; do \
 	  case '$(am__configure_deps)' in \
@@ -254,7 +279,6 @@ distclean-compile:
 
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libcommon_a-ContigID.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libcommon_a-Fcontrol.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libcommon_a-HashFunction.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libcommon_a-Histogram.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libcommon_a-Kmer.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libcommon_a-Log.Po at am__quote@
@@ -264,15 +288,16 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libcommon_a-SignalHandler.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libcommon_a-Timer.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libcommon_a-Uncompress.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libcommon_a-city.Po at am__quote@
 
-.cpp.o:
+.cc.o:
 @am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
 @am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
 
-.cpp.obj:
+.cc.obj:
 @am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
 @am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@@ -307,20 +332,6 @@ libcommon_a-Fcontrol.obj: Fcontrol.cpp
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcommon_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libcommon_a-Fcontrol.obj `if test -f 'Fcontrol.cpp'; then $(CYGPATH_W) 'Fcontrol.cpp'; else $(CYGPATH_W) '$(srcdir)/Fcontrol.cpp'; fi`
 
-libcommon_a-HashFunction.o: HashFunction.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcommon_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libcommon_a-HashFunction.o -MD -MP -MF $(DEPDIR)/libcommon_a-HashFunction.Tpo -c -o libcommon_a-HashFunction.o `test -f 'HashFunction.cpp' || echo '$(srcdir)/'`HashFunction.cpp
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/libcommon_a-HashFunction.Tpo $(DEPDIR)/libcommon_a-HashFunction.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='HashFunction.cpp' object='libcommon_a-HashFunction.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcommon_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libcommon_a-HashFunction.o `test -f 'HashFunction.cpp' || echo '$(srcdir)/'`HashFunction.cpp
-
-libcommon_a-HashFunction.obj: HashFunction.cpp
- at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcommon_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libcommon_a-HashFunction.obj -MD -MP -MF $(DEPDIR)/libcommon_a-HashFunction.Tpo -c -o libcommon_a-HashFunction.obj `if test -f 'HashFunction.cpp'; then $(CYGPATH_W) 'HashFunction.cpp'; else $(CYGPATH_W) '$(srcdir)/HashFunction.cpp'; fi`
- at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/libcommon_a-HashFunction.Tpo $(DEPDIR)/libcommon_a-HashFunction.Po
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='HashFunction.cpp' object='libcommon_a-HashFunction.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcommon_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libcommon_a-HashFunction.obj `if test -f 'HashFunction.cpp'; then $(CYGPATH_W) 'HashFunction.cpp'; else $(CYGPATH_W) '$(srcdir)/HashFunction.cpp'; fi`
-
 libcommon_a-Histogram.o: Histogram.cpp
 @am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcommon_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libcommon_a-Histogram.o -MD -MP -MF $(DEPDIR)/libcommon_a-Histogram.Tpo -c -o libcommon_a-Histogram.o `test -f 'Histogram.cpp' || echo '$(srcdir)/'`Histogram.cpp
 @am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/libcommon_a-Histogram.Tpo $(DEPDIR)/libcommon_a-Histogram.Po
@@ -447,6 +458,34 @@ libcommon_a-Uncompress.obj: Uncompress.cpp
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcommon_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libcommon_a-Uncompress.obj `if test -f 'Uncompress.cpp'; then $(CYGPATH_W) 'Uncompress.cpp'; else $(CYGPATH_W) '$(srcdir)/Uncompress.cpp'; fi`
 
+libcommon_a-city.o: city.cc
+ at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcommon_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libcommon_a-city.o -MD -MP -MF $(DEPDIR)/libcommon_a-city.Tpo -c -o libcommon_a-city.o `test -f 'city.cc' || echo '$(srcdir)/'`city.cc
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/libcommon_a-city.Tpo $(DEPDIR)/libcommon_a-city.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='city.cc' object='libcommon_a-city.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcommon_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libcommon_a-city.o `test -f 'city.cc' || echo '$(srcdir)/'`city.cc
+
+libcommon_a-city.obj: city.cc
+ at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcommon_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libcommon_a-city.obj -MD -MP -MF $(DEPDIR)/libcommon_a-city.Tpo -c -o libcommon_a-city.obj `if test -f 'city.cc'; then $(CYGPATH_W) 'city.cc'; else $(CYGPATH_W) '$(srcdir)/city.cc'; fi`
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/libcommon_a-city.Tpo $(DEPDIR)/libcommon_a-city.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='city.cc' object='libcommon_a-city.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libcommon_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libcommon_a-city.obj `if test -f 'city.cc'; then $(CYGPATH_W) 'city.cc'; else $(CYGPATH_W) '$(srcdir)/city.cc'; fi`
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
 	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
 	unique=`for i in $$list; do \
@@ -496,6 +535,20 @@ GTAGS:
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
 
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
@@ -635,14 +688,14 @@ uninstall-am:
 .MAKE: install-am install-strip
 
 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-noinstLIBRARIES ctags distclean distclean-compile \
-	distclean-generic distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-data \
-	install-data-am install-dvi install-dvi-am install-exec \
-	install-exec-am install-html install-html-am install-info \
-	install-info-am install-man install-pdf install-pdf-am \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
+	clean-noinstLIBRARIES cscopelist ctags distclean \
+	distclean-compile distclean-generic distclean-tags distdir dvi \
+	dvi-am html html-am info info-am install install-am \
+	install-data install-data-am install-dvi install-dvi-am \
+	install-exec install-exec-am install-html install-html-am \
+	install-info install-info-am install-man install-pdf \
+	install-pdf-am install-ps install-ps-am install-strip \
+	installcheck installcheck-am installdirs maintainer-clean \
 	maintainer-clean-generic mostlyclean mostlyclean-compile \
 	mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
 	uninstall-am
diff --git a/Common/Options.cpp b/Common/Options.cpp
index 614430e..f0a2d2d 100644
--- a/Common/Options.cpp
+++ b/Common/Options.cpp
@@ -12,7 +12,4 @@ namespace opt {
 
 	/** Verbose output */
 	int verbose;
-
-	/** The acceptable error of a distance estimate. */
-	unsigned distanceError = 6;
 }
diff --git a/Common/PMF.h b/Common/PMF.h
index 6be9891..b497af7 100644
--- a/Common/PMF.h
+++ b/Common/PMF.h
@@ -14,7 +14,7 @@ class PMF
   public:
 	/** Construct a PMF from a histogram. */
 	PMF(const Histogram& h)
-		: m_dist(h.maximum() + 1), m_stdDev(h.sd())
+		: m_dist(h.maximum() + 1), m_mean(h.mean()), m_stdDev(h.sd())
 	{
 		unsigned count = h.size();
 		m_minp = (double)1 / count;
@@ -43,6 +43,12 @@ class PMF
 		return m_dist.size() - 1;
 	}
 
+	/** Return the mean of this distribution. */
+	double mean() const { return m_mean; }
+
+	/** Return the standard deviation of the sampled mean
+	 * of n observations.
+	 */
 	double getSampleStdDev(unsigned n) const
 	{
 		return m_stdDev / sqrt(n);
@@ -50,6 +56,7 @@ class PMF
 
   private:
 	std::vector<double> m_dist;
+	double m_mean;
 	double m_stdDev;
 	double m_minp;
 };
diff --git a/Common/Uncompress.cpp b/Common/Uncompress.cpp
index d6241a9..fcbc4ed 100644
--- a/Common/Uncompress.cpp
+++ b/Common/Uncompress.cpp
@@ -39,6 +39,7 @@ static const char* zcatExec(const string& path)
 		endsWith(path, ".gz") ? "gunzip -c" :
 		endsWith(path, ".bz2") ? "bunzip2 -c" :
 		endsWith(path, ".xz") ? "xzdec -c" :
+		endsWith(path, ".zip") ? "unzip -p" :
 		endsWith(path, ".bam") ? "samtools view -h" :
 		endsWith(path, ".jf") ? "jellyfish dump" :
 		endsWith(path, ".jfq") ? "jellyfish qdump" :
diff --git a/Common/cholesky.hpp b/Common/cholesky.hpp
new file mode 100644
index 0000000..c7c0c6d
--- /dev/null
+++ b/Common/cholesky.hpp
@@ -0,0 +1,230 @@
+/** -*- c++ -*- \file cholesky.hpp \brief cholesky decomposition */
+/*
+ -   begin                : 2005-08-24
+ -   copyright            : (C) 2005 by Gunter Winkler, Konstantin Kutzkow
+ -   email                : guwi17 at gmx.de
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+*/
+
+#ifndef _H_CHOLESKY_HPP_
+#define _H_CHOLESKY_HPP_
+
+
+#include <cassert>
+
+#include <boost/numeric/ublas/vector.hpp>
+#include <boost/numeric/ublas/vector_proxy.hpp>
+
+#include <boost/numeric/ublas/matrix.hpp>
+#include <boost/numeric/ublas/matrix_proxy.hpp>
+
+#include <boost/numeric/ublas/vector_expression.hpp>
+#include <boost/numeric/ublas/matrix_expression.hpp>
+
+#include <boost/numeric/ublas/triangular.hpp>
+
+namespace ublas = boost::numeric::ublas;
+
+
+/** \brief decompose the symmetric positive definit matrix A into product L L^T.
+ *
+ * \param MATRIX type of input matrix
+ * \param TRIA type of lower triangular output matrix
+ * \param A square symmetric positive definite input matrix (only the lower triangle is accessed)
+ * \param L lower triangular output matrix
+ * \return nonzero if decompositon fails (the value ist 1 + the numer of the failing row)
+ */
+template < class MATRIX, class TRIA >
+size_t cholesky_decompose(const MATRIX& A, TRIA& L)
+{
+  using namespace ublas;
+
+  typedef typename MATRIX::value_type T;
+
+  assert( A.size1() == A.size2() );
+  assert( A.size1() == L.size1() );
+  assert( A.size2() == L.size2() );
+
+  const size_t n = A.size1();
+
+  for (size_t k=0 ; k < n; k++) {
+
+    double qL_kk = A(k,k) - inner_prod( project( row(L, k), range(0, k) ),
+                                        project( row(L, k), range(0, k) ) );
+
+    if (qL_kk <= 0) {
+      return 1 + k;
+    } else {
+      double L_kk = sqrt( qL_kk );
+      L(k,k) = L_kk;
+
+      matrix_column<TRIA> cLk(L, k);
+      project( cLk, range(k+1, n) )
+        = ( project( column(A, k), range(k+1, n) )
+            - prod( project(L, range(k+1, n), range(0, k)),
+                    project(row(L, k), range(0, k) ) ) ) / L_kk;
+    }
+  }
+  return 0;
+}
+
+
+/** \brief decompose the symmetric positive definit matrix A into product L L^T.
+ *
+ * \param MATRIX type of matrix A
+ * \param A input: square symmetric positive definite matrix (only the lower triangle is accessed)
+ * \param A output: the lower triangle of A is replaced by the cholesky factor
+ * \return nonzero if decompositon fails (the value ist 1 + the numer of the failing row)
+ */
+template < class MATRIX >
+size_t cholesky_decompose(MATRIX& A)
+{
+  using namespace ublas;
+
+  typedef typename MATRIX::value_type T;
+
+  const MATRIX& A_c(A);
+
+  const size_t n = A.size1();
+
+  for (size_t k=0 ; k < n; k++) {
+
+    double qL_kk = A_c(k,k) - inner_prod( project( row(A_c, k), range(0, k) ),
+                                          project( row(A_c, k), range(0, k) ) );
+
+    if (qL_kk <= 0) {
+      return 1 + k;
+    } else {
+      double L_kk = sqrt( qL_kk );
+
+      matrix_column<MATRIX> cLk(A, k);
+      project( cLk, range(k+1, n) )
+        = ( project( column(A_c, k), range(k+1, n) )
+            - prod( project(A_c, range(k+1, n), range(0, k)),
+                    project(row(A_c, k), range(0, k) ) ) ) / L_kk;
+      A(k,k) = L_kk;
+    }
+  }
+  return 0;
+}
+
+#if 0
+  using namespace ublas;
+
+    // Operations:
+    //  n * (n - 1) / 2 + n = n * (n + 1) / 2 multiplications,
+    //  n * (n - 1) / 2 additions
+
+    // Dense (proxy) case
+    template<class E1, class E2>
+    void inplace_solve (const matrix_expression<E1> &e1, vector_expression<E2> &e2,
+                        lower_tag, column_major_tag) {
+      std::cout << " is_lc ";
+        typedef typename E2::size_type size_type;
+        typedef typename E2::difference_type difference_type;
+        typedef typename E2::value_type value_type;
+
+        BOOST_UBLAS_CHECK (e1 ().size1 () == e1 ().size2 (), bad_size ());
+        BOOST_UBLAS_CHECK (e1 ().size2 () == e2 ().size (), bad_size ());
+        size_type size = e2 ().size ();
+        for (size_type n = 0; n < size; ++ n) {
+#ifndef BOOST_UBLAS_SINGULAR_CHECK
+            BOOST_UBLAS_CHECK (e1 () (n, n) != value_type/*zero*/(), singular ());
+#else
+            if (e1 () (n, n) == value_type/*zero*/())
+                singular ().raise ();
+#endif
+            value_type t = e2 () (n) / e1 () (n, n);
+            e2 () (n) = t;
+            if (t != value_type/*zero*/()) {
+              project( e2 (), range(n+1, size) )
+                .minus_assign( t * project( column( e1 (), n), range(n+1, size) ) );
+            }
+        }
+    }
+#endif
+
+
+
+
+
+/** \brief decompose the symmetric positive definit matrix A into product L L^T.
+ *
+ * \param MATRIX type of matrix A
+ * \param A input: square symmetric positive definite matrix (only the lower triangle is accessed)
+ * \param A output: the lower triangle of A is replaced by the cholesky factor
+ * \return nonzero if decompositon fails (the value ist 1 + the numer of the failing row)
+ */
+template < class MATRIX >
+size_t incomplete_cholesky_decompose(MATRIX& A)
+{
+  using namespace ublas;
+
+  typedef typename MATRIX::value_type T;
+
+  // read access to a const matrix is faster
+  const MATRIX& A_c(A);
+
+  const size_t n = A.size1();
+
+  for (size_t k=0 ; k < n; k++) {
+
+    double qL_kk = A_c(k,k) - inner_prod( project( row( A_c, k ), range(0, k) ),
+                                          project( row( A_c, k ), range(0, k) ) );
+
+    if (qL_kk <= 0) {
+      return 1 + k;
+    } else {
+      double L_kk = sqrt( qL_kk );
+
+      // aktualisieren
+      for (size_t i = k+1; i < A.size1(); ++i) {
+        T* Aik = A.find_element(i, k);
+
+        if (Aik != 0) {
+          *Aik = ( *Aik - inner_prod( project( row( A_c, k ), range(0, k) ),
+                                      project( row( A_c, i ), range(0, k) ) ) ) / L_kk;
+        }
+      }
+
+      A(k,k) = L_kk;
+    }
+  }
+
+  return 0;
+}
+
+
+
+
+/** \brief solve system L L^T x = b inplace
+ *
+ * \param L a triangular matrix
+ * \param x input: right hand side b; output: solution x
+ */
+template < class TRIA, class VEC >
+void
+cholesky_solve(const TRIA& L, VEC& x, ublas::lower)
+{
+  using namespace ublas;
+//   ::inplace_solve(L, x, lower_tag(), typename TRIA::orientation_category () );
+  inplace_solve(L, x, lower_tag() );
+  inplace_solve(trans(L), x, upper_tag());
+}
+
+
+#endif
diff --git a/Common/city.cc b/Common/city.cc
new file mode 100644
index 0000000..b5fd2d2
--- /dev/null
+++ b/Common/city.cc
@@ -0,0 +1,467 @@
+// Copyright (c) 2011 Google, Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+// CityHash, by Geoff Pike and Jyrki Alakuijala
+//
+// This file provides CityHash64() and related functions.
+//
+// It's probably possible to create even faster hash functions by
+// writing a program that systematically explores some of the space of
+// possible hash functions, by using SIMD instructions, or by
+// compromising on hash quality.
+
+#include "config.h"
+#include <city.h>
+
+#include <algorithm>
+#include <string.h>  // for memcpy and memset
+
+using namespace std;
+
+static uint64 UNALIGNED_LOAD64(const char *p) {
+  uint64 result;
+  memcpy(&result, p, sizeof(result));
+  return result;
+}
+
+static uint32 UNALIGNED_LOAD32(const char *p) {
+  uint32 result;
+  memcpy(&result, p, sizeof(result));
+  return result;
+}
+
+#if !defined(WORDS_BIGENDIAN)
+
+#define uint32_in_expected_order(x) (x)
+#define uint64_in_expected_order(x) (x)
+
+#else
+
+#ifdef _MSC_VER
+#include <stdlib.h>
+#define bswap_32(x) _byteswap_ulong(x)
+#define bswap_64(x) _byteswap_uint64(x)
+
+#elif defined(__APPLE__)
+// Mac OS X / Darwin features
+#include <libkern/OSByteOrder.h>
+#define bswap_32(x) OSSwapInt32(x)
+#define bswap_64(x) OSSwapInt64(x)
+
+#else
+#include <byteswap.h>
+#endif
+
+#define uint32_in_expected_order(x) (bswap_32(x))
+#define uint64_in_expected_order(x) (bswap_64(x))
+
+#endif  // WORDS_BIGENDIAN
+
+#if !defined(LIKELY)
+#if HAVE_BUILTIN_EXPECT
+#define LIKELY(x) (__builtin_expect(!!(x), 1))
+#else
+#define LIKELY(x) (x)
+#endif
+#endif
+
+static uint64 Fetch64(const char *p) {
+  return uint64_in_expected_order(UNALIGNED_LOAD64(p));
+}
+
+static uint32 Fetch32(const char *p) {
+  return uint32_in_expected_order(UNALIGNED_LOAD32(p));
+}
+
+// Some primes between 2^63 and 2^64 for various uses.
+static const uint64 k0 = 0xc3a5c85c97cb3127ULL;
+static const uint64 k1 = 0xb492b66fbe98f273ULL;
+static const uint64 k2 = 0x9ae16a3b2f90404fULL;
+static const uint64 k3 = 0xc949d7c7509e6557ULL;
+
+// Bitwise right rotate.  Normally this will compile to a single
+// instruction, especially if the shift is a manifest constant.
+static uint64 Rotate(uint64 val, int shift) {
+  // Avoid shifting by 64: doing so yields an undefined result.
+  return shift == 0 ? val : ((val >> shift) | (val << (64 - shift)));
+}
+
+// Equivalent to Rotate(), but requires the second arg to be non-zero.
+// On x86-64, and probably others, it's possible for this to compile
+// to a single instruction if both args are already in registers.
+static uint64 RotateByAtLeast1(uint64 val, int shift) {
+  return (val >> shift) | (val << (64 - shift));
+}
+
+static uint64 ShiftMix(uint64 val) {
+  return val ^ (val >> 47);
+}
+
+static uint64 HashLen16(uint64 u, uint64 v) {
+  return Hash128to64(uint128(u, v));
+}
+
+static uint64 HashLen0to16(const char *s, size_t len) {
+  if (len > 8) {
+    uint64 a = Fetch64(s);
+    uint64 b = Fetch64(s + len - 8);
+    return HashLen16(a, RotateByAtLeast1(b + len, len)) ^ b;
+  }
+  if (len >= 4) {
+    uint64 a = Fetch32(s);
+    return HashLen16(len + (a << 3), Fetch32(s + len - 4));
+  }
+  if (len > 0) {
+    uint8 a = s[0];
+    uint8 b = s[len >> 1];
+    uint8 c = s[len - 1];
+    uint32 y = static_cast<uint32>(a) + (static_cast<uint32>(b) << 8);
+    uint32 z = len + (static_cast<uint32>(c) << 2);
+    return ShiftMix(y * k2 ^ z * k3) * k2;
+  }
+  return k2;
+}
+
+// This probably works well for 16-byte strings as well, but it may be overkill
+// in that case.
+static uint64 HashLen17to32(const char *s, size_t len) {
+  uint64 a = Fetch64(s) * k1;
+  uint64 b = Fetch64(s + 8);
+  uint64 c = Fetch64(s + len - 8) * k2;
+  uint64 d = Fetch64(s + len - 16) * k0;
+  return HashLen16(Rotate(a - b, 43) + Rotate(c, 30) + d,
+                   a + Rotate(b ^ k3, 20) - c + len);
+}
+
+// Return a 16-byte hash for 48 bytes.  Quick and dirty.
+// Callers do best to use "random-looking" values for a and b.
+static pair<uint64, uint64> WeakHashLen32WithSeeds(
+    uint64 w, uint64 x, uint64 y, uint64 z, uint64 a, uint64 b) {
+  a += w;
+  b = Rotate(b + a + z, 21);
+  uint64 c = a;
+  a += x;
+  a += y;
+  b += Rotate(a, 44);
+  return make_pair(a + z, b + c);
+}
+
+// Return a 16-byte hash for s[0] ... s[31], a, and b.  Quick and dirty.
+static pair<uint64, uint64> WeakHashLen32WithSeeds(
+    const char* s, uint64 a, uint64 b) {
+  return WeakHashLen32WithSeeds(Fetch64(s),
+                                Fetch64(s + 8),
+                                Fetch64(s + 16),
+                                Fetch64(s + 24),
+                                a,
+                                b);
+}
+
+// Return an 8-byte hash for 33 to 64 bytes.
+static uint64 HashLen33to64(const char *s, size_t len) {
+  uint64 z = Fetch64(s + 24);
+  uint64 a = Fetch64(s) + (len + Fetch64(s + len - 16)) * k0;
+  uint64 b = Rotate(a + z, 52);
+  uint64 c = Rotate(a, 37);
+  a += Fetch64(s + 8);
+  c += Rotate(a, 7);
+  a += Fetch64(s + 16);
+  uint64 vf = a + z;
+  uint64 vs = b + Rotate(a, 31) + c;
+  a = Fetch64(s + 16) + Fetch64(s + len - 32);
+  z = Fetch64(s + len - 8);
+  b = Rotate(a + z, 52);
+  c = Rotate(a, 37);
+  a += Fetch64(s + len - 24);
+  c += Rotate(a, 7);
+  a += Fetch64(s + len - 16);
+  uint64 wf = a + z;
+  uint64 ws = b + Rotate(a, 31) + c;
+  uint64 r = ShiftMix((vf + ws) * k2 + (wf + vs) * k0);
+  return ShiftMix(r * k0 + vs) * k2;
+}
+
+uint64 CityHash64(const char *s, size_t len) {
+  if (len <= 32) {
+    if (len <= 16) {
+      return HashLen0to16(s, len);
+    } else {
+      return HashLen17to32(s, len);
+    }
+  } else if (len <= 64) {
+    return HashLen33to64(s, len);
+  }
+
+  // For strings over 64 bytes we hash the end first, and then as we
+  // loop we keep 56 bytes of state: v, w, x, y, and z.
+  uint64 x = Fetch64(s + len - 40);
+  uint64 y = Fetch64(s + len - 16) + Fetch64(s + len - 56);
+  uint64 z = HashLen16(Fetch64(s + len - 48) + len, Fetch64(s + len - 24));
+  pair<uint64, uint64> v = WeakHashLen32WithSeeds(s + len - 64, len, z);
+  pair<uint64, uint64> w = WeakHashLen32WithSeeds(s + len - 32, y + k1, x);
+  x = x * k1 + Fetch64(s);
+
+  // Decrease len to the nearest multiple of 64, and operate on 64-byte chunks.
+  len = (len - 1) & ~static_cast<size_t>(63);
+  do {
+    x = Rotate(x + y + v.first + Fetch64(s + 8), 37) * k1;
+    y = Rotate(y + v.second + Fetch64(s + 48), 42) * k1;
+    x ^= w.second;
+    y += v.first + Fetch64(s + 40);
+    z = Rotate(z + w.first, 33) * k1;
+    v = WeakHashLen32WithSeeds(s, v.second * k1, x + w.first);
+    w = WeakHashLen32WithSeeds(s + 32, z + w.second, y + Fetch64(s + 16));
+    std::swap(z, x);
+    s += 64;
+    len -= 64;
+  } while (len != 0);
+  return HashLen16(HashLen16(v.first, w.first) + ShiftMix(y) * k1 + z,
+                   HashLen16(v.second, w.second) + x);
+}
+
+uint64 CityHash64WithSeed(const char *s, size_t len, uint64 seed) {
+  return CityHash64WithSeeds(s, len, k2, seed);
+}
+
+uint64 CityHash64WithSeeds(const char *s, size_t len,
+                           uint64 seed0, uint64 seed1) {
+  return HashLen16(CityHash64(s, len) - seed0, seed1);
+}
+
+// A subroutine for CityHash128().  Returns a decent 128-bit hash for strings
+// of any length representable in signed long.  Based on City and Murmur.
+static uint128 CityMurmur(const char *s, size_t len, uint128 seed) {
+  uint64 a = Uint128Low64(seed);
+  uint64 b = Uint128High64(seed);
+  uint64 c = 0;
+  uint64 d = 0;
+  signed long l = len - 16;
+  if (l <= 0) {  // len <= 16
+    a = ShiftMix(a * k1) * k1;
+    c = b * k1 + HashLen0to16(s, len);
+    d = ShiftMix(a + (len >= 8 ? Fetch64(s) : c));
+  } else {  // len > 16
+    c = HashLen16(Fetch64(s + len - 8) + k1, a);
+    d = HashLen16(b + len, c + Fetch64(s + len - 16));
+    a += d;
+    do {
+      a ^= ShiftMix(Fetch64(s) * k1) * k1;
+      a *= k1;
+      b ^= a;
+      c ^= ShiftMix(Fetch64(s + 8) * k1) * k1;
+      c *= k1;
+      d ^= c;
+      s += 16;
+      l -= 16;
+    } while (l > 0);
+  }
+  a = HashLen16(a, c);
+  b = HashLen16(d, b);
+  return uint128(a ^ b, HashLen16(b, a));
+}
+
+uint128 CityHash128WithSeed(const char *s, size_t len, uint128 seed) {
+  if (len < 128) {
+    return CityMurmur(s, len, seed);
+  }
+
+  // We expect len >= 128 to be the common case.  Keep 56 bytes of state:
+  // v, w, x, y, and z.
+  pair<uint64, uint64> v, w;
+  uint64 x = Uint128Low64(seed);
+  uint64 y = Uint128High64(seed);
+  uint64 z = len * k1;
+  v.first = Rotate(y ^ k1, 49) * k1 + Fetch64(s);
+  v.second = Rotate(v.first, 42) * k1 + Fetch64(s + 8);
+  w.first = Rotate(y + z, 35) * k1 + x;
+  w.second = Rotate(x + Fetch64(s + 88), 53) * k1;
+
+  // This is the same inner loop as CityHash64(), manually unrolled.
+  do {
+    x = Rotate(x + y + v.first + Fetch64(s + 8), 37) * k1;
+    y = Rotate(y + v.second + Fetch64(s + 48), 42) * k1;
+    x ^= w.second;
+    y += v.first + Fetch64(s + 40);
+    z = Rotate(z + w.first, 33) * k1;
+    v = WeakHashLen32WithSeeds(s, v.second * k1, x + w.first);
+    w = WeakHashLen32WithSeeds(s + 32, z + w.second, y + Fetch64(s + 16));
+    std::swap(z, x);
+    s += 64;
+    x = Rotate(x + y + v.first + Fetch64(s + 8), 37) * k1;
+    y = Rotate(y + v.second + Fetch64(s + 48), 42) * k1;
+    x ^= w.second;
+    y += v.first + Fetch64(s + 40);
+    z = Rotate(z + w.first, 33) * k1;
+    v = WeakHashLen32WithSeeds(s, v.second * k1, x + w.first);
+    w = WeakHashLen32WithSeeds(s + 32, z + w.second, y + Fetch64(s + 16));
+    std::swap(z, x);
+    s += 64;
+    len -= 128;
+  } while (LIKELY(len >= 128));
+  x += Rotate(v.first + z, 49) * k0;
+  z += Rotate(w.first, 37) * k0;
+  // If 0 < len < 128, hash up to 4 chunks of 32 bytes each from the end of s.
+  for (size_t tail_done = 0; tail_done < len; ) {
+    tail_done += 32;
+    y = Rotate(x + y, 42) * k0 + v.second;
+    w.first += Fetch64(s + len - tail_done + 16);
+    x = x * k0 + w.first;
+    z += w.second + Fetch64(s + len - tail_done);
+    w.second += v.first;
+    v = WeakHashLen32WithSeeds(s + len - tail_done, v.first + z, v.second);
+  }
+  // At this point our 56 bytes of state should contain more than
+  // enough information for a strong 128-bit hash.  We use two
+  // different 56-byte-to-8-byte hashes to get a 16-byte final result.
+  x = HashLen16(x, v.first);
+  y = HashLen16(y + z, w.first);
+  return uint128(HashLen16(x + v.second, w.second) + y,
+                 HashLen16(x + w.second, y + v.second));
+}
+
+uint128 CityHash128(const char *s, size_t len) {
+  if (len >= 16) {
+    return CityHash128WithSeed(s + 16,
+                               len - 16,
+                               uint128(Fetch64(s) ^ k3,
+                                       Fetch64(s + 8)));
+  } else if (len >= 8) {
+    return CityHash128WithSeed(NULL,
+                               0,
+                               uint128(Fetch64(s) ^ (len * k0),
+                                       Fetch64(s + len - 8) ^ k1));
+  } else {
+    return CityHash128WithSeed(s, len, uint128(k0, k1));
+  }
+}
+
+#if 0 // #ifdef __SSE4_2__
+#include <citycrc.h>
+#include <nmmintrin.h>
+
+// Requires len >= 240.
+static void CityHashCrc256Long(const char *s, size_t len,
+                               uint32 seed, uint64 *result) {
+  uint64 a = Fetch64(s + 56) + k0;
+  uint64 b = Fetch64(s + 96) + k0;
+  uint64 c = result[0] = HashLen16(b, len);
+  uint64 d = result[1] = Fetch64(s + 120) * k0 + len;
+  uint64 e = Fetch64(s + 184) + seed;
+  uint64 f = seed;
+  uint64 g = 0;
+  uint64 h = 0;
+  uint64 i = 0;
+  uint64 j = 0;
+  uint64 t = c + d;
+
+  // 240 bytes of input per iter.
+  size_t iters = len / 240;
+  len -= iters * 240;
+  do {
+#define CHUNK(multiplier, z)                                    \
+    {                                                           \
+      uint64 old_a = a;                                         \
+      a = Rotate(b, 41 ^ z) * multiplier + Fetch64(s);          \
+      b = Rotate(c, 27 ^ z) * multiplier + Fetch64(s + 8);      \
+      c = Rotate(d, 41 ^ z) * multiplier + Fetch64(s + 16);     \
+      d = Rotate(e, 33 ^ z) * multiplier + Fetch64(s + 24);     \
+      e = Rotate(t, 25 ^ z) * multiplier + Fetch64(s + 32);     \
+      t = old_a;                                                \
+    }                                                           \
+    f = _mm_crc32_u64(f, a);                                    \
+    g = _mm_crc32_u64(g, b);                                    \
+    h = _mm_crc32_u64(h, c);                                    \
+    i = _mm_crc32_u64(i, d);                                    \
+    j = _mm_crc32_u64(j, e);                                    \
+    s += 40
+
+    CHUNK(1, 1); CHUNK(k0, 0);
+    CHUNK(1, 1); CHUNK(k0, 0);
+    CHUNK(1, 1); CHUNK(k0, 0);
+  } while (--iters > 0);
+
+  while (len >= 40) {
+    CHUNK(k0, 0);
+    len -= 40;
+  }
+  if (len > 0) {
+    s = s + len - 40;
+    CHUNK(k0, 0);
+  }
+  j += i << 32;
+  a = HashLen16(a, j);
+  h += g << 32;
+  b += h;
+  c = HashLen16(c, f) + i;
+  d = HashLen16(d, e + result[0]);
+  j += e;
+  i += HashLen16(h, t);
+  e = HashLen16(a, d) + j;
+  f = HashLen16(b, c) + a;
+  g = HashLen16(j, i) + c;
+  result[0] = e + f + g + h;
+  a = ShiftMix((a + g) * k0) * k0 + b;
+  result[1] += a + result[0];
+  a = ShiftMix(a * k0) * k0 + c;
+  result[2] = a + result[1];
+  a = ShiftMix((a + e) * k0) * k0;
+  result[3] = a + result[2];
+}
+
+// Requires len < 240.
+static void CityHashCrc256Short(const char *s, size_t len, uint64 *result) {
+  char buf[240];
+  memcpy(buf, s, len);
+  memset(buf + len, 0, 240 - len);
+  CityHashCrc256Long(buf, 240, ~static_cast<uint32>(len), result);
+}
+
+void CityHashCrc256(const char *s, size_t len, uint64 *result) {
+  if (LIKELY(len >= 240)) {
+    CityHashCrc256Long(s, len, 0, result);
+  } else {
+    CityHashCrc256Short(s, len, result);
+  }
+}
+
+uint128 CityHashCrc128WithSeed(const char *s, size_t len, uint128 seed) {
+  if (len <= 900) {
+    return CityHash128WithSeed(s, len, seed);
+  } else {
+    uint64 result[4];
+    CityHashCrc256(s, len, result);
+    uint64 u = Uint128High64(seed) + result[0];
+    uint64 v = Uint128Low64(seed) + result[1];
+    return uint128(HashLen16(u, v + result[2]),
+                   HashLen16(Rotate(v, 32), u * k0 + result[3]));
+  }
+}
+
+uint128 CityHashCrc128(const char *s, size_t len) {
+  if (len <= 900) {
+    return CityHash128(s, len);
+  } else {
+    uint64 result[4];
+    CityHashCrc256(s, len, result);
+    return uint128(result[2], result[3]);
+  }
+}
+
+#endif
diff --git a/Common/city.h b/Common/city.h
new file mode 100644
index 0000000..c2ab352
--- /dev/null
+++ b/Common/city.h
@@ -0,0 +1,90 @@
+// Copyright (c) 2011 Google, Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//
+// CityHash, by Geoff Pike and Jyrki Alakuijala
+//
+// This file provides a few functions for hashing strings. On x86-64
+// hardware in 2011, CityHash64() is faster than other high-quality
+// hash functions, such as Murmur.  This is largely due to higher
+// instruction-level parallelism.  CityHash64() and CityHash128() also perform
+// well on hash-quality tests.
+//
+// CityHash128() is optimized for relatively long strings and returns
+// a 128-bit hash.  For strings more than about 2000 bytes it can be
+// faster than CityHash64().
+//
+// Functions in the CityHash family are not suitable for cryptography.
+//
+// WARNING: This code has not been tested on big-endian platforms!
+// It is known to work well on little-endian platforms that have a small penalty
+// for unaligned reads, such as current Intel and AMD moderate-to-high-end CPUs.
+//
+// By the way, for some hash functions, given strings a and b, the hash
+// of a+b is easily derived from the hashes of a and b.  This property
+// doesn't hold for any hash functions in this file.
+
+#ifndef CITY_HASH_H_
+#define CITY_HASH_H_
+
+#include <stdlib.h>  // for size_t.
+#include <stdint.h>
+#include <utility>
+
+typedef uint8_t uint8;
+typedef uint32_t uint32;
+typedef uint64_t uint64;
+typedef std::pair<uint64, uint64> uint128;
+
+inline uint64 Uint128Low64(const uint128& x) { return x.first; }
+inline uint64 Uint128High64(const uint128& x) { return x.second; }
+
+// Hash function for a byte array.
+uint64 CityHash64(const char *buf, size_t len);
+
+// Hash function for a byte array.  For convenience, a 64-bit seed is also
+// hashed into the result.
+uint64 CityHash64WithSeed(const char *buf, size_t len, uint64 seed);
+
+// Hash function for a byte array.  For convenience, two seeds are also
+// hashed into the result.
+uint64 CityHash64WithSeeds(const char *buf, size_t len,
+                           uint64 seed0, uint64 seed1);
+
+// Hash function for a byte array.
+uint128 CityHash128(const char *s, size_t len);
+
+// Hash function for a byte array.  For convenience, a 128-bit seed is also
+// hashed into the result.
+uint128 CityHash128WithSeed(const char *s, size_t len, uint128 seed);
+
+// Hash 128 input bits down to 64 bits of output.
+// This is intended to be a reasonably good hash function.
+inline uint64 Hash128to64(const uint128& x) {
+  // Murmur-inspired hashing.
+  const uint64 kMul = 0x9ddfea08eb382d69ULL;
+  uint64 a = (Uint128Low64(x) ^ Uint128High64(x)) * kMul;
+  a ^= (a >> 47);
+  uint64 b = (Uint128High64(x) ^ a) * kMul;
+  b ^= (b >> 47);
+  b *= kMul;
+  return b;
+}
+
+#endif  // CITY_HASH_H_
diff --git a/Consensus/Makefile.in b/Consensus/Makefile.in
index 623a0e1..38e8732 100644
--- a/Consensus/Makefile.in
+++ b/Consensus/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# Makefile.in generated by automake 1.12 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -16,6 +16,23 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -34,7 +51,8 @@ PRE_UNINSTALL = :
 POST_UNINSTALL = :
 bin_PROGRAMS = Consensus$(EXEEXT)
 subdir = Consensus
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -60,6 +78,11 @@ CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
 	-o $@
 SOURCES = $(Consensus_SOURCES)
 DIST_SOURCES = $(Consensus_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -205,8 +228,11 @@ $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 $(am__aclocal_m4_deps):
 install-binPROGRAMS: $(bin_PROGRAMS)
 	@$(NORMAL_INSTALL)
-	test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
 	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+	fi; \
 	for p in $$list; do echo "$$p $$p"; done | \
 	sed 's/$(EXEEXT)$$//' | \
 	while read p p1; do if test -f $$p; \
@@ -329,6 +355,20 @@ GTAGS:
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
 
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
@@ -471,7 +511,7 @@ uninstall-am: uninstall-binPROGRAMS
 .MAKE: install-am install-strip
 
 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
-	clean-generic ctags distclean distclean-compile \
+	clean-generic cscopelist ctags distclean distclean-compile \
 	distclean-generic distclean-tags distdir dvi dvi-am html \
 	html-am info info-am install install-am install-binPROGRAMS \
 	install-data install-data-am install-dvi install-dvi-am \
diff --git a/DAssembler/Makefile.in b/DAssembler/Makefile.in
index 05a43ed..9d1fd6c 100644
--- a/DAssembler/Makefile.in
+++ b/DAssembler/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# Makefile.in generated by automake 1.12 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -16,6 +16,23 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -34,7 +51,8 @@ PRE_UNINSTALL = :
 POST_UNINSTALL = :
 bin_PROGRAMS = DAssembler$(EXEEXT)
 subdir = DAssembler
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -65,6 +83,11 @@ CCLD = $(CC)
 LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
 SOURCES = $(DAssembler_SOURCES)
 DIST_SOURCES = $(DAssembler_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -211,8 +234,11 @@ $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 $(am__aclocal_m4_deps):
 install-binPROGRAMS: $(bin_PROGRAMS)
 	@$(NORMAL_INSTALL)
-	test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
 	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+	fi; \
 	for p in $$list; do echo "$$p $$p"; done | \
 	sed 's/$(EXEEXT)$$//' | \
 	while read p p1; do if test -f $$p; \
@@ -350,6 +376,20 @@ GTAGS:
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
 
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
@@ -492,7 +532,7 @@ uninstall-am: uninstall-binPROGRAMS
 .MAKE: install-am install-strip
 
 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
-	clean-generic ctags distclean distclean-compile \
+	clean-generic cscopelist ctags distclean distclean-compile \
 	distclean-generic distclean-tags distdir dvi dvi-am html \
 	html-am info info-am install install-am install-binPROGRAMS \
 	install-data install-data-am install-dvi install-dvi-am \
diff --git a/DataLayer/FastaIndex.h b/DataLayer/FastaIndex.h
index 46a7f40..d64d707 100644
--- a/DataLayer/FastaIndex.h
+++ b/DataLayer/FastaIndex.h
@@ -2,12 +2,12 @@
 #define FASTA_INDEX_H 1
 
 #include "IOUtil.h"
+#include <boost/tuple/tuple.hpp>
 #include <algorithm>
 #include <cassert>
 #include <fstream>
 #include <iterator> // for ostream_iterator
 #include <string>
-#include <utility>
 #include <vector>
 
 /** A record of an indexed FASTA file. */
@@ -55,6 +55,8 @@ class FastaIndex
 	};
 
   public:
+	typedef boost::tuple<const FAIRecord&, size_t> SeqPos;
+
 	/** Return the number of contigs. */
 	size_t size() { return m_data.size(); }
 
@@ -81,6 +83,7 @@ class FastaIndex
 			assert(c == '>');
 			assert(!id.empty());
 			std::streampos offset = in.tellg();
+			assert(offset > 0);
 			in >> Ignore('\n');
 			size_t n = in.gcount();
 			assert(n > 0);
@@ -90,7 +93,7 @@ class FastaIndex
 	}
 
 	/** Translate a file offset to a sequence:position coordinate. */
-	std::pair<FAIRecord, size_t> operator[](size_t offset) const
+	SeqPos operator[](size_t offset) const
 	{
 		Data::const_iterator it = std::upper_bound(
 				m_data.begin(), m_data.end(),
@@ -100,7 +103,7 @@ class FastaIndex
 		assert(it != m_data.end());
 		assert(it->offset <= offset);
 		assert(offset < it->offset + it->size);
-		return std::make_pair(*it, offset - it->offset);
+		return SeqPos(*it, offset - it->offset);
 	}
 
 	/** Write FASTA headers to the specified seekable stream. */
@@ -146,6 +149,21 @@ class FastaIndex
 	{
 		assert(in.good());
 		o.m_data.clear();
+
+		// Count the number of records.
+		if (in.seekg(0, std::ios::beg)) {
+			size_t n = 0;
+			while (in)
+				if (in.get() == '\n')
+					n++;
+			o.m_data.reserve(n);
+			in.clear();
+			in.seekg(0, std::ios::beg);
+			assert(in.good());
+		} else
+			in.clear();
+
+		// Read the records.
 		for (FAIRecord rec; in >> rec;) {
 			if (!o.m_data.empty())
 				assert(rec.offset > o.m_data.back().offset);
diff --git a/DataLayer/FastaReader.cpp b/DataLayer/FastaReader.cpp
index 1549b9e..da11ef0 100644
--- a/DataLayer/FastaReader.cpp
+++ b/DataLayer/FastaReader.cpp
@@ -145,7 +145,8 @@ next_record:
 			goto next_record;
 
 		// Casava FASTQ format
-		if (comment.size() > 3 && comment[1] == ':' && comment[3]) {
+		if (comment.size() > 3
+				&& comment[1] == ':' && comment[3] == ':') {
 			// read, chastity, flags, index: 1:Y:0:AAAAAA
 			if (opt::chastityFilter && comment[2] == 'Y') {
 				m_unchaste++;
@@ -193,7 +194,8 @@ next_record:
 			exit(EXIT_FAILURE);
 		}
 
-		if (isColourSpace(s) && !isdigit(s[0])) {
+		bool colourSpace = isColourSpace(s);
+		if (colourSpace && !isdigit(s[0])) {
 			// The first character is the primer base. The second
 			// character is the dibase read of the primer and the
 			// first base of the sample, which is not part of the
@@ -202,7 +204,12 @@ next_record:
 			anchor = colourToNucleotideSpace(s[0], s[1]);
 			s.erase(0, 2);
 			q.erase(0, 1);
-		} else if (opt::trimMasked) {
+		}
+
+		if (!q.empty())
+			checkSeqQual(s, q);
+
+		if (opt::trimMasked && !colourSpace) {
 			// Removed masked (lower case) sequence at the beginning
 			// and end of the read.
 			size_t trimFront = s.find_first_not_of("acgtn");
@@ -214,8 +221,6 @@ next_record:
 				q.erase(0, trimFront);
 			}
 		}
-		if (!q.empty())
-			checkSeqQual(s, q);
 		if (flagFoldCase())
 			transform(s.begin(), s.end(), s.begin(), ::toupper);
 
diff --git a/DataLayer/FastaReader.h b/DataLayer/FastaReader.h
index 411cce7..782d41a 100644
--- a/DataLayer/FastaReader.h
+++ b/DataLayer/FastaReader.h
@@ -4,6 +4,7 @@
 #include "Sequence.h"
 #include "StringUtil.h" // for chomp
 #include <cassert>
+#include <cstdlib> // for exit
 #include <fstream>
 #include <istream>
 #include <limits> // for numeric_limits
@@ -22,7 +23,17 @@ class FastaReader {
 		bool flagConvertQual() { return m_flags & CONVERT_QUALITY; }
 
 		FastaReader(const char* path, int flags);
-		~FastaReader() { assert(m_in.eof()); }
+
+		~FastaReader()
+		{
+			if (!m_in.eof()) {
+				std::string line;
+				getline(line);
+				die() << "expected end-of-file near\n"
+					<< line << '\n';
+				exit(EXIT_FAILURE);
+			}
+		}
 
 		Sequence read(std::string& id, std::string& comment,
 				char& anchor, std::string& qual);
diff --git a/DataLayer/Makefile.in b/DataLayer/Makefile.in
index 06b1f3a..9cf895e 100644
--- a/DataLayer/Makefile.in
+++ b/DataLayer/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# Makefile.in generated by automake 1.12 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -17,6 +17,23 @@
 
 
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -35,7 +52,8 @@ PRE_UNINSTALL = :
 POST_UNINSTALL = :
 bin_PROGRAMS = abyss-fac$(EXEEXT) abyss-tofastq$(EXEEXT)
 subdir = DataLayer
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -79,6 +97,11 @@ SOURCES = $(libdatalayer_a_SOURCES) $(abyss_fac_SOURCES) \
 	$(abyss_tofastq_SOURCES)
 DIST_SOURCES = $(libdatalayer_a_SOURCES) $(abyss_fac_SOURCES) \
 	$(abyss_tofastq_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -245,8 +268,11 @@ libdatalayer.a: $(libdatalayer_a_OBJECTS) $(libdatalayer_a_DEPENDENCIES) $(EXTRA
 	$(RANLIB) libdatalayer.a
 install-binPROGRAMS: $(bin_PROGRAMS)
 	@$(NORMAL_INSTALL)
-	test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
 	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+	fi; \
 	for p in $$list; do echo "$$p $$p"; done | \
 	sed 's/$(EXEEXT)$$//' | \
 	while read p p1; do if test -f $$p; \
@@ -431,6 +457,20 @@ GTAGS:
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
 
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
@@ -574,7 +614,7 @@ uninstall-am: uninstall-binPROGRAMS
 .MAKE: install-am install-strip
 
 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
-	clean-generic clean-noinstLIBRARIES ctags distclean \
+	clean-generic clean-noinstLIBRARIES cscopelist ctags distclean \
 	distclean-compile distclean-generic distclean-tags distdir dvi \
 	dvi-am html html-am info info-am install install-am \
 	install-binPROGRAMS install-data install-data-am install-dvi \
diff --git a/DataLayer/fac.cc b/DataLayer/fac.cc
index 5b7c1e2..472f667 100644
--- a/DataLayer/fac.cc
+++ b/DataLayer/fac.cc
@@ -73,6 +73,14 @@ static const int FASTAREADER_FLAGS = FastaReader::NO_FOLD_CASE;
 /** Print contiguity statistics. */
 static void printContiguityStatistics(const char* path)
 {
+	static bool printHeader = true;
+	if (string(path) == "---") {
+		if (printHeader == false)
+			cout << '\n';
+		printHeader = true;
+		return;
+	}
+
 	// Read the sequences and count the lengths.
 	Histogram h;
 	FastaReader in(path, FASTAREADER_FLAGS);
@@ -81,7 +89,6 @@ static void printContiguityStatistics(const char* path)
 	assert(in.eof());
 
 	// Print the table header.
-	static bool printHeader = true;
 	if (opt::format == JIRA && printHeader) {
 		printHeader = false;
 		const char* sep = "\t||";
@@ -129,7 +136,7 @@ static void printContiguityStatistics(const char* path)
 		<< opt::delimiter << path;
 	if (opt::format == JIRA)
 		cout << opt::delimiter;
-	cout << '\n';
+	cout << endl;
 	printHeader = false;
 }
 
diff --git a/DistanceEst/DistanceEst.cpp b/DistanceEst/DistanceEst.cpp
index b0be27e..1c3c9ea 100644
--- a/DistanceEst/DistanceEst.cpp
+++ b/DistanceEst/DistanceEst.cpp
@@ -50,6 +50,10 @@ static const char USAGE_MESSAGE[] =
 "  -q, --min-mapq=N      ignore alignments with mapping quality\n"
 "                        less than this threshold [10]\n"
 "  -o, --out=FILE        write result to FILE\n"
+"      --mle             use the MLE [default]\n"
+"                        (maximum likelihood estimator)\n"
+"      --mean            use the difference of the population mean\n"
+"                        and the sample mean\n"
 "      --dist            output graph in dist format [default]\n"
 "      --dot             output graph in dot format\n"
 "  -j, --threads=N       use N parallel threads [1]\n"
@@ -59,6 +63,9 @@ static const char USAGE_MESSAGE[] =
 "\n"
 "Report bugs to <" PACKAGE_BUGREPORT ">.\n";
 
+/** Which estimator to use. See opt::method. */
+enum { MLE, MEAN };
+
 namespace opt {
 	unsigned k; // used by Estimate.h
 
@@ -81,6 +88,9 @@ namespace opt {
 	/** Reverse-forward mate pair orientation. */
 	static int rf = -1;
 
+	/** Which estimator to use. */
+	static int method = MLE;
+
 	static int verbose;
 	static string out;
 	static int threads = 1;
@@ -100,6 +110,8 @@ static const struct option longopts[] = {
 	{ "min-align",   required_argument, NULL, 'l' },
 	{ "mind",        required_argument, NULL, OPT_MIND },
 	{ "maxd",        required_argument, NULL, OPT_MAXD },
+	{ "mle",         no_argument,       &opt::method, MLE },
+	{ "mean",        no_argument,       &opt::method, MEAN },
 	{ "kmer",        required_argument, NULL, 'k' },
 	{ "npairs",      required_argument, NULL, 'n' },
 	{ "out",         required_argument, NULL, 'o' },
@@ -115,6 +127,30 @@ static const struct option longopts[] = {
 /** A collection of aligned read pairs. */
 typedef vector<SAMRecord> Pairs;
 
+/** Estimate the distance between two contigs using the difference of
+ * the population mean and the sample mean.
+ * @param numPairs [out] the number of pairs that agree with the
+ * expected distribution
+ * @return the estimated distance
+ */
+static int estimateDistanceUsingMean(
+		const std::vector<int>& samples, const PMF& pmf,
+		unsigned& numPairs)
+{
+	Histogram h(samples.begin(), samples.end());
+	int d = pmf.mean() - h.mean();
+
+	// Count the number of samples that agree with the distribution.
+	unsigned n = 0;
+	for (Histogram::const_iterator it = h.begin();
+			it != h.end(); ++it)
+		if (pmf[it->first + d] > pmf.minProbability())
+			n += it->second;
+
+	numPairs = n;
+	return d;
+}
+
 /** Estimate the distance between two contigs.
  * @param numPairs [out] the number of pairs that agree with the
  * expected distribution
@@ -165,9 +201,21 @@ static int estimateDistance(unsigned len0, unsigned len1,
 		fragmentSizes.push_back(x);
 	}
 
-	return maximumLikelihoodEstimate(opt::minAlign,
-			opt::minDist, opt::maxDist,
-			fragmentSizes, pmf, len0, len1, opt::rf, numPairs);
+	switch (opt::method) {
+	  case MLE:
+		// Use the maximum likelihood estimator.
+		return maximumLikelihoodEstimate(opt::minAlign,
+				opt::minDist, opt::maxDist,
+				fragmentSizes, pmf, len0, len1, opt::rf, numPairs);
+	  case MEAN:
+		// Use the difference of the population mean
+		// and the sample mean.
+		return estimateDistanceUsingMean(
+				fragmentSizes, pmf, numPairs);
+	  default:
+		assert(false);
+		abort();
+	}
 }
 
 static void writeEstimate(ostream& out,
@@ -183,18 +231,17 @@ static void writeEstimate(ostream& out,
 			pairs, pmf, est.numPairs);
 	est.stdDev = pmf.getSampleStdDev(est.numPairs);
 
-	ContigNode v = id1 ^ id0.sense();
+	std::pair<ContigNode, ContigNode> e(id0, id1 ^ id0.sense());
 	if (est.numPairs >= opt::npairs) {
 		if (opt::format == DOT) {
 #pragma omp critical(out)
-			out << '"' << id0 << "\" -> \"" << v << "\""
-				" [" << est << "]\n";
+			out << get(g_contigNames, e) << " [" << est << "]\n";
 		} else
-			out << ' ' << id1 << ',' << est;
+			out << ' ' << get(g_contigNames, id1) << ',' << est;
 	} else if (opt::verbose > 1) {
 #pragma omp critical(cerr)
-		cerr << "warning: " << '"' << id0 << "\" -> \"" << v << "\""
-				" [d=" << est.distance << "] "
+		cerr << "warning: " << get(g_contigNames, e)
+			<< " [d=" << est.distance << "] "
 			<< est.numPairs << " of " << pairs.size()
 			<< " pairs fit the expected distribution\n";
 	}
@@ -206,7 +253,7 @@ static void writeEstimates(ostream& out,
 		const vector<unsigned>& lengthVec, const PMF& pmf)
 {
 	assert(!pairs.empty());
-	ContigID id0(pairs.front().rname);
+	ContigID id0(get(g_contigNames, pairs.front().rname));
 	assert(id0 < lengthVec.size());
 	unsigned len0 = lengthVec[id0];
 	if (len0 < opt::seedLen)
@@ -220,8 +267,9 @@ static void writeEstimates(ostream& out,
 	PairsMap dataMap[2];
 	for (Pairs::const_iterator it = pairs.begin();
 			it != pairs.end(); ++it)
-		dataMap[it->isReverse()][ContigNode(it->mrnm,
-				it->isReverse() == it->isMateReverse())]
+		dataMap[it->isReverse()][find_vertex(
+				it->mrnm, it->isReverse() == it->isMateReverse(),
+				g_contigNames)]
 			.push_back(*it);
 
 	for (int sense0 = false; sense0 <= true; sense0++) {
@@ -263,7 +311,7 @@ static void readContigLengths(istream& in, vector<unsigned>& lengths)
 {
 	assert(in);
 	assert(lengths.empty());
-	assert(ContigID::empty());
+	assert(g_contigNames.empty());
 	for (string line; in.peek() == '@' && getline(in, line);) {
 		istringstream ss(line);
 		string type;
@@ -276,8 +324,7 @@ static void readContigLengths(istream& in, vector<unsigned>& lengths)
 		ss >> expect(" SN:") >> s >> expect(" LN:") >> len;
 		assert(ss);
 
-		ContigID id = ContigID::insert(s);
-		assert(id == lengths.size());
+		put(g_contigNames, lengths.size(), s);
 		lengths.push_back(len);
 	}
 	if (lengths.empty()) {
@@ -314,7 +361,8 @@ static void readPairs(It& it, const It& last, vector<SAMRecord>& out)
 
 	// Check that the input is sorted.
 	if (it != last && !out.empty()
-			&& ContigID(it->rname) < ContigID(out.front().rname)) {
+			&& get(g_contigNames, it->rname)
+				< get(g_contigNames, out.front().rname)) {
 		cerr << "error: input must be sorted: saw `"
 			<< out.front().rname << "' before `"
 			<< it->rname << "'\n";
@@ -479,7 +527,7 @@ int main(int argc, char** argv)
 	// Read the contig lengths.
 	vector<unsigned> contigLens;
 	readContigLengths(in, contigLens);
-	ContigID::lock();
+	g_contigNames.lock();
 
 	// Estimate the distances between contigs.
 	istream_iterator<SAMRecord> it(in), last;
diff --git a/DistanceEst/Makefile.in b/DistanceEst/Makefile.in
index 2f23b3e..7807ed6 100644
--- a/DistanceEst/Makefile.in
+++ b/DistanceEst/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# Makefile.in generated by automake 1.12 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -16,6 +16,23 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -34,7 +51,8 @@ PRE_UNINSTALL = :
 POST_UNINSTALL = :
 bin_PROGRAMS = DistanceEst$(EXEEXT)
 subdir = DistanceEst
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -66,6 +84,11 @@ CCLD = $(CC)
 LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
 SOURCES = $(DistanceEst_SOURCES)
 DIST_SOURCES = $(DistanceEst_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -208,8 +231,11 @@ $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 $(am__aclocal_m4_deps):
 install-binPROGRAMS: $(bin_PROGRAMS)
 	@$(NORMAL_INSTALL)
-	test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
 	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+	fi; \
 	for p in $$list; do echo "$$p $$p"; done | \
 	sed 's/$(EXEEXT)$$//' | \
 	while read p p1; do if test -f $$p; \
@@ -347,6 +373,20 @@ GTAGS:
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
 
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
@@ -489,7 +529,7 @@ uninstall-am: uninstall-binPROGRAMS
 .MAKE: install-am install-strip
 
 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
-	clean-generic ctags distclean distclean-compile \
+	clean-generic cscopelist ctags distclean distclean-compile \
 	distclean-generic distclean-tags distdir dvi dvi-am html \
 	html-am info info-am install install-am install-binPROGRAMS \
 	install-data install-data-am install-dvi install-dvi-am \
diff --git a/FMIndex/BitArrays.h b/FMIndex/BitArrays.h
index 69371ee..113e037 100644
--- a/FMIndex/BitArrays.h
+++ b/FMIndex/BitArrays.h
@@ -24,26 +24,25 @@ class BitArrays
 
   public:
 
-/** Count the occurrences of the symbols of s. */
-void assign(const std::vector<T>& s)
+/** Count the occurrences of the symbols of [first, last). */
+template<typename It>
+void assign(It first, It last)
 {
-	assert(!s.empty());
+	assert(first < last);
 	m_data.clear();
 
 	// Determine the size of the alphabet ignoring the sentinel.
 	T n = 0;
-	for (std::vector<T>::const_iterator it = s.begin();
-			it != s.end(); ++it)
+	for (It it = first; it != last; ++it)
 		if (*it != SENTINEL())
 			n = std::max(n, *it);
 	n++;
 
 	assert(n < std::numeric_limits<T>::max());
-	m_data.resize(n, wat_array::BitArray(s.size()));
+	m_data.resize(n, wat_array::BitArray(last - first));
 
-	typedef std::vector<T>::const_iterator It;
 	size_t i = 0;
-	for (It it = s.begin(); it != s.end(); ++it, ++i) {
+	for (It it = first; it != last; ++it, ++i) {
 		T c = *it;
 		if (c == SENTINEL())
 			continue;
diff --git a/FMIndex/FMIndex.h b/FMIndex/FMIndex.h
index c0a23ed..2334c76 100644
--- a/FMIndex/FMIndex.h
+++ b/FMIndex/FMIndex.h
@@ -84,7 +84,6 @@ void encode(It first, It last) const
 	assert(first < last);
 	assert(!m_alphabet.empty());
 	std::transform(first, last, first, Translate(*this));
-	std::replace(first, last, SENTINEL(), T(0));
 }
 
 /** Decode the alphabet of [first, last). */
@@ -97,13 +96,19 @@ void decode(It first, It last) const
 		*it = m_alphabet[*it];
 }
 
-/** Build the BWT of [first, last). */
+/** Build the BWT of [first, last).
+ * The BWT including the sentinel is stored in [first, last].
+ * @return the position of the sentinel
+ */
 template<typename It>
 size_type buildBWT(It first, It last) const
 {
 	assert(first < last);
 	assert(size_t(last - first)
 			< std::numeric_limits<size_type>::max());
+	encode(first, last);
+	std::replace(first, last, SENTINEL(), T(0));
+
 	std::cerr << "Building the Burrows-Wheeler transform...\n";
 	size_t n = last - first;
 	std::vector<sais_size_type> sa(n);
@@ -115,30 +120,56 @@ size_type buildBWT(It first, It last) const
 	assert(sentinel >= 0);
 	if (sentinel < 0)
 		abort();
+	// Insert the sentinel.
+	std::copy_backward(first + sentinel, last, last + 1);
+	first[sentinel] = SENTINEL();
 	return sentinel;
 }
 
-/** Build the BWT of [first, last) and write the result to out. */
+/** Set the specified element of the sampled suffix array. */
+void setSA(size_t sai, size_t pos)
+{
+	if (sai % m_sampleSA == 0) {
+		size_t i = sai / m_sampleSA;
+		assert(i < m_sa.size());
+		m_sa[i] = pos;
+	}
+}
+
+/** Construct the suffix array from the FM index. */
+void constructSuffixArray()
+{
+	// The length of the original string.
+	size_t n = m_occ.size() - 1;
+	assert(n > 0);
+	assert(m_sampleSA > 0);
+	m_sa.resize(n / m_sampleSA + 1);
+	size_t sai = 0;
+	for (size_t i = n; i > 0; i--) {
+		setSA(sai, i);
+		T c = m_occ.at(sai);
+		assert(c != SENTINEL());
+		sai = m_cf[c] + m_occ.rank(c, sai);
+		assert(sai > 0);
+	}
+	setSA(sai, 0);
+}
+
+/** Build an FM-index of the specified BWT. */
 template<typename It>
-std::ostream& buildBWT(It first, It last, std::ostream& out) const
+void assignBWT(It first, It last)
 {
-	assert(first < last);
-	assert(out);
+	assert(last - first > 1);
+	assert(size_t(last - first)
+			< std::numeric_limits<size_type>::max());
 
-	// Construct the BWT.
-	encode(first, last);
-	sais_size_type sentinel = buildBWT(first, last);
-	assert(sentinel <= last - first);
-	decode(first, last);
-
-	// Output the BWT.
-	out.write(reinterpret_cast<char*>(&first[0]),
-			sentinel);
-	out.put('\0');
-	out.write(reinterpret_cast<char*>(&first[sentinel]),
-			last - first - sentinel);
-	assert(out);
-	return out;
+	std::cerr << "Building the character occurrence table...\n";
+	m_occ.assign(first, last);
+	countOccurrences();
+
+	// Construct the suffix array from the FM index.
+	std::cerr << "Building the suffix array...\n";
+	constructSuffixArray();
 }
 
 /** Build an FM-index of the specified data. */
@@ -150,6 +181,7 @@ void assign(It first, It last)
 			< std::numeric_limits<size_type>::max());
 
 	encode(first, last);
+	std::replace(first, last, SENTINEL(), T(0));
 
 	// Construct the suffix array.
 	std::cerr << "Building the suffix array...\n";
@@ -175,7 +207,7 @@ void assign(It first, It last)
 		bwt[i] = m_sa[i] == 0 ? SENTINEL() : first[m_sa[i] - 1];
 
 	std::cerr << "Building the character occurrence table...\n";
-	m_occ.assign(bwt);
+	m_occ.assign(bwt.begin(), bwt.end());
 	countOccurrences();
 }
 
@@ -187,7 +219,7 @@ void sampleSA(unsigned period)
 		return;
 	assert(m_sampleSA == 1);
 	m_sampleSA = period;
-	if (m_sampleSA == 1)
+	if (m_sampleSA == 1 || m_sa.empty())
 		return;
 	std::vector<size_type>::iterator out = m_sa.begin();
 	for (size_t i = 0; i < m_sa.size(); i += m_sampleSA)
@@ -431,7 +463,10 @@ Match find(const std::string& q, unsigned k) const
 	return findSubstring(s.begin(), s.end(), k);
 }
 
-/** Set the alphabet to [first, last). */
+/** Set the alphabet to [first, last).
+ * The character '\0' is treated specially and not included in the
+ * alphabet.
+ */
 template <typename It>
 void setAlphabet(It first, It last)
 {
@@ -442,6 +477,9 @@ void setAlphabet(It first, It last)
 		mask[*it] = true;
 	}
 
+	// Remove the character '\0' from the alphabet.
+	mask[0] = false;
+
 	m_alphabet.clear();
 	m_mapping.clear();
 	for (unsigned c = 0; c < mask.size(); ++c) {
@@ -499,22 +537,16 @@ friend std::istream& operator>>(std::istream& in, FMIndex& o)
 	assert(in);
 
 	size_t n;
-	char c;
-
-	in >> n;
+	in >> n >> expect("\n");
 	assert(in);
-	c = in.get();
-	assert(c == '\n');
 	assert(n < std::numeric_limits<size_type>::max());
 	o.m_alphabet.resize(n);
 	in.read(reinterpret_cast<char*>(&o.m_alphabet[0]),
 			n * sizeof o.m_alphabet[0]);
 	o.setAlphabet(o.m_alphabet.begin(), o.m_alphabet.end());
 
-	in >> n;
+	in >> n >> expect("\n");
 	assert(in);
-	c = in.get();
-	assert(c == '\n');
 	assert(n < std::numeric_limits<size_type>::max());
 	o.m_sa.resize(n);
 	in.read(reinterpret_cast<char*>(&o.m_sa[0]),
diff --git a/FMIndex/Makefile.in b/FMIndex/Makefile.in
index 5ea64d9..bdd222e 100644
--- a/FMIndex/Makefile.in
+++ b/FMIndex/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# Makefile.in generated by automake 1.12 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -17,6 +17,23 @@
 
 
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -35,7 +52,8 @@ PRE_UNINSTALL = :
 POST_UNINSTALL = :
 noinst_PROGRAMS = abyss-count$(EXEEXT) abyss-dawg$(EXEEXT)
 subdir = FMIndex
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -77,6 +95,11 @@ SOURCES = $(libfmindex_a_SOURCES) $(abyss_count_SOURCES) \
 	$(abyss_dawg_SOURCES)
 DIST_SOURCES = $(libfmindex_a_SOURCES) $(abyss_count_SOURCES) \
 	$(abyss_dawg_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -364,6 +387,20 @@ GTAGS:
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
 
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
@@ -504,17 +541,17 @@ uninstall-am:
 .MAKE: install-am install-strip
 
 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-noinstLIBRARIES clean-noinstPROGRAMS ctags distclean \
-	distclean-compile distclean-generic distclean-tags distdir dvi \
-	dvi-am html html-am info info-am install install-am \
-	install-data install-data-am install-dvi install-dvi-am \
-	install-exec install-exec-am install-html install-html-am \
-	install-info install-info-am install-man install-pdf \
-	install-pdf-am install-ps install-ps-am install-strip \
-	installcheck installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
-	uninstall-am
+	clean-noinstLIBRARIES clean-noinstPROGRAMS cscopelist ctags \
+	distclean distclean-compile distclean-generic distclean-tags \
+	distdir dvi dvi-am html html-am info info-am install \
+	install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/FilterGraph/FilterGraph.cpp b/FilterGraph/FilterGraph.cpp
index 24774bb..e4b96a9 100644
--- a/FilterGraph/FilterGraph.cpp
+++ b/FilterGraph/FilterGraph.cpp
@@ -60,6 +60,11 @@ static const char USAGE_MESSAGE[] =
 "      --no-assemble     disable assembling of paths [default]\n"
 "  -g, --graph=FILE      write the contig adjacency graph to FILE\n"
 "  -i, --ignore=FILE     ignore contigs seen in FILE\n"
+"      --adj             output the graph in adj format [default]\n"
+"      --asqg            output the graph in asqg format\n"
+"      --dot             output the graph in dot format\n"
+"      --dot-meancov     same as above but give the mean coverage\n"
+"      --sam             output the graph in SAM format\n"
 "  -v, --verbose         display verbose output\n"
 "      --help            display this help and exit\n"
 "      --version         output version information and exit\n"
@@ -93,7 +98,8 @@ namespace opt {
 	/** The minimum overlap allowed between two contigs. */
 	static int minOverlap = 10;
 
-	int format; // used by ContigProperties
+	/** Output graph format. */
+	int format = ADJ; // used by ContigProperties
 }
 
 static const char shortopts[] = "g:i:k:l:m:t:T:v";
@@ -101,6 +107,11 @@ static const char shortopts[] = "g:i:k:l:m:t:T:v";
 enum { OPT_HELP = 1, OPT_VERSION };
 
 static const struct option longopts[] = {
+	{ "adj",           no_argument,       &opt::format, ADJ },
+	{ "asqg",          no_argument,       &opt::format, ASQG },
+	{ "dot",           no_argument,       &opt::format, DOT },
+	{ "dot-meancov",   no_argument,       &opt::format, DOT_MEANCOV },
+	{ "sam",           no_argument,       &opt::format, SAM },
 	{ "graph",         required_argument, NULL, 'g' },
 	{ "ignore",        required_argument, NULL, 'i' },
 	{ "kmer",          required_argument, NULL, 'k' },
@@ -141,6 +152,7 @@ static bool removable(const Graph* pg, vertex_descriptor v)
 	typedef graph_traits<Graph> GTraits;
 	typedef GTraits::out_edge_iterator OEit;
 	typedef GTraits::in_edge_iterator IEit;
+	typedef GTraits::vertex_descriptor V;
 
 	const Graph& g = *pg;
 
@@ -167,7 +179,9 @@ static bool removable(const Graph* pg, vertex_descriptor v)
 	OEit oei0, oei1;
 	tie(oei0, oei1) = out_edges(v, g);
 	for (OEit vw = oei0; vw != oei1; ++vw) {
-		if (v == target(*vw, g) || ~v == target(*vw, g)) {
+		V w = target(*vw, g);
+		V vc = get(vertex_complement, g, v);
+		if (v == w || vc == w) {
 			g_count.self_adj++;
 			return false;
 		}
@@ -198,7 +212,7 @@ static bool removable(const Graph* pg, vertex_descriptor v)
 struct EdgeInfo {
 	vertex_descriptor u;
 	vertex_descriptor w;
-	Distance ep;
+	edge_bundle_type<Graph>::type ep;
 
 	EdgeInfo(vertex_descriptor u, vertex_descriptor w, int ep)
 		: u(u), w(w), ep(ep) {}
@@ -296,7 +310,7 @@ static void removeContigs(Graph& g, vector<vertex_descriptor>& sc)
 
 		clear_vertex(v, g);
 		remove_vertex(v, g);
-		g_removed.push_back(v);
+		g_removed.push_back(get(vertex_contig_index, g, v));
 		g_count.removed++;
 	}
 	sc.swap(out);
@@ -305,12 +319,14 @@ static void removeContigs(Graph& g, vector<vertex_descriptor>& sc)
 /** Return the value of the bit at the specified index. */
 struct Marked : unary_function<vertex_descriptor, bool> {
 	typedef vector<bool> Data;
-	Marked(const Data& data) : m_data(data) { }
+	Marked(const Graph& g, const Data& data)
+		: m_g(g), m_data(data) { }
 	bool operator()(vertex_descriptor u) const
 	{
-		return m_data[ContigID(u)];
+		return m_data[get(vertex_contig_index, m_g, u)];
 	}
   private:
+	const Graph& m_g;
 	const Data& m_data;
 };
 
@@ -323,7 +339,7 @@ static void findShortContigs(const Graph& g, const vector<bool>& seen,
 	Vit first, second;
 	tie(first, second) = vertices(g);
 	copy_if(first, second, back_inserter(sc),
-			!bind(Marked(seen), _1) && bind(removable, &g, _1));
+			!bind(Marked(g, seen), _1) && bind(removable, &g, _1));
 }
 
 /** Functor used for sorting contigs based on degree, then size,
@@ -359,7 +375,7 @@ struct ShorterThanX : unary_function<vertex_descriptor, bool> {
 	bool operator()(vertex_descriptor y) const
 	{
 		return g[y].length < x && !get(vertex_removed, g, y)
-			&& !seen[ContigID(y)];
+			&& !seen[get(vertex_contig_index, g, y)];
 	}
 };
 
@@ -399,7 +415,8 @@ static void removeShortContigs(Graph& g, const vector<bool>& seen)
 	copy_if(first, second, back_inserter(sc),
 			ShorterThanX(g, seen, opt::minLen));
 	remove_vertex_if(g, sc.begin(), sc.end(), True<V>());
-	copy(sc.begin(), sc.end(), back_inserter(g_removed));
+	transform(sc.begin(), sc.end(), back_inserter(g_removed),
+			mem_fun_ref(&ContigNode::contigIndex));
 	if (opt::verbose > 0)
 		cerr << "Removed " << sc.size()/2 << " short contigs.\n";
 }
@@ -550,17 +567,23 @@ int main(int argc, char** argv)
 	sort(g_removed.begin(), g_removed.end());
 	g_removed.erase(unique(g_removed.begin(), g_removed.end()),
 			g_removed.end());
-	copy(g_removed.begin(), g_removed.end(),
-			ostream_iterator<ContigID>(cout, "\n"));
+	for (vector<ContigID>::const_iterator it = g_removed.begin();
+			it != g_removed.end(); ++it)
+		cout << get(g_contigNames, *it) << '\n';
 
 	// Assemble unambiguous paths.
 	if (opt::assemble) {
+		size_t numContigs = num_vertices(g) / 2;
 		typedef vector<ContigPath> ContigPaths;
 		ContigPaths paths;
 		assemble(g, back_inserter(paths));
 		for (ContigPaths::const_iterator it = paths.begin();
-				it != paths.end(); ++it)
-			cout << ContigID::create() << '\t' << *it << '\n';
+				it != paths.end(); ++it) {
+			ContigNode u(numContigs + it - paths.begin(), false);
+			string name = createContigName();
+			put(vertex_name, g, u, name);
+			cout << name << '\t' << *it << '\n';
+		}
 	}
 
 	// Output the updated adjacency graph.
diff --git a/FilterGraph/Makefile.in b/FilterGraph/Makefile.in
index 05502c6..6aed6e3 100644
--- a/FilterGraph/Makefile.in
+++ b/FilterGraph/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# Makefile.in generated by automake 1.12 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -16,6 +16,23 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -34,7 +51,8 @@ PRE_UNINSTALL = :
 POST_UNINSTALL = :
 bin_PROGRAMS = abyss-filtergraph$(EXEEXT)
 subdir = FilterGraph
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -64,6 +82,11 @@ CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
 	-o $@
 SOURCES = $(abyss_filtergraph_SOURCES)
 DIST_SOURCES = $(abyss_filtergraph_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -209,8 +232,11 @@ $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 $(am__aclocal_m4_deps):
 install-binPROGRAMS: $(bin_PROGRAMS)
 	@$(NORMAL_INSTALL)
-	test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
 	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+	fi; \
 	for p in $$list; do echo "$$p $$p"; done | \
 	sed 's/$(EXEEXT)$$//' | \
 	while read p p1; do if test -f $$p; \
@@ -333,6 +359,20 @@ GTAGS:
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
 
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
@@ -475,7 +515,7 @@ uninstall-am: uninstall-binPROGRAMS
 .MAKE: install-am install-strip
 
 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
-	clean-generic ctags distclean distclean-compile \
+	clean-generic cscopelist ctags distclean distclean-compile \
 	distclean-generic distclean-tags distdir dvi dvi-am html \
 	html-am info info-am install install-am install-binPROGRAMS \
 	install-data install-data-am install-dvi install-dvi-am \
diff --git a/Graph/AdjIO.h b/Graph/AdjIO.h
index 199610f..48f2cd9 100644
--- a/Graph/AdjIO.h
+++ b/Graph/AdjIO.h
@@ -44,14 +44,15 @@ std::ostream& write_adj(std::ostream& out, const Graph& g)
  		if (get(vertex_removed, g, *u))
 			continue;
 		if (!sense)
-			out << ContigID(*u) << get(vertex_bundle, g, *u);
+			out << get(vertex_contig_name, g, *u)
+				<< get(vertex_bundle, g, *u);
 		out << "\t;";
 		std::pair<out_edge_iterator, out_edge_iterator>
 			adj = out_edges(*u, g);
 		for (out_edge_iterator e = adj.first; e != adj.second; ++e) {
 			vertex_descriptor v = target(*e, g);
 			assert(!get(vertex_removed, g, v));
-			out << ' ' << (v ^ sense);
+			out << ' ' << get(vertex_name, g, v ^ sense);
 			write_edge_prop(out, get(edge_bundle, g, e));
 		}
 		if (sense)
@@ -69,10 +70,10 @@ std::istream& readDistEdges(std::istream& in, ContigGraph<Graph>& g,
 	typedef typename graph_traits<Graph>::vertex_descriptor V;
 	typedef typename graph_traits<Graph>::edge_descriptor E;
 	typedef typename Graph::edge_property_type EP;
-	for (std::string id; getline(in >> std::ws, id, ',');) {
-		assert(!id.empty());
-		V v(id);
-		v = v ^ u.sense();
+	for (std::string vname; getline(in >> std::ws, vname, ',');) {
+		assert(!vname.empty());
+		V v = find_vertex(vname, g);
+		v = v ^ get(vertex_sense, g, u);
 		EP ep;
 		in >> ep;
 		assert(in);
@@ -142,7 +143,7 @@ std::istream& read_adj(std::istream& in, ContigGraph<Graph>& g,
 		assert(in.eof());
 	}
 	assert(num_vertices(g) > 0);
-	ContigID::lock();
+	g_contigNames.lock();
 
 	if (faiFormat)
 		return in;
@@ -151,10 +152,10 @@ std::istream& read_adj(std::istream& in, ContigGraph<Graph>& g,
 	in.clear();
 	in.seekg(std::ios_base::beg);
 	assert(in);
-	for (ContigID id; in >> id;) {
+	for (std::string name; in >> name;) {
 		if (adjFormat)
 			in >> Ignore(';');
-		vertex_descriptor u(id, false);
+		vertex_descriptor u = find_vertex(name, false, g);
 		for (int sense = false; sense <= true; ++sense) {
 			std::string s;
 			getline(in, s, !sense ? ';' : '\n');
@@ -163,7 +164,8 @@ std::istream& read_adj(std::istream& in, ContigGraph<Graph>& g,
 			if (!adjFormat) {
 				readDistEdges(ss, g, u ^ sense, betterEP);
 			} else
-			for (vertex_descriptor v; ss >> v >> std::ws;) {
+			for (std::string vname; ss >> vname >> std::ws;) {
+				vertex_descriptor v = find_vertex(vname, g);
 				assert(!edge(u ^ sense, v ^ sense, g).second);
 				if (ss.peek() == '[') {
 					ss.get();
diff --git a/Graph/AsqgIO.h b/Graph/AsqgIO.h
index 2ee5a3d..a3bc142 100644
--- a/Graph/AsqgIO.h
+++ b/Graph/AsqgIO.h
@@ -1,7 +1,6 @@
 #ifndef ASQGIO_H
 #define ASQGIO_H 1
 
-#include "Common/ContigID.h"
 #include "Common/IOUtil.h"
 #include "Graph/Properties.h"
 #include <boost/graph/graph_traits.hpp>
@@ -31,7 +30,8 @@ std::ostream& write_asqg(std::ostream& out, Graph& g)
 		if (get(vertex_removed, g, u))
 			continue;
 		const VP& vp = g[u];
-		out << "VT\t" << ContigID(u) << "\t*\tLN:i:" << vp.length;
+		out << "VT\t" << get(vertex_contig_name, g, u)
+			<< "\t*\tLN:i:" << vp.length;
 		if (vp.coverage > 0)
 			out << "\tXC:i:" << vp.coverage;
 		out << '\n';
@@ -50,14 +50,17 @@ std::ostream& write_asqg(std::ostream& out, Graph& g)
 		unsigned overlap = -distance;
 		unsigned ulen = g[u].length;
 		unsigned vlen = g[v].length;
-		out << "ED\t" << ContigID(u) << ' ' << ContigID(v)
-			<< ' ' << (u.sense() ? 0 : ulen - overlap)
-			<< ' ' << (u.sense() ? overlap : ulen) - 1
+		bool usense = get(vertex_sense, g, u);
+		bool vsense = get(vertex_sense, g, v);
+		out << "ED\t" << get(vertex_contig_name, g, u)
+			<< ' ' << get(vertex_contig_name, g, v)
+			<< ' ' << (usense ? 0 : ulen - overlap)
+			<< ' ' << (usense ? overlap : ulen) - 1
 			<< ' ' << ulen
-			<< ' ' << (!v.sense() ? 0 : vlen - overlap)
-			<< ' ' << (!v.sense() ? overlap : vlen) - 1
+			<< ' ' << (!vsense ? 0 : vlen - overlap)
+			<< ' ' << (!vsense ? overlap : vlen) - 1
 			<< ' ' << vlen
-			<< ' ' << (u.sense() != v.sense())
+			<< ' ' << (usense != vsense)
 			<< " -1\n"; // number of mismatches
 	}
 	return out;
@@ -103,13 +106,14 @@ std::istream& read_asqg(std::istream& in, Graph& g)
 				V u = add_vertex(vp, g);
 				put(vertex_name, g, u, uname);
 			} else {
-				V u(uname, false);
+				V u = find_vertex(uname, false, g);
 				assert(get(vertex_index, g, u) < num_vertices(g));
+				(void)u;
 			}
 			break;
 		  }
 		  case 'E': {
-			ContigID uname, vname;
+			std::string uname, vname;
 			unsigned s1, e1, l1, s2, e2, l2;
 			bool rc;
 			int nd;
@@ -125,7 +129,8 @@ std::istream& read_asqg(std::istream& in, Graph& g)
 			int d = -(e1 - s1 + 1);
 			assert(d < 0);
 			EP ep(d);
-			V u(uname, s1 == 0), v(vname, s2 > 0);
+			V u = find_vertex(uname, s1 == 0, g);
+			V v = find_vertex(vname, s2 > 0, g);
 			std::pair<E, bool> e = edge(u, v, g);
 			if (e.second) {
 				// Ignore duplicate edges that are self loops.
diff --git a/Graph/Assemble.h b/Graph/Assemble.h
index a381b90..323e524 100644
--- a/Graph/Assemble.h
+++ b/Graph/Assemble.h
@@ -1,7 +1,7 @@
 #ifndef ASSEMBLE_H
 #define ASSEMBLE_H 1
 
-#include "Common/ContigID.h" // for ContigIDIndexMap
+#include "Common/ContigNode.h" // for ContigIndexMap
 #include "Common/Iterator.h" // for output_iterator_traits
 #include "Graph/DepthFirstSearch.h"
 
@@ -59,7 +59,7 @@ template<typename Graph, typename OutIt>
 void assembleDFS(const Graph& g, OutIt out)
 {
 	typedef boost::vector_property_map<
-		boost::default_color_type, ContigIDIndexMap> ColorMap;
+		boost::default_color_type, ContigIndexMap> ColorMap;
 	depthFirstSearch(g, AssembleVisitor<OutIt>(out),
 			ColorMap(num_vertices(g) / 2));
 }
diff --git a/Graph/ConstrainedSearch.h b/Graph/ConstrainedSearch.h
index e7436e8..1553830 100644
--- a/Graph/ConstrainedSearch.h
+++ b/Graph/ConstrainedSearch.h
@@ -23,7 +23,8 @@ typedef std::vector<Constraint> Constraints;
 typedef std::vector<ContigPath> ContigPaths;
 
 bool constrainedSearch(const Graph& g,
-		ContigNode origin, Constraints& constraints,
+		graph_traits<Graph>::vertex_descriptor origin,
+		Constraints& constraints,
 		ContigPaths& superPaths, unsigned& compCost);
 
 #endif
diff --git a/Graph/ContigGraph.h b/Graph/ContigGraph.h
index 5f61e73..4c51f79 100644
--- a/Graph/ContigGraph.h
+++ b/Graph/ContigGraph.h
@@ -1,6 +1,7 @@
 #ifndef CONTIGGRAPH_H
 #define CONTIGGRAPH_H 1
 
+#include "ContigID.h"
 #include "Graph/Properties.h"
 #include <boost/graph/graph_traits.hpp>
 #include <cassert>
@@ -65,7 +66,7 @@ class in_edge_iterator
 	static edge_descriptor complement(const edge_descriptor& e)
 	{
 		return std::pair<vertex_descriptor, vertex_descriptor>(
-				~e.second, ~e.first);
+				e.second ^ 1, e.first ^ 1);
 	}
 
   public:
@@ -113,7 +114,7 @@ class in_edge_iterator
 	/** Return the in degree of vertex v. */
 	degree_size_type in_degree(vertex_descriptor v) const
 	{
-		return G::out_degree(~v);
+		return G::out_degree(get(vertex_complement, *this, v));
 	}
 
 	/** Remove all out edges from vertex u. */
@@ -122,12 +123,14 @@ class in_edge_iterator
 		std::pair<adjacency_iterator, adjacency_iterator>
 			adj = G::adjacent_vertices(u);
 		for (adjacency_iterator v = adj.first; v != adj.second; ++v) {
-			if (~*v == u) {
+			vertex_descriptor uc = get(vertex_complement, *this, u);
+			vertex_descriptor vc = get(vertex_complement, *this, *v);
+			if (vc == u) {
 				// When ~v == u, removing (~v,~u), which is (u,~u),
 				// would invalidate our iterator. This edge will be
 				// removed by clear_out_edges.
 			} else
-				G::remove_edge(~*v, ~u);
+				G::remove_edge(vc, uc);
 		}
 		G::clear_out_edges(u);
 	}
@@ -135,7 +138,7 @@ class in_edge_iterator
 	/** Remove all in edges from vertex v. */
 	void clear_in_edges(vertex_descriptor v)
 	{
-		clear_out_edges(~v);
+		clear_out_edges(get(vertex_complement, *this, v));
 	}
 
 	/** Remove all edges to and from vertex v. */
@@ -161,16 +164,18 @@ class in_edge_iterator
 	void remove_vertex(vertex_descriptor v)
 	{
 		G::remove_vertex(v);
-		G::remove_vertex(~v);
+		G::remove_vertex(get(vertex_complement, *this, v));
 	}
 
 	/** Add edge (u,v) to this graph. */
 	std::pair<edge_descriptor, bool>
 	add_edge(vertex_descriptor u, vertex_descriptor v)
 	{
+		vertex_descriptor uc = get(vertex_complement, *this, u);
+		vertex_descriptor vc = get(vertex_complement, *this, v);
 		std::pair<edge_descriptor, bool> e = G::add_edge(u, v);
-		if (u != ~v)
-			G::add_edge(~v, ~u);
+		if (u != vc)
+			G::add_edge(vc, uc);
 		return e;
 	}
 
@@ -179,18 +184,22 @@ class in_edge_iterator
 	add_edge(vertex_descriptor u, vertex_descriptor v,
 			const edge_property_type& ep)
 	{
+		vertex_descriptor uc = get(vertex_complement, *this, u);
+		vertex_descriptor vc = get(vertex_complement, *this, v);
 		std::pair<edge_descriptor, bool> e = G::add_edge(u, v, ep);
-		if (u != ~v)
-			G::add_edge(~v, ~u, ep);
+		if (u != vc)
+			G::add_edge(vc, uc, ep);
 		return e;
 	}
 
 	/** Remove the edge (u,v) from this graph. */
 	void remove_edge(vertex_descriptor u, vertex_descriptor v)
 	{
+		vertex_descriptor uc = get(vertex_complement, *this, u);
+		vertex_descriptor vc = get(vertex_complement, *this, v);
 		G::remove_edge(u, v);
-		if (u != ~v)
-			G::remove_edge(~v, ~u);
+		if (u != vc)
+			G::remove_edge(vc, uc);
 	}
 
 	/** Remove the edge e from this graph. */
@@ -245,7 +254,7 @@ in_edges(
 	typedef typename ContigGraph<G>::out_edge_iterator
 		out_edge_iterator;
 	std::pair<out_edge_iterator, out_edge_iterator> it
-		= out_edges(~u, g);
+		= out_edges(get(vertex_complement, g, u), g);
 	return std::pair<in_edge_iterator, in_edge_iterator>(
 			it.first, it.second);
 }
@@ -405,7 +414,7 @@ template <typename G>
 bool get(vertex_removed_t tag, const ContigGraph<G>& g,
 		typename ContigGraph<G>::vertex_descriptor u)
 {
-	return g.get(tag, u);
+	return get(tag, static_cast<const G&>(g), u);
 }
 
 template <typename G>
@@ -414,7 +423,7 @@ void put(vertex_removed_t tag, ContigGraph<G>& g,
 		bool flag)
 {
 	put(tag, static_cast<G&>(g), u, flag);
-	put(tag, static_cast<G&>(g), ~u, flag);
+	put(tag, static_cast<G&>(g), get(vertex_complement, g, u), flag);
 }
 
 /** Return the properties of the edge of iterator eit. */
@@ -444,6 +453,44 @@ get(edge_bundle_t, const ContigGraph<G>& g,
 	return g[e];
 }
 
+// PropertyGraph
+
+namespace boost {
+template <typename G>
+struct property_map<ContigGraph<G>, vertex_index_t>
+{
+	typedef typename property_map<G, vertex_index_t>::type type;
+	typedef type const_type;
+};
+}
+
+/** Return the complement of the specified vertex. */
+template <typename G>
+typename graph_traits<G>::vertex_descriptor
+get(vertex_complement_t, const ContigGraph<G>&,
+		typename graph_traits<G>::vertex_descriptor u)
+{
+	return u ^ 1;
+}
+
+/** Return the contig index of the specified vertex. */
+template <typename G>
+ContigID
+get(vertex_contig_index_t, const ContigGraph<G>&,
+		typename graph_traits<G>::vertex_descriptor u)
+{
+	return u.contigIndex();
+}
+
+/** Return the sense of the specified vertex. */
+template <typename G>
+bool
+get(vertex_sense_t, const ContigGraph<G>&,
+		typename graph_traits<G>::vertex_descriptor u)
+{
+	return u.sense();
+}
+
 // VertexMutablePropertyGraph
 
 template <typename G>
diff --git a/Graph/ContigGraphAlgorithms.h b/Graph/ContigGraphAlgorithms.h
index b610535..023a898 100644
--- a/Graph/ContigGraphAlgorithms.h
+++ b/Graph/ContigGraphAlgorithms.h
@@ -2,7 +2,9 @@
 #define CONTIGGRAPHALGORITHMS_H 1
 
 #include "Algorithms.h"
+#include "ContigGraph.h"
 #include "ContigNode.h"
+#include "Estimate.h" // for BetterDistanceEst
 #include "Functional.h"
 #include "Iterator.h"
 #include <boost/graph/graph_traits.hpp>
@@ -23,7 +25,8 @@ struct IsPalindrome : std::unary_function<
 	bool operator()(
 			typename graph_traits<Graph>::edge_descriptor e) const
 	{
-		return source(e, m_g) == ~target(e, m_g);
+		return source(e, m_g)
+			== get(vertex_complement, m_g, target(e, m_g));
 	}
   private:
 	const Graph& m_g;
@@ -43,7 +46,7 @@ template<typename Graph>
 bool contiguous_in(const Graph& g,
 		typename graph_traits<Graph>::vertex_descriptor u)
 {
-	return contiguous_out(g, ~u);
+	return contiguous_out(g, get(vertex_complement, g, u));
 }
 
 /** Add the outgoing edges of vertex u to vertex uout. */
@@ -64,7 +67,8 @@ void copy_out_edges(Graph &g,
 	edge_property_type palindrome_ep;
 	for (out_edge_iterator e = edges.first; e != edges.second; ++e) {
 		vertex_descriptor v = target(*e, g);
-		if (~v == u) {
+		vertex_descriptor vc = get(vertex_complement, g, v);
+		if (vc == u) {
 			// When ~v == u, adding the edge (~v,~u), which is (u,~u),
 			// would invalidate our iterator. Add the edge after this
 			// loop completes.
@@ -74,8 +78,10 @@ void copy_out_edges(Graph &g,
 			g.add_edge(uout, v, g[*e]);
 	}
 	if (palindrome) {
-		g.add_edge(uout, ~u, palindrome_ep);
-		g.add_edge(uout, ~uout, palindrome_ep);
+		vertex_descriptor uc = get(vertex_complement, g, u);
+		vertex_descriptor uoutc = get(vertex_complement, g, uout);
+		g.add_edge(uout, uc, palindrome_ep);
+		g.add_edge(uout, uoutc, palindrome_ep);
 	}
 }
 
@@ -85,7 +91,9 @@ void copy_in_edges(Graph& g,
 		typename Graph::vertex_descriptor u,
 		typename Graph::vertex_descriptor v)
 {
-	copy_out_edges(g, ~u, ~v);
+	copy_out_edges(g,
+			get(vertex_complement, g, u),
+			get(vertex_complement, g, v));
 }
 
 /** Assemble a path of unambigous out edges starting at vertex u.
@@ -174,7 +182,8 @@ typename vertex_property<Graph>::type addProp(const Graph& g,
  * Remove the vertices [first, last).
  */
 template<typename Graph, typename It>
-void merge(Graph& g, It first, It last)
+typename graph_traits<Graph>::vertex_descriptor
+merge(Graph& g, It first, It last)
 {
 	typedef typename graph_traits<Graph>::vertex_descriptor
 		vertex_descriptor;
@@ -182,6 +191,7 @@ void merge(Graph& g, It first, It last)
 	vertex_descriptor u = add_vertex(addProp(g, first, last), g);
 	copy_in_edges(g, *first, u);
 	copy_out_edges(g, *(last - 1), u);
+	return u;
 }
 
 /** Assemble unambiguous paths. Write the paths to out.
@@ -252,7 +262,8 @@ OutputIt pruneTips_if(Graph& g, OutputIt result, Pred p)
 
 	/** Remove the tips. */
 	remove_vertex_if(g, tips.begin(), tips.end(), True<V>());
-	copy(tips.begin(), tips.end(), result);
+	std::transform(tips.begin(), tips.end(), result,
+			std::mem_fun_ref(&ContigNode::contigIndex));
 
 	return result;
 }
@@ -287,7 +298,7 @@ OutputIt removeIslands_if(Graph& g, OutputIt result, Pred p)
 		if (get(vertex_removed, g, u))
 			continue;
 		if (p(u) && in_degree(u, g) == 0 && out_degree(u, g) == 0) {
-			*result++ = u;
+			*result++ = get(vertex_contig_index, g, u);
 			clear_vertex(u, g);
 			remove_vertex(u, g);
 		}
@@ -295,4 +306,35 @@ OutputIt removeIslands_if(Graph& g, OutputIt result, Pred p)
 	return result;
 }
 
+/** Add missing complementary edges. */
+template <typename DG>
+size_t addComplementaryEdges(ContigGraph<DG>& g)
+{
+	typedef ContigGraph<DG> Graph;
+	typedef graph_traits<Graph> GTraits;
+	typedef typename GTraits::edge_descriptor E;
+	typedef typename GTraits::edge_iterator Eit;
+	typedef typename GTraits::vertex_descriptor V;
+
+	std::pair<Eit, Eit> erange = edges(g);
+	size_t numAdded = 0;
+	for (Eit eit = erange.first; eit != erange.second; ++eit) {
+		E e = *eit;
+		V u = source(e, g), v = target(e, g);
+		V uc = get(vertex_complement, g, u);
+		V vc = get(vertex_complement, g, v);
+		E f;
+		bool found;
+		tie(f, found) = edge(vc, uc, g);
+		if (!found) {
+			add_edge(vc, uc, g[e], static_cast<DG&>(g));
+			numAdded++;
+		} else if (g[e] != g[f]) {
+			// The edge properties do not agree. Select the better.
+			g[e] = g[f] = BetterDistanceEst()(g[e], g[f]);
+		}
+	}
+	return numAdded;
+}
+
 #endif
diff --git a/Graph/DirectedGraph.h b/Graph/DirectedGraph.h
index b0c6158..eec9682 100644
--- a/Graph/DirectedGraph.h
+++ b/Graph/DirectedGraph.h
@@ -346,7 +346,9 @@ class Edge
 	/** Return properties of vertex u. */
 	const vertex_property_type& operator[](vertex_descriptor u) const
 	{
-		return m_vertices[index(u)].get_property();
+		vertices_size_type ui = get(vertex_index, *this, u);
+		assert(ui < num_vertices());
+		return m_vertices[ui].get_property();
 	}
 
 	/** Returns an iterator-range to the vertices. */
@@ -371,8 +373,9 @@ class Edge
 	std::pair<out_edge_iterator, out_edge_iterator>
 	out_edges(vertex_descriptor u) const
 	{
-		assert(index(u) < num_vertices());
-		return m_vertices[index(u)].out_edges(u);
+		vertices_size_type ui = get(vertex_index, *this, u);
+		assert(ui < num_vertices());
+		return m_vertices[ui].out_edges(u);
 	}
 
 	/** Returns an iterator-range to the adjacent vertices of
@@ -380,8 +383,9 @@ class Edge
 	std::pair<adjacency_iterator, adjacency_iterator>
 	adjacent_vertices(vertex_descriptor u) const
 	{
-		assert(index(u) < num_vertices());
-		return m_vertices[index(u)].adjacent_vertices();
+		vertices_size_type ui = get(vertex_index, *this, u);
+		assert(ui < num_vertices());
+		return m_vertices[ui].adjacent_vertices();
 	}
 
 	/** Adds edge (u,v) to this graph. */
@@ -389,16 +393,19 @@ class Edge
 	add_edge(vertex_descriptor u, vertex_descriptor v,
 			const edge_property_type& ep = edge_property_type())
 	{
-		assert(index(u) < num_vertices());
-		assert(index(v) < num_vertices());
+		vertices_size_type ui = get(vertex_index, *this, u);
+		assert(ui < num_vertices());
+		assert(get(vertex_index, *this, v) < num_vertices());
 		return make_pair(edge_descriptor(u, v),
-				m_vertices[index(u)].add_edge(v, ep));
+				m_vertices[ui].add_edge(v, ep));
 	}
 
 	/** Remove the edge (u,v) from this graph. */
 	void remove_edge(vertex_descriptor u, vertex_descriptor v)
 	{
-		m_vertices[index(u)].remove_edge(v);
+		vertices_size_type ui = get(vertex_index, *this, u);
+		assert(ui < num_vertices());
+		m_vertices[ui].remove_edge(v);
 	}
 
 	/** Remove the edge e from this graph. */
@@ -410,7 +417,9 @@ class Edge
 	/** Remove all out edges from vertex u. */
 	void clear_out_edges(vertex_descriptor u)
 	{
-		m_vertices[index(u)].clear_out_edges();
+		vertices_size_type ui = get(vertex_index, *this, u);
+		assert(ui < num_vertices());
+		m_vertices[ui].clear_out_edges();
 	}
 
 	/** Remove all edges to and from vertex u from this graph.
@@ -427,10 +436,10 @@ class Edge
 	/** Set the vertex_removed property. */
 	void put(vertex_removed_t, vertex_descriptor u, bool flag)
 	{
-		unsigned i = index(u);
-		if (i >= m_removed.size())
-			m_removed.resize(i + 1);
-		m_removed[i] = flag;
+		vertices_size_type ui = get(vertex_index, *this, u);
+		if (ui >= m_removed.size())
+			m_removed.resize(ui + 1);
+		m_removed[ui] = flag;
 	}
 
 	/** Remove vertex u from this graph. It is assumed that there
@@ -461,7 +470,9 @@ class Edge
 	/** Return the out degree of vertex u. */
 	degree_size_type out_degree(vertex_descriptor u) const
 	{
-		return m_vertices[index(u)].out_degree();
+		vertices_size_type ui = get(vertex_index, *this, u);
+		assert(ui < num_vertices());
+		return m_vertices[ui].out_degree();
 	}
 
 	/** Return the nth vertex. */
@@ -484,28 +495,26 @@ class Edge
 	std::pair<edge_descriptor, bool> edge(
 			vertex_descriptor u, vertex_descriptor v) const
 	{
-		unsigned i = index(u);
-		assert(i < m_vertices.size());
+		vertices_size_type ui = get(vertex_index, *this, u);
+		assert(ui < num_vertices());
 		return make_pair(edge_descriptor(u, v),
-				m_vertices[i].edge(v));
-	}
-
-	/** Return true if this vertex has been removed. */
-	bool get(vertex_removed_t, vertex_descriptor u) const
-	{
-		return is_removed(u);
+				m_vertices[ui].edge(v));
 	}
 
 	/** Return properties of edge e. */
 	edge_property_type& operator[](edge_descriptor e)
 	{
-		return m_vertices[index(e.first)][e.second];
+		vertices_size_type ui = get(vertex_index, *this, e.first);
+		assert(ui < num_vertices());
+		return m_vertices[ui][e.second];
 	}
 
 	/** Return properties of edge e. */
 	const edge_property_type& operator[](edge_descriptor e) const
 	{
-		return m_vertices[index(e.first)][e.second];
+		vertices_size_type ui = get(vertex_index, *this, e.first);
+		assert(ui < num_vertices());
+		return m_vertices[ui][e.second];
 	}
 
 	/** Remove edges that satisfy the predicate. */
@@ -518,14 +527,14 @@ class Edge
 			it->remove_edge_if(vertex(i++), predicate);
 	}
 
-  private:
 	/** Return true if this vertex has been removed. */
 	bool is_removed(vertex_descriptor u) const
 	{
-		unsigned i = index(u);
-		return i < m_removed.size() ? m_removed[i] : false;
+		vertices_size_type ui = get(vertex_index, *this, u);
+		return ui < m_removed.size() ? m_removed[ui] : false;
 	}
 
+  private:
 	DirectedGraph& operator =(const DirectedGraph& x);
 
 	/** The set of vertices. */
@@ -704,10 +713,10 @@ remove_edge_if(Predicate predicate, DirectedGraph<VP, EP>& g)
 
 /** Return true if this vertex has been removed. */
 template <typename VP, typename EP>
-bool get(vertex_removed_t tag, const DirectedGraph<VP, EP>& g,
+bool get(vertex_removed_t, const DirectedGraph<VP, EP>& g,
 		typename DirectedGraph<VP, EP>::vertex_descriptor u)
 {
-	return g.get(tag, u);
+	return g.is_removed(u);
 }
 
 template <typename VP, typename EP>
@@ -745,6 +754,32 @@ get(edge_bundle_t, const DirectedGraph<VP, EP>& g,
 	return g[e];
 }
 
+// PropertyGraph vertex_index
+
+namespace boost {
+template <typename VP, typename EP>
+struct property_map<DirectedGraph<VP, EP>, vertex_index_t>
+{
+	typedef ContigNodeIndexMap type;
+	typedef type const_type;
+};
+}
+
+template <typename VP, typename EP>
+ContigNodeIndexMap
+get(vertex_index_t, const DirectedGraph<VP, EP>&)
+{
+	return ContigNodeIndexMap();
+}
+
+template <typename VP, typename EP>
+ContigNodeIndexMap::reference
+get(vertex_index_t tag, const DirectedGraph<VP, EP>& g,
+		typename DirectedGraph<VP, EP>::vertex_descriptor u)
+{
+	return get(get(tag, g), u);
+}
+
 // VertexMutablePropertyGraph
 
 template <typename VP, typename EP>
@@ -767,4 +802,21 @@ add_edge(
 	return g.add_edge(u, v, ep);
 }
 
+// NamedGraph
+
+template <typename VP, typename EP>
+typename DirectedGraph<VP, EP>::vertex_descriptor
+find_vertex(const std::string& name, const DirectedGraph<VP, EP>&)
+{
+	return find_vertex(name, g_contigNames);
+}
+
+template <typename VP, typename EP>
+typename DirectedGraph<VP, EP>::vertex_descriptor
+find_vertex(const std::string& name, bool sense,
+		const DirectedGraph<VP, EP>&)
+{
+	return find_vertex(name, sense, g_contigNames);
+}
+
 #endif
diff --git a/Graph/DistIO.h b/Graph/DistIO.h
index f077ef4..8e33a26 100644
--- a/Graph/DistIO.h
+++ b/Graph/DistIO.h
@@ -1,7 +1,6 @@
 #ifndef DISTIO_H
 #define DISTIO_H 1
 
-#include "ContigID.h"
 #include <boost/graph/graph_traits.hpp>
 #include <cassert>
 #include <ostream>
@@ -24,14 +23,15 @@ std::ostream& write_dist(std::ostream& out, const Graph& g)
 			continue;
 		bool sense = get(vertex_sense, g, u);
 		if (!sense)
-			out << ContigID(u);
+			out << get(vertex_contig_name, g, u);
 		else
 			out << " ;";
 		std::pair<Eit, Eit> erange = out_edges(u, g);
 		for (Eit eit = erange.first; eit != erange.second; ++eit) {
 			V v = target(*eit, g) ^ sense;
 			assert(!get(vertex_removed, g, v));
-			out << ' ' << v << ',' << get(edge_bundle, g, eit);
+			out << ' ' << get(vertex_name, g, v)
+				<< ',' << get(edge_bundle, g, eit);
 		}
 		if (sense)
 			out << '\n';
diff --git a/Graph/DotIO.h b/Graph/DotIO.h
index afd4dff..0e08639 100644
--- a/Graph/DotIO.h
+++ b/Graph/DotIO.h
@@ -1,7 +1,7 @@
 #ifndef DOTIO_H
 #define DOTIO_H 1
 
-#include "ContigID.h" // for ContigID::lock
+#include "ContigID.h" // for g_contigNames.lock
 #include "Graph/Options.h"
 #include "IOUtil.h"
 #include <boost/graph/graph_traits.hpp>
@@ -17,7 +17,8 @@ void write_vertex(std::ostream& out, const Graph& g,
 		typename graph_traits<Graph>::vertex_descriptor u,
 		const VertexProp*)
 {
-	out << '"' << u << "\" [" << get(vertex_bundle, g, u) << "]\n";
+	out << '"' << get(vertex_name, g, u) << "\""
+		" [" << get(vertex_bundle, g, u) << "]\n";
 }
 
 template <typename Graph>
@@ -40,9 +41,8 @@ void write_edges(std::ostream& out, const Graph& g,
 	std::pair<out_edge_iterator, out_edge_iterator>
 		adj = out_edges(u, g);
 	for (out_edge_iterator e = adj.first; e != adj.second; ++e) {
-		vertex_descriptor v = target(*e, g);
-		assert(!get(vertex_removed, g, v));
-		out << '"' << u << "\" -> \"" << v << '"';
+		assert(!get(vertex_removed, g, target(*e, g)));
+		out << get(edge_name, g, *e);
 		const edge_property_type& ep = get(edge_bundle, g, e);
 		if (!(ep == edge_property_type()))
 			out << " [" << ep << ']';
@@ -60,13 +60,13 @@ void write_edges(std::ostream& out, const Graph& g,
 	unsigned outdeg = out_degree(u, g);
 	if (outdeg == 0)
 		return;
-	out << '"' << u << "\" ->";
+	out << '"' << get(vertex_name, g, u) << "\" ->";
 	if (outdeg > 1)
 		out << " {";
 	std::pair<adjacency_iterator, adjacency_iterator>
 		adj = adjacent_vertices(u, g);
 	for (adjacency_iterator v = adj.first; v != adj.second; ++v)
-		out << " \"" << *v << '"';
+		out << " \"" << get(vertex_name, g, *v) << '"';
 	if (outdeg > 1)
 		out << " }";
 	out << '\n';
@@ -140,12 +140,13 @@ std::istream& read_dot_name(std::istream& in, std::string& s)
 }
 
 /** Read a vertex descriptor delimited by double quotes. */
-template <typename VertexDescriptor>
-std::istream& read_dot_id(std::istream& in, VertexDescriptor& u)
+template <typename Graph>
+std::istream& read_dot_id(std::istream& in, const Graph& g,
+		typename graph_traits<Graph>::vertex_descriptor& u)
 {
 	std::string s;
 	if (read_dot_name(in, s))
-		u = VertexDescriptor(s);
+		u = find_vertex(s, g);
 	return in;
 }
 
@@ -211,8 +212,9 @@ std::istream& read_dot(std::istream& in, Graph& g, BetterEP betterEP)
 				vertex_descriptor u = add_vertex(g);
 				put(vertex_name, g, u, uname);
 			} else {
-				vertex_descriptor u(uname);
+				vertex_descriptor u = find_vertex(uname, g);
 				assert(get(vertex_index, g, u) < num_vertices(g));
+				(void)u;
 			}
 		} else if (c == '[') {
 			// Vertex properties
@@ -223,7 +225,7 @@ std::istream& read_dot(std::istream& in, Graph& g, BetterEP betterEP)
 				vertex_descriptor u = add_vertex(vp, g);
 				put(vertex_name, g, u, uname);
 			} else {
-				vertex_descriptor u(uname);
+				vertex_descriptor u = find_vertex(uname, g);
 				assert(get(vertex_index, g, u) < num_vertices(g));
 				if (g[u] != vp) {
 					std::cerr << "error: "
@@ -237,13 +239,13 @@ std::istream& read_dot(std::istream& in, Graph& g, BetterEP betterEP)
 			// Edge
 			in >> expect(">");
 			assert(in);
-			ContigID::lock();
+			g_contigNames.lock();
 
-			vertex_descriptor u(uname);
+			vertex_descriptor u = find_vertex(uname, g);
 			if (in >> std::ws && in.peek() == '{') {
 				// Subgraph
 				in >> expect("{");
-				for (vertex_descriptor v; read_dot_id(in, v);)
+				for (vertex_descriptor v; read_dot_id(in, g, v);)
 					add_edge(u, v, defaultEdgeProp, g);
 				if (in.fail())
 					in.clear();
@@ -251,8 +253,7 @@ std::istream& read_dot(std::istream& in, Graph& g, BetterEP betterEP)
 				assert(in);
 			} else {
 				vertex_descriptor v;
-				read_dot_id(in, v);
-				if (in.fail()) {
+				if (!read_dot_id(in, g, v)) {
 					in.clear();
 					std::cerr << "error: Expected `\"' and saw `"
 						<< (char)in.peek() << "'.\n";
diff --git a/Graph/Makefile.in b/Graph/Makefile.in
index 42a0ef9..16c0741 100644
--- a/Graph/Makefile.in
+++ b/Graph/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# Makefile.in generated by automake 1.12 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -17,6 +17,23 @@
 
 
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -35,7 +52,8 @@ PRE_UNINSTALL = :
 POST_UNINSTALL = :
 bin_PROGRAMS = abyss-gc$(EXEEXT) abyss-todot$(EXEEXT)
 subdir = Graph
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -79,6 +97,11 @@ SOURCES = $(libgraph_a_SOURCES) $(abyss_gc_SOURCES) \
 	$(abyss_todot_SOURCES)
 DIST_SOURCES = $(libgraph_a_SOURCES) $(abyss_gc_SOURCES) \
 	$(abyss_todot_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -251,8 +274,11 @@ libgraph.a: $(libgraph_a_OBJECTS) $(libgraph_a_DEPENDENCIES) $(EXTRA_libgraph_a_
 	$(RANLIB) libgraph.a
 install-binPROGRAMS: $(bin_PROGRAMS)
 	@$(NORMAL_INSTALL)
-	test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
 	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+	fi; \
 	for p in $$list; do echo "$$p $$p"; done | \
 	sed 's/$(EXEEXT)$$//' | \
 	while read p p1; do if test -f $$p; \
@@ -422,6 +448,20 @@ GTAGS:
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
 
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
@@ -565,7 +605,7 @@ uninstall-am: uninstall-binPROGRAMS
 .MAKE: install-am install-strip
 
 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
-	clean-generic clean-noinstLIBRARIES ctags distclean \
+	clean-generic clean-noinstLIBRARIES cscopelist ctags distclean \
 	distclean-compile distclean-generic distclean-tags distdir dvi \
 	dvi-am html html-am info info-am install install-am \
 	install-binPROGRAMS install-data install-data-am install-dvi \
diff --git a/Graph/PopBubbles.h b/Graph/PopBubbles.h
index 1c35655..8eea310 100644
--- a/Graph/PopBubbles.h
+++ b/Graph/PopBubbles.h
@@ -32,9 +32,12 @@ template <typename Graph, typename It>
 void topologicalSort(const Graph& g, It it)
 {
 	using boost::default_color_type;
+	using boost::property_map;
 	using boost::vector_property_map;
-	typedef vector_property_map<
-		default_color_type, ContigNodeIndexMap> ColorMap;
+	typedef typename property_map<Graph, vertex_index_t>::type
+		VertexIndexMap;
+	typedef vector_property_map<default_color_type, VertexIndexMap>
+		ColorMap;
 	depthFirstSearch(g, TopoVisitor<It>(it),
 			ColorMap(num_vertices(g)));
 }
@@ -44,11 +47,12 @@ template <typename Graph, typename It>
 bool isBubble(const Graph& g, It first, It last)
 {
 	typedef typename graph_traits<Graph>::adjacency_iterator Ait;
+	typedef typename graph_traits<Graph>::in_edge_iterator Iit;
 	typedef typename graph_traits<Graph>::vertex_descriptor V;
 	assert(last - first > 1);
 	if (last - first == 2)
 		return false; // unambiguous edge
-	if (*first == ~last[-1])
+	if (*first == get(vertex_complement, g, last[-1]))
 		return false; // palindrome
 	std::set<V> targets(first, first + 1);
 	for (It it = first; it != last - 1; ++it) {
@@ -57,10 +61,9 @@ bool isBubble(const Graph& g, It first, It last)
 	}
 	std::set<V> sources(last - 1, last);
 	for (It it = first + 1; it != last; ++it) {
-		std::pair<Ait, Ait> adj = adjacent_vertices(~*it, g);
-		transform(adj.first, adj.second,
-				inserter(sources, sources.end()),
-				std::mem_fun_ref(&V::operator~));
+		std::pair<Iit, Iit> adj = in_edges(*it, g);
+		for (Iit eit = adj.first; eit != adj.second; ++eit)
+			sources.insert(source(*eit, g));
 	}
 	std::set<V> bubble(first, last);
 	return sources == bubble && targets == bubble;
@@ -85,14 +88,15 @@ Bubbles discoverBubbles(const Graph& g)
 		if (sum < 2)
 			continue;
 		if (opt::verbose > 3)
-			std::cerr << "* " << *first << '\n';
+			std::cerr << "* " << get(vertex_name, g, *first) << '\n';
 		for (It it = first + 1; it != topo.end(); ++it) {
 			unsigned indeg = in_degree(*it, g);
 			unsigned outdeg = out_degree(*it, g);
 			sum -= indeg;
 
 			if (opt::verbose > 3)
-				std::cerr << *it << '\t' << indeg << '\t' << outdeg
+				std::cerr << get(vertex_name, g, *it)
+					<< '\t' << indeg << '\t' << outdeg
 					<< '\t' << sum
 					<< '\t' << sum + (int)outdeg << '\n';
 
diff --git a/Graph/Properties.h b/Graph/Properties.h
index b2a3274..c577b6d 100644
--- a/Graph/Properties.h
+++ b/Graph/Properties.h
@@ -8,6 +8,15 @@
 /** The distance between two vertices. */
 enum edge_distance_t { edge_distance };
 
+/** The complementary vertex of a skew-symmetric graph. */
+enum vertex_complement_t { vertex_complement };
+
+/** The index of a contig. */
+enum vertex_contig_index_t { vertex_contig_index };
+
+/** The name of a contig without an orientation. */
+enum vertex_contig_name_t { vertex_contig_name };
+
 /** The coverage of a vertex. */
 enum vertex_coverage_t { vertex_coverage };
 
@@ -22,6 +31,8 @@ enum vertex_sense_t { vertex_sense };
 
 using boost::edge_bundle;
 using boost::edge_bundle_t;
+using boost::edge_name;
+using boost::edge_name_t;
 using boost::edge_weight;
 using boost::edge_weight_t;
 using boost::no_property;
@@ -39,6 +50,9 @@ using boost::vertex_property;
 
 namespace boost {
 	BOOST_INSTALL_PROPERTY(edge, distance);
+	BOOST_INSTALL_PROPERTY(vertex, complement);
+	BOOST_INSTALL_PROPERTY(vertex, contig_index);
+	BOOST_INSTALL_PROPERTY(vertex, contig_name);
 	BOOST_INSTALL_PROPERTY(vertex, coverage);
 	BOOST_INSTALL_PROPERTY(vertex, length);
 	BOOST_INSTALL_PROPERTY(vertex, removed);
diff --git a/Graph/SAMIO.h b/Graph/SAMIO.h
index b9ab99c..b2da70c 100644
--- a/Graph/SAMIO.h
+++ b/Graph/SAMIO.h
@@ -35,7 +35,7 @@ std::ostream& write_sam(std::ostream& out, const Graph& g,
  		if (get(vertex_removed, g, *u))
 			continue;
 		const vertex_property_type& vp = g[*u];
-		out << "@SQ\tSN:" << ContigID(*u)
+		out << "@SQ\tSN:" << get(vertex_contig_name, g, *u)
 			<< "\tLN:" << vp.length;
 		if (vp.coverage > 0)
 			out << "\tXC:" << vp.coverage;
@@ -52,9 +52,9 @@ std::ostream& write_sam(std::ostream& out, const Graph& g,
 		unsigned flag = u.sense() == v.sense() ? 0 : 0x10; //FREVERSE
 		unsigned alen = -distance;
 		unsigned pos = 1 + (u.sense() ? 0 : g[u].length - alen);
-		out << ContigID(v) // QNAME
+		out << get(vertex_contig_name, g, v) // QNAME
 			<< '\t' << flag // FLAG
-			<< '\t' << ContigID(u) // RNAME
+			<< '\t' << get(vertex_contig_name, g, u) // RNAME
 			<< '\t' << pos // POS
 			<< "\t255\t"; // MAPQ
 		// CIGAR
diff --git a/Graph/gc.cc b/Graph/gc.cc
index 881496e..f27f915 100644
--- a/Graph/gc.cc
+++ b/Graph/gc.cc
@@ -59,7 +59,7 @@ static void readGraph(const string& path, Graph& g, BetterEP betterEP)
 	read_graph(in, g, betterEP);
 	assert(in.eof());
 	printGraphStats(cout, g);
-	ContigID::lock();
+	g_contigNames.lock();
 }
 
 /** Read a graph from the specified files. */
diff --git a/Graph/todot.cc b/Graph/todot.cc
index 72a84b7..16a50b5 100644
--- a/Graph/todot.cc
+++ b/Graph/todot.cc
@@ -88,7 +88,7 @@ static void readGraph(const string& path, Graph& g, BetterEP betterEP)
 	assert(in.eof());
 	if (opt::verbose > 0)
 		printGraphStats(cerr, g);
-	ContigID::lock();
+	g_contigNames.lock();
 }
 
 /** Read a graph from the specified files. */
diff --git a/KAligner/Makefile.in b/KAligner/Makefile.in
index 766c179..1dfe4bd 100644
--- a/KAligner/Makefile.in
+++ b/KAligner/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# Makefile.in generated by automake 1.12 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -16,6 +16,23 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -34,7 +51,8 @@ PRE_UNINSTALL = :
 POST_UNINSTALL = :
 bin_PROGRAMS = KAligner$(EXEEXT)
 subdir = KAligner
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -67,6 +85,11 @@ CCLD = $(CC)
 LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
 SOURCES = $(KAligner_SOURCES)
 DIST_SOURCES = $(KAligner_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -213,8 +236,11 @@ $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 $(am__aclocal_m4_deps):
 install-binPROGRAMS: $(bin_PROGRAMS)
 	@$(NORMAL_INSTALL)
-	test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
 	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+	fi; \
 	for p in $$list; do echo "$$p $$p"; done | \
 	sed 's/$(EXEEXT)$$//' | \
 	while read p p1; do if test -f $$p; \
@@ -352,6 +378,20 @@ GTAGS:
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
 
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
@@ -494,7 +534,7 @@ uninstall-am: uninstall-binPROGRAMS
 .MAKE: install-am install-strip
 
 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
-	clean-generic ctags distclean distclean-compile \
+	clean-generic cscopelist ctags distclean distclean-compile \
 	distclean-generic distclean-tags distdir dvi dvi-am html \
 	html-am info info-am install install-am install-binPROGRAMS \
 	install-data install-data-am install-dvi install-dvi-am \
diff --git a/Makefile.am b/Makefile.am
index 7ae0074..19e84f9 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -3,7 +3,7 @@ Parallel=Parallel
 endif
 
 dist_doc_DATA = ChangeLog COPYRIGHT LICENSE \
-	README README.css README.html
+	README.css README.html README.md
 
 EXTRA_DIST=doxygen.conf
 
@@ -34,5 +34,5 @@ SUBDIRS = \
 	kmerprint \
 	FilterGraph
 
-README.html: %.html: %
+%.html: %.md
 	multimarkdown $< >$@
diff --git a/Makefile.in b/Makefile.in
index abc27eb..a9a26fa 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# Makefile.in generated by automake 1.12 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -16,6 +16,23 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -33,7 +50,7 @@ NORMAL_UNINSTALL = :
 PRE_UNINSTALL = :
 POST_UNINSTALL = :
 subdir = .
-DIST_COMMON = README $(am__configure_deps) $(dist_doc_DATA) \
+DIST_COMMON = $(am__configure_deps) $(dist_doc_DATA) \
 	$(srcdir)/Makefile.am $(srcdir)/Makefile.in \
 	$(srcdir)/config.h.in $(top_srcdir)/configure ChangeLog \
 	depcomp install-sh missing
@@ -56,6 +73,11 @@ RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
 	install-pdf-recursive install-ps-recursive install-recursive \
 	installcheck-recursive installdirs-recursive pdf-recursive \
 	ps-recursive uninstall-recursive
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
 am__vpath_adj = case $$p in \
     $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
@@ -89,9 +111,10 @@ RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
   distclean-recursive maintainer-clean-recursive
 AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
 	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
-	distdir dist dist-all distcheck
+	cscope distdir dist dist-all distcheck
 ETAGS = etags
 CTAGS = ctags
+CSCOPE = cscope
 DIST_SUBDIRS = bin doc Assembly Common DataLayer FMIndex Graph dialign \
 	Align ABYSS Parallel AdjList Consensus DAssembler DistanceEst \
 	KAligner Map MergePaths Overlap ParseAligns PathOverlap \
@@ -105,6 +128,7 @@ am__remove_distdir = \
       && rm -rf "$(distdir)" \
       || { sleep 5 && rm -rf "$(distdir)"; }; \
   else :; fi
+am__post_remove_distdir = $(am__remove_distdir)
 am__relativize = \
   dir0=`pwd`; \
   sed_first='s,^\([^/]*\)/.*$$,\1,'; \
@@ -132,6 +156,7 @@ am__relativize = \
   reldir="$$dir2"
 DIST_ARCHIVES = $(distdir).tar.gz
 GZIP_ENV = --best
+DIST_TARGETS = dist-gzip
 distuninstallcheck_listfiles = find . -type f -print
 am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
   | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
@@ -233,7 +258,7 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 @HAVE_LIBMPI_TRUE at Parallel = Parallel
 dist_doc_DATA = ChangeLog COPYRIGHT LICENSE \
-	README README.css README.html
+	README.css README.html README.md
 
 EXTRA_DIST = doxygen.conf
 SUBDIRS = \
@@ -318,8 +343,11 @@ distclean-hdr:
 	-rm -f config.h stamp-h1
 install-dist_docDATA: $(dist_doc_DATA)
 	@$(NORMAL_INSTALL)
-	test -z "$(docdir)" || $(MKDIR_P) "$(DESTDIR)$(docdir)"
 	@list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(docdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(docdir)" || exit 1; \
+	fi; \
 	for p in $$list; do \
 	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
 	  echo "$$d$$p"; \
@@ -336,11 +364,11 @@ uninstall-dist_docDATA:
 	dir='$(DESTDIR)$(docdir)'; $(am__uninstall_files_from_dir)
 
 # This directory's subdirectories are mostly independent; you can cd
-# into them and run `make' without going through this Makefile.
-# To change the values of `make' variables: instead of editing Makefiles,
-# (1) if the variable is set in `config.status', edit `config.status'
-#     (which will cause the Makefiles to be regenerated when you run `make');
-# (2) otherwise, pass the desired values on the `make' command line.
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+#     (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
 $(RECURSIVE_TARGETS):
 	@fail= failcom='exit 1'; \
 	for f in x $$MAKEFLAGS; do \
@@ -404,6 +432,10 @@ ctags-recursive:
 	list='$(SUBDIRS)'; for subdir in $$list; do \
 	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
 	done
+cscopelist-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \
+	done
 
 ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
 	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
@@ -467,8 +499,32 @@ GTAGS:
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
 
+cscope: cscope.files
+	test ! -s cscope.files \
+	  || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
+
+clean-cscope:
+	-rm -f cscope.files
+
+cscope.files: clean-cscope cscopelist-recursive cscopelist
+
+cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+	-rm -f cscope.out cscope.in.out cscope.po.out cscope.files
 
 distdir: $(DISTFILES)
 	$(am__remove_distdir)
@@ -504,13 +560,10 @@ distdir: $(DISTFILES)
 	done
 	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
 	  if test "$$subdir" = .; then :; else \
-	    test -d "$(distdir)/$$subdir" \
-	    || $(MKDIR_P) "$(distdir)/$$subdir" \
-	    || exit 1; \
-	  fi; \
-	done
-	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
-	  if test "$$subdir" = .; then :; else \
+	    $(am__make_dryrun) \
+	      || test -d "$(distdir)/$$subdir" \
+	      || $(MKDIR_P) "$(distdir)/$$subdir" \
+	      || exit 1; \
 	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
 	    $(am__relativize); \
 	    new_distdir=$$reldir; \
@@ -539,40 +592,36 @@ distdir: $(DISTFILES)
 	|| chmod -R a+r "$(distdir)"
 dist-gzip: distdir
 	tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
-	$(am__remove_distdir)
+	$(am__post_remove_distdir)
 
 dist-bzip2: distdir
 	tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
-	$(am__remove_distdir)
+	$(am__post_remove_distdir)
 
 dist-lzip: distdir
 	tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
-	$(am__remove_distdir)
-
-dist-lzma: distdir
-	tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
-	$(am__remove_distdir)
+	$(am__post_remove_distdir)
 
 dist-xz: distdir
 	tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
-	$(am__remove_distdir)
+	$(am__post_remove_distdir)
 
 dist-tarZ: distdir
 	tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
-	$(am__remove_distdir)
+	$(am__post_remove_distdir)
 
 dist-shar: distdir
 	shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
-	$(am__remove_distdir)
+	$(am__post_remove_distdir)
 
 dist-zip: distdir
 	-rm -f $(distdir).zip
 	zip -rq $(distdir).zip $(distdir)
-	$(am__remove_distdir)
+	$(am__post_remove_distdir)
 
-dist dist-all: distdir
-	tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
-	$(am__remove_distdir)
+dist dist-all:
+	$(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:'
+	$(am__post_remove_distdir)
 
 # This target untars the dist file and tries a VPATH configuration.  Then
 # it guarantees that the distribution is self-contained by making another
@@ -583,8 +632,6 @@ distcheck: dist
 	  GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
 	*.tar.bz2*) \
 	  bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
-	*.tar.lzma*) \
-	  lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\
 	*.tar.lz*) \
 	  lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
 	*.tar.xz*) \
@@ -630,7 +677,7 @@ distcheck: dist
 	  && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
 	  && cd "$$am__cwd" \
 	  || exit 1
-	$(am__remove_distdir)
+	$(am__post_remove_distdir)
 	@(echo "$(distdir) archives ready for distribution: "; \
 	  list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
 	  sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
@@ -768,26 +815,28 @@ ps-am:
 uninstall-am: uninstall-dist_docDATA
 
 .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \
-	ctags-recursive install-am install-strip tags-recursive
+	cscopelist-recursive ctags-recursive install-am install-strip \
+	tags-recursive
 
 .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
-	all all-am am--refresh check check-am clean clean-generic \
-	ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \
-	dist-lzip dist-lzma dist-shar dist-tarZ dist-xz dist-zip \
-	distcheck distclean distclean-generic distclean-hdr \
-	distclean-tags distcleancheck distdir distuninstallcheck dvi \
-	dvi-am html html-am info info-am install install-am \
-	install-data install-data-am install-dist_docDATA install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-ps install-ps-am \
-	install-strip installcheck installcheck-am installdirs \
-	installdirs-am maintainer-clean maintainer-clean-generic \
-	mostlyclean mostlyclean-generic pdf pdf-am ps ps-am tags \
-	tags-recursive uninstall uninstall-am uninstall-dist_docDATA
-
-
-README.html: %.html: %
+	all all-am am--refresh check check-am clean clean-cscope \
+	clean-generic cscope cscopelist cscopelist-recursive ctags \
+	ctags-recursive dist dist-all dist-bzip2 dist-gzip dist-lzip \
+	dist-shar dist-tarZ dist-xz dist-zip distcheck distclean \
+	distclean-generic distclean-hdr distclean-tags distcleancheck \
+	distdir distuninstallcheck dvi dvi-am html html-am info \
+	info-am install install-am install-data install-data-am \
+	install-dist_docDATA install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-ps install-ps-am install-strip installcheck \
+	installcheck-am installdirs installdirs-am maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
+	pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \
+	uninstall-dist_docDATA
+
+
+%.html: %.md
 	multimarkdown $< >$@
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/Map/Makefile.in b/Map/Makefile.in
index 8b8cba5..00ece28 100644
--- a/Map/Makefile.in
+++ b/Map/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# Makefile.in generated by automake 1.12 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -16,6 +16,23 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -35,7 +52,8 @@ POST_UNINSTALL = :
 bin_PROGRAMS = abyss-index$(EXEEXT) abyss-map$(EXEEXT) \
 	abyss-overlap$(EXEEXT)
 subdir = Map
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -78,6 +96,11 @@ SOURCES = $(abyss_index_SOURCES) $(abyss_map_SOURCES) \
 	$(abyss_overlap_SOURCES)
 DIST_SOURCES = $(abyss_index_SOURCES) $(abyss_map_SOURCES) \
 	$(abyss_overlap_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -247,8 +270,11 @@ $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 $(am__aclocal_m4_deps):
 install-binPROGRAMS: $(bin_PROGRAMS)
 	@$(NORMAL_INSTALL)
-	test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
 	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+	fi; \
 	for p in $$list; do echo "$$p $$p"; done | \
 	sed 's/$(EXEEXT)$$//' | \
 	while read p p1; do if test -f $$p; \
@@ -407,6 +433,20 @@ GTAGS:
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
 
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
@@ -549,7 +589,7 @@ uninstall-am: uninstall-binPROGRAMS
 .MAKE: install-am install-strip
 
 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
-	clean-generic ctags distclean distclean-compile \
+	clean-generic cscopelist ctags distclean distclean-compile \
 	distclean-generic distclean-tags distdir dvi dvi-am html \
 	html-am info info-am install install-am install-binPROGRAMS \
 	install-data install-data-am install-dvi install-dvi-am \
diff --git a/Map/index.cc b/Map/index.cc
index cd52109..ec041f0 100644
--- a/Map/index.cc
+++ b/Map/index.cc
@@ -13,7 +13,6 @@
 #include <getopt.h>
 #include <iostream>
 #include <iterator>
-#include <sstream>
 #include <string>
 
 using namespace std;
@@ -33,7 +32,8 @@ static const char USAGE_MESSAGE[] =
 "      --both              build both FAI and FM indexes [default]\n"
 "      --fai               build a FAI index\n"
 "      --fm                build a FM index\n"
-"      --bwt               build the BWT\n"
+"      --fa2bwt            build the BWT directly without the SA\n"
+"      --bwt2fm            build the FM index from the BWT\n"
 "  -a, --alphabet=STRING   use the alphabet STRING [-ACGT]\n"
 "  -s, --sample=N          sample the suffix array [16]\n"
 "  -d, --decompress        decompress the index FILE\n"
@@ -52,8 +52,11 @@ namespace opt {
 	enum { NONE, FAI, FM, BOTH };
 	static int indexes = BOTH;
 
-	/** Output the BWT. */
-	static int bwt;
+	/** Build the BWT directly without the SA. */
+	static int fa2bwt;
+
+	/** Build the FM index from the BWT. */
+	static int bwt2fm;
 
 	/** The alphabet. */
 	static string alphabet = "-ACGT";
@@ -76,7 +79,8 @@ static const struct option longopts[] = {
 	{ "both", no_argument, &opt::indexes, opt::BOTH },
 	{ "fai", no_argument, &opt::indexes, opt::FAI },
 	{ "fm", no_argument, &opt::indexes, opt::FM },
-	{ "bwt", no_argument, &opt::bwt, true },
+	{ "fa2bwt", no_argument, &opt::fa2bwt, true },
+	{ "bwt2fm", no_argument, &opt::bwt2fm, true },
 	{ "alphabet", optional_argument, NULL, 'a' },
 	{ "decompress", no_argument, NULL, 'd' },
 	{ "sample", required_argument, NULL, 's' },
@@ -104,13 +108,34 @@ static void indexFasta(const string& faPath, const string& faiPath)
 	assert_good(out, faiPath);
 }
 
+/** Build the FM index from the BWT. */
+static void buildFMIndexFromBWT(FMIndex& fm, const string& path)
+{
+	if (opt::verbose > 0)
+		cerr << "Reading `" << path << "'...\n";
+	std::vector<FMIndex::value_type> bwt;
+	readFile(path.c_str(), bwt);
+	assert(bwt.size() > 1);
+
+	if (opt::alphabet.empty()) {
+		fm.setAlphabet(bwt.begin(), bwt.end());
+		std::cerr << "The alphabet has "
+			<< fm.alphabetSize() << " symbols.\n";
+	} else
+		fm.setAlphabet(opt::alphabet);
+
+	fm.encode(bwt.begin(), bwt.end());
+	fm.sampleSA(opt::sampleSA);
+	fm.assignBWT(bwt.begin(), bwt.end());
+}
+
 /** Build an FM index of the specified file. */
-static size_t buildFMIndex(FMIndex& fm, const char* path)
+static void buildFMIndex(FMIndex& fm, const string& path)
 {
 	if (opt::verbose > 0)
 		std::cerr << "Reading `" << path << "'...\n";
 	std::vector<FMIndex::value_type> s;
-	readFile(path, s);
+	readFile(path.c_str(), s);
 
 	size_t MAX_SIZE = numeric_limits<FMIndex::sais_size_type>::max();
 	if (s.size() > MAX_SIZE) {
@@ -130,23 +155,17 @@ static size_t buildFMIndex(FMIndex& fm, const char* path)
 	} else
 		fm.setAlphabet(opt::alphabet);
 
-	if (opt::bwt) {
-		string bwtPath = string(path) + ".bwt";
-		cerr << "Writing `" << bwtPath << "'...\n";
-		ofstream fout;
-		if (!opt::toStdout)
-			fout.open(bwtPath.c_str());
-		ostream& out = opt::toStdout ? cout : fout;
-		assert_good(out, bwtPath);
-
-		fm.buildBWT(s.begin(), s.end(), out);
-		out.flush();
-		assert_good(out, bwtPath);
+	if (opt::fa2bwt) {
+		// Build the BWT first.
+		s.push_back(0);
+		fm.buildBWT(s.begin(), s.end() - 1);
+		fm.sampleSA(opt::sampleSA);
+		fm.assignBWT(s.begin(), s.end());
 	} else {
+		// Construct the suffix array first.
 		fm.assign(s.begin(), s.end());
 		fm.sampleSA(opt::sampleSA);
 	}
-	return s.size();
 }
 
 int main(int argc, char **argv)
@@ -222,10 +241,7 @@ int main(int argc, char **argv)
 		out.flush();
 		assert_good(out, faPath);
 
-		ostringstream ss;
-		ss << faPath << ".fai";
-		string faiPath(ss.str());
-		in.open(faiPath.c_str());
+		in.open((faPath + ".fai").c_str());
 		FastaIndex faIndex;
 		if (in) {
 			in >> faIndex;
@@ -234,33 +250,30 @@ int main(int argc, char **argv)
 		return 0;
 	}
 
-	const char* faPath(argv[optind]);
-	ostringstream ss;
-	ss << faPath << ".fm";
-	string fmPath = opt::toStdout ? "-" : ss.str();
-	ss.str("");
-	ss << faPath << ".fai";
-	string faiPath(ss.str());
 
-	if (opt::indexes & opt::FAI)
-		indexFasta(faPath, faiPath);
+	string path = argv[optind];
+	FMIndex fm;
+	if (opt::bwt2fm) {
+		buildFMIndexFromBWT(fm, path);
+	} else {
+		if (opt::indexes & opt::FAI)
+			indexFasta(path, path + ".fai");
 
-	if ((opt::indexes & opt::FM) == 0)
-		return 0;
+		if ((opt::indexes & opt::FM) == 0)
+			return 0;
 
-	FMIndex fm;
-	size_t n = buildFMIndex(fm, faPath);
+		buildFMIndex(fm, path);
+	}
 
 	if (opt::verbose > 0) {
+		size_t n = fm.size();
 		ssize_t bytes = getMemoryUsage();
 		cerr << "Read " << toSI(n) << "B. "
 			"Used " << toSI(bytes) << "B of memory and "
 				<< setprecision(3) << (float)bytes / n << " B/bp.\n";
 	}
 
-	if (opt::bwt)
-		return 0;
-
+	string fmPath = opt::toStdout ? "-" : path + ".fm";
 	cerr << "Writing `" << fmPath << "'...\n";
 	ofstream fout;
 	if (!opt::toStdout)
diff --git a/Map/map.cc b/Map/map.cc
index 3fa9637..6449aa6 100644
--- a/Map/map.cc
+++ b/Map/map.cc
@@ -104,9 +104,9 @@ static SAMRecord toSAM(const FastaIndex& faIndex,
 		a.mapq = 0;
 		a.cigar = "*";
 	} else {
-		pair<FAIRecord, size_t> idPos = faIndex[fmIndex[m.l]];
-		a.rname = idPos.first.id;
-		a.pos = idPos.second;
+		FastaIndex::SeqPos seqPos = faIndex[fmIndex[m.l]];
+		a.rname = seqPos.get<0>().id;
+		a.pos = seqPos.get<1>();
 		a.flag = rc ? SAMAlignment::FREVERSE : 0;
 
 		// Set the mapq to the alignment score.
@@ -133,8 +133,7 @@ static size_t getMyPos(const Match& m, const FastaIndex& faIndex,
 		const FMIndex& fmIndex, const string& id)
 {
 	for (size_t i = m.l; i < m.u; i++) {
-		pair<FAIRecord, size_t> idPos = faIndex[fmIndex[i]];
-		if (idPos.first.id == id)
+		if (faIndex[fmIndex[i]].get<0>().id == id)
 			return fmIndex[i];
 	}
 	return fmIndex[m.l];
@@ -147,8 +146,7 @@ static size_t getMinPos(const Match& m, size_t maxLen,
 	size_t minPos = numeric_limits<size_t>::max();
 	for (size_t i = m.l; i < m.u; i++) {
 		size_t pos = fmIndex[i];
-		pair<FAIRecord, size_t> idPos = faIndex[pos];
-		if (idPos.first.size == maxLen && pos < minPos)
+		if (faIndex[pos].get<0>().size == maxLen && pos < minPos)
 			minPos = fmIndex[i];
 	}
 	return minPos;
@@ -160,8 +158,7 @@ static size_t getMaxLen(const Match& m, const FastaIndex& faIndex,
 {
 	size_t maxLen = 0;
 	for (size_t i = m.l; i < m.u; i++) {
-		pair<FAIRecord, size_t> idPos = faIndex[fmIndex[i]];
-		size_t len = idPos.first.size;
+		size_t len = faIndex[fmIndex[i]].get<0>().size;
 		if (len > maxLen)
 			maxLen = len;
 	}
@@ -414,6 +411,13 @@ int main(int argc, char** argv)
 			cerr << "Reading `" << targetFile << "'...\n";
 		faIndex.index(targetFile);
 	}
+	if (opt::verbose > 0) {
+		ssize_t bytes = getMemoryUsage();
+		if (bytes > 0)
+			cerr << "Using " << toSI(bytes) << "B of memory and "
+				<< setprecision(3) << (float)bytes / faIndex.size()
+				<< " B/sequence.\n";
+	}
 
 	// Read the FM index.
 	FMIndex fmIndex;
diff --git a/Map/overlap.cc b/Map/overlap.cc
index 935899f..b3f856f 100644
--- a/Map/overlap.cc
+++ b/Map/overlap.cc
@@ -115,13 +115,13 @@ static void addSuffixOverlaps(Graph &g,
 {
 	typedef edge_property<Graph>::type EP;
 	typedef graph_traits<Graph>::edge_descriptor E;
+	typedef graph_traits<Graph>::vertex_descriptor V;
 
 	Distance ep(-fmi.qspan());
 	assert(ep.distance < 0);
 	for (unsigned i = fmi.l; i < fmi.u; ++i) {
 		size_t tstart = fmIndex[i] + 1;
-		pair<FAIRecord, size_t> idPos = faIndex[tstart];
-		ContigNode v(idPos.first.id, false);
+		V v = find_vertex(faIndex[tstart].get<0>().id, false, g);
 #pragma omp critical(g)
 		{
 			pair<E, bool> e = edge(u, v, g);
@@ -129,7 +129,7 @@ static void addSuffixOverlaps(Graph &g,
 				const EP& ep0 = g[e.first];
 				if (opt::verbose > 1)
 					cerr << "duplicate edge: "
-						<< u << " -> " << v << ' '
+						<< get(edge_name, g, e.first) << ' '
 						<< ep0 << ' ' << ep << '\n';
 				assert(ep0.distance < ep.distance);
 			} else if(u.sense()) {
@@ -150,6 +150,7 @@ static void addPrefixOverlaps(Graph &g,
 {
 	typedef edge_property<Graph>::type EP;
 	typedef graph_traits<Graph>::edge_descriptor E;
+	typedef graph_traits<Graph>::vertex_descriptor V;
 
 	assert(v.sense());
 	assert(fmi.qstart == 0);
@@ -157,8 +158,7 @@ static void addPrefixOverlaps(Graph &g,
 	assert(ep.distance < 0);
 	for (unsigned i = fmi.l; i < fmi.u; ++i) {
 		size_t tstart = fmIndex[i];
-		pair<FAIRecord, size_t> idPos = faIndex[tstart];
-		ContigNode u(idPos.first.id, false);
+		V u = find_vertex(faIndex[tstart].get<0>().id, false, g);
 #pragma omp critical(g)
 		{
 			pair<E, bool> e = edge(u, v, g);
@@ -166,7 +166,7 @@ static void addPrefixOverlaps(Graph &g,
 				const EP& ep0 = g[e.first];
 				if (opt::verbose > 1)
 					cerr << "duplicate edge: "
-						<< u << " -> " << v << ' '
+						<< get(edge_name, g, e.first) << ' '
 						<< ep0 << ' ' << ep << '\n';
 				assert(ep0.distance < ep.distance);
 			} else {
@@ -217,14 +217,16 @@ static void findOverlaps(Graph& g,
 		const FastaIndex& faIndex, const FMIndex& fmIndex,
 		const FastqRecord& rec)
 {
-	ContigNode u(rec.id, false);
+	typedef graph_traits<Graph>::vertex_descriptor V;
+	V u = find_vertex(rec.id, false, g);
+	V uc = get(vertex_complement, g, u);
 	// Add edges u+ -> v+ and v- -> u-
 	findOverlapsSuffix(g, faIndex, fmIndex, u, rec.seq);
 	string rcseq = reverseComplement(rec.seq);
 	// Add edges u- -> v+
-	findOverlapsSuffix(g, faIndex, fmIndex, ~u, rcseq);
+	findOverlapsSuffix(g, faIndex, fmIndex, uc, rcseq);
 	// Add edges v+ -> u-
-	findOverlapsPrefix(g, faIndex, fmIndex, ~u, rcseq);
+	findOverlapsPrefix(g, faIndex, fmIndex, uc, rcseq);
 }
 
 /** Map the sequences of the specified file. */
@@ -276,7 +278,7 @@ static void addVertices(const string& path, Graph& g)
 	ifstream in(path.c_str());
 	assert_good(in, path);
 	in >> g;
-	ContigID::lock();
+	g_contigNames.lock();
 	assert(in.eof());
 }
 
diff --git a/MergePaths/Makefile.in b/MergePaths/Makefile.in
index 7b986b1..20dbaec 100644
--- a/MergePaths/Makefile.in
+++ b/MergePaths/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# Makefile.in generated by automake 1.12 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -16,6 +16,23 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -35,7 +52,8 @@ POST_UNINSTALL = :
 bin_PROGRAMS = MergePaths$(EXEEXT) MergeContigs$(EXEEXT) \
 	PathConsensus$(EXEEXT)
 subdir = MergePaths
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -79,6 +97,11 @@ SOURCES = $(MergeContigs_SOURCES) $(MergePaths_SOURCES) \
 	$(PathConsensus_SOURCES)
 DIST_SOURCES = $(MergeContigs_SOURCES) $(MergePaths_SOURCES) \
 	$(PathConsensus_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -254,8 +277,11 @@ $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 $(am__aclocal_m4_deps):
 install-binPROGRAMS: $(bin_PROGRAMS)
 	@$(NORMAL_INSTALL)
-	test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
 	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+	fi; \
 	for p in $$list; do echo "$$p $$p"; done | \
 	sed 's/$(EXEEXT)$$//' | \
 	while read p p1; do if test -f $$p; \
@@ -414,6 +440,20 @@ GTAGS:
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
 
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
@@ -556,7 +596,7 @@ uninstall-am: uninstall-binPROGRAMS
 .MAKE: install-am install-strip
 
 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
-	clean-generic ctags distclean distclean-compile \
+	clean-generic cscopelist ctags distclean distclean-compile \
 	distclean-generic distclean-tags distdir dvi dvi-am html \
 	html-am info info-am install install-am install-binPROGRAMS \
 	install-data install-data-am install-dvi install-dvi-am \
diff --git a/MergePaths/MergeContigs.cpp b/MergePaths/MergeContigs.cpp
index 30d76de..e7ab728 100644
--- a/MergePaths/MergeContigs.cpp
+++ b/MergePaths/MergeContigs.cpp
@@ -225,8 +225,8 @@ static void mergeContigs(const Graph& g, const Contigs& contigs,
 		seq += o.overlap_str;
 		seq += Sequence(s, o.overlap_h_pos + 1);
 	} else {
-		cerr << "warning: the head of `" << v << "' "
-			"does not match the tail of the previous contig\n"
+		cerr << "warning: the head of " << get(vertex_name, g, v)
+			<< " does not match the tail of the previous contig\n"
 			<< ao << '\n' << bo << '\n' << path << endl;
 		seq += 'n';
 		seq += s;
@@ -234,15 +234,16 @@ static void mergeContigs(const Graph& g, const Contigs& contigs,
 }
 
 /** Return a FASTA comment for the specified path. */
-static void pathToComment(ostream& out, const ContigPath& path)
+static void pathToComment(ostream& out,
+		const Graph& g, const ContigPath& path)
 {
 	assert(path.size() > 1);
-	out << path.front();
+	out << get(vertex_name, g, path.front());
 	if (path.size() == 3)
-		out << ',' << path[1];
+		out << ',' << get(vertex_name, g, path[1]);
 	else if (path.size() > 3)
 		out << ",...";
-	out << ',' << path.back();
+	out << ',' << get(vertex_name, g, path.back());
 }
 
 /** Merge the specified path. */
@@ -264,7 +265,7 @@ static Contig mergePath(const Graph& g, const Contigs& contigs,
 	}
 	ostringstream ss;
 	ss << seq.size() << ' ' << coverage << ' ';
-	pathToComment(ss, path);
+	pathToComment(ss, g, path);
 	return Contig(ss.str(), seq);
 }
 
@@ -327,9 +328,14 @@ static void markRemovedContigs(vector<bool>& marked,
 		const vector<string>& pathIDs, const ContigPaths& paths)
 {
 	for (ContigPaths::const_iterator it = paths.begin();
-			it != paths.end(); ++it)
-		if (it->empty())
-			marked[ContigID(pathIDs[it - paths.begin()])] = true;
+			it != paths.end(); ++it) {
+		if (it->empty()) {
+			size_t i = get(g_contigNames,
+					pathIDs[it - paths.begin()]);
+			assert(i < marked.size());
+			marked[i] = true;
+		}
+	}
 }
 
 /** Output the updated overlap graph. */
@@ -337,16 +343,20 @@ static void outputGraph(Graph& g,
 		const vector<string>& pathIDs, const ContigPaths& paths,
 		const string& commandLine)
 {
+	typedef graph_traits<Graph>::vertex_descriptor V;
+
 	// Add the path vertices.
+	g_contigNames.unlock();
 	for (ContigPaths::const_iterator it = paths.begin();
 			it != paths.end(); ++it) {
 		const ContigPath& path = *it;
 		const string& id = pathIDs[it - paths.begin()];
 		if (!path.empty()) {
-			ContigID::insert(id);
-			merge(g, path.begin(), path.end());
+			V u = merge(g, path.begin(), path.end());
+			put(vertex_name, g, u, id);
 		}
 	}
+	g_contigNames.lock();
 
 	// Remove the vertices that are used in paths.
 	for (ContigPaths::const_iterator it = paths.begin();
@@ -354,7 +364,7 @@ static void outputGraph(Graph& g,
 		const ContigPath& path = *it;
 		const string& id = pathIDs[it - paths.begin()];
 		if (path.empty()) {
-			remove_vertex(ContigNode(id, false), g);
+			remove_vertex(find_vertex(id, false, g), g);
 		} else {
 			remove_vertex_if(g, path.begin(), path.end(),
 					not1(std::mem_fun_ref(&ContigNode::ambiguous)));
@@ -466,12 +476,12 @@ int main(int argc, char** argv)
 		FastaReader in(contigFile, FastaReader::NO_FOLD_CASE);
 		for (FastaRecord rec; in >> rec;) {
 			if (!adjPath.empty()
-					&& ContigID::count(rec.id) == 0)
+					&& g_contigNames.count(rec.id) == 0)
 				continue;
-			ContigID id = adjPath.empty()
-				? ContigID::insert(rec.id)
-				: ContigID(rec.id);
-			assert(id == contigs.size());
+			if (adjPath.empty())
+				put(g_contigNames, contigs.size(), rec.id);
+			else
+				assert(get(g_contigNames, rec.id) == contigs.size());
 			contigs.push_back(rec);
 
 			++count;
@@ -487,7 +497,7 @@ int main(int argc, char** argv)
 		assert(in.eof());
 		assert(!contigs.empty());
 		opt::colourSpace = isdigit(contigs[0].seq[0]);
-		ContigID::lock();
+		g_contigNames.lock();
 	}
 
 	vector<string> pathIDs;
@@ -510,7 +520,7 @@ int main(int argc, char** argv)
 			ContigID id(it - contigs.begin());
 			if (!seen[id]) {
 				const Contig& contig = *it;
-				out << '>' << id;
+				out << '>' << get(g_contigNames, id);
 				if (!contig.comment.empty())
 					out << ' ' << contig.comment;
 				out << '\n' << contig.seq << '\n';
diff --git a/MergePaths/MergePaths.cpp b/MergePaths/MergePaths.cpp
index b95c7f4..f73e5e8 100644
--- a/MergePaths/MergePaths.cpp
+++ b/MergePaths/MergePaths.cpp
@@ -4,7 +4,6 @@
 #include "ContigPath.h"
 #include "Functional.h" // for mem_var
 #include "IOUtil.h"
-#include "Iterator.h"
 #include "Uncompress.h"
 #include "Graph/Assemble.h"
 #include "Graph/ContigGraph.h"
@@ -132,7 +131,7 @@ static set<ContigID> findRepeats(const ContigPathMap& paths)
 		for (ContigPath::const_iterator it = path.begin();
 				it != path.end(); ++it)
 			if (!it->ambiguous())
-				count[ContigID(*it)]++;
+				count[it->contigIndex()]++;
 		for (map<ContigID, unsigned>::const_iterator
 				it = count.begin(); it != count.end(); ++it)
 			if (it->second > 1)
@@ -149,10 +148,11 @@ static set<ContigID> removeRepeats(ContigPathMap& paths)
 	set<ContigID> repeats = findRepeats(paths);
 	if (gDebugPrint) {
 		cout << "Repeats:";
-		if (!repeats.empty())
-			copy(repeats.begin(), repeats.end(),
-					affix_ostream_iterator<ContigID>(cout, " "));
-		else
+		if (!repeats.empty()) {
+			for (set<ContigID>::const_iterator it = repeats.begin();
+					it != repeats.end(); ++it)
+				cout << ' ' << get(g_contigNames, *it);
+		} else
 			cout << " none";
 		cout << '\n';
 	}
@@ -173,7 +173,7 @@ static set<ContigID> removeRepeats(ContigPathMap& paths)
 	for (set<ContigID>::const_iterator it = repeats.begin();
 			it != repeats.end(); ++it)
 		if (paths.erase(*it) > 0)
-			ss << ' ' << ContigID(*it);
+			ss << ' ' << get(g_contigNames, *it);
 
 	if (opt::verbose > 0 && removed > 0)
 		cout << "Removing paths in repeats:" << ss.str() << '\n';
@@ -234,7 +234,7 @@ static bool addOverlapEdge(const Lengths& lengths,
 /** Return the specified path. */
 static ContigPath getPath(const ContigPathMap& paths, ContigNode u)
 {
-	ContigPathMap::const_iterator it = paths.find(ContigID(u));
+	ContigPathMap::const_iterator it = paths.find(u.contigIndex());
 	assert(it != paths.end());
 	ContigPath path = it->second;
 	if (u.sense())
@@ -256,7 +256,7 @@ static void findPathOverlaps(const Lengths& lengths,
 		if (seed2.ambiguous())
 			continue;
 		ContigPathMap::const_iterator path2It
-			= paths.find(ContigID(seed2));
+			= paths.find(seed2.contigIndex());
 		if (path2It == paths.end())
 			continue;
 
@@ -281,7 +281,7 @@ static unsigned mergePaths(const Lengths& lengths,
 	for (ContigNode pivot; !mergeQ.empty(); mergeQ.pop_front()) {
 		pivot = mergeQ.front();
 		ContigPathMap::const_iterator path2It
-			= paths.find(ContigID(pivot));
+			= paths.find(pivot.contigIndex());
 		if (path2It == paths.end())
 			continue;
 
@@ -298,7 +298,8 @@ static unsigned mergePaths(const Lengths& lengths,
 		path.swap(consensus);
 		if (gDebugPrint)
 #pragma omp critical(cout)
-			cout << pivot << '\t' << path2 << '\n'
+			cout << get(g_contigNames, pivot)
+				<< '\t' << path2 << '\n'
 				<< '\t' << path << '\n';
 		merged++;
 	}
@@ -315,7 +316,7 @@ static ContigPath mergePath(const Lengths& lengths,
 	assert(!seedPath.empty());
 	ContigNode seed1 = seedPath.front();
 	ContigPathMap::const_iterator path1It
-		= paths.find(ContigID(seed1));
+		= paths.find(seed1.contigIndex());
 	assert(path1It != paths.end());
 	ContigPath path(path1It->second);
 	if (seedPath.front().sense())
@@ -323,12 +324,13 @@ static ContigPath mergePath(const Lengths& lengths,
 	if (opt::verbose > 1)
 #pragma omp critical(cout)
 		cout << "\n* " << seedPath << '\n'
-			<< seedPath.front() << '\t' << path << '\n';
+			<< get(g_contigNames, seedPath.front())
+			<< '\t' << path << '\n';
 	for (ContigPath::const_iterator it = seedPath.begin() + 1;
 			it != seedPath.end(); ++it) {
 		ContigNode seed2 = *it;
 		ContigPathMap::const_iterator path2It
-			= paths.find(ContigID(seed2));
+			= paths.find(seed2.contigIndex());
 		assert(path2It != paths.end());
 		ContigPath path2 = path2It->second;
 		if (seed2.sense())
@@ -342,13 +344,15 @@ static ContigPath mergePath(const Lengths& lengths,
 			// This seed could be removed from the seed path.
 			if (opt::verbose > 1)
 #pragma omp critical(cout)
-				cout << seed2 << '\t' << path2 << '\n'
+				cout << get(g_contigNames, seed2)
+					<< '\t' << path2 << '\n'
 					<< "\tinvalid\n";
 		} else {
 			path.swap(consensus);
 			if (opt::verbose > 1)
 #pragma omp critical(cout)
-				cout << seed2 << '\t' << path2 << '\n'
+				cout << get(g_contigNames, seed2)
+					<< '\t' << path2 << '\n'
 					<< '\t' << path << '\n';
 		}
 		seed1 = seed2;
@@ -394,7 +398,7 @@ static void extendPaths(const Lengths& lengths,
 
 	if (gDebugPrint)
 		#pragma omp critical(cout)
-		cout << "\n* " << ContigNode(id, false) << '\n'
+		cout << "\n* " << get(g_contigNames, id) << "+\n"
 			<< '\t' << path << '\n';
 
 	set<ContigNode> seen;
@@ -410,8 +414,8 @@ static void extendPaths(const Lengths& lengths,
 			cout << "invalid\n";
 			for (deque<ContigNode>::const_iterator it
 					= mergeQ.begin(); it != mergeQ.end(); ++it)
-				cout << *it << '\t'
-					<< paths.find(ContigID(*it))->second << '\n';
+				cout << get(g_contigNames, *it) << '\t'
+					<< paths.find(it->contigIndex())->second << '\n';
 		}
 	}
 }
@@ -452,14 +456,16 @@ static ContigID identifySubsumedPaths(const Lengths& lengths,
 	ContigID id(path1It->first);
 	const ContigPath& path = path1It->second;
 	if (gDebugPrint)
-		vout << ContigNode(id, false) << '\t' << path << '\n';
+		vout << get(g_contigNames, ContigNode(id, false))
+			<< '\t' << path << '\n';
 
 	for (ContigPath::const_iterator it = path.begin();
 			it != path.end(); ++it) {
 		ContigNode pivot = *it;
 		if (pivot.ambiguous() || pivot.id() == id)
 			continue;
-		ContigPathMap::iterator path2It = paths.find(ContigID(pivot));
+		ContigPathMap::iterator path2It
+			= paths.find(pivot.contigIndex());
 		if (path2It == paths.end())
 			continue;
 		ContigPath path2 = path2It->second;
@@ -470,7 +476,8 @@ static ContigID identifySubsumedPaths(const Lengths& lengths,
 			continue;
 		if (equalIgnoreAmbiguos(consensus, path)) {
 			if (gDebugPrint)
-				vout << pivot << '\t' << path2 << '\n';
+				vout << get(g_contigNames, pivot)
+					<< '\t' << path2 << '\n';
 			out.insert(path2It->first);
 		} else if (equalIgnoreAmbiguos(consensus, path2)) {
 			// This path is larger. Use it as the seed.
@@ -483,14 +490,16 @@ static ContigID identifySubsumedPaths(const Lengths& lengths,
 			if (!isCyclePath1 && !isCyclePath2) {
 				// Neither path is a cycle.
 				if (gDebugPrint)
-					vout << pivot << '\t' << path2 << '\n'
+					vout << get(g_contigNames, pivot)
+						<< '\t' << path2 << '\n'
 						<< "ignored\t" << consensus << '\n';
 				overlaps.insert(id);
 				overlaps.insert(path2It->first);
 			} else {
 				// At least one path is a cycle.
 				if (gDebugPrint)
-					vout << pivot << '\t' << path2 << '\n'
+					vout << get(g_contigNames, pivot)
+						<< '\t' << path2 << '\n'
 						<< "cycle\t" << consensus << '\n';
 				if (isCyclePath1 && isCyclePath2)
 					out.insert(path2It->first);
@@ -501,7 +510,8 @@ static ContigID identifySubsumedPaths(const Lengths& lengths,
 			}
 		} else {
 			if (gDebugPrint)
-				vout << pivot << '\t' << path2 << '\n'
+				vout << get(g_contigNames, pivot)
+					<< '\t' << path2 << '\n'
 					<< "ignored\t" << consensus << '\n';
 			overlaps.insert(id);
 			overlaps.insert(path2It->first);
@@ -579,7 +589,8 @@ static void addMissingEdges(const Lengths& lengths,
 			++vit1;
 			assert(v1 != u);
 			ContigPath path1 = getPath(paths, v1);
-			if (find(path1.begin(), path1.end(), u) == path1.end())
+			if (find(path1.begin(), path1.end(),
+						ContigPath::value_type(u)) == path1.end())
 				continue;
 			for (Vit vit2 = vit1; vit2 != vrange.second; ++vit2) {
 				V v2 = *vit2;
@@ -588,8 +599,8 @@ static void addMissingEdges(const Lengths& lengths,
 				if (edge(v1, v2, g).second || edge(v2, v1, g).second)
 					continue;
 				ContigPath path2 = getPath(paths, v2);
-				if (find(path2.begin(), path2.end(), u)
-						== path2.end())
+				if (find(path2.begin(), path2.end(),
+							ContigPath::value_type(u)) == path2.end())
 					continue;
 				numAdded += addOverlapEdge(lengths,
 						g, u, v1, path1, v2, path2);
@@ -641,7 +652,7 @@ static void removeSmallOverlaps(PathGraph& g,
 				continue;
 			ContigPath pathv = getPath(paths, v);
 			if (pathu.back() == pathv.front()
-					&& paths.count(pathu.back()) > 0)
+					&& paths.count(pathu.back().contigIndex()) > 0)
 				edges.push_back(uv);
 		}
 	}
@@ -677,7 +688,7 @@ static void outputSortedPaths(const ContigPathMap& paths)
 	assert_good(out, opt::out);
 	for (vector<ContigPath>::const_iterator it = sortedPaths.begin();
 			it != sortedPaths.end(); ++it)
-		out << ContigID::create() << '\t' << *it << '\n';
+		out << createContigName() << '\t' << *it << '\n';
 	assert_good(out, opt::out);
 }
 
@@ -702,7 +713,8 @@ static void assemblePathGraph(const Lengths& lengths,
 				it2 != it1->end(); ++it2) {
 			ContigNode seed(*it2);
 			if (find(path.begin(), path.end(), seed) != path.end()) {
-				paths[ContigID(seed)] = seed.sense() ? pathrc : path;
+				paths[seed.contigIndex()]
+					= seed.sense() ? pathrc : path;
 			} else {
 				// This seed was not included in the merged path.
 			}
@@ -730,10 +742,11 @@ static ContigPathMap readPaths(const Lengths& lengths,
 
 	unsigned tooSmall = 0;
 	ContigPathMap paths;
-	ContigID id;
+	std::string name;
 	ContigPath path;
-	while (in >> id >> path) {
+	while (in >> name >> path) {
 		// Ignore seed contigs shorter than the threshold length.
+		ContigID id(get(g_contigNames, name));
 		unsigned len = lengths[id] + opt::k - 1;
 		if (len < opt::seedLen) {
 			tooSmall++;
@@ -776,7 +789,7 @@ static void buildPathGraph(const Lengths& lengths,
 	typedef graph_traits<PathGraph>::vertex_iterator vertex_iterator;
 	pair<vertex_iterator, vertex_iterator> vit = g.vertices();
 	for (vertex_iterator u = vit.first; u != vit.second; ++u)
-		if (paths.count(ContigID(*u)) == 0)
+		if (paths.count(get(vertex_contig_index, g, *u)) == 0)
 			remove_vertex(*u, g);
 
 	// Find the overlapping paths.
@@ -801,20 +814,19 @@ static void buildPathGraph(const Lengths& lengths,
 static Lengths readContigLengths(istream& in)
 {
 	assert(in);
-	assert(ContigID::empty());
+	assert(g_contigNames.empty());
 	Lengths lengths;
 	string s;
 	unsigned len;
 	while (in >> s >> len) {
-		ContigID id = ContigID::insert(s);
 		in.ignore(numeric_limits<streamsize>::max(), '\n');
+		put(g_contigNames, lengths.size(), s);
 		assert(len >= opt::k);
-		assert(id == lengths.size());
 		lengths.push_back(len - opt::k + 1);
 	}
 	assert(in.eof());
 	assert(!lengths.empty());
-	ContigID::lock();
+	g_contigNames.lock();
 	return lengths;
 }
 
@@ -935,8 +947,9 @@ int main(int argc, char** argv)
 		// Reassemble the paths that were found to overlap.
 		if (gDebugPrint) {
 			cout << "\nReassembling overlapping contigs:";
-			copy(overlaps.begin(), overlaps.end(),
-					affix_ostream_iterator<ContigID>(cout, " "));
+			for (set<ContigID>::const_iterator it = overlaps.begin();
+					it != overlaps.end(); ++it)
+				cout << ' ' << get(g_contigNames, *it);
 			cout << '\n';
 		}
 
@@ -965,8 +978,9 @@ int main(int argc, char** argv)
 		overlaps = removeSubsumedPaths(lengths, resultsPathMap);
 		if (!overlaps.empty() && gDebugPrint) {
 			cout << "\nOverlapping contigs:";
-			copy(overlaps.begin(), overlaps.end(),
-					affix_ostream_iterator<ContigID>(cout, " "));
+			for (set<ContigID>::const_iterator it = overlaps.begin();
+					it != overlaps.end(); ++it)
+				cout << ' ' << get(g_contigNames, *it);
 			cout << '\n';
 		}
 	}
@@ -1051,7 +1065,11 @@ static bool alignCoordinates(const Lengths& lengths,
 
 	assert(ambiguous1 == 0 || ambiguous2 == 0);
 	int ambiguous = ambiguous1 + ambiguous2;
-	*out++ = ContigNode(max(1, ambiguous), 'N');
+	assert(out > result);
+	if (out[-1].ambiguous())
+		assert(ambiguous == 0);
+	else
+		*out++ = ContigNode(max(1, ambiguous), 'N');
 	first1 = it1;
 	first2 = it2;
 	result = out;
diff --git a/MergePaths/PathConsensus.cpp b/MergePaths/PathConsensus.cpp
index cd2210f..cbafb7f 100644
--- a/MergePaths/PathConsensus.cpp
+++ b/MergePaths/PathConsensus.cpp
@@ -84,7 +84,7 @@ namespace opt {
 	/** The the number of bases to continue the constrained search of
 	 * the graph beyond the size of the ambiguous gap in the path.
 	 */
-	static unsigned distanceError = 6;
+	unsigned distanceError = 6;
 }
 
 static const char shortopts[] = "d:k:o:s:g:a:p:vD:M:P:";
@@ -177,13 +177,16 @@ static int getDistance(const Graph& g,
 }
 
 /** Read contig paths from the specified file.
- * @param ids [out] the string ID of the paths
- * @param isAmb [out] whether the path contains a gap
+ * @param[in] inPath the filename of the contig paths
+ * @param[out] ids the string ID of the paths
+ * @param[out] isAmb whether the path contains a gap
  */
-static ContigPaths readPath(const string& inPath,
+static ContigPaths readPaths(const string& inPath,
 	vector<string>& ids, vector<bool>& isAmb)
 {
-	assert(ids.empty()); //this seed is contigID of the path
+	typedef graph_traits<Graph>::vertex_descriptor V;
+
+	assert(ids.empty());
 	assert(isAmb.empty());
 	assert(g_ambpath_contig.empty());
 	ifstream fin(inPath.c_str());
@@ -196,33 +199,25 @@ static ContigPaths readPath(const string& inPath,
 	ContigPaths paths;
 	string id;
 	Path path;
-	Path::iterator prev, next;
 	while (in >> id >> path) {
 		paths.push_back(path);
 		ids.push_back(id);
+		isAmb.push_back(false);
 
-		if (path.size() <= 2) {
-			isAmb.push_back(false);
+		if (path.size() <= 2)
 			continue;
-		}
-
-		/* contig with Ns must have prev and next */
-		bool cur_is_amb = false;
-		prev = path.begin();
-		next = path.begin();
-		Path::iterator it = path.begin();
-		it++; next++; next++;
-		for (; next != path.end(); it++, prev++, next++) {
-			if (it->ambiguous()) {
-				cur_is_amb = true;
-				/* add the entry to g_ambpath_contig
-				(value 0: unprocessed/no proper paths) */
+		for (Path::iterator it = path.begin() + 2;
+				it != path.end(); ++it) {
+			ContigPath::value_type t = it[-2], u = it[-1], v = it[0];
+			if (u.ambiguous()) {
+				assert(!t.ambiguous());
+				assert(!v.ambiguous());
 				g_ambpath_contig.insert(AmbPath2Contig::value_type(
-					AmbPathConstraint(*prev, *next, -it->id()),
+					AmbPathConstraint(t, v, u.length()),
 					ContigPath()));
+				isAmb.back() = true;
 			}
 		}
-		isAmb.push_back(cur_is_amb);
 	}
 	assert(in.eof());
 	return paths;
@@ -266,7 +261,7 @@ typedef vector<NewVertex> NewVertices;
 static NewVertices g_newVertices;
 
 /** Output a new contig. */
-static ContigID outputNewContig(const Graph& g,
+static ContigNode outputNewContig(const Graph& g,
 	const vector<Path>& solutions,
 	size_t longestPrefix, size_t longestSuffix,
 	const Sequence& seq, const unsigned coverage,
@@ -276,9 +271,12 @@ static ContigID outputNewContig(const Graph& g,
 	assert(longestPrefix > 0);
 	assert(longestSuffix > 0);
 
-	ContigID id(ContigID::create());
-	out << '>' << id.str() << ' ' << seq.length()
-		<< ' ' << coverage << ' ';
+	size_t numContigs = num_vertices(g) / 2;
+	ContigNode u(numContigs + g_newVertices.size(), false);
+	string name = createContigName();
+	put(vertex_name, g, u, name);
+	out << '>' << name
+		<< ' ' << seq.length() << ' ' << coverage << ' ';
 
 	int dtu = INT_MAX, duv = INT_MAX;
 	for (vector<Path>::const_iterator it = solutions.begin();
@@ -291,9 +289,10 @@ static ContigID outputNewContig(const Graph& g,
 			last = path.end() - longestSuffix;
 		assert(first <= last);
 		if (first < last) {
-			copy(first, last - 1,
-					ostream_iterator<ContigNode>(out, ","));
-			out << *(last - 1);
+			ContigPath::const_iterator it = first;
+			out << get(vertex_name, g, *it);
+			for (++it; it != last; ++it)
+				out << ',' << get(vertex_name, g, *it);
 			dtu = min(dtu, getDistance(g, first[-1], first[0]));
 			duv = min(duv, getDistance(g, last[-1], last[0]));
 		} else
@@ -306,11 +305,11 @@ static ContigID outputNewContig(const Graph& g,
 	// Record the newly-created contig to be added to the graph later.
 	g_newVertices.push_back(NewVertex(
 				*(solutions[0].begin() + longestPrefix - 1),
-				ContigNode(id, false),
+				u,
 				*(solutions[0].rbegin() + longestSuffix - 1),
 				ContigProperties(seq.length(), coverage),
 				dtu, duv));
-	return id;
+	return u;
 }
 
 /** Return a consensus sequence of a and b.
@@ -342,7 +341,8 @@ static string createConsensus(const Sequence& a, const Sequence& b)
  * generate a consensus sequence of the overlapping region. The result
  * is stored in the first argument.
  */
-static void mergeContigs(unsigned overlap, Sequence& seq,
+static void mergeContigs(const Graph& g,
+		unsigned overlap, Sequence& seq,
 		const Sequence& s, const ContigNode& node, const Path& path)
 {
 	assert(s.length() > overlap);
@@ -355,8 +355,9 @@ static void mergeContigs(unsigned overlap, Sequence& seq,
 		o = createConsensus(ao, bo);
 	} while (o.empty() && chomp(seq, 'n'));
 	if (o.empty()) {
-		cerr << "warning: the head of `" << node << "' "
-			"does not match the tail of the previous contig\n"
+		cerr << "warning: the head of "
+			<< get(vertex_name, g, node)
+			<< " does not match the tail of the previous contig\n"
 			<< ao << '\n' << bo << '\n' << path << endl;
 		seq += 'n';
 		seq += s;
@@ -379,7 +380,8 @@ static Sequence mergePath(const Graph&g, const Path& path)
 			int d = get(edge_bundle, g, *(it-1), *it).distance;
 			assert(d < 0);
 			unsigned overlap = -d;
-			mergeContigs(overlap, seq, getSequence(*it), *it, path);
+			mergeContigs(g, overlap, seq,
+					getSequence(*it), *it, path);
 		}
 		prev_it = it;
 	}
@@ -428,11 +430,11 @@ static ContigPath alignPair(const Graph& g,
 			return ContigPath();
 
 		unsigned coverage = calculatePathProperties(g, sol).coverage;
-		ContigID id = outputNewContig(g,
+		ContigNode u = outputNewContig(g,
 				solutions, 1, 1, consensus, coverage, out);
 		ContigPath path;
 		path.push_back(solutions.front().front());
-		path.push_back(ContigNode(id, false));
+		path.push_back(u);
 		path.push_back(solutions.front().back());
 		return path;
 	}
@@ -448,10 +450,12 @@ static ContigPath alignPair(const Graph& g,
 					fstSol.begin(), fstSol.end(), sndSol.begin());
 			assert(it.first != fstSol.end());
 			assert(it.second != sndSol.end());
-			assert(*it.first == ~*it.second);
+			assert(*it.first
+					== get(vertex_complement, g, *it.second));
 			assert(equal(it.first+1, It(fstSol.end()), it.second+1));
 			if (opt::verbose > 1)
-				cerr << "Palindrome: " << ContigID(*it.first) << '\n';
+				cerr << "Palindrome: "
+					<< get(vertex_contig_name, g, *it.first) << '\n';
 			return solutions[0];
 		} else {
 			// The paths are different lengths.
@@ -490,11 +494,11 @@ static ContigPath alignPair(const Graph& g,
 
 	unsigned coverage = calculatePathProperties(g, fstSol).coverage
 		+ calculatePathProperties(g, sndSol).coverage;
-	ContigID id = outputNewContig(g, solutions, 1, 1,
+	ContigNode u = outputNewContig(g, solutions, 1, 1,
 			align.consensus(), coverage, out);
 	ContigPath path;
 	path.push_back(solutions.front().front());
-	path.push_back(ContigNode(id, false));
+	path.push_back(u);
 	path.push_back(solutions.front().back());
 	return path;
 }
@@ -606,11 +610,15 @@ static ContigPath alignMulti(const Graph& g,
 
 	if (identity == 1) {
 		// A perfect match must be caused by two palindromes.
-		ContigID palindrome0 = solutions[0][longestPrefix];
-		ContigID palindrome1 = solutions[0].rbegin()[longestSuffix];
+		ContigID palindrome0
+			= solutions[0][longestPrefix].contigIndex();
+		ContigID palindrome1
+			= solutions[0].rbegin()[longestSuffix].contigIndex();
 		if (opt::verbose > 1)
-			cerr << "Palindrome: " << palindrome0 << '\n'
-				<< "Palindrome: " << palindrome1 << '\n';
+			cerr << "Palindrome: "
+				<< get(g_contigNames, palindrome0) << '\n'
+				<< "Palindrome: "
+				<< get(g_contigNames, palindrome1) << '\n';
 #ifndef NDEBUG
 		string s0 = getSequence(ContigNode(palindrome0, false));
 		string s1 = getSequence(ContigNode(palindrome1, false));
@@ -619,8 +627,8 @@ static ContigPath alignMulti(const Graph& g,
 		for (vector<Path>::const_iterator it = solutions.begin();
 				it != solutions.end(); ++it) {
 			const ContigPath& path = *it;
-			assert(ContigID(path[longestPrefix]) == palindrome0);
-			assert(ContigID(path.rbegin()[longestSuffix])
+			assert(path[longestPrefix].contigIndex() == palindrome0);
+			assert(path.rbegin()[longestSuffix].contigIndex()
 					== palindrome1);
 			assert(path.size() == solutions[0].size());
 		}
@@ -628,10 +636,10 @@ static ContigPath alignMulti(const Graph& g,
 		return solutions[0];
 	}
 
-	ContigID id = outputNewContig(g, solutions,
+	ContigNode u = outputNewContig(g, solutions,
 		longestPrefix, longestSuffix, consensus, coverage, out);
 	ContigPath path(vppath);
-	path.push_back(ContigNode(id, false));
+	path.push_back(u);
 	path.insert(path.end(), vspath.begin(), vspath.end());
 	return path;
 }
@@ -655,9 +663,10 @@ static ContigPath fillGap(const Graph& g,
 		ofstream& outFasta)
 {
 	if (opt::verbose > 1)
-		cerr << "\n* " << apConstraint.source << ' '
+		cerr << "\n* "
+			<< get(vertex_name, g, apConstraint.source) << ' '
 			<< apConstraint.dist << "N "
-			<< apConstraint.dest << '\n';
+			<< get(vertex_name, g, apConstraint.dest) << '\n';
 
 	Constraints constraints;
 	constraints.push_back(Constraint(apConstraint.dest,
@@ -791,6 +800,7 @@ int main(int argc, char** argv)
 	Graph g;
 	fin >> g;
 	assert(fin.eof());
+	g_contigNames.lock();
 
 	// Read contigs
 	Contigs& contigs = g_contigs;
@@ -799,26 +809,24 @@ int main(int argc, char** argv)
 			cerr << "Reading `" << contigFile << "'..." << endl;
 		FastaReader in(contigFile, FastaReader::NO_FOLD_CASE);
 		for (FastaRecord rec; in >> rec;) {
-			ContigID id(rec.id);
-			assert(contigs.size() == id);
+			assert(contigs.size() == get(g_contigNames, rec.id));
 			contigs.push_back(rec.seq);
 		}
 		assert(in.eof());
 		assert(!contigs.empty());
 		opt::colourSpace = isdigit(contigs[0][0]);
 	}
-	ContigID::lock();
 
 	vector<string> pathIDs;
 	vector<bool> isAmbPath;
-	ContigPaths paths = readPath(allPaths, pathIDs, isAmbPath);
+	ContigPaths paths = readPaths(allPaths, pathIDs, isAmbPath);
 	stats.numAmbPaths = g_ambpath_contig.size();
 	if (opt::verbose > 0)
 		cerr << "Read " << paths.size() << " paths\n";
 
 	// Start numbering new contigs from the last
 	if (!pathIDs.empty())
-		ContigID::setNextContigID(pathIDs.back());
+		setNextContigName(pathIDs.back());
 
 	// Prepare output fasta file
 	ofstream fa(opt::consensusPath.c_str());
@@ -835,9 +843,11 @@ int main(int argc, char** argv)
 	vector<bool> seen(contigs.size());
 
 	// resolve ambiguous paths recorded in g_ambpath_contig
+	g_contigNames.unlock();
 	for (AmbPath2Contig::iterator ambIt = g_ambpath_contig.begin();
 			ambIt != g_ambpath_contig.end(); ambIt++)
 		ambIt->second = fillGap(g, ambIt->first, seen, fa);
+	g_contigNames.lock();
 	assert_good(fa, opt::consensusPath);
 	fa.close();
 	if (opt::verbose > 1)
@@ -855,7 +865,7 @@ int main(int argc, char** argv)
 	// Output those contigs that were not seen in ambiguous path.
 	for (unsigned id = 0; id < contigs.size(); ++id)
 		if (seen[id])
-			out << ContigID(id) << '\n';
+			out << get(g_contigNames, id) << '\n';
 
 	for (ContigPaths::const_iterator path = paths.begin();
 			path != paths.end(); ++path) {
diff --git a/Overlap/Makefile.in b/Overlap/Makefile.in
index 5817f6f..c24e091 100644
--- a/Overlap/Makefile.in
+++ b/Overlap/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# Makefile.in generated by automake 1.12 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -16,6 +16,23 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -34,7 +51,8 @@ PRE_UNINSTALL = :
 POST_UNINSTALL = :
 bin_PROGRAMS = Overlap$(EXEEXT)
 subdir = Overlap
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -61,6 +79,11 @@ CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
 	-o $@
 SOURCES = $(Overlap_SOURCES)
 DIST_SOURCES = $(Overlap_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -207,8 +230,11 @@ $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 $(am__aclocal_m4_deps):
 install-binPROGRAMS: $(bin_PROGRAMS)
 	@$(NORMAL_INSTALL)
-	test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
 	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+	fi; \
 	for p in $$list; do echo "$$p $$p"; done | \
 	sed 's/$(EXEEXT)$$//' | \
 	while read p p1; do if test -f $$p; \
@@ -331,6 +357,20 @@ GTAGS:
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
 
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
@@ -473,7 +513,7 @@ uninstall-am: uninstall-binPROGRAMS
 .MAKE: install-am install-strip
 
 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
-	clean-generic ctags distclean distclean-compile \
+	clean-generic cscopelist ctags distclean distclean-compile \
 	distclean-generic distclean-tags distdir dvi dvi-am html \
 	html-am info info-am install install-am install-binPROGRAMS \
 	install-data install-data-am install-dvi install-dvi-am \
diff --git a/Overlap/Overlap.cpp b/Overlap/Overlap.cpp
index 5bba510..9695dc2 100644
--- a/Overlap/Overlap.cpp
+++ b/Overlap/Overlap.cpp
@@ -72,6 +72,9 @@ namespace opt {
 	static int mask = 1;
 	static int scaffold = 1;
 
+	/** The acceptable error of a distance estimate. */
+	unsigned distanceError = 6;
+
 	/** Write the contig adjacency graph to this file. */
 	static string graphPath;
 
@@ -123,7 +126,8 @@ static string sequence(const ContigNode& id)
 	return id.sense() ? reverseComplement(seq) : seq;
 }
 
-static unsigned findOverlap(const ContigNode& t_id,
+static unsigned findOverlap(const Graph& g,
+		const ContigNode& t_id,
 		const ContigNode& h_id,
 		bool& mask)
 {
@@ -140,7 +144,8 @@ static unsigned findOverlap(const ContigNode& t_id,
 	}
 
 	if (opt::verbose > 0) {
-		cout << t_id << '\t' << h_id;
+		cout << get(vertex_name, g, t_id)
+			<< '\t' << get(vertex_name, g, h_id);
 		for (vector<unsigned>::const_iterator i = overlaps.begin();
 				i != overlaps.end(); ++i)
 			cout << '\t' << *i;
@@ -170,13 +175,15 @@ static unsigned findOverlap(const ContigNode& t_id,
 	return overlaps[0];
 }
 
-static FastaRecord newContig(const ContigNode& t, const ContigNode& h,
+static FastaRecord newContig(const Graph& g,
+		const ContigNode& t, const ContigNode& v,
 		int dist, const string& seq)
 {
 	ostringstream comment;
-	comment << seq.length() << " 0 " << t << ' ' << h << ' ' << dist;
-	return FastaRecord((string)ContigID::create().str(),
-			comment.str(), seq);
+	comment << seq.length() << " 0 "
+		<< get(vertex_name, g, t) << ' '
+		<< get(vertex_name, g, v) << ' ' << dist;
+	return FastaRecord(createContigName(), comment.str(), seq);
 }
 
 /** An overlap of two sequences. */
@@ -208,7 +215,7 @@ struct Overlap : public DistanceEst {
 };
 
 /** Create a contig representing the gap between contigs u and v. */
-static FastaRecord createGapContig(
+static FastaRecord createGapContig(const Graph& g,
 		const ContigNode& u, const ContigNode& v,
 		const Overlap& o)
 {
@@ -217,14 +224,16 @@ static FastaRecord createGapContig(
 	stats.scaffold++;
 	int distance = o.distance;
 	if (opt::verbose > 0)
-		cout << u << '\t' << v << "\t(" << distance << ")\n";
+		cout << get(vertex_name, g, u)
+			<< '\t' << get(vertex_name, g, v)
+			<< "\t(" << distance << ")\n";
 	assert(distance < 100000);
 	string gap = distance <= 0 ? string("n")
 		: string(distance, 'N');
 	const string& useq = sequence(u);
 	const string& vseq = sequence(v);
 	unsigned overlap = opt::k - 1; // by convention
-	return newContig(u, v, distance,
+	return newContig(g, u, v, distance,
 			useq.substr(useq.length() - overlap) + gap
 			+ vseq.substr(0, overlap));
 }
@@ -250,8 +259,10 @@ static bool checkEdgeForOverlap(const Graph& goverlap,
 	typedef edge_bundle_type<OverlapGraph>::type EP;
 
 	V u = source(e, g), v = target(e, g);
+	V uc = get(vertex_complement, g, u);
+	V vc = get(vertex_complement, g, v);
 	assert(u != v);
-	assert(u != ~v);
+	assert(u != vc);
 	EP& ep = g[e];
 	if (ep.overlap != UINT_MAX) {
 		// Found the complementary overlap.
@@ -269,7 +280,7 @@ static bool checkEdgeForOverlap(const Graph& goverlap,
 	bool mask = false;
 	unsigned overlap
 		= ep.distance - (int)allowedError(ep.stdDev) <= 0
-		? findOverlap(u, v, mask) : 0;
+		? findOverlap(goverlap, u, v, mask) : 0;
 	if (mask && !opt::mask) {
 		// Ambiguous overlap.
 		return false;
@@ -280,28 +291,29 @@ static bool checkEdgeForOverlap(const Graph& goverlap,
 	}
 	ep.overlap = overlap;
 	ep.mask = mask;
-	pair<E, bool> ecomplement = edge(~v, ~u, g);
+	pair<E, bool> ecomplement = edge(vc, uc, g);
 	if (ecomplement.second) {
 		// Modify the complementary edge.
 		g[ecomplement.first] = ep;
 	} else {
 		// Add the complementary edge.
-		assert(~v != u);
-		add_edge(~v, ~u, ep,
+		assert(vc != u);
+		add_edge(vc, uc, ep,
 				static_cast<OverlapGraph::base_type&>(g));
 	}
 	return true;
 }
 
 static void findOverlap(const Graph& g,
-		ContigID refID, bool rc, const Estimate& est,
+		ContigID refID, bool rc,
+		const ContigNode& pair,
+		const DistanceEst& est,
 		OverlapGraph& out)
 {
-	if (refID == est.contig.id()
+	if (refID == pair.id()
 			|| (est.distance >= 0 && !opt::scaffold))
 		return;
 	ContigNode ref(refID, false);
-	const ContigNode& pair = est.contig;
 	const ContigNode& t = rc ? pair : ref;
 	const ContigNode& h = rc ? ref : pair;
 	if (out_degree(t, g) > 0 || in_degree(h, g) > 0
@@ -311,7 +323,7 @@ static void findOverlap(const Graph& g,
 	bool mask = false;
 	unsigned overlap
 		= est.distance - (int)allowedError(est.stdDev) <= 0
-		? findOverlap(t, h, mask) : 0;
+		? findOverlap(g, t, h, mask) : 0;
 	if (mask && !opt::mask)
 		return;
 	if (overlap > 0 || opt::scaffold)
@@ -402,6 +414,7 @@ int main(int argc, char** argv)
 	Graph graph;
 	fin >> graph;
 	assert(fin.eof());
+	g_contigNames.lock();
 
 	// Open the output file.
 	ofstream out(opt::out.c_str());
@@ -427,10 +440,13 @@ int main(int argc, char** argv)
 		// dist graph format
 		for (EstimateRecord er; in >> er;) {
 			for (int sense = false; sense <= true; ++sense) {
-				const vector<Estimate>& ests = er.estimates[sense];
-				for (EstimateVector::const_iterator it = ests.begin();
+				typedef vector<
+					pair<ContigNode, DistanceEst> > Estimates;
+				const Estimates& ests = er.estimates[sense];
+				for (Estimates::const_iterator it = ests.begin();
 						it != ests.end(); ++it)
-					findOverlap(graph, er.refID, sense, *it,
+					findOverlap(graph, er.refID, sense,
+							it->first, it->second,
 							scaffoldGraph);
 			}
 		}
@@ -503,6 +519,7 @@ int main(int argc, char** argv)
 	overlapGraph.clear();
 
 	// Second, handle scaffolded edges.
+	g_contigNames.unlock();
 	for (Edges::const_iterator it = edges.begin();
 			it != edges.end(); ++it) {
 		const ContigNode& t = source(*it, scaffoldGraph),
@@ -518,18 +535,21 @@ int main(int argc, char** argv)
 			// This edge is not scaffolded.
 		} else if (contiguous_out(scaffoldGraph, t)) {
 			assert(*adjacent_vertices(t, scaffoldGraph).first == h);
-			FastaRecord contig = createGapContig(t, h, overlap);
+			FastaRecord contig = createGapContig(graph,
+					t, h, overlap);
 			out << contig;
 			assert(out.good());
 
 			// Add the new contig to the adjacency graph.
 			vertex_descriptor v = add_vertex(
 					ContigProperties(contig.seq.length(), 0), graph);
+			put(vertex_name, graph, v, contig.id);
 			add_edge(t, v, graph);
 			add_edge(v, h, graph);
 		} else
 			stats.ambiguous++;
 	}
+	g_contigNames.lock();
 	out.close();
 
 	if (!opt::graphPath.empty()) {
diff --git a/Parallel/Makefile.in b/Parallel/Makefile.in
index b3a50b1..ecf5dd9 100644
--- a/Parallel/Makefile.in
+++ b/Parallel/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# Makefile.in generated by automake 1.12 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -16,6 +16,23 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -34,7 +51,8 @@ PRE_UNINSTALL = :
 POST_UNINSTALL = :
 bin_PROGRAMS = ABYSS-P$(EXEEXT)
 subdir = Parallel
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -69,6 +87,11 @@ CCLD = $(CC)
 LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
 SOURCES = $(ABYSS_P_SOURCES)
 DIST_SOURCES = $(ABYSS_P_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -221,8 +244,11 @@ $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 $(am__aclocal_m4_deps):
 install-binPROGRAMS: $(bin_PROGRAMS)
 	@$(NORMAL_INSTALL)
-	test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
 	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+	fi; \
 	for p in $$list; do echo "$$p $$p"; done | \
 	sed 's/$(EXEEXT)$$//' | \
 	while read p p1; do if test -f $$p; \
@@ -405,6 +431,20 @@ GTAGS:
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
 
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
@@ -547,7 +587,7 @@ uninstall-am: uninstall-binPROGRAMS
 .MAKE: install-am install-strip
 
 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
-	clean-generic ctags distclean distclean-compile \
+	clean-generic cscopelist ctags distclean distclean-compile \
 	distclean-generic distclean-tags distdir dvi dvi-am html \
 	html-am info info-am install install-am install-binPROGRAMS \
 	install-data install-data-am install-dvi install-dvi-am \
diff --git a/ParseAligns/Makefile.in b/ParseAligns/Makefile.in
index d10a293..565d6c8 100644
--- a/ParseAligns/Makefile.in
+++ b/ParseAligns/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# Makefile.in generated by automake 1.12 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -16,6 +16,23 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -34,7 +51,8 @@ PRE_UNINSTALL = :
 POST_UNINSTALL = :
 bin_PROGRAMS = abyss-fixmate$(EXEEXT) ParseAligns$(EXEEXT)
 subdir = ParseAligns
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -62,6 +80,11 @@ CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
 	-o $@
 SOURCES = $(ParseAligns_SOURCES) $(abyss_fixmate_SOURCES)
 DIST_SOURCES = $(ParseAligns_SOURCES) $(abyss_fixmate_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -212,8 +235,11 @@ $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 $(am__aclocal_m4_deps):
 install-binPROGRAMS: $(bin_PROGRAMS)
 	@$(NORMAL_INSTALL)
-	test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
 	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+	fi; \
 	for p in $$list; do echo "$$p $$p"; done | \
 	sed 's/$(EXEEXT)$$//' | \
 	while read p p1; do if test -f $$p; \
@@ -368,6 +394,20 @@ GTAGS:
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
 
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
@@ -510,7 +550,7 @@ uninstall-am: uninstall-binPROGRAMS
 .MAKE: install-am install-strip
 
 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
-	clean-generic ctags distclean distclean-compile \
+	clean-generic cscopelist ctags distclean distclean-compile \
 	distclean-generic distclean-tags distdir dvi dvi-am html \
 	html-am info info-am install install-am install-binPROGRAMS \
 	install-data install-data-am install-dvi install-dvi-am \
diff --git a/ParseAligns/ParseAligns.cpp b/ParseAligns/ParseAligns.cpp
index fc70c8e..327c65e 100644
--- a/ParseAligns/ParseAligns.cpp
+++ b/ParseAligns/ParseAligns.cpp
@@ -123,6 +123,9 @@ static int fragmentSize(const Alignment& a0, const Alignment& a1)
 	return r - f;
 }
 
+typedef pair<ContigNode, DistanceEst> Estimate;
+typedef vector<Estimate> Estimates;
+
 static void addEstimate(EstimateMap& map, const Alignment& a,
 		Estimate& est, bool reverse)
 {
@@ -131,13 +134,12 @@ static void addEstimate(EstimateMap& map, const Alignment& a,
 	bool a_isRC = a.isRC != reverse;
 	EstimateMap::iterator estimatesIt = map.find(a.contig);
 	if (estimatesIt != map.end()) {
-		EstimateVector& estimates =
-			estimatesIt->second.estimates[a_isRC];
-		for (EstimateVector::iterator estIt = estimates.begin();
+		Estimates& estimates = estimatesIt->second.estimates[a_isRC];
+		for (Estimates::iterator estIt = estimates.begin();
 				estIt != estimates.end(); ++estIt) {
-			if (estIt->contig.id() == est.contig.id()) {
-				estIt->numPairs++;
-				estIt->distance += est.distance;
+			if (estIt->first.id() == est.first.id()) {
+				estIt->second.numPairs++;
+				estIt->second.distance += est.second.distance;
 				placed = true;
 				break;
 			}
@@ -183,11 +185,12 @@ static void doReadIntegrity(const ReadAlignMap::value_type& a)
 		unsigned largest_end =
 			largest.read_start_pos + largest.align_length - opt::k;
 		int distance = last.read_start_pos - largest_end;
-		est.contig = ContigNode(last.contig,
-				largest.isRC != last.isRC);
-		est.distance = distance - opt::k;
-		est.numPairs = 1;
-		est.stdDev = 0;
+		est.first = find_vertex(
+				last.contig, largest.isRC != last.isRC,
+				g_contigNames);
+		est.second.distance = distance - opt::k;
+		est.second.numPairs = 1;
+		est.second.stdDev = 0;
 		addEstimate(estMap, largest, est, false);
 	}
 
@@ -197,10 +200,12 @@ static void doReadIntegrity(const ReadAlignMap::value_type& a)
 		unsigned first_end =
 			first.read_start_pos + first.align_length - opt::k;
 		int distance = last.read_start_pos - first_end;
-		est.contig = ContigNode(last.contig, first.isRC != last.isRC);
-		est.distance = distance - opt::k;
-		est.numPairs = 1;
-		est.stdDev = 0;
+		est.first = find_vertex(
+				last.contig, first.isRC != last.isRC,
+				g_contigNames);
+		est.second.distance = distance - opt::k;
+		est.second.numPairs = 1;
+		est.second.stdDev = 0;
 		addEstimate(estMap, first, est, false);
 	}
 
@@ -211,11 +216,12 @@ static void doReadIntegrity(const ReadAlignMap::value_type& a)
 		unsigned largest_end =
 			largest.read_start_pos + largest.align_length - opt::k;
 		int distance = first.read_start_pos - largest_end;
-		est.contig = ContigNode(first.contig,
-				largest.isRC != first.isRC);
-		est.distance = distance - opt::k;
-		est.numPairs = 1;
-		est.stdDev = 0;
+		est.first = find_vertex(
+				first.contig, largest.isRC != first.isRC,
+				g_contigNames);
+		est.second.distance = distance - opt::k;
+		est.second.numPairs = 1;
+		est.second.stdDev = 0;
 		addEstimate(estMap, largest, est, false);
 	}
 
@@ -264,13 +270,18 @@ static void generateDistFile()
 			if (refIsRC)
 				distFile << " ;";
 
-			for (EstimateVector::iterator vecIt = mapIt->second.estimates[refIsRC].begin();
+			for (Estimates::iterator vecIt
+					= mapIt->second.estimates[refIsRC].begin();
 					vecIt != mapIt->second.estimates[refIsRC].end(); ++vecIt) {
-				vecIt->distance = (int)round((double)vecIt->distance /
-						(double)vecIt->numPairs);
-				if (vecIt->numPairs >= opt::c && vecIt->numPairs != 0
+				vecIt->second.distance
+					= (int)round((double)vecIt->second.distance /
+							(double)vecIt->second.numPairs);
+				if (vecIt->second.numPairs >= opt::c
+						&& vecIt->second.numPairs != 0
 						/*&& vecIt->distance > 1 - opt::k*/)
-					distFile << ' ' << *vecIt;
+					distFile
+						<< ' ' << get(g_contigNames, vecIt->first)
+						<< ',' << vecIt->second;
 			}
 		}
 		distFile << '\n';
@@ -480,7 +491,7 @@ int main(int argc, char* const* argv)
 		istringstream arg(optarg != NULL ? optarg : "");
 		switch (c) {
 			case '?': die = true; break;
-			case 'k': arg >> opt::k; break;
+			case 'l': arg >> opt::k; break;
 			case 'c': arg >> opt::c; break;
 			case 'd': arg >> opt::distPath; break;
 			case 'f': arg >> opt::fragPath; break;
diff --git a/ParseAligns/abyss-fixmate.cc b/ParseAligns/abyss-fixmate.cc
index 506ea0c..1a169cf 100644
--- a/ParseAligns/abyss-fixmate.cc
+++ b/ParseAligns/abyss-fixmate.cc
@@ -1,5 +1,6 @@
 #include "Histogram.h"
 #include "IOUtil.h"
+#include "MemoryUtil.h"
 #include "SAM.h"
 #include "StringUtil.h"
 #include "Uncompress.h"
@@ -125,9 +126,6 @@ typedef unordered_map<string, SAMRecord> Alignments;
 typedef unordered_map<string, SAMAlignment> Alignments;
 #endif
 
-/** Start of the data segment. */
-static intptr_t sbrk0 = reinterpret_cast<intptr_t>(sbrk(0));
-
 static void printProgress(const Alignments& map)
 {
 	if (opt::verbose == 0)
@@ -139,13 +137,12 @@ static void printProgress(const Alignments& map)
 
 	size_t buckets = map.bucket_count();
 	if (stats.alignments % 1000000 == 0 || buckets != prevBuckets) {
-		ptrdiff_t bytes = reinterpret_cast<intptr_t>(sbrk(0)) - sbrk0;
 		prevBuckets = buckets;
 		size_t size = map.size();
 		cerr << "Read " << stats.alignments << " alignments. "
 			<< "Hash load: " << size << " / " << buckets
 			<< " = " << (float)size / buckets
-			<< " using " << toSI(bytes) << "B." << endl;
+			<< " using " << toSI(getMemoryUsage()) << "B." << endl;
 	}
 }
 
diff --git a/PathOverlap/Makefile.in b/PathOverlap/Makefile.in
index 95a1077..02818b6 100644
--- a/PathOverlap/Makefile.in
+++ b/PathOverlap/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# Makefile.in generated by automake 1.12 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -16,6 +16,23 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -34,7 +51,8 @@ PRE_UNINSTALL = :
 POST_UNINSTALL = :
 bin_PROGRAMS = PathOverlap$(EXEEXT)
 subdir = PathOverlap
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -61,6 +79,11 @@ CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
 	-o $@
 SOURCES = $(PathOverlap_SOURCES)
 DIST_SOURCES = $(PathOverlap_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -207,8 +230,11 @@ $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 $(am__aclocal_m4_deps):
 install-binPROGRAMS: $(bin_PROGRAMS)
 	@$(NORMAL_INSTALL)
-	test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
 	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+	fi; \
 	for p in $$list; do echo "$$p $$p"; done | \
 	sed 's/$(EXEEXT)$$//' | \
 	while read p p1; do if test -f $$p; \
@@ -331,6 +357,20 @@ GTAGS:
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
 
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
@@ -473,7 +513,7 @@ uninstall-am: uninstall-binPROGRAMS
 .MAKE: install-am install-strip
 
 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
-	clean-generic ctags distclean distclean-compile \
+	clean-generic cscopelist ctags distclean distclean-compile \
 	distclean-generic distclean-tags distdir dvi dvi-am html \
 	html-am info info-am install install-am install-binPROGRAMS \
 	install-data install-data-am install-dvi install-dvi-am \
diff --git a/PathOverlap/PathOverlap.cpp b/PathOverlap/PathOverlap.cpp
index c826573..dd607d3 100644
--- a/PathOverlap/PathOverlap.cpp
+++ b/PathOverlap/PathOverlap.cpp
@@ -119,7 +119,7 @@ struct Vertex {
 		return id == v.id && sense == v.sense;
 	}
 
-	operator ContigNode() const
+	ContigNode descriptor() const
 	{
 		return ContigNode(s_offset + id, sense);
 	}
@@ -178,8 +178,12 @@ static ContigPath getPath(const Paths& paths, const ContigNode& u)
 static Paths readPaths(Graph& g,
 		const string& inPath, vector<string>& pathIDs)
 {
+	typedef graph_traits<Graph>::vertex_descriptor V;
+
 	assert(pathIDs.empty());
 	ifstream fin(inPath.c_str());
+	if (opt::verbose > 0)
+		cerr << "Reading `" << inPath << "'..." << endl;
 	if (inPath != "-")
 		assert_good(fin, inPath);
 	istream& in = inPath == "-" ? cin : fin;
@@ -191,7 +195,7 @@ static Paths readPaths(Graph& g,
 	while (in >> id >> path) {
 		if (path.empty()) {
 			// Remove this contig from the graph.
-			ContigNode u(id, false);
+			V u = find_vertex(id, false, g);
 			clear_vertex(u, g);
 			remove_vertex(u, g);
 		} else {
@@ -218,7 +222,7 @@ static SeedMap makeSeedMap(const Paths& paths)
 		seedMap.insert(make_pair(it->front(),
 					Vertex(it - paths.begin(), false)));
 		assert(!it->back().ambiguous());
-		seedMap.insert(make_pair(~it->back(),
+		seedMap.insert(make_pair(it->back() ^ 1,
 					Vertex(it - paths.begin(), true)));
 	}
 	return seedMap;
@@ -308,7 +312,7 @@ static void recordTrimmedContigs(
 {
 	for (ContigPath::const_iterator it = first; it != last; ++it)
 		if (!it->ambiguous())
-			s_trimmedContigs.push_back(ContigID(*it));
+			s_trimmedContigs.push_back(it->contigIndex());
 }
 
 /** Remove ambiguous contigs from the ends of the path. */
@@ -382,18 +386,21 @@ static void addPathOverlapEdges(Graph& g,
 		const Paths& paths, const vector<string>& pathIDs,
 		const Overlaps& overlaps)
 {
+	typedef graph_traits<Graph>::vertex_descriptor V;
 	const bool allowParallelEdge = opt::mode == opt::ASSEMBLE;
 
 	// Add the path vertices.
-	ContigID::unlock();
+	g_contigNames.unlock();
 	for (Paths::const_iterator it = paths.begin();
 			it != paths.end(); ++it) {
-		if (it->empty())
-			continue;
-		ContigID::insert(pathIDs[it - paths.begin()]);
-		merge(g, it->begin(), it->end());
+		const ContigPath& path = *it;
+		const string& id = pathIDs[it - paths.begin()];
+		if (!path.empty()) {
+			V u = merge(g, path.begin(), path.end());
+			put(vertex_name, g, u, id);
+		}
 	}
-	ContigID::lock();
+	g_contigNames.lock();
 
 	// Remove the single-end contigs that are in paths.
 	for (Paths::const_iterator it = paths.begin();
@@ -404,12 +411,13 @@ static void addPathOverlapEdges(Graph& g,
 	// Add the path edges.
 	for (Overlaps::const_iterator it = overlaps.begin();
 			it != overlaps.end(); ++it) {
-		Vertex u = it->source, v = it->target;
+		V u = it->source.descriptor();
+		V v = it->target.descriptor();
 		if (allowParallelEdge || !edge(u, v, g).second)
 			add_edge(u, v, it->distance, static_cast<DG&>(g));
 		else if (opt::verbose > 0)
-			cerr << "ambiguous overlap: "
-				<< ContigNode(u) << " -> " << ContigNode(v) << '\n';
+			cerr << "ambiguous overlap: " << get(vertex_name, g, u)
+				<< " -> " << get(vertex_name, g, v) << '\n';
 	}
 }
 
@@ -421,7 +429,8 @@ typedef map<edge_descriptor, unsigned> OverlapMap;
 
 /** Return the number of contigs by which the two paths overlap. */
 static unsigned getOverlap(const OverlapMap& pmap,
-		const ContigNode& u, const ContigNode& v)
+		graph_traits<Graph>::vertex_descriptor u,
+		graph_traits<Graph>::vertex_descriptor v)
 {
 	if (isPath(u) && isPath(v)) {
 		// Both vertices are paths.
@@ -485,7 +494,9 @@ static void assembleOverlappingPaths(Graph& g,
 	for (Overlaps::const_iterator it = overlaps.begin();
 			it != overlaps.end(); ++it)
 		overlapMap.insert(OverlapMap::value_type(
-				OverlapMap::key_type(it->source, it->target),
+				OverlapMap::key_type(
+					it->source.descriptor(),
+					it->target.descriptor()),
 				it->overlap));
 
 	// Assemble unambiguously overlapping paths.
@@ -494,14 +505,17 @@ static void assembleOverlappingPaths(Graph& g,
 			IsPathOverlap(g, overlapMap));
 
 	// Merge overlapping paths.
+	g_contigNames.unlock();
 	assert(!pathIDs.empty());
-	ContigID::setNextContigID(pathIDs.back());
+	setNextContigName(pathIDs.back());
 	for (Paths::const_iterator it = merges.begin();
 			it != merges.end(); ++it) {
-		ContigID id = ContigID::create();
+		string name = createContigName();
 		if (opt::verbose > 0)
-			cerr << id << '\t' << *it << '\n';
-		pathIDs.push_back((string)id.str());
+			cerr << name << '\t' << *it << '\n';
+		Vertex u(paths.size(), false);
+		put(vertex_name, g, u.descriptor(), name);
+		pathIDs.push_back(name);
 		paths.push_back(mergePaths(paths, overlapMap, *it));
 
 		// Remove the merged paths.
@@ -511,6 +525,7 @@ static void assembleOverlappingPaths(Graph& g,
 				paths[it2->id() - Vertex::s_offset].clear();
 		}
 	}
+	g_contigNames.lock();
 }
 
 int main(int argc, char** argv)
@@ -568,6 +583,8 @@ int main(int argc, char** argv)
 	}
 
 	const char *adjPath = argv[optind++];
+	if (opt::verbose > 0)
+		cerr << "Reading `" << adjPath << "'..." << endl;
 	ifstream fin(adjPath);
 	assert_good(fin, adjPath);
 	Graph g;
@@ -638,7 +655,7 @@ int main(int argc, char** argv)
 		for (vector<ContigID>::const_iterator it
 				= s_trimmedContigs.begin();
 				it != s_trimmedContigs.end(); ++it)
-			out << ContigID(*it) << '\n';
+			out << get(g_contigNames, *it) << '\n';
 		assert_good(out, opt::repeatContigs);
 	}
 
diff --git a/PopBubbles/Makefile.in b/PopBubbles/Makefile.in
index b30d607..394bcf6 100644
--- a/PopBubbles/Makefile.in
+++ b/PopBubbles/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# Makefile.in generated by automake 1.12 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -16,6 +16,23 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -34,7 +51,8 @@ PRE_UNINSTALL = :
 POST_UNINSTALL = :
 bin_PROGRAMS = PopBubbles$(EXEEXT)
 subdir = PopBubbles
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -65,6 +83,11 @@ CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
 	-o $@
 SOURCES = $(PopBubbles_SOURCES)
 DIST_SOURCES = $(PopBubbles_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -213,8 +236,11 @@ $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 $(am__aclocal_m4_deps):
 install-binPROGRAMS: $(bin_PROGRAMS)
 	@$(NORMAL_INSTALL)
-	test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
 	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+	fi; \
 	for p in $$list; do echo "$$p $$p"; done | \
 	sed 's/$(EXEEXT)$$//' | \
 	while read p p1; do if test -f $$p; \
@@ -337,6 +363,20 @@ GTAGS:
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
 
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
@@ -479,7 +519,7 @@ uninstall-am: uninstall-binPROGRAMS
 .MAKE: install-am install-strip
 
 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
-	clean-generic ctags distclean distclean-compile \
+	clean-generic cscopelist ctags distclean distclean-compile \
 	distclean-generic distclean-tags distdir dvi dvi-am html \
 	html-am info info-am install install-am install-binPROGRAMS \
 	install-data install-data-am install-dvi install-dvi-am \
diff --git a/PopBubbles/PopBubbles.cpp b/PopBubbles/PopBubbles.cpp
index c65bb7f..c60e2b4 100644
--- a/PopBubbles/PopBubbles.cpp
+++ b/PopBubbles/PopBubbles.cpp
@@ -11,7 +11,6 @@
 #include "ContigProperties.h"
 #include "FastaReader.h"
 #include "IOUtil.h"
-#include "Iterator.h"
 #include "Sequence.h"
 #include "Uncompress.h"
 #include "alignGlobal.h"
@@ -180,16 +179,16 @@ static void popBubble(Graph& g,
 	if (opt::dot)
 #pragma omp critical(cout)
 	{
-		cout << '"' << v << "\" -> {";
-		copy(sorted.begin(), sorted.end(),
-				affix_ostream_iterator<ContigNode>(cout,
-					" \"", "\""));
-		cout << " } -> \"" << tail << "\"\n";
+		cout << '"' << get(vertex_name, g, v) << "\" -> {";
+		for (vector<vertex_descriptor>::const_iterator
+				it = sorted.begin(); it != sorted.end(); ++it)
+			cout << " \"" << get(vertex_name, g, *it) << '"';
+		cout << " } -> \"" << get(vertex_name, g, tail) << "\"\n";
 	}
 #pragma omp critical(g_popped)
 	transform(sorted.begin() + 1, sorted.end(),
 			back_inserter(g_popped),
-			mem_fun_ref(&ContigNode::operator ContigID));
+			mem_fun_ref(&ContigNode::contigIndex));
 }
 
 static struct {
@@ -207,12 +206,12 @@ typedef vector<const_string> Contigs;
 static Contigs g_contigs;
 
 /** Return the sequence of vertex u. */
-static string getSequence(vertex_descriptor u)
+static string getSequence(const Graph* g, vertex_descriptor u)
 {
-	assert(!u.ambiguous());
-	assert(u.id() < g_contigs.size());
-	string seq(g_contigs[u.id()]);
-	return u.sense() ? reverseComplement(seq) : seq;
+	size_t i = get(vertex_contig_index, *g, u);
+	assert(i < g_contigs.size());
+	string seq(g_contigs[i]);
+	return get(vertex_sense, *g, u) ? reverseComplement(seq) : seq;
 }
 
 /** Return the length of vertex v. */
@@ -302,7 +301,7 @@ static float getAlignmentIdentity(const Graph& g,
 		return max_identity;
 
 	vector<string> seqs(nbranches);
-	transform(first, last, seqs.begin(), getSequence);
+	transform(first, last, seqs.begin(), bind(getSequence, &g, _1));
 	for (unsigned i = 0; i < seqs.size(); i++) {
 		// Remove the overlapping sequence.
 		int n = seqs[i].size();
@@ -332,7 +331,7 @@ static bool popSimpleBubble(Graph* pg, vertex_descriptor v)
 		return false;
 	}
 	vertex_descriptor tail = *g.adjacent_vertices(v1).first;
-	if (v == ~tail // Palindrome
+	if (v == get(vertex_complement, g, tail) // Palindrome
 			|| g.in_degree(tail) != nbranches) {
 #pragma omp atomic
 		g_count.notSimple++;
@@ -359,10 +358,11 @@ static bool popSimpleBubble(Graph* pg, vertex_descriptor v)
 	if (opt::verbose > 2)
 #pragma omp critical(cerr)
 	{
-		cerr << "\n* " << v << " -> ";
-		copy(adj.first, adj.second,
-				ostream_iterator<ContigNode>(cerr, " "));
-		cerr << "-> " << tail << '\n';
+		cerr << "\n* " << get(vertex_name, g, v) << " ->";
+		for (adjacency_iterator it = adj.first;
+				it != adj.second; ++it)
+			cerr << ' ' << get(vertex_name, g, *it);
+		cerr << " -> " << get(vertex_name, g, tail) << '\n';
 	}
 
 	if (nbranches > opt::maxBranches) {
@@ -476,8 +476,12 @@ static void scaffoldBubble(Graph& g, const Bubble& bubble)
 	}
 	assert(isBubble(g, bubble.begin(), bubble.end()));
 
-	g_popped.insert(g_popped.end(),
-			bubble.begin() + 1, bubble.end() - 1);
+	assert(bubble.size() > 2);
+	size_t n = bubble.size() - 2;
+	g_popped.reserve(g_popped.size() + n);
+	for (Bubble::const_iterator it = bubble.begin() + 1;
+			it != bubble.end() - 1; ++it)
+		g_popped.push_back(it->contigIndex());
 
 	add_edge(u, w, max(longestPath(g, bubble), 1), g);
 }
@@ -526,7 +530,7 @@ static void filterGraph(Graph& g)
 			removedKmer += getKmerLength(vp);
 			clear_vertex(u, g);
 			remove_vertex(u, g);
-			g_popped.push_back(u);
+			g_popped.push_back(get(vertex_contig_index, g, u));
 		}
 	}
 	if (opt::verbose > 0) {
@@ -626,7 +630,7 @@ int main(int argc, char** argv)
 	Graph g;
 	fin >> g;
 	assert(fin.eof());
-	ContigID::lock();
+	g_contigNames.lock();
 	if (opt::verbose > 0)
 		printGraphStats(cerr, g);
 
@@ -637,10 +641,9 @@ int main(int argc, char** argv)
 			cerr << "Reading `" << contigsPath << "'...\n";
 		FastaReader in(contigsPath, FastaReader::NO_FOLD_CASE);
 		for (FastaRecord rec; in >> rec;) {
-			if (ContigID::count(rec.id) == 0)
+			if (g_contigNames.count(rec.id) == 0)
 				continue;
-			ContigID id(rec.id);
-			assert(contigs.size() == id);
+			assert(contigs.size() == get(g_contigNames, rec.id));
 			contigs.push_back(rec.seq);
 		}
 		assert(in.eof());
@@ -665,11 +668,13 @@ int main(int argc, char** argv)
 	g_popped.erase(unique(g_popped.begin(), g_popped.end()),
 			g_popped.end());
 
-	if (opt::dot)
+	if (opt::dot) {
 		cout << "}\n";
-	else
-		copy(g_popped.begin(), g_popped.end(),
-				ostream_iterator<ContigID>(cout, "\n"));
+	} else {
+		for (vector<ContigID>::const_iterator it = g_popped.begin();
+				it != g_popped.end(); ++it)
+			cout << get(g_contigNames, *it) << '\n';
+	}
 	free_prob_dist(pdist);
 	free(para);
 
@@ -689,21 +694,32 @@ int main(int argc, char** argv)
 				bind1st(ptr_fun(removeContig), &g));
 
 		// Assemble unambiguous paths.
+		g_contigNames.unlock();
 		typedef vector<ContigPath> ContigPaths;
 		ContigPaths paths;
+		size_t numContigs = num_vertices(g) / 2;
 		if (opt::scaffold) {
 			Graph gorig = g;
 			assemble(g, back_inserter(paths));
 			for (ContigPaths::const_iterator it = paths.begin();
-					it != paths.end(); ++it)
-				cout << ContigID::create() << '\t'
+					it != paths.end(); ++it) {
+				ContigNode u(numContigs + it - paths.begin(), false);
+				string name = createContigName();
+				put(vertex_name, g, u, name);
+				cout << name << '\t'
 					<< addDistance(gorig, *it) << '\n';
+			}
 		} else {
 			assemble(g, back_inserter(paths));
 			for (ContigPaths::const_iterator it = paths.begin();
-					it != paths.end(); ++it)
-				cout << ContigID::create() << '\t' << *it << '\n';
+					it != paths.end(); ++it) {
+				ContigNode u(numContigs + it - paths.begin(), false);
+				string name = createContigName();
+				put(vertex_name, g, u, name);
+				cout << name << '\t' << *it << '\n';
+			}
 		}
+		g_contigNames.lock();
 		paths.clear();
 
 		// Output the updated adjacency graph.
diff --git a/README b/README.md
similarity index 100%
rename from README
rename to README.md
diff --git a/Scaffold/Makefile.am b/Scaffold/Makefile.am
index b3225f6..b6ca98d 100644
--- a/Scaffold/Makefile.am
+++ b/Scaffold/Makefile.am
@@ -1,4 +1,5 @@
 bin_PROGRAMS = abyss-scaffold abyss-junction
+noinst_PROGRAMS = abyss-drawgraph
 
 abyss_scaffold_CPPFLAGS = -I$(top_srcdir) \
 	-I$(top_srcdir)/Common
@@ -19,3 +20,7 @@ abyss_junction_LDADD = \
 	$(top_builddir)/Common/libcommon.a
 
 abyss_junction_SOURCES = junction.cc
+
+abyss_drawgraph_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/Common
+abyss_drawgraph_LDADD = $(top_builddir)/Common/libcommon.a
+abyss_drawgraph_SOURCES = drawgraph.cc
diff --git a/Scaffold/Makefile.in b/Scaffold/Makefile.in
index c4a95ba..ea9e543 100644
--- a/Scaffold/Makefile.in
+++ b/Scaffold/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# Makefile.in generated by automake 1.12 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -16,6 +16,23 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -33,8 +50,10 @@ NORMAL_UNINSTALL = :
 PRE_UNINSTALL = :
 POST_UNINSTALL = :
 bin_PROGRAMS = abyss-scaffold$(EXEEXT) abyss-junction$(EXEEXT)
+noinst_PROGRAMS = abyss-drawgraph$(EXEEXT)
 subdir = Scaffold
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -44,7 +63,10 @@ CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
 CONFIG_CLEAN_VPATH_FILES =
 am__installdirs = "$(DESTDIR)$(bindir)"
-PROGRAMS = $(bin_PROGRAMS)
+PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS)
+am_abyss_drawgraph_OBJECTS = abyss_drawgraph-drawgraph.$(OBJEXT)
+abyss_drawgraph_OBJECTS = $(am_abyss_drawgraph_OBJECTS)
+abyss_drawgraph_DEPENDENCIES = $(top_builddir)/Common/libcommon.a
 am_abyss_junction_OBJECTS = abyss_junction-junction.$(OBJEXT)
 abyss_junction_OBJECTS = $(am_abyss_junction_OBJECTS)
 abyss_junction_DEPENDENCIES = $(top_builddir)/Common/libcommon.a
@@ -64,8 +86,15 @@ CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
 CXXLD = $(CXX)
 CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
 	-o $@
-SOURCES = $(abyss_junction_SOURCES) $(abyss_scaffold_SOURCES)
-DIST_SOURCES = $(abyss_junction_SOURCES) $(abyss_scaffold_SOURCES)
+SOURCES = $(abyss_drawgraph_SOURCES) $(abyss_junction_SOURCES) \
+	$(abyss_scaffold_SOURCES)
+DIST_SOURCES = $(abyss_drawgraph_SOURCES) $(abyss_junction_SOURCES) \
+	$(abyss_scaffold_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -180,6 +209,9 @@ abyss_junction_LDADD = \
 	$(top_builddir)/Common/libcommon.a
 
 abyss_junction_SOURCES = junction.cc
+abyss_drawgraph_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/Common
+abyss_drawgraph_LDADD = $(top_builddir)/Common/libcommon.a
+abyss_drawgraph_SOURCES = drawgraph.cc
 all: all-am
 
 .SUFFIXES:
@@ -216,8 +248,11 @@ $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 $(am__aclocal_m4_deps):
 install-binPROGRAMS: $(bin_PROGRAMS)
 	@$(NORMAL_INSTALL)
-	test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
 	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+	fi; \
 	for p in $$list; do echo "$$p $$p"; done | \
 	sed 's/$(EXEEXT)$$//' | \
 	while read p p1; do if test -f $$p; \
@@ -251,6 +286,12 @@ uninstall-binPROGRAMS:
 
 clean-binPROGRAMS:
 	-test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+
+clean-noinstPROGRAMS:
+	-test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS)
+abyss-drawgraph$(EXEEXT): $(abyss_drawgraph_OBJECTS) $(abyss_drawgraph_DEPENDENCIES) $(EXTRA_abyss_drawgraph_DEPENDENCIES) 
+	@rm -f abyss-drawgraph$(EXEEXT)
+	$(CXXLINK) $(abyss_drawgraph_OBJECTS) $(abyss_drawgraph_LDADD) $(LIBS)
 abyss-junction$(EXEEXT): $(abyss_junction_OBJECTS) $(abyss_junction_DEPENDENCIES) $(EXTRA_abyss_junction_DEPENDENCIES) 
 	@rm -f abyss-junction$(EXEEXT)
 	$(abyss_junction_LINK) $(abyss_junction_OBJECTS) $(abyss_junction_LDADD) $(LIBS)
@@ -264,6 +305,7 @@ mostlyclean-compile:
 distclean-compile:
 	-rm -f *.tab.c
 
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/abyss_drawgraph-drawgraph.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/abyss_junction-junction.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/abyss_scaffold-scaffold.Po at am__quote@
 
@@ -281,6 +323,20 @@ distclean-compile:
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
 
+abyss_drawgraph-drawgraph.o: drawgraph.cc
+ at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(abyss_drawgraph_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT abyss_drawgraph-drawgraph.o -MD -MP -MF $(DEPDIR)/abyss_drawgraph-drawgraph.Tpo -c -o abyss_drawgraph-drawgraph.o `test -f 'drawgraph.cc' || echo '$(srcdir)/'`drawgraph.cc
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/abyss_drawgraph-drawgraph.Tpo $(DEPDIR)/abyss_drawgraph-drawgraph.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='drawgraph.cc' object='abyss_drawgraph-drawgraph.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(abyss_drawgraph_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o abyss_drawgraph-drawgraph.o `test -f 'drawgraph.cc' || echo '$(srcdir)/'`drawgraph.cc
+
+abyss_drawgraph-drawgraph.obj: drawgraph.cc
+ at am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(abyss_drawgraph_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT abyss_drawgraph-drawgraph.obj -MD -MP -MF $(DEPDIR)/abyss_drawgraph-drawgraph.Tpo -c -o abyss_drawgraph-drawgraph.obj `if test -f 'drawgraph.cc'; then $(CYGPATH_W) 'drawgraph.cc'; else $(CYGPATH_W) '$(srcdir)/drawgraph.cc'; fi`
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/abyss_drawgraph-drawgraph.Tpo $(DEPDIR)/abyss_drawgraph-drawgraph.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='drawgraph.cc' object='abyss_drawgraph-drawgraph.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(abyss_drawgraph_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o abyss_drawgraph-drawgraph.obj `if test -f 'drawgraph.cc'; then $(CYGPATH_W) 'drawgraph.cc'; else $(CYGPATH_W) '$(srcdir)/drawgraph.cc'; fi`
+
 abyss_junction-junction.o: junction.cc
 @am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(abyss_junction_CPPFLAGS) $(CPPFLAGS) $(abyss_junction_CXXFLAGS) $(CXXFLAGS) -MT abyss_junction-junction.o -MD -MP -MF $(DEPDIR)/abyss_junction-junction.Tpo -c -o abyss_junction-junction.o `test -f 'junction.cc' || echo '$(srcdir)/'`junction.cc
 @am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/abyss_junction-junction.Tpo $(DEPDIR)/abyss_junction-junction.Po
@@ -358,6 +414,20 @@ GTAGS:
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
 
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
@@ -430,7 +500,8 @@ maintainer-clean-generic:
 	@echo "it deletes files that may require special tools to rebuild."
 clean: clean-am
 
-clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
+clean-am: clean-binPROGRAMS clean-generic clean-noinstPROGRAMS \
+	mostlyclean-am
 
 distclean: distclean-am
 	-rm -rf ./$(DEPDIR)
@@ -500,17 +571,17 @@ uninstall-am: uninstall-binPROGRAMS
 .MAKE: install-am install-strip
 
 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
-	clean-generic ctags distclean distclean-compile \
-	distclean-generic distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-binPROGRAMS \
-	install-data install-data-am install-dvi install-dvi-am \
-	install-exec install-exec-am install-html install-html-am \
-	install-info install-info-am install-man install-pdf \
-	install-pdf-am install-ps install-ps-am install-strip \
-	installcheck installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
-	uninstall-am uninstall-binPROGRAMS
+	clean-generic clean-noinstPROGRAMS cscopelist ctags distclean \
+	distclean-compile distclean-generic distclean-tags distdir dvi \
+	dvi-am html html-am info info-am install install-am \
+	install-binPROGRAMS install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-binPROGRAMS
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/Scaffold/drawgraph.cc b/Scaffold/drawgraph.cc
new file mode 100644
index 0000000..ccce65b
--- /dev/null
+++ b/Scaffold/drawgraph.cc
@@ -0,0 +1,268 @@
+/**
+ * Place each contig on a one-dimesional coordinate system using
+ * distance estimates.
+ * Written by Shaun Jackman.
+ */
+
+/** Disable Boost uBLAS runtime sanity checks. */
+#define BOOST_UBLAS_NDEBUG 1
+
+#include "ContigProperties.h"
+#include "Estimate.h"
+#include "Graph/ContigGraph.h"
+#include "Graph/ContigGraphAlgorithms.h"
+#include "Graph/DirectedGraph.h"
+#include "Graph/GraphIO.h"
+#include "Graph/GraphUtil.h"
+#include "cholesky.hpp"
+#include <boost/numeric/ublas/matrix.hpp>
+#include <boost/numeric/ublas/vector.hpp>
+#include <algorithm>
+#include <cassert>
+#include <fstream>
+#include <getopt.h>
+#include <iostream>
+#include <limits>
+#include <string>
+
+using namespace std;
+using boost::tie;
+namespace ublas = boost::numeric::ublas;
+
+#define PROGRAM "abyss-drawgraph"
+
+static const char VERSION_MESSAGE[] =
+PROGRAM " (" PACKAGE_NAME ") " VERSION "\n"
+"Written by Shaun Jackman.\n"
+"\n"
+"Copyright 2012 Canada's Michael Smith Genome Science Centre\n";
+
+static const char USAGE_MESSAGE[] =
+"Usage: " PROGRAM " [OPTION]... FASTA|OVERLAP DIST...\n"
+"Place each contig on a one-dimesional coordinate system using\n"
+"distance estimates and output a DOT graph with coordinates.\n"
+"  FASTA    contigs in FASTA format\n"
+"  OVERLAP  the contig overlap graph\n"
+"  DIST     estimates of the distance between contigs\n"
+"\n"
+"  -x, --xscale=N        set the x scale to N nt/inch [100e3]\n"
+"  -v, --verbose         display verbose output\n"
+"      --help            display this help and exit\n"
+"      --version         output version information and exit\n"
+"\n"
+"Report bugs to <" PACKAGE_BUGREPORT ">.\n";
+
+namespace opt {
+	unsigned k; // used by ContigProperties
+
+	/** The x scale. */
+	double xscale = 100e3; // nt/inch
+
+	/** Verbose output. */
+	int verbose; // used by PopBubbles
+
+	/** Output format */
+	int format = DOT; // used by DistanceEst
+}
+
+static const char shortopts[] = "x:v";
+
+enum { OPT_HELP = 1, OPT_VERSION };
+
+static const struct option longopts[] = {
+	{ "xscale", required_argument, NULL, 'x' },
+	{ "verbose", no_argument, NULL, 'v' },
+	{ "help", no_argument, NULL, OPT_HELP },
+	{ "version", no_argument, NULL, OPT_VERSION },
+	{ NULL, 0, NULL, 0 }
+};
+
+/** A distance estimate graph. */
+typedef DirectedGraph<Length, DistanceEst> DG;
+typedef ContigGraph<DG> Graph;
+
+/** A matrix. */
+typedef ublas::matrix<double> Matrix;
+
+/** A vector. */
+typedef ublas::vector<double> Vector;
+
+/** Read a graph from the specified file. */
+static void readGraph(const string& path, Graph& g)
+{
+	if (opt::verbose > 0)
+		cerr << "Reading `" << path << "'...\n";
+	ifstream fin(path.c_str());
+	istream& in = path == "-" ? cin : fin;
+	assert_good(in, path);
+	read_graph(in, g, BetterDistanceEst());
+	assert(in.eof());
+	if (opt::verbose > 0)
+		printGraphStats(cerr, g);
+	g_contigNames.lock();
+}
+
+/** Solve Ax = b for x using Cholesky decomposition.
+ * The matrix A is symmetric and positive-definite.
+ * @param[in,out] a input matrix A, which is clobbered
+ * @param[in,out] b input vector b and output vector x
+ */
+static void solve(Matrix& a, Vector& b)
+{
+	int ret = cholesky_decompose(a);
+	if (ret > 0) {
+		cerr << PROGRAM ": error: "
+			"The graph has multiple connected components.\n";
+		exit(EXIT_FAILURE);
+	}
+	cholesky_solve(a, b, ublas::lower());
+}
+
+/** Run abyss-drawgraph. */
+int main(int argc, char** argv)
+{
+	bool die = false;
+	for (int c; (c = getopt_long(argc, argv,
+					shortopts, longopts, NULL)) != -1;) {
+		istringstream arg(optarg != NULL ? optarg : "");
+		switch (c) {
+		  case '?':
+			die = true;
+			break;
+		  case 'x':
+			arg >> opt::xscale;
+			break;
+		  case 'v':
+			opt::verbose++;
+			break;
+		  case OPT_HELP:
+			cout << USAGE_MESSAGE;
+			exit(EXIT_SUCCESS);
+		  case OPT_VERSION:
+			cout << VERSION_MESSAGE;
+			exit(EXIT_SUCCESS);
+		}
+		if (optarg != NULL && !arg.eof()) {
+			cerr << PROGRAM ": invalid option: `-"
+				<< (char)c << optarg << "'\n";
+			exit(EXIT_FAILURE);
+		}
+	}
+
+	if (argc - optind < 0) {
+		cerr << PROGRAM ": missing arguments\n";
+		die = true;
+	}
+
+	if (die) {
+		cerr << "Try `" << PROGRAM
+			<< " --help' for more information.\n";
+		exit(EXIT_FAILURE);
+	}
+
+	typedef graph_traits<Graph>::edge_descriptor E;
+	typedef graph_traits<Graph>::edge_iterator Eit;
+	typedef graph_traits<Graph>::vertex_descriptor V;
+	typedef graph_traits<Graph>::vertex_iterator Vit;
+	typedef edge_bundle_type<Graph>::type EP;
+
+	Graph g;
+	if (optind < argc) {
+		for (; optind < argc; optind++)
+			readGraph(argv[optind], g);
+	} else
+		readGraph("-", g);
+
+	// Add any missing complementary edges.
+	addComplementaryEdges(g);
+
+	size_t n = num_vertices(g);
+	Matrix a(n, n);
+	Vector b = ublas::zero_vector<double>(n);
+
+	// Set the origin.
+	a(0, 0) = 1;
+
+	// Build the information matrix.
+	Eit eit, elast;
+	for (tie(eit, elast) = edges(g); eit != elast; ++eit) {
+		E e = *eit;
+		V u = source(e, g);
+		V v = target(e, g);
+		size_t ui = get(vertex_index, g, u);
+		size_t vi = get(vertex_index, g, v);
+		int d = get(edge_weight, g, e);
+		double err = max(0.1, (double)g[e].stdDev);
+		double weight = 1 / err;
+		a(ui, ui) += weight;
+		a(ui, vi) -= weight;
+		a(vi, ui) -= weight;
+		a(vi, vi) += weight;
+		b[ui] -= d * weight;
+		b[vi] += d * weight;
+	}
+
+	// Solve the equation Ax = b for x.
+	solve(a, b);
+
+	// Output the coordinates of each contig.
+	if (opt::verbose > 1) {
+		Vit uit, ulast;
+		for (tie(uit, ulast) = vertices(g); uit != ulast; ++uit) {
+			V u = *uit;
+			size_t ui = get(vertex_index, g, u);
+			ssize_t x1 = (ssize_t)b[ui];
+			ssize_t x0 = x1 - g[u].length;
+			cerr << get(vertex_name, g, u)
+				<< '\t' << x0 << '\t' << x1 << '\n';
+		}
+	}
+
+	// Sort the contigs by their right coordinate.
+	std::vector< std::pair<double, V> > sorted;
+	sorted.reserve(n);
+	Vit uit, ulast;
+	for (tie(uit, ulast) = vertices(g); uit != ulast; ++uit) {
+		V u = *uit;
+		size_t ui = get(vertex_index, g, u);
+		sorted.push_back(std::make_pair(b[ui], u));
+	}
+	sort(sorted.begin(), sorted.end());
+
+	// Write the graph.
+	cout << "digraph g {\n"
+		"node [shape=\"box\" height=0.3 fixedsize=1]\n";
+	assert_good(cout, "stdout");
+
+	// Write the vertices.
+	double pos0 = -numeric_limits<double>::max();
+	size_t yi = 0;
+	for (size_t i = 0; i < n; ++i) {
+		V u = sorted[i].second;
+		double pos = b[get(vertex_index, g, u)];
+		size_t l = g[u].length;
+
+		if (pos - l < pos0)
+			yi++;
+		pos0 = pos;
+
+		double dpi = 72;
+		const double W = dpi / opt::xscale; // pt/nt
+		const double H = 32; // pt
+		double w = l * W;
+		double x = pos * W - w / 2;
+		double y = yi * H;
+		cout << '"' << get(vertex_name, g, u) << "\""
+			" [pos=\"" << x << ",-" << y << "\""
+			" width=" << w / dpi << "]\n";
+	}
+
+	// Write the edges.
+	for (tie(eit, elast) = edges(g); eit != elast; ++eit)
+		cout << get(edge_name, g, *eit) << '\n';
+
+	cout << "}\n";
+	assert_good(cout, "stdout");
+
+	return 0;
+}
diff --git a/Scaffold/junction.cc b/Scaffold/junction.cc
index f05f782..6ad417c 100644
--- a/Scaffold/junction.cc
+++ b/Scaffold/junction.cc
@@ -92,30 +92,6 @@ typedef Graph OverlapGraph;
 /** A scaffold graph. */
 typedef Graph ScaffoldGraph;
 
-/** Add missing complementary edges. */
-static void addComplementaryEdges(DG& g)
-{
-	typedef graph_traits<DG> GTraits;
-	typedef GTraits::edge_descriptor E;
-	typedef GTraits::edge_iterator Eit;
-	typedef GTraits::vertex_descriptor V;
-
-	pair<Eit, Eit> erange = edges(g);
-	unsigned numAdded = 0;
-	for (Eit eit = erange.first; eit != erange.second; ++eit) {
-		E e = *eit;
-		V u = source(e, g), v = target(e, g);
-		if (!edge(~v, ~u, g).second) {
-			add_edge(~v, ~u, g[e], g);
-			numAdded++;
-		}
-	}
-	if (opt::verbose > 0)
-		cerr << "Added " << numAdded << " complementary edges.\n";
-	if (opt::verbose > 1)
-		printGraphStats(cerr, g);
-}
-
 /** Extend junction contigs. */
 void extendJunction(
 		const OverlapGraph& overlapG,
@@ -134,12 +110,13 @@ void extendJunction(
 		// This junction contig is supported by the scaffold graph.
 		ContigPath path;
 		path.reserve(3);
-		extend(overlapG, ~v, back_inserter(path));
+		extend(overlapG, get(vertex_complement, overlapG, v),
+				back_inserter(path));
 		reverseComplement(path.begin(), path.end());
 		path.push_back(v);
 		extend(overlapG, v, back_inserter(path));
 		assert(path.size() >= 3);
-		cout << ContigID::create() << '\t' << path << '\n';
+		cout << createContigName() << '\t' << path << '\n';
 		g_count.supported++;
 	}
 	g_count.junctions++;
@@ -166,7 +143,7 @@ static void readGraph(const string& path, Graph& g)
 	assert(in.eof());
 	if (opt::verbose > 1)
 		printGraphStats(cerr, g);
-	ContigID::lock();
+	g_contigNames.lock();
 }
 
 int main(int argc, char** argv)
@@ -212,7 +189,11 @@ int main(int argc, char** argv)
 		for_each(argv + optind, argv + argc,
 				bind(readGraph, _1, ref(scaffoldG)));
 		// Add any missing complementary edges.
-		addComplementaryEdges(scaffoldG);
+		size_t numAdded = addComplementaryEdges(scaffoldG);
+		if (opt::verbose > 0)
+			cerr << "Added " << numAdded << " complementary edges.\n";
+		if (opt::verbose > 1)
+			printGraphStats(cerr, scaffoldG);
 	} else
 		opt::noScaffoldGraph = true;
 
@@ -227,7 +208,7 @@ int main(int argc, char** argv)
 	// Extend the junction contigs.
 	graph_traits<OverlapGraph>::vertex_iterator uit, ulast;
 	for (tie(uit, ulast) = vertices(overlapG); uit != ulast; ++uit)
-		if (!seen[ContigID(*uit)])
+		if (!seen[get(vertex_contig_index, overlapG, *uit)])
 			extendJunction(overlapG, scaffoldG, *uit);
 
 	assert_good(cout, "stdout");
diff --git a/Scaffold/scaffold.cc b/Scaffold/scaffold.cc
index ad74041..8bd5102 100644
--- a/Scaffold/scaffold.cc
+++ b/Scaffold/scaffold.cc
@@ -4,6 +4,7 @@
 #include "ContigProperties.h"
 #include "Estimate.h"
 #include "IOUtil.h"
+#include "Iterator.h"
 #include "Uncompress.h"
 #include "Graph/Assemble.h"
 #include "Graph/ContigGraph.h"
@@ -81,8 +82,8 @@ namespace opt {
 	/** Verbose output. */
 	int verbose; // used by PopBubbles
 
- 	/** Output format */
- 	int format = DOT; // used by DistanceEst
+	/** Output format */
+	int format = DOT; // used by DistanceEst
 }
 
 static const char shortopts[] = "g:k:n:o:s:v";
@@ -106,28 +107,6 @@ static const struct option longopts[] = {
 typedef DirectedGraph<Length, DistanceEst> DG;
 typedef ContigGraph<DG> Graph;
 
-/** Add missing complementary edges. */
-static void addComplementaryEdges(DG& g)
-{
-	typedef graph_traits<Graph> GTraits;
-	typedef GTraits::edge_descriptor E;
-	typedef GTraits::edge_iterator Eit;
-	typedef GTraits::vertex_descriptor V;
-
-	std::pair<Eit, Eit> erange = edges(g);
-	unsigned numAdded = 0;
-	for (Eit eit = erange.first; eit != erange.second; ++eit) {
-		E e = *eit;
-		V u = source(e, g), v = target(e, g);
-		if (!edge(~v, ~u, g).second) {
-			add_edge(~v, ~u, g[e], g);
-			numAdded++;
-		}
-	}
-	if (opt::verbose > 0)
-		cerr << "Added " << numAdded << " complementary edges.\n";
-}
-
 /** Return whether the specified edges has sufficient support. */
 struct PoorSupport {
 	PoorSupport(Graph& g) : m_g(g) { }
@@ -231,14 +210,17 @@ static void resolveForks(Graph& g, const Graph& g0)
 				pair<E, bool> e21 = edge(v2, v1, g0);
 				if (e12.second && e21.second) {
 					if (opt::verbose > 1)
-						cerr << "cycle: " << v1 << ' ' << v2 << '\n';
+						cerr << "cycle: " << get(vertex_name, g, v1)
+							<< ' ' << get(vertex_name, g, v2) << '\n';
 				} else if (e12.second || e21.second) {
 					E e = e12.second ? e12.first : e21.first;
 					V v = source(e, g0), w = target(e, g0);
 					add_edge(v, w, g0[e], g);
 					numEdges++;
 					if (opt::verbose > 1)
-						cerr << u << " -> " << v << " -> " << w
+						cerr << get(vertex_name, g, u)
+							<< " -> " << get(vertex_name, g, v)
+							<< " -> " << get(vertex_name, g, w)
 							<< " [" << g0[e] << "]\n";
 				}
 			}
@@ -258,11 +240,11 @@ static void pruneTips(Graph& g)
 	typedef graph_traits<Graph>::vertex_descriptor V;
 
 	/** Identify the tips. */
-	vector<V> tips;
-	pruneTips(g, back_inserter(tips));
+	size_t n = 0;
+	pruneTips(g, CountingOutputIterator(n));
 
 	if (opt::verbose > 0) {
-		cerr << "Removed " << tips.size() << " tips.\n";
+		cerr << "Removed " << n << " tips.\n";
 		printGraphStats(cerr, g);
 	}
 }
@@ -314,9 +296,10 @@ static void removeRepeats(Graph& g)
 	repeats.erase(unique(repeats.begin(), repeats.end()),
 			repeats.end());
 	if (opt::verbose > 1) {
-		cerr << "Ambiguous: ";
-		copy(repeats.begin(), repeats.end(),
-				ostream_iterator<ContigNode>(cerr, " "));
+		cerr << "Ambiguous:";
+		for (vector<V>::const_iterator it = repeats.begin();
+				it != repeats.end(); ++it)
+			cerr << ' ' << get(vertex_name, g, *it);
 		cerr << '\n';
 	}
 
@@ -325,8 +308,9 @@ static void removeRepeats(Graph& g)
 	for (vector<V>::const_iterator it = repeats.begin();
 			it != repeats.end(); ++it) {
 		V u = *it;
+		V uc = get(vertex_complement, g, u);
 		clear_out_edges(u, g);
-		if (it != repeats.begin() && it[-1] == ~u) {
+		if (it != repeats.begin() && it[-1] == uc) {
 			remove_vertex(u, g);
 			numRemoved++;
 		}
@@ -407,8 +391,8 @@ static void removeWeakEdges(Graph& g)
 		for (vector<E>::const_iterator it = weak.begin();
 				it != weak.end(); ++it) {
 			E e = *it;
-			cerr << "\t\"" << source(e, g) << "\"->\"" << target(e, g)
-				<< "\" [" << g[e] << "]\n";
+			cerr << '\t' << get(edge_name, g, e)
+				<< " [" << g[e] << "]\n";
 		}
 	}
 
@@ -479,7 +463,7 @@ static void readGraph(const string& path, Graph& g)
 	assert(in.eof());
 	if (opt::verbose > 0)
 		printGraphStats(cerr, g);
-	ContigID::lock();
+	g_contigNames.lock();
 }
 
 /** Return the scaffold length of [first, last), not counting gaps. */
@@ -570,16 +554,18 @@ unsigned scaffold(const Graph& g0, unsigned minContigLength,
 	pruneTips(g);
 
 	// Pop bubbles.
-	vector<ContigNode> popped = popBubbles(g);
+	typedef graph_traits<Graph>::vertex_descriptor V;
+	vector<V> popped = popBubbles(g);
 	if (opt::verbose > 0) {
 		cerr << "Removed " << popped.size()
 			<< " vertices in bubbles.\n";
 		printGraphStats(cerr, g);
 	}
 	if (opt::verbose > 1) {
-		cerr << "Popped: ";
-		copy(popped.begin(), popped.end(),
-				ostream_iterator<ContigNode>(cerr, " "));
+		cerr << "Popped:";
+		for (vector<V>::const_iterator it = popped.begin();
+				it != popped.end(); ++it)
+			cerr << ' ' << get(vertex_name, g, *it);
 		cerr << '\n';
 	}
 
@@ -616,12 +602,11 @@ unsigned scaffold(const Graph& g0, unsigned minContigLength,
 	ofstream fout(opt::out.c_str());
 	ostream& out = opt::out.empty() || opt::out == "-" ? cout : fout;
 	assert_good(out, opt::out);
-	ContigID::unlock();
+	g_contigNames.unlock();
 	for (vector<ContigPath>::const_iterator it = paths.begin();
-			it != paths.end(); ++it) {
-		out << ContigID::create() << '\t'
+			it != paths.end(); ++it)
+		out << createContigName() << '\t'
 			<< addDistEst(g0, g, *it) << '\n';
-	}
 	assert_good(out, opt::out);
 
 	// Output the graph.
@@ -714,7 +699,11 @@ int main(int argc, char** argv)
 		readGraph("-", g);
 
 	// Add any missing complementary edges.
-	addComplementaryEdges(g);
+	size_t numAdded = addComplementaryEdges(g);
+	if (opt::verbose > 0) {
+		cerr << "Added " << numAdded << " complementary edges.\n";
+		printGraphStats(cerr, g);
+	}
 
 	if (opt::minContigLengthEnd == 0) {
 		scaffold(g, opt::minContigLength, true);
@@ -724,14 +713,16 @@ int main(int argc, char** argv)
 	// Find the value of s that maximizes the scaffold N50.
 	unsigned bests = 0, bestN50 = 0;
 	const double STEP = cbrt(10); // Three steps per decade.
-	unsigned ilast = round(log(opt::minContigLengthEnd) / log(STEP));
-	for (unsigned i = round(log(opt::minContigLength) / log(STEP));
+	unsigned ilast = (unsigned)round(
+			log(opt::minContigLengthEnd) / log(STEP));
+	for (unsigned i = (unsigned)round(
+				log(opt::minContigLength) / log(STEP));
 			i <= ilast; ++i) {
-		unsigned s = pow(STEP, (int)i);
+		unsigned s = (unsigned)pow(STEP, (int)i);
 
 		// Round to 1 figure.
 		double nearestDecade = pow(10, floor(log10(s)));
-		s = round(s / nearestDecade) * nearestDecade;
+		s = unsigned(round(s / nearestDecade) * nearestDecade);
 
 		unsigned n50 = scaffold(g, s, false);
 		if (opt::verbose > 0)
diff --git a/SimpleGraph/Makefile.in b/SimpleGraph/Makefile.in
index ef92a72..943b645 100644
--- a/SimpleGraph/Makefile.in
+++ b/SimpleGraph/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# Makefile.in generated by automake 1.12 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -16,6 +16,23 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -34,7 +51,8 @@ PRE_UNINSTALL = :
 POST_UNINSTALL = :
 bin_PROGRAMS = SimpleGraph$(EXEEXT)
 subdir = SimpleGraph
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -62,6 +80,11 @@ CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
 	-o $@
 SOURCES = $(SimpleGraph_SOURCES)
 DIST_SOURCES = $(SimpleGraph_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -206,8 +229,11 @@ $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 $(am__aclocal_m4_deps):
 install-binPROGRAMS: $(bin_PROGRAMS)
 	@$(NORMAL_INSTALL)
-	test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
 	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+	fi; \
 	for p in $$list; do echo "$$p $$p"; done | \
 	sed 's/$(EXEEXT)$$//' | \
 	while read p p1; do if test -f $$p; \
@@ -330,6 +356,20 @@ GTAGS:
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
 
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
@@ -472,7 +512,7 @@ uninstall-am: uninstall-binPROGRAMS
 .MAKE: install-am install-strip
 
 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
-	clean-generic ctags distclean distclean-compile \
+	clean-generic cscopelist ctags distclean distclean-compile \
 	distclean-generic distclean-tags distdir dvi dvi-am html \
 	html-am info info-am install install-am install-binPROGRAMS \
 	install-data install-data-am install-dvi install-dvi-am \
diff --git a/SimpleGraph/SimpleGraph.cpp b/SimpleGraph/SimpleGraph.cpp
index c4435b4..dfe82d9 100644
--- a/SimpleGraph/SimpleGraph.cpp
+++ b/SimpleGraph/SimpleGraph.cpp
@@ -2,7 +2,6 @@
 #include "ContigPath.h"
 #include "Estimate.h"
 #include "IOUtil.h"
-#include "Iterator.h"
 #include "Uncompress.h"
 #include "Graph/ConstrainedSearch.h"
 #include "Graph/ContigGraph.h"
@@ -45,6 +44,8 @@ static const char USAGE_MESSAGE[] =
 "      --max-cost=COST   maximum computational cost\n"
 "  -o, --out=FILE        write result to FILE\n"
 "  -j, --threads=THREADS use THREADS parallel threads [1]\n"
+"      --extend          extend unambiguous paths\n"
+"      --no-extend       do not extend unambiguous paths [default]\n"
 "      --scaffold        join contigs with Ns [default]\n"
 "      --no-scaffold     do not scaffold\n"
 "  -v, --verbose         display verbose output\n"
@@ -56,10 +57,14 @@ static const char USAGE_MESSAGE[] =
 namespace opt {
 	unsigned k; // used by ContigProperties
 	static unsigned threads = 1;
+	static int extend;
 	static int scaffold = 1;
 	static int verbose;
 	static string out;
 
+	/** The acceptable error of a distance estimate. */
+	unsigned distanceError = 6;
+
  	/** Output format */
  	int format = DIST; // used by Estimate
 }
@@ -73,6 +78,8 @@ static const struct option longopts[] = {
 	{ "dist-error",  required_argument, NULL, 'd' },
 	{ "max-cost",    required_argument, NULL, OPT_MAX_COST },
 	{ "out",         required_argument, NULL, 'o' },
+	{ "extend",      no_argument,       &opt::extend, 1 },
+	{ "no-extend",   no_argument,       &opt::extend, 0 },
 	{ "scaffold",    no_argument,       &opt::scaffold, 1 },
 	{ "no-scaffold", no_argument,       &opt::scaffold, 0 },
 	{ "threads",     required_argument,	NULL, 'j' },
@@ -156,11 +163,14 @@ int main(int argc, char** argv)
 	generatePathsThroughEstimates(g, estFile);
 }
 
-static ostream& printConstraints(ostream& out, Constraints s)
+/** Print a set of constraints. */
+static ostream& printConstraints(ostream& out,
+		const Graph& g, const Constraints& s)
 {
 	for (Constraints::const_iterator it = s.begin();
 			it != s.end(); ++it)
-		out << ' ' << it->first << ',' << it->second;
+		out << ' ' << get(vertex_name, g, it->first)
+			<< ',' << it->second;
 	return out;
 }
 
@@ -177,7 +187,7 @@ static set<ContigID> findRepeats(ContigID seed,
 		count[seed]++;
 		for (ContigPath::const_iterator it = solIt->begin();
 				it != solIt->end(); ++it)
-			count[ContigID(*it)]++;
+			count[it->contigIndex()]++;
 		for (map<ContigID, unsigned>::const_iterator
 				it = count.begin(); it != count.end(); ++it)
 			if (it->second > 1)
@@ -376,10 +386,12 @@ static void printDistanceMap(ostream& out, const Graph& g,
 	DistanceMap distanceMap = makeDistanceMap(g, u, path);
 	for (DistanceMap::const_iterator it = distanceMap.begin();
 			it != distanceMap.end(); ++it)
-		out << '"' << u << "\" -> \"" << it->first
-			<< "\" [d=" << it->second << "]\n";
+		out << get(edge_name, g, make_pair(u, it->first))
+			<< " [d=" << it->second << "]\n";
 }
 
+typedef std::vector<std::pair<ContigNode, DistanceEst> > Estimates;
+
 /** Find a path for the specified distance estimates.
  * @param out [out] the solution path
  */
@@ -394,21 +406,23 @@ static void handleEstimate(const Graph& g,
 	ostringstream vout_ss;
 	ostream bitBucket(NULL);
 	ostream& vout = opt::verbose > 0 ? vout_ss : bitBucket;
-	vout << "\n* " << origin << '\n';
+	vout << "\n* " << get(vertex_name, g, origin) << '\n';
 
 	unsigned minNumPairs = UINT_MAX;
 	// generate the reachable set
 	Constraints constraints;
-	for (EstimateVector::const_iterator iter
+	for (Estimates::const_iterator iter
 				= er.estimates[dirIdx].begin();
 			iter != er.estimates[dirIdx].end(); ++iter) {
-		minNumPairs = min(minNumPairs, iter->numPairs);
-		constraints.push_back(Constraint(iter->contig,
-					iter->distance + allowedError(iter->stdDev)));
+		ContigNode v = iter->first;
+		const DistanceEst& ep = iter->second;
+		minNumPairs = min(minNumPairs, ep.numPairs);
+		constraints.push_back(Constraint(v,
+					ep.distance + allowedError(ep.stdDev)));
 	}
 
 	vout << "Constraints:";
-	printConstraints(vout, constraints) << '\n';
+	printConstraints(vout, g, constraints) << '\n';
 
 	ContigPaths solutions;
 	unsigned numVisited = 0;
@@ -419,8 +433,9 @@ static void handleEstimate(const Graph& g,
 	set<ContigID> repeats = findRepeats(er.refID, solutions);
 	if (!repeats.empty()) {
 		vout << "Repeats:";
-		copy(repeats.begin(), repeats.end(),
-				affix_ostream_iterator<ContigID>(vout, " "));
+		for (set<ContigID>::const_iterator it = repeats.begin();
+				it != repeats.end(); ++it)
+			vout << ' ' << get(g_contigNames, *it);
 		vout << '\n';
 	}
 
@@ -439,13 +454,15 @@ static void handleEstimate(const Graph& g,
 
 		// Remove solutions whose distance estimates are not correct.
 		unsigned validCount = 0, invalidCount = 0, ignoredCount = 0;
-		for (EstimateVector::const_iterator iter
+		for (Estimates::const_iterator iter
 					= er.estimates[dirIdx].begin();
 				iter != er.estimates[dirIdx].end(); ++iter) {
-			vout << *iter << '\t';
+			ContigNode v = iter->first;
+			const DistanceEst& ep = iter->second;
+			vout << get(vertex_name, g, v) << ',' << ep << '\t';
 
 			map<ContigNode, int>::iterator dmIter
-				= distanceMap.find(iter->contig);
+				= distanceMap.find(v);
 			if (dmIter == distanceMap.end()) {
 				// This contig is a repeat.
 				ignoredCount++;
@@ -456,10 +473,10 @@ static void handleEstimate(const Graph& g,
 			// translate distance by -overlap to match
 			// coordinate space used by the estimate
 			int actualDistance = dmIter->second;
-			int diff = actualDistance - iter->distance;
-			unsigned buffer = allowedError(iter->stdDev);
+			int diff = actualDistance - ep.distance;
+			unsigned buffer = allowedError(ep.stdDev);
 			bool invalid = (unsigned)abs(diff) > buffer;
-			bool repeat = repeats.count(ContigID(iter->contig)) > 0;
+			bool repeat = repeats.count(v.contigIndex()) > 0;
 			bool ignored = invalid && repeat;
 			if (ignored)
 				ignoredCount++;
@@ -470,7 +487,7 @@ static void handleEstimate(const Graph& g,
 			vout << "dist: " << actualDistance
 				<< " diff: " << diff
 				<< " buffer: " << buffer
-				<< " n: " << iter->numPairs
+				<< " n: " << ep.numPairs
 				<< (ignored ? " ignored" : invalid ? " invalid" : "")
 				<< '\n';
 		}
@@ -495,16 +512,18 @@ static void handleEstimate(const Graph& g,
 		map<ContigNode, int> distanceMap
 			= makeDistanceMap(g, origin, *solIter);
 		int sumDiff = 0;
-		for (EstimateVector::const_iterator iter
+		for (Estimates::const_iterator iter
 					= er.estimates[dirIdx].begin();
 				iter != er.estimates[dirIdx].end(); ++iter) {
-			if (repeats.count(ContigID(iter->contig)) > 0)
+			ContigNode v = iter->first;
+			const DistanceEst& ep = iter->second;
+			if (repeats.count(v.contigIndex()) > 0)
 				continue;
 			map<ContigNode, int>::iterator dmIter
-				= distanceMap.find(iter->contig);
+				= distanceMap.find(v);
 			assert(dmIter != distanceMap.end());
 			int actualDistance = dmIter->second;
-			int diff = actualDistance - iter->distance;
+			int diff = actualDistance - ep.distance;
 			sumDiff += abs(diff);
 		}
 
@@ -533,13 +552,14 @@ static void handleEstimate(const Graph& g,
 	} else if (solutions.empty()) {
 		stats.noValidPaths++;
 	} else if (repeats.count(er.refID) > 0) {
-		vout << "Repeat: " << ContigNode(er.refID, dirIdx) << '\n';
+		vout << "Repeat: " << get(vertex_name, g, origin) << '\n';
 		stats.repeat++;
 	} else if (solutions.size() > 1) {
 		ContigPath path
 			= constructAmbiguousPath(g, origin, solutions);
 		if (!path.empty()) {
-			extend(g, path.back(), back_inserter(path));
+			if (opt::extend)
+				extend(g, path.back(), back_inserter(path));
 			vout << path << '\n';
 			if (opt::scaffold) {
 				out.insert(out.end(), path.begin(), path.end());
@@ -554,8 +574,8 @@ static void handleEstimate(const Graph& g,
 		ContigPath& path = *bestSol;
 		if (opt::verbose > 1)
 			printDistanceMap(vout, g, origin, path);
-
-		extend(g, path.back(), back_inserter(path));
+		if (opt::extend)
+			extend(g, path.back(), back_inserter(path));
 		out.insert(out.end(), path.begin(), path.end());
 		stats.uniqueEnd++;
 		g_minNumPairsUsed = min(g_minNumPairsUsed, minNumPairs);
@@ -588,9 +608,9 @@ static void* worker(void* pArg)
 			break;
 
 		// Flip the anterior distance estimates.
-		for (EstimateVector::iterator it = er.estimates[1].begin();
+		for (Estimates::iterator it = er.estimates[1].begin();
 				it != er.estimates[1].end(); ++it)
-			it->contig.flip();
+			it->first ^= 1;
 
 		ContigPath path;
 		handleEstimate(*arg.graph, er, true, path);
@@ -602,7 +622,8 @@ static void* worker(void* pArg)
 			static pthread_mutex_t outMutex
 				= PTHREAD_MUTEX_INITIALIZER;
 			pthread_mutex_lock(&outMutex);
-			*arg.out << er.refID << '\t' << path << '\n';
+			*arg.out << get(g_contigNames, er.refID)
+				<< '\t' << path << '\n';
 			assert(arg.out->good());
 			pthread_mutex_unlock(&outMutex);
 		}
diff --git a/aclocal.m4 b/aclocal.m4
index da06da5..63b681e 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1,4 +1,4 @@
-# generated automatically by aclocal 1.11.3 -*- Autoconf -*-
+# generated automatically by aclocal 1.12 -*- Autoconf -*-
 
 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
 # 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation,
@@ -14,20 +14,19 @@
 
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
-[m4_warning([this file was generated for autoconf 2.68.
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
+[m4_warning([this file was generated for autoconf 2.69.
 You have another version of autoconf.  It may work, but is not guaranteed to.
 If you have problems, you may need to regenerate the build system entirely.
-To do so, use the procedure documented by the package, typically `autoreconf'.])])
+To do so, use the procedure documented by the package, typically 'autoreconf'.])])
 
-# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software
-# Foundation, Inc.
+# Copyright (C) 2002-2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 1
+# serial 8
 
 # AM_AUTOMAKE_VERSION(VERSION)
 # ----------------------------
@@ -35,10 +34,10 @@ To do so, use the procedure documented by the package, typically `autoreconf'.])
 # generated from the m4 files accompanying Automake X.Y.
 # (This private macro should not be called outside this file.)
 AC_DEFUN([AM_AUTOMAKE_VERSION],
-[am__api_version='1.11'
+[am__api_version='1.12'
 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
 dnl require some minimum version.  Point them to the right macro.
-m4_if([$1], [1.11.3], [],
+m4_if([$1], [1.12], [],
       [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
 ])
 
@@ -54,24 +53,24 @@ m4_define([_AM_AUTOCONF_VERSION], [])
 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.11.3])dnl
+[AM_AUTOMAKE_VERSION([1.12])dnl
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
 
 # AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
 
-# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
+# Copyright (C) 2001-2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 1
+# serial 2
 
 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
-# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
-# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
+# $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to
+# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
 #
 # Of course, Automake must honor this variable whenever it calls a
 # tool from the auxiliary directory.  The problem is that $srcdir (and
@@ -90,7 +89,7 @@ _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
 #
 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
 # are both prefixed by $srcdir.  In an in-source build this is usually
-# harmless because $srcdir is `.', but things will broke when you
+# harmless because $srcdir is '.', but things will broke when you
 # start a VPATH build or use an absolute $srcdir.
 #
 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
@@ -116,22 +115,21 @@ am_aux_dir=`cd $ac_aux_dir && pwd`
 
 # AM_CONDITIONAL                                            -*- Autoconf -*-
 
-# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
-# Free Software Foundation, Inc.
+# Copyright (C) 1997-2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 9
+# serial 10
 
 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
 # -------------------------------------
 # Define a conditional.
 AC_DEFUN([AM_CONDITIONAL],
-[AC_PREREQ(2.52)dnl
- ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
-	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+[AC_PREREQ([2.52])dnl
+ m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
+       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
 AC_SUBST([$1_TRUE])dnl
 AC_SUBST([$1_FALSE])dnl
 _AM_SUBST_NOTMAKE([$1_TRUE])dnl
@@ -150,16 +148,15 @@ AC_CONFIG_COMMANDS_PRE(
 Usually this means the macro was only invoked conditionally.]])
 fi])])
 
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009,
-# 2010, 2011 Free Software Foundation, Inc.
+# Copyright (C) 1999-2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 12
+# serial 16
 
-# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
+# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
 # written in clear, in which case automake, when reading aclocal.m4,
 # will think it sees a *use*, and therefore will trigger all it's
 # C support machinery.  Also note that it means that autoscan, seeing
@@ -182,12 +179,12 @@ AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
 AC_REQUIRE([AM_DEP_TRACK])dnl
 
-ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
-       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
-       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
-       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
-       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
-                   [depcc="$$1"   am_compiler_list=])
+m4_if([$1], [CC],   [depcc="$CC"   am_compiler_list=],
+      [$1], [CXX],  [depcc="$CXX"  am_compiler_list=],
+      [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+      [$1], [UPC],  [depcc="$UPC"  am_compiler_list=],
+      [$1], [GCJ],  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
+                    [depcc="$$1"   am_compiler_list=])
 
 AC_CACHE_CHECK([dependency style of $depcc],
                [am_cv_$1_dependencies_compiler_type],
@@ -195,8 +192,8 @@ AC_CACHE_CHECK([dependency style of $depcc],
   # We make a subdir and do the tests there.  Otherwise we can end up
   # making bogus files that we don't know about and never remove.  For
   # instance it was reported that on HP-UX the gcc test will end up
-  # making a dummy file named `D' -- because `-MD' means `put the output
-  # in D'.
+  # making a dummy file named 'D' -- because '-MD' means "put the output
+  # in D".
   rm -rf conftest.dir
   mkdir conftest.dir
   # Copy depcomp to subdir because otherwise we won't find it if we're
@@ -236,16 +233,16 @@ AC_CACHE_CHECK([dependency style of $depcc],
     : > sub/conftest.c
     for i in 1 2 3 4 5 6; do
       echo '#include "conftst'$i'.h"' >> sub/conftest.c
-      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
-      # Solaris 8's {/usr,}/bin/sh.
-      touch sub/conftst$i.h
+      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+      # Solaris 10 /bin/sh.
+      echo '/* dummy */' > sub/conftst$i.h
     done
     echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
 
-    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # We check with '-c' and '-o' for the sake of the "dashmstdout"
     # mode.  It turns out that the SunPro C++ compiler does not properly
-    # handle `-M -o', and we need to detect this.  Also, some Intel
-    # versions had trouble with output in subdirs
+    # handle '-M -o', and we need to detect this.  Also, some Intel
+    # versions had trouble with output in subdirs.
     am__obj=sub/conftest.${OBJEXT-o}
     am__minus_obj="-o $am__obj"
     case $depmode in
@@ -254,8 +251,8 @@ AC_CACHE_CHECK([dependency style of $depcc],
       test "$am__universal" = false || continue
       ;;
     nosideeffect)
-      # after this tag, mechanisms are not by side-effect, so they'll
-      # only be used when explicitly requested
+      # After this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested.
       if test "x$enable_dependency_tracking" = xyes; then
 	continue
       else
@@ -263,7 +260,7 @@ AC_CACHE_CHECK([dependency style of $depcc],
       fi
       ;;
     msvc7 | msvc7msys | msvisualcpp | msvcmsys)
-      # This compiler won't grok `-c -o', but also, the minuso test has
+      # This compiler won't grok '-c -o', but also, the minuso test has
       # not run yet.  These depmodes are late enough in the game, and
       # so weak that their functioning should not be impacted.
       am__obj=conftest.${OBJEXT-o}
@@ -311,7 +308,7 @@ AM_CONDITIONAL([am__fastdep$1], [
 # AM_SET_DEPDIR
 # -------------
 # Choose a directory name for dependency files.
-# This macro is AC_REQUIREd in _AM_DEPENDENCIES
+# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
 AC_DEFUN([AM_SET_DEPDIR],
 [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
 AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
@@ -321,9 +318,13 @@ AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
 # AM_DEP_TRACK
 # ------------
 AC_DEFUN([AM_DEP_TRACK],
-[AC_ARG_ENABLE(dependency-tracking,
-[  --disable-dependency-tracking  speeds up one-time build
-  --enable-dependency-tracking   do not reject slow dependency extractors])
+[AC_ARG_ENABLE([dependency-tracking], [dnl
+AS_HELP_STRING(
+  [--enable-dependency-tracking],
+  [do not reject slow dependency extractors])
+AS_HELP_STRING(
+  [--disable-dependency-tracking],
+  [speeds up one-time build])])
 if test "x$enable_dependency_tracking" != xno; then
   am_depcomp="$ac_aux_dir/depcomp"
   AMDEPBACKSLASH='\'
@@ -338,14 +339,13 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl
 
 # Generate code to set up dependency tracking.              -*- Autoconf -*-
 
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
-# Free Software Foundation, Inc.
+# Copyright (C) 1999-2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-#serial 5
+# serial 6
 
 # _AM_OUTPUT_DEPENDENCY_COMMANDS
 # ------------------------------
@@ -364,7 +364,7 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
     # Strip MF so we end up with the name of the file.
     mf=`echo "$mf" | sed -e 's/:.*$//'`
     # Check whether this is an Automake generated Makefile or not.
-    # We used to match only the files named `Makefile.in', but
+    # We used to match only the files named 'Makefile.in', but
     # some people rename them; so instead we look at the file content.
     # Grep'ing the first line is not enough: some people post-process
     # each Makefile.in and add a new line on top of each file to say so.
@@ -376,21 +376,19 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
       continue
     fi
     # Extract the definition of DEPDIR, am__include, and am__quote
-    # from the Makefile without running `make'.
+    # from the Makefile without running 'make'.
     DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
     test -z "$DEPDIR" && continue
     am__include=`sed -n 's/^am__include = //p' < "$mf"`
     test -z "am__include" && continue
     am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
-    # When using ansi2knr, U may be empty or an underscore; expand it
-    U=`sed -n 's/^U = //p' < "$mf"`
     # Find all dependency output files, they are included files with
     # $(DEPDIR) in their names.  We invoke sed twice because it is the
     # simplest approach to changing $(DEPDIR) to its actual value in the
     # expansion.
     for file in `sed -n "
       s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
-	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
       # Make sure the directory exists.
       test -f "$dirpart/$file" && continue
       fdir=`AS_DIRNAME(["$file"])`
@@ -408,7 +406,7 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
 # This macro should only be invoked once -- use via AC_REQUIRE.
 #
 # This code is only required when automatic dependency tracking
-# is enabled.  FIXME.  This creates each `.P' file that we will
+# is enabled.  FIXME.  This creates each '.P' file that we will
 # need in order to bootstrap the dependency handling code.
 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
 [AC_CONFIG_COMMANDS([depfiles],
@@ -418,14 +416,13 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
 
 # Do all the work for Automake.                             -*- Autoconf -*-
 
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
+# Copyright (C) 1996-2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 16
+# serial 18
 
 # This macro actually does too much.  Some checks are only needed if
 # your package does certain things.  But this isn't really a big deal.
@@ -476,23 +473,25 @@ m4_ifval([$2],
  AC_SUBST([VERSION], [$2])],
 [_AM_SET_OPTIONS([$1])dnl
 dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
-m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
+m4_if(
+  m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
+  [ok:ok],,
   [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
  AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
  AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
 
 _AM_IF_OPTION([no-define],,
-[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
- AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
+[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
+ AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
 
 # Some tools Automake needs.
 AC_REQUIRE([AM_SANITY_CHECK])dnl
 AC_REQUIRE([AC_ARG_PROGRAM])dnl
-AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
-AM_MISSING_PROG(AUTOCONF, autoconf)
-AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
-AM_MISSING_PROG(AUTOHEADER, autoheader)
-AM_MISSING_PROG(MAKEINFO, makeinfo)
+AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
+AM_MISSING_PROG([AUTOCONF], [autoconf])
+AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
+AM_MISSING_PROG([AUTOHEADER], [autoheader])
+AM_MISSING_PROG([MAKEINFO], [makeinfo])
 AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
 AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
 AC_REQUIRE([AM_PROG_MKDIR_P])dnl
@@ -506,28 +505,28 @@ _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
 			     [_AM_PROG_TAR([v7])])])
 _AM_IF_OPTION([no-dependencies],,
 [AC_PROVIDE_IFELSE([AC_PROG_CC],
-		  [_AM_DEPENDENCIES(CC)],
+		  [_AM_DEPENDENCIES([CC])],
 		  [define([AC_PROG_CC],
-			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
+			  defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
 AC_PROVIDE_IFELSE([AC_PROG_CXX],
-		  [_AM_DEPENDENCIES(CXX)],
+		  [_AM_DEPENDENCIES([CXX])],
 		  [define([AC_PROG_CXX],
-			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
 AC_PROVIDE_IFELSE([AC_PROG_OBJC],
-		  [_AM_DEPENDENCIES(OBJC)],
+		  [_AM_DEPENDENCIES([OBJC])],
 		  [define([AC_PROG_OBJC],
-			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
+			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
 ])
 _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
-dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
-dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
+dnl The 'parallel-tests' driver may need to know about EXEEXT, so add the
+dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
 dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
 AC_CONFIG_COMMANDS_PRE(dnl
 [m4_provide_if([_AM_COMPILER_EXEEXT],
   [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
 ])
 
-dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
+dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
 dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
 dnl mangled by Autoconf and run in a shell conditional statement.
 m4_define([_AC_COMPILER_EXEEXT],
@@ -555,14 +554,13 @@ for _am_header in $config_headers :; do
 done
 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
 
-# Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation,
-# Inc.
+# Copyright (C) 2001-2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 1
+# serial 8
 
 # AM_PROG_INSTALL_SH
 # ------------------
@@ -577,9 +575,9 @@ if test x"${install_sh}" != xset; then
     install_sh="\${SHELL} $am_aux_dir/install-sh"
   esac
 fi
-AC_SUBST(install_sh)])
+AC_SUBST([install_sh])])
 
-# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
+# Copyright (C) 2003-2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -602,13 +600,13 @@ AC_SUBST([am__leading_dot])])
 
 # Check to see how 'make' treats includes.	            -*- Autoconf -*-
 
-# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
+# Copyright (C) 2001-2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 4
+# serial 5
 
 # AM_MAKE_INCLUDE()
 # -----------------
@@ -627,7 +625,7 @@ am__quote=
 _am_result=none
 # First try GNU make style include.
 echo "include confinc" > confmf
-# Ignore all kinds of additional output from `make'.
+# Ignore all kinds of additional output from 'make'.
 case `$am_make -s -f confmf 2> /dev/null` in #(
 *the\ am__doit\ target*)
   am__include=include
@@ -654,14 +652,13 @@ rm -f confinc confmf
 
 # Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
 
-# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
-# Free Software Foundation, Inc.
+# Copyright (C) 1997-2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 6
+# serial 7
 
 # AM_MISSING_PROG(NAME, PROGRAM)
 # ------------------------------
@@ -691,22 +688,21 @@ if eval "$MISSING --run true"; then
   am_missing_run="$MISSING --run "
 else
   am_missing_run=
-  AC_MSG_WARN([`missing' script is too old or missing])
+  AC_MSG_WARN(['missing' script is too old or missing])
 fi
 ])
 
-# Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation,
-# Inc.
+# Copyright (C) 2003-2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 1
+# serial 2
 
 # AM_PROG_MKDIR_P
 # ---------------
-# Check for `mkdir -p'.
+# Check for 'mkdir -p'.
 AC_DEFUN([AM_PROG_MKDIR_P],
 [AC_PREREQ([2.60])dnl
 AC_REQUIRE([AC_PROG_MKDIR_P])dnl
@@ -726,14 +722,13 @@ esac
 
 # Helper functions for option handling.                     -*- Autoconf -*-
 
-# Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software
-# Foundation, Inc.
+# Copyright (C) 2001-2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 5
+# serial 6
 
 # _AM_MANGLE_OPTION(NAME)
 # -----------------------
@@ -744,7 +739,7 @@ AC_DEFUN([_AM_MANGLE_OPTION],
 # --------------------
 # Set option NAME.  Presently that only means defining a flag for this option.
 AC_DEFUN([_AM_SET_OPTION],
-[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
+[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
 
 # _AM_SET_OPTIONS(OPTIONS)
 # ------------------------
@@ -760,22 +755,18 @@ AC_DEFUN([_AM_IF_OPTION],
 
 # Check to make sure that the build environment is sane.    -*- Autoconf -*-
 
-# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
-# Free Software Foundation, Inc.
+# Copyright (C) 1996-2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 5
+# serial 9
 
 # AM_SANITY_CHECK
 # ---------------
 AC_DEFUN([AM_SANITY_CHECK],
 [AC_MSG_CHECKING([whether build environment is sane])
-# Just in case
-sleep 1
-echo timestamp > conftest.file
 # Reject unsafe characters in $srcdir or the absolute working directory
 # name.  Accept space and tab only in the latter.
 am_lf='
@@ -786,32 +777,40 @@ case `pwd` in
 esac
 case $srcdir in
   *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
-    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
+    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
 esac
 
-# Do `set' in a subshell so we don't clobber the current shell's
+# Do 'set' in a subshell so we don't clobber the current shell's
 # arguments.  Must try -L first in case configure is actually a
 # symlink; some systems play weird games with the mod time of symlinks
 # (eg FreeBSD returns the mod time of the symlink's containing
 # directory).
 if (
-   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
-   if test "$[*]" = "X"; then
-      # -L didn't work.
-      set X `ls -t "$srcdir/configure" conftest.file`
-   fi
-   rm -f conftest.file
-   if test "$[*]" != "X $srcdir/configure conftest.file" \
-      && test "$[*]" != "X conftest.file $srcdir/configure"; then
-
-      # If neither matched, then we have a broken ls.  This can happen
-      # if, for instance, CONFIG_SHELL is bash and it inherits a
-      # broken ls alias from the environment.  This has actually
-      # happened.  Such a system could not be considered "sane".
-      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
-alias in your environment])
-   fi
-
+   am_has_slept=no
+   for am_try in 1 2; do
+     echo "timestamp, slept: $am_has_slept" > conftest.file
+     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+     if test "$[*]" = "X"; then
+	# -L didn't work.
+	set X `ls -t "$srcdir/configure" conftest.file`
+     fi
+     if test "$[*]" != "X $srcdir/configure conftest.file" \
+	&& test "$[*]" != "X conftest.file $srcdir/configure"; then
+
+	# If neither matched, then we have a broken ls.  This can happen
+	# if, for instance, CONFIG_SHELL is bash and it inherits a
+	# broken ls alias from the environment.  This has actually
+	# happened.  Such a system could not be considered "sane".
+	AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
+  alias in your environment])
+     fi
+     if test "$[2]" = conftest.file || test $am_try -eq 2; then
+       break
+     fi
+     # Just in case.
+     sleep 1
+     am_has_slept=yes
+   done
    test "$[2]" = conftest.file
    )
 then
@@ -821,39 +820,55 @@ else
    AC_MSG_ERROR([newly created file is older than distributed files!
 Check your system clock])
 fi
-AC_MSG_RESULT(yes)])
+AC_MSG_RESULT([yes])
+# If we didn't sleep, we still need to ensure time stamps of config.status and
+# generated files are strictly newer.
+am_sleep_pid=
+if grep 'slept: no' conftest.file >/dev/null 2>&1; then
+  ( sleep 1 ) &
+  am_sleep_pid=$!
+fi
+AC_CONFIG_COMMANDS_PRE(
+  [AC_MSG_CHECKING([that generated files are newer than configure])
+   if test -n "$am_sleep_pid"; then
+     # Hide warnings about reused PIDs.
+     wait $am_sleep_pid 2>/dev/null
+   fi
+   AC_MSG_RESULT([done])])
+rm -f conftest.file
+])
 
-# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
+# Copyright (C) 2001-2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 1
+# serial 2
 
 # AM_PROG_INSTALL_STRIP
 # ---------------------
-# One issue with vendor `install' (even GNU) is that you can't
+# One issue with vendor 'install' (even GNU) is that you can't
 # specify the program used to strip binaries.  This is especially
 # annoying in cross-compiling environments, where the build's strip
 # is unlikely to handle the host's binaries.
 # Fortunately install-sh will honor a STRIPPROG variable, so we
-# always use install-sh in `make install-strip', and initialize
+# always use install-sh in "make install-strip", and initialize
 # STRIPPROG with the value of the STRIP variable (set by the user).
 AC_DEFUN([AM_PROG_INSTALL_STRIP],
 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
-# Installed binaries are usually stripped using `strip' when the user
-# run `make install-strip'.  However `strip' might not be the right
+# Installed binaries are usually stripped using 'strip' when the user
+# run "make install-strip".  However 'strip' might not be the right
 # tool to use in cross-compilation environments, therefore Automake
-# will honor the `STRIP' environment variable to overrule this program.
-dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
+# will honor the 'STRIP' environment variable to overrule this program.
+dnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
 if test "$cross_compiling" != no; then
   AC_CHECK_TOOL([STRIP], [strip], :)
 fi
 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
 AC_SUBST([INSTALL_STRIP_PROGRAM])])
 
-# Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc.
+# Copyright (C) 2006-2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -874,18 +889,18 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
 
 # Check how to create a tarball.                            -*- Autoconf -*-
 
-# Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc.
+# Copyright (C) 2004-2012 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 2
+# serial 3
 
 # _AM_PROG_TAR(FORMAT)
 # --------------------
 # Check how to create a tarball in format FORMAT.
-# FORMAT should be one of `v7', `ustar', or `pax'.
+# FORMAT should be one of 'v7', 'ustar', or 'pax'.
 #
 # Substitute a variable $(am__tar) that is a command
 # writing to stdout a FORMAT-tarball containing the directory
@@ -908,7 +923,7 @@ AC_MSG_CHECKING([how to create a $1 tar archive])
 _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
 _am_tools=${am_cv_prog_tar_$1-$_am_tools}
 # Do not fold the above two line into one, because Tru64 sh and
-# Solaris sh will not grok spaces in the rhs of `-'.
+# Solaris sh will not grok spaces in the rhs of '-'.
 for _am_tool in $_am_tools
 do
   case $_am_tool in
diff --git a/bin/Makefile.am b/bin/Makefile.am
index cdb59fb..658decd 100644
--- a/bin/Makefile.am
+++ b/bin/Makefile.am
@@ -3,6 +3,7 @@ dist_bin_SCRIPTS = \
 	abyss-bowtie2 \
 	abyss-bwa \
 	abyss-bwasw \
+	abyss-fatoagp \
 	abyss-kaligner \
 	abyss-pe \
 	abyss-samtoafg
diff --git a/bin/Makefile.in b/bin/Makefile.in
index 509fc6d..804aaf7 100644
--- a/bin/Makefile.in
+++ b/bin/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# Makefile.in generated by automake 1.12 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -16,6 +16,23 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -74,6 +91,11 @@ am__installdirs = "$(DESTDIR)$(bindir)"
 SCRIPTS = $(dist_bin_SCRIPTS) $(dist_noinst_SCRIPTS)
 SOURCES =
 DIST_SOURCES =
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
@@ -175,6 +197,7 @@ dist_bin_SCRIPTS = \
 	abyss-bowtie2 \
 	abyss-bwa \
 	abyss-bwasw \
+	abyss-fatoagp \
 	abyss-kaligner \
 	abyss-pe \
 	abyss-samtoafg
@@ -220,8 +243,11 @@ $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 $(am__aclocal_m4_deps):
 install-dist_binSCRIPTS: $(dist_bin_SCRIPTS)
 	@$(NORMAL_INSTALL)
-	test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
 	@list='$(dist_bin_SCRIPTS)'; test -n "$(bindir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+	fi; \
 	for p in $$list; do \
 	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
 	  if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
@@ -256,6 +282,8 @@ TAGS:
 ctags: CTAGS
 CTAGS:
 
+cscope cscopelist:
+
 
 distdir: $(DISTFILES)
 	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
diff --git a/bin/abyss-fatoagp b/bin/abyss-fatoagp
new file mode 100755
index 0000000..d1b517d
--- /dev/null
+++ b/bin/abyss-fatoagp
@@ -0,0 +1,53 @@
+#!/usr/bin/perl
+# Convert a FASTA file of scaffolds to a FASTA file of contigs and an
+# AGP file.
+# Written by Shaun Jackman <sjackman at bcgsc.ca>.
+
+use strict;
+use Getopt::Std qw'getopts';
+
+my %opt;
+getopts 'f:s:', \%opt;
+my $opt_fasta = $opt{'f'};
+my $opt_min_len = defined $opt{'s'} ? $opt{'s'} : 200;
+
+open FASTA, ">$opt_fasta"
+	or die "error: `$opt_fasta': $!\n"
+	if $opt_fasta;
+
+while (<>) {
+	die unless /^>/;
+	chomp;
+	my ($scafid, undef) = split ' ', $_, 2;
+	substr $scafid, 0, 1, '';
+
+	my $scafseq = <>;
+	chomp $scafseq;
+	my $scaflen = $scafseq =~ tr/ACGTacgt//;
+	next if $scaflen < $opt_min_len;
+
+	my @ctgseqs = split /([Nn]+)/, $scafseq;
+	my $i = 0;
+	my $x = 0;
+	for my $ctgseq (@ctgseqs) {
+		my $len = length $ctgseq;
+		# object object_beg object_end part_number
+		print 'scaffold', $scafid, "\t",
+			$x + 1, "\t",
+			$x + $len, "\t",
+			$i + 1, "\t";
+		if ($ctgseq =~ /^[nN]/) {
+			# component_type gap_length gap_type linkage
+			print "N\t", $len, "\tscaffold\tyes\tpaired-ends\n";
+		} else {
+			my $ctgid = 'contig' . $scafid . '_' . ($i / 2);
+			# component_type component_id
+			# component_beg component_end orientation
+			print "W\t", $ctgid, "\t1\t", $len, "\t+\n";
+			print FASTA '>', $ctgid, "\n", $ctgseq, "\n"
+				if $opt_fasta;
+		}
+		$i++;
+		$x += $len;
+	}
+}
diff --git a/bin/abyss-pe b/bin/abyss-pe
index 0edf3f4..c46b785 100755
--- a/bin/abyss-pe
+++ b/bin/abyss-pe
@@ -66,6 +66,17 @@ np?=$(NSLOTS)
 endif
 endif
 
+# Integrate with SLURM
+ifdef SLURM_JOB_NAME
+name?=$(SLURM_JOB_NAME)
+endif
+ifdef SLURM_JOBID
+k?=$(SLURM_JOBID)
+endif
+ifdef SLURM_NTASKS
+np?=$(SLURM_NTASKS)
+endif
+
 # Determine the path to mpirun
 mpirun?=$(shell which mpirun)
 ifeq ($(mpirun),)
@@ -134,7 +145,7 @@ j:=2
 endif
 
 # AdjList parameters
-m?=30
+m?=50
 
 # PopBubbles parameters
 p?=0.9
@@ -220,7 +231,7 @@ Report bugs to <abyss-users at bcgsc.ca>.\n'
 
 version:
 	@printf '\
-abyss-pe (ABySS) 1.3.3\n\
+abyss-pe (ABySS) 1.3.4\n\
 Written by Shaun Jackman.\n\
 \n\
 Copyright 2012 Canada'\''s Michael Smith Genome Science Centre\n'
@@ -530,3 +541,18 @@ $(name)-stats: %-stats: %-scaffolds.fa
 endif
 $(name)-stats:
 	abyss-fac $(FAC_OPTIONS) $^ |tee $@
+
+# Create an AGP file and FASTA file of scaftigs from scaffolds
+
+%.agp %-agp.fa: %.fa
+	abyss-fatoagp $(FATOAGP_OPTIONS) -f $*-agp.fa $< >$*.agp
+
+# Align the contigs to the reference
+
+%-$(ref).sam.gz: %.fa
+	bwa bwasw -t$j $(BWASW_OPTIONS) $($(ref)) $< |gzip >$@
+
+# Find breakpoints in the alignments
+
+%.break: %.sam.gz
+	sam2break $(SAM2BREAK_OPTIONS) $< >$@
diff --git a/configure b/configure
index 3716e05..7b12f18 100755
--- a/configure
+++ b/configure
@@ -1,13 +1,11 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.68 for ABySS 1.3.3.
+# Generated by GNU Autoconf 2.69 for ABySS 1.3.4.
 #
 # Report bugs to <abyss-users at bcgsc.ca>.
 #
 #
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
-# Foundation, Inc.
+# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
 #
 #
 # This configure script is free software; the Free Software Foundation
@@ -136,6 +134,31 @@ export LANGUAGE
 # CDPATH.
 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
 
+# Use a proper internal environment variable to ensure we don't fall
+  # into an infinite loop, continuously re-executing ourselves.
+  if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
+    _as_can_reexec=no; export _as_can_reexec;
+    # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+  *v*x* | *x*v* ) as_opts=-vx ;;
+  *v* ) as_opts=-v ;;
+  *x* ) as_opts=-x ;;
+  * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+as_fn_exit 255
+  fi
+  # We don't want this to propagate to other subprocesses.
+          { _as_can_reexec=; unset _as_can_reexec;}
 if test "x$CONFIG_SHELL" = x; then
   as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
   emulate sh
@@ -169,7 +192,8 @@ if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
 else
   exitcode=1; echo positional parameters were not saved.
 fi
-test x\$exitcode = x0 || exit 1"
+test x\$exitcode = x0 || exit 1
+test -x / || exit 1"
   as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
   as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
   eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
@@ -214,21 +238,25 @@ IFS=$as_save_IFS
 
 
       if test "x$CONFIG_SHELL" != x; then :
-  # We cannot yet assume a decent shell, so we have to provide a
-	# neutralization value for shells without unset; and this also
-	# works around shells that cannot unset nonexistent variables.
-	# Preserve -v and -x to the replacement shell.
-	BASH_ENV=/dev/null
-	ENV=/dev/null
-	(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
-	export CONFIG_SHELL
-	case $- in # ((((
-	  *v*x* | *x*v* ) as_opts=-vx ;;
-	  *v* ) as_opts=-v ;;
-	  *x* ) as_opts=-x ;;
-	  * ) as_opts= ;;
-	esac
-	exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"}
+  export CONFIG_SHELL
+             # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+  *v*x* | *x*v* ) as_opts=-vx ;;
+  *v* ) as_opts=-v ;;
+  *x* ) as_opts=-x ;;
+  * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+exit 255
 fi
 
     if test x$as_have_required = xno; then :
@@ -331,6 +359,14 @@ $as_echo X"$as_dir" |
 
 
 } # as_fn_mkdir_p
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+  test -f "$1" && test -x "$1"
+} # as_fn_executable_p
 # as_fn_append VAR VALUE
 # ----------------------
 # Append the text in VALUE to the end of the definition contained in VAR. Take
@@ -452,6 +488,10 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits
   chmod +x "$as_me.lineno" ||
     { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
 
+  # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
+  # already done that, so ensure we don't try to do so again and fall
+  # in an infinite loop.  This has already happened in practice.
+  _as_can_reexec=no; export _as_can_reexec
   # Don't try to exec as it changes $[0], causing all sort of problems
   # (the dirname of $[0] is not the place where we might find the
   # original and so on.  Autoconf is especially sensitive to this).
@@ -486,16 +526,16 @@ if (echo >conf$$.file) 2>/dev/null; then
     # ... but there are two gotchas:
     # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
     # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
-    # In both cases, we have to default to `cp -p'.
+    # In both cases, we have to default to `cp -pR'.
     ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
-      as_ln_s='cp -p'
+      as_ln_s='cp -pR'
   elif ln conf$$.file conf$$ 2>/dev/null; then
     as_ln_s=ln
   else
-    as_ln_s='cp -p'
+    as_ln_s='cp -pR'
   fi
 else
-  as_ln_s='cp -p'
+  as_ln_s='cp -pR'
 fi
 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
 rmdir conf$$.dir 2>/dev/null
@@ -507,28 +547,8 @@ else
   as_mkdir_p=false
 fi
 
-if test -x / >/dev/null 2>&1; then
-  as_test_x='test -x'
-else
-  if ls -dL / >/dev/null 2>&1; then
-    as_ls_L_option=L
-  else
-    as_ls_L_option=
-  fi
-  as_test_x='
-    eval sh -c '\''
-      if test -d "$1"; then
-	test -d "$1/.";
-      else
-	case $1 in #(
-	-*)set "./$1";;
-	esac;
-	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
-	???[sx]*):;;*)false;;esac;fi
-    '\'' sh
-  '
-fi
-as_executable_p=$as_test_x
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
 
 # Sed expression to map a string onto a valid CPP name.
 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -560,8 +580,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='ABySS'
 PACKAGE_TARNAME='abyss'
-PACKAGE_VERSION='1.3.3'
-PACKAGE_STRING='ABySS 1.3.3'
+PACKAGE_VERSION='1.3.4'
+PACKAGE_STRING='ABySS 1.3.4'
 PACKAGE_BUGREPORT='abyss-users at bcgsc.ca'
 PACKAGE_URL='http://www.bcgsc.ca/platform/bioinfo/software/abyss'
 
@@ -1182,8 +1202,6 @@ target=$target_alias
 if test "x$host_alias" != x; then
   if test "x$build_alias" = x; then
     cross_compiling=maybe
-    $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host.
-    If a cross compiler is detected then cross compile mode will be used" >&2
   elif test "x$build_alias" != "x$host_alias"; then
     cross_compiling=yes
   fi
@@ -1269,7 +1287,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures ABySS 1.3.3 to adapt to many kinds of systems.
+\`configure' configures ABySS 1.3.4 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1335,7 +1353,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of ABySS 1.3.3:";;
+     short | recursive ) echo "Configuration of ABySS 1.3.4:";;
    esac
   cat <<\_ACEOF
 
@@ -1343,8 +1361,10 @@ Optional Features:
   --disable-option-checking  ignore unrecognized --enable/--with options
   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
-  --disable-dependency-tracking  speeds up one-time build
-  --enable-dependency-tracking   do not reject slow dependency extractors
+  --enable-dependency-tracking
+                          do not reject slow dependency extractors
+  --disable-dependency-tracking
+                          speeds up one-time build
   --enable-mpich          use MPICH (default is to use Open MPI)
   --enable-lammpi         use LAM/MPI (default is to use Open MPI)
   --enable-fm             specify the width of the FM-index in bits (default
@@ -1441,10 +1461,10 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-ABySS configure 1.3.3
-generated by GNU Autoconf 2.68
+ABySS configure 1.3.4
+generated by GNU Autoconf 2.69
 
-Copyright (C) 2010 Free Software Foundation, Inc.
+Copyright (C) 2012 Free Software Foundation, Inc.
 This configure script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it.
 _ACEOF
@@ -1811,7 +1831,8 @@ int
 main ()
 {
 static int test_array [1 - 2 * !(0 < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1))];
-test_array [0] = 0
+test_array [0] = 0;
+return test_array [0];
 
   ;
   return 0;
@@ -1827,7 +1848,8 @@ main ()
 {
 static int test_array [1 - 2 * !(($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1)
 		 < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 2))];
-test_array [0] = 0
+test_array [0] = 0;
+return test_array [0];
 
   ;
   return 0;
@@ -1884,7 +1906,8 @@ int
 main ()
 {
 static int test_array [1 - 2 * !((($ac_type) -1 >> ($2 / 2 - 1)) >> ($2 / 2 - 1) == 3)];
-test_array [0] = 0
+test_array [0] = 0;
+return test_array [0];
 
   ;
   return 0;
@@ -1940,7 +1963,7 @@ $as_echo "$ac_try_echo"; } >&5
 	 test ! -s conftest.err
        } && test -s conftest$ac_exeext && {
 	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
+	 test -x conftest$ac_exeext
        }; then :
   ac_retval=0
 else
@@ -2099,7 +2122,7 @@ $as_echo "$ac_try_echo"; } >&5
 	 test ! -s conftest.err
        } && test -s conftest$ac_exeext && {
 	 test "$cross_compiling" = yes ||
-	 $as_test_x conftest$ac_exeext
+	 test -x conftest$ac_exeext
        }; then :
   ac_retval=0
 else
@@ -2249,8 +2272,8 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by ABySS $as_me 1.3.3, which was
-generated by GNU Autoconf 2.68.  Invocation command line was
+It was created by ABySS $as_me 1.3.4, which was
+generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
 
@@ -2597,7 +2620,7 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
-am__api_version='1.11'
+am__api_version='1.12'
 
 ac_aux_dir=
 for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
@@ -2665,7 +2688,7 @@ case $as_dir/ in #((
     # by default.
     for ac_prog in ginstall scoinst install; do
       for ac_exec_ext in '' $ac_executable_extensions; do
-	if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
+	if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
 	  if test $ac_prog = install &&
 	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
 	    # AIX install.  It has an incompatible calling convention.
@@ -2723,9 +2746,6 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
 $as_echo_n "checking whether build environment is sane... " >&6; }
-# Just in case
-sleep 1
-echo timestamp > conftest.file
 # Reject unsafe characters in $srcdir or the absolute working directory
 # name.  Accept space and tab only in the latter.
 am_lf='
@@ -2736,32 +2756,40 @@ case `pwd` in
 esac
 case $srcdir in
   *[\\\"\#\$\&\'\`$am_lf\ \	]*)
-    as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;;
+    as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;;
 esac
 
-# Do `set' in a subshell so we don't clobber the current shell's
+# Do 'set' in a subshell so we don't clobber the current shell's
 # arguments.  Must try -L first in case configure is actually a
 # symlink; some systems play weird games with the mod time of symlinks
 # (eg FreeBSD returns the mod time of the symlink's containing
 # directory).
 if (
-   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
-   if test "$*" = "X"; then
-      # -L didn't work.
-      set X `ls -t "$srcdir/configure" conftest.file`
-   fi
-   rm -f conftest.file
-   if test "$*" != "X $srcdir/configure conftest.file" \
-      && test "$*" != "X conftest.file $srcdir/configure"; then
-
-      # If neither matched, then we have a broken ls.  This can happen
-      # if, for instance, CONFIG_SHELL is bash and it inherits a
-      # broken ls alias from the environment.  This has actually
-      # happened.  Such a system could not be considered "sane".
-      as_fn_error $? "ls -t appears to fail.  Make sure there is not a broken
-alias in your environment" "$LINENO" 5
-   fi
-
+   am_has_slept=no
+   for am_try in 1 2; do
+     echo "timestamp, slept: $am_has_slept" > conftest.file
+     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+     if test "$*" = "X"; then
+	# -L didn't work.
+	set X `ls -t "$srcdir/configure" conftest.file`
+     fi
+     if test "$*" != "X $srcdir/configure conftest.file" \
+	&& test "$*" != "X conftest.file $srcdir/configure"; then
+
+	# If neither matched, then we have a broken ls.  This can happen
+	# if, for instance, CONFIG_SHELL is bash and it inherits a
+	# broken ls alias from the environment.  This has actually
+	# happened.  Such a system could not be considered "sane".
+	as_fn_error $? "ls -t appears to fail.  Make sure there is not a broken
+  alias in your environment" "$LINENO" 5
+     fi
+     if test "$2" = conftest.file || test $am_try -eq 2; then
+       break
+     fi
+     # Just in case.
+     sleep 1
+     am_has_slept=yes
+   done
    test "$2" = conftest.file
    )
 then
@@ -2773,6 +2801,16 @@ Check your system clock" "$LINENO" 5
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
+# If we didn't sleep, we still need to ensure time stamps of config.status and
+# generated files are strictly newer.
+am_sleep_pid=
+if grep 'slept: no' conftest.file >/dev/null 2>&1; then
+  ( sleep 1 ) &
+  am_sleep_pid=$!
+fi
+
+rm -f conftest.file
+
 test "$program_prefix" != NONE &&
   program_transform_name="s&^&$program_prefix&;$program_transform_name"
 # Use a double $ so make ignores it.
@@ -2799,8 +2837,8 @@ if eval "$MISSING --run true"; then
   am_missing_run="$MISSING --run "
 else
   am_missing_run=
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5
-$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5
+$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
 fi
 
 if test x"${install_sh}" != xset; then
@@ -2812,10 +2850,10 @@ if test x"${install_sh}" != xset; then
   esac
 fi
 
-# Installed binaries are usually stripped using `strip' when the user
-# run `make install-strip'.  However `strip' might not be the right
+# Installed binaries are usually stripped using 'strip' when the user
+# run "make install-strip".  However 'strip' might not be the right
 # tool to use in cross-compilation environments, therefore Automake
-# will honor the `STRIP' environment variable to overrule this program.
+# will honor the 'STRIP' environment variable to overrule this program.
 if test "$cross_compiling" != no; then
   if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
@@ -2834,7 +2872,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_STRIP="${ac_tool_prefix}strip"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -2874,7 +2912,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_STRIP="strip"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -2925,7 +2963,7 @@ do
   test -z "$as_dir" && as_dir=.
     for ac_prog in mkdir gmkdir; do
 	 for ac_exec_ext in '' $ac_executable_extensions; do
-	   { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
+	   as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue
 	   case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
 	     'mkdir (GNU coreutils) '* | \
 	     'mkdir (coreutils) '* | \
@@ -2978,7 +3016,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_AWK="$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3064,7 +3102,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='abyss'
- VERSION='1.3.3'
+ VERSION='1.3.4'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -3127,7 +3165,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_AWK="$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3173,7 +3211,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="${ac_tool_prefix}gcc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3213,7 +3251,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_CC="gcc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3266,7 +3304,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="${ac_tool_prefix}cc"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3307,7 +3345,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
        ac_prog_rejected=yes
        continue
@@ -3365,7 +3403,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3409,7 +3447,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_CC="$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -3855,8 +3893,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <stdarg.h>
 #include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+struct stat;
 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
 struct buf { int x; };
 FILE * (*rcsopen) (struct buf *, struct stat *, int);
@@ -3959,7 +3996,7 @@ am__quote=
 _am_result=none
 # First try GNU make style include.
 echo "include confinc" > confmf
-# Ignore all kinds of additional output from `make'.
+# Ignore all kinds of additional output from 'make'.
 case `$am_make -s -f confmf 2> /dev/null` in #(
 *the\ am__doit\ target*)
   am__include=include
@@ -4015,8 +4052,8 @@ else
   # We make a subdir and do the tests there.  Otherwise we can end up
   # making bogus files that we don't know about and never remove.  For
   # instance it was reported that on HP-UX the gcc test will end up
-  # making a dummy file named `D' -- because `-MD' means `put the output
-  # in D'.
+  # making a dummy file named 'D' -- because '-MD' means "put the output
+  # in D".
   rm -rf conftest.dir
   mkdir conftest.dir
   # Copy depcomp to subdir because otherwise we won't find it if we're
@@ -4051,16 +4088,16 @@ else
     : > sub/conftest.c
     for i in 1 2 3 4 5 6; do
       echo '#include "conftst'$i'.h"' >> sub/conftest.c
-      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
-      # Solaris 8's {/usr,}/bin/sh.
-      touch sub/conftst$i.h
+      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+      # Solaris 10 /bin/sh.
+      echo '/* dummy */' > sub/conftst$i.h
     done
     echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
 
-    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # We check with '-c' and '-o' for the sake of the "dashmstdout"
     # mode.  It turns out that the SunPro C++ compiler does not properly
-    # handle `-M -o', and we need to detect this.  Also, some Intel
-    # versions had trouble with output in subdirs
+    # handle '-M -o', and we need to detect this.  Also, some Intel
+    # versions had trouble with output in subdirs.
     am__obj=sub/conftest.${OBJEXT-o}
     am__minus_obj="-o $am__obj"
     case $depmode in
@@ -4069,8 +4106,8 @@ else
       test "$am__universal" = false || continue
       ;;
     nosideeffect)
-      # after this tag, mechanisms are not by side-effect, so they'll
-      # only be used when explicitly requested
+      # After this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested.
       if test "x$enable_dependency_tracking" = xyes; then
 	continue
       else
@@ -4078,7 +4115,7 @@ else
       fi
       ;;
     msvc7 | msvc7msys | msvisualcpp | msvcmsys)
-      # This compiler won't grok `-c -o', but also, the minuso test has
+      # This compiler won't grok '-c -o', but also, the minuso test has
       # not run yet.  These depmodes are late enough in the game, and
       # so weak that their functioning should not be impacted.
       am__obj=conftest.${OBJEXT-o}
@@ -4297,7 +4334,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4341,7 +4378,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_CXX="$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4537,8 +4574,8 @@ else
   # We make a subdir and do the tests there.  Otherwise we can end up
   # making bogus files that we don't know about and never remove.  For
   # instance it was reported that on HP-UX the gcc test will end up
-  # making a dummy file named `D' -- because `-MD' means `put the output
-  # in D'.
+  # making a dummy file named 'D' -- because '-MD' means "put the output
+  # in D".
   rm -rf conftest.dir
   mkdir conftest.dir
   # Copy depcomp to subdir because otherwise we won't find it if we're
@@ -4573,16 +4610,16 @@ else
     : > sub/conftest.c
     for i in 1 2 3 4 5 6; do
       echo '#include "conftst'$i'.h"' >> sub/conftest.c
-      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
-      # Solaris 8's {/usr,}/bin/sh.
-      touch sub/conftst$i.h
+      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+      # Solaris 10 /bin/sh.
+      echo '/* dummy */' > sub/conftst$i.h
     done
     echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
 
-    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # We check with '-c' and '-o' for the sake of the "dashmstdout"
     # mode.  It turns out that the SunPro C++ compiler does not properly
-    # handle `-M -o', and we need to detect this.  Also, some Intel
-    # versions had trouble with output in subdirs
+    # handle '-M -o', and we need to detect this.  Also, some Intel
+    # versions had trouble with output in subdirs.
     am__obj=sub/conftest.${OBJEXT-o}
     am__minus_obj="-o $am__obj"
     case $depmode in
@@ -4591,8 +4628,8 @@ else
       test "$am__universal" = false || continue
       ;;
     nosideeffect)
-      # after this tag, mechanisms are not by side-effect, so they'll
-      # only be used when explicitly requested
+      # After this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested.
       if test "x$enable_dependency_tracking" = xyes; then
 	continue
       else
@@ -4600,7 +4637,7 @@ else
       fi
       ;;
     msvc7 | msvc7msys | msvisualcpp | msvcmsys)
-      # This compiler won't grok `-c -o', but also, the minuso test has
+      # This compiler won't grok '-c -o', but also, the minuso test has
       # not run yet.  These depmodes are late enough in the game, and
       # so weak that their functioning should not be impacted.
       am__obj=conftest.${OBJEXT-o}
@@ -4672,7 +4709,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4712,7 +4749,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_RANLIB="ranlib"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
@@ -4767,7 +4804,7 @@ do
     for ac_prog in grep ggrep; do
     for ac_exec_ext in '' $ac_executable_extensions; do
       ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
-      { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+      as_fn_executable_p "$ac_path_GREP" || continue
 # Check for GNU ac_path_GREP and select it if it is found.
   # Check for GNU $ac_path_GREP
 case `"$ac_path_GREP" --version 2>&1` in
@@ -4833,7 +4870,7 @@ do
     for ac_prog in egrep; do
     for ac_exec_ext in '' $ac_executable_extensions; do
       ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
-      { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+      as_fn_executable_p "$ac_path_EGREP" || continue
 # Check for GNU ac_path_EGREP and select it if it is found.
   # Check for GNU $ac_path_EGREP
 case `"$ac_path_EGREP" --version 2>&1` in
@@ -5032,60 +5069,60 @@ else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-#include <stdbool.h>
-#ifndef bool
- "error: bool is not defined"
-#endif
-#ifndef false
- "error: false is not defined"
-#endif
-#if false
- "error: false is not 0"
-#endif
-#ifndef true
- "error: true is not defined"
-#endif
-#if true != 1
- "error: true is not 1"
-#endif
-#ifndef __bool_true_false_are_defined
- "error: __bool_true_false_are_defined is not defined"
-#endif
-
-	struct s { _Bool s: 1; _Bool t; } s;
-
-	char a[true == 1 ? 1 : -1];
-	char b[false == 0 ? 1 : -1];
-	char c[__bool_true_false_are_defined == 1 ? 1 : -1];
-	char d[(bool) 0.5 == true ? 1 : -1];
-	/* See body of main program for 'e'.  */
-	char f[(_Bool) 0.0 == false ? 1 : -1];
-	char g[true];
-	char h[sizeof (_Bool)];
-	char i[sizeof s.t];
-	enum { j = false, k = true, l = false * true, m = true * 256 };
-	/* The following fails for
-	   HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */
-	_Bool n[m];
-	char o[sizeof n == m * sizeof n[0] ? 1 : -1];
-	char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
-	/* Catch a bug in an HP-UX C compiler.  See
-	   http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
-	   http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
-	 */
-	_Bool q = true;
-	_Bool *pq = &q;
+             #include <stdbool.h>
+             #ifndef bool
+              "error: bool is not defined"
+             #endif
+             #ifndef false
+              "error: false is not defined"
+             #endif
+             #if false
+              "error: false is not 0"
+             #endif
+             #ifndef true
+              "error: true is not defined"
+             #endif
+             #if true != 1
+              "error: true is not 1"
+             #endif
+             #ifndef __bool_true_false_are_defined
+              "error: __bool_true_false_are_defined is not defined"
+             #endif
+
+             struct s { _Bool s: 1; _Bool t; } s;
+
+             char a[true == 1 ? 1 : -1];
+             char b[false == 0 ? 1 : -1];
+             char c[__bool_true_false_are_defined == 1 ? 1 : -1];
+             char d[(bool) 0.5 == true ? 1 : -1];
+             /* See body of main program for 'e'.  */
+             char f[(_Bool) 0.0 == false ? 1 : -1];
+             char g[true];
+             char h[sizeof (_Bool)];
+             char i[sizeof s.t];
+             enum { j = false, k = true, l = false * true, m = true * 256 };
+             /* The following fails for
+                HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */
+             _Bool n[m];
+             char o[sizeof n == m * sizeof n[0] ? 1 : -1];
+             char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
+             /* Catch a bug in an HP-UX C compiler.  See
+                http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
+                http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
+              */
+             _Bool q = true;
+             _Bool *pq = &q;
 
 int
 main ()
 {
 
-	bool e = &s;
-	*pq |= q;
-	*pq |= ! q;
-	/* Refer to every declared value, to avoid compiler optimizations.  */
-	return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l
-		+ !m + !n + !o + !p + !q + !pq);
+             bool e = &s;
+             *pq |= q;
+             *pq |= ! q;
+             /* Refer to every declared value, to avoid compiler optimizations.  */
+             return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l
+                     + !m + !n + !o + !p + !q + !pq);
 
   ;
   return 0;
@@ -5100,7 +5137,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5
 $as_echo "$ac_cv_header_stdbool_h" >&6; }
-ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default"
+   ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default"
 if test "x$ac_cv_type__Bool" = xyes; then :
 
 cat >>confdefs.h <<_ACEOF
@@ -5110,6 +5147,7 @@ _ACEOF
 
 fi
 
+
 if test $ac_cv_header_stdbool_h = yes; then
 
 $as_echo "#define HAVE_STDBOOL_H 1" >>confdefs.h
@@ -5465,11 +5503,11 @@ else
 int
 main ()
 {
-/* FIXME: Include the comments suggested by Paul. */
+
 #ifndef __cplusplus
-  /* Ultrix mips cc rejects this.  */
+  /* Ultrix mips cc rejects this sort of thing.  */
   typedef int charset[2];
-  const charset cs;
+  const charset cs = { 0, 0 };
   /* SunOS 4.1.1 cc rejects this.  */
   char const *const *pcpcc;
   char **ppc;
@@ -5486,8 +5524,9 @@ main ()
   ++pcpcc;
   ppc = (char**) pcpcc;
   pcpcc = (char const *const *) ppc;
-  { /* SCO 3.2v4 cc rejects this.  */
-    char *t;
+  { /* SCO 3.2v4 cc rejects this sort of thing.  */
+    char tx;
+    char *t = &tx;
     char const *s = 0 ? (char *) 0 : (char const *) 0;
 
     *t++ = 0;
@@ -5503,10 +5542,10 @@ main ()
     iptr p = 0;
     ++p;
   }
-  { /* AIX XL C 1.02.0.0 rejects this saying
+  { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying
        "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
-    struct s { int j; const int *ap[3]; };
-    struct s *b; b->j = 5;
+    struct s { int j; const int *ap[3]; } bx;
+    struct s *b = &bx; b->j = 5;
   }
   { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
     const int foo = 10;
@@ -6963,7 +7002,8 @@ if ac_fn_cxx_try_link "$LINENO"; then :
   ac_cv_prog_cxx_openmp='none needed'
 else
   ac_cv_prog_cxx_openmp='unsupported'
-	  	  	  	  	  	  	  	  	  	  	  	  	  for ac_option in -fopenmp -xopenmp -openmp -mp -omp -qsmp=omp; do
+	  	  	  	  	  	  	                                	  	  	  	  	  	  for ac_option in -fopenmp -xopenmp -openmp -mp -omp -qsmp=omp -homp \
+                           -Popenmp --openmp; do
 	    ac_save_CXXFLAGS=$CXXFLAGS
 	    CXXFLAGS="$CXXFLAGS $ac_option"
 	    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -7120,6 +7160,14 @@ LIBOBJS=$ac_libobjs
 LTLIBOBJS=$ac_ltlibobjs
 
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5
+$as_echo_n "checking that generated files are newer than configure... " >&6; }
+   if test -n "$am_sleep_pid"; then
+     # Hide warnings about reused PIDs.
+     wait $am_sleep_pid 2>/dev/null
+   fi
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
+$as_echo "done" >&6; }
  if test -n "$EXEEXT"; then
   am__EXEEXT_TRUE=
   am__EXEEXT_FALSE='#'
@@ -7443,16 +7491,16 @@ if (echo >conf$$.file) 2>/dev/null; then
     # ... but there are two gotchas:
     # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
     # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
-    # In both cases, we have to default to `cp -p'.
+    # In both cases, we have to default to `cp -pR'.
     ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
-      as_ln_s='cp -p'
+      as_ln_s='cp -pR'
   elif ln conf$$.file conf$$ 2>/dev/null; then
     as_ln_s=ln
   else
-    as_ln_s='cp -p'
+    as_ln_s='cp -pR'
   fi
 else
-  as_ln_s='cp -p'
+  as_ln_s='cp -pR'
 fi
 rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
 rmdir conf$$.dir 2>/dev/null
@@ -7512,28 +7560,16 @@ else
   as_mkdir_p=false
 fi
 
-if test -x / >/dev/null 2>&1; then
-  as_test_x='test -x'
-else
-  if ls -dL / >/dev/null 2>&1; then
-    as_ls_L_option=L
-  else
-    as_ls_L_option=
-  fi
-  as_test_x='
-    eval sh -c '\''
-      if test -d "$1"; then
-	test -d "$1/.";
-      else
-	case $1 in #(
-	-*)set "./$1";;
-	esac;
-	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
-	???[sx]*):;;*)false;;esac;fi
-    '\'' sh
-  '
-fi
-as_executable_p=$as_test_x
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+  test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
 
 # Sed expression to map a string onto a valid CPP name.
 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -7554,8 +7590,8 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by ABySS $as_me 1.3.3, which was
-generated by GNU Autoconf 2.68.  Invocation command line was
+This file was extended by ABySS $as_me 1.3.4, which was
+generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
   CONFIG_HEADERS  = $CONFIG_HEADERS
@@ -7621,11 +7657,11 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-ABySS config.status 1.3.3
-configured by $0, generated by GNU Autoconf 2.68,
+ABySS config.status 1.3.4
+configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
-Copyright (C) 2010 Free Software Foundation, Inc.
+Copyright (C) 2012 Free Software Foundation, Inc.
 This config.status script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it."
 
@@ -7716,7 +7752,7 @@ fi
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 if \$ac_cs_recheck; then
-  set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
   shift
   \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
   CONFIG_SHELL='$SHELL'
@@ -8388,7 +8424,7 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
     # Strip MF so we end up with the name of the file.
     mf=`echo "$mf" | sed -e 's/:.*$//'`
     # Check whether this is an Automake generated Makefile or not.
-    # We used to match only the files named `Makefile.in', but
+    # We used to match only the files named 'Makefile.in', but
     # some people rename them; so instead we look at the file content.
     # Grep'ing the first line is not enough: some people post-process
     # each Makefile.in and add a new line on top of each file to say so.
@@ -8422,21 +8458,19 @@ $as_echo X"$mf" |
       continue
     fi
     # Extract the definition of DEPDIR, am__include, and am__quote
-    # from the Makefile without running `make'.
+    # from the Makefile without running 'make'.
     DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
     test -z "$DEPDIR" && continue
     am__include=`sed -n 's/^am__include = //p' < "$mf"`
     test -z "am__include" && continue
     am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
-    # When using ansi2knr, U may be empty or an underscore; expand it
-    U=`sed -n 's/^U = //p' < "$mf"`
     # Find all dependency output files, they are included files with
     # $(DEPDIR) in their names.  We invoke sed twice because it is the
     # simplest approach to changing $(DEPDIR) to its actual value in the
     # expansion.
     for file in `sed -n "
       s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
-	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
       # Make sure the directory exists.
       test -f "$dirpart/$file" && continue
       fdir=`$as_dirname -- "$file" ||
diff --git a/configure.ac b/configure.ac
index 872c09a..dfbd3aa 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,5 +1,5 @@
 AC_PREREQ(2.59)
-AC_INIT(ABySS, 1.3.3, abyss-users at bcgsc.ca, abyss,
+AC_INIT(ABySS, 1.3.4, abyss-users at bcgsc.ca, abyss,
 		http://www.bcgsc.ca/platform/bioinfo/software/abyss)
 AM_INIT_AUTOMAKE(foreign)
 AC_CONFIG_SRCDIR([ABYSS/Abyss.cpp])
diff --git a/depcomp b/depcomp
index 11e2d3b..df8eea7 100755
--- a/depcomp
+++ b/depcomp
@@ -1,9 +1,10 @@
 #! /bin/sh
 # depcomp - compile a program generating dependencies as side-effects
 
-scriptversion=2004-05-31.23
+scriptversion=2009-04-28.21; # UTC
 
-# Copyright (C) 1999, 2000, 2003, 2004 Free Software Foundation, Inc.
+# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free
+# Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -16,9 +17,7 @@ scriptversion=2004-05-31.23
 # GNU General Public License for more details.
 
 # You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -50,11 +49,11 @@ Environment variables:
 
 Report bugs to <bug-automake at gnu.org>.
 EOF
-    exit 0
+    exit $?
     ;;
   -v | --v*)
     echo "depcomp $scriptversion"
-    exit 0
+    exit $?
     ;;
 esac
 
@@ -86,12 +85,34 @@ if test "$depmode" = dashXmstdout; then
    depmode=dashmstdout
 fi
 
+cygpath_u="cygpath -u -f -"
+if test "$depmode" = msvcmsys; then
+   # This is just like msvisualcpp but w/o cygpath translation.
+   # Just convert the backslash-escaped backslashes to single forward
+   # slashes to satisfy depend.m4
+   cygpath_u="sed s,\\\\\\\\,/,g"
+   depmode=msvisualcpp
+fi
+
 case "$depmode" in
 gcc3)
 ## gcc 3 implements dependency tracking that does exactly what
 ## we want.  Yay!  Note: for some reason libtool 1.4 doesn't like
 ## it if -MD -MP comes after the -MF stuff.  Hmm.
-  "$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
+## Unfortunately, FreeBSD c89 acceptance of flags depends upon
+## the command line argument order; so add the flags where they
+## appear in depend2.am.  Note that the slowdown incurred here
+## affects only configure: in makefiles, %FASTDEP% shortcuts this.
+  for arg
+  do
+    case $arg in
+    -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
+    *)  set fnord "$@" "$arg" ;;
+    esac
+    shift # fnord
+    shift # $arg
+  done
+  "$@"
   stat=$?
   if test $stat -eq 0; then :
   else
@@ -178,14 +199,14 @@ sgi)
 ' < "$tmpdepfile" \
     | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
     tr '
-' ' ' >> $depfile
-    echo >> $depfile
+' ' ' >> "$depfile"
+    echo >> "$depfile"
 
     # The second pass generates a dummy entry for each header file.
     tr ' ' '
 ' < "$tmpdepfile" \
    | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
-   >> $depfile
+   >> "$depfile"
   else
     # The sourcefile does not contain any dependencies, so just
     # store a dummy comment line, to avoid errors with the Makefile
@@ -201,34 +222,39 @@ aix)
   # current directory.  Also, the AIX compiler puts `$object:' at the
   # start of each line; $object doesn't have directory information.
   # Version 6 uses the directory in both cases.
-  stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'`
-  tmpdepfile="$stripped.u"
+  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+  test "x$dir" = "x$object" && dir=
+  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
   if test "$libtool" = yes; then
+    tmpdepfile1=$dir$base.u
+    tmpdepfile2=$base.u
+    tmpdepfile3=$dir.libs/$base.u
     "$@" -Wc,-M
   else
+    tmpdepfile1=$dir$base.u
+    tmpdepfile2=$dir$base.u
+    tmpdepfile3=$dir$base.u
     "$@" -M
   fi
   stat=$?
 
-  if test -f "$tmpdepfile"; then :
-  else
-    stripped=`echo "$stripped" | sed 's,^.*/,,'`
-    tmpdepfile="$stripped.u"
-  fi
-
   if test $stat -eq 0; then :
   else
-    rm -f "$tmpdepfile"
+    rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
     exit $stat
   fi
 
+  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+  do
+    test -f "$tmpdepfile" && break
+  done
   if test -f "$tmpdepfile"; then
-    outname="$stripped.o"
     # Each line is of the form `foo.o: dependent.h'.
     # Do two passes, one to just change these to
     # `$object: dependent.h' and one to simply `dependent.h:'.
-    sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
-    sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
+    sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
+    # That's a tab and a space in the [].
+    sed -e 's,^.*\.[a-z]*:[	 ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
   else
     # The sourcefile does not contain any dependencies, so just
     # store a dummy comment line, to avoid errors with the Makefile
@@ -276,6 +302,51 @@ icc)
   rm -f "$tmpdepfile"
   ;;
 
+hp2)
+  # The "hp" stanza above does not work with aCC (C++) and HP's ia64
+  # compilers, which have integrated preprocessors.  The correct option
+  # to use with these is +Maked; it writes dependencies to a file named
+  # 'foo.d', which lands next to the object file, wherever that
+  # happens to be.
+  # Much of this is similar to the tru64 case; see comments there.
+  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+  test "x$dir" = "x$object" && dir=
+  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+  if test "$libtool" = yes; then
+    tmpdepfile1=$dir$base.d
+    tmpdepfile2=$dir.libs/$base.d
+    "$@" -Wc,+Maked
+  else
+    tmpdepfile1=$dir$base.d
+    tmpdepfile2=$dir$base.d
+    "$@" +Maked
+  fi
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+     rm -f "$tmpdepfile1" "$tmpdepfile2"
+     exit $stat
+  fi
+
+  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
+  do
+    test -f "$tmpdepfile" && break
+  done
+  if test -f "$tmpdepfile"; then
+    sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
+    # Add `dependent.h:' lines.
+    sed -ne '2,${
+	       s/^ *//
+	       s/ \\*$//
+	       s/$/:/
+	       p
+	     }' "$tmpdepfile" >> "$depfile"
+  else
+    echo "#dummy" > "$depfile"
+  fi
+  rm -f "$tmpdepfile" "$tmpdepfile2"
+  ;;
+
 tru64)
    # The Tru64 compiler uses -MD to generate dependencies as a side
    # effect.  `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
@@ -287,36 +358,43 @@ tru64)
    base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
 
    if test "$libtool" = yes; then
-      # Dependencies are output in .lo.d with libtool 1.4.
-      # With libtool 1.5 they are output both in $dir.libs/$base.o.d
-      # and in $dir.libs/$base.o.d and $dir$base.o.d.  We process the
-      # latter, because the former will be cleaned when $dir.libs is
-      # erased.
-      tmpdepfile1="$dir.libs/$base.lo.d"
-      tmpdepfile2="$dir$base.o.d"
-      tmpdepfile3="$dir.libs/$base.d"
+      # With Tru64 cc, shared objects can also be used to make a
+      # static library.  This mechanism is used in libtool 1.4 series to
+      # handle both shared and static libraries in a single compilation.
+      # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
+      #
+      # With libtool 1.5 this exception was removed, and libtool now
+      # generates 2 separate objects for the 2 libraries.  These two
+      # compilations output dependencies in $dir.libs/$base.o.d and
+      # in $dir$base.o.d.  We have to check for both files, because
+      # one of the two compilations can be disabled.  We should prefer
+      # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
+      # automatically cleaned when .libs/ is deleted, while ignoring
+      # the former would cause a distcleancheck panic.
+      tmpdepfile1=$dir.libs/$base.lo.d   # libtool 1.4
+      tmpdepfile2=$dir$base.o.d          # libtool 1.5
+      tmpdepfile3=$dir.libs/$base.o.d    # libtool 1.5
+      tmpdepfile4=$dir.libs/$base.d      # Compaq CCC V6.2-504
       "$@" -Wc,-MD
    else
-      tmpdepfile1="$dir$base.o.d"
-      tmpdepfile2="$dir$base.d"
-      tmpdepfile3="$dir$base.d"
+      tmpdepfile1=$dir$base.o.d
+      tmpdepfile2=$dir$base.d
+      tmpdepfile3=$dir$base.d
+      tmpdepfile4=$dir$base.d
       "$@" -MD
    fi
 
    stat=$?
    if test $stat -eq 0; then :
    else
-      rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+      rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
       exit $stat
    fi
 
-   if test -f "$tmpdepfile1"; then
-      tmpdepfile="$tmpdepfile1"
-   elif test -f "$tmpdepfile2"; then
-      tmpdepfile="$tmpdepfile2"
-   else
-      tmpdepfile="$tmpdepfile3"
-   fi
+   for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
+   do
+     test -f "$tmpdepfile" && break
+   done
    if test -f "$tmpdepfile"; then
       sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
       # That's a tab and a space in the [].
@@ -338,7 +416,7 @@ dashmstdout)
 
   # Remove the call to Libtool.
   if test "$libtool" = yes; then
-    while test $1 != '--mode=compile'; do
+    while test "X$1" != 'X--mode=compile'; do
       shift
     done
     shift
@@ -389,32 +467,39 @@ makedepend)
   "$@" || exit $?
   # Remove any Libtool call
   if test "$libtool" = yes; then
-    while test $1 != '--mode=compile'; do
+    while test "X$1" != 'X--mode=compile'; do
       shift
     done
     shift
   fi
   # X makedepend
   shift
-  cleared=no
-  for arg in "$@"; do
+  cleared=no eat=no
+  for arg
+  do
     case $cleared in
     no)
       set ""; shift
       cleared=yes ;;
     esac
+    if test $eat = yes; then
+      eat=no
+      continue
+    fi
     case "$arg" in
     -D*|-I*)
       set fnord "$@" "$arg"; shift ;;
     # Strip any option that makedepend may not understand.  Remove
     # the object too, otherwise makedepend will parse it as a source file.
+    -arch)
+      eat=yes ;;
     -*|$object)
       ;;
     *)
       set fnord "$@" "$arg"; shift ;;
     esac
   done
-  obj_suffix="`echo $object | sed 's/^.*\././'`"
+  obj_suffix=`echo "$object" | sed 's/^.*\././'`
   touch "$tmpdepfile"
   ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
   rm -f "$depfile"
@@ -434,7 +519,7 @@ cpp)
 
   # Remove the call to Libtool.
   if test "$libtool" = yes; then
-    while test $1 != '--mode=compile'; do
+    while test "X$1" != 'X--mode=compile'; do
       shift
     done
     shift
@@ -460,7 +545,8 @@ cpp)
   done
 
   "$@" -E |
-    sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
+    sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
+       -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
     sed '$ s: \\$::' > "$tmpdepfile"
   rm -f "$depfile"
   echo "$object : \\" > "$depfile"
@@ -471,13 +557,27 @@ cpp)
 
 msvisualcpp)
   # Important note: in order to support this mode, a compiler *must*
-  # always write the preprocessed file to stdout, regardless of -o,
-  # because we must use -o when running libtool.
+  # always write the preprocessed file to stdout.
   "$@" || exit $?
+
+  # Remove the call to Libtool.
+  if test "$libtool" = yes; then
+    while test "X$1" != 'X--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+
   IFS=" "
   for arg
   do
     case "$arg" in
+    -o)
+      shift
+      ;;
+    $object)
+      shift
+      ;;
     "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
 	set fnord "$@"
 	shift
@@ -490,16 +590,23 @@ msvisualcpp)
 	;;
     esac
   done
-  "$@" -E |
-  sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
+  "$@" -E 2>/dev/null |
+  sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
   rm -f "$depfile"
   echo "$object : \\" > "$depfile"
-  . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::	\1 \\:p' >> "$depfile"
+  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::	\1 \\:p' >> "$depfile"
   echo "	" >> "$depfile"
-  . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
+  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
   rm -f "$tmpdepfile"
   ;;
 
+msvcmsys)
+  # This case exists only to let depend.m4 do its work.  It works by
+  # looking at the text of this script.  This case will never be run,
+  # since it is checked for above.
+  exit 1
+  ;;
+
 none)
   exec "$@"
   ;;
@@ -518,5 +625,6 @@ exit 0
 # eval: (add-hook 'write-file-hooks 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-end: "$"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
 # End:
diff --git a/dialign/Makefile.in b/dialign/Makefile.in
index 63825f9..63c451c 100644
--- a/dialign/Makefile.in
+++ b/dialign/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# Makefile.in generated by automake 1.12 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -17,6 +17,23 @@
 
 
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -35,7 +52,8 @@ PRE_UNINSTALL = :
 POST_UNINSTALL = :
 noinst_PROGRAMS = dialign$(EXEEXT)
 subdir = dialign
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -67,6 +85,11 @@ CCLD = $(CC)
 LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
 SOURCES = $(libdialign_a_SOURCES) $(dialign_SOURCES)
 DIST_SOURCES = $(libdialign_a_SOURCES) $(dialign_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -306,6 +329,20 @@ GTAGS:
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
 
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
@@ -446,17 +483,17 @@ uninstall-am:
 .MAKE: install-am install-strip
 
 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-noinstLIBRARIES clean-noinstPROGRAMS ctags distclean \
-	distclean-compile distclean-generic distclean-tags distdir dvi \
-	dvi-am html html-am info info-am install install-am \
-	install-data install-data-am install-dvi install-dvi-am \
-	install-exec install-exec-am install-html install-html-am \
-	install-info install-info-am install-man install-pdf \
-	install-pdf-am install-ps install-ps-am install-strip \
-	installcheck installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-compile \
-	mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
-	uninstall-am
+	clean-noinstLIBRARIES clean-noinstPROGRAMS cscopelist ctags \
+	distclean distclean-compile distclean-generic distclean-tags \
+	distdir dvi dvi-am html html-am info info-am install \
+	install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am
 
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/doc/ABYSS.1 b/doc/ABYSS.1
index 59b119f..d9c26eb 100644
--- a/doc/ABYSS.1
+++ b/doc/ABYSS.1
@@ -1,4 +1,4 @@
-.TH ABYSS "1" "2012-Mar" "ABYSS (ABySS) 1.3.3" "User Commands"
+.TH ABYSS "1" "2012-May" "ABYSS (ABySS) 1.3.4" "User Commands"
 .SH NAME
 ABYSS \- assemble short reads into contigs
 .SH SYNOPSIS
diff --git a/doc/Makefile.in b/doc/Makefile.in
index eb0e920..1831227 100644
--- a/doc/Makefile.in
+++ b/doc/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# Makefile.in generated by automake 1.12 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -16,6 +16,23 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -45,6 +62,11 @@ CONFIG_CLEAN_FILES =
 CONFIG_CLEAN_VPATH_FILES =
 SOURCES =
 DIST_SOURCES =
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
 am__vpath_adj = case $$p in \
     $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
@@ -210,11 +232,18 @@ $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
 $(am__aclocal_m4_deps):
 install-man1: $(dist_man_MANS)
 	@$(NORMAL_INSTALL)
-	test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)"
-	@list=''; test -n "$(man1dir)" || exit 0; \
-	{ for i in $$list; do echo "$$i"; done; \
-	l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \
-	  sed -n '/\.1[a-z]*$$/p'; \
+	@list1=''; \
+	list2='$(dist_man_MANS)'; \
+	test -n "$(man1dir)" \
+	  && test -n "`echo $$list1$$list2`" \
+	  || exit 0; \
+	echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \
+	$(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \
+	{ for i in $$list1; do echo "$$i"; done;  \
+	if test -n "$$list2"; then \
+	  for i in $$list2; do echo "$$i"; done \
+	    | sed -n '/\.1[a-z]*$$/p'; \
+	fi; \
 	} | while read p; do \
 	  if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
 	  echo "$$d$$p"; echo "$$p"; \
@@ -246,8 +275,11 @@ uninstall-man1:
 	dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir)
 install-dist_docDATA: $(dist_doc_DATA)
 	@$(NORMAL_INSTALL)
-	test -z "$(docdir)" || $(MKDIR_P) "$(DESTDIR)$(docdir)"
 	@list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(docdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(docdir)" || exit 1; \
+	fi; \
 	for p in $$list; do \
 	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
 	  echo "$$d$$p"; \
@@ -268,6 +300,8 @@ TAGS:
 ctags: CTAGS
 CTAGS:
 
+cscope cscopelist:
+
 
 distdir: $(DISTFILES)
 	@list='$(MANS)'; if test -n "$$list"; then \
@@ -276,10 +310,10 @@ distdir: $(DISTFILES)
 	    if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
 	  if test -n "$$list" && \
 	    grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
-	    echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \
+	    echo "error: found man pages containing the 'missing help2man' replacement text:" >&2; \
 	    grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/         /' >&2; \
 	    echo "       to fix them, install help2man, remove and regenerate the man pages;" >&2; \
-	    echo "       typically \`make maintainer-clean' will remove them" >&2; \
+	    echo "       typically 'make maintainer-clean' will remove them" >&2; \
 	    exit 1; \
 	  else :; fi; \
 	else :; fi
diff --git a/doc/abyss-pe.1 b/doc/abyss-pe.1
index 8c71aed..424ef36 100644
--- a/doc/abyss-pe.1
+++ b/doc/abyss-pe.1
@@ -1,4 +1,4 @@
-.TH abyss-pe "1" "2012-Mar" "abyss-pe (ABySS) 1.3.3" "User Commands"
+.TH abyss-pe "1" "2012-May" "abyss-pe (ABySS) 1.3.4" "User Commands"
 .SH NAME
 abyss-pe - assemble reads into contigs
 .SH SYNOPSIS
@@ -115,6 +115,62 @@ convert colour-space contigs to nucleotide contigs following assembly
 .TP
 \fB-n\fR, \fB--dry-run\fR
 Print the commands that would be executed, but do not execute them.
+.SS "Commands of abyss-pe"
+.TP
+.B default
+Equivalent to `scaffolds scaffolds-dot stats'.
+.TP
+.B unitigs
+Assemble unitigs.
+.TP
+.B unitigs-dot
+Output the unitig overlap graph.
+.TP
+.B pe-sam
+Map paired-end reads to the unitigs and output a SAM file.
+.TP
+.B pe-bam
+Map paired-end reads to the unitigs and output a BAM file.
+.TP
+.B pe-index
+Generate an index of the unitigs used by abyss-map.
+.TP
+.B contigs
+Assemble contigs.
+.TP
+.B contigs-dot
+Output the contig overlap graph.
+.TP
+.B mp-sam
+Map mate-pair reads to the contigs and output a SAM file.
+.TP
+.B mp-bam
+Map mate-pair reads to the contigs and output a BAM file.
+.TP
+.B mp-index
+Generate an index of the contigs used by abyss-map.
+.TP
+.B scaffolds
+Assemble scaffolds.
+.TP
+.B scaffolds-dot
+Output the scaffold overlap graph.
+.TP
+.B stats
+Display assembly contiguity statistics.
+.TP
+.B clean
+Remove intermediate files.
+.TP
+.B version
+Display the version of abyss-pe.
+.TP
+.B versions
+Display the versions of all programs used by abyss-pe.
+.TP
+.B help
+Display a helpful message.
+
 .SH "ENVIRONMENT VARIABLES"
 Any parameter that may be specified on the command line may also be
 specified in an environment variable.
diff --git a/doc/abyss-tofastq.1 b/doc/abyss-tofastq.1
index eb80cdb..97cbb27 100644
--- a/doc/abyss-tofastq.1
+++ b/doc/abyss-tofastq.1
@@ -1,4 +1,4 @@
-.TH abyss-tofastq "1" "2012-Mar" "ABySS 1.3.3" "User Commands"
+.TH abyss-tofastq "1" "2012-May" "ABySS 1.3.4" "User Commands"
 .SH NAME
 abyss-tofastq \- convert various file formats to FASTQ format
 .br
diff --git a/install-sh b/install-sh
index dd97db7..6781b98 100755
--- a/install-sh
+++ b/install-sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 # install - install a program, script, or datafile
 
-scriptversion=2004-09-10.20
+scriptversion=2009-04-28.21; # UTC
 
 # This originates from X11R5 (mit/util/scripts/install.sh), which was
 # later released in X11R6 (xc/config/util/install.sh) with the
@@ -39,38 +39,68 @@ scriptversion=2004-09-10.20
 # when there is no Makefile.
 #
 # This script is compatible with the BSD install script, but was written
-# from scratch.  It can only install one file at a time, a restriction
-# shared with many OS's install programs.
+# from scratch.
+
+nl='
+'
+IFS=" ""	$nl"
 
 # set DOITPROG to echo to test this script
 
 # Don't use :- since 4.3BSD and earlier shells don't like it.
-doit="${DOITPROG-}"
+doit=${DOITPROG-}
+if test -z "$doit"; then
+  doit_exec=exec
+else
+  doit_exec=$doit
+fi
+
+# Put in absolute file names if you don't have them in your path;
+# or use environment vars.
+
+chgrpprog=${CHGRPPROG-chgrp}
+chmodprog=${CHMODPROG-chmod}
+chownprog=${CHOWNPROG-chown}
+cmpprog=${CMPPROG-cmp}
+cpprog=${CPPROG-cp}
+mkdirprog=${MKDIRPROG-mkdir}
+mvprog=${MVPROG-mv}
+rmprog=${RMPROG-rm}
+stripprog=${STRIPPROG-strip}
+
+posix_glob='?'
+initialize_posix_glob='
+  test "$posix_glob" != "?" || {
+    if (set -f) 2>/dev/null; then
+      posix_glob=
+    else
+      posix_glob=:
+    fi
+  }
+'
 
-# put in absolute paths if you don't have them in your path; or use env. vars.
+posix_mkdir=
 
-mvprog="${MVPROG-mv}"
-cpprog="${CPPROG-cp}"
-chmodprog="${CHMODPROG-chmod}"
-chownprog="${CHOWNPROG-chown}"
-chgrpprog="${CHGRPPROG-chgrp}"
-stripprog="${STRIPPROG-strip}"
-rmprog="${RMPROG-rm}"
-mkdirprog="${MKDIRPROG-mkdir}"
+# Desired mode of installed file.
+mode=0755
 
-chmodcmd="$chmodprog 0755"
-chowncmd=
 chgrpcmd=
-stripcmd=
+chmodcmd=$chmodprog
+chowncmd=
+mvcmd=$mvprog
 rmcmd="$rmprog -f"
-mvcmd="$mvprog"
+stripcmd=
+
 src=
 dst=
 dir_arg=
-dstarg=
+dst_arg=
+
+copy_on_change=false
 no_target_directory=
 
-usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
+usage="\
+Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
    or: $0 [OPTION]... SRCFILES... DIRECTORY
    or: $0 [OPTION]... -t DIRECTORY SRCFILES...
    or: $0 [OPTION]... -d DIRECTORIES...
@@ -80,81 +110,86 @@ In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
 In the 4th, create DIRECTORIES.
 
 Options:
--c         (ignored)
--d         create directories instead of installing files.
--g GROUP   $chgrpprog installed files to GROUP.
--m MODE    $chmodprog installed files to MODE.
--o USER    $chownprog installed files to USER.
--s         $stripprog installed files.
--t DIRECTORY  install into DIRECTORY.
--T         report an error if DSTFILE is a directory.
---help     display this help and exit.
---version  display version info and exit.
+     --help     display this help and exit.
+     --version  display version info and exit.
+
+  -c            (ignored)
+  -C            install only if different (preserve the last data modification time)
+  -d            create directories instead of installing files.
+  -g GROUP      $chgrpprog installed files to GROUP.
+  -m MODE       $chmodprog installed files to MODE.
+  -o USER       $chownprog installed files to USER.
+  -s            $stripprog installed files.
+  -t DIRECTORY  install into DIRECTORY.
+  -T            report an error if DSTFILE is a directory.
 
 Environment variables override the default commands:
-  CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
+  CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
+  RMPROG STRIPPROG
 "
 
-while test -n "$1"; do
+while test $# -ne 0; do
   case $1 in
-    -c) shift
-        continue;;
+    -c) ;;
 
-    -d) dir_arg=true
-        shift
-        continue;;
+    -C) copy_on_change=true;;
+
+    -d) dir_arg=true;;
 
     -g) chgrpcmd="$chgrpprog $2"
-        shift
-        shift
-        continue;;
+	shift;;
 
-    --help) echo "$usage"; exit 0;;
+    --help) echo "$usage"; exit $?;;
 
-    -m) chmodcmd="$chmodprog $2"
-        shift
-        shift
-        continue;;
+    -m) mode=$2
+	case $mode in
+	  *' '* | *'	'* | *'
+'*	  | *'*'* | *'?'* | *'['*)
+	    echo "$0: invalid mode: $mode" >&2
+	    exit 1;;
+	esac
+	shift;;
 
     -o) chowncmd="$chownprog $2"
-        shift
-        shift
-        continue;;
-
-    -s) stripcmd=$stripprog
-        shift
-        continue;;
-
-    -t) dstarg=$2
-	shift
-	shift
-	continue;;
-
-    -T) no_target_directory=true
-	shift
-	continue;;
-
-    --version) echo "$0 $scriptversion"; exit 0;;
-
-    *)  # When -d is used, all remaining arguments are directories to create.
-	# When -t is used, the destination is already specified.
-	test -n "$dir_arg$dstarg" && break
-        # Otherwise, the last argument is the destination.  Remove it from $@.
-	for arg
-	do
-          if test -n "$dstarg"; then
-	    # $@ is not empty: it contains at least $arg.
-	    set fnord "$@" "$dstarg"
-	    shift # fnord
-	  fi
-	  shift # arg
-	  dstarg=$arg
-	done
+	shift;;
+
+    -s) stripcmd=$stripprog;;
+
+    -t) dst_arg=$2
+	shift;;
+
+    -T) no_target_directory=true;;
+
+    --version) echo "$0 $scriptversion"; exit $?;;
+
+    --)	shift
 	break;;
+
+    -*)	echo "$0: invalid option: $1" >&2
+	exit 1;;
+
+    *)  break;;
   esac
+  shift
 done
 
-if test -z "$1"; then
+if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
+  # When -d is used, all remaining arguments are directories to create.
+  # When -t is used, the destination is already specified.
+  # Otherwise, the last argument is the destination.  Remove it from $@.
+  for arg
+  do
+    if test -n "$dst_arg"; then
+      # $@ is not empty: it contains at least $arg.
+      set fnord "$@" "$dst_arg"
+      shift # fnord
+    fi
+    shift # arg
+    dst_arg=$arg
+  done
+fi
+
+if test $# -eq 0; then
   if test -z "$dir_arg"; then
     echo "$0: no input file specified." >&2
     exit 1
@@ -164,24 +199,47 @@ if test -z "$1"; then
   exit 0
 fi
 
+if test -z "$dir_arg"; then
+  trap '(exit $?); exit' 1 2 13 15
+
+  # Set umask so as not to create temps with too-generous modes.
+  # However, 'strip' requires both read and write access to temps.
+  case $mode in
+    # Optimize common cases.
+    *644) cp_umask=133;;
+    *755) cp_umask=22;;
+
+    *[0-7])
+      if test -z "$stripcmd"; then
+	u_plus_rw=
+      else
+	u_plus_rw='% 200'
+      fi
+      cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
+    *)
+      if test -z "$stripcmd"; then
+	u_plus_rw=
+      else
+	u_plus_rw=,u+rw
+      fi
+      cp_umask=$mode$u_plus_rw;;
+  esac
+fi
+
 for src
 do
   # Protect names starting with `-'.
   case $src in
-    -*) src=./$src ;;
+    -*) src=./$src;;
   esac
 
   if test -n "$dir_arg"; then
     dst=$src
-    src=
-
-    if test -d "$dst"; then
-      mkdircmd=:
-      chmodcmd=
-    else
-      mkdircmd=$mkdirprog
-    fi
+    dstdir=$dst
+    test -d "$dstdir"
+    dstdir_status=$?
   else
+
     # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
     # might cause directories to be created, which would be especially bad
     # if $src (and thus $dsttmp) contains '*'.
@@ -190,70 +248,199 @@ do
       exit 1
     fi
 
-    if test -z "$dstarg"; then
+    if test -z "$dst_arg"; then
       echo "$0: no destination specified." >&2
       exit 1
     fi
 
-    dst=$dstarg
+    dst=$dst_arg
     # Protect names starting with `-'.
     case $dst in
-      -*) dst=./$dst ;;
+      -*) dst=./$dst;;
     esac
 
     # If destination is a directory, append the input filename; won't work
     # if double slashes aren't ignored.
     if test -d "$dst"; then
       if test -n "$no_target_directory"; then
-	echo "$0: $dstarg: Is a directory" >&2
+	echo "$0: $dst_arg: Is a directory" >&2
 	exit 1
       fi
-      dst=$dst/`basename "$src"`
+      dstdir=$dst
+      dst=$dstdir/`basename "$src"`
+      dstdir_status=0
+    else
+      # Prefer dirname, but fall back on a substitute if dirname fails.
+      dstdir=`
+	(dirname "$dst") 2>/dev/null ||
+	expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	     X"$dst" : 'X\(//\)[^/]' \| \
+	     X"$dst" : 'X\(//\)$' \| \
+	     X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
+	echo X"$dst" |
+	    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+		   s//\1/
+		   q
+		 }
+		 /^X\(\/\/\)[^/].*/{
+		   s//\1/
+		   q
+		 }
+		 /^X\(\/\/\)$/{
+		   s//\1/
+		   q
+		 }
+		 /^X\(\/\).*/{
+		   s//\1/
+		   q
+		 }
+		 s/.*/./; q'
+      `
+
+      test -d "$dstdir"
+      dstdir_status=$?
     fi
   fi
 
-  # This sed command emulates the dirname command.
-  dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
+  obsolete_mkdir_used=false
+
+  if test $dstdir_status != 0; then
+    case $posix_mkdir in
+      '')
+	# Create intermediate dirs using mode 755 as modified by the umask.
+	# This is like FreeBSD 'install' as of 1997-10-28.
+	umask=`umask`
+	case $stripcmd.$umask in
+	  # Optimize common cases.
+	  *[2367][2367]) mkdir_umask=$umask;;
+	  .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
+
+	  *[0-7])
+	    mkdir_umask=`expr $umask + 22 \
+	      - $umask % 100 % 40 + $umask % 20 \
+	      - $umask % 10 % 4 + $umask % 2
+	    `;;
+	  *) mkdir_umask=$umask,go-w;;
+	esac
+
+	# With -d, create the new directory with the user-specified mode.
+	# Otherwise, rely on $mkdir_umask.
+	if test -n "$dir_arg"; then
+	  mkdir_mode=-m$mode
+	else
+	  mkdir_mode=
+	fi
+
+	posix_mkdir=false
+	case $umask in
+	  *[123567][0-7][0-7])
+	    # POSIX mkdir -p sets u+wx bits regardless of umask, which
+	    # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
+	    ;;
+	  *)
+	    tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+	    trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
+
+	    if (umask $mkdir_umask &&
+		exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
+	    then
+	      if test -z "$dir_arg" || {
+		   # Check for POSIX incompatibilities with -m.
+		   # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+		   # other-writeable bit of parent directory when it shouldn't.
+		   # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+		   ls_ld_tmpdir=`ls -ld "$tmpdir"`
+		   case $ls_ld_tmpdir in
+		     d????-?r-*) different_mode=700;;
+		     d????-?--*) different_mode=755;;
+		     *) false;;
+		   esac &&
+		   $mkdirprog -m$different_mode -p -- "$tmpdir" && {
+		     ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
+		     test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+		   }
+		 }
+	      then posix_mkdir=:
+	      fi
+	      rmdir "$tmpdir/d" "$tmpdir"
+	    else
+	      # Remove any dirs left behind by ancient mkdir implementations.
+	      rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
+	    fi
+	    trap '' 0;;
+	esac;;
+    esac
 
-  # Make sure that the destination directory exists.
+    if
+      $posix_mkdir && (
+	umask $mkdir_umask &&
+	$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+      )
+    then :
+    else
 
-  # Skip lots of stat calls in the usual case.
-  if test ! -d "$dstdir"; then
-    defaultIFS='
-	 '
-    IFS="${IFS-$defaultIFS}"
+      # The umask is ridiculous, or mkdir does not conform to POSIX,
+      # or it failed possibly due to a race condition.  Create the
+      # directory the slow way, step by step, checking for races as we go.
 
-    oIFS=$IFS
-    # Some sh's can't handle IFS=/ for some reason.
-    IFS='%'
-    set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
-    IFS=$oIFS
+      case $dstdir in
+	/*) prefix='/';;
+	-*) prefix='./';;
+	*)  prefix='';;
+      esac
 
-    pathcomp=
+      eval "$initialize_posix_glob"
 
-    while test $# -ne 0 ; do
-      pathcomp=$pathcomp$1
+      oIFS=$IFS
+      IFS=/
+      $posix_glob set -f
+      set fnord $dstdir
       shift
-      if test ! -d "$pathcomp"; then
-        $mkdirprog "$pathcomp"
-	# mkdir can fail with a `File exist' error in case several
-	# install-sh are creating the directory concurrently.  This
-	# is OK.
-	test -d "$pathcomp" || exit
+      $posix_glob set +f
+      IFS=$oIFS
+
+      prefixes=
+
+      for d
+      do
+	test -z "$d" && continue
+
+	prefix=$prefix$d
+	if test -d "$prefix"; then
+	  prefixes=
+	else
+	  if $posix_mkdir; then
+	    (umask=$mkdir_umask &&
+	     $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+	    # Don't fail if two instances are running concurrently.
+	    test -d "$prefix" || exit 1
+	  else
+	    case $prefix in
+	      *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+	      *) qprefix=$prefix;;
+	    esac
+	    prefixes="$prefixes '$qprefix'"
+	  fi
+	fi
+	prefix=$prefix/
+      done
+
+      if test -n "$prefixes"; then
+	# Don't fail if two instances are running concurrently.
+	(umask $mkdir_umask &&
+	 eval "\$doit_exec \$mkdirprog $prefixes") ||
+	  test -d "$dstdir" || exit 1
+	obsolete_mkdir_used=true
       fi
-      pathcomp=$pathcomp/
-    done
+    fi
   fi
 
   if test -n "$dir_arg"; then
-    $doit $mkdircmd "$dst" \
-      && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \
-      && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \
-      && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \
-      && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; }
-
+    { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
+    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
+    { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
+      test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
   else
-    dstfile=`basename "$dst"`
 
     # Make a couple of temp file names in the proper directory.
     dsttmp=$dstdir/_inst.$$_
@@ -261,10 +448,9 @@ do
 
     # Trap to clean up those temp files at exit.
     trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
-    trap '(exit $?); exit' 1 2 13 15
 
     # Copy the file name to the temp name.
-    $doit $cpprog "$src" "$dsttmp" &&
+    (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
 
     # and set any options; do chmod last to preserve setuid bits.
     #
@@ -272,51 +458,63 @@ do
     # ignore errors from any of these, just make sure not to ignore
     # errors from the above "$doit $cpprog $src $dsttmp" command.
     #
-    { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
-      && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
-      && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
-      && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } &&
-
-    # Now rename the file to the real destination.
-    { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \
-      || {
-	   # The rename failed, perhaps because mv can't rename something else
-	   # to itself, or perhaps because mv is so ancient that it does not
-	   # support -f.
-
-	   # Now remove or move aside any old file at destination location.
-	   # We try this two ways since rm can't unlink itself on some
-	   # systems and the destination file might be busy for other
-	   # reasons.  In this case, the final cleanup might fail but the new
-	   # file should still install successfully.
-	   {
-	     if test -f "$dstdir/$dstfile"; then
-	       $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \
-	       || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \
-	       || {
-		 echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
-		 (exit 1); exit
-	       }
-	     else
-	       :
-	     fi
-	   } &&
-
-	   # Now rename the file to the real destination.
-	   $doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
-	 }
-    }
-  fi || { (exit 1); exit; }
+    { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
+    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
+    { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
+    { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
+
+    # If -C, don't bother to copy if it wouldn't change the file.
+    if $copy_on_change &&
+       old=`LC_ALL=C ls -dlL "$dst"	2>/dev/null` &&
+       new=`LC_ALL=C ls -dlL "$dsttmp"	2>/dev/null` &&
+
+       eval "$initialize_posix_glob" &&
+       $posix_glob set -f &&
+       set X $old && old=:$2:$4:$5:$6 &&
+       set X $new && new=:$2:$4:$5:$6 &&
+       $posix_glob set +f &&
+
+       test "$old" = "$new" &&
+       $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
+    then
+      rm -f "$dsttmp"
+    else
+      # Rename the file to the real destination.
+      $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
+
+      # The rename failed, perhaps because mv can't rename something else
+      # to itself, or perhaps because mv is so ancient that it does not
+      # support -f.
+      {
+	# Now remove or move aside any old file at destination location.
+	# We try this two ways since rm can't unlink itself on some
+	# systems and the destination file might be busy for other
+	# reasons.  In this case, the final cleanup might fail but the new
+	# file should still install successfully.
+	{
+	  test ! -f "$dst" ||
+	  $doit $rmcmd -f "$dst" 2>/dev/null ||
+	  { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
+	    { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
+	  } ||
+	  { echo "$0: cannot unlink or rename $dst" >&2
+	    (exit 1); exit 1
+	  }
+	} &&
+
+	# Now rename the file to the real destination.
+	$doit $mvcmd "$dsttmp" "$dst"
+      }
+    fi || exit 1
+
+    trap '' 0
+  fi
 done
 
-# The final little trick to "correctly" pass the exit status to the exit trap.
-{
-  (exit 0); exit
-}
-
 # Local variables:
 # eval: (add-hook 'write-file-hooks 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-end: "$"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
 # End:
diff --git a/kmerprint/Makefile.in b/kmerprint/Makefile.in
index 9040449..931e79f 100644
--- a/kmerprint/Makefile.in
+++ b/kmerprint/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.11.3 from Makefile.am.
+# Makefile.in generated by automake 1.12 from Makefile.am.
 # @configure_input@
 
 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -16,6 +16,23 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
 pkglibdir = $(libdir)/@PACKAGE@
@@ -34,7 +51,8 @@ PRE_UNINSTALL = :
 POST_UNINSTALL = :
 noinst_PROGRAMS = kmerprint$(EXEEXT)
 subdir = kmerprint
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
@@ -59,6 +77,11 @@ CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
 	-o $@
 SOURCES = $(kmerprint_SOURCES)
 DIST_SOURCES = $(kmerprint_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -292,6 +315,20 @@ GTAGS:
 	  && $(am__cd) $(top_srcdir) \
 	  && gtags -i $(GTAGS_ARGS) "$$here"
 
+cscopelist:  $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS) $(LISP)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
 distclean-tags:
 	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
@@ -431,14 +468,14 @@ uninstall-am:
 .MAKE: install-am install-strip
 
 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
-	clean-noinstPROGRAMS ctags distclean distclean-compile \
-	distclean-generic distclean-tags distdir dvi dvi-am html \
-	html-am info info-am install install-am install-data \
-	install-data-am install-dvi install-dvi-am install-exec \
-	install-exec-am install-html install-html-am install-info \
-	install-info-am install-man install-pdf install-pdf-am \
-	install-ps install-ps-am install-strip installcheck \
-	installcheck-am installdirs maintainer-clean \
+	clean-noinstPROGRAMS cscopelist ctags distclean \
+	distclean-compile distclean-generic distclean-tags distdir dvi \
+	dvi-am html html-am info info-am install install-am \
+	install-data install-data-am install-dvi install-dvi-am \
+	install-exec install-exec-am install-html install-html-am \
+	install-info install-info-am install-man install-pdf \
+	install-pdf-am install-ps install-ps-am install-strip \
+	installcheck installcheck-am installdirs maintainer-clean \
 	maintainer-clean-generic mostlyclean mostlyclean-compile \
 	mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
 	uninstall-am
diff --git a/missing b/missing
index 64b5f90..28055d2 100755
--- a/missing
+++ b/missing
@@ -1,10 +1,10 @@
 #! /bin/sh
 # Common stub for a few missing GNU programs while installing.
 
-scriptversion=2004-09-07.08
+scriptversion=2009-04-28.21; # UTC
 
-# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004
-#   Free Software Foundation, Inc.
+# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
+# 2008, 2009 Free Software Foundation, Inc.
 # Originally by Fran,cois Pinard <pinard at iro.umontreal.ca>, 1996.
 
 # This program is free software; you can redistribute it and/or modify
@@ -18,9 +18,7 @@ scriptversion=2004-09-07.08
 # GNU General Public License for more details.
 
 # You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -33,6 +31,8 @@ if test $# -eq 0; then
 fi
 
 run=:
+sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
+sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
 
 # In the cases where this matters, `missing' is being run in the
 # srcdir already.
@@ -44,7 +44,7 @@ fi
 
 msg="missing on your system"
 
-case "$1" in
+case $1 in
 --run)
   # Try to run requested program, and just exit if it succeeds.
   run=
@@ -77,6 +77,7 @@ Supported PROGRAM values:
   aclocal      touch file \`aclocal.m4'
   autoconf     touch file \`configure'
   autoheader   touch file \`config.h.in'
+  autom4te     touch the output file, or create a stub one
   automake     touch all \`Makefile.in' files
   bison        create \`y.tab.[ch]', if possible, from existing .[ch]
   flex         create \`lex.yy.c', if possible, from existing .c
@@ -86,13 +87,16 @@ Supported PROGRAM values:
   tar          try tar, gnutar, gtar, then tar without non-portable flags
   yacc         create \`y.tab.[ch]', if possible, from existing .[ch]
 
+Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and
+\`g' are ignored when checking the name.
+
 Send bug reports to <bug-automake at gnu.org>."
-    exit 0
+    exit $?
     ;;
 
   -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
     echo "missing $scriptversion (GNU Automake)"
-    exit 0
+    exit $?
     ;;
 
   -*)
@@ -103,15 +107,22 @@ Send bug reports to <bug-automake at gnu.org>."
 
 esac
 
+# normalize program name to check for.
+program=`echo "$1" | sed '
+  s/^gnu-//; t
+  s/^gnu//; t
+  s/^g//; t'`
+
 # Now exit if we have it, but it failed.  Also exit now if we
 # don't have it and --version was passed (most likely to detect
-# the program).
-case "$1" in
-  lex|yacc)
+# the program).  This is about non-GNU programs, so use $1 not
+# $program.
+case $1 in
+  lex*|yacc*)
     # Not GNU programs, they don't have --version.
     ;;
 
-  tar)
+  tar*)
     if test -n "$run"; then
        echo 1>&2 "ERROR: \`tar' requires --run"
        exit 1
@@ -135,7 +146,7 @@ esac
 
 # If it does not exist, or fails to run (possibly an outdated version),
 # try to emulate it.
-case "$1" in
+case $program in
   aclocal*)
     echo 1>&2 "\
 WARNING: \`$1' is $msg.  You should only need it if
@@ -145,7 +156,7 @@ WARNING: \`$1' is $msg.  You should only need it if
     touch aclocal.m4
     ;;
 
-  autoconf)
+  autoconf*)
     echo 1>&2 "\
 WARNING: \`$1' is $msg.  You should only need it if
          you modified \`${configure_ac}'.  You might want to install the
@@ -154,7 +165,7 @@ WARNING: \`$1' is $msg.  You should only need it if
     touch configure
     ;;
 
-  autoheader)
+  autoheader*)
     echo 1>&2 "\
 WARNING: \`$1' is $msg.  You should only need it if
          you modified \`acconfig.h' or \`${configure_ac}'.  You might want
@@ -164,7 +175,7 @@ WARNING: \`$1' is $msg.  You should only need it if
     test -z "$files" && files="config.h"
     touch_files=
     for f in $files; do
-      case "$f" in
+      case $f in
       *:*) touch_files="$touch_files "`echo "$f" |
 				       sed -e 's/^[^:]*://' -e 's/:.*//'`;;
       *) touch_files="$touch_files $f.in";;
@@ -184,7 +195,7 @@ WARNING: \`$1' is $msg.  You should only need it if
 	   while read f; do touch "$f"; done
     ;;
 
-  autom4te)
+  autom4te*)
     echo 1>&2 "\
 WARNING: \`$1' is needed, but is $msg.
          You might have modified some files without having the
@@ -192,8 +203,8 @@ WARNING: \`$1' is needed, but is $msg.
          You can get \`$1' as part of \`Autoconf' from any GNU
          archive site."
 
-    file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
-    test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
+    file=`echo "$*" | sed -n "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
     if test -f "$file"; then
 	touch $file
     else
@@ -207,80 +218,78 @@ WARNING: \`$1' is needed, but is $msg.
     fi
     ;;
 
-  bison|yacc)
+  bison*|yacc*)
     echo 1>&2 "\
 WARNING: \`$1' $msg.  You should only need it if
          you modified a \`.y' file.  You may need the \`Bison' package
          in order for those modifications to take effect.  You can get
          \`Bison' from any GNU archive site."
     rm -f y.tab.c y.tab.h
-    if [ $# -ne 1 ]; then
+    if test $# -ne 1; then
         eval LASTARG="\${$#}"
-	case "$LASTARG" in
+	case $LASTARG in
 	*.y)
 	    SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
-	    if [ -f "$SRCFILE" ]; then
+	    if test -f "$SRCFILE"; then
 	         cp "$SRCFILE" y.tab.c
 	    fi
 	    SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
-	    if [ -f "$SRCFILE" ]; then
+	    if test -f "$SRCFILE"; then
 	         cp "$SRCFILE" y.tab.h
 	    fi
 	  ;;
 	esac
     fi
-    if [ ! -f y.tab.h ]; then
+    if test ! -f y.tab.h; then
 	echo >y.tab.h
     fi
-    if [ ! -f y.tab.c ]; then
+    if test ! -f y.tab.c; then
 	echo 'main() { return 0; }' >y.tab.c
     fi
     ;;
 
-  lex|flex)
+  lex*|flex*)
     echo 1>&2 "\
 WARNING: \`$1' is $msg.  You should only need it if
          you modified a \`.l' file.  You may need the \`Flex' package
          in order for those modifications to take effect.  You can get
          \`Flex' from any GNU archive site."
     rm -f lex.yy.c
-    if [ $# -ne 1 ]; then
+    if test $# -ne 1; then
         eval LASTARG="\${$#}"
-	case "$LASTARG" in
+	case $LASTARG in
 	*.l)
 	    SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
-	    if [ -f "$SRCFILE" ]; then
+	    if test -f "$SRCFILE"; then
 	         cp "$SRCFILE" lex.yy.c
 	    fi
 	  ;;
 	esac
     fi
-    if [ ! -f lex.yy.c ]; then
+    if test ! -f lex.yy.c; then
 	echo 'main() { return 0; }' >lex.yy.c
     fi
     ;;
 
-  help2man)
+  help2man*)
     echo 1>&2 "\
 WARNING: \`$1' is $msg.  You should only need it if
 	 you modified a dependency of a manual page.  You may need the
 	 \`Help2man' package in order for those modifications to take
 	 effect.  You can get \`Help2man' from any GNU archive site."
 
-    file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
-    if test -z "$file"; then
-	file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
-    fi
-    if [ -f "$file" ]; then
+    file=`echo "$*" | sed -n "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+    if test -f "$file"; then
 	touch $file
     else
 	test -z "$file" || exec >$file
 	echo ".ab help2man is required to generate this page"
-	exit 1
+	exit $?
     fi
     ;;
 
-  makeinfo)
+  makeinfo*)
     echo 1>&2 "\
 WARNING: \`$1' is $msg.  You should only need it if
          you modified a \`.texi' or \`.texinfo' file, or any other file
@@ -288,15 +297,28 @@ WARNING: \`$1' is $msg.  You should only need it if
          call might also be the consequence of using a buggy \`make' (AIX,
          DU, IRIX).  You might want to install the \`Texinfo' package or
          the \`GNU make' package.  Grab either from any GNU archive site."
-    file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
+    # The file to touch is that specified with -o ...
+    file=`echo "$*" | sed -n "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
     if test -z "$file"; then
-      file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
-      file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
+      # ... or it is the one specified with @setfilename ...
+      infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
+      file=`sed -n '
+	/^@setfilename/{
+	  s/.* \([^ ]*\) *$/\1/
+	  p
+	  q
+	}' $infile`
+      # ... or it is derived from the source name (dir/f.texi becomes f.info)
+      test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
     fi
+    # If the file does not exist, the user really needs makeinfo;
+    # let's fail without touching anything.
+    test -f $file || exit 1
     touch $file
     ;;
 
-  tar)
+  tar*)
     shift
 
     # We have already tried tar in the generic part.
@@ -310,13 +332,13 @@ WARNING: \`$1' is $msg.  You should only need it if
     fi
     firstarg="$1"
     if shift; then
-	case "$firstarg" in
+	case $firstarg in
 	*o*)
 	    firstarg=`echo "$firstarg" | sed s/o//`
 	    tar "$firstarg" "$@" && exit 0
 	    ;;
 	esac
-	case "$firstarg" in
+	case $firstarg in
 	*h*)
 	    firstarg=`echo "$firstarg" | sed s/h//`
 	    tar "$firstarg" "$@" && exit 0
@@ -349,5 +371,6 @@ exit 0
 # eval: (add-hook 'write-file-hooks 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-end: "$"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
 # End:

-- 
Packaging of abyss in Debian



More information about the debian-med-commit mailing list