Class ProteinRange
- java.lang.Object
-
- de.charite.compbio.jannovar.hgvs.protein.ProteinRange
-
- All Implemented Interfaces:
ConvertibleToHGVSString
public class ProteinRange extends Object implements ConvertibleToHGVSString
Represent a range in a protein.Note that contrary to Java-style, we represent the first and last character of the range instead of the begin and end position. Thus, we use inclusive positions. This is also reflected by the members being named first and last instead of begin and end.
In the case of the first position being equal to the last one, the
ProteinRange
degrades to a point whentoHGVSString()
is called.- Author:
- Manuel Holtgrewe
-
-
Constructor Summary
Constructors Constructor Description ProteinRange(ProteinPointLocation first, ProteinPointLocation last)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ProteinRange
build(String firstAA, int first, String lastAA, int last)
static ProteinRange
buildDownstreamOfTerminal(String firstAA, int first, String lastAA, int last)
static ProteinRange
buildWithOffset(String firstAA, int first, int firstOffset, String lastAA, int last, int lastOffset)
boolean
equals(Object obj)
ProteinPointLocation
getFirst()
ProteinPointLocation
getLast()
int
hashCode()
int
length()
String
toHGVSString()
Return HGVS representation in three-letter amino acid code.String
toHGVSString(AminoAcidCode code)
Return HGVS representation using the given amino acid code.String
toString()
-
-
-
Constructor Detail
-
ProteinRange
public ProteinRange(ProteinPointLocation first, ProteinPointLocation last)
- Parameters:
first
- first position of the rangelast
- last position of the range
-
-
Method Detail
-
build
public static ProteinRange build(String firstAA, int first, String lastAA, int last)
-
buildWithOffset
public static ProteinRange buildWithOffset(String firstAA, int first, int firstOffset, String lastAA, int last, int lastOffset)
-
buildDownstreamOfTerminal
public static ProteinRange buildDownstreamOfTerminal(String firstAA, int first, String lastAA, int last)
-
getFirst
public ProteinPointLocation getFirst()
- Returns:
- location of the first amino acid in the range
-
getLast
public ProteinPointLocation getLast()
- Returns:
- location of the last amino acid in the range
-
length
public int length()
- Returns:
- length of the range
-
toHGVSString
public String toHGVSString()
Description copied from interface:ConvertibleToHGVSString
Return HGVS representation in three-letter amino acid code.- Specified by:
toHGVSString
in interfaceConvertibleToHGVSString
- Returns:
- HGVS representation, e.g. "133L" for an
ProteinPointLocation
-
toHGVSString
public String toHGVSString(AminoAcidCode code)
Description copied from interface:ConvertibleToHGVSString
Return HGVS representation using the given amino acid code.- Specified by:
toHGVSString
in interfaceConvertibleToHGVSString
- Parameters:
code
-AminoAcidCode
to use- Returns:
- HGVS representation, e.g. "133L" for an
ProteinPointLocation
-
-