Compression-induced structural transition in a self-assembled monolayer