Reconstruction of 3D genome architecture via a two-stage algorithm