Dimensionality reduction and multiscale modeling for the understanding of protein folding and hierarchical self-assembly