def chromosome(record):
    """
    Get the chromosome this record is from. If it is part of a scaffold then it
    will be returned.
    """

    basic = record.id
    if basic.startswith("chromosome:") or basic.startswith("scaffold:"):
        parts = basic.split(":")
        return parts[2]
    return basic.split(".")[0]