def parse_input_table(input_file, query_col, target_col, table):
    """ Parses input file and returns query_ids and target_ids or just target_ids.
    
    Arguments:
        input_file {string} -- Tab-separated input file with blast results or just target ids.
        query_col {int} -- Column with query ids.
        target_col {int} -- Column with target ids.
    
    Returns:
        [list] -- List of (query_ids and target_ids) or just target_ids.
    """
    input_list = []
    with open(input_file, 'r') as infile:
        if table == "swissprot" or table  == "trembl":
            for line in infile:
                line = line.strip().split("\t")
                db_hit = line[target_col].split("|")[2]
                if query_col is not None:
                    input_query = line[query_col]
                    input_list.append((input_query, db_hit))
                else:
                    input_list.append(db_hit)
        else:
            for line in infile:
                line = line.strip().split("\t")
                db_hit = line[target_col]
                if query_col is not None:
                    input_query = line[query_col]
                    input_list.append((input_query, db_hit))
                else:
                    input_list.append(db_hit)
    return input_list