matchcolumnidentifyer.java
来自「马尔科夫模型的c语言实现」· Java 代码 · 共 92 行
JAVA
92 行
class MatchColumnIdentifyer{ MSA msa; public MatchColumnIdentifyer(MSA msa) { this.msa = msa; } public boolean[] getMatchColumns(String constructionMethod) { if(constructionMethod.startsWith("F")) { return getMatchColumnsFast(); } else if(constructionMethod.startsWith("H")) { return getMatchColumnsHand(); } else if(constructionMethod.startsWith("M")) { return getMatchColumnsMAP(); } else if(constructionMethod.startsWith("Q")) { return getMatchColumnsQuery(); } else { P.MESSAGE("No such match column identifyer exists"); System.exit(0); } return null; } private boolean[] getMatchColumnsFast() { return null; } private boolean[] getMatchColumnsHand() { return null; } private boolean[] getMatchColumnsMAP() { return null; } private boolean[] getMatchColumnsQuery() { /* return the columns for which the query sequence has non gap residues * the query seq is always taken to be the first seq in the alignment */ boolean[] matchColumns = new boolean[msa.nrColumns]; for(int i = 0; i < msa.nrColumns; i++) { if(!(msa.theMsa[0][i].letter_1.equals("-")) && !(msa.theMsa[0][i].letter_1.equals(" ")) && !(msa.theMsa[0][i].letter_1.equals(".")) && !(msa.theMsa[0][i].letter_1.equals("_"))) { matchColumns[i] = true; } else { matchColumns[i] = false; } } return matchColumns; } public int getNrOfMatchColumns(boolean[] mc) { int nr = 0; for(int i = 0; i < mc.length; i++) { if(mc[i]) { nr++; } } return nr; }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?