Skip to content
This repository has been archived by the owner on Jan 13, 2022. It is now read-only.

Commit

Permalink
Merge branch 'ff384' into 'master'
Browse files Browse the repository at this point in the history
New flip-flop, size384

See merge request algorithm/flappie!8
  • Loading branch information
tmassingham-ont committed Mar 5, 2020
2 parents caa5c1f + 1714e79 commit c3f88f8
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 6 deletions.
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ set (CPACK_PACKAGE_DESCRIPTION_FILE "${PROJECT_SOURCE_DIR}/README.md")
#set (CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE.md")
set (CPACK_PACKAGE_VERSION_MAJOR 2)
set (CPACK_PACKAGE_VERSION_MINOR 1)
set (CPACK_PACKAGE_VERSION_PATCH 1)
set (CPACK_PACKAGE_VERSION_PATCH 2)

# Get the latest abbreviated commit hash of the working branch
execute_process(
Expand Down Expand Up @@ -155,12 +155,13 @@ add_executable(flappie_unittest
target_include_directories(flappie_unittest PUBLIC "src/test" "src")
target_link_libraries(flappie_unittest flappie_static ${BLAS} ${HDF5} m cunit)

set (READSDIR ${PROJECT_SOURCE_DIR}/reads)
set (READSDIR ${PROJECT_SOURCE_DIR}/reads/single/)
set (TESTREAD "single/de1508c4-755b-489e-9ffb-51af35c9a7e6.fast5")
set (ENV{OPENBLAS_NUM_THREADS} 1)

add_test(NAME unittest WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/src/test/ COMMAND flappie_unittest)
add_test(test_flappie_call flappie ${READSDIR})
add_test(test_flappie_vitonly flappie --viterbi ${READSDIR})
add_test(test_flappie_licence flappie --licence)
add_test(test_flappie_license flappie --license)
add_test(test_flappie_help flappie --help)
Expand Down
7 changes: 6 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,15 @@

Flappie is a prototype basecaller for the sequence platforms produced by Oxford Nanopore Technologies.

## 2.1.2 ()
Further improvements to Flip-flop and RLE models
- Accuracy improvement, typically +1.5% over Guppy Hac v3.4
- Performance reduced

## 2.1.1 (_Solea solea_)
Improved Flip-flop and RLE models
- Accuracy improvements, typically > +1%
- Performance improvements, approximated 2x faster
- Performance improvements, approximately 2x faster

## 2.1.0 (_Lepidopsetta bilineata_)
_Runnie(r)_, improved Run-Length Encoding.
Expand Down
19 changes: 17 additions & 2 deletions src/flappie.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ static struct argp_option options[] = {
{"licence", 10, 0, 0, "Print licensing information"},
{"license", 11, 0, OPTION_ALIAS, "Print licensing information"},
{"segmentation", 3, "chunk:percentile", 0, "Chunk size and percentile for variance based segmentation"},
{"viterbi", 'v', 0, 0, "Use viterbi decoding only"},
{"no-viterbi", 8, 0, OPTION_ALIAS, "Use forward-backward followed by viterbi"},
{"fb", 9, 0, OPTION_ALIAS, "Use forward-backward followed by viterbi"},
{"hdf5-compression", 12, "level", 0,
"Gzip compression level for HDF5 output (0:off, 1: quickest, 9: best)"},
{"hdf5-chunk", 13, "size", 0, "Chunk size for HDF5 output"},
Expand All @@ -77,6 +80,7 @@ struct arguments {
int trim_end;
int varseg_chunk;
float varseg_thresh;
bool viterbi_only;
char ** files;
bool uuid;
};
Expand All @@ -95,6 +99,7 @@ static struct arguments args = {
.trim_end = 10,
.varseg_chunk = 100,
.varseg_thresh = 0.0f,
.viterbi_only = false,
.files = NULL,
.uuid = true
};
Expand Down Expand Up @@ -162,6 +167,9 @@ static error_t parse_arg(int key, char * arg, struct argp_state * state){
case 'T':
args.trace = arg;
break;
case 'v':
args.viterbi_only = true;
break;
case 3:
args.varseg_chunk = atoi(strtok(arg, ":"));
next_tok = strtok(NULL, ":");
Expand All @@ -176,6 +184,10 @@ static error_t parse_arg(int key, char * arg, struct argp_state * state){
args.temperature = atof(arg);
assert(isfinite(args.temperature) && args.temperature > 0.0f);
break;
case 8:
case 9:
args.viterbi_only = false;
break;
case 10:
case 11:
ret = fputs(flappie_licence_text, stdout);
Expand Down Expand Up @@ -241,7 +253,11 @@ static struct _raw_basecall_info calculate_post(char * filename, enum model_type

float score = NAN;

flappie_matrix posterior = transpost_crf_flipflop(trans_weights, true);
flappie_matrix posterior = trans_weights;
if( ! args.viterbi_only){
posterior = transpost_crf_flipflop(trans_weights, true);
free(trans_weights);
}
score = decode_crf_flipflop(posterior, false, path, qpath);
size_t path_nidx = change_positions(path, nblock, path_idx);

Expand All @@ -259,7 +275,6 @@ static struct _raw_basecall_info calculate_post(char * filename, enum model_type
free(qpath);
free(path_idx);
free(path);
trans_weights = free_flappie_matrix(trans_weights);
const size_t basecall_length = strlen(basecall);

return (struct _raw_basecall_info) {
Expand Down
3 changes: 3 additions & 0 deletions src/models/flipflop5_202003_r941native_5b1c1eee.mdl
Git LFS file not shown
2 changes: 1 addition & 1 deletion src/models/flipflop5_r941native.h

0 comments on commit c3f88f8

Please sign in to comment.