Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
shinyscreen
Manage
Activity
Members
Labels
Plan
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review 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
shinyscreen
Commits
0e3ea5f3
Unverified
Commit
0e3ea5f3
authored
5 years ago
by
Todor Kondic
Browse files
Options
Downloads
Patches
Plain Diff
Add simple helpers to base.R
parent
da87769c
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
R/base.R
+18
-0
18 additions, 0 deletions
R/base.R
R/mix.R
+1
-36
1 addition, 36 deletions
R/mix.R
with
19 additions
and
36 deletions
R/base.R
0 → 100644
+
18
−
0
View file @
0e3ea5f3
tab2file
<-
function
(
tab
,
file
,
...
)
{
write.csv
(
x
=
tab
,
file
=
file
,
row.names
=
F
,
...
)
}
file2tab
<-
function
(
file
,
stringsAsFactors
=
F
,
comment.char
=
''
,
...
)
{
read.csv
(
file
=
file
,
header
=
T
,
stringsAsFactors
=
stringsAsFactors
,
comment.char
=
comment.char
,
na.strings
=
c
(
""
,
"NA"
),
...
)
}
isThingFile
<-
function
(
fn
)
{
if
(
length
(
fn
)
>
0
&&
is.character
(
fn
))
{
file.exists
(
fn
)
}
else
F
}
This diff is collapsed.
Click to expand it.
R/mix.R
+
1
−
36
View file @
0e3ea5f3
...
...
@@ -31,26 +31,7 @@ REST_TXT_INP<-c("fnStgsRMB",
"confFileTabProcInp"
,
"confResFileTab"
)
## ***** Helper Functions *****
tab2file
<-
function
(
tab
,
file
,
...
)
{
write.csv
(
x
=
tab
,
file
=
file
,
row.names
=
F
,
...
)
}
file2tab
<-
function
(
file
,
stringsAsFactors
=
F
,
comment.char
=
''
,
...
)
{
read.csv
(
file
=
file
,
header
=
T
,
stringsAsFactors
=
stringsAsFactors
,
comment.char
=
comment.char
,
na.strings
=
c
(
""
,
"NA"
),
...
)
}
isThingFile
<-
function
(
fn
)
{
if
(
length
(
fn
)
>
0
&&
is.character
(
fn
))
{
file.exists
(
fn
)
}
else
F
}
## ***** End helper functions *****
ppInpFt
<-
function
()
{
tempfile
(
pattern
=
FN_PP_OUT_PREF
,
fileext
=
".csv"
)
}
...
...
@@ -547,23 +528,7 @@ RMB_EIC_prescreen_df_old1 <- function (wd, RMB_mode, FileList, cmpd_list,
write.csv
(
rtwiDf
,
file
=
file.path
(
odir
,
"RTs_wI.csv"
),
row.names
=
F
)
}
##' Extracts data from mzML files.
##'
##' @title Data Extraction from mzML Files
##' @param fTab File table with Files,ID,wd,Name and mz
##' columns. Column Files, as well as wd must have all rows
##' identical.
##'
##' @param extr_fun Extraction function from the backend.
##' @param limEIC Absolute mz tolerance used to extract precursor EICs.
##' @param limFinePPM Tolerance given in PPM used to associate input
##' masses with what the instrument assigned as precutsors to MS2.
##' @param bufferMode Either "onDisk", or "inMemory". Only relevant
##' for MSnbase backend.
##' @return Nothing useful.
##' @author Todor Kondić
extract
<-
function
(
fTab
,
extr_fun
,
limEIC
,
limFinePPM
,
bufferMode
)
{
}
preProc
<-
function
(
fnFileTab
,
fnDest
=
paste
(
stripext
(
fnFileTab
),
"_candidate.csv"
,
sep
=
''
),
noiseFac
=
3
,
rtDelta
=
0.5
,
intTresh
=
1e5
)
{
## read in .csv file as 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