

def parse_description(issue):
    """
    :param issue: Issue object.
    :return: ROGA type: (a string that should be listeria/salmonella/vtec - otherwise they'll get others later.
             seq_ids: List of seqIDs which will later be written to file and used in ROGA report generation.
    """
    # Take whatever is on the first line, assume it's the ROGA type.
    roga_type = issue.description.split()[0].lower()
    seq_ids = list()
    lines = issue.description.split()
    # Assume that every line other than the first (and has a - in it) is a seqID and append to a list of seqIDs
    # that will get returned to be used for ROGA generation.
    for i in range(1, len(lines)):
        if "-" in lines[i]:
            seq_ids.append(lines[i])
    return roga_type, seq_ids


def seq_ids_to_textfile(seqids):
    """
    :param seqids: List of seqIDS generated by parse_description.
    Generates a file called seqIDlist.txt in the tmp directory that will be used for ROGA generation.
    """
    f = open("seqIDlist.txt", "w")
    for seqid in seqids:
        f.write(seqid + "\n")
    f.close()


def parse_description(issue):
    """
    :param issue: Issue object.
    :return: ROGA type: (a string that should be listeria/salmonella/vtec - otherwise they'll get others later.
             seq_ids: List of seqIDs which will later be written to file and used in ROGA report generation.
    """
    # Take whatever is on the first line, assume it's the ROGA type.
    roga_type = issue.description.split()[0].lower()
    seq_ids = list()
    lines = issue.description.split()
    # Assume that every line other than the first (and has a - in it) is a seqID and append to a list of seqIDs
    # that will get returned to be used for ROGA generation.
    for i in range(1, len(lines)):
        if "-" in lines[i]:
            seq_ids.append(lines[i])
    return roga_type, seq_ids


def seq_ids_to_textfile(seqids):
    """
    :param seqids: List of seqIDS generated by parse_description.
    Generates a file called seqIDlist.txt in the tmp directory that will be used for ROGA generation.
    """
    f = open("seqIDlist.txt", "w")
    for seqid in seqids:
        f.write(seqid + "\n")
    f.close()
:param issue: Issue object.     :return: ROGA type: (a string that should be listeria/salmonella/vtec - otherwise they'll get others later.              seq_ids: List of seqIDs which will later be written to file and used in ROGA report generation. # Take whatever is on the first line, assume it's the ROGA type. # Assume that every line other than the first (and has a - in it) is a seqID and append to a list of seqIDs # that will get returned to be used for ROGA generation. :param seqids: List of seqIDS generated by parse_description.     Generates a file called seqIDlist.txt in the tmp directory that will be used for ROGA generation.