Deducting Remaining Cost of Roof Upon Sale of Rental

I put a new roof on a rental property back in 2016. I have been depreciating the cost using the straight line method over 27 years. There is still $5K of the cost that has not been depreciated. How do I claim this remaining 5K now that I've sold the rental?