@Override public Index finalizeIndex(final long finalFilePosition) { if (previousFeature != null) { finalizeFeature(finalFilePosition); } if (indexBuilder != null) { indexContents.add(indexBuilder.generateIndexContent()); } // Make this as big as the sequence dictionary, even if there is not content for every sequence, // but truncate the sequence dictionary before its end if there are sequences in the sequence dictionary without // any features. final BinningIndexContent[] indices = indexContents.toArray(new BinningIndexContent[sequenceNames.size()]); return new TabixIndex(formatSpec, sequenceNames, indices); }
@Override public Index finalizeIndex(final long finalFilePosition) { if (previousFeature != null) { finalizeFeature(finalFilePosition); } if (indexBuilder != null) { indexContents.add(indexBuilder.generateIndexContent()); } // Make this as big as the sequence dictionary, even if there is not content for every sequence, // but truncate the sequence dictionary before its end if there are sequences in the sequence dictionary without // any features. final BinningIndexContent[] indices = indexContents.toArray(new BinningIndexContent[sequenceNames.size()]); return new TabixIndex(formatSpec, sequenceNames, indices); }
@Override public Index finalizeIndex(final long finalFilePosition) { if (previousFeature != null) { finalizeFeature(finalFilePosition); } if (indexBuilder != null) { indexContents.add(indexBuilder.generateIndexContent()); } // Make this as big as the sequence dictionary, even if there is not content for every sequence, // but truncate the sequence dictionary before its end if there are sequences in the sequence dictionary without // any features. final BinningIndexContent[] indices = indexContents.toArray(new BinningIndexContent[sequenceNames.size()]); return new TabixIndex(formatSpec, sequenceNames, indices); }
private void advanceToReference(final String sequenceName) { if (indexBuilder != null) { indexContents.add(indexBuilder.generateIndexContent()); } // If sequence dictionary is provided, BinningIndexBuilder can reduce size of array it allocates. final int sequenceLength; if (sequenceDictionary != null) { sequenceLength = sequenceDictionary.getSequence(sequenceName).getSequenceLength(); } else { sequenceLength = 0; } indexBuilder = new BinningIndexBuilder(sequenceNames.size(), sequenceLength); sequenceNames.add(sequenceName); currentSequenceName = sequenceName; sequenceNamesSeen.add(sequenceName); }
private void advanceToReference(final String sequenceName) { if (indexBuilder != null) { indexContents.add(indexBuilder.generateIndexContent()); } // If sequence dictionary is provided, BinningIndexBuilder can reduce size of array it allocates. final int sequenceLength; if (sequenceDictionary != null) { sequenceLength = sequenceDictionary.getSequence(sequenceName).getSequenceLength(); } else { sequenceLength = 0; } indexBuilder = new BinningIndexBuilder(sequenceNames.size(), sequenceLength); sequenceNames.add(sequenceName); currentSequenceName = sequenceName; sequenceNamesSeen.add(sequenceName); }
private void advanceToReference(final String sequenceName) { if (indexBuilder != null) { indexContents.add(indexBuilder.generateIndexContent()); } // If sequence dictionary is provided, BinningIndexBuilder can reduce size of array it allocates. final int sequenceLength; if (sequenceDictionary != null) { sequenceLength = sequenceDictionary.getSequence(sequenceName).getSequenceLength(); } else { sequenceLength = 0; } indexBuilder = new BinningIndexBuilder(sequenceNames.size(), sequenceLength); sequenceNames.add(sequenceName); currentSequenceName = sequenceName; sequenceNamesSeen.add(sequenceName); }
@Test(dataProvider = "BinningFeatures") public void testFeatureAtOffsetZero( final List<MockIndexableFeature> mockFeatures, final List<Chunk> expectedChunks, final long[] expectedBins) { // use a sequence length that spans at least two (16k) binning blocks final BinningIndexBuilder bib = new BinningIndexBuilder(REFERNCE_SEQUENCE_INDEX, 40000); mockFeatures.forEach(bib::processFeature); final BinningIndexContent bic = bib.generateIndexContent(); Assert.assertEquals(expectedBins, bic.getLinearIndex().getIndexEntries()); Assert.assertEquals(expectedChunks, bic.getAllChunks()); }
/** * Creates the BAMIndexContent for this reference. * Requires all alignments of the reference have already been processed. * * @return Null if there are no features for this reference. */ public BAMIndexContent processReference(final int reference) { if (reference != currentReference) { throw new SAMException("Unexpected reference " + reference + " when constructing index for " + currentReference); } final BinningIndexContent indexContent = binningIndexBuilder.generateIndexContent(); if (indexContent == null) return null; return new BAMIndexContent(indexContent.getReferenceSequence(), indexContent.getBins(), indexStats, indexContent.getLinearIndex()); }
/** * Creates the BAMIndexContent for this reference. * Requires all alignments of the reference have already been processed. * @return Null if there are no features for this reference. */ public BAMIndexContent processReference(final int reference) { if (reference != currentReference) { throw new SAMException("Unexpected reference " + reference + " when constructing index for " + currentReference); } final BinningIndexContent indexContent = binningIndexBuilder.generateIndexContent(); if (indexContent == null) return null; return new BAMIndexContent(indexContent.getReferenceSequence(), indexContent.getBins(), indexStats, indexContent.getLinearIndex()); }
/** * Creates the BAMIndexContent for this reference. * Requires all alignments of the reference have already been processed. * * @return Null if there are no features for this reference. */ public BAMIndexContent processReference(final int reference) { if (reference != currentReference) { throw new SAMException("Unexpected reference " + reference + " when constructing index for " + currentReference); } final BinningIndexContent indexContent = binningIndexBuilder.generateIndexContent(); if (indexContent == null) return null; return new BAMIndexContent(indexContent.getReferenceSequence(), indexContent.getBins(), indexStats, indexContent.getLinearIndex()); }
/** * Creates the BAMIndexContent for this reference. * Requires all alignments of the reference have already been processed. * * @return Null if there are no features for this reference. */ public BAMIndexContent processReference(final int reference) { if (reference != currentReference) { throw new SAMException("Unexpected reference " + reference + " when constructing index for " + currentReference); } final BinningIndexContent indexContent = binningIndexBuilder.generateIndexContent(); if (indexContent == null) return null; return new BAMIndexContent(indexContent.getReferenceSequence(), indexContent.getBins(), indexStats, indexContent.getLinearIndex()); }
/** * Creates the BAMIndexContent for this reference. * Requires all alignments of the reference have already been processed. * * @return Null if there are no features for this reference. */ public BAMIndexContent processReference(final int reference) { if (reference != currentReference) { throw new SAMException("Unexpected reference " + reference + " when constructing index for " + currentReference); } final BinningIndexContent indexContent = binningIndexBuilder.generateIndexContent(); if (indexContent == null) return null; return new BAMIndexContent(indexContent.getReferenceSequence(), indexContent.getBins(), indexStats, indexContent.getLinearIndex()); }