public void advanceToContig(String contig) {
		if (contig.equals(currentContig)) {
			return; //Already there
		}
		
		if (! contigMap.containsKey(contig)) {
			throw new IllegalArgumentException("Unrecognized contig name : "  + contig);
		}
		
		if (DEBUG)
			System.err.println("Advancing to contig : " + contig);
		
		recordIt.close();
		currentPos = 0;
		records.clear();
		
		int length = contigMap.get(contig);
		recordIt = samReader.queryOverlapping(contig, 1, length);
		
		//Going to a new contig, clear current queue
		
		try {
			nextRecord = recordIt.next();
		}
		catch (NoSuchElementException ex) {
			nextRecord = null;
		}
		
		if (nextRecord != null)
			currentContig = contig;
		else {
			if (DEBUG)
				System.err.println("Could not find any reads that mapped to contig : " + contig);
		}
	}