Skip to content

Commit 2f5055d

Browse files
authored
Merge pull request #4 from GarrettLab-UF/JPK_Dev
Jpk dev
2 parents 97b36d0 + d383877 commit 2f5055d

File tree

3 files changed

+29
-14
lines changed

3 files changed

+29
-14
lines changed

2018_07_19_LMN_Instructions.docx

41.8 KB
Binary file not shown.

LN.R

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,9 @@
66
rm( list = ls() )
77

88
# comment below for csv input
9-
# args = commandArgs(trailingOnly=TRUE)
9+
args = commandArgs(trailingOnly=TRUE)
1010
# uncomment below for csv input
11-
# args = c("C:/Users/Jeremy/Desktop/Desktop/Instrumentation/Software/MSms/LipidMatch_Workflow/LMQ/2018_05_08_LMQ_Software/LMQ_settings.csv")
12-
# args = c("/Users/JasonCochran/Documents/research/LipidMatch-Normalizer/LMQ_settings.csv")
13-
args = c("C:/Users/Jeremy/Desktop/Desktop/Instrumentation/Software/MSms/LipidMatch_Workflow/LipidMatch_Normalizer/2018_07_18_LMN_Software/LMN_settings.csv")
11+
# args = c("C:/Users/Jeremy/Desktop/Desktop/Instrumentation/Software/MSms/LipidMatch_Workflow/LipidMatch_Normalizer/2018_07_18_LMN_Software/LN_settings.csv")
1412

1513
numAdducts <- NULL
1614
numValues <- NULL
@@ -265,13 +263,13 @@ invisible( apply(InternalStandard, 1, FindStandards) )
265263

266264
rm(mz_tolerance, row, rt_tolerance, titles, FindStandards)
267265

266+
# Make a table of just our matched Intd Standards to make quantifying easier
267+
write.table(matches, file = paste(paste(substr(featureTable_loc,1,nchar(featureTable_loc)-4),"IS_Found.csv", sep = "_"), sep = "/"), sep = ",", col.names = TRUE, row.names = FALSE)
268+
268269
#############################################
269270
############### PART 2 & 3 ##################
270271
#############################################
271272

272-
# Make a table of just our matched Intd Standards to make quantifying easier
273-
write.table(matches, file = paste(paste(substr(featureTable_loc,1,nchar(featureTable_loc)-4),"IS_Found.csv", sep = "_"), sep = "/"), sep = ",", col.names = TRUE, row.names = FALSE)
274-
275273
# Setup a dataframe to store all the classes we need
276274
quantClasses <- as.list( strsplit( as.character( InternalStandard$Classes), split = " " ) )
277275
quantClasses <- sapply( quantClasses , '[', seq(max(sapply(quantClasses, length))))
@@ -486,21 +484,32 @@ comparator = function(sel_group) {
486484
apply(subset_sm, 1, quantifier, sel_IS = avgIntStd, curStandard = curStandard, score = 2 )
487485
}
488486
} else {
489-
subset_classes <- classes
490-
avgIntStd <- which( abs( as.numeric(subset_classes$RT)-avgRT) == min(abs( as.numeric(subset_classes$RT)-avgRT)) )
491-
avgIntStd <- subset_classes[avgIntStd,]
487+
avgIntStd <- which( abs( as.numeric(classes$RT)-avgRT) == min(abs( as.numeric(classes$RT)-avgRT)) )
488+
avgIntStd <- classes[avgIntStd,]
489+
if (grepl("].+",sel_group[2])) {
490+
PosFeature<-TRUE
491+
} else {
492+
PosFeature<-FALSE
493+
}
494+
if (PosFeature==TRUE) {
495+
matches_subset<-matches[grep("].+",matches[,ncol(matches)]),]
496+
}
497+
if (PosFeature==FALSE) {
498+
matches_subset<-matches[grep("].-",matches[,ncol(matches)]),]
499+
}
492500
curStandard <- which( matches$matchClass == avgIntStd[,1] )
493501
curStandard <- matches[curStandard,]
494502
# Need to refine selection of curStandard to account for m/z average
495503
mzAvg <- mean(subset_sm[,mzCol])
496504
mzAvgFeature <- which( abs( as.numeric(curStandard[,mzCol])-mzAvg) == min(abs( as.numeric(curStandard[,mzCol])-mzAvg)) )
497505
curStandard <- curStandard[mzAvgFeature,]
506+
#browser()
498507
if( nrow(curStandard) != 0 ) {
499508
apply(subset_sm, 1, quantifier, sel_IS = avgIntStd, curStandard = curStandard, score = 3 )
500509
}
501510
}
502511
} else {
503-
# print("No matches identified lipids were found to quantify using our current standard.")
512+
#print("No matches identified lipids were found to quantify using our current standard.")
504513
}
505514
}
506515

README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
1-
# LipidMatch Quant
1+
# LipidMatch Normalizer
22

33
Open source solution for quantification of lipids. Can be easily used with LipidMatch software.
44

5-
How to download LipidMatchQuant
5+
For detailed instructions on getting started:
6+
=========================================
7+
Please see the video tutorial for help:
8+
See tutorial 10 in the following LipidMatch tutorial series:
9+
https://www.youtube.com/playlist?list=PLZtU6nmcTb5mQWKYLJmULsfqNy9eCwy7K
10+
11+
How to download LipidMatch Normalizer
612
=========================================
713
Want to download the latest version? Click "release" in the lower menu then click 'zip' to download the version you want!
814

@@ -17,5 +23,5 @@ Want to contribute to our project?
1723
Start by creating a Github profile! Then fork the Github project to your local computer. We recommend R Studio for coding but you can use anything you like. When you have completed the modifications, submit a pull request to the project and the developers will review it.
1824

1925

20-
Check out the UF SECIM webpage here: http://secim.ufl.edu/
26+
Check out the UF SECIM webpage here: http://secim.ufl.edu/secim-tools/
2127
=========================================

0 commit comments

Comments
 (0)