CyclicGraphException

A rule ends up depending on its own output

why

The dependency graph must be acyclic. A cycle usually appears when a rule's input and output patterns can match the same filename, so the file is required in order to build itself.

what to do

Print the graph and look at where it loops: snakemake --dag | dot -Tsvg > dag.svg. The fix is nearly always to make the output name distinguishable from the input (a different suffix or directory) rather than to restructure the workflow.

Snakemake documented behaviour
This is one entry from BioErrors, a catalogue of bioinformatics error messages that point at the wrong thing. Every entry was traced to its real cause before it was written down.
If your error is not in it, paste it there and it gets traced and added.