Skip to content

Commit

Permalink
set refillhaps as 2 in default
Browse files Browse the repository at this point in the history
  • Loading branch information
Zilong-Li committed Jul 17, 2024
1 parent 5c567de commit 081f6e4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
15 changes: 8 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,29 @@ CXX = g++
CXXFLAGS = -std=c++17 -Wall -O3 -DNDEBUG
INC = -I./src -I./inst/include -I$(HTSDIR)
LDFLAGS = -L$(HTSDIR) -Wl,-rpath,$(HTSDIR)
LIBS = $(HTSDIR)/libhts.a -llzma -lbz2 -lm -lz -lpthread
LIBS = -llzma -lbz2 -lm -lz -lpthread
OBJS = src/main.o src/phaseless.o src/fastphase.o src/admixture.o src/utils.o
BINS = phaseless
libhts = $(HTSDIR)/libhts.a
FLOAT = 0

ifeq ($(strip $(FLOAT)),1)
$(info "use float in phaseless!")
CXXFLAGS += -DUSE_FLOAT
endif

.PHONY: all clean htslib
.PHONY: all clean

all: $(BINS)
all: $(BINS) $(libhts)

%.o: %.cpp
${CXX} ${CXXFLAGS} -o $@ -c $< ${INC}

$(BINS): $(OBJS)
${CXX} ${CXXFLAGS} -o $@ $(OBJS) ${INC} $(LIBS) $(LDFLAGS)
$(BINS): $(OBJS) $(libhts)
${CXX} ${CXXFLAGS} -o $@ $(OBJS) ${INC} $(libhts) $(LIBS) $(LDFLAGS)

htslib:
cd $(HTSDIR) && ./configure --disable-libcurl --without-libdeflate && make -j10
$(libhts):
cd $(HTSDIR) && ./configure --disable-libcurl --without-libdeflate && make -j6

clean:
rm -f $(BINS) $(OBJS)
Expand Down
2 changes: 1 addition & 1 deletion src/fastphase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ int run_impute_main(Options & opts)
for(int it = 0; SIG_COND && it <= opts.nimpute; it++)
{
tim.clock();
if(opts.refillHaps && it > 4 && it < opts.nimpute / 2 && it % 4 == 1)
if(opts.refillHaps && it > 4 && it < opts.nimpute / 4 && it % 4 == 1)
faith.refillHaps(opts.refillHaps);
faith.initIteration();
for(int i = 0; i < faith.N; i++)
Expand Down
2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ int main(int argc, char * argv[])
"2: re-sample P by copying from haplotype with the highest probability\n"
"3: re-sample P by copying from others with respect to their probability\n"
"0: disable this")
.default_value(0)
.default_value(2)
.scan<'i', int>();
cmd_impute.add_argument("--minRecombRate")
.help("min recombination rate to determine if a SNP should be collapsed")
Expand Down

0 comments on commit 081f6e4

Please sign in to comment.