private void addRepresentativeReadOfDuplicateSet(final long representativeReadIndexInFile, final int setSize, final long read1IndexInFile) { final RepresentativeReadIndexer rri = new RepresentativeReadIndexer(); rri.representativeReadIndexInFile = (int) representativeReadIndexInFile; rri.setSize = setSize; rri.readIndexInFile = (int) read1IndexInFile; this.representativeReadIndicesForDuplicates.add(rri); }
private void addRepresentativeReadOfDuplicateSet(final long representativeReadIndexInFile, final int setSize, final long read1IndexInFile) { final RepresentativeReadIndexer rri = new RepresentativeReadIndexer(); rri.representativeReadIndexInFile = (int) representativeReadIndexInFile; rri.setSize = setSize; rri.readIndexInFile = (int) read1IndexInFile; this.representativeReadIndicesForDuplicates.add(rri); }
/** Adds a record to the sink. */ void add(final SAMRecord rec) { if (writer != null) { writer.addAlignment(rec); } if (sorter != null) { sorter.add(rec); } }
/** Adds a record to the sink. */ void add(final SAMRecord rec) { if (writer != null) { writer.addAlignment(rec); } if (sorter != null) { sorter.add(rec); } }
void add(final SAMRecord rec) { final SortingCollection<SAMRecord> sorter; if (outputByReadGroup) { sorter = sorterMap.get(rec.getReadGroup().getId()); } else { sorter = singleSorter; } sorter.add(rec); }
void add(final SAMRecord rec) { final SortingCollection<SAMRecord> sorter; if (outputByReadGroup) { sorter = sorterMap.get(rec.getReadGroup().getId()); } else { sorter = singleSorter; } sorter.add(rec); }
private void addAndTrack(final VariantContext toAdd, final VariantContext source) { trackLiftedVariantContig(liftedBySourceContig, source.getContig()); trackLiftedVariantContig(liftedByDestContig, toAdd.getContig()); sorter.add(toAdd); }
private void addAndTrack(final VariantContext toAdd, final VariantContext source) { trackLiftedVariantContig(liftedBySourceContig, source.getContig()); trackLiftedVariantContig(liftedByDestContig, toAdd.getContig()); sorter.add(toAdd); }
public void addAlignment(final SAMRecord alignment) { if (sortOrder.equals(SAMFileHeader.SortOrder.unsorted)) { if (!header.getGroupOrder().equals(SAMFileHeader.GroupOrder.none)) { throw new UnsupportedOperationException("GroupOrder " + header.getGroupOrder() + " is not supported"); } writeAlignment(alignment); } else if (presorted) { assertPresorted(alignment); writeAlignment(alignment); } else { alignmentSorter.add(alignment); } }
/** * Add an alignment record to be emitted by the writer. * * @param alignment Must not be null. The record will be updated to use the header used by this writer, which will * in turn cause any unresolved reference and mate reference indices to be resolved against the * header's sequence dictionary. * @throws IllegalArgumentException if the record's reference or mate reference indices cannot be * resolved against the writer's header using the current reference and mate reference names */ @Override public void addAlignment(final SAMRecord alignment) { alignment.setHeaderStrict(header); // re-establish the record header and resolve reference indices if (sortOrder.equals(SAMFileHeader.SortOrder.unsorted)) { writeAlignment(alignment); } else if (presorted) { assertPresorted(alignment); writeAlignment(alignment); } else { alignmentSorter.add(alignment); } }
/** * Add an alignment record to be emitted by the writer. * * @param alignment Must not be null. The record will be updated to use the header used by this writer, which will * in turn cause any unresolved reference and mate reference indices to be resolved against the * header's sequence dictionary. * @throws IllegalArgumentException if the record's reference or mate reference indices cannot be * resolved against the writer's header using the current reference and mate reference names */ @Override public void addAlignment(final SAMRecord alignment) { alignment.setHeaderStrict(header); // re-establish the record header and resolve reference indices if (sortOrder.equals(SAMFileHeader.SortOrder.unsorted)) { writeAlignment(alignment); } else if (presorted) { assertPresorted(alignment); writeAlignment(alignment); } else { alignmentSorter.add(alignment); } }
@Test public void spillToDiskTest() { final SortingCollection<String> sortingCollection = makeSortingCollection(10); final String[] strings = new String[] { "1", "2", "3" }; for (String str : strings) { sortingCollection.add(str); } Assert.assertEquals(tmpDir().list().length, 0); sortingCollection.spillToDisk(); Assert.assertEquals(tmpDir().list().length, 1); assertIteratorEqualsList(strings, sortingCollection.iterator()); sortingCollection.cleanup(); Assert.assertEquals(tmpDir().list().length, 0); }
sequenceNames.add(refSeq.getName());
alignmentSorter.add(record); if (progressLogger != null) progressLogger.record(record);
/** * Generate some strings, put into SortingCollection, confirm that the right number of * Strings come out, and in the right order. * @param numStringsToGenerate * @param maxRecordsInRam */ @Test(dataProvider = "test1") public void testPositive(final String testName, final int numStringsToGenerate, final int maxRecordsInRam) { final String[] strings = new String[numStringsToGenerate]; int numStringsGenerated = 0; final SortingCollection<String> sortingCollection = makeSortingCollection(maxRecordsInRam); for (final String s : new RandomStringGenerator(numStringsToGenerate)) { sortingCollection.add(s); strings[numStringsGenerated++] = s; } Arrays.sort(strings, new StringComparator()); Assert.assertEquals(tmpDirIsEmpty(), numStringsToGenerate <= maxRecordsInRam); sortingCollection.setDestructiveIteration(false); assertIteratorEqualsList(strings, sortingCollection.iterator()); assertIteratorEqualsList(strings, sortingCollection.iterator()); sortingCollection.cleanup(); Assert.assertEquals(tmpDir().list().length, 0); }
alignmentSorter.add(record); if (progressLogger != null) progressLogger.record(record);
log.info("Reading entries from input file " + readerCount); for (final VariantContext variantContext : reader) { sorter.add(variantContext); readProgress.record(variantContext.getContig(), variantContext.getStart());
log.info("Reading entries from input file " + readerCount); for (final VariantContext variantContext : reader) { sorter.add(variantContext); readProgress.record(variantContext.getContig(), variantContext.getStart());
sorter.add(record);
sorter.add(record);