Using your example, your 50K gain is treated as part capital gain and part ordinary (gain) income. The depreciation recapture is the part that gets ordinary income treatment as the depreciation was deducted against ordinary income. The 2K of gain is treated as a "capital" gain and gets Capital gain treatment, i.e. the capital gain tax rate. Total amount TAXED 50K.
You or A TAX PROFESSIONAL should look at the recapture rules relative to real property (IRC section 1250) in order to determine the amount of depreciation recapture. The amount of depreciation required to be recaptured gets ordinary income treatment and any amount of gain over that gets capital gain treatment. Real property, residential and commercial, get a slightly different recapture treatment than tangible personal property (IRC section 1245).