def parse_fastq_seqid(line):
    """Extracts read identifier and end identifier from different formats of FASTQ sequence IDs

    Args:
        line (str): sequence identifier from FASTQ file

    Returns:
        read_id (str): read identifier
        end_id (str): end identifier (if any) or empty string
    """
    if line.startswith('@'):
        line = line[1:]
    result = (line, '')
    if ' ' in line:
        line_tokens = line.split(' ')
        if len(line_tokens) == 2:
            # Casava 1.8+ format
            end = line_tokens[1]
            end = end[0]
            result = (line_tokens[0], end)
        elif len(line_tokens) == 3:
            # SRA format?
            if line_tokens[0].endswith('.1') or line_tokens[0].endswith('.2'):
                # SRA format
                result = (line_tokens[0][:-2], line_tokens[0][-1])
            else:
                # unknown format
                result = (line_tokens[0], '')
        else:
            # sequences from FASTA files?
            result = (line_tokens[0], '')
        # return (line.split('\s')[0], line.split('\s')[1][0])
    elif line.endswith('/1') or line.endswith('/2'):
        # Old Ilumina format
        result = (line[:-2], line[-1])
    elif line.endswith('.1') or line.endswith('.2'):
        if len(line.split('.')) == 3:
            # Converted SRA
            result = (line[:-2], line[-1])
        else:
            #  NCBI accession number?
            result = (line, '')
    return result