Pyrite is usually found associated with other sulphides or oxides in quartz veins , sedimentary rock , and metamorphic rock , as well as in coal beds , and as a replacement mineral in fossils . Pyrite is usually found associated with other sulfides or oxides in quartz veins , sedimentary rock , and metamorphic rock , as well as in coal beds , and as a replacement mineral in fossils .