Assalamu alaykum, Ibrahim/IFG have posted a guide to determining whether a stock is halal or not, see here: How to Buy Halal Stocks - Stock Screening Method | IFG — Islamic Finance Guru
All of the shariah screening methods I have come across (including IFG) state that the company can have a maximum of 5% haram income to be permissible.
As for purification of the haram amount (up to 5%), this thread on the IFG forum should hopefully clarify things for you
Hope this is helpful
JzkAllahkher
Nawaaz