public String getProgramGroup() { return getAttribute(PROGRAM_GROUP_TAG); } public void setProgramGroup(final String programGroup) { setAttribute(PROGRAM_GROUP_TAG, programGroup); }
public String getPlatformUnit() { return getAttribute(PLATFORM_UNIT_TAG); } public void setPlatformUnit(final String pu) { setAttribute(PLATFORM_UNIT_TAG, pu); }
public String getPlatform() { return getAttribute(PLATFORM_TAG); } public void setPlatform(final String platform) { setAttribute(PLATFORM_TAG, platform); }
public String getLibrary() { return getAttribute(LIBRARY_TAG); } public void setLibrary(final String value) { setAttribute(LIBRARY_TAG, value); }
public String getSequencingCenter() { return getAttribute(SEQUENCING_CENTER_TAG); } public void setSequencingCenter(final String center) { setAttribute(SEQUENCING_CENTER_TAG, center); }
public String getSample() { return getAttribute(READ_GROUP_SAMPLE_TAG); } public void setSample(final String value) { setAttribute(READ_GROUP_SAMPLE_TAG, value); }
public String getSample() { return getAttribute(READ_GROUP_SAMPLE_TAG); } public void setSample(final String value) { setAttribute(READ_GROUP_SAMPLE_TAG, value); }
public String getLibrary() { return getAttribute(LIBRARY_TAG); } public void setLibrary(final String value) { setAttribute(LIBRARY_TAG, value); }
public String getDescription() { return getAttribute(DESCRIPTION_TAG); } public void setDescription(final String description) { setAttribute(DESCRIPTION_TAG, description); }
public String getPlatform() { return getAttribute(PLATFORM_TAG); } public void setPlatform(final String platform) { setAttribute(PLATFORM_TAG, platform); }
public Integer getPredictedMedianInsertSize() { final String stringRep = getAttribute(PREDICTED_MEDIAN_INSERT_SIZE_TAG); if (stringRep == null) return null; return Integer.parseInt(stringRep); } public void setPredictedMedianInsertSize(final Integer predictedMedianInsertSize) {
public Integer getPredictedMedianInsertSize() { final String stringRep = getAttribute(PREDICTED_MEDIAN_INSERT_SIZE_TAG); if (stringRep == null) return null; return Integer.parseInt(stringRep); } public void setPredictedMedianInsertSize(final Integer predictedMedianInsertSize) {
public Integer getPredictedMedianInsertSize() { final String stringRep = getAttribute(PREDICTED_MEDIAN_INSERT_SIZE_TAG); if (stringRep == null) return null; return Integer.parseInt(stringRep); } public void setPredictedMedianInsertSize(final Integer predictedMedianInsertSize) {
/** * @return the List of barcodes associated with this read group or null */ public List<String> getBarcodes() { final String barcodeString = getAttribute(BARCODE_TAG); if (barcodeString == null) { return null; } else if (barcodeString.isEmpty()) { return Collections.emptyList(); } else { return Arrays.asList(barcodeString.split(SamConstants.BARCODE_SEQUENCE_DELIMITER)); } }
public Date getRunDate() { final String dt = getAttribute(DATE_RUN_PRODUCED_TAG); if (dt == null) return null; else return new Iso8601Date(dt); }
public Date getRunDate() { final String dt = getAttribute(DATE_RUN_PRODUCED_TAG); if (dt == null) return null; else return new Iso8601Date(dt); }
public Date getRunDate() { final String dt = getAttribute(DATE_RUN_PRODUCED_TAG); if (dt == null) return null; else return new Iso8601Date(dt); }
public boolean filterOut(SAMRecord samRecord) { if ( blackListedLanes.size() == 0 ) return false; // no filters set, nothing to do Object pu_attr = samRecord.getAttribute("PU"); if ( pu_attr == null ) { // no platform unit in the record, go get from read group SAMReadGroupRecord rgr = samRecord.getReadGroup(); if ( rgr == null ) throw new UserException.MalformedBAM(samRecord, "Read " + samRecord.getReadName() +" has NO associated read group record"); pu_attr = rgr.getAttribute("PU") ; } if ( pu_attr == null ) return false; // could not get PU, forget about the filtering... return blackListedLanes.contains((String)pu_attr); }
@Test(dataProvider = "getBarcodes") public void testGetAndSetBarcodes(List<String> barcodes, String encoded){ final SAMReadGroupRecord readGroup = new SAMReadGroupRecord("ReadGroup"); Assert.assertNull(readGroup.getBarcodes()); Assert.assertNull(readGroup.getAttribute(SAMReadGroupRecord.BARCODE_TAG)); readGroup.setBarcodes(barcodes); Assert.assertEquals(readGroup.getBarcodes(), barcodes); Assert.assertEquals(readGroup.getAttribute(SAMReadGroupRecord.BARCODE_TAG), encoded); } }
private boolean compareReadGroup(final SAMReadGroupRecord samReadGroupRecord1, final SAMReadGroupRecord samReadGroupRecord2) { boolean ret = compareValues(samReadGroupRecord1.getReadGroupId(), samReadGroupRecord2.getReadGroupId(), "Read Group ID"); ret = compareValues(samReadGroupRecord1.getSample(), samReadGroupRecord2.getSample(), "Sample for read group " + samReadGroupRecord1.getReadGroupId()) && ret; ret = compareValues(samReadGroupRecord1.getLibrary(), samReadGroupRecord2.getLibrary(), "Library for read group " + samReadGroupRecord1.getReadGroupId()) && ret; final String[] attributes = {"DS", "PU", "PI", "CN", "DT", "PL"}; for (final String attribute : attributes) { ret = compareValues(samReadGroupRecord1.getAttribute(attribute), samReadGroupRecord2.getAttribute(attribute), attribute + " for read group " + samReadGroupRecord1.getReadGroupId()) && ret; } return ret; }