Sparse code shrinkage is a method that is commonly used for image denoising and that has recently found some applications in seismic for random noise attenuation and multiple removal in a simplified form. Sparse coding finds a representation of the data in which each component is only rarely significantly active. Such a representation is closely related to independent component analysis. We discuss the link between sparse coding and independent component analysis, and show how the application of shrinkages to sparse components manages to attenuate the noise in seismic data. The use of data-driven shrinkages estimated from noise-free data is a necessary condition for this method to be efficient. We propose a realization of the data, attenuated in noise, that allows the derivation of data-driven shrinkage functions. They are obtained either by fitting this sparse representation with a given density model, or by estimating the density directly from the data. Two parametric models of density are investigated, the sparse density and the normal inverse Gaussian density, while the Gaussian kernel estimator estimates the density from the data. They are tested on both synthetic and real marine seismic data, and compared with f-x deconvolution and local SVD as alternative denoising methods. We show that the NIG density yields the best results, but the sparse density and the nonparametric density estimate are acceptable choices as well. Finally, the comparison with alternative methods shows that sparse code shrinkage is a credible alternative for the denoising of seismic data.