def read_matrix(filename):
    """
    Reads a matrix and returns a dictionary with the data and list of conditions (tuple of dict and list)

    :param filename: the matrix containing genes id , conditions and reads
    :return: data, conditions
    """
    data = {}
    with open(filename, "r") as f:
        header = f.readline().strip().split('\t')
        conditions = header[1:]

        for row in f:
            parts = row.strip().split('\t')
            gene_id = parts[0]
            expression_values = parts[1:]

            gene_data = {}
            for condition, read_counts in zip(conditions, expression_values):
                gene_data[condition] = read_counts

            data[gene_id] = gene_data

        return data, conditions