Commit f4043b6d authored by Marc Duez's avatar Marc Duez

Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot/vidjil/vidjil into rework_data

parents 8057f332 afdeaac1
language: cpp
compiler: gcc
before_install:
- sudo pip install cpp-coveralls
before_script: make data ; make germline
script: make && make test
after_success:
- make COVERAGE=1 unit should ; ln -s algo/core . ; coveralls --exclude algo/tests --exclude algo/tools --gcov-options '\-lp'
COVERAGE=
VIDJIL_ALGO_SRC = algo/
VIDJIL_SERVER_SRC = server/
ifeq (${COVERAGE},1)
COVERAGE_OPTION=--coverage
else
COVERAGE_OPTION=
endif
all:
make -C $(VIDJIL_ALGO_SRC)
make COVERAGE="$(COVERAGE_OPTION)" -C $(VIDJIL_ALGO_SRC)
test:
make unit
make COVERAGE="$(COVERAGE)" unit
make should
# make pytests
test_with_fuse:
make unit
make COVERAGE="$(COVERAGE)" unit
make should
make pytests
unit: all
@echo "*** Launching unit tests..."
make -C $(VIDJIL_ALGO_SRC)/tests
make COVERAGE="$(COVERAGE_OPTION)" -C $(VIDJIL_ALGO_SRC)/tests
@echo "*** All .should_get tests passed"
pytests:
......@@ -29,9 +35,19 @@ pytests:
should: all
@echo
@echo "*** Launching .should_get tests..."
make -C $(VIDJIL_ALGO_SRC)/tests should
make COVERAGE="$(COVERAGE_OPTION)" -C $(VIDJIL_ALGO_SRC)/tests should
@echo "*** All .should_get tests passed"
coverage: unit_coverage should_coverage
unit_coverage: clean
make COVERAGE=1 unit
which gcovr > /dev/null && (cd algo; gcovr -r . -e tests/ --xml > unit_coverage.xml) || echo "gcovr is needed to generate a full report"
should_coverage: clean
make COVERAGE=1 should
which gcovr > /dev/null && (cd algo; gcovr -r . -e tests/ --xml > should_coverage.xml) || echo "gcovr is needed to generate a full report"
data germline: %:
make -C $@
......@@ -42,7 +58,7 @@ cleanall: clean
make -C data $^
make -C germline $^
.PHONY: all test should clean cleanall distrib data germline
.PHONY: all test should clean cleanall distrib data germline unit_coverage should_coverage coverage
RELEASE_TAG="notag"
RELEASE_H = $(VIDJIL_ALGO_SRC)/release.h
......
CC=g++
OPTIM=-O2 -DNDEBUG
OPTIM=-O2 -DNDEBUG $(COVERAGE)
CXXFLAGS=-W -Wall $(OPTIM) $(DEBUG) $(CONFIG)
LDFLAGS=-lm
EXEC=vidjil kmer kmer_count cut count detailed_affect
......@@ -50,6 +50,7 @@ $(EXEC): %: %.o
clean:
make -C core $@
rm -f *.o *.gcda *.gcno *.gcov
cd $(BINDIR) ; rm -f $(EXEC)
make -C tests $@
......
......@@ -13,7 +13,7 @@ $(LIBCORE): $(OBJCORE)
ar rc $@ $^
clean:
rm -f $(OBJCORE) $(LIBCORE)
rm -f $(OBJCORE) $(LIBCORE) *.gcda *.gcno *.gcov
forcedep:
g++ -M $(SRCCORE) > dep.mk
......
......@@ -95,6 +95,12 @@ MultiGermline::MultiGermline(string f_germlines_json)
germlines.push_back(germline);
}
MultiGermline::~MultiGermline() {
for (list<Germline*>::const_iterator it = germlines.begin(); it != germlines.end(); ++it)
{
delete *it ;
}
}
void MultiGermline::insert(Germline *germline)
{
......
......@@ -64,6 +64,7 @@ class MultiGermline {
MultiGermline();
MultiGermline(string f_germlines_json);
~MultiGermline();
void insert(Germline *germline);
void load_default_set();
......
#include <fstream>
#include <iostream>
#include <stdio.h>
#include <string.h>
#include <cstdlib>
#include "core/dynprog.h"
#include "core/fasta.h"
#include "core/lazy_msa.h"
using namespace std;
int main(int argc, char* argv[])
{
//initilisation par defaut
const char* fdata_default = "../data/msa_test.fa" ;
DynProg::DynProgMode dpMode = DynProg::Global;
Cost dpCost = VDJ;
const char* fdata = fdata_default;
//initialisation
if ( argc > 1 && argv[1][0] != '-'){
fdata = argv[1];
}
Fasta f(fdata, 1, " ");
string seq0 = f.sequence(0);
LazyMsa lm = LazyMsa(50, seq0);
for (int i=1; i < f.size(); i++){
string seq1 = f.sequence(i);
lm.add(seq1);
string *result;
result =new string[2];
cout <<"align 0/"<<i<<endl;
lm.alignOne(result, i-1);
cout<<result[0]<<endl;
cout<<result[1]<<endl<<endl;
}
string *result;
result =new string[lm.sizeUsed+2];
lm.align(result);
cout <<"lazy_msa"<<endl;
for (int i=0; i<lm.sizeUsed+2; i++){
cout<<result[i]<<endl;
}
}
CC=g++
CXXFLAGS=-W -Wall -g -O0
CXXFLAGS=-W -Wall -g -O0 $(COVERAGE)
INCLUDE=-I ..
LDFLAGS=
SRC= tests.cpp
......@@ -33,16 +33,16 @@ $(EXEC): % : %.o $(LIB)
../core.a: core
vidjil:
make OPTIM="-O0 -g" -C ../
make CXXFLAGS="$(CXXFLAGS)" -C ../
core:
make OPTIM="-O0 -g" -C ../core
make CXXFLAGS="$(CXXFLAGS)" -C ../core
%.o: %.cpp $(OTHER_SRC)
$(CC) -o $@ $(INCLUDE) -c $< $(CXXFLAGS)
clean:
rm -f *.o $(EXEC) *.tap *.log
rm -f *.o $(EXEC) *.tap *.log *.gcda *.gcno *.gcov
forcedep:
g++ $(INCLUDE) -M $(SRC) > dep.mk
......
......@@ -55,7 +55,7 @@ void testSegmentationBug1(int delta_min, int delta_max) {
delete segment;
delete kaa;
}
delete germline;
delete multi;
}
void testBugs() {
......
......@@ -56,7 +56,7 @@ void testFineSegment()
"s2 = " << s2.info);
TAP_TEST(s.code == s2.code, TEST_SEGMENT_REVCOMP, " code string");
delete germline;
}
/**
......@@ -91,6 +91,9 @@ void testSegmentOverlap()
TEST_FINE_SEGMENT_OVERLAP,
" V= " << fs.seg_V << ", N = " << fs.seg_N << ", J = " << fs.seg_J);
}
delete multi1;
delete germline2;
}
void testSegmentationCause() {
......@@ -183,6 +186,8 @@ void testSegmentationCause() {
}
TAP_TEST(nb_checked == 11, TEST_KMER_DATA, "");
delete multi;
}
void testExtractor() {
......@@ -236,6 +241,7 @@ void testExtractor() {
TAP_TEST(out_unseg.tellp() > 0, TEST_EXTRACTOR_OUT_UNSEG, "");
delete ws;
delete multi;
}
void testSegment() {
......
......@@ -201,6 +201,23 @@ There can be several causes leading to bad ratios:
(high concentration) to purple (low concentration) and allows to easily
spot on the graph any large change in concentration.
* Browser API
The browser can be opened on a data file specified from a =data= attribute,
and optionally on an analysis file specified from a =analysis= attribute,
as in the following URLs on our test server:
- http://rbx.vidjil.org/browser/?data=test.data
- http://rbx.vidjil.org/browser/?data=test.data&analysis=test.analysis
- http://rbx.vidjil.org/browser/?data=http://rbx.vidjil.org/browser/test.data
Both GET and POST requests are accepted.
Note that the =browser/index.html= file and the =.data/.analysis= files should be hosted on the same server.
Otherwise, the server hosting the =.data/.analysis= files must accept cross-domain queries.
* Reference
If you use Vidjil for your research, please cite the following reference:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment