def obtainLigandIndexes(trajectory, ligand):
    """
    Extract the indexes for the ligand in the trajectory
    :param trajectory: mdtraj trajectory
    :param ligand: name of the ligand
    :return: list of the atom indexes of the heavy atoms of the ligand
    """
    residueIndexes = []
    for residue in trajectory.topology.residues:
        if residue.name == ligand:
            for atom in residue.atoms:
                if "H" not in atom.name:
                    residueIndexes.append(atom.index)
    return residueIndexes