Deciphering the mechanisms of 1D and 2D self-assembly of biopolymers