public void buildFromBEDFile(File bedFile) throws IOException {
		intervals = new HashMap<String, List<Interval>>();
		
		BufferedReader reader = new BufferedReader(new FileReader(bedFile));
		String line = reader.readLine();
		while(line != null && line.startsWith("#")) {
			line = reader.readLine();
		}
		
		while(line != null) {
			if (line.trim().length() > 1) {
				String[] toks = line.split("\t");
				if (toks.length > 2) {
					String contig = toks[0];
					try {
						int first = Integer.parseInt(toks[1]);
						int last = Integer.parseInt(toks[2]);
						Interval inter = new Interval(first, last+1);
						addInterval(contig, inter);
					}
					catch (NumberFormatException nfe) {
						System.err.println("Warning: Could not parse position for BED file line: " + line );
					}
					
				}
				else {
					System.err.println("Warning: Incorrect number of tokens on BED file line: " + line );
				}
			}
			line = reader.readLine();
		}
		
		sortAllIntervals();
		reader.close();
	}