# Test Modular Functions

    library(nipalsMCIA)
    data("NCI60")

    metadata_NCI60 <- data.frame(cancerType = unlist(metadata_NCI60))
    row.names(metadata_NCI60) <- rownames(data_blocks[[1]])

    # Adding metadata as part of the nipals_multiblock() function
    mcia_results <- nipals_multiblock(data_blocks, preprocMethod = "colprofile",
                                      metadata = metadata_NCI60, plots = "none",
                                      num_PCs = 10, tol = 1e-12)

    ## Performing centered column profile pre-processing...

    ## Pre-processing completed.

    ## Computing order 1 scores

    ## Computing order 2 scores

    ## Computing order 3 scores

    ## Computing order 4 scores

    ## Computing order 5 scores

    ## Computing order 6 scores

    ## Computing order 7 scores

    ## Computing order 8 scores

    ## Computing order 9 scores

    ## Computing order 10 scores

    # Alternative method for adding metadata
    mcia_results$metadata <- metadata_NCI60

# Test projection_plot with NO colors

    plotType = 'projection_global'
    orders = c(1,2)
    projection_plot(mcia_results, plotType,
                    orders=c(1,2), color_col = NULL,
                    legend_loc = "bottomleft")

    plotType = 'projection'
    projection_plot(mcia_results, plotType,
                    orders=c(1,2), color_col = NULL,
                    legend_loc = "bottomleft")

# Test projection_plot with the default color settings (uses scales::<function>)

    color_col = 'cancerType'

    plotType = 'projection_global'
    orders = c(1,2)
    projection_plot(mcia_results, plotType,
                    orders=c(1,2), color_col = 'cancerType',
                    legend_loc = "bottomleft")

    plotType = 'projection'
    projection_plot(mcia_results, plotType,
                    orders=c(1,2), color_col = 'cancerType',
                    legend_loc = "bottomleft")

# Test projection_plot with the user specified colors

    plotType = 'projection_global'
    orders = c(1,2)
    projection_plot(mcia_results, plotType,
                    orders=c(1,2), color_col = 'cancerType',
                    color_pal = c('red', 'green', 'blue'),
                    legend_loc = "bottomleft")

    plotType = 'projection'
    projection_plot(mcia_results, plotType,
                    orders=c(1,2), color_col = 'cancerType',
                    color_pal = c('orange', 'purple', 'pink'),
                    legend_loc = "bottomleft")

# Test global_scores_eigenvalues_plot(mcia_results)

    global_scores_eigenvalues_plot(mcia_results)

# Test block_weights_heatmap

    block_weights_heatmap(mcia_results)