本文整理汇总了Java中org.simmetrics.metrics.functions.MatchMismatch类的典型用法代码示例。如果您正苦于以下问题:Java MatchMismatch类的具体用法?Java MatchMismatch怎么用?Java MatchMismatch使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MatchMismatch类属于org.simmetrics.metrics.functions包,在下文中一共展示了MatchMismatch类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getSmithWatermanFunction
import org.simmetrics.metrics.functions.MatchMismatch; //导入依赖的package包/类
private org.simmetrics.metrics.SmithWaterman getSmithWatermanFunction(final Value... values) throws ExpressionEvaluationException {
if (smithWaterman == null) {
if (values.length == 7) {
for(final Expression expression : getArgs()) {
if(!(expression instanceof Constant)) {
throw new ExpressionEvaluationException("Parameters 2 through 7 must be constant expressions");
}
}
final float gapA = assertNumericLiteral(values[2]).floatValue();
final float gapB = assertNumericLiteral(values[3]).floatValue();
final float subPenaltyA = assertNumericLiteral(values[4]).floatValue();
final float subPenaltyB = assertNumericLiteral(values[5]).floatValue();
final int windowSize = assertNumericLiteral(values[6]).intValue();
smithWaterman = new org.simmetrics.metrics.SmithWaterman(new AffineGap(gapA, gapB), new MatchMismatch(subPenaltyA, subPenaltyB), windowSize);
} else {
smithWaterman = new org.simmetrics.metrics.SmithWaterman();
}
}
return smithWaterman;
}
示例2: getSmithWatermanGotohFunction
import org.simmetrics.metrics.functions.MatchMismatch; //导入依赖的package包/类
private org.simmetrics.metrics.SmithWatermanGotoh getSmithWatermanGotohFunction(final Value... values) throws ExpressionEvaluationException {
if (smithWatermanGotoh == null) {
if (values.length == 5) {
for (final Expression expression : getArgs()) {
//FIXME check only 2 through 7 not all params
if (!(expression instanceof Constant)) {
throw new ExpressionEvaluationException("Parameters 2 through 7 must be constant expressions");
}
}
final float gapValue = assertNumericLiteral(values[2]).floatValue();
final float matchPenalty = assertNumericLiteral(values[3]).floatValue();
final float mismatchPenalty = assertNumericLiteral(values[4]).floatValue();
smithWatermanGotoh = new org.simmetrics.metrics.SmithWatermanGotoh(gapValue, new MatchMismatch(matchPenalty, mismatchPenalty));
} else {
smithWatermanGotoh = new org.simmetrics.metrics.SmithWatermanGotoh();
}
}
return smithWatermanGotoh;
}
示例3: getNeedlemanWunchFunction
import org.simmetrics.metrics.functions.MatchMismatch; //导入依赖的package包/类
private org.simmetrics.metrics.NeedlemanWunch getNeedlemanWunchFunction(final Value... values) throws ExpressionEvaluationException {
if (needlemanWunch == null) {
if (values.length == 5) {
final float gapValue = assertNumericLiteral(values[2]).floatValue();
final float subPenaltyA = assertNumericLiteral(values[3]).floatValue();
final float subPenaltyB = assertNumericLiteral(values[4]).floatValue();
needlemanWunch = new org.simmetrics.metrics.NeedlemanWunch(gapValue, new MatchMismatch(subPenaltyA, subPenaltyB));
} else {
needlemanWunch = new org.simmetrics.metrics.NeedlemanWunch();
}
}
return needlemanWunch;
}
示例4: SmithWaterman
import org.simmetrics.metrics.functions.MatchMismatch; //导入依赖的package包/类
/**
* Constructs a new Smith Waterman metric. Uses an affine gap of
* <code>-5.0 - gapLength</code> a <code>-3.0</code> substitution penalty
* for mismatches, <code>5.0</code> for matches.
*
*/
public SmithWaterman() {
this(new AffineGap(-5.0f, -1.0f), new MatchMismatch(5.0f, -3.0f),
Integer.MAX_VALUE);
}