@Override
	protected Regulation readNext() {
		// Try to read a line
		try {
			while (ready()) {
				line = readLine();

				if (line == null) return null; // End of file?

				// Ignore empty lines and comment lines
				if ((line.length() > 0) && (!line.startsWith("#"))) {
					// Parse line
					String fields[] = line.split("\t");

					// Is line OK?
					if (fields.length >= 3) {
						// Format: CHR \t START \t END \t ID \t SCORE \t ....
						// Fields 
						String chromosome = fields[0].trim();
						Chromosome chromo = getChromosome(chromosome);
						sanityCheckChromo(chromosome, chromo); // Sanity check

						// Start
						int start = parsePosition(fields[1]);

						// End
						int end = start; // Default 'end is same as start (only if value is missing)
						if (fields.length > 2) end = Gpr.parseIntSafe(fields[2]); // The chromEnd base is not included, but zero-based

						// ID
						String id = "line_" + lineNum;
						if ((fields.length > 3) && (!fields[3].isEmpty())) id = fields[3];

						// Score and all following fields are ignored 

						// Create regulation
						return new Regulation(chromo, start, end, 1, id, name, cellType);
					}
				}
			}
		} catch (IOException e) {
			throw new RuntimeException(e);
		}
		return null;
	}