@Override public String getId() { return getProgramGroupId(); }
@Override public String getId() { return getProgramGroupId(); }
public String getId() { return getProgramGroupId(); }
public void addProgramRecord(final SAMProgramRecord programRecord) { if (mProgramRecordMap.containsKey(programRecord.getProgramGroupId())) { throw new IllegalArgumentException("Program record with group id " + programRecord.getProgramGroupId() + " already exists in SAMFileHeader!"); } this.mProgramRecords.add(programRecord); this.mProgramRecordMap.put(programRecord.getProgramGroupId(), programRecord); }
public void addProgramRecord(final SAMProgramRecord programRecord) { if (mProgramRecordMap.containsKey(programRecord.getProgramGroupId())) { throw new IllegalArgumentException("Program record with group id " + programRecord.getProgramGroupId() + " already exists in SAMFileHeader!"); } this.mProgramRecords.add(programRecord); this.mProgramRecordMap.put(programRecord.getProgramGroupId(), programRecord); }
public void addProgramRecord(final SAMProgramRecord programRecord) { if (mProgramRecordMap.containsKey(programRecord.getProgramGroupId())) { throw new IllegalArgumentException("Program record with group id " + programRecord.getProgramGroupId() + " already exists in SAMFileHeader!"); } this.mProgramRecords.add(programRecord); this.mProgramRecordMap.put(programRecord.getProgramGroupId(), programRecord); }
/** * Replace entire list of program records * @param programRecords This list is used directly, not copied. */ public void setProgramRecords(final List<SAMProgramRecord> programRecords) { this.mProgramRecords = programRecords; this.mProgramRecordMap.clear(); for (final SAMProgramRecord programRecord : this.mProgramRecords) { this.mProgramRecordMap.put(programRecord.getProgramGroupId(), programRecord); } }
/** * Replace entire list of program records * @param programRecords This list is used directly, not copied. */ public void setProgramRecords(final List<SAMProgramRecord> programRecords) { this.mProgramRecords = programRecords; this.mProgramRecordMap.clear(); for (final SAMProgramRecord programRecord : this.mProgramRecords) { this.mProgramRecordMap.put(programRecord.getProgramGroupId(), programRecord); } }
/** * Replace entire list of program records * @param programRecords This list is used directly, not copied. */ public void setProgramRecords(final List<SAMProgramRecord> programRecords) { this.mProgramRecords = programRecords; this.mProgramRecordMap.clear(); for (final SAMProgramRecord programRecord : this.mProgramRecords) { this.mProgramRecordMap.put(programRecord.getProgramGroupId(), programRecord); } }
/** * Do this unconditionally, not just for aligned records, for two reasons: * - An unaligned read has been processed by the aligner, so it is more truthful. * - When chaining additional PG records, having all the records in the output file refer to the same PG * record means that only one chain will need to be created, rather than a chain for the mapped reads * and a separate chain for the unmapped reads. */ private void maybeSetPgTag(final SAMRecord rec) { if (this.programRecord != null && addPGTagToReads) { rec.setAttribute(ReservedTagConstants.PROGRAM_GROUP_ID, this.programRecord.getProgramGroupId()); } }
public PgIdGenerator(final SAMFileHeader header) { for (final SAMProgramRecord pgRecord : header.getProgramRecords()) { idsThatAreAlreadyTaken.add(pgRecord.getProgramGroupId()); } recordCounter = idsThatAreAlreadyTaken.size(); }
public PgIdGenerator(final SAMFileHeader header) { for (final SAMProgramRecord pgRecord : header.getProgramRecords()) { idsThatAreAlreadyTaken.add(pgRecord.getProgramGroupId()); } recordCounter = idsThatAreAlreadyTaken.size(); }
/** * Do this unconditionally, not just for aligned records, for two reasons: * - An unaligned read has been processed by the aligner, so it is more truthful. * - When chaining additional PG records, having all the records in the output file refer to the same PG * record means that only one chain will need to be created, rather than a chain for the mapped reads * and a separate chain for the unmapped reads. */ private void maybeSetPgTag(final SAMRecord rec) { if (this.programRecord != null && addPGTagToReads) { rec.setAttribute(ReservedTagConstants.PROGRAM_GROUP_ID, this.programRecord.getProgramGroupId()); } }
@Override String getGroupId(AbstractSAMHeaderRecord group) { return ((SAMProgramRecord) group).getProgramGroupId(); }
private boolean compareProgramRecord(final SAMProgramRecord programRecord1, final SAMProgramRecord programRecord2) { if (programRecord1 == null && programRecord2 == null) { return true; } if (programRecord1 == null) { reportDifference("null", programRecord2.getProgramGroupId(), "Program Record"); return false; } if (programRecord2 == null) { reportDifference(programRecord1.getProgramGroupId(), "null", "Program Record"); return false; } boolean ret = compareValues(programRecord1.getProgramGroupId(), programRecord2.getProgramGroupId(), "Program Name"); final String[] attributes = {"VN", "CL"}; for (final String attribute : attributes) { ret = compareValues(programRecord1.getAttribute(attribute), programRecord2.getAttribute(attribute), attribute + " Program Record attribute") && ret; } return ret; }
private boolean compareProgramRecord(final SAMProgramRecord programRecord1, final SAMProgramRecord programRecord2) throws Exception { if (programRecord1 == null && programRecord2 == null) { return true; } if (programRecord1 == null) { reportDifference("null", programRecord2.getProgramGroupId(), "Program Record"); return false; } if (programRecord2 == null) { reportDifference(programRecord1.getProgramGroupId(), "null", "Program Record"); return false; } boolean ret = compareValues(programRecord1.getProgramGroupId(), programRecord2.getProgramGroupId(), "Program Name"); final String[] attributes = {"VN", "CL"}; for (final String attribute : attributes) { ret = compareValues(programRecord1.getAttribute(attribute), programRecord2.getAttribute(attribute), attribute + " Program Record attribute") && ret; } return ret; }
private boolean compareProgramRecord(final SAMProgramRecord programRecord1, final SAMProgramRecord programRecord2) { if (programRecord1 == null && programRecord2 == null) { return true; } if (programRecord1 == null) { reportDifference("null", programRecord2.getProgramGroupId(), "Program Record"); return false; } if (programRecord2 == null) { reportDifference(programRecord1.getProgramGroupId(), "null", "Program Record"); return false; } boolean ret = compareValues(programRecord1.getProgramGroupId(), programRecord2.getProgramGroupId(), "Program Name"); final String[] attributes = {"VN", "CL"}; for (final String attribute : attributes) { ret = compareValues(programRecord1.getAttribute(attribute), programRecord2.getAttribute(attribute), attribute + " Program Record attribute") && ret; } return ret; }
protected String getPGLine(final SAMProgramRecord programRecord) { final String[] fields = new String[2 + programRecord.getAttributes().size()]; fields[0] = HEADER_LINE_START + HeaderRecordType.PG; fields[1] = SAMProgramRecord.PROGRAM_GROUP_ID_TAG + TAG_KEY_VALUE_SEPARATOR + programRecord.getProgramGroupId(); encodeTags(programRecord, fields, 2); return StringUtil.join(FIELD_SEPARATOR, fields); }
protected String getPGLine(final SAMProgramRecord programRecord) { final String[] fields = new String[2 + programRecord.getAttributes().size()]; fields[0] = HEADER_LINE_START + HeaderRecordType.PG; fields[1] = SAMProgramRecord.PROGRAM_GROUP_ID_TAG + TAG_KEY_VALUE_SEPARATOR + programRecord.getProgramGroupId(); encodeTags(programRecord, fields, 2); return StringUtil.join(FIELD_SEPARATOR, fields); }
private void writePGLine(final SAMProgramRecord programRecord) { if (programRecord == null) { return; } final String[] fields = new String[2 + programRecord.getAttributes().size()]; fields[0] = HEADER_LINE_START + HeaderRecordType.PG; fields[1] = SAMProgramRecord.PROGRAM_GROUP_ID_TAG + TAG_KEY_VALUE_SEPARATOR + programRecord.getProgramGroupId(); encodeTags(programRecord, fields, 2); println(StringUtil.join(FIELD_SEPARATOR, fields)); }