Description Usage Arguments Details Value Author(s) See Also Examples
This is the main function to plot multiple mass spectra on one plot, with many options to control the output.
1 2 3 4 5 6 | plotSpectra(mz, int, main, labels=NULL,labelSpec=1,label_mz=NA,
label_int=NA,mz_a=NA,int_a=NA, absInt=FALSE, logInt=FALSE, mz_b=NA,int_b=NA,
smiles="",kekulise=TRUE,legend=c("spec1","spec2","spec3"),
xlim=NULL,ylim=NULL, yfactor=2.5, line_colour=c("black","red","green"),
line_type=c("solid","dashed","dotdash"),line_width=c(2,2,1),
chem2express=FALSE, srt=60, pos=4,offset=-0.2)
|
mz |
Vector containing mz values (x) to plot first. |
int |
Vector containing intensity values (y) to plot first. |
main |
Title for the plot. |
labels |
Vector containing labels for selected peaks. If |
labelSpec |
Indicates which spectrum to use for label coordinates. Must be same
length as |
label_mz |
Values defining starting x coordinates for |
label_int |
Values defining starting y coordinates for |
mz_a |
Vector containing mz values for second spectrum. |
int_a |
Vector containing intensity values for second spectrum. |
absInt |
If |
logInt |
If |
mz_b |
Vector containing mz values for third spectrum. |
int_b |
Vector containing intensity values for third spectrum. |
smiles |
SMILES code of the structure to plot. Leave empty for no structure. |
kekulise |
Controls aromaticity detection of |
legend |
Vector containing legend entries. |
xlim |
Option to control x-axis limits. If |
ylim |
Option to control y-axis limits. If |
yfactor |
Scaling factor for y-axis. Default |
line_colour |
Optional vector to re-define default line colours. |
line_type |
Optional vector to re-define default line type. |
line_width |
Optional vector to re-define default line widths. |
chem2express |
If |
srt |
Optional parameter to adjust |
pos |
Optional parameter to adjust |
offset |
Optional parameter to adjust |
For controlling label orientation, the following settings are useful:
Default (angle): srt=60
, pos=4
, offset=-0.2
;
Vertical above peak: srt=90
, pos=4
, offset=0
;
Horizontal, centred above peak: srt=0
, pos=3
, offset=0.2
.
To avoid overlapping labels, use trimAnnotation
.
Returns a plot in the current plotting device.
Emma Schymanski <emma.schymanski@uni.lu>
plot
, renderSMILES.rcdk
, chemistry2expression
,
text
, trimAnnotation
.
1 2 3 4 5 6 7 | mz_1 <- c(58.0287, 111.0441, 168.0655, 210.1125)
int_1 <- c(23.0000, 999.0000, 843.5855, 999.0000)
labels_1 <- c("C2H4NO", "C6H7O2", "C8H10NO3", "C11H16NO3")
smiles_1 <- "O=C(Oc1ccccc1OC(C)C)NC"
plotSpectra(mz_1, int_1, main="test spec",labels=labels_1, labelSpec=1, smiles=smiles_1)
plotSpectra(mz_1, int_1, main="test spec",labels=labels_1, labelSpec=1, smiles=smiles_1,
chem2express=TRUE, mz_a=mz_1, int_a = int_1, legend=c("spec1","spec1 again"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.