sneumann / xcms

This is the git repository matching the Bioconductor package xcms: LC/MS and GC/MS Data Analysis
Other
183 stars 80 forks source link

Overlay of EICs in plot #243

Open michaelwitting opened 6 years ago

michaelwitting commented 6 years ago

Hi,

is there a possibility to have several EICs in a chromatogram object plotted in a single plot with overlay and different colours for the different EICs?

I'm currently using this code:

bpis <- chromatogram(ms1data, mz = fragCand[,2:3], rt = fragCand[,5:6])
plot(bpis)

This produces subplots for all EICs. I would like to have them overlapping.

Best regards,

Michael

jorainer commented 6 years ago

No, currently it is not possible to plot several EICs into the same plot. Currently each row in a Chromatograms is plotted into a single plot since each row is supposed to represent the same mz and rt range (i.e. EIC). If you want to plot several rows (EICs) into one plot you have to do this manually. e.g. by looping over the rows of a Chromatograms object. The tricky thing is that you have to pre-define the xlim and ylim before to include the full retention time and intensity range.

stanstrup commented 6 years ago

I never finished this but I played around with ggplot2 plotting. You can maybe adjust that to your needs: https://cdn.rawgit.com/stanstrup/xcms_ggplot2/8ac45aeb/ggplot.Chromatograms.html