Package org.biojava.nbio.alignment
Class SimpleGapPenalty
- java.lang.Object
-
- org.biojava.nbio.alignment.SimpleGapPenalty
-
- All Implemented Interfaces:
Serializable
,GapPenalty
public class SimpleGapPenalty extends Object implements GapPenalty, Serializable
Implements a data structure for the gap penalties used during a sequence alignment routine.- Author:
- Mark Chapman
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.biojava.nbio.alignment.template.GapPenalty
GapPenalty.Type
-
-
Constructor Summary
Constructors Constructor Description SimpleGapPenalty()
Creates a new set of gap penalties using the defaults.SimpleGapPenalty(int gop, int gep)
Creates a new set of gap penalties.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getExtensionPenalty()
Returns the negative of the extension penalty passed to the constructor.int
getOpenPenalty()
Returns the negative of the opening penalty passed to the constructor.GapPenalty.Type
getType()
ReturnsGapPenalty.Type
stored.static void
setDefaultExtensionPenalty(int gep)
Sets the default gap extension penalty.static void
setDefaultOpenPenalty(int gop)
Sets the default gap open penalty.void
setExtensionPenalty(int gep)
Sets penalty given when an already open gap elongates by a single elementvoid
setOpenPenalty(int gop)
Sets penalty given when a deletion or insertion gap first opens
-
-
-
Constructor Detail
-
SimpleGapPenalty
public SimpleGapPenalty()
Creates a new set of gap penalties using the defaults.
-
SimpleGapPenalty
public SimpleGapPenalty(int gop, int gep)
Creates a new set of gap penalties.- Parameters:
gop
- the gap open penalty; should be nonnegativegep
- the gap extension penalty; should be nonnegative
-
-
Method Detail
-
setDefaultExtensionPenalty
public static void setDefaultExtensionPenalty(int gep)
Sets the default gap extension penalty.- Parameters:
gep
- the default gap extension penalty
-
setDefaultOpenPenalty
public static void setDefaultOpenPenalty(int gop)
Sets the default gap open penalty.- Parameters:
gop
- the default gap open penalty
-
getExtensionPenalty
public int getExtensionPenalty()
Returns the negative of the extension penalty passed to the constructor.- Specified by:
getExtensionPenalty
in interfaceGapPenalty
- Returns:
- gap extension penalty
-
getOpenPenalty
public int getOpenPenalty()
Returns the negative of the opening penalty passed to the constructor.- Specified by:
getOpenPenalty
in interfaceGapPenalty
- Returns:
- gap open penalty
-
getType
public GapPenalty.Type getType()
Description copied from interface:GapPenalty
ReturnsGapPenalty.Type
stored.- Specified by:
getType
in interfaceGapPenalty
- Returns:
- gap penalty type
-
setExtensionPenalty
public void setExtensionPenalty(int gep)
Description copied from interface:GapPenalty
Sets penalty given when an already open gap elongates by a single element- Specified by:
setExtensionPenalty
in interfaceGapPenalty
- Parameters:
gep
- Should be nonnegative
-
setOpenPenalty
public void setOpenPenalty(int gop)
Description copied from interface:GapPenalty
Sets penalty given when a deletion or insertion gap first opens- Specified by:
setOpenPenalty
in interfaceGapPenalty
- Parameters:
gop
- Should be nonnegative
-
-