Serializable
, Iterable<CigarElement>
public class Cigar extends Object implements Serializable, Iterable<CigarElement>
Modifier and Type | Field | Description |
---|---|---|
static long |
serialVersionUID |
Constructor | Description |
---|---|
Cigar() |
|
Cigar(List<CigarElement> cigarElements) |
Modifier and Type | Method | Description |
---|---|---|
void |
add(CigarElement cigarElement) |
|
boolean |
containsOperator(CigarOperator operator) |
returns true if the cigar string contains the given operator
|
boolean |
equals(Object o) |
|
static Cigar |
fromCigarOperators(List<CigarOperator> cigarOperators) |
build a new Cigar object from a list of cigar operators.
|
CigarElement |
getCigarElement(int i) |
|
List<CigarElement> |
getCigarElements() |
|
CigarElement |
getFirstCigarElement() |
returns the first cigar element
|
CigarElement |
getLastCigarElement() |
returns the last cigar element
|
int |
getPaddedReferenceLength() |
|
int |
getReadLength() |
|
static int |
getReadLength(List<CigarElement> cigarElements) |
|
int |
getReferenceLength() |
|
int |
hashCode() |
|
boolean |
isClipped() |
returns true if the cigar is clipped
|
boolean |
isEmpty() |
|
boolean |
isLeftClipped() |
returns true if the cigar string starts With a clipping operator
|
boolean |
isRightClipped() |
returns true if the cigar string ends With a clipping operator
|
List<SAMValidationError> |
isValid(String readName,
long recordNumber) |
Exhaustive validation of CIGAR.
|
Iterator<CigarElement> |
iterator() |
shortcut to
getCigarElements().iterator() |
int |
numCigarElements() |
|
String |
toString() |
forEach, spliterator
public static final long serialVersionUID
public Cigar()
public Cigar(List<CigarElement> cigarElements)
public List<CigarElement> getCigarElements()
public CigarElement getCigarElement(int i)
public void add(CigarElement cigarElement)
public int numCigarElements()
public boolean isEmpty()
public int getReferenceLength()
public int getPaddedReferenceLength()
public int getReadLength()
public static int getReadLength(List<CigarElement> cigarElements)
public List<SAMValidationError> isValid(String readName, long recordNumber)
readName
- For error reporting only. May be null if not known.recordNumber
- For error reporting only. May be -1 if not known.public static Cigar fromCigarOperators(List<CigarOperator> cigarOperators)
[M,M,M,M,M,M,M,M,M,M]
, here
fromCigarOperators would generate the cigar '10M'
later the user resolved the 'M' to '=' or 'X', the array is now
[=,=,=,=,=,X,X,=,=,=]
fromCigarOperators would generate the cigar '5M2X3M'public Iterator<CigarElement> iterator()
getCigarElements().iterator()
iterator
in interface Iterable<CigarElement>
public boolean containsOperator(CigarOperator operator)
public CigarElement getFirstCigarElement()
public CigarElement getLastCigarElement()
public boolean isLeftClipped()
public boolean isRightClipped()
public boolean isClipped()