Source:
public void addMatePairWithUmi(final String readName, final int referenceSequenceIndex1, final int referenceSequenceIndex2, final int alignmentStart1, final int alignmentStart2, final boolean record1Unmapped, final boolean record2Unmapped, final boolean isDuplicate1, final boolean isDuplicate2, final String cigar1, final String cigar2, final boolean strand1, final boolean strand2, final boolean firstOnly, final boolean record1NonPrimary, final boolean record2NonPrimary, final int defaultQuality, final String umi, final String assignedUMI) { final List<SAMRecord> samRecordList = samRecordSetBuilder.addPair(readName, referenceSequenceIndex1, referenceSequenceIndex2, alignmentStart1, alignmentStart2, record1Unmapped, record2Unmapped, cigar1, cigar2, strand1, strand2, record1NonPrimary, record2NonPrimary, defaultQuality); final SAMRecord record1 = samRecordList.get(0); final SAMRecord record2 = samRecordList.get(1); if (this.noMateCigars) { record1.setAttribute("MC", null); record2.setAttribute("MC", null); } if (firstOnly) { samRecordSetBuilder.getRecords().remove(record2); } final String key1 = samRecordToDuplicatesFlagsKey(record1); Assert.assertFalse(this.duplicateFlags.containsKey(key1)); this.duplicateFlags.put(key1, isDuplicate1); final String key2 = samRecordToDuplicatesFlagsKey(record2); Assert.assertFalse(this.duplicateFlags.containsKey(key2)); this.duplicateFlags.put(key2, isDuplicate2); if(umi != null) { record1.setAttribute("RX", umi); record2.setAttribute("RX", umi); } if(assignedUMI != null) { record1.setAttribute("RE", assignedUMI); record2.setAttribute("RE", assignedUMI); } }

Target:
public void addMatePairWithUmi(final String readName, final int referenceSequenceIndex1, final int referenceSequenceIndex2, final int alignmentStart1, final int alignmentStart2, final boolean record1Unmapped, final boolean record2Unmapped, final boolean isDuplicate1, final boolean isDuplicate2, final String cigar1, final String cigar2, final boolean strand1, final boolean strand2, final boolean firstOnly, final boolean record1NonPrimary, final boolean record2NonPrimary, final int defaultQuality, final String umi, final String assignedUMI) { final List<SAMRecord> samRecordList = samRecordSetBuilder.addPair(readName, referenceSequenceIndex1, referenceSequenceIndex2, alignmentStart1, alignmentStart2, record1Unmapped, record2Unmapped, cigar1, cigar2, strand1, strand2, record1NonPrimary, record2NonPrimary, defaultQuality); final SAMRecord record1 = samRecordList.get(0); final SAMRecord record2 = samRecordList.get(1); if (this.noMateCigars) { record1.setAttribute("MC", null); record2.setAttribute("MC", null); } if (firstOnly) { samRecordSetBuilder.getRecords().remove(record2); } final String key1 = samRecordToDuplicatesFlagsKey(record1); Assert.assertFalse(this.duplicateFlags.containsKey(key1)); this.duplicateFlags.put(key1, isDuplicate1); final String key2 = samRecordToDuplicatesFlagsKey(record2); Assert.assertFalse(this.duplicateFlags.containsKey(key2)); this.duplicateFlags.put(key2, isDuplicate2); if (umi != null) { record1.setAttribute("RX", umi); record2.setAttribute("RX", umi); } if (assignedUMI != null) { record1.setAttribute(expectedUmiTag, assignedUMI); record2.setAttribute(expectedUmiTag, assignedUMI); } }