Skip to content

Commit

Permalink
minigraph-chain code-base
Browse files Browse the repository at this point in the history
  • Loading branch information
gsc74 committed Jul 14, 2022
1 parent 886f091 commit 20aca28
Show file tree
Hide file tree
Showing 13 changed files with 1,440 additions and 17 deletions.
20 changes: 10 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,35 +1,34 @@
CC= gcc
CFLAGS= -g -Wall -Wc++-compat -std=c99 -msse4 -O3
CPPFLAGS=
CXX= g++
CPPFLAGS= -g -Wall -std=c++2a -march=native -O3 -w
INCLUDES=
OBJS= kalloc.o kthread.o algo.o sys.o gfa-base.o gfa-io.o gfa-aug.o gfa-bbl.o gfa-ed.o \
sketch.o misc.o bseq.o options.o shortk.o miniwfa.o \
index.o lchain.o gchain1.o galign.o gcmisc.o map-algo.o cal_cov.o \
format.o gmap.o ggsimple.o ggen.o asm-call.o
format.o gmap.o ggsimple.o ggen.o asm-call.o graphUtils.o
PROG= minigraph
LIBS= -lz -lpthread -lm
LIBS= -lz -lpthread -lm -fopenmp

ifneq ($(asan),)
CFLAGS+=-fsanitize=address
CPPFLAGS+=-fsanitize=address
LIBS+=-fsanitize=address -ldl
endif

.SUFFIXES:.c .o
.PHONY:all clean depend

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

all:$(PROG)

minigraph:$(OBJS) main.o
$(CC) $(CFLAGS) $^ -o $@ $(LIBS)
$(CXX) $(CPPFLAGS) $^ -o $@ $(LIBS)

clean:
rm -fr gmon.out *.o a.out $(PROG) *~ *.a *.dSYM

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

# DO NOT DELETE

Expand Down Expand Up @@ -57,10 +56,11 @@ kalloc.o: kalloc.h
kthread.o: kthread.h
lchain.o: mgpriv.h minigraph.h gfa.h kalloc.h krmq.h
main.o: mgpriv.h minigraph.h gfa.h gfa-priv.h sys.h ketopt.h
map-algo.o: kalloc.h mgpriv.h minigraph.h gfa.h khashl.h ksort.h
map-algo.o: kalloc.h mgpriv.h minigraph.h gfa.h khashl.h ksort.h graphUtils.h
miniwfa.o: miniwfa.h kalloc.h
misc.o: mgpriv.h minigraph.h gfa.h ksort.h
options.o: mgpriv.h minigraph.h gfa.h sys.h
shortk.o: mgpriv.h minigraph.h gfa.h ksort.h kavl.h algo.h khashl.h kalloc.h
sketch.o: kvec-km.h kalloc.h mgpriv.h minigraph.h gfa.h
sys.o: sys.h
graphUtils.o: graphUtils.h
1 change: 1 addition & 0 deletions gfa-aug.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ void gfa_augment(gfa_t *g, int32_t n_ins, const gfa_ins_t *ins, int32_t n_ctg, c
static int32_t gfa_ins_shrink_semi(const gfa_t *g, int32_t pen, uint32_t v, int32_t voff, int32_t coff, uint32_t vv, int32_t vend, int32_t cend, const char *seq)
{
int32_t i, j, l, dir, score, max, max_l;
extern unsigned char gfa_comp_table[256];
if (cend == coff) return 0;
dir = cend > coff? +1 : -1;
for (i = coff, j = voff, l = max_l = 0, score = max = 0; i != cend; i += dir, j += dir) {
Expand Down
1 change: 1 addition & 0 deletions gfa-bbl.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ typedef struct {
static void bb_write_seq(const gfa_t *g, int32_t n, const uint32_t *v, int32_t l_seq, char *seq)
{
int32_t k, l;
extern unsigned char gfa_comp_table[256];
for (k = n - 1, l = 0; k >= 0; --k) {
const gfa_seg_t *s = &g->seg[v[k]>>1];
if (v[k]&1) {
Expand Down
1 change: 1 addition & 0 deletions gfa-ed.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ void gfa_edopt_init(gfa_edopt_t *opt)

gfa_edseq_t *gfa_edseq_init(const gfa_t *g)
{
extern unsigned char gfa_comp_table[256];
uint32_t i, n_vtx = gfa_n_vtx(g);
gfa_edseq_t *es;
GFA_MALLOC(es, n_vtx);
Expand Down
2 changes: 1 addition & 1 deletion gfa.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ typedef struct {
} gfa_ins_t;

extern int gfa_verbose;
extern unsigned char gfa_comp_table[256];
// extern unsigned char gfa_comp_table[256];

#ifdef __cplusplus
extern "C" {
Expand Down
Loading

0 comments on commit 20aca28

Please sign in to comment.