@Override void setAttribute(AbstractSAMHeaderRecord group, String value) { ((SAMReadGroupRecord) group).setPlatformUnit(value); }
private FingerprintIdDetails createUnknownFP(final Path samFile, final SAMRecord rec) { final PicardException e = new PicardException("Found read with no readgroup: " + rec.getReadName() + " in file: " + samFile); if (validationStringency != ValidationStringency.STRICT) { final SAMReadGroupRecord readGroupRecord = new SAMReadGroupRecord("<UNKNOWN>:::" + samFile.toUri().toString()); readGroupRecord.setLibrary("<UNKNOWN>"); readGroupRecord.setSample("<UNKNOWN>"); readGroupRecord.setPlatformUnit("<UNKNOWN>.0.ZZZ"); if (validationStringency == ValidationStringency.LENIENT) { log.warn(e); log.warn("further messages from this file will be suppressed"); } return new FingerprintIdDetails(readGroupRecord, samFile.toUri().toString()); } else { log.error(e); throw e; } }
private FingerprintIdDetails createUnknownFP(final Path samFile, final SAMRecord rec) { final PicardException e = new PicardException("Found read with no readgroup: " + rec.getReadName() + " in file: " + samFile); if (validationStringency != ValidationStringency.STRICT) { final SAMReadGroupRecord readGroupRecord = new SAMReadGroupRecord("<UNKNOWN>:::" + samFile.toUri().toString()); readGroupRecord.setLibrary("<UNKNOWN>"); readGroupRecord.setSample("<UNKNOWN>"); readGroupRecord.setPlatformUnit("<UNKNOWN>.0.ZZZ"); if (validationStringency == ValidationStringency.LENIENT) { log.warn(e); log.warn("further messages from this file will be suppressed"); } return new FingerprintIdDetails(readGroupRecord, samFile.toUri().toString()); } else { log.error(e); throw e; } }
@DataProvider(name="UsualSuspects") public Object[][] createData() { final SAMReadGroupRecord left = new SAMReadGroupRecord("left"); left.setPlatformUnit("left.1"); left.setLibrary("library"); final SAMReadGroupRecord right = new SAMReadGroupRecord("right"); right.setPlatformUnit("right.1"); right.setLibrary("library"); right.setDescription("description"); return new Object[][] {{ left, right }}; }
void setup(final int numReads, final String readName, final int ID, final String readGroupId, final SAMReadGroupRecord readGroupRecord, final String sample, final String library, final SAMFileHeader header, final SAMRecordSetBuilder setBuilder) throws IOException { final String separator = ":"; readGroupRecord.setSample(sample); readGroupRecord.setPlatform(platform); readGroupRecord.setLibrary(library); readGroupRecord.setPlatformUnit(readGroupId); header.addReadGroup(readGroupRecord); setBuilder.setReadGroup(readGroupRecord); setBuilder.setUseNmFlag(true); setBuilder.setHeader(header); final int max = 15000; final int min = 1; final Random rg = new Random(5); for (int i = 0; i < numReads; i++) { final int start = rg.nextInt(max) + min; final String newReadName = readName + separator + ID + separator + i; setBuilder.addPair(newReadName, 0, start + ID, start + ID + 99); } }
readgroup.setPlatformUnit(RG.getExperiment().getPlatformUnit());
readgroup.setPlatformUnit(RG.getExperiment().getPlatformUnit());
readGroupRecord.setPlatform(platform); readGroupRecord.setLibrary(library); readGroupRecord.setPlatformUnit(readGroupId); setBuilder.setReadGroup(readGroupRecord); setBuilder.setUseNmFlag(true);
public void setupTest1(final int ID, final String readGroupId, final SAMReadGroupRecord readGroupRecord, final String sample, final String library, final SAMFileHeader header, final SAMRecordSetBuilder setBuilder) throws IOException { final String separator = ":"; final int contig1 = 0; final int contig2 = 1; readGroupRecord.setSample(sample); readGroupRecord.setPlatform(platform); readGroupRecord.setLibrary(library); readGroupRecord.setPlatformUnit(readGroupId); header.addReadGroup(readGroupRecord); setBuilder.setReadGroup(readGroupRecord); setBuilder.setUseNmFlag(true); setBuilder.setHeader(header); final int max = 800; final int min = 1; final Random rg = new Random(5); //add records that align to chrM and O but not N for (int i = 0; i < NUM_READS; i++) { final int start = rg.nextInt(max) + min; final String newReadName = READ_NAME + separator + ID + separator + i; if (i != NUM_READS - 1) { setBuilder.addPair(newReadName, contig1, start + ID, start + ID + LENGTH); } else { setBuilder.addPair(newReadName, contig2, start + ID, start + ID + LENGTH); } } }
/** Creates a simple header with the values provided on the command line. */ public SAMFileHeader createSamFileHeader() { final SAMReadGroupRecord rgroup = new SAMReadGroupRecord(this.READ_GROUP_NAME); rgroup.setSample(this.SAMPLE_NAME); if (this.LIBRARY_NAME != null) rgroup.setLibrary(this.LIBRARY_NAME); if (this.PLATFORM != null) rgroup.setPlatform(this.PLATFORM); if (this.PLATFORM_UNIT != null) rgroup.setPlatformUnit(this.PLATFORM_UNIT); if (this.SEQUENCING_CENTER != null) rgroup.setSequencingCenter(SEQUENCING_CENTER); if (this.PREDICTED_INSERT_SIZE != null) rgroup.setPredictedMedianInsertSize(PREDICTED_INSERT_SIZE); if (this.DESCRIPTION != null) rgroup.setDescription(this.DESCRIPTION); if (this.RUN_DATE != null) rgroup.setRunDate(this.RUN_DATE); if (this.PLATFORM_MODEL != null) rgroup.setPlatformModel(this.PLATFORM_MODEL); if (this.PROGRAM_GROUP != null) rgroup.setProgramGroup(this.PROGRAM_GROUP); final SAMFileHeader header = new SAMFileHeader(); header.addReadGroup(rgroup); for (final String comment : COMMENT) { header.addComment(comment); } header.setSortOrder(this.SORT_ORDER); return header ; }
/** Creates a simple header with the values provided on the command line. */ public SAMFileHeader createSamFileHeader() { final SAMReadGroupRecord rgroup = new SAMReadGroupRecord(this.READ_GROUP_NAME); rgroup.setSample(this.SAMPLE_NAME); if (this.LIBRARY_NAME != null) rgroup.setLibrary(this.LIBRARY_NAME); if (this.PLATFORM != null) rgroup.setPlatform(this.PLATFORM); if (this.PLATFORM_UNIT != null) rgroup.setPlatformUnit(this.PLATFORM_UNIT); if (this.SEQUENCING_CENTER != null) rgroup.setSequencingCenter(SEQUENCING_CENTER); if (this.PREDICTED_INSERT_SIZE != null) rgroup.setPredictedMedianInsertSize(PREDICTED_INSERT_SIZE); if (this.DESCRIPTION != null) rgroup.setDescription(this.DESCRIPTION); if (this.RUN_DATE != null) rgroup.setRunDate(this.RUN_DATE); if (this.PLATFORM_MODEL != null) rgroup.setPlatformModel(this.PLATFORM_MODEL); if (this.PROGRAM_GROUP != null) rgroup.setProgramGroup(this.PROGRAM_GROUP); final SAMFileHeader header = new SAMFileHeader(); header.addReadGroup(rgroup); for (final String comment : COMMENT) { header.addComment(comment); } header.setSortOrder(this.SORT_ORDER); return header ; }
readGroupRecord.setPlatform(platform); readGroupRecord.setLibrary(library); readGroupRecord.setPlatformUnit(readGroupId); header.addReadGroup(readGroupRecord);
readGroupRecord.setPlatform(PLATFORM); readGroupRecord.setLibrary(LIBRARY); readGroupRecord.setPlatformUnit(READ_GROUP_ID); header.addReadGroup(readGroupRecord);
protected static SAMRecordSetBuilder createTestSAMBuilder(final File reference, final String readGroupId, final String sample, final String platform, final String library) { final SAMFileHeader header = new SAMFileHeader(); // check that dictionary file is readable and then set header dictionary try { header.setSequenceDictionary(SAMSequenceDictionaryExtractor.extractDictionary(reference.toPath())); header.setSortOrder(SAMFileHeader.SortOrder.unsorted); } catch (final SAMException e) { e.printStackTrace(); } // set readGroupRecord final SAMReadGroupRecord readGroupRecord = new SAMReadGroupRecord(readGroupId); readGroupRecord.setSample(sample); readGroupRecord.setPlatform(platform); readGroupRecord.setLibrary(library); readGroupRecord.setPlatformUnit(readGroupId); header.addReadGroup(readGroupRecord); final SAMRecordSetBuilder setBuilder = new SAMRecordSetBuilder(true, SAMFileHeader.SortOrder.coordinate, true, 100); setBuilder.setReadGroup(readGroupRecord); setBuilder.setUseNmFlag(true); setBuilder.setHeader(header); return(setBuilder); }
rg.setPlatform(RGPL); rg.setSample(RGSM); rg.setPlatformUnit(RGPU); if (RGCN != null) rg.setSequencingCenter(RGCN); if (RGDS != null) rg.setDescription(RGDS);
rg.setPlatform(RGPL); rg.setSample(RGSM); rg.setPlatformUnit(RGPU); if (RGCN != null) rg.setSequencingCenter(RGCN); if (RGDS != null) rg.setDescription(RGDS);