Coordination of the electrical and optical signals revealing nanochannels with an ‘onion-like’ gating mechanism and its sensing application