001package com.hfg.bio.seq.alignment; 002 003 004//------------------------------------------------------------------------------ 005 006import com.hfg.exception.ProgrammingException; 007 008/** 009 Container for pairwise sequence alignment gap penalties. 010 011 @author J. Alex Taylor, hairyfatguy.com 012 */ 013//------------------------------------------------------------------------------ 014// com.hfg XML/HTML Coding Library 015// 016// This library is free software; you can redistribute it and/or 017// modify it under the terms of the GNU Lesser General Public 018// License as published by the Free Software Foundation; either 019// version 2.1 of the License, or (at your option) any later version. 020// 021// This library is distributed in the hope that it will be useful, 022// but WITHOUT ANY WARRANTY; without even the implied warranty of 023// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 024// Lesser General Public License for more details. 025// 026// You should have received a copy of the GNU Lesser General Public 027// License along with this library; if not, write to the Free Software 028// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 029// 030// J. Alex Taylor, President, Founder, CEO, COO, CFO, OOPS hairyfatguy.com 031// jataylor@hairyfatguy.com 032//------------------------------------------------------------------------------ 033 034 035public class GapPenalties implements Cloneable 036{ 037 private Float mOpenPenalty; 038 private Float mExtensionPenalty; 039 040 041 //########################################################################### 042 // PUBLIC METHODS 043 //########################################################################### 044 045 //--------------------------------------------------------------------------- 046 @Override 047 public GapPenalties clone() 048 { 049 GapPenalties cloneObj = null; 050 try 051 { 052 cloneObj = (GapPenalties) super.clone(); 053 } 054 catch (CloneNotSupportedException e) 055 { 056 throw new ProgrammingException(e); 057 } 058 059 return cloneObj; 060 } 061 062 //--------------------------------------------------------------------------- 063 public GapPenalties setOpenPenalty(Float inValue) 064 { 065 mOpenPenalty = inValue; 066 return this; 067 } 068 069 //--------------------------------------------------------------------------- 070 public Float getOpenPenalty() 071 { 072 return mOpenPenalty; 073 } 074 075 //--------------------------------------------------------------------------- 076 public GapPenalties setExtensionPenalty(Float inValue) 077 { 078 mExtensionPenalty = inValue; 079 return this; 080 } 081 082 //--------------------------------------------------------------------------- 083 public Float getExtensionPenalty() 084 { 085 return mExtensionPenalty; 086 } 087 088 //--------------------------------------------------------------------------- 089 @Override 090 public String toString() 091 { 092 return String.format("[%.1f, %.1f]", mOpenPenalty, mExtensionPenalty); 093 } 094}