Skip to content

Commit

Permalink
minimap2 incorporated
Browse files Browse the repository at this point in the history
  • Loading branch information
mikolmogorov committed Nov 29, 2017
1 parent d97737f commit d1e423e
Show file tree
Hide file tree
Showing 88 changed files with 16,001 additions and 30 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
bin/abruijn-assemble
bin/abruijn-polish
bin/abruijn-repeat
bin/abruijn-minimap2
bin/blasr
build
lib/lemon-1.3.1/build
lib/lemon-1.3.1/install
lib/blasr_install/*
31 changes: 21 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,21 +1,32 @@
export COMMON = -I$(shell pwd)/src/include
export LIBCUCKOO = -I$(shell pwd)/lib/libcuckoo
export INTERVAL_TREE = -I$(shell pwd)/lib/interval_tree
export LEMON = -I$(shell pwd)/lib/lemon
export BIN_DIR = $(shell pwd)/bin
ROOT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))

export COMMON = -I${ROOT_DIR}/src/include
export LIBCUCKOO = -I${ROOT_DIR}/lib/libcuckoo
export INTERVAL_TREE = -I${ROOT_DIR}/lib/interval_tree
export LEMON = -I${ROOT_DIR}/lib/lemon
export BIN_DIR = ${ROOT_DIR}/bin
export MINIMAP2_DIR = ${ROOT_DIR}/lib/minimap2

export CXXFLAGS = ${LIBCUCKOO} ${INTERVAL_TREE} ${LEMON} ${COMMON}
#export LDFLAGS =

.PHONY: clean all profile debug
.PHONY: clean all profile debug minimap2

.DEFAULT_GOAL := all

all:

${BIN_DIR}/abruijn-minimap2:
make -C ${MINIMAP2_DIR}
cp ${MINIMAP2_DIR}/minimap2 ${BIN_DIR}/abruijn-minimap2

minimap2: ${BIN_DIR}/abruijn-minimap2

all: minimap2
make release -C src
profile:
profile: minimap2
make profile -C src
debug:
debug: minimap2
make debug -C src
clean:
clean:
make clean -C src
make clean -C ${MINIMAP2_DIR}
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ step, which improves the structural accuracy of the resulting sequence.
The algorithm also produces a graph representation of the final assembly.

ABruijn has moderate memory requirements and is designed to run on a single node.
Typically, assembly of a bacteria with 50x coverage takes less than half an hour
on a modern desktop and yeast assembly takes about 2 hours. A metagenome of total size 200 Mbp
can be assembled within a day on using 70Gb of memory and 20 CPUs.
Typically, assembly of a bacteria or yeast assembly takes less than half an hour
on a modern desktop. A whole human genome with 30x coverage could be assembled
within a week on a node with 32 CPUs and 800Gb RAM.

Install
-------
Expand All @@ -41,7 +41,7 @@ ABruijn package includes some third-party software:
* libcuckoo [http://github.com/efficient/libcuckoo]
* intervaltree [https://github.com/ekg/intervaltree]
* lemon [http://lemon.cs.elte.hu/trac/lemon]
* BLASR [https://github.com/PacificBiosciences/blasr]
* minimap2 [https://github.com/lh3/minimap2]


License
Expand Down
2 changes: 1 addition & 1 deletion abruijn/alignment.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@


logger = logging.getLogger()
MINIMAP_BIN = "minimap2"
MINIMAP_BIN = "abruijn-minimap2"

Alignment = namedtuple("Alignment", ["qry_id", "trg_id", "qry_start", "qry_end",
"qry_sign", "qry_len", "trg_start",
Expand Down
12 changes: 2 additions & 10 deletions docs/INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,7 @@ Requirements
* GNU make
* Python 2.7
* Git
* BLASR aligner [https://github.com/PacificBiosciences/blasr]


BLASR installation
------------------

You can use 'install\_blasr.py' script for a local BLASR installation. You may skip
this step if BLASR is already installed in your system.
* Basic OS development headers (zlib, etc.)


ABruijn Installation
Expand All @@ -42,5 +35,4 @@ Additonally, you may install the package for the better OS integration:
python setup.py install

Alternatively, you can perform local user installation by adding '--user' or '--prefix'
options to the previous command. The system installation does not include BLASR, which
should be installed separately.
options to the previous command.
2 changes: 1 addition & 1 deletion docs/USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ as follows:
Finally, ABruijn performs polishing of the resulting assembly
to correct the remaining errors:

* Alignment of all reads to the current assembly using BLASR
* Alignment of all reads to the current assembly using minimap2
* Selection of solid regions
* Partition the total alignment of all reads into mini-alignments (bubbles)
* Error correction of each bubble using a maximum likelihood approach
Expand Down
8 changes: 8 additions & 0 deletions lib/minimap2/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.cproject
.project
.*.swp
*.a
*.o
*.dSYM
minimap2
mappy.c
24 changes: 24 additions & 0 deletions lib/minimap2/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
matrix:
include:
- language: c
compiler: gcc
script: make
- language: c
compiler: clang
script: make
- language: python
python: "2.7"
before_install: pip install cython
script: python setup.py build_ext
- language: python
python: "3.3"
before_install: pip install cython
script: python setup.py build_ext
- language: python
python: "3.5"
before_install: pip install cython
script: python setup.py build_ext
- language: python
python: "3.6"
before_install: pip install cython
script: python setup.py build_ext
23 changes: 23 additions & 0 deletions lib/minimap2/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
The MIT License

Copyright (c) 2017 Broad Institute, 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.
11 changes: 11 additions & 0 deletions lib/minimap2/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
include *.h
include Makefile
include ksw2_dispatch.c
include getopt.c
include main.c
include README.md
include python/mappy.c
include python/cmappy.h
include python/cmappy.pxd
include python/mappy.pyx
include python/README.rst
83 changes: 83 additions & 0 deletions lib/minimap2/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
CFLAGS= -g -Wall -O2 -Wc++-compat
CPPFLAGS= -DHAVE_KALLOC
INCLUDES=
OBJS= kthread.o kalloc.o misc.o bseq.o sketch.o sdust.o index.o chain.o align.o hit.o map.o format.o pe.o ksw2_ll_sse.o
PROG= minimap2
PROG_EXTRA= sdust minimap2-lite
LIBS= -lm -lz -lpthread

ifeq ($(sse2only),)
OBJS+=ksw2_extz2_sse41.o ksw2_extd2_sse41.o ksw2_exts2_sse41.o ksw2_extz2_sse2.o ksw2_extd2_sse2.o ksw2_exts2_sse2.o ksw2_dispatch.o
else
OBJS+=ksw2_extz2_sse.o ksw2_extd2_sse.o ksw2_exts2_sse.o
endif

.SUFFIXES:.c .o

.c.o:
$(CC) -c $(CFLAGS) $(CPPFLAGS) $(INCLUDES) $< -o $@

all:$(PROG)

extra:all $(PROG_EXTRA)

minimap2:main.o getopt.o libminimap2.a
$(CC) $(CFLAGS) main.o getopt.o -o $@ -L. -lminimap2 $(LIBS)

minimap2-lite:example.o libminimap2.a
$(CC) $(CFLAGS) $< -o $@ -L. -lminimap2 $(LIBS)

libminimap2.a:$(OBJS)
$(AR) -csru $@ $(OBJS)

sdust:sdust.c getopt.o kalloc.o kalloc.h kdq.h kvec.h kseq.h sdust.h
$(CC) -D_SDUST_MAIN $(CFLAGS) $< getopt.o kalloc.o -o $@ -lz

ksw2_extz2_sse41.o:ksw2_extz2_sse.c ksw2.h kalloc.h
$(CC) -c -msse4 $(CFLAGS) $(CPPFLAGS) -DKSW_CPU_DISPATCH $(INCLUDES) $< -o $@

ksw2_extz2_sse2.o:ksw2_extz2_sse.c ksw2.h kalloc.h
$(CC) -c $(CFLAGS) $(CPPFLAGS) -DKSW_CPU_DISPATCH -DKSW_SSE2_ONLY $(INCLUDES) $< -o $@

ksw2_extd2_sse41.o:ksw2_extd2_sse.c ksw2.h kalloc.h
$(CC) -c -msse4 $(CFLAGS) $(CPPFLAGS) -DKSW_CPU_DISPATCH $(INCLUDES) $< -o $@

ksw2_extd2_sse2.o:ksw2_extd2_sse.c ksw2.h kalloc.h
$(CC) -c $(CFLAGS) $(CPPFLAGS) -DKSW_CPU_DISPATCH -DKSW_SSE2_ONLY $(INCLUDES) $< -o $@

ksw2_exts2_sse41.o:ksw2_exts2_sse.c ksw2.h kalloc.h
$(CC) -c -msse4 $(CFLAGS) $(CPPFLAGS) -DKSW_CPU_DISPATCH $(INCLUDES) $< -o $@

ksw2_exts2_sse2.o:ksw2_exts2_sse.c ksw2.h kalloc.h
$(CC) -c $(CFLAGS) $(CPPFLAGS) -DKSW_CPU_DISPATCH -DKSW_SSE2_ONLY $(INCLUDES) $< -o $@

ksw2_dispatch.o:ksw2_dispatch.c ksw2.h
$(CC) -c $(CFLAGS) $(CPPFLAGS) -DKSW_CPU_DISPATCH $(INCLUDES) $< -o $@

clean:
rm -fr gmon.out *.o a.out $(PROG) $(PROG_EXTRA) *~ *.a *.dSYM build dist mappy.so mappy.c python/mappy.c mappy.egg*

depend:
(LC_ALL=C; export LC_ALL; makedepend -Y -- $(CFLAGS) $(CPPFLAGS) -- *.c)

# DO NOT DELETE

align.o: minimap.h mmpriv.h bseq.h ksw2.h kalloc.h
bseq.o: bseq.h kvec.h kalloc.h kseq.h
chain.o: minimap.h mmpriv.h bseq.h kalloc.h
example.o: minimap.h kseq.h
format.o: kalloc.h mmpriv.h minimap.h bseq.h
getopt.o: getopt.h
hit.o: mmpriv.h minimap.h bseq.h kalloc.h khash.h
index.o: kthread.h bseq.h minimap.h mmpriv.h kvec.h kalloc.h khash.h
kalloc.o: kalloc.h
ksw2_extd2_sse.o: ksw2.h kalloc.h
ksw2_exts2_sse.o: ksw2.h kalloc.h
ksw2_extz2_sse.o: ksw2.h kalloc.h
ksw2_ll_sse.o: ksw2.h kalloc.h
main.o: bseq.h minimap.h mmpriv.h getopt.h
map.o: kthread.h kvec.h kalloc.h sdust.h mmpriv.h minimap.h bseq.h khash.h
misc.o: minimap.h ksort.h
pe.o: mmpriv.h minimap.h bseq.h kvec.h kalloc.h ksort.h
sdust.o: kalloc.h kdq.h kvec.h sdust.h
sketch.o: kvec.h kalloc.h minimap.h
Loading

0 comments on commit d1e423e

Please sign in to comment.