本文整理了Java中org.broadinstitute.gatk.utils.Utils.longestCommonSuffix()
方法的一些代码示例,展示了Utils.longestCommonSuffix()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utils.longestCommonSuffix()
方法的具体详情如下:
包路径:org.broadinstitute.gatk.utils.Utils
类名称:Utils
方法名:longestCommonSuffix
[英]Get the length of the longest common suffix of seq1 and seq2
[中]获取seq1和seq2最长公共后缀的长度
代码示例来源:origin: broadgsa/gatk
int reverseEdgeMatch = Utils.longestCommonSuffix(reference, alternate, Integer.MAX_VALUE);
代码示例来源:origin: broadgsa/gatk
@Test
public void testLongestCommonOps() {
for ( int prefixLen = 0; prefixLen < 20; prefixLen++ ) {
for ( int extraSeq1Len = 0; extraSeq1Len < 10; extraSeq1Len++ ) {
for ( int extraSeq2Len = 0; extraSeq2Len < 10; extraSeq2Len++ ) {
for ( int max = 0; max < 50; max++ ) {
final String prefix = Utils.dupString("A", prefixLen);
final int expected = Math.min(prefixLen, max);
{
final String seq1 = prefix + Utils.dupString("C", extraSeq1Len);
final String seq2 = prefix + Utils.dupString("G", extraSeq1Len);
Assert.assertEquals(Utils.longestCommonPrefix(seq1.getBytes(), seq2.getBytes(), max), expected, "LongestCommonPrefix failed: seq1 " + seq1 + " seq2 " + seq2 + " max " + max);
}
{
final String seq1 = Utils.dupString("C", extraSeq1Len) + prefix;
final String seq2 = Utils.dupString("G", extraSeq1Len) + prefix;
Assert.assertEquals(Utils.longestCommonSuffix(seq1.getBytes(), seq2.getBytes(), max), expected, "longestCommonSuffix failed: seq1 " + seq1 + " seq2 " + seq2 + " max " + max);
}
}
}
}
}
}
内容来源于网络,如有侵权,请联系作者删除!