# Class SamEntry

java.lang.Object
org.snpeff.sam.SamEntry

public class SamEntry extends Object
An entry in a SAM file References: http://samtools.sourceforge.net/SAM-1.3.pdf

Author:
  pcingola

## Constructor Summary

Constructors
Constructor
Description
`SamEntry(String line)`
Create an entry give a line from a file

## Method Summary

Modifier and Type
Method
Description
`String`
`findTag(String tagName)`
Does this entry have a tag?
`String`
`getCigar()`
`int`
`getFlag()`
`String`
`getId()`
`String`
`getLine()`
`int`
`getMapq()`
`int`
`getPnext()`
`int`
`getPos()`
`String`
`getQname()`
`String`
`getQual()`
`String`
`getRname()`
`String`
`getRnext()`
`String`
`getSeq()`
`int`
`getTlen()`
`boolean`
`hasMapq()`
Some aligners just use '255' in the mapping quality field (bowtie)
`boolean`
`isDuplicate()`
PCR or optical duplicate
`boolean`
`isFirstFragment()`
The first fragment in the template
`boolean`
`isLastFragment()`
The last fragment in the template
`boolean`
`isMapped()`
Is this entry mapped to the genome?
`boolean`
`isMultipleFragments()`
Template having multiple fragments in sequencing
`boolean`
`isMultipleHits()`
Is this read mapped to multiple genomic locations?
`boolean`
`isNextReverseWc()`
SEQ of the next fragment in the template being reversed
`boolean`
`isNextUnmapped()`
Next fragment in the template unmapped
`boolean`
`isNotQualityControl()`
Not passing quality controls
`boolean`
`isProperlyAligned()`
Each fragment properly aligned according to the aligner
`boolean`
`isReverseWc()`
SEQ being reverse complemented
`boolean`
`isSecondaryAlignment()`
Secondary alignment
`boolean`
`isUniqueHit()`
Is this read mapped to only one genomic locations?
`boolean`
`isUnmapped()`
Fragment unmapped
`void`
`replaceSeq(String newSeq)`
Replace a sequence WARNING: Doing this might invalidate the CIGAR field
`static String`
`samLine2Id(String line)`
Get an ID from a SAM line
`String`
`toString()`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Constructor Details

### SamEntry

public SamEntry(String line)
Create an entry give a line from a file

## Method Details

### samLine2Id

public static String samLine2Id(String line)
Get an ID from a SAM line

### findTag

public String findTag(String tagName)
Does this entry have a tag?

### getCigar

public String getCigar()

### getFlag

public int getFlag()

### getId

public String getId()

### getLine

public String getLine()

### getMapq

public int getMapq()

### getPnext

public int getPnext()

### getPos

public int getPos()

### getQname

public String getQname()

### getQual

public String getQual()

### getRname

public String getRname()

### getRnext

public String getRnext()

### getSeq

public String getSeq()

### getTlen

public int getTlen()

### hasMapq

public boolean hasMapq()
Some aligners just use '255' in the mapping quality field (bowtie)

### isDuplicate

public boolean isDuplicate()
PCR or optical duplicate

### isFirstFragment

public boolean isFirstFragment()
The first fragment in the template

### isLastFragment

public boolean isLastFragment()
The last fragment in the template

### isMapped

public boolean isMapped()
Is this entry mapped to the genome?

### isMultipleFragments

public boolean isMultipleFragments()
Template having multiple fragments in sequencing

### isMultipleHits

public boolean isMultipleHits()
Is this read mapped to multiple genomic locations?

### isNextReverseWc

public boolean isNextReverseWc()
SEQ of the next fragment in the template being reversed

### isNextUnmapped

public boolean isNextUnmapped()
Next fragment in the template unmapped

### isNotQualityControl

public boolean isNotQualityControl()
Not passing quality controls

### isProperlyAligned

public boolean isProperlyAligned()
Each fragment properly aligned according to the aligner

### isReverseWc

public boolean isReverseWc()
SEQ being reverse complemented

### isSecondaryAlignment

public boolean isSecondaryAlignment()
Secondary alignment

### isUniqueHit

public boolean isUniqueHit()
Is this read mapped to only one genomic locations?

Returns:

### isUnmapped

public boolean isUnmapped()
Fragment unmapped

### replaceSeq

public void replaceSeq(String newSeq)
Replace a sequence WARNING: Doing this might invalidate the CIGAR field

Parameters:
  `newSeq` -

### toString

public String toString()

Overrides:
  `toString` in class `Object`