I am trying to plot mutation spectrum:
##################################################################################################
# Construct mutational motif.
somatic.motif = mutationContext(VR, ref=BSgenome.Hsapiens.1000genomes.hs37d5)
If I plot with full data:
plotMutationSpectrum(somatic.motif, group="sampleNames")
it works.
But if I get a subset of the rows, and try to plot it, it does not work.
aster = somatic.motif[(somatic.motif@sampleNames %in% patients)]
plotMutationSpectrum(aster, group="sampleNames")
This gives error:
Error in colSums(y) : 'x' must be an array of at least two dimensions
Both somatic.motif and aster are VRange objects.
I tried to go inside of plotMutationSpectrum function, but I cannot figure out what went wrong.
I have been struggling with this all day today.
Could you please help me in your earliest convenience?
Thank you very much in advance.
Best regards,
Haiying