Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
AD-CSF
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Environmental Cheminformatics
AD-CSF
Commits
92c85823
Commit
92c85823
authored
2 years ago
by
Begoña Talavera Andújar
Browse files
Options
Downloads
Patches
Plain Diff
Upload New File
parent
a7d44de8
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
patRoon_codes/Non_target_pos.R
+89
-0
89 additions, 0 deletions
patRoon_codes/Non_target_pos.R
with
89 additions
and
0 deletions
patRoon_codes/Non_target_pos.R
0 → 100644
+
89
−
0
View file @
92c85823
################################Non-target screening of CSF with patRoon 2.1.0###############################
###Load library
library
(
patRoon
)
###Set all options
#Set the path of the working directory
setwd
(
"../../../../patRoon_codes/"
)
#set the name of the output folder
output
<-
"report_NT"
# Modify this value to point to the location of the MetFrag2.4.5-CL.jar file
options
(
patRoon.path.MetFragCL
=
"~/opt/metfrag/MetFrag2.4.5-CL.jar"
)
options
(
patRoon.path.obabel
=
"~/babel/bin/"
)
####Initialitation
#Load the analysis.csv that contains the path where the mzML files are. There is one different anaylsis.csv per LC mode (RP or HILIC) and per ionization mode (positive or negative), althought this code is just for the positive mode.
#Positive ionization files
anaInfoPos
<-
read.csv
(
"analysis_RP_POS.csv"
)
#Set the localization of the database
myLocalDatabasePath
<-
".../patRoon_files/databases/AD_database.csv"
###Extract features
library
(
xcms
)
#To find positive features
fList
<-
findFeatures
(
anaInfoPos
,
"xcms3"
,
param
=
xcms
::
CentWaveParam
(
ppm
=
5
,
peakwidth
=
c
(
10
,
30
),
mzdiff
=
-0.001
,
mzCenterFun
=
"wMean"
,
integrate
=
1L
,
snthresh
=
10
,
prefilter
=
c
(
3
,
100
),
noise
=
7500
,
fitgauss
=
FALSE
,
firstBaselineCheck
=
TRUE
),
verbose
=
TRUE
)
###Group features
library
(
BiocParallel
)
BiocParallel
::
register
(
BiocParallel
::
SerialParam
(),
default
=
TRUE
)
fGroups
<-
groupFeatures
(
fList
,
"xcms3"
)
library
(
"MetaClean"
)
fGroups
<-
filter
(
fGroups
,
absMinIntensity
=
100
,
relMinReplicateAbundance
=
NULL
,
maxReplicateIntRSD
=
NULL
,
blankThreshold
=
3
,
removeBlanks
=
TRUE
,
retentionRange
=
NULL
,
mzRange
=
NULL
)
###Retrieve MS peak lists
avgPListParams
<-
getDefAvgPListParams
(
clusterMzWindow
=
0.005
)
mslists
<-
generateMSPeakLists
(
fGroups
,
"mzr"
,
maxMSRtWindow
=
5
,
precursorMzWindow
=
0.5
,
avgFeatParams
=
avgPListParams
,
avgFGroupParams
=
avgPListParams
)
mslists
<-
filter
(
mslists
,
withMSMS
=
TRUE
,
absMSIntThr
=
NULL
,
absMSMSIntThr
=
NULL
,
relMSIntThr
=
NULL
,
relMSMSIntThr
=
NULL
,
topMSPeaks
=
NULL
,
topMSMSPeaks
=
25
,
deIsotopeMS
=
FALSE
,
deIsotopeMSMS
=
FALSE
)
###Find compound structure candidates
compounds
<-
generateCompounds
(
fGroups
,
mslists
,
"metfrag"
,
method
=
"CL"
,
dbRelMzDev
=
5
,
fragRelMzDev
=
5
,
fragAbsMzDev
=
0.002
,
adduct
=
"[M+H]+"
,
database
=
"csv"
,
extraOpts
=
list
(
LocalDatabasePath
=
myLocalDatabasePath
),
scoreTypes
=
c
(
"fragScore"
,
"score"
,
"individualMoNAScore"
),
maxCandidatesToStop
=
500
,
errorRetries
=
200
,
timeoutRetries
=
20
)
###Report results
#Create the csv tables with groups and peak intensities for the set (positive and negative results combined)
reportCSV
(
fGroups
,
path
=
output
,
reportFeatures
=
FALSE
,
compounds
=
compounds
,
compoundsNormalizeScores
=
"max"
)
# Summary of MetFrag Results in a a Single Table
MFsummary
<-
as.data.table
(
compounds
)
outputSummary
<-
paste
(
output
,
"MFsummary.csv"
,
sep
=
"/"
)
write.csv
(
MFsummary
,
outputSummary
)
#Plots of every group of features (in the set)
reportPDF
(
fGroups
,
path
=
output
,
reportFGroups
=
TRUE
,
reportFormulaSpectra
=
TRUE
,
compounds
=
compounds
,
compoundsNormalizeScores
=
"max"
,
MSPeakLists
=
mslists
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment