Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 5b5f8e29 authored by Jérôme Euzenat's avatar Jérôme Euzenat
Browse files

- added gap thresholding

parent c96b12e0
No related branches found
No related tags found
No related merge requests found
/* /*
* $Id$ * $Id$
* *
* Copyright (C) INRIA, 2003-2008 * Copyright (C) INRIA, 2003-2009
* Copyright (C) CNR Pisa, 2005 * Copyright (C) CNR Pisa, 2005
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
...@@ -416,6 +416,8 @@ public class BasicAlignment implements Alignment { ...@@ -416,6 +416,8 @@ public class BasicAlignment implements Alignment {
* - getting those cells with strength at worse n under the best (span) * - getting those cells with strength at worse n under the best (span)
* - getting the n% best cells (perc) * - getting the n% best cells (perc)
* - getting those cells with strength at worse n% of the best (prop) * - getting those cells with strength at worse n% of the best (prop)
* - getting all cells until a gap of n (hardgap)
* - getting all cells until a gap of n% of the last (propgap)
* Rule: * Rule:
* threshold is betweew 1 and 0 * threshold is betweew 1 and 0
**************************************************************************/ **************************************************************************/
...@@ -436,6 +438,19 @@ public class BasicAlignment implements Alignment { ...@@ -436,6 +438,19 @@ public class BasicAlignment implements Alignment {
i = (new Double(size*threshold)).intValue(); i = (new Double(size*threshold)).intValue();
} else if ( method.equals("best") ){ } else if ( method.equals("best") ){
i = new Double(threshold*100).intValue(); i = new Double(threshold*100).intValue();
} else if ( method.equals("hardgap") || method.equals("propgap") ){
double gap;
double last = ((Cell)buffer.get(0)).getStrength();
if ( method.equals("propgap") ) gap = last * threshold;
else gap = threshold;
for( i=1; i < size && !found ;) {
if ( last - ((Cell)buffer.get(i)).getStrength() > gap ) found = true;
else {
last = ((Cell)buffer.get(i)).getStrength();
if ( method.equals("propgap") ) gap = last * threshold;
i++;
}
}
} else { } else {
double max; double max;
if ( method.equals("hard") ) max = threshold; if ( method.equals("hard") ) max = threshold;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment