Compression and stretching of a self-avoiding chain in cylindrical nanopores.