I am running SomaticSignatures 2.6.0 using somatic calls from 2 sources (~40 samples, internal; ~200 samples external source). I am not using a 'group' to generate the motif matrix, eg:
>sca_mm = motifMatrix(sca_motifs, normalize = TRUE)
I am trying to correct for batch effect, but this produces some negative numbers in sca_mm which causes problems for nmf decomposition:
>meta<-read.table("meta.test", header=TRUE, sep="\t") >model_null = model.matrix(~ 1, meta) >sca_mm_batch = ComBat(sca_mm, batch = meta$study, mod = model_null) >gof_nmf= assessNumberSignatures(sca_mm_batch, n_sigs, nReplicates = 5,
nmfDecomposition) Error: NMF::nmf - Input matrix x contains some negative entries.
My 'meta' dataframe is columns of 'sampleNames' and 'study' and other metadata; each sample is classified as either coming from the internal or external data source.
Are negative entries expected or am I not applying the batch effect correction appropriately? Is this telling me something about my data?
Thanks