It depends on the school and most will specify on their websites. I have 2 LORs from science profs and 1 from a PI who is a science prof but did not teach me in traditional course. If schools asked for science professors or science faculty who have taught me, I played it safe and did not assume my PI letter would qualify. However, some schools say that any science professional or faculty member will do, in which case I would use my PI letter (given the choice, I would use my PI letter as he knows me better)