this.record = record;
this.flags = record.getFlags();
String refName = record.getReferenceName();
Genome genome = GenomeManager.getInstance().getCurrentGenome();
this.chr = genome == null ? refName : genome.getChromosomeAlias(refName);
// SAMRecord is 1 based inclusive. IGV is 0 based exclusive.
this.end = record.getAlignmentEnd(); // might be modified later for soft clipping
this.start = record.getAlignmentStart() - 1; // might be modified later for soft clipping
if (record.getReadPairedFlag()) {
String mateReferenceName = record.getMateReferenceName();
String mateChr = genome == null ? mateReferenceName : genome.getChromosomeAlias(mateReferenceName);
this.setMate(new ReadMate(mateChr,
record.getMateAlignmentStart() - 1,
record.getMateNegativeStrandFlag(),
record.getMateUnmappedFlag()));
}