| 1 |
package org.broadinstitute.hellbender.utils.bwa; |
| 2 |
|
| 3 |
/** |
| 4 |
* Info from the Aligner about an alignment to reference that it discovered for some sequence. |
| 5 |
* Please note that the refId is with respect to the BWA index reference names. These won't necessarily agree with |
| 6 |
* reference IDs in SAM or BAM headers. |
| 7 |
*/ |
| 8 |
public class BwaMemAlignment { |
| 9 |
private final int samFlag; // flag bits per SAM format standard |
| 10 |
private final int refId; // index into reference dictionary (-1 if unmapped) |
| 11 |
private final int refStart; // 0-based coordinate, inclusive (-1 if unmapped) |
| 12 |
private final int refEnd; // 0-based coordinate, exclusive (-1 if unmapped) |
| 13 |
private final int seqStart; // 0-based coordinate, inclusive (-1 if unmapped) |
| 14 |
private final int seqEnd; // 0-based coordinate, exclusive (-1 if unmapped) |
| 15 |
private final int mapQual; // phred-scaled mapping quality (-1 if unmapped) |
| 16 |
private final int nMismatches; // number of mismatches (i.e., value of the NM tag in a SAM/BAM) (-1 if unmapped) |
| 17 |
private final int alignerScore; // for AS tag |
| 18 |
private final int suboptimalScore; // for bwa-specific XS tag |
| 19 |
private final String cigar; // cigar for alignment (empty if unmapped) |
| 20 |
private final String mdTag; // the MD tag |
| 21 |
private final String xaTag; // the XA tag |
| 22 |
private final int mateRefId; // mate's refId (-1 if unpaired or if mate unmapped) |
| 23 |
private final int mateRefStart;// mate's reference start (-1 if unpaired or if mate unmapped) |
| 24 |
private final int templateLen; // inferred template length (0 if unpaired, mate unmapped, or on different ref contigs) |
| 25 |
|
| 26 |
public BwaMemAlignment(final int samFlag, final int refId, final int refStart, final int refEnd, |
| 27 |
final int seqStart, final int seqEnd, final int mapQual, |
| 28 |
final int nMismatches, final int alignerScore, final int suboptimalScore, |
| 29 |
final String cigar, final String mdTag, final String xaTag, |
| 30 |
final int mateRefId, final int mateRefStart, final int templateLen ) { |
| 31 |
this.samFlag = samFlag; |
| 32 |
this.refId = refId; |
| 33 |
this.refStart = refStart; |
| 34 |
this.refEnd = refEnd; |
| 35 |
this.seqStart = seqStart; |
| 36 |
this.seqEnd = seqEnd; |
| 37 |
this.mapQual = mapQual; |
| 38 |
this.nMismatches = nMismatches; |
| 39 |
this.alignerScore = alignerScore; |
| 40 |
this.suboptimalScore = suboptimalScore; |
| 41 |
this.cigar = cigar; |
| 42 |
this.mdTag = mdTag; |
| 43 |
this.xaTag = xaTag; |
| 44 |
this.mateRefId = mateRefId; |
| 45 |
this.mateRefStart = mateRefStart; |
| 46 |
this.templateLen = templateLen; |
| 47 |
} |
| 48 |
|
| 49 |
public int getSamFlag() { return samFlag; } |
| 50 |
public int getRefId() { return refId; } |
| 51 |
public int getRefStart() { return refStart; } |
| 52 |
public int getRefEnd() { return refEnd; } |
| 53 |
public int getSeqStart() { return seqStart; } |
| 54 |
public int getSeqEnd() { return seqEnd; } |
| 55 |
public int getMapQual() { return mapQual; } |
| 56 |
public int getNMismatches() { return nMismatches; } |
| 57 |
public int getAlignerScore() { return alignerScore; } |
| 58 |
public int getSuboptimalScore() { return suboptimalScore; } |
| 59 |
public String getCigar() { return cigar; } |
| 60 |
public String getMDTag() { return mdTag; } |
| 61 |
public String getXATag() { return xaTag; } |
| 62 |
public int getMateRefId() { return mateRefId; } |
| 63 |
public int getMateRefStart() { return mateRefStart; } |
| 64 |
public int getTemplateLen() { return templateLen; } |
| 65 |
} |