@Override
	public void sequence(String id, String sequence, String quality) {
		int cutIndex = sequence.length();
		if (qdecoder != null) {
			int qual[] = null;

			try {
				qual = qdecoder.decodeQuality(quality);
			} catch (QualityFormatException e1) {
				String error = String.format(
						"Quality encoding is not correct: %s", quality);
				System.err.println(error);
			}

			cutIndex = qual.length;
			int cumQuality = 0;

			for (int i = (qual.length - 1); i >= 0; i--) {
				int cumCutoff = cutoff * (cutIndex - i);
				cumQuality += qual[i];

				if ((cumQuality - cumCutoff) < 0) {
					cutIndex = i;
					cumQuality = 0;
				}
			}

		}

		if ((minLength > -1) && (cutIndex < minLength)) {
			notifyListeners(id, "", "");
		} else {
			notifyListeners(id, sequence.substring(0, cutIndex),
					quality.substring(0, cutIndex));

		}

	}