Skip to main content
Topic: Show only few chromatograms (Read 2419 times) previous topic - next topic

Show only few chromatograms

Hi all,

I thought I did this before, but just can't figure it out anymore. I have a read about 300 data files into xcms, but I only want to show the base peak chromatogram of few of them.

Code: [Select]
bpis <- chromatogram(object = raw_data, aggregationFun = "max")

This will get all chromatograms and I thought I could plot only 3 of them like this:

Code: [Select]
plot(bpis[c(1, 25, 50, 100)])

But this didn't work. Is there way to only show a few chromatograms while raw_data contains the data of about 300 files.

Cheers, Rico

Re: Show only few chromatograms

Reply #1
Hi all,

Sorry for the inconvenience!.  I just found a solution. I found the function filterfile().
To select only the chromatograms I want, I just have to do:

Code: [Select]
partial_data <- filterFile(raw_data, = c(1, 25, 50, 100))

And from here I can just use chromatogram() and plot it. Not sure if there is an easier solution, but this works well.

Cheers, Rico