Given a double complex in the first quadrant, one can derive from it a (homological or cohomological) spectral sequence converging to the (co)homology of the total complex of the double complex.

My question is: When is a (homological or cohomological) spectral sequence comes from a double complex?