Skip to content

Commit

Permalink
Merge branch 'master' into glenn
Browse files Browse the repository at this point in the history
  • Loading branch information
glennhickey authored Dec 4, 2019
2 parents cda652b + c8e6f9f commit 08a4572
Show file tree
Hide file tree
Showing 68 changed files with 4,630 additions and 2,067 deletions.
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,6 @@
[submodule "deps/mmmultimap"]
path = deps/mmmultimap
url = https://github.com/ekg/mmmultimap.git
[submodule "deps/BBHash"]
[submodule "vgteam_bbhash"]
path = deps/BBHash
url = https://github.com/rizkg/BBHash.git
url = https://github.com/vgteam/BBHash.git
26 changes: 15 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -376,13 +376,15 @@ test/build_graph: test/build_graph.cpp $(LIB_DIR)/libvg.a $(SRC_DIR)/json2pb.h $
$(LIB_DIR)/libjemalloc.a: $(JEMALLOC_DIR)/src/*.c
+. ./source_me.sh && cd $(JEMALLOC_DIR) && ./autogen.sh && ./configure --disable-libdl --prefix=`pwd` $(FILTER) && $(MAKE) $(FILTER) && cp -r lib/* $(CWD)/$(LIB_DIR)/ && cp -r include/* $(CWD)/$(INC_DIR)/

$(LIB_DIR)/libsdsl.a: $(SDSL_DIR)/lib/*.cpp $(SDSL_DIR)/include/sdsl/*.hpp
# Use fake patterns to tell Make that this rule generates all these files when run once.
# Here % should always match "lib" which is a common substring.
# See https://stackoverflow.com/a/19822767
$(LIB_DIR)/%sdsl.a $(LIB_DIR)/%divsufsort.a $(LIB_DIR)/%divsufsort64.a : $(SDSL_DIR)/lib/*.cpp $(SDSL_DIR)/include/sdsl/*.hpp
ifeq ($(shell uname -s),Darwin)
+. ./source_me.sh && cd $(SDSL_DIR) && AS_INTEGRATED_ASSEMBLER=1 BUILD_PORTABLE=1 ./install.sh $(CWD) $(FILTER)
else
+. ./source_me.sh && cd $(SDSL_DIR) && BUILD_PORTABLE=1 ./install.sh $(CWD) $(FILTER)
endif

endif

$(LIB_DIR)/libssw.a: $(SSW_DIR)/*.c $(SSW_DIR)/*.h
+. ./source_me.sh && cd $(SSW_DIR) && $(MAKE) $(FILTER) && ar rs $(CWD)/$(LIB_DIR)/libssw.a ssw.o ssw_cpp.o && cp ssw_cpp.h ssw.h $(CWD)/$(LIB_DIR)
Expand All @@ -397,7 +399,7 @@ $(LIB_DIR)/librocksdb.a: $(LIB_DIR)/libsnappy.a $(ROCKSDB_DIR)/db/*.cc $(ROCKSDB

$(INC_DIR)/gcsa/gcsa.h: $(LIB_DIR)/libgcsa2.a

$(LIB_DIR)/libgcsa2.a: $(LIB_DIR)/libsdsl.a $(wildcard $(GCSA2_DIR)/*.cpp) $(wildcard $(GCSA2_DIR)/include/gcsa/*.h)
$(LIB_DIR)/libgcsa2.a: $(LIB_DIR)/libsdsl.a $(LIB_DIR)/libdivsufsort.a $(LIB_DIR)/libdivsufsort64.a $(wildcard $(GCSA2_DIR)/*.cpp) $(wildcard $(GCSA2_DIR)/include/gcsa/*.h)
ifeq ($(shell uname -s),Darwin)
+. ./source_me.sh && cp -r $(GCSA2_DIR)/include/gcsa $(CWD)/$(INC_DIR)/ && cd $(GCSA2_DIR) && AS_INTEGRATED_ASSEMBLER=1 $(MAKE) libgcsa2.a $(FILTER) && mv libgcsa2.a $(CWD)/$(LIB_DIR)
else
Expand All @@ -406,7 +408,7 @@ endif

$(INC_DIR)/gbwt/dynamic_gbwt.h: $(LIB_DIR)/libgbwt.a

$(LIB_DIR)/libgbwt.a: $(LIB_DIR)/libsdsl.a $(wildcard $(GBWT_DIR)/*.cpp) $(wildcard $(GBWT_DIR)/include/gbwt/*.h)
$(LIB_DIR)/libgbwt.a: $(LIB_DIR)/libsdsl.a $(LIB_DIR)/libdivsufsort.a $(LIB_DIR)/libdivsufsort64.a $(wildcard $(GBWT_DIR)/*.cpp) $(wildcard $(GBWT_DIR)/include/gbwt/*.h)
ifeq ($(shell uname -s),Darwin)
+. ./source_me.sh && cp -r $(GBWT_DIR)/include/gbwt $(CWD)/$(INC_DIR)/ && cd $(GBWT_DIR) && AS_INTEGRATED_ASSEMBLER=1 $(MAKE) $(FILTER) && mv libgbwt.a $(CWD)/$(LIB_DIR)
else
Expand All @@ -415,7 +417,7 @@ endif

$(INC_DIR)/gbwtgraph/gbwtgraph.h: $(LIB_DIR)/libgbwtgraph.a

$(LIB_DIR)/libgbwtgraph.a: $(LIB_DIR)/libgbwt.a $(LIB_DIR)/libsdsl.a $(LIB_DIR)/libhandlegraph.a $(wildcard $(GBWTGRAPH_DIR)/*.cpp) $(wildcard $(GBWTGRAPH_DIR)/include/gbwtgraph/*.h)
$(LIB_DIR)/libgbwtgraph.a: $(LIB_DIR)/libgbwt.a $(LIB_DIR)/libsdsl.a $(LIB_DIR)/libdivsufsort.a $(LIB_DIR)/libdivsufsort64.a $(LIB_DIR)/libhandlegraph.a $(wildcard $(GBWTGRAPH_DIR)/*.cpp) $(wildcard $(GBWTGRAPH_DIR)/include/gbwtgraph/*.h)
ifeq ($(shell uname -s),Darwin)
+. ./source_me.sh && cp -r $(GBWTGRAPH_DIR)/include/gbwtgraph $(CWD)/$(INC_DIR)/ && cd $(GBWTGRAPH_DIR) && AS_INTEGRATED_ASSEMBLER=1 $(MAKE) $(FILTER) && mv libgbwtgraph.a $(CWD)/$(LIB_DIR)
else
Expand Down Expand Up @@ -497,9 +499,11 @@ $(INC_DIR)/lru_cache.h: $(DEP_DIR)/lru_cache/*.h $(DEP_DIR)/lru_cache/*.cc
# We moved the Dynamic headers so make sure to clean up the old ones.
$(INC_DIR)/dynamic/dynamic.hpp: $(DYNAMIC_DIR)/include/*.hpp $(DYNAMIC_DIR)/include/internal/*.hpp
rm -Rf $(INC_DIR)/dynamic.hpp $(INC_DIR)/dynamic
mkdir -p $(INC_DIR)/dynamic && cp -r $(CWD)/$(DYNAMIC_DIR)/include/* $(INC_DIR)/dynamic
# annoyingly doesn't have an install option on the cmake, so we manually move their external dependency headers
cd $(CWD)/$(DYNAMIC_DIR) && mkdir -p build && cd build && cmake .. && make && cp -r hopscotch_map-prefix/src/hopscotch_map/include/* $(CWD)/$(INC_DIR)/dynamic
cd $(CWD)/$(DYNAMIC_DIR) && rm -Rf build && mkdir -p build && cd build && cmake .. && make && cp -r hopscotch_map-prefix/src/hopscotch_map/include/* $(CWD)/$(INC_DIR)/
# Do the copy of the main file last so we can tell if this recipe failed and redo it.
# Otherwise we get dynamic.hpp without its deps
mkdir -p $(INC_DIR)/dynamic && cp -r $(CWD)/$(DYNAMIC_DIR)/include/* $(INC_DIR)/dynamic

$(INC_DIR)/sparsehash/sparse_hash_map: $(wildcard $(SPARSEHASH_DIR)/**/*.cc) $(wildcard $(SPARSEHASH_DIR)/**/*.h)
+. ./source_me.sh && cd $(SPARSEHASH_DIR) && ./autogen.sh && LDFLAGS="-L/opt/local/lib" ./configure --prefix=$(CWD) $(FILTER) && $(MAKE) $(FILTER) && $(MAKE) install
Expand Down Expand Up @@ -614,8 +618,8 @@ $(LIB_DIR)/libfml.a: $(FERMI_DIR)/*.h $(FERMI_DIR)/*.c
$(LIB_DIR)/libsublinearLS.a: $(LINLS_DIR)/src/*.cpp $(LINLS_DIR)/src/*.hpp $(LIB_DIR)/libhts.a
. ./source_me.sh && cd $(LINLS_DIR) && $(MAKE) clean && INCLUDE_FLAGS="-I$(CWD)/$(INC_DIR)" $(MAKE) libs $(FILTER) && cp lib/libsublinearLS.a $(CWD)/$(LIB_DIR)/ && mkdir -p $(CWD)/$(INC_DIR)/sublinearLS && cp src/*.hpp $(CWD)/$(INC_DIR)/sublinearLS/

$(LIB_DIR)/libbdsg.a: $(INC_DIR)/BooPHF.h $(LIBBDSG_DIR)/src/*.cpp $(LIBBDSG_DIR)/include/bdsg/*.hpp $(LIB_DIR)/libhandlegraph.a $(LIB_DIR)/libsdsl.a $(INC_DIR)/sparsepp/spp.h $(INC_DIR)/dynamic/dynamic.hpp
+. ./source_me.sh && cd $(LIBBDSG_DIR) && $(MAKE) clean && CPLUS_INCLUDE_PATH=$(CWD)/$(INC_DIR):$(CWD)/$(INC_DIR)/dynamic:$(CPLUS_INCLUDE_PATH) $(MAKE) $(FILTER) && cp lib/libbdsg.a $(CWD)/$(LIB_DIR) && pwd && cp -r include/bdsg $(CWD)/$(INC_DIR)
$(LIB_DIR)/libbdsg.a: $(INC_DIR)/BooPHF.h $(LIBBDSG_DIR)/src/*.cpp $(LIBBDSG_DIR)/include/bdsg/*.hpp $(LIB_DIR)/libhandlegraph.a $(LIB_DIR)/libsdsl.a $(LIB_DIR)/libdivsufsort.a $(LIB_DIR)/libdivsufsort64.a $(INC_DIR)/sparsepp/spp.h $(INC_DIR)/dynamic/dynamic.hpp
+. ./source_me.sh && rm -Rf $(CWD)/$(INC_DIR)/bdsg && cd $(LIBBDSG_DIR) && $(MAKE) clean && CPLUS_INCLUDE_PATH=$(CWD)/$(INC_DIR):$(CWD)/$(INC_DIR)/dynamic:$(CPLUS_INCLUDE_PATH) CXXFLAGS="$(INCLUDE_FLAGS) $(CXXFLAGS)" $(MAKE) $(FILTER) && cp lib/libbdsg.a $(CWD)/$(LIB_DIR) && pwd && cp -r include/bdsg $(CWD)/$(INC_DIR)

$(INC_DIR)/mmmultiset.hpp: $(MMMULTIMAP_DIR)/src/mmmultiset.hpp $(INC_DIR)/mmmultimap.hpp
$(INC_DIR)/mmmultimap.hpp: $(MMMULTIMAP_DIR)/src/mmmultimap.hpp $(MMMULTIMAP_DIR)/src/mmmultiset.hpp
Expand All @@ -626,7 +630,7 @@ $(INC_DIR)/ips4o.hpp: $(IPS4O_DIR)/ips4o.hpp $(IPS4O_DIR)/ips4o/*

# The xg repo has a cmake build system based all around external projects, and
# we need it to use our installed versions of everything instead.
$(LIB_DIR)/libxg.a: $(XG_DIR)/src/*.hpp $(XG_DIR)/src/*.cpp $(INC_DIR)/mmmultimap.hpp $(INC_DIR)/ips4o.hpp $(INC_DIR)/gfakluge.hpp $(LIB_DIR)/libhandlegraph.a $(LIB_DIR)/libsdsl.a
$(LIB_DIR)/libxg.a: $(XG_DIR)/src/*.hpp $(XG_DIR)/src/*.cpp $(INC_DIR)/mmmultimap.hpp $(INC_DIR)/ips4o.hpp $(INC_DIR)/gfakluge.hpp $(LIB_DIR)/libhandlegraph.a $(LIB_DIR)/libsdsl.a $(LIB_DIR)/libdivsufsort.a $(LIB_DIR)/libdivsufsort64.a
+rm -f $@
+cp -r $(XG_DIR)/src/*.hpp $(CWD)/$(INC_DIR)
+. ./source_me.sh && $(CXX) $(INCLUDE_FLAGS) $(CXXFLAGS) -c -o $(XG_DIR)/xg.o $(XG_DIR)/src/xg.cpp $(FILTER)
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,11 +224,12 @@ Variation from alignments can be embedded back into the graph. This process is

```sh
# augment the graph with all variation from the GAM except that implied by soft clips, saving to aug.vg. aug.gam contains the same reads as aln.gam but mapped to aug.vg
vg augment x.vg aln.gam -C -A aug.gam > aug.vg
vg augment x.vg aln.gam -A aug.gam > aug.vg

# augment the graph with all variation from the GAM, saving each mapping as a path in the graph.
# softclips of alignment paths are preserved (`-S`).
# Note, this can be much less efficient than the above example if there are many alignments in the GAM
vg augment x.vg aln.gam -i > aug_with_paths.vg
vg augment x.vg aln.gam -i -S > aug_with_paths.vg
```

### Variant Calling
Expand All @@ -247,7 +248,7 @@ vg pack -x x.xg -g aln.gam -Q 5 -o aln.pack
vg call x.xg -k aln.pack > graph_calls.vcf
```

In order to also consider *novel* variants from the reads, use the augmented graph and gam (as created in the previous example using `vg augment -C -A`):
In order to also consider *novel* variants from the reads, use the augmented graph and gam (as created in the previous example using `vg augment -A`):

```sh
# Index our augmented graph
Expand Down
2 changes: 1 addition & 1 deletion deps/BBHash
2 changes: 1 addition & 1 deletion deps/libbdsg
2 changes: 1 addition & 1 deletion deps/libhandlegraph
2 changes: 1 addition & 1 deletion deps/libvgio
2 changes: 1 addition & 1 deletion deps/xg
Submodule xg updated 1 files
+1 −1 CMakeLists.txt
48 changes: 46 additions & 2 deletions ontology/vg.html
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,13 @@
</tr>
<tr><td><a href="#Properties">
Properties (
7
8
)
</a></td></tr>
<tr>
<td><a style="objectPropertySearch" href="#ObjectProperties">
Object properties (
6
7
)
</a></td>
<td><select onChange="window.location.hash = document.getElementById('navi3').value" id="navi3"><option value="linksForwardToForward">
Expand All @@ -163,6 +163,8 @@
vg:linksReverseToReverse</option>
<option value="node">
vg:node</option>
<option value="position">
vg:position</option>
<option value="reverseOfNode">
vg:reverseOfNode</option></select></td>
</tr>
Expand Down Expand Up @@ -829,9 +831,51 @@ <h3 id="ObjectProperties">Object properties</h3>
<tr>
<td><a href="http://www.w3.org/2000/01/rdf-schema#range">
rdfs:range</a></td>
<td><a href="http://biohackathon.org/resource/vg#Node">
vg:Node</a></td>
</tr>
</tbody>
</table>
<table class="subsection">
<a name="http://biohackathon.org/resource/vg#position"></a><tbody>
<tr><th id="position">
vg:position<span class="cp-type">
(rdf:type
<a href="http://www.w3.org/2002/07/owl#ObjectProperty">
owl:ObjectProperty</a>
)
</span>
</th></tr>
<tr>
<td><a href="http://www.w3.org/2000/01/rdf-schema#comment">
rdfs:comment</a></td>
<td>
"This is the position on the reference path at which this step starts."
<sup><a href=".">
xsd:string</a></sup>
</td>
</tr>
<tr>
<td><a href="http://www.w3.org/2000/01/rdf-schema#domain">
rdfs:domain</a></td>
<td><a href="http://biohackathon.org/resource/vg#Step">
vg:Step</a></td>
</tr>
<tr>
<td><a href="http://www.w3.org/2000/01/rdf-schema#label">
rdfs:label</a></td>
<td>
"position"
<sup><a href=".">
xsd:string</a></sup>
</td>
</tr>
<tr>
<td><a href="http://www.w3.org/2000/01/rdf-schema#range">
rdfs:range</a></td>
<td><a href="http://www.w3.org/2001/XMLSchema#positiveInteger">
xsd:positiveInteger</a></td>
</tr>
</tbody>
</table>
<table class="subsection">
Expand Down
10 changes: 9 additions & 1 deletion ontology/vg.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,16 @@
rdfs:comment "This means that this step occurs on the forward strand of the sequence attaced to the node (i.e. it is on the explicit encoded forward (5' to 3') strand) of the predicate node."^^xsd:string ;
rdfs:domain :Step ;
rdfs:label "node"^^xsd:string ;
rdfs:range :Step ;
rdfs:range :Node ;
.

:position
rdf:type owl:ObjectProperty ;
rdfs:comment "This is the position on the reference path at which this step starts."^^xsd:string ;
rdfs:domain :Step ;
rdfs:label "position"^^xsd:string ;
rdfs:range xsd:positiveInteger .

:rank
rdf:type owl:DatatypeProperty ;
rdfs:comment "The rank records the step place along its path."^^xsd:string ;
Expand Down
Loading

0 comments on commit 08a4572

Please sign in to comment.