Skip to content
Snippets Groups Projects
Commit 63954332 authored by Todor Kondić's avatar Todor Kondić
Browse files

app: Update MetFrag on-line docs.

parent 071ea982
No related branches found
No related tags found
No related merge requests found
Pipeline #68568 failed
...@@ -2,6 +2,7 @@ mk_shiny_input <- function(name,fun,args) { ...@@ -2,6 +2,7 @@ mk_shiny_input <- function(name,fun,args) {
content = do.call(what=fun,args=c(list(inputId=name),args)) content = do.call(what=fun,args=c(list(inputId=name),args))
res = list(name=name, res = list(name=name,
fun=fun, fun=fun,
args=args,
content=content) content=content)
res res
} }
...@@ -10,6 +11,15 @@ inject_inputs<- function(collection,which) { ...@@ -10,6 +11,15 @@ inject_inputs<- function(collection,which) {
do.call(shiny::tagList,lapply(which,function(nm) collection[[nm]]$content)) do.call(shiny::tagList,lapply(which,function(nm) collection[[nm]]$content))
} }
inputs_label <- function(collection,which) {
collection[[which]]$args$label
}
inputs_html_out <- function(collection, which, inline=T,...) {
txt = inputs_label(collection, which)
paste0('<code>',txt,'</code>')
}
INPUTS_METFRAG_NUMERIC = list(mk_shiny_input(name="mf_database_search_relative_mass_deviation", INPUTS_METFRAG_NUMERIC = list(mk_shiny_input(name="mf_database_search_relative_mass_deviation",
fun="numericInput", fun="numericInput",
args=list(label="Database search relative mass deviation", args=list(label="Database search relative mass deviation",
......
...@@ -182,6 +182,15 @@ inject_inputs(INPUTS_METFRAG,c("mf_pre_processing_candidate_filter", ...@@ -182,6 +182,15 @@ inject_inputs(INPUTS_METFRAG,c("mf_pre_processing_candidate_filter",
<!-- metfrag-conf-execution --> <!-- metfrag-conf-execution -->
#### Execution #### Execution
<details><summary>More about execution controls</summary>
The `Number of MetFrag Processses` field will show the maximum amount
of logical threads available on the platform which executes
MetFrag. Consider that, if you use all of them, this might cause an
overload of the system's resources.
</details>
```{r, echo=F} ```{r, echo=F}
## This is treated differently than other MF inputs, because the value ## This is treated differently than other MF inputs, because the value
## is not known prior to starting a R session. There should be a ## is not known prior to starting a R session. There should be a
...@@ -201,6 +210,50 @@ numericInput(inputId="mf_proc", ...@@ -201,6 +210,50 @@ numericInput(inputId="mf_proc",
#### Databases #### Databases
<details><summary>More about databases</summary>
MetFrag offers a possibility to query different chemical
databases. Some, such as `PubChem` are remote and some, such as
`PubChemLite` are files that can be downloaded and used locally. At
the moment, Shinyscreen has only been well tested with `LocalCSV`
databases --- those which come in a CSV format. The Shinyscreen
development team is keen to hear experiences of experimentation with
other sources and. Let us know what works, or does not work and
whether having other sources available is important for your
endeavours.
As for the `LocalCSV` types of databases, on an abstract level they
can be viewed as collections of metadata about various
compounds. There will be *identifier* fields which are unique to a
compound. As an example, those could be `Identifier`, or
`CompoundName` columns in a PubChemLite database. Additionally, there
will be lots of other fields, some of which can be used as *scoring
terms*. For example, annotation, patent and PubMed count columns in a
PubChemLite database can be used by MetFrag to aid sensible ranking of
candidates.
Local databases should all reside in a directory that was specified
during Shinyscreen initialisation (look up the documentation of the
`Shinyscreen::init` function).
User selects the local databases from
`r inputs_html_out(INPUTS_METFRAG,"mf_local_database")`
control. Once a database is selected, it is required
to declare which columns are the identifiers
and this is done using
`r inputs_html_out(INPUTS_METFRAG,"mf_local_db_col_ident")`.
The summary of MetFrag results which is created by Shinyscreen
contains top candidates. But, in addition to those, it will show a
collection of other candidates, those that did not rank that high. The
identifier filed which will be used for those can be chosen from
`r inputs_html_out(INPUTS_METFRAG,"mf_local_db_col_coll")`.
In case of PubChemLite, it is probably best to select `Identifier` column here.
</details>
```{r, echo=F} ```{r, echo=F}
inject_inputs(INPUTS_METFRAG,c("mf_database_type", inject_inputs(INPUTS_METFRAG,c("mf_database_type",
"mf_local_database", "mf_local_database",
...@@ -214,6 +267,11 @@ inject_inputs(INPUTS_METFRAG,c("mf_database_type", ...@@ -214,6 +267,11 @@ inject_inputs(INPUTS_METFRAG,c("mf_database_type",
#### MetFrag Scores #### MetFrag Scores
<details><summary>About MetFrag scoring terms</summary>
Here, it is possible to select MetFrag scoring types available for any
kind of database.
</details>
```{r, echo = F} ```{r, echo = F}
inject_inputs(INPUTS_METFRAG,"mf_scores_intrinsic") inject_inputs(INPUTS_METFRAG,"mf_scores_intrinsic")
DT::DTOutput("mf_local_ident") DT::DTOutput("mf_local_ident")
...@@ -224,6 +282,11 @@ DT::DTOutput("mf_local_ident") ...@@ -224,6 +282,11 @@ DT::DTOutput("mf_local_ident")
#### Local Database Scoring Terms #### Local Database Scoring Terms
<details><summary>About local DB scoring terms</summary>
Select local database columns that make sense as scoring terms.
</details>
```{r, echo = F} ```{r, echo = F}
inject_inputs(INPUTS_METFRAG,"mf_local_db_col_scores") inject_inputs(INPUTS_METFRAG,"mf_local_db_col_scores")
DT::DTOutput("mf_local_db_scores") DT::DTOutput("mf_local_db_scores")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment