Skip to contents

[Experimental]

This defines the input for the gene signature specification.

Usage

geneSpecInput(
  inputId,
  funs,
  label_genes = "Select Gene(s)",
  label_funs = "Select Gene Summary",
  label_text_button = "Enter list of genes",
  label_lock_button =
    "Lock gene selection (so that it does not get updated when filtering)",
  label_select_all_button = paste0("Select All Genes (first ", max_options, ")"),
  label_select_none_button = "Select None",
  max_options = 200L,
  max_selected = max_options
)

Arguments

inputId

(string)
the ID used to call the module input.

funs

(named list)
names of this list will be used for the function selection drop down menu.

label_genes

(string)
label for the gene selection.

label_funs

(string)
label for the function selection.

label_text_button

(string)
label for the text input button.

label_lock_button

(string)
label for the lock button.

label_select_all_button

(string)
label for the selecting all genes button.

label_select_none_button

(string)
label for the selecting no genes button.

max_options

(count)
maximum number of gene options rendering and selected via "Select All".

max_selected

(count)
maximum number of genes which can be selected.

Value

The UI part.

See also

geneSpecServer() for the module server and a complete example.

Examples

geneSpecInput("my_genes", list(mean = colMeans), label_funs = "Please select function")
#> <div class="row">
#>   <div class="col-sm-8">
#>     <label class="control-label">Select Gene(s)</label>
#>   </div>
#>   <div class="col-sm-2">
#>     <button class="btn btn-default action-button pull-right list-genes" id="my_genes-select_none_button" title="Select None" type="button">
#>       <span>
#>         <i aria-label="remove-circle icon" class="glyphicon glyphicon-remove-circle" role="presentation"></i>
#>       </span>
#>     </button>
#>     <button class="btn btn-default action-button pull-right list-genes" id="my_genes-select_all_button" title="Select All Genes (first 200)" type="button">
#>       <span>
#>         <i aria-label="ok-circle icon" class="glyphicon glyphicon-ok-circle" role="presentation"></i>
#>       </span>
#>     </button>
#>   </div>
#>   <div class="col-sm-2">
#>     <button class="btn btn-default action-button pull-right list-genes" id="my_genes-text_button" title="Enter list of genes" type="button">
#>       <span>
#>         <i class="fas fa-font" role="presentation" aria-label="font icon"></i>
#>       </span>
#>     </button>
#>     <div class="pull-right" title="Lock gene selection (so that it does not get updated when filtering)">
#>       <div class="form-group shiny-input-container">
#>         <div class="pretty p-toggle p-plain p-icon p-pulse">
#>           <input id="my_genes-lock_button" type="checkbox"/>
#>           <div class="state p-on">
#>             <i aria-label="lock icon" class="fas fa-lock icon" role="presentation"></i>
#>             <label>
#>               <span></span>
#>             </label>
#>           </div>
#>           <div class="state p-off">
#>             <i aria-label="lock-open icon" class="fas fa-lock-open icon" role="presentation"></i>
#>             <label>
#>               <span></span>
#>             </label>
#>           </div>
#>         </div>
#>       </div>
#>     </div>
#>   </div>
#> </div>
#> <div class="custom-select-input">
#>   <div class="form-group shiny-input-container">
#>     <label class="control-label shiny-label-null" for="my_genes-genes" id="my_genes-genes-label"></label>
#>     <div>
#>       <select class="shiny-input-select form-control" id="my_genes-genes" multiple="multiple"><option value=""></option></select>
#>       <script type="application/json" data-for="my_genes-genes" data-eval="[&quot;render&quot;]">{"placeholder":"- Nothing selected -","render":"{\n          option: function(item, escape) {\n              return '<div> <span style=\"font-size: inherit;\">' + item.label + '<\/div>' +\n                ' <span style=\"color: #808080; font-size: xx-small;\" >' + item.value + '<\/div> <\/div>'\n            }\n          }","searchField":["value","label"],"maxOptions":200,"maxItems":200,"plugins":["selectize-plugin-a11y"]}</script>
#>     </div>
#>   </div>
#> </div>
#> <div class="shiny-panel-conditional" data-display-if="input.genes &amp;&amp; input.genes.length &gt; 1" data-ns-prefix="my_genes-">
#>   <div class="form-group shiny-input-container">
#>     <label class="control-label" id="my_genes-fun_name-label" for="my_genes-fun_name">Please select function</label>
#>     <div>
#>       <select id="my_genes-fun_name" class="shiny-input-select"><option value="mean" selected>mean</option></select>
#>       <script type="application/json" data-for="my_genes-fun_name" data-nonempty="">{"plugins":["selectize-plugin-a11y"]}</script>
#>     </div>
#>   </div>
#> </div>