The rules are the same for both floor joists and roof rafters as far how much can be removed and still maintain the structural integrity of the wood member, They are divided into the categories of notching (cutting away an area of wood at the top or bottom) and bored holes (drilling through the center).
1) Notches in the top or bottom not to exceed 1/6 of the height of the joist/rafter.
2) The length of the notch cannot exceed 1/3 of the depth of the joist/rafter.
3) No notches in the center 1/3 of the span.
4) Notches at the end of a rafter/joist cannot exceed 1/4 of the the height
5) Notches and bored holes cannot be in the same area.
Bored hole requirements:
1) Holes cannot be more than 1/3 of the height of the joist/rafter.
2) Holes must be a minimum of 2 inches from the top, bottom and other holes in the joist/rafter.