Skip to content

Commit

Permalink
Add option to filter UMI iterator with an IntervalList
Browse files Browse the repository at this point in the history
  • Loading branch information
alecw committed Jun 27, 2024
1 parent 1b19813 commit 9466915
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ protected int doWork() {

UMIIterator umiIterator = new UMIIterator(headerAndIter,GENE_NAME_TAG, GENE_STRAND_TAG, GENE_FUNCTION_TAG,
this.STRAND_STRATEGY, this.LOCUS_FUNCTION_LIST, this.FUNCTIONAL_STRATEGY, this.CELL_BARCODE_TAG, this.MOLECULAR_BARCODE_TAG,
this.READ_MQ, false, cellBarcodes, false, false, true);
this.READ_MQ, false, cellBarcodes, false, false, true, null);

while (umiIterator.hasNext()) {
UMICollection c = umiIterator.next();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ public UMIIterator(final SamHeaderAndIterator headerAndIterator,
final boolean recordCellsInInput) {

this(headerAndIterator, geneTag, geneStrandTag, geneFunctionTag, strandStrategy, acceptedLociFunctions, functionStrategy,
cellBarcodeTag, molecularBarcodeTag, readMQ, assignReadsToAllGenes, cellBarcodes, cellFirstSort, recordCellsInInput, false);
cellBarcodeTag, molecularBarcodeTag, readMQ, assignReadsToAllGenes, cellBarcodes, cellFirstSort, recordCellsInInput, false,
null);

}
/**
Expand Down Expand Up @@ -148,7 +149,8 @@ public UMIIterator(final SamHeaderAndIterator headerAndIterator,
final Collection<String> cellBarcodes,
final boolean cellFirstSort,
final boolean recordCellsInInput,
final boolean retainReads) {
final boolean retainReads,
final IntervalList intervals) {

this.retainReads=retainReads;
this.geneTag=geneTag;
Expand Down Expand Up @@ -188,6 +190,9 @@ public UMIIterator(final SamHeaderAndIterator headerAndIterator,
filteringIterator =
new TagValueFilteringIterator<>(filteringIterator, this.cellBarcodeTag, cellBarcodes);
}
if (intervals != null) {
filteringIterator = new IntervalFilteringIterator(filteringIterator, intervals, true);
}

// Filter/assign reads based on functional annotations
GeneFunctionIteratorWrapper wrapper = new GeneFunctionIteratorWrapper(filteringIterator, geneTag,
Expand Down

0 comments on commit 9466915

Please sign in to comment.