/*
 * The Exomiser - A tool to annotate and prioritize genomic variants
 *
 * Copyright (c) 2016-2018 Queen Mary University of London.
 * Copyright (c) 2012-2016 Charité Universitätsmedizin Berlin and Genome Research Ltd.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package org.monarchinitiative.exomiser.core.prioritisers.util;

import org.jblas.FloatMatrix;

import java.util.Map;
import java.util.Objects;

/**
 * Non-public utility class for helping DataMatrix classes create FloatMatrix from Maps.
 *
 * @author Jules Jacobsen <j.jacobsen@qmul.ac.uk>
 * @since 10.0.0
 */
class DataMatrixUtil {

    private DataMatrixUtil() {
    }

    static void checkKeys(Map<Integer, float[]> columns, Map<Integer, Integer> rowIndex) {
        Objects.requireNonNull(columns);
        Objects.requireNonNull(rowIndex);
        if (!rowIndex.keySet().equals(columns.keySet())) {
            throw new IllegalArgumentException("rowIndex and columns must have same keys");
        }
    }

    static FloatMatrix createMatrixfromMap(Map<Integer, float[]> columns, Map<Integer, Integer> rowIndex) {
        checkKeys(columns, rowIndex);
        return createFloatMatrix(columns, rowIndex);
    }

    private static FloatMatrix createFloatMatrix(Map<Integer, float[]> columns, Map<Integer, Integer> rowIndex) {
        FloatMatrix floatMatrix = new FloatMatrix(rowIndex.size(), columns.size());
        for (Map.Entry<Integer, Integer> entry : rowIndex.entrySet()) {
            Integer entrezGeneId = entry.getKey();
            Integer row = entry.getValue();
            float[] columnValues = columns.get(entrezGeneId);
            FloatMatrix column = new FloatMatrix(columnValues);
            floatMatrix.putColumn(row, column);
        }
        return floatMatrix;
    }

}

@@ -97,9 +97,9 @@
 -201
-8
+9
  Que
@@ -983,16 +983,73 @@
 tMatrix;
+%0Aimport org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;
 %0A%0Aimport
@@ -1282,16 +1282,105 @@
 Util %7B%0A%0A
+    private static final Logger logger = LoggerFactory.getLogger(DataMatrixUtil.class);%0A%0A
     priv
@@ -2063,32 +2063,119 @@
 er%3E rowIndex) %7B%0A
+        logger.debug(%22Creating %7B%7D * %7B%7D FloatMatrix%22, rowIndex.size(), columns.size());%0A
         FloatMat
@@ -2583,16 +2583,16 @@
 olumn);%0A
-
         
@@ -2589,24 +2589,74 @@
 ;%0A        %7D%0A
+        logger.debug(%22Finished building matrix%22);%0A
         retu

Add debug logging to DataMatrixUtil