%% Returns Datamatrix X, Response y, and Features f
function [X, y, f] = ingest (datafile, pars)
    %% Load Data
    rna = readtable(datafile);

    %% Remove any columns to be discarded
    if ~isempty(pars.discard_cols{:})  
        rna(:,  pars.discard_cols) = []; 
    end

    %% Work with only numeric columns
    data_cols = varfun(@isnumeric, rna);

    %% Delete rows where feature name is missing
    rna = rmmissing(rna, 'DataVariable', pars.features);
    f = rna{:, pars.features};

    %% Create the data matrix
    X = transpose(table2array(rna(:,data_cols{1,:})));
    
    %% Use regular expressions in pars to label samples
    samples = rna.Properties.VariableNames(data_cols{1,:});
    ctl = cellfun(@(x) ~isempty(regexp(x, pars.re_ctl)), samples);
    abn = cellfun(@(x) ~isempty(regexp(x, pars.re_abn)), samples);

    %% Construct the response vector 
    y = zeros(length(samples), 1);
    y(abn) = 1;
	
end
