A graph algorithm for extracting features from transcription factor binding sites