public Collection<RODRecordList> allElementsLTE(RODRecordList elt, boolean includeElt) { LinkedList<RODRecordList> all = new LinkedList<RODRecordList>(); if ( includeElt ) all.add(elt); while ( hasNext() ) { Element x = queue.peek(); //System.out.printf("elt.compareTo(x) == %d%n", elt.compareTo(x)); //System.out.printf("In allElementLTE%n"); int cmp = elt.getLocation().compareTo(x.nextLoc); //System.out.printf("x=%s%n elt=%s%n => elt.compareTo(x) == %d%n", x, elt, cmp); if ( cmp >= 0 ) { //System.out.printf(" Adding element x=%s, size = %d%n", x, all.size()); all.add(next()); //System.out.printf(" Added size = %d%n", all.size()); } else { //System.out.printf("breaking...%n"); break; } } return all; }
/** * Returns the next covered locus context in the shard. * @return Next covered locus context in the shard. * @throw NoSuchElementException if no such element exists. */ public AlignmentContext next() { if ( DEBUG ) System.out.printf("In RodLocusView.next()...%n"); RODRecordList datum = rodQueue.next(); if ( DEBUG ) System.out.printf("In RodLocusView.next(); datum = %s...%n", datum.getLocation()); if ( DEBUG ) System.out.printf("In RodLocusView.next(): creating tracker...%n"); allTracksHere = getSpanningTracks(datum); GenomeLoc rodSite = datum.getLocation(); GenomeLoc site = genomeLocParser.createGenomeLoc( rodSite.getContig(), rodSite.getStart(), rodSite.getStart()); if ( DEBUG ) System.out.printf("rodLocusView.next() is at %s%n", site); // calculate the number of skipped bases, and update lastLoc so we can do that again in the next() long skippedBases = getSkippedBases( rodSite ); lastLoc = site; return new AlignmentContext(site, new ReadBackedPileupImpl(site), skippedBases); }