def _ngl_write_atom(
    num,
    species,
    x,
    y,
    z,
    group=None,
    num2=None,
    occupancy=1.0,
    temperature_factor=0.0,
):
    """
    Writes a PDB-formatted line to represent an atom.

    Args:
        num (int): Atomic index.
        species (str): Elemental species.
        x, y, z (float): Cartesian coordinates of the atom.
        group (str): A...group name? (Default is None, repeat elemental species.)
        num2 (int): An "alternate" index. (Don't ask me...) (Default is None, repeat first number.)
        occupancy (float): PDB occupancy parameter. (Default is 1.)
        temperature_factor (float): PDB temperature factor parameter. (Default is 0.

    Returns:
        (str): The line defining an atom in PDB format

    Warnings:
        * The [PDB docs](https://www.cgl.ucsf.edu/chimera/docs/UsersGuide/tutorials/pdbintro.html) indicate that
            the xyz coordinates might need to be in some sort of orthogonal basis. If you have weird behaviour,
            this might be a good place to investigate.
    """
    if group is None:
        group = species
    if num2 is None:
        num2 = num
    return "ATOM {:>6} {:>4} {:>4} {:>5} {:10.3f} {:7.3f} {:7.3f} {:5.2f} {:5.2f} {:>11} \n".format(
        num, species, group, num2, x, y, z, occupancy, temperature_factor, species
    )