A linked cluster expansion for the calculation of ground state observables of complex nuclei with realistic interactions has been used to calculate the ground state energy, density and momentum distribution of 16O and 40Ca. Using the same cluster expansion and the wave function and correlation parameters obtained from the energy calculation, we have evaluated the semi inclusive reaction A(e,ep)X taking final state interaction (FSI) into account by a Glauber type approach; the comparison between the distorted and undistorted momentum distributions provides an estimate of the transparency of the nuclear medium to the propagation of the hit proton. The effect of color transparency is also included by considering the Finite Formation Time (FFT) that the hit hadron needs to reach its asymptotic physical state.