• Osteosarcoma disease-related immune cell populations, mainly Mast cells activated were enriched in osteosarcoma tissue.• Nine genes with varying levels of immune cell infiltration were associated with osteosarcoma, four of which, including SORBS2, BAIAP2L2, SNAPC3, and ZDHHC21, had a greater disease-free survival probability than the high abundance group. Here, BAIAP2L2 is linked to osteosarcoma.