001/* 002 * BioJava development code 003 * 004 * This code may be freely distributed and modified under the 005 * terms of the GNU Lesser General Public Licence. This should 006 * be distributed with the code. If you do not have a copy, 007 * see: 008 * 009 * http://www.gnu.org/copyleft/lesser.html 010 * 011 * Copyright for this code is held jointly by the individual 012 * authors. These should be listed in @author doc comments. 013 * 014 * For more information on the BioJava project and its aims, 015 * or to join the biojava-l mailing list, visit the home page 016 * at: 017 * 018 * http://www.biojava.org/ 019 * 020 */ 021package org.biojava.nbio.structure.align.ce; 022 023import java.util.List; 024 025/** 026 * Provides parameters to {@link CeCPMain} 027 * 028 * @author Spencer Bliven 029 * 030 */ 031public class CECPParameters extends CeParameters { 032 033 public static final int DEFAULT_MIN_CP_LENGTH = 5; //The minimum block length for CPs. Blocks shorter than this will be ignored. 034 035 public static enum DuplicationHint { 036 SHORTER("Shorter of the two"), 037 LEFT("Left"), 038 RIGHT("Right"); 039 040 041 private String name; 042 private DuplicationHint(String name) { 043 this.name = name; 044 } 045 @Override 046 public String toString() { 047 return name; 048 } 049 } 050 051 protected DuplicationHint duplicationHint; 052 protected Integer minCPLength; 053 054 public CECPParameters() { 055 super(); 056 // super calls reset(); 057 } 058 059 @Override 060 public String toString() { 061 return "CECPParameters [scoringStrategy=" + scoringStrategy 062 + ", maxGapSize=" + maxGapSize 063 + ", rmsdThr=" + rmsdThr 064 + ", rmsdThrJoin="+ rmsdThrJoin 065 + ", winSize=" + winSize 066 + ", showAFPRanges=" + showAFPRanges 067 + ", maxOptRMSD=" + maxOptRMSD 068 + ", seqWeight=" + seqWeight 069 + ", duplicationHint=" + duplicationHint 070 + ", minCPLength=" + minCPLength 071 + "]"; 072 } 073 074 075 @Override 076 public void reset(){ 077 super.reset(); 078 duplicationHint = DuplicationHint.SHORTER; 079 minCPLength = DEFAULT_MIN_CP_LENGTH; 080 setMaxGapSize(0); 081 } 082 083 084 @Override 085 public List<String> getUserConfigHelp() { 086 List<String> params = super.getUserConfigHelp(); 087 params.add("Direction to duplicate: SHORTER, LEFT, or RIGHT"); 088 params.add("Minimum length of a CP block to consider"); 089 return params; 090 } 091 092 @Override 093 public List<String> getUserConfigParameters() { 094 List<String> params = super.getUserConfigParameters(); 095 params.add("DuplicationHint"); 096 params.add("MinCPLength"); 097 return params; 098 } 099 100 @Override 101 public List<String> getUserConfigParameterNames(){ 102 List<String> params = super.getUserConfigParameterNames(); 103 104 params.add("Which to duplicate"); 105 params.add("Min CP Length"); 106 return params; 107 } 108 109 @Override 110 @SuppressWarnings("rawtypes") 111 public List<Class> getUserConfigTypes() { 112 List<Class> params = super.getUserConfigTypes(); 113 params.add(DuplicationHint.class); 114 params.add(Integer.class); 115 return params; 116 } 117 118 public DuplicationHint getDuplicationHint() { 119 return duplicationHint; 120 } 121 122 public void setDuplicationHint(DuplicationHint duplicationHint) { 123 this.duplicationHint = duplicationHint; 124 } 125 126 127 public Integer getMinCPLength() { 128 return minCPLength; 129 } 130 131 132 public void setMinCPLength(Integer minCPLength) { 133 this.minCPLength = minCPLength; 134 } 135}