Commit aa1d9bb8 authored by Mikaël Salson's avatar Mikaël Salson
Browse files

Merge branch 'feature-a/2732-cli' into 'dev'

vidjil.cpp: refactor option handling using CLI11

Closes #2732, #2749, #2741, and #2738

See merge request !105
parents 7647eacb 5f5a9137
Pipeline #29112 passed with stages
in 53 seconds
......@@ -112,6 +112,15 @@ ostream& operator<<(ostream& out, const Cost& cost)
return out;
}
string string_of_cost(const Cost cost)
{
stringstream ss;
ss << cost ;
return ss.str();
}
Cost::Cost()
{
}
......
......@@ -67,6 +67,7 @@ class Cost
ostream& operator<<(ostream& out, const Cost& cost);
string string_of_cost(const Cost cost);
// Usual costs
const Cost Hamming = Cost(0, -1, MINUS_INF);
......
......@@ -8,6 +8,7 @@
#define NO_LIMIT_VALUE -1 // Value for 'all' on command-line options
#define NO_LIMIT_VALUE_STRING "-1"
#define MAX_SEED_SIZE 50 // Spaced seed buffer
......
This diff is collapsed.
......@@ -249,8 +249,8 @@ def header_igblast_results(ff_fasta, ff_igblast):
### Vidjil
VIDJIL_FINE = '{directory}/vidjil-algo -X 100 -# "#" -c segment -3 -d -g {directory}/germline/homo-sapiens.g %s >> %s'
VIDJIL_KMER = '{directory}/vidjil-algo -w 20 -# "#" -b out -c windows -uuuU -2 -g {directory}/germline/homo-sapiens.g %s > /dev/null ; cat out/out.segmented.vdj.fa out/out.unsegmented.vdj.fa >> %s'
VIDJIL_FINE = '{directory}/vidjil-algo -X 100 --header-sep "#" -c segment -3 -d -g {directory}/germline/homo-sapiens.g %s >> %s'
VIDJIL_KMER = '{directory}/vidjil-algo -w 20 --header-sep "#" -b out -c windows -uuuU -2 -g {directory}/germline/homo-sapiens.g %s > /dev/null ; cat out/out.segmented.vdj.fa out/out.unsegmented.vdj.fa >> %s'
def should_results_from_vidjil_output(f_log):
'''
......
......@@ -4,7 +4,7 @@
# Test examples embedded in 'doc/algo.org'
# Run eight times
8:vidjil-algo -- V.D.J recombinations analysis
8:vidjil-algo -- V.D.J recombinations analysis .*vidjil.org
# '-c clone' (or implied), five times
5: end of clones
......
!LAUNCH: $VIDJIL_DIR/$EXEC $VIDJIL_DEFAULT_OPTIONS -\# FA -k 16 -z 0 -w 60 -r 5 -o out2 -uuu -U -v -V $VIDJIL_DIR/germline/homo-sapiens/IGHV.fa -J $VIDJIL_DIR/germline/homo-sapiens/IGHJ.fa $VIDJIL_DATA/Stanford_S22.fasta ; tail out2/Stanford_S22.segmented.vdj.fa ; grep UNSEG out2/Stanford_S22.unsegmented.vdj.fa
!LAUNCH: $VIDJIL_DIR/$EXEC $VIDJIL_DEFAULT_OPTIONS --header-sep FA -k 16 -z 0 -w 60 -r 5 -o out2 -uuu -U -v -V $VIDJIL_DIR/germline/homo-sapiens/IGHV.fa -J $VIDJIL_DIR/germline/homo-sapiens/IGHJ.fa $VIDJIL_DATA/Stanford_S22.fasta ; tail out2/Stanford_S22.segmented.vdj.fa ; grep UNSEG out2/Stanford_S22.unsegmented.vdj.fa
# Testing uncommon and debug options
$ verbose (-v)
......
!LAUNCH: $VIDJIL_DIR/$EXEC $VIDJIL_DEFAULT_OPTIONS -f '1, 2, 3, 4, 5'
!LAUNCH: $VIDJIL_DIR/$EXEC $VIDJIL_DEFAULT_OPTIONS -f '1, 2, 3, 4, 5' $VIDJIL_DATA/Stanford_S22.fasta
!EXIT_CODE: 1
$Check that correct custom cost is used
......
!LAUNCH: $VIDJIL_DIR/$EXEC $VIDJIL_DEFAULT_OPTIONS -g $VIDJIL_DIR/germline/Makefile 2>&1
!LAUNCH: $VIDJIL_DIR/$EXEC $VIDJIL_DEFAULT_OPTIONS -g $VIDJIL_DIR/germline/Makefile $VIDJIL_DATA/Stanford_S22.fasta 2>&1
!EXIT_CODE: 1
$ Error, incorrect *.g
......
!NO_LAUNCHER:
!LAUNCH: $VIDJIL_DIR/$EXEC $VIDJIL_DEFAULT_OPTIONS 2>&1
!LAUNCH: $VIDJIL_DIR/$EXEC $VIDJIL_DEFAULT_OPTIONS $VIDJIL_DATA/Stanford_S22.fasta 2>&1
!EXIT_CODE: 1
$ Error, no germlines
......
!NO_LAUNCHER:
!LAUNCH: (cd $VIDJIL_DIR ; ./$EXEC -h 2>&1 > /dev/null | grep '$EXEC -c' | sed 's/X 50/X 5/' | sed 's/demo.LIL-L4/-X 1000 demo\/LIL-L4/' | sh)
cd $VIDJIL_DIR
./$EXEC -h | grep '$EXEC -c' | sed 's/X 50/X 5/' | sed 's/demo.LIL-L4/-X 1000 demo\/LIL-L4/' | sh
# Test examples embedded in './vidjil-algo -h'
......
!NO_LAUNCHER:
!LAUNCH: $VIDJIL_DIR/$EXEC $VIDJIL_DEFAULT_OPTIONS -H 2> out-v ; cat out-v
!LAUNCH: $VIDJIL_DIR/$EXEC $VIDJIL_DEFAULT_OPTIONS -H
$ License
1:vidjil-algo is free software
......@@ -8,4 +8,9 @@ $ Check default costs
1:segmenter .* "4, -6, -10, -1, -10"
1:clustering .* "1, -4, -4, 0, 0"
$ Display advanced options
: , experimental options
: custom Cost
$ Correct number of options
B47:^ -
!NO_LAUNCHER:
!LAUNCH: $VIDJIL_DIR/$EXEC $VIDJIL_DEFAULT_OPTIONS -h 2> out-v ; cat out-v
!LAUNCH: $VIDJIL_DIR/$EXEC $VIDJIL_DEFAULT_OPTIONS -h
$ License
1:vidjil-algo is free software
$ Check default filtering options
1:minimal number of reads supporting a clone .*: 5
1:minimal percentage of reads supporting a clone .*: 0
1:maximal number of clones computed with a consensus sequence .*: 100
1:maximal number of clones to be analyzed .*: 100
1: =5 .* minimal number of reads supporting a clone
1: =0 .* minimal percentage of reads supporting a clone
1: =100 .* maximal number of clones computed with a consensus sequence
1: =100 .* maximal number of clones to be analyzed
$ Do not display advanced options
0: , experimental options
0: custom Cost
$ Correct number of regular options
B24:^ -
!LAUNCH: $LAUNCHER $VIDJIL_DIR/$EXEC $VIDJIL_DEFAULT_OPTIONS -z 1 -k 9 -g $VIDJIL_DIR/germline/homo-sapiens.g:IGH -% 0.001 -r 2 -x 1000 -y 1 -c clones $VIDJIL_DATA/Stanford_S22.fasta | sed 's/--IGH--.*VDJ\\(.*\\).$/\\1/' | sed 's/IGH SEG_./IGH SEG_X/' > vidjil_s22.log && $LAUNCHER $VIDJIL_DIR/$EXEC $VIDJIL_DEFAULT_OPTIONS -z 1 -k 9 -g $VIDJIL_DIR/germline/homo-sapiens.g:IGH -% 0.001 -r 2 -x 1000 -y 1 -c clones $VIDJIL_DATA/Stanford_S22.rc.fasta | sed 's/--IGH--.*VDJ\\(.*\\).$/\\1/' | sed 's/IGH SEG_./IGH SEG_X/' > vidjil_s22_rc.log && diff out/Stanford_S22{,.rc}.vidjil | grep GGG && diff vidjil_s22.log vidjil_s22_rc.log
!LAUNCH: $LAUNCHER $VIDJIL_DIR/$EXEC $VIDJIL_DEFAULT_OPTIONS -z 1 -k 9 -g $VIDJIL_DIR/germline/homo-sapiens.g:IGH --ratio 0.001 -r 2 -x 1000 -y 1 -c clones $VIDJIL_DATA/Stanford_S22.fasta | sed 's/--IGH--.*VDJ\\(.*\\).$/\\1/' | sed 's/IGH SEG_./IGH SEG_X/' > vidjil_s22.log
!LAUNCH: $LAUNCHER $VIDJIL_DIR/$EXEC $VIDJIL_DEFAULT_OPTIONS -z 1 -k 9 -g $VIDJIL_DIR/germline/homo-sapiens.g:IGH --ratio 0.001 -r 2 -x 1000 -y 1 -c clones $VIDJIL_DATA/Stanford_S22.rc.fasta | sed 's/--IGH--.*VDJ\\(.*\\).$/\\1/' | sed 's/IGH SEG_./IGH SEG_X/' > vidjil_s22_rc.log
!LAUNCH: diff out/Stanford_S22{,.rc}.vidjil | grep GGG && diff vidjil_s22.log vidjil_s22_rc.log
!EXIT_CODE: 1
$ Same number segmented
......
This diff is collapsed.
Supports Markdown
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