ints = groupval(xset, "maxint", "intb");
groups = data.frame(xset@groups);
ints[is.na(ints)] = 0;
nad = list();
nadh = list();
nadR = list();
nadhR = list();
numsamps = length(rownames(xset@phenoData));
for (i in 1:13) {
mz1 = NAD + (i-1)*1.00335;
mz2 = NADH +(i-1)*1.00335;
a = which(abs(groups$mzmed - mz1)/mz1*1000000 < 10 & abs(groups$rtmed - rt1) < 10);
b = which(abs(groups$mzmed - mz2)/mz2*1000000 < 10 & abs(groups$rtmed - rt2) < 10);
if (length(a) == 1) {
nad = c(nad, ints[a,]);
nadR = c(nadR, rownames(ints)[a]);
}
if (length(b) == 1) {
nadh = c(nadh, ints[b,]);
nadhR = c(nadhR, rownames(ints)[b]);
}
if (length(a) == 0) {
nad = c(nad, rep(0, numsamps));
nadR = c(nadR, 0);
}
if (length(b) == 0) {
nadh = c(nadh, rep(0,numsamps));
nadhR = c(nadhR, 0);
}
if (length(a) > 1) {
ind = which(abs(groups$rtmed[a] - rt1) < 10);
nad = c(nad, ints[a[ind],]);
nadR = c(nadR, rownames(ints)[a[ind]]);
}
if (length(b) > 1) {
ind = which(abs(groups$rtmed[b] - rt2) < 10);
nadh = c(nadh, ints[b[ind],]);
nadhR = c(nadhR, rownames(ints)[b[ind]]);
}
}
nad = matrix(unlist(nad), byrow = TRUE, ncol = numsamps);
nadh = matrix(unlist(nadh), byrow = TRUE, ncol = numsamps);
colnames(nad) = rownames(xset@phenoData);
colnames(nadh) = colnames(nad);
rownames(nad) = unlist(nadR);
rownames(nadh) = unlist(nadhR);
return(list(nad,nadh));
}
groups = data.frame(xsA3@groups);
groups[abs(groups$mzmed - 662.1019)/662.1019*1000000 < 20,]
rt1 = 1267
groups[abs(groups$mzmed - 664.1175)/664.1175*1000000 < 20,]
rt2 = 1960
a = getNADH(xsA3, rt1, rt2)
a[[2]]
a[[1]]
colSums(a[[1]][,which(sN %in% sNWT)])/colSums(a[[2]][,which(sN %in% sNWT)])
colSums(a[[1]][,which(sN %in% sNKO)])/colSums(a[[2]][,which(sN %in% sNKO)])
load("~/Dropbox (Crawford Lab)/Thesis LCMS Data/110714 gluc BMDMs/112214x13cms.RData")
rt1 = 1267
rt2 = 1960
xsG3@phenoData
groups = data.frame(xsG3@groups);
groups[abs(groups$mzmed - 664.1175)/664.1175*1000000 < 20,]
rt1
rt2
groups[abs(groups$mzmed - 662.1019)/662.1019*1000000 < 20,]
getNADH <- function(xset, rt1, rt2) {
NAD = 662.1019;
NADH = 664.1175;
ints = groupval(xset, "maxint", "intb");
groups = data.frame(xset@groups);
ints[is.na(ints)] = 0;
nad = list();
nadh = list();
nadR = list();
nadhR = list();
numsamps = length(rownames(xset@phenoData));
for (i in 1:13) {
mz1 = NAD + (i-1)*1.00335;
mz2 = NADH +(i-1)*1.00335;
a = which(abs(groups$mzmed - mz1)/mz1*1000000 < 10 & abs(groups$rtmed - rt1) < 10);
b = which(abs(groups$mzmed - mz2)/mz2*1000000 < 10 & abs(groups$rtmed - rt2) < 10);
if (length(a) == 1) {
nad = c(nad, ints[a,]);
nadR = c(nadR, rownames(ints)[a]);
}
if (length(b) == 1) {
nadh = c(nadh, ints[b,]);
nadhR = c(nadhR, rownames(ints)[b]);
}
if (length(a) == 0) {
nad = c(nad, rep(0, numsamps));
nadR = c(nadR, 0);
}
if (length(b) == 0) {
nadh = c(nadh, rep(0,numsamps));
nadhR = c(nadhR, 0);
}
if (length(a) > 1) {
ind = which(abs(groups$rtmed[a] - rt1) < 10);
nad = c(nad, ints[a[ind],]);
nadR = c(nadR, rownames(ints)[a[ind]]);
}
if (length(b) > 1) {
ind = which(abs(groups$rtmed[b] - rt2) < 10);
nadh = c(nadh, ints[b[ind],]);
nadhR = c(nadhR, rownames(ints)[b[ind]]);
}
}
nad = matrix(unlist(nad), byrow = TRUE, ncol = numsamps);
nadh = matrix(unlist(nadh), byrow = TRUE, ncol = numsamps);
colnames(nad) = rownames(xset@phenoData);
colnames(nadh) = colnames(nad);
rownames(nad) = unlist(nadR);
rownames(nadh) = unlist(nadhR);
return(list(nad,nadh));
}
a = getNADH(xsG3, rt1, rt2)
a[[2]]
a[[1]]
rt1
groups[abs(groups$mzmed - 662.1019)/662.1019*1000000 < 20,]
rt1 = 1293
a = getNADH(xsG3, rt1, rt2)
a[[1]]
a[[2]]
colSums(a[[1]][,which(sN %in% sNWT)])/colSums(a[[2]][,which(sN %in% sNWT)])
colSums(a[[1]][,which(sN %in% sNKO)])/colSums(a[[2]][,which(sN %in% sNKO)])
load("~/Dropbox (Crawford Lab)/Thesis LCMS Data/121814 BMDMPreTxAcAcBOHB/011415x13cms.RData")
getNADH <- function(xset, rt1, rt2) {
NAD = 662.1019;
NADH = 664.1175;
ints = groupval(xset, "maxint", "intb");
groups = data.frame(xset@groups);
ints[is.na(ints)] = 0;
nad = list();
nadh = list();
nadR = list();
nadhR = list();
numsamps = length(rownames(xset@phenoData));
for (i in 1:13) {
mz1 = NAD + (i-1)*1.00335;
mz2 = NADH +(i-1)*1.00335;
a = which(abs(groups$mzmed - mz1)/mz1*1000000 < 10 & abs(groups$rtmed - rt1) < 10);
b = which(abs(groups$mzmed - mz2)/mz2*1000000 < 10 & abs(groups$rtmed - rt2) < 10);
if (length(a) == 1) {
nad = c(nad, ints[a,]);
nadR = c(nadR, rownames(ints)[a]);
}
if (length(b) == 1) {
nadh = c(nadh, ints[b,]);
nadhR = c(nadhR, rownames(ints)[b]);
}
if (length(a) == 0) {
nad = c(nad, rep(0, numsamps));
nadR = c(nadR, 0);
}
if (length(b) == 0) {
nadh = c(nadh, rep(0,numsamps));
nadhR = c(nadhR, 0);
}
if (length(a) > 1) {
ind = which(abs(groups$rtmed[a] - rt1) < 10);
nad = c(nad, ints[a[ind],]);
nadR = c(nadR, rownames(ints)[a[ind]]);
}
if (length(b) > 1) {
ind = which(abs(groups$rtmed[b] - rt2) < 10);
nadh = c(nadh, ints[b[ind],]);
nadhR = c(nadhR, rownames(ints)[b[ind]]);
}
}
nad = matrix(unlist(nad), byrow = TRUE, ncol = numsamps);
nadh = matrix(unlist(nadh), byrow = TRUE, ncol = numsamps);
colnames(nad) = rownames(xset@phenoData);
colnames(nadh) = colnames(nad);
rownames(nad) = unlist(nadR);
rownames(nadh) = unlist(nadhR);
return(list(nad,nadh));
}
groups = data.frame(xs3@groups);
groups[abs(groups$mzmed - 662.1019)/662.1019*1000000 < 20,]
groups[abs(groups$mzmed - 664.1175)/664.1175*1000000 < 20,]
rt1 = 464
rt2 = 454
a = getNADH(xs3, rt1, rt2)
a[[1]]
a[[2]]
colSums(a[[1]][,which(sN %in% sNWT)])/colSums(a[[2]][,which(sN %in% sNWT)])
colSums(a[[1]][,which(sN %in% sNWTAcAc)])/colSums(a[[2]][,which(sN %in% sNWTAcAc)])
sN
sN = rownames(xs3@phenoData)
colSums(a[[1]][,which(sN %in% sNWTAcAc)])/colSums(a[[2]][,which(sN %in% sNWTAcAc)])
colSums(a[[1]][,which(sN %in% sNKOAcAc)])/colSums(a[[2]][,which(sN %in% sNKOAcAc)])
colSums(a[[1]][,which(sN %in% sNWTBOHB)])/colSums(a[[2]][,which(sN %in% sNWTBOHB])
colSums(a[[1]][,which(sN %in% sNWTBOHB])/colSums(a[[2]][,which(sN %in% sNWTBOHB])
colSums(a[[1]][,which(sN %in% sNWTBOHB)])/colSums(a[[2]][,which(sN %in% sNWTBOHB)])
colSums(a[[1]][,which(sN %in% sNKOBOHB)])/colSums(a[[2]][,which(sN %in% sNKOBOHB)])
load("~/Dropbox (Crawford Lab)/Thesis LCMS Data/012715bactinBMDM/012915bactinBMDMAcAc.rdata.RData")
groups = data.frame(xs3@groups);
sN
groups[abs(groups$mzmed - 664.1175)/664.1175*1000000 < 20,]
groups[abs(groups$mzmed - 662.1019)/662.1019*1000000 < 20,]
rt1 = 1185
rt2 = 2002
a = getNADH(xs3, rt1, rt2)
getNADH <- function(xset, rt1, rt2) {
NAD = 662.1019;
NADH = 664.1175;
ints = groupval(xset, "maxint", "intb");
groups = data.frame(xset@groups);
ints[is.na(ints)] = 0;
nad = list();
nadh = list();
nadR = list();
nadhR = list();
numsamps = length(rownames(xset@phenoData));
for (i in 1:13) {
mz1 = NAD + (i-1)*1.00335;
mz2 = NADH +(i-1)*1.00335;
a = which(abs(groups$mzmed - mz1)/mz1*1000000 < 10 & abs(groups$rtmed - rt1) < 10);
b = which(abs(groups$mzmed - mz2)/mz2*1000000 < 10 & abs(groups$rtmed - rt2) < 10);
if (length(a) == 1) {
nad = c(nad, ints[a,]);
nadR = c(nadR, rownames(ints)[a]);
}
if (length(b) == 1) {
nadh = c(nadh, ints[b,]);
nadhR = c(nadhR, rownames(ints)[b]);
}
if (length(a) == 0) {
nad = c(nad, rep(0, numsamps));
nadR = c(nadR, 0);
}
if (length(b) == 0) {
nadh = c(nadh, rep(0,numsamps));
nadhR = c(nadhR, 0);
}
if (length(a) > 1) {
ind = which(abs(groups$rtmed[a] - rt1) < 10);
nad = c(nad, ints[a[ind],]);
nadR = c(nadR, rownames(ints)[a[ind]]);
}
if (length(b) > 1) {
ind = which(abs(groups$rtmed[b] - rt2) < 10);
nadh = c(nadh, ints[b[ind],]);
nadhR = c(nadhR, rownames(ints)[b[ind]]);
}
}
nad = matrix(unlist(nad), byrow = TRUE, ncol = numsamps);
nadh = matrix(unlist(nadh), byrow = TRUE, ncol = numsamps);
colnames(nad) = rownames(xset@phenoData);
colnames(nadh) = colnames(nad);
rownames(nad) = unlist(nadR);
rownames(nadh) = unlist(nadhR);
return(list(nad,nadh));
}
a = getNADH(xs3, rt1, rt2)
a[[1]]
a[[2]]
colSums(a[[1]][,which(sN %in% sNWT)])/colSums(a[[2]][,which(sN %in% sNWT)])
colSums(a[[1]][,which(sN %in% sNKO)])/colSums(a[[2]][,which(sN %in% sNKO)])
load("~/Dropbox (Crawford Lab)/Thesis LCMS Data/012715bactinBMDM/012915bactinBMDMGluc.rdata.RData")
getNADH <- function(xset, rt1, rt2) {
NAD = 662.1019;
NADH = 664.1175;
ints = groupval(xset, "maxint", "intb");
groups = data.frame(xset@groups);
ints[is.na(ints)] = 0;
nad = list();
nadh = list();
nadR = list();
nadhR = list();
numsamps = length(rownames(xset@phenoData));
for (i in 1:13) {
mz1 = NAD + (i-1)*1.00335;
mz2 = NADH +(i-1)*1.00335;
a = which(abs(groups$mzmed - mz1)/mz1*1000000 < 10 & abs(groups$rtmed - rt1) < 10);
b = which(abs(groups$mzmed - mz2)/mz2*1000000 < 10 & abs(groups$rtmed - rt2) < 10);
if (length(a) == 1) {
nad = c(nad, ints[a,]);
nadR = c(nadR, rownames(ints)[a]);
}
if (length(b) == 1) {
nadh = c(nadh, ints[b,]);
nadhR = c(nadhR, rownames(ints)[b]);
}
if (length(a) == 0) {
nad = c(nad, rep(0, numsamps));
nadR = c(nadR, 0);
}
if (length(b) == 0) {
nadh = c(nadh, rep(0,numsamps));
nadhR = c(nadhR, 0);
}
if (length(a) > 1) {
ind = which(abs(groups$rtmed[a] - rt1) < 10);
nad = c(nad, ints[a[ind],]);
nadR = c(nadR, rownames(ints)[a[ind]]);
}
if (length(b) > 1) {
ind = which(abs(groups$rtmed[b] - rt2) < 10);
nadh = c(nadh, ints[b[ind],]);
nadhR = c(nadhR, rownames(ints)[b[ind]]);
}
}
nad = matrix(unlist(nad), byrow = TRUE, ncol = numsamps);
nadh = matrix(unlist(nadh), byrow = TRUE, ncol = numsamps);
colnames(nad) = rownames(xset@phenoData);
colnames(nadh) = colnames(nad);
rownames(nad) = unlist(nadR);
rownames(nadh) = unlist(nadhR);
return(list(nad,nadh));
}
groups = data.frame(xs3@groups);
groups[abs(groups$mzmed - 662.1019)/662.1019*1000000 < 20,]
groups[abs(groups$mzmed - 664.1175)/664.1175*1000000 < 20,]
rt1 = 1206
rt2 = 2006
a = getNADH(xs3, rt1, rt2)
a[[1]]
a[[2]]
colSums(a[[1]][,which(sN %in% sNWT)])/colSums(a[[2]][,which(sN %in% sNWT)])
colSums(a[[1]][,which(sN %in% sNKO)])/colSums(a[[2]][,which(sN %in% sNKO)])
load("~/Dropbox (Crawford Lab)/Thesis LCMS Data/020315 bactin BMDMs M0 M1 M2 diff glucose/020514x13cms.RData")
getNADH <- function(xset, rt1, rt2) {
NAD = 662.1019;
NADH = 664.1175;
ints = groupval(xset, "maxint", "intb");
groups = data.frame(xset@groups);
ints[is.na(ints)] = 0;
nad = list();
nadh = list();
nadR = list();
nadhR = list();
numsamps = length(rownames(xset@phenoData));
for (i in 1:13) {
mz1 = NAD + (i-1)*1.00335;
mz2 = NADH +(i-1)*1.00335;
a = which(abs(groups$mzmed - mz1)/mz1*1000000 < 10 & abs(groups$rtmed - rt1) < 10);
b = which(abs(groups$mzmed - mz2)/mz2*1000000 < 10 & abs(groups$rtmed - rt2) < 10);
if (length(a) == 1) {
nad = c(nad, ints[a,]);
nadR = c(nadR, rownames(ints)[a]);
}
if (length(b) == 1) {
nadh = c(nadh, ints[b,]);
nadhR = c(nadhR, rownames(ints)[b]);
}
if (length(a) == 0) {
nad = c(nad, rep(0, numsamps));
nadR = c(nadR, 0);
}
if (length(b) == 0) {
nadh = c(nadh, rep(0,numsamps));
nadhR = c(nadhR, 0);
}
if (length(a) > 1) {
ind = which(abs(groups$rtmed[a] - rt1) < 10);
nad = c(nad, ints[a[ind],]);
nadR = c(nadR, rownames(ints)[a[ind]]);
}
if (length(b) > 1) {
ind = which(abs(groups$rtmed[b] - rt2) < 10);
nadh = c(nadh, ints[b[ind],]);
nadhR = c(nadhR, rownames(ints)[b[ind]]);
}
}
nad = matrix(unlist(nad), byrow = TRUE, ncol = numsamps);
nadh = matrix(unlist(nadh), byrow = TRUE, ncol = numsamps);
colnames(nad) = rownames(xset@phenoData);
colnames(nadh) = colnames(nad);
rownames(nad) = unlist(nadR);
rownames(nadh) = unlist(nadhR);
return(list(nad,nadh));
}
groups = data.frame(xs3@groups);
groups[abs(groups$mzmed - 662.1019)/662.1019*1000000 < 20,]
groups[abs(groups$mzmed - 664.1175)/664.1175*1000000 < 20,]
rt1 = 1254
rt2 = 2126
a = getNADH(xs3, rt1, rt2)
a[[2]]
a[[1]]
colSums(a[[1]][,which(sN %in% sNWTM0)])/colSums(a[[2]][,which(sN %in% sNWTM0)])
colSums(a[[1]][,which(sN %in% sNKOM0)])/colSums(a[[2]][,which(sN %in% sNKOM0)])
colSums(a[[1]][,which(sN %in% sNWTM1)])/colSums(a[[2]][,which(sN %in% sNWTM1)])
colSums(a[[1]][,which(sN %in% sNKOM1)])/colSums(a[[2]][,which(sN %in% sNKOM1)])
colSums(a[[1]][,which(sN %in% sNWTM2)])/colSums(a[[2]][,which(sN %in% sNWTM2)])
colSums(a[[1]][,which(sN %in% sNKOM2)])/colSums(a[[2]][,which(sN %in% sNKOM2)])
load("~/Dropbox (Crawford Lab)/Thesis LCMS Data/103014 13CoctCompGlucMEFs/11111413CoctCompGlucMEFsppm2snthresh2.RData")
load("~/Dropbox (Crawford Lab)/Thesis LCMS Data/031815 AcAc M0 M1 M2/032015AcAcM0M1M2.RData")
source('~/Dropbox (Crawford Lab)/Thesis LCMS Data/Scripts and manuals/metlin.r')
metlin = loadMetlin()
mzs = unique(c(labelsKOM0[[1]], labelsKOM1[[1]], labelsKOM2[[1]]))
mzs = unique(c(mzs, labelsWTM0[[1]], labelsWTM1[[1]], labelsWTM2[[2]]))
IDs = getMetlinIDs(mzs, metlin, -1.0078, 20, "IDs.txt")
head(mzs)
mzs = unlist(mzs)
mzs = unique(c(unlist(labelsKOM0[[1]]), unlist(labelsKOM1[[1]]), unlist(labelsKOM2[[1]])))
mzs = unique(c(mzs, unlist(labelsWTM0[[1]]), unlist(labelsWTM1[[1]]), unlist(labelsWTM2[[2]])))
head(mzs)
mzs = unique(round(mzs,4))
head(mzs)
IDs = getMetlinIDs(mzs, metlin, -1.0078, 20, "IDs.txt")
save.image("~/Dropbox (Crawford Lab)/Thesis LCMS Data/031815 AcAc M0 M1 M2/032015AcAcM0M1M2.RData")
load("~/Dropbox (Crawford Lab)/Thesis LCMS Data/031815 AcAc M0 M1 M2/032015AcAcM0M1M2.RData")
head(mzs)
mzs = unique(c(unlist(labelsKOM0[[1]]), unlist(labelsKOM1[[1]]), unlist(labelsKOM2[[1]])))
mzs = unique(c(mzs, unlist(labelsWTM0[[1]]), unlist(labelsWTM1[[1]]), unlist(labelsWTM2[[2]])))
head(mzs)
head(unlist(labelsWTM0[[1]]))
mzs = mzs[(order(mzs))]
head(mzs)
mzs = unique(round(mzs, 4))
head(mzs)
IDs = getMetlinIDs(mzs, metlin, -1.0078, 20, "IDs.txt")
getwd()
setwd("~/Dropbox (Crawford Lab)/Thesis LCMS Data/031815 AcAc M0 M1 M2")
IDs = getMetlinIDs(mzs, metlin, -1.0078, 20, "IDs.txt")
save.image("~/Dropbox (Crawford Lab)/Thesis LCMS Data/031815 AcAc M0 M1 M2/032015AcAcM0M1M2.RData")
setwd("~/Dropbox (Crawford Lab)/Thesis LCMS Data/081513 LPS-Astrocytes/032315 example")
library("X13CMS", lib.loc="/Library/Frameworks/R.framework/Versions/3.1/Resources/library")
groupval()
detach("package:X13CMS", unload=TRUE)
setwd("~/Dropbox (Crawford Lab)/Thesis LCMS Data")
source('~/Dropbox (Crawford Lab)/Thesis LCMS Data/Scripts and manuals/X13CMS/R/functionsv6.r')
setwd("~/Dropbox (Crawford Lab)/Thesis LCMS Data/081513 LPS-Astrocytes/032315 example")
load("~/Dropbox (Crawford Lab)/Thesis LCMS Data/081513 LPS-Astrocytes/032315 example/xcms.rdata")
sN = rownames(xs3@phenoData)
sN
sNctrl = sN[c(1:3, 7:9)] # control samples (3 unlabeled, 3 labeled)
sNLPS = sN[c(4:6, 10:12)] # LPS-treated samples (3 unlabeled, 3 labeled)
sNctrl
source('~/Dropbox (Crawford Lab)/Thesis LCMS Data/Scripts and manuals/X13CMS/R/functionsv6.r')
source('~/Dropbox (Crawford Lab)/Thesis LCMS Data/Scripts and manuals/X13CMS/R/functionsv6.r')
source('~/Dropbox (Crawford Lab)/Thesis LCMS Data/Scripts and manuals/X13CMS/R/functionsv6.r')
source('~/Dropbox (Crawford Lab)/Thesis LCMS Data/Scripts and manuals/X13CMS/R/functionsv6.r')
sN = rownames(xs3@phenoData) # sample names
sNctrl = sN[c(1:3, 7:9)] # control samples (3 unlabeled, 3 labeled)
sNLPS = sN[c(4:6, 10:12)] # LPS-treated samples (3 unlabeled, 3 labeled)
# labeling report for control samples:
labelsCtrl = getIsoLabelReport(xcmsSet = xs3, sampleNames = sNctrl, unlabeledSamples = "C12", labeledSamples = "C13",
isotopeMassDiff = 1.00335, RTwindow = 10, ppm = 20, massOfLabeledAtom = 12, noiseCutoff = 10000,
intChoice = "intb", varEq = FALSE, alpha = 0.05, singleSample = FALSE, compareOnlyDistros = FALSE,
monotonicityTol = FALSE, enrichTol = 0.1)
# labeling report for LPS-treated samples:
labelsLPS = getIsoLabelReport(xs3, sNLPS, "C12", "C13", 1.00335, 10, 20, 12, 10000) # all other parameters set to defaults
# in each of the sN variables, the first 3 samples listed are of the "C12" or unlabeled type while the next 3 are of the "C13" type
classes = c(rep("C12",3), rep("C13",3))
# diffReport comparing labeling patterns in control vs LPS-treated samples:
isoDiff = getIsoDiffReport(labelsData1 = labelsCtrl, labelsData2 = labelsLPS, condition1 = "ctrl", condition2 = "LPS",
classes1 = classes, classes2 = classes, labeledSamples = "C13", varEq = FALSE, singleSample = FALSE)
# print labeling report to a text file (recommended to open in Excel)
printIsoListOutputs(listReport = labelsCtrl, outputfile = "labelsCtrl.txt")
# print pdf of isotopologue groups in a single labeling report plotted as relative intensity distributions
plotLabelReport(isoLabelReport = labelsCtrl, intOption = "rel", classes, labeledSamples = "C13", outputfile = "labelsCtrlrel.pdf")
# print pdf of isotopologue groups in a single labeling report plotted as absolute intensity distributions
plotLabelReport(isoLabelReport = labelsCtrl, intOption = "abs", classes, labeledSamples = "C13", outputfile = "labelsCtrlabs.pdf")
# print pdf of isotopologue groups from an isoDiff report comparing two conditions; plots are of relative intensity distributions
plotIsoDiffReport(isoDiffReport = isoDiff, xcmsSet = xs3, intChoice = "intb", sampleNames1 = sNctrl, sampleNames2 = sNLPS,
labelReport1 = labelsCtrl, labelReport2 = labelsLPS, classes1 = classes, classes2 = classes, labeledSamples = "C13",
isotopeMassDifference = 1.00335, outputfile = "isoDiffPlots.pdf")
# print pdf of isotopologue groups from an isoDiff report comparing two conditions; plots are of absolute intensity distributions combined into total pools
plotTotalIsoPools <- function(isoDiffReport = isoDiff, xcmsSet = xs3, intChoice = "intb", sampleNames1 = sNctrl, sampleNames2 = sNLPS,
labelReport1 = labelsCtrl, labelReport2 = labelsLPS, classes1 = classes, classes2 = classes, labeledSamples = "C13",
outputfile = "totalPools.pdf")
# obtain a condensed version of the XCMS diffReport using just the C12 samples of control and LPS-treated samples; output is a matrix
miniDiff = miniDiffReport(xcmsSet = xs3, class1sampNames = sN[1:3], class2sampNames = sN[4:6], varEq = FALSE, intChoice = "intb")
# filters isoDiff report to report back only isotopologue groups that are different between sample classes
filteredIsoDiff = filterIsoDiffReport(isoDiffReport = isoDiff, alpha = 0.05)
labelsLPS = getIsoLabelReport(xs3, sNLPS, "C12", "C13", 1.00335, 10, 20, 12, 10000, alpha = 0.05) # all other parameters set to defaults
isoDiff = getIsoDiffReport(labelsData1 = labelsCtrl, labelsData2 = labelsLPS, condition1 = "ctrl", condition2 = "LPS",
classes1 = classes, classes2 = classes, labeledSamples = "C13", varEq = FALSE, singleSample = FALSE)
getwd()
plotIsoDiffReport(isoDiffReport = isoDiff, xcmsSet = xs3, intChoice = "intb", sampleNames1 = sNctrl, sampleNames2 = sNLPS,
labelReport1 = labelsCtrl, labelReport2 = labelsLPS, classes1 = classes, classes2 = classes, labeledSamples = "C13",
isotopeMassDifference = 1.00335, outputfile = "isoDiffPlots.pdf")
# print pdf of isotopologue groups from an isoDiff report comparing two conditions; plots are of absolute intensity distributions combined into total pools
plotTotalIsoPools <- function(isoDiffReport = isoDiff, xcmsSet = xs3, intChoice = "intb", sampleNames1 = sNctrl, sampleNames2 = sNLPS,
labelReport1 = labelsCtrl, labelReport2 = labelsLPS, classes1 = classes, classes2 = classes, labeledSamples = "C13",
outputfile = "totalPools.pdf")
# obtain a condensed version of the XCMS diffReport using just the C12 samples of control and LPS-treated samples; output is a matrix
miniDiff = miniDiffReport(xcmsSet = xs3, class1sampNames = sN[1:3], class2sampNames = sN[4:6], varEq = FALSE, intChoice = "intb")
# filters isoDiff report to report back only isotopologue groups that are different between sample classes
filteredIsoDiff = filterIsoDiffReport(isoDiffReport = isoDiff, alpha = 0.05)
length(isoDff[[1]])
length(isoDiff[[1]])
length(filteredIsoDiff[[1]])
getwd()
plotTotalIsoPools <- function(isoDiffReport = isoDiff, xcmsSet = xs3, intChoice = "intb", sampleNames1 = sNctrl, sampleNames2 = sNLPS,
labelReport1 = labelsCtrl, labelReport2 = labelsLPS, classes1 = classes, classes2 = classes, labeledSamples = "C13",
outputfile = "totalPools.pdf")
)
source('~/Dropbox (Crawford Lab)/Thesis LCMS Data/Scripts and manuals/X13CMS/R/functionsv6.r')
plotTotalIsoPools(isoDiffReport = isoDiff, xcmsSet = xs3, intChoice = "intb", sampleNames1 = sNctrl, sampleNames2 = sNLPS,
labelReport1 = labelsCtrl, labelReport2 = labelsLPS, classes1 = classes, classes2 = classes, labeledSamples = "C13",
outputfile = "totalPools.pdf")
179.0549+7*1.00335
179.0549+6*1.00335
186.07969-185.0749
head(miniDiff)
miniDiff = miniDiffReport(xcmsSet = xs3, class1sampNames = sN[1:3], class2sampNames = sN[4:6], varEq = FALSE, intChoice = "intb")
sN[1:3]
source('~/Dropbox (Crawford Lab)/Thesis LCMS Data/Scripts and manuals/X13CMS/R/functionsv6.r')
miniDiff = miniDiffReport(xcmsSet = xs3, class1sampNames = sN[1:3], class2sampNames = sN[4:6], varEq = FALSE, intChoice = "intb")
head(peakIntensities)
source('~/Dropbox (Crawford Lab)/Thesis LCMS Data/Scripts and manuals/X13CMS/R/functionsv6.r')
miniDiff = miniDiffReport(xcmsSet = xs3, class1sampNames = sN[1:3], class2sampNames = sN[4:6], varEq = FALSE, intChoice = "intb")
head(miniDiff)
save.image("~/Dropbox (Crawford Lab)/Thesis LCMS Data/081513 LPS-Astrocytes/032315 example/sampleWorkspace.RData")
