Mercurial > repos > iuc > seurat_plot
changeset 0:2622dd85416f draft default tip
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/seurat_v5 commit a9214c07b0cc929a51fd92a369bb89c675b6c88d
author | iuc |
---|---|
date | Wed, 11 Sep 2024 10:21:18 +0000 |
parents | |
children | |
files | macros.xml plot.xml |
diffstat | 2 files changed, 1700 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/macros.xml Wed Sep 11 10:21:18 2024 +0000 @@ -0,0 +1,437 @@ +<macros> + <token name="@TOOL_VERSION@">5.0</token> + <token name="@VERSION_SUFFIX@">0</token> + <token name="@PROFILE@">23.0</token> + <xml name="requirements"> + <requirements> + <requirement type="package" version="@TOOL_VERSION@">r-seurat</requirement> + <requirement type="package" version="1.2.1">fit-sne</requirement> + <requirement type="package" version="3.58.1">bioconductor-limma</requirement> + <requirement type="package" version="1.28.0">bioconductor-mast</requirement> + <requirement type="package" version="1.42.0">bioconductor-deseq2</requirement> + <requirement type="package" version="2.1.3">r-svglite</requirement> + <requirement type="package" version="1.1">r-metap</requirement> + <requirement type="package" version="1.14.0">bioconductor-glmGamPoi</requirement> + <requirement type="package" version="0.5.3">umap-learn</requirement> <!-- https://github.com/satijalab/seurat/issues/8283 --> + <requirement type="package" version="0.10.2">leidenalg</requirement> + <requirement type="package" version="1.2.0">r-harmony</requirement> + <requirement type="package" version="1.18.0">bioconductor-batchelor</requirement> + <requirement type="package" version="2.0.0">numpy</requirement> + <requirement type="package" version="2.2.2">pandas</requirement> + </requirements> + </xml> + <xml name="citations"> + <citations> + <citation type="doi">10.1038/s41587-023-01767-y</citation> + </citations> + </xml> + <xml name="sanitize_query" token_validinitial="string.printable"> + <sanitizer> + <valid initial="@VALIDINITIAL@"> + <remove value="'" /> + </valid> + </sanitizer> + </xml> + <xml name="sanitize_vectors" token_validinitial="string.digits"> + <sanitizer> + <valid initial="@VALIDINITIAL@"> + <add value=","/> + </valid> + </sanitizer> + </xml> + <xml name="version_command"> + <version_command><![CDATA[ +echo $(R --version | grep version | grep -v GNU)", Seurat version" $(R --vanilla --slave -e "library(Seurat); cat(sessionInfo()\$otherPkgs\$DESeq2\$Version)" 2> /dev/null | grep -v -i "WARNING: ") + ]]></version_command> + </xml> + + <token name="@CMD_imports@"><![CDATA[ +library(Seurat) + ]]> + </token> + <token name="@reticulate_hack@"><![CDATA[ +library(reticulate) +## HACK: CI biocontainers do not contain a useable conda binary, just the env. +## see: https://github.com/galaxyproject/tools-iuc/issues/5585#issuecomment-1803773923 +is_biocontainer = grepl("^# cmd: /opt/conda/bin/", + paste0(reticulate:::python_info_condaenv_find("/usr/local/"), + "-none")) +if (is_biocontainer) { + ## conda detection false positive + assignInNamespace("is_conda_python", function(x) FALSE, ns="reticulate") + use_python("/usr/local/bin/python") +} else { + conda_path = Sys.getenv("CONDA_PREFIX") + if (conda_path != "") { + ## Active conda env found + use_python(file.path(conda_path, "bin", "python3")) + } else { + ## Not biocontainer or conda, assume system python + use_python("/usr/bin/python3") + } +}]]> + </token> + <xml name="input_rds"> + <param name="seurat_rds" type="data" format="rds" label="Input file with the Seurat object"/> + </xml> + <token name="@CMD_read_inputs@"><![CDATA[ +seurat_obj = readRDS('seurat.rds') + ]]> + </token> + <token name="@CMD_read_expression_matrix@"><![CDATA[ +counts<-read.table("matrix.tab", header=TRUE, row.names=1, sep="\t") + ]]>] + </token> + <token name="@CMD@"><![CDATA[ +cp '$seurat_rds' seurat.rds && +cat '$script_file' > $hidden_output && +Rscript '$script_file' >> $hidden_output + ]]> + </token> + <xml name="inputs_common_advanced"> + <section name="advanced_common" title="Advanced Output" expanded="false"> + <param name="show_log" type="boolean" checked="false" label="Output Log?" /> + </section> + </xml> + <xml name="outputs_common_advanced"> + <data name="hidden_output" format="txt" label="Log file" > + <filter>advanced_common['show_log']</filter> + </data> + </xml> + <xml name="seurat_outputs"> + <data name="rds_out" format="rds" from_work_dir="seurat.rds" label="${tool.name} (${method.method}) on ${on_string}: RDS"> + <filter>method['method'] != 'Inspect'</filter> + </data> + <expand macro="outputs_common_advanced"/> + </xml> + <token name="@CMD_rds_write_outputs@"><![CDATA[ +saveRDS(seurat_obj, 'seurat.rds') + ]]> + </token> + <xml name="variable_out"> + <data name="variable_tabular" format="txt" from_work_dir="variable_out.txt" label="${tool.name} (${method.method}) on ${on_string}: Top variable features list"> + <filter>method['method'] == 'FindVariableFeatures' or method['method'] == 'SCTransform'</filter> + <filter>method['output_topN']['output_topN'] == 'true'</filter> + </data> + </xml> + <token name="@CMD_write_variable_tab@"><![CDATA[ +write.table(top_N, 'variable_out.txt', sep= "\t", col.names = FALSE, quote = FALSE) + ]]> + </token> + <xml name="markers_out"> + <data name="markers_tabular" format="csv" from_work_dir="markers_out.csv" label="${tool.name} (${method.method}) on ${on_string}: Markers list"> + <filter>method['method'] == 'FindAllMarkers' or method['method'] == 'FindMarkers' or method['method'] == 'FindConservedMarkers'</filter> + </data> + </xml> + <token name="@CMD_write_markers_tab@"><![CDATA[ +write.csv(seurat_obj, 'markers_out.csv', quote = FALSE) + ]]> + </token> + <xml name="print_top_pcs"> + <data name="top_pcs" format="txt" from_work_dir="print_pcs.txt" label="${tool.name} Print PCs on ${on_string}"> + <filter>method['method'] == 'RunPCA' and method['print_pcs']['print_pcs'] == 'true'</filter> + </data> + </xml> + <xml name="inspect_out"> + <data name="inspect_tabular" format="tabular" from_work_dir="inspect_out.tab" label="${tool.name} Inspect (${method.inspect.inspect}) on ${on_string}"> + <filter>method['method'] == 'Inspect' and method['inspect']['inspect'] != 'General'</filter> + </data> + <data name="inspect_general" format="txt" from_work_dir="inspect.txt" label="${tool.name} Inspect General on ${on_string}"> + <filter>method['method'] == 'Inspect' and method['inspect']['inspect'] == 'General'</filter> + </data> + </xml> + <token name="@CMD_inspect_rds_outputs@"><![CDATA[ +write.table(inspect, 'inspect_out.tab', sep="\t", col.names = col.names, row.names = row.names, quote = FALSE) + ]]> + </token> + <xml name="plot_out"> + <data name="plot_out_png" format="png" from_work_dir="plot.png" label="${tool.name} (${method.method}) on ${on_string}: png plot"> + <filter>plot_format == 'png'</filter> + </data> + <data name="plot_out_pdf" format="pdf" from_work_dir="plot.pdf" label="${tool.name} (${method.method}) on ${on_string}: pdf plot"> + <filter>plot_format == 'pdf'</filter> + </data> + <data name="plot_out_svg" format="svg" from_work_dir="plot.svg" label="${tool.name} (${method.method}) on ${on_string}: svg plot"> + <filter>plot_format == 'svg'</filter> + </data> + <data name="plot_out_jpeg" format="jpeg" from_work_dir="plot.jpeg" label="${tool.name} (${method.method}) on ${on_string}: jpeg plot"> + <filter>plot_format == 'jpeg'</filter> + </data> + <data name="plot_out_tex" format="tex" from_work_dir="plot.tex" label="${tool.name} (${method.method}) on ${on_string}: tex plot"> + <filter>plot_format == 'tex'</filter> + </data> + <data name="plot_out_tiff" format="tiff" from_work_dir="plot.tiff" label="${tool.name} (${method.method}) on ${on_string}: tiff plot"> + <filter>plot_format == 'tiff'</filter> + </data> + <data name="plot_out_eps" format="eps" from_work_dir="plot.eps" label="${tool.name} (${method.method}) on ${on_string}: eps plot"> + <filter>plot_format == 'eps'</filter> + </data> + </xml> + <xml name="param_eps" tokens="eps_value"> + <param argument="eps" type="float" value="@EPS_VALUE@" label="Small number to avoid numerical errors"/> + </xml> + <xml name="valid_name"> + <validator type="regex" message="Please only use letters, numbers, or _ - .">^[\w\-.]+$</validator> + </xml> + <xml name="valid_reduction_key"> + <validator type="regex" message="Please only use letters and _">^[A-Za-z_]+$</validator> + </xml> + <xml name="valid_list"> + <validator type="regex" message="Please only use letters, numbers, or _ - . ,">^[\w\-., ]+$</validator> + </xml> + <xml name="valid_cell_name"> + <validator type="regex" message="Please only use letters, numbers, or punctuation marks">^[\w[:punct:]]+$</validator> + </xml> + <xml name="valid_cell_list"> + <validator type="regex" message="Please only use letters, numbers, or punctuation marks">^[\w[:punct:]]+$</validator> + </xml> + <xml name="select_assay"> + <param argument="assay" type="text" optional="true" value="" label="Name of assay to use" help="leave blank to use default assay"> + <expand macro="valid_name"/> + </param> + </xml> + <xml name="select_assay_RNA"> + <param argument="assay" type="text" value="RNA" label="Name of assay to use"> + <expand macro="valid_name"/> + </param> + </xml> + <xml name="select_slot_data"> + <param argument="slot" type="select" label="Slot to pull data from"> + <option value="counts">counts</option> + <option value="data" selected="true">data</option> + <option value="scale.data">scale.data</option> + <option value="raw.data">raw.data</option> + </param> + </xml> + <xml name="select_slot_scale"> + <param argument="slot" type="select" label="Slot to pull data from"> + <option value="counts">counts</option> + <option value="data">data</option> + <option value="scale.data" selected="true">scale.data</option> + <option value="raw.data">raw.data</option> + </param> + </xml> + <xml name="select_slot_counts"> + <param argument="slot" type="select" label="Slot to pull data from"> + <option value="counts" selected="true">counts</option> + <option value="data">data</option> + <option value="scale.data">scale.data</option> + <option value="raw.data">raw.data</option> + </param> + </xml> + <xml name="select_layer"> + <param argument="layer" type="text" optional="true" value="" label="Layer to pull data from" help="leave blank to use default"> + <expand macro="valid_name"/> + </param> + </xml> + <xml name="select_reduction_pca"> + <param argument="reduction" type="text" value="pca" label="Name of reduction to use" help="default is pca"> + <expand macro="valid_name"/> + </param> + </xml> + <xml name="select_reduction_umap"> + <param argument="reduction" type="text" value="umap" label="Name of reduction to use" help="first defaults to umap, then tsne, then pca"> + <expand macro="valid_name"/> + </param> + </xml> + <xml name="set_topN"> + <param name="topN" type="integer" value="10" label="Number to show"/> + </xml> + <xml name="set_dims"> + <param argument="dims" type="integer" optional="true" value="10" label="Number of dimensions from reduction to use as input"/> + </xml> + <xml name="normalize"> + <conditional name="normalization_method"> + <param name="normalization_method" type="select" label="Method for normalization" help="(normalization.method)"> + <option value="LogNormalize" selected="true">LogNormalize</option> + <option value="CLR">CLR</option> + <option value="RC">RC</option> + </param> + <when value="LogNormalize"></when> + <when value="CLR"> + <param argument="margin" type="select" checked="true" label="Normalize across features (1) or cells (2)"> + <option value="1" selected="true">features</option> + <option value="2">cells</option> + </param> + </when> + <when value="RC"></when> + </conditional> + <param name="scale_factor" type="integer" value="10000" label="Set scale factor for normalization" help="(scale.factor)"/> + <param name="block_size" type="integer" optional="true" value="" label="Number of cells to run in each block" help="(block.size)"/> + </xml> + <xml name="integration_inputs"> + <param argument="dims" type="integer" value="30" label="Number of dimensions from reduction to use for integration"/> + <param name="dims_to_integrate" type="integer" optional="true" value="" label="Number of dimensions to return integrated values for" help="(dims.to.integrate)"/> + <param name="k_weight" type="integer" value="100" label="Number of neighbors to consider when weighting anchors" help="(k.weight)"/> + <param name="weight_reduction" type="text" optional="true" value="" label="Name of reduction(s) to use for calculating anchor weights" help="leave blank to use full corrected space (weight.reduction)"> + <expand macro="valid_list"/> + </param> + <param name="sd_weight" type="float" value="1" label="Controls bandwidth of Gaussian kernel for weighting"/> + <param name="preserve_order" type="boolean" truevalue="TRUE" falsevalue="FALSE" checked="false" label="Preserve order" help="do not reorder objects based on size for each pairwise integration (preserve.order)"/> + </xml> + <xml name="markers_inputs"> + <param argument="features" type="data" format="txt,tabular" optional="true" value="" label="Features to test" help="text file with one feature on each line, leave empty to use all genes"/> + <param name="logfc_threshold" type="float" value="0.1" label="Minimum log-fold difference to test" help="(logfc.threshold)"/> + <conditional name="test_use"> + <param name="test_use" type="select" label="Select test to run" help="(test.use)"> + <option value="wilcox" selected="true">wilcox</option> + <option value="wilcox_limma">wilcox_limma</option> + <option value="bimod">bimod</option> + <option value="roc">roc</option> + <option value="t">t</option> + <option value="negbinom">negbinom</option> + <option value="poisson">poisson</option> + <option value="LR">LR</option> + <option value="MAST">MAST</option> + <option value="DESeq2">DESeq2</option> + </param> + <when value="wilcox"> + <expand macro="select_slot_data"/> + </when> + <when value="wilcox_limma"> + <expand macro="select_slot_data"/> + </when> + <when value="bimod"> + <expand macro="select_slot_data"/> + </when> + <when value="roc"> + <expand macro="select_slot_data"/> + <param name="return_thresh" type="float" value="0.01" min="0.0" max="1.0" label="Only return markers with a p-value below or power above this threshold" help="(return.thresh)"/> + </when> + <when value="t"> + <expand macro="select_slot_data"/> + </when> + <when value="negbinom"> + <expand macro="select_slot_counts"/> + <param name="latent_vars" type="text" optional="true" value="" label="Select variables to test" help="(latent.vars)"/> + <param name="min_cells_feature" type="integer" value="3" label="Minimum number of cells expressing the feature in at least one cluster" help="(min.cells.feature)"/> + </when> + <when value="poisson"> + <expand macro="select_slot_counts"/> + <param name="latent_vars" type="text" optional="true" value="" label="Select variables to test" help="(latent.vars)"/> + <param name="min_cells_feature" type="integer" value="3" label="Minimum number of cells expressing the feature in at least one cluster" help="(min.cells.feature)"/> + </when> + <when value="LR"> + <expand macro="select_slot_data"/> + <param name="latent_vars" type="text" optional="true" value="" label="Select variables to test" help="(latent.vars)"/> + </when> + <when value="MAST"> + <expand macro="select_slot_data"/> + <param name="latent_vars" type="text" optional="true" value="" label="Select variables to test" help="(latent.vars)"/> + </when> + <when value="DESeq2"> + <expand macro="select_slot_counts"/> + </when> + </conditional> + </xml> + <xml name="advanced_markers_inputs"> + <expand macro="select_assay"/> + <param name="fc_name" type="text" optional="true" value="" label="Choose a name for the fold change, average difference, or custom function column" help="(fc.name)"> + <expand macro="valid_name"/> + </param> + <param name="min_pct" type="float" value="0.01" min="0" max="100" label="Minimum percentage of cells genes must be present in to be tested" help="(min.pct)"/> + <param name="min_diff_pct" type="float" optional="true" value="" label="Minimum difference in percentage of expression between groups for genes to be tested" help="defaults to -Inf (min.diff.pct)"/> + <param name="only_pos" type="boolean" truevalue="TRUE" falsevalue="FALSE" checked="false" label="Only return positive markers" help="(only.pos)"/> + <param name="max_cells_per_ident" type="integer" optional="true" value="" label="Downsample each identity class to a max number of cells" help="defaults to Inf for no downsampling (max.cells.per.ident)"/> + <param name="random_seed" type="integer" optional = "true" value="1" label="Set a random seed for downsampling" help="(random.seed)"/> + <param name="min_cells_group" type="integer" value="3" label="Minimum number of cells in one group" help="(min.cells.group)"/> + <param argument="densify" type="boolean" truevalue="TRUE" falsevalue="FALSE" checked="false" label="Convert to dense matrix before running DE test"/> + </xml> + <xml name="plot_types"> + <param name="plot_format" type="select" label="Format of plot to produce"> + <option value="png">png</option> + <option value="pdf">pdf</option> + <option value="svg">svg</option> + <option value="jpeg">jpeg</option> + <option value="tex">tex</option> + <option value="tiff">tiff</option> + <option value="eps">eps</option> + </param> + </xml> + <xml name="plot_sizes"> + <conditional name="resize"> + <param name="resize" type="select" label="Change size of plot"> + <option value="false" selected="true">No</option> + <option value="true">Yes</option> + </param> + <when value="false"></when> + <when value="true"> + <param argument="width" type="integer" value="2100" label="Width of plot in pixels"/> + <param argument="height" type="integer" value="2100" label="Height of plot in pixels"/> + </when> + </conditional> + </xml> + <xml name="plot_cols"> + <param argument="cols" type="text" optional="true" value="" label="Colours to use for plotting" help="comma separated list"> + <expand macro="valid_list"/> + </param> + </xml> + <xml name="plot_log_scale"> + <param argument="log" type="boolean" truevalue="TRUE" falsevalue="FALSE" checked="false" label="Plot on a log scale"/> + </xml> + <xml name="plot_2_dims"> + <param name="dims_1" type="integer" value="1" label="Dimension to plot on x axis"/> + <param name="dims_2" type="integer" value="2" label="Dimension to plot on y axis"/> + </xml> + <xml name="plot_projected_and_balanced"> + <param argument="projected" type="boolean" truevalue="TRUE" falsevalue="FALSE" checked="false" label="Use reduction values for full dataset" help="i.e. projected dimensional reduction values"/> + <param argument="balanced" type="boolean" truevalue="TRUE" falsevalue="FALSE" checked="false" label="Return an equal number of genes with + and - scores"/> + </xml> + <xml name="plot_disp_min_max"> + <param name="disp_min" type="float" optional="true" value="-2.5" label="Minimum display value" help="all values below are clipped (disp.min)"/> + <param name="disp_max" type="float" optional="true" value="" label="Maximum display value" help="all values above are clipped. Defaults to 2.5 if slot is scale.data, otherwise defaults to 6 (disp.max)"/> + </xml> + <xml name="plot_shuffle_and_seed"> + <conditional name="shuffle"> + <param argument="shuffle" type="select" label="Randomly shuffle order of points" help="can help with crowded plots if points of interest are hidden"> + <option value="TRUE">Yes</option> + <option value="FALSE" selected="true">No</option> + </param> + <when value="TRUE"> + <param argument="seed" type="integer" value="1" label="Set random seed for shuffling"/> + </when> + <when value="FALSE"></when> + </conditional> + </xml> + <xml name="plot_order"> + <param argument="order" type="text" optional="true" value="" label="Specify the order of plotting for the idents" help="a full comma-separated list or the ident to be plotted last on the top"> + <expand macro="valid_list"/> + </param> + </xml> + <xml name="plot_group_by"> + <param name="group_by" type="text" optional="true" value="" label="Factor to group cells by" help="(group.by)"/> + </xml> + <xml name="plot_split_by"> + <param name="split_by" type="text" optional="true" value="" label="Factor or identity to split the plot by" help="(split.by)"/> + </xml> + <xml name="plot_alpha"> + <param argument="alpha" type="integer" value="1" label="Alpha value for points"/> + </xml> + <xml name="plot_pt_size"> + <param name="pt_size" type="float" optional="true" value="" label="Point size for plot" help="(pt.size)"/> + </xml> + <xml name="plot_smooth"> + <param argument="smooth" type="boolean" truevalue="TRUE" falsevalue="FALSE" checked="false" label="Smooth the graph"/> + </xml> + <xml name="plot_ncol"> + <param argument="ncol" type="integer" optional="true" value="" label="Number of columns to display"/> + </xml> + <xml name="raster_select"> + <conditional name="raster"> + <param argument="raster" type="select" label="Convert points to raster format" help="NULL will automatically use raster if more than 100,000 points plotted"> + <option value="NULL" selected="true">NULL</option> + <option value="TRUE">TRUE</option> + <option value="FALSE">FALSE</option> + </param> + <when value="NULL"></when> + <when value="TRUE"> + <param name="raster_x" type="integer" value="512" label="Horizontal length of raster plot (pixels)"/> + <param name="raster_y" type="integer" value="512" label="Vertical height of raster plot (pixels)"/> + </when> + <when value="FALSE"></when> + </conditional> + </xml> + <xml name="raster_boolean"> + <param argument="raster" type="boolean" truevalue="TRUE" falsevalue="FALSE" checked="true" label="Convert to raster format"/> + </xml> +</macros>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plot.xml Wed Sep 11 10:21:18 2024 +0000 @@ -0,0 +1,1263 @@ +<tool id="seurat_plot" name="Seurat Visualize" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@"> + <description>- Plot cells, features and dimensions</description> + <macros> + <import>macros.xml</import> + </macros> + <expand macro="requirements"/> + <expand macro="version_command"/> + <command detect_errors="exit_code"><![CDATA[ +@CMD@ + ]]></command> + <configfiles> + <configfile name="script_file"><![CDATA[ +@CMD_imports@ +@CMD_read_inputs@ +library(ggplot2) + +#if $method.method == 'VlnPlot' + +plot<-VlnPlot( + seurat_obj, + features = c(unlist(strsplit(gsub(" ", "", '$method.features'), ","))), + #if $method.idents != '' + idents = '$method.idents', + #end if + sort = $method.sort, + #if $method.adv.assay != '' + assay = '$method.adv.assay', + #end if + #if $method.adv.layer != '' + layer = '$method.adv.layer', + #end if + #if $method.plot.cols != '' + cols = c(unlist(strsplit(gsub(" ", "", '$method.plot.cols'), ","))), + #end if + #if $method.plot.pt_size + pt.size = $method.plot.pt_size, + #end if + alpha = $method.plot.alpha, + #if $method.adv.group_by != '' + group.by = '$method.adv.group_by', + #end if + #if $method.adv.split_by != '' + split.by = '$method.adv.split_by', + #end if + adjust = $method.plot.adjust, + #if $method.plot.y_max + y.max = $method.plot.y_max, + #end if + same.y.lims = $method.plot.same_y_lims, + log = $method.plot.log, + #if $method.plot.ncol != '' + ncol = $method.plot.ncol, + #end if + split.plot = $method.adv.split_plot, + stack = $method.adv.stack, + fill.by = '$method.plot.fill_by', + flip = $method.plot.flip, + add.noise = $method.plot.add_noise, + combine = TRUE +) + +#else if $method.method == 'FeatureScatter' + + #if $method.adv.cells + cells_list<-paste(readLines('$method.adv.cells'), collapse=",") + #end if + +plot<-FeatureScatter( + seurat_obj, + feature1 = '$method.feature1', + feature2 = '$method.feature2', + #if $method.adv.cells + cells = c(unlist(strsplit(cells_list, ","))), + #end if + shuffle = $method.plot.shuffle.shuffle, + #if $method.plot.shuffle.shuffle == 'TRUE' + seed = $method.plot.shuffle.seed, + #end if + #if $method.adv.group_by != '' + group.by = '$method.adv.group_by', + #end if + #if $method.adv.split_by != '' + split.by = '$method.adv.split_by', + #end if + #if $method.plot.cols != '' + cols = c(unlist(strsplit(gsub(" ", "", '$method.plot.cols'), ","))), + #end if + #if $method.plot.pt_size + pt.size = $method.plot.pt_size, + #end if + #if $method.adv.span != '' + span = '$method.adv.span', + #end if + smooth = $method.plot.smooth, + slot = '$method.adv.slot', + plot.cor = $method.plot.plot_cor, + log = $method.plot.log, + #if $method.plot.ncol + ncol = $method.plot.ncol, + #end if + raster = $method.plot.raster.raster, + #if $method.plot.raster.raster == 'TRUE' + raster.dpi = c($method.plot.raster.raster_x, $method.plot.raster.raster_y), + #end if + jitter = $method.plot.jitter, + combine = TRUE +) + +#else if $method.method == 'CellScatter' + + #if $method.features + features_list<-paste(readLines('$method.features'), collapse=",") + #end if + +plot<-CellScatter( + seurat_obj, + cell1 = '$method.cell1', + cell2 = '$method.cell2', + #if $method.features + features = c(unlist(strsplit(features_list, ","))), + #end if + #if $method.highlight != '' + highlight = c(unlist(strsplit(gsub(" ", "", '$method.highlight'), ","))), + #end if + #if $method.plot.cols != '' + cols = c(unlist(strsplit(gsub(" ", "", '$method.plot.cols'), ","))), + #end if + #if $method.plot.pt_size + pt.size = $method.plot.pt_size, + #end if + smooth = $method.plot.smooth, + raster = $method.plot.raster.raster, + #if $method.plot.raster.raster == 'TRUE' + raster.dpi = c($method.plot.raster.raster_x, $method.plot.raster.raster_y), + #end if +) + + #if $method.label_points == 'true' + plot<-LabelPoints( + plot, + points = c(unlist(strsplit(gsub(" ", "", '$method.highlight'), ","))), + repeal = TRUE + ) + #end if + +#else if $method.method == 'VariableFeaturePlot' + +plot<-VariableFeaturePlot( + seurat_obj, + #if $method.assay != '' + assay = '$method.assay', + #end if + cols = c('$method.plot.cols_1', '$method.plot.cols_2'), + #if $method.plot.pt_size + pt.size = $method.plot.pt_size, + #end if + raster = $method.plot.raster.raster, + #if $method.plot.raster.raster == 'TRUE' + raster.dpi = c($method.plot.raster.raster_x, $method.plot.raster.raster_y), + #end if + log =$method.plot.log +) + + #if $method.label_topN.label_topN == 'true' + N = $method.label_topN.topN + top_N<-head(VariableFeatures(seurat_obj), N) + plot<-LabelPoints(plot, + points = top_N, + repel = TRUE) + #end if + +#else if $method.method == 'VizDimLoadings' +plot<-VizDimLoadings( + seurat_obj, + dims = 1:$method.dims, + nfeatures = $method.nfeatures, + reduction = '$method.reduction', + col = '$method.plot.col', + projected = $method.projected, + balanced = $method.balanced, + #if $method.plot.ncol + ncol = $method.plot.ncol, + #end if + combine = TRUE +) + +#else if $method.method == 'DimPlot' + + #if $method.adv.cells + cells_list<-paste(readLines('$method.adv.cells'), collapse=",") + #end if + +plot<-DimPlot( + seurat_obj, + dims = c($method.dims_1, $method.dims_2), + #if $method.adv.cells + cells = c(unlist(strsplit(cells_list, ","))), + #end if + #if $method.reduction != '' + reduction = '$method.reduction', + #end if + #if $method.plot.cols != '' + cols = c(unlist(strsplit(gsub(" ", "", '$method.plot.cols'), ","))), + #end if + #if $method.plot.pt_size + pt.size = $method.plot.pt_size, + #end if + #if $method.adv.group_by != '' + group.by = '$method.adv.group_by', + #end if + #if $method.adv.split_by != '' + split.by = '$method.adv.split_by', + #end if + #if $method.adv.shape_by != '' + shape.by = '$method.adv.shape_by', + #end if + #if $method.plot.order != '' + order = c(unlist(strsplit(gsub(" ", "", '$method.plot.order'), ","))), + #end if + shuffle = $method.plot.shuffle.shuffle, + #if $method.plot.shuffle.shuffle == 'TRUE' + seed = $method.plot.shuffle.seed, + #end if + label = $method.plot.label.label, + #if $method.plot.label.label =='TRUE' + label.size = $method.plot.label.label_size, + label.color = '$method.plot.label.label_color', + label.box = $method.plot.label.label_box, + repel = $method.plot.label.repel, + #end if + alpha = $method.plot.alpha, + #if $method.plot.highlight.highlight == 'true' + cells.highlight = c(unlist(strsplit(gsub(" ", "", '$method.plot.highlight.cells_highlight'), ","))), + cols.highlight = '$method.plot.highlight.cols_highlight', + sizes.highlight = $method.plot.highlight.sizes_highlight, + #end if + na.value = '$method.plot.na_value', + #if $method.plot.ncol + ncol = $method.plot.ncol, + #end if + raster = $method.plot.raster.raster, + #if $method.plot.raster.raster == 'TRUE' + raster.dpi = c($method.plot.raster.raster_x, $method.plot.raster.raster_y), + #end if + combine = TRUE +) + +#else if $method.method == 'DimHeatmap' +plot<-DimHeatmap( + seurat_obj, + dims = $method.dims, + nfeatures = $method.nfeatures, + reduction = '$method.reduction', + #if $method.adv.cells != '' + cells = $method.adv.cells, + #end if + #if $method.plot.disp_min + disp.min = $method.plot.disp_min, + #end if + #if $method.plot.disp_max + disp.max = $method.plot.disp_max, + #end if + projected = $method.adv.projected, + balanced = $method.adv.balanced, + #if $method.plot.ncol + ncol = $method.plot.ncol, + #end if + fast = FALSE, + raster = $method.plot.raster, + slot = '$method.adv.slot', + #if $method.adv.assays != '' + assays = c(unlist(strsplit(gsub(" ", "", '$method.adv.assays'), ","))), + #end if + combine = TRUE +) + +#else if $method.method == 'ElbowPlot' +plot<-ElbowPlot( + seurat_obj, + ndims = $method.ndims, + reduction = '$method.reduction' +) + +#else if $method.method == 'FeaturePlot' + + #if $method.adv.cells + cells_list<-paste(readLines('$method.adv.cells'), collapse=",") + #end if + +plot<-FeaturePlot( + seurat_obj, + features = c(unlist(strsplit(gsub(" ", "", '$method.features'), ","))), + dims = c('$method.dims_1', '$method.dims_2'), + #if $method.reduction != '' + reduction = '$method.reduction', + #end if + #if $method.adv.cells + cells = c(unlist(strsplit(cells_list, ","))), + #end if + blend = $method.plot.blend.blend, + #if $method.plot.blend.blend == 'TRUE' + cols = c('$method.plot.blend.cols_1', '$method.plot.cols_2', '$method.plot.cols_3'), + blend.threshold = $method.plot.blend.blend_threshold, + #else + cols = c('$method.plot.cols_2', '$method.plot.cols_3'), + #end if + #if $method.plot.pt_size + pt.size = $method.plot.pt_size, + #end if + alpha = $method.plot.alpha, + order = $method.plot.order, + min.cutoff = 'q$method.adv.min_cutoff', + max.cutoff = 'q$method.adv.max_cutoff', + #if $method.adv.split_by != '' + split.by = '$method.adv.split_by', + by.col = $method.plot.blend.by_col, + #end if + keep.scale = '$method.plot.keep_scale', + #if $method.adv.shape_by != '' + shape.by = '$method.adv.shape_by', + #end if + slot = '$method.adv.slot', + label = $method.plot.label.label, + #if $method.plot.label.label =='TRUE' + label.size = $method.plot.label.label_size, + label.color = '$method.plot.label.label_color', + repel = $method.plot.label.repel, + #end if + #if $method.plot.ncol + ncol = $method.plot.ncol, + #end if + coord.fixed = $method.plot.coord_fixed, + raster = $method.plot.raster.raster, + #if $method.plot.raster.raster == 'TRUE' + raster.dpi = c($method.plot.raster.raster_x, $method.plot.raster.raster_y), + #end if + combine = TRUE +) + +#else if $method.method == 'DoHeatmap' + + #if $method.features + features_list<-paste(readLines('$method.features'), collapse=",") + #end if + #if $method.cells + cells_list<-paste(readLines('$method.cells'), collapse=",") + #end if + +plot<-DoHeatmap( + seurat_obj, + #if $method.features + features = c(unlist(strsplit(features_list, ","))), + #end if + #if $method.cells + cells = c(unlist(strsplit(cells_list, ","))), + #end if + #if $method.adv.group_by != '' + group.by = '$method.adv.group_by', + #end if + group.bar = $method.plot.group_bar, + #if $method.plot.group_colors != '' + group.colors = c(unlist(strsplit(gsub(" ", "", '$method.plot.group_colors'), ","))), + #end if + #if $method.plot.disp_min + disp.min = $method.plot.disp_min, + #end if + #if $method.plot.disp_max + disp.max = $method.plot.disp_max, + #end if + slot = '$method.adv.slot', + #if $method.adv.assay != '' + assay = '$method.adv.assay', + #end if + label = $method.plot.label, + size = $method.plot.size, + hjust = $method.plot.hjust, + vjust = $method.plot.vjust, + angle = $method.plot.angle, + raster = $method.plot.raster, + draw.lines = $method.plot.draw_lines, + #if $method.plot.lines_width + lines.width = $method.plot.lines_width, + #end if + group.bar.height = $method.plot.group_bar_height, + combine = TRUE +) + +#else if $method.method == 'DotPlot' +plot<-DotPlot( + seurat_obj, + features = c(unlist(strsplit(gsub(" ", "", '$method.features'), ","))), + #if $method.plot.cols.cols == 'two' + cols = c('$method.plot.cols.cols_1', '$method.plot.cols.cols_2'), + #else if $method.plot.cols.cols == 'more' + cols = c(unlist(strsplit(gsub(" ", "", '$method.plot.cols.cols_more'), ","))), + #end if + col.min = $method.plot.col_min, + col.max = $method.plot.col_max, + dot.min = $method.plot.dot_min, + dot.scale = $method.plot.dot_scale, + cluster.idents = $method.plot.cluster_idents, + scale = $method.plot.scale.scale, + #if $method.plot.scale.scale == 'TRUE' + scale.by = '$method.plot.scale.scale_by', + #if $method.plot.scale.scale_min != '' + scale.min = $method.plot.scale.scale_min, + #end if + #if $method.plot.scale.scale_max != '' + scale.max = $method.plot.scale.scale_max + #end if + #end if + #if $method.adv.assay != '' + assay = '$method.adv.assay', + #end if + #if $method.adv.group_by != '' + group.by = '$method.adv.group_by', + #end if + #if $method.adv.split_by != '' + split.by = '$method.adv.split_by' + #end if +) + +#end if + +#if $plot_format == 'png' +ggsave('plot.png', + #if $resize.resize == 'true' + width = $resize.width, + height = $resize.height, + units = 'px', + #end if + bg = 'white' +) +#else if $plot_format == 'pdf' +ggsave('plot.pdf', + #if $resize.resize == 'true' + width = $resize.width, + height = $resize.height, + units = 'px', + #end if + bg = 'white' +) +#else if $plot_format == 'svg' +ggsave('plot.svg', + #if $resize.resize == 'true' + width = $resize.width, + height = $resize.height, + units = 'px', + #end if + bg = 'white' +) +#else if $plot_format == 'jpeg' +ggsave('plot.jpeg', + #if $resize.resize == 'true' + width = $resize.width, + height = $resize.height, + units = 'px', + #end if + bg = 'white' +) +#else if $plot_format == 'tex' +ggsave('plot.tex', + #if $resize.resize == 'true' + width = $resize.width, + height = $resize.height, + units = 'px', + #end if + bg = 'white' +) +#else if $plot_format == 'tiff' +ggsave('plot.tiff', + #if $resize.resize == 'true' + width = $resize.width, + height = $resize.height, + units = 'px', + #end if + bg = 'white' +) +#else if $plot_format == 'eps' +ggsave('plot.eps', + #if $resize.resize == 'true' + width = $resize.width, + height = $resize.height, + units = 'px', + #end if + bg = 'white' +) +#end if + +]]></configfile> + </configfiles> + <inputs> + <expand macro="input_rds"/> + <expand macro="plot_types"/> + <conditional name="method"> + <param name="method" type="select" label="Method used"> + <option value="VlnPlot">Violin Plot with 'VlnPlot'</option> + <option value="FeatureScatter">Scatter Plot with 'FeatureScatter'</option> + <option value="CellScatter">Scatter Plot with 'CellScatter'</option> + <option value="VariableFeaturePlot">Plot Variable Genes with 'VariableFeaturePlot'</option> + <option value="VizDimLoadings">Visualize Reduction Results with 'VizDimLoadings'</option> + <option value="DimPlot">Visualize Dimensional Reduction with 'DimPlot'</option> + <option value="DimHeatmap">Visualize Reduction Results with 'DimHeatmap'</option> + <option value="ElbowPlot">Determine dimensionality with 'ElbowPlot'</option> + <option value="FeaturePlot">Visualize expression with 'FeaturePlot'</option> + <option value="DoHeatmap">Visualize expression with 'DoHeatmap'</option> + <option value="DotPlot">Visualize expression with 'DotPlot'</option> + </param> + <when value="VlnPlot"> + <param argument="features" type="text" value="nFeature_RNA" label="Features to plot" help="as variables on y-axis, comma-separated list e.g. nCount_RNA, percent.mt"> + <expand macro="valid_list"/> + </param> + <param argument="idents" type="text" optional="true" value="" label="Ident classes to display on plot" help="as category on x-axis, defauts to all"> + <expand macro="valid_name"/> + </param> + <param argument="sort" type="boolean" truevalue="TRUE" falsevalue="FALSE" checked="false" label="Sort identity classes by average expression"/> + <section name="plot" title="Plot Formatting Options"> + <expand macro="plot_ncol"/> + <expand macro="plot_cols"/> + <expand macro="plot_pt_size"/> + <expand macro="plot_alpha"/> + <param argument="adjust" type="integer" value="1" label="Adjust parameter for geom_violin"/> + <param name="y_max" type="float" optional="true" value="" label="Maximum y axis value" help="(y.max)"/> + <param name="same_y_lims" type="boolean" truevalue="TRUE" falsevalue="FALSE" checked="false" label="Set all y-axis limits to same value" help="when plotting multiple features (same.y.lims)"/> + <expand macro="plot_log_scale"/> + <param name="fill_by" type="select" label="Colour violins by feature or ident" help="(fill.by)"> + <option value="feature" selected="true">feature</option> + <option value="ident">ident</option> + </param> + <param argument="flip" type="boolean" truevalue="TRUE" falsevalue="FALSE" checked="false" label="Flip plot orientation" help="puts identities on y-axis"/> + <param name="add_noise" type="boolean" truevalue="TRUE" falsevalue="FALSE" checked="true" label="Add a small noise for plotting" help="(add.noise)"/> + </section> + <section name="adv" title="Advanced Options"> + <expand macro="select_assay"/> + <expand macro="select_layer"/> + <expand macro="plot_group_by"/> + <expand macro="plot_split_by"/> + <param name="split_plot" type="boolean" truevalue="TRUE" falsevalue="FALSE" checked="false" label="Plot each group of a split plot as multiple violin shapes" help="(split.plot)"/> + <param argument="stack" type="boolean" truevalue="TRUE" falsevalue="FALSE" checked="false" label="Horizontally stack plots for each feature"/> + </section> + </when> + <when value="FeatureScatter"> + <param argument="feature1" type="text" value="nCount_RNA" label="First feature to plot" help="on x-axis"> + <expand macro="valid_name"/> + </param> + <param argument="feature2" type="text" value="nFeature_RNA" label="Second feature to plot" help="on y-axis"> + <expand macro="valid_name"/> + </param> + <section name="plot" title="Plot Formatting Options"> + <expand macro="plot_cols"/> + <expand macro="plot_pt_size"/> + <expand macro="plot_shuffle_and_seed"/> + <expand macro="plot_smooth"/> + <param name="plot_cor" type="boolean" truevalue="TRUE" falsevalue="FALSE" checked="true" label="Display correlation in plot title" help="(plot.cor)"/> + <expand macro="plot_ncol"/> + <expand macro="raster_select"/> + <expand macro="plot_log_scale"/> + <param argument="jitter" type="boolean" truevalue="TRUE" falsevalue="FALSE" checked="false" label="Jitter for easier visualization of crowded points"/> + </section> + <section name="adv" title="Advanced Options"> + <param argument="cells" type="data" format="txt,tabular" optional="true" label="List of cells to include on plot" help="text file with one cell on each line"/> + <expand macro="select_slot_data"/> + <expand macro="plot_group_by"/> + <expand macro="plot_split_by"/> + <param argument="span" type="boolean" truevalue="TRUE" falsevalue="NULL" checked="false" label="Spline span in loess function call"/> + </section> + </when> + <when value="CellScatter"> + <param argument="cell1" type="text" value="cell 1" label="First cell to plot" help="on x-axis"> + <expand macro="valid_cell_name"/> + </param> + <param argument="cell2" type="text" value="cell 2" label="Second cell to plot" help="on y-axis"> + <expand macro="valid_cell_name"/> + </param> + <param argument="features" type="data" format="txt,tabular" optional="true" label="List of features to plot" help="text file with one feature on each line, default is all features"/> + <param argument="highlight" type="text" optional="true" value="" label="Features to highlight"> + <expand macro="valid_list"/> + </param> + <param name="label_points" type="boolean" truevalue="true" falsevalue="false" checked="false" label="Label highlighted features"/> + <section name="plot" title="Plot Formatting Options"> + <expand macro="plot_cols"/> + <expand macro="plot_pt_size"/> + <expand macro="plot_smooth"/> + <expand macro="raster_select"/> + </section> + </when> + <when value="VariableFeaturePlot"> + <expand macro="select_assay"/> + <conditional name="label_topN"> + <param name="label_topN" type="select" label="Label the top most variable features"> + <option value="true">Yes</option> + <option value="false" selected="true">No</option> + </param> + <when value="true"> + <expand macro="set_topN"/> + </when> + <when value="false"> + </when> + </conditional> + <section name="plot" title="Plot Formatting Options"> + <param name="cols_1" type="select" label="Colour for non-variable genes"> + <option value="black" selected="true">black</option> + <option value="grey">grey</option> + </param> + <param name="cols_2" type="select" label="Colour for variable genes"> + <option value="red" selected="true">red</option> + <option value="blue">blue</option> + <option value="green">green</option> + <option value="orange">orange</option> + <option value="magenta">magenta</option> + <option value="purple">purple</option> + <option value="black">black</option> + </param> + <expand macro="plot_pt_size"/> + <param argument="log" type="boolean" truevalue="TRUE" falsevalue="NULL" checked="false" label="Plot the x-axis in log scale"/> + <expand macro="raster_select"/> + </section> + </when> + <when value="VizDimLoadings"> + <param argument="dims" type="integer" value="10" label="Number of dimensions to display"/> + <param argument="nfeatures" type="integer" value="30" label="Number of genes to display"/> + <expand macro="select_reduction_pca"/> + <expand macro="plot_projected_and_balanced"/> + <section name="plot" title="Plot Formatting Options"> + <param argument="col" type="select" label="Colour to use for points"> + <option value="blue" selected="true">blue</option> + <option value="red">red</option> + <option value="green">green</option> + <option value="orange">orange</option> + <option value="magenta">magenta</option> + <option value="purple">purple</option> + <option value="grey">grey</option> + <option value="black">black</option> + </param> + <expand macro="plot_ncol"/> + </section> + </when> + <when value="DimPlot"> + <expand macro="plot_2_dims"/> + <expand macro="select_reduction_umap"/> + <section name="plot" title="Plot Formatting Options"> + <expand macro="plot_cols"/> + <expand macro="plot_pt_size"/> + <expand macro="plot_order"/> + <expand macro="plot_shuffle_and_seed"/> + <expand macro="plot_alpha"/> + <expand macro="plot_ncol"/> + <expand macro="raster_select"/> + <conditional name="label"> + <param argument="label" type="select" label="Add labels to the clusters"> + <option value="TRUE">Yes</option> + <option value="FALSE" selected="true">No</option> + </param> + <when value="TRUE"> + <param name="label_size" type="integer" value="4" label="Set size of labels" help="(label.size)"/> + <param name="label_color" type="select" label="Set colour of label text" help="(label.color)"> + <option value="black" selected="true">black</option> + <option value="grey">grey</option> + </param> + <param name="label_box" type="boolean" truevalue="TRUE" falsevalue="FALSE" checked="false" label="Put a box around each label" help="(label.box)"/> + <param argument="repel" type="boolean" truevalue="TRUE" falsevalue="FALSE" checked="false" label="Repel labels"/> + </when> + <when value="FALSE"> + </when> + </conditional> + <conditional name="highlight"> + <param name="highlight" type="select" label="Highlight group(s) of cells"> + <option value="true">Yes</option> + <option value="false" selected="true">No</option> + </param> + <when value="true"> + <param name="cells_highlight" type="text" value="" label="List of cells to highlight" help="comma-separated list of e.g. barcodes, clusters, groups (cells.highlight)"> + <expand macro="valid_cell_list"/> + </param> + <param name="cols_highlight" type="select" label="Colour for highlighted cells" help="other cells will be black (cols.highlight)"> + <option value="blue" selected="true">blue</option> + <option value="red">red</option> + <option value="green">green</option> + <option value="orange">orange</option> + <option value="magenta">magenta</option> + <option value="purple">purple</option> + <option value="grey">grey</option> + </param> + <param name="sizes_highlight" type="integer" value="1" label="Size of highlighted cells" help="(sizes.highlight)"/> + </when> + <when value="false"> + </when> + </conditional> + <param name="na_value" type="select" label="Colour for NA points when using custom scale" help="(na.value)"> + <option value="lightgrey" selected="true">lightgrey</option> + <option value="grey">grey</option> + <option value="black">black</option> + </param> + </section> + <section name="adv" title="Advanced Options"> + <param argument="cells" type="data" format="txt,tabular" optional="true" label="List of cells to include on plot" help="text file with one cell on each line"/> + <expand macro="plot_group_by"/> + <expand macro="plot_split_by"/> + <param name="shape_by" type="text" optional="true" value="" label="Shape points by a group or identity" help="only when not saving as raster (shape.by)"/> + </section> + </when> + <when value="DimHeatmap"> + <param argument="dims" type="text" value="1:10" label="Dimensions from reduction to plot" help="enter one or a range of dimensions e.g. 3 to plot dim 3, 1:10 to plot dims 1 to 10"> + <validator type="regex" message="Please only use numbers or colon">^[\d:]+$</validator> + </param> + <param argument="nfeatures" type="integer" value="30" label="Number of genes to plot"/> + <expand macro="select_reduction_pca"/> + <section name="plot" title="Plot Formatting Options"> + <expand macro="plot_disp_min_max"/> + <expand macro="plot_ncol"/> + <expand macro="raster_boolean"/> + </section> + <section name="adv" title="Advanced Options"> + <param argument="cells" type="integer" optional="true" value="" label="Number of top cells to plot"/> + <expand macro="select_slot_scale"/> + <param argument="assays" type="text" optional="true" value="" label="Vector of assays to pull data from"> + <expand macro="valid_list"/> + </param> + <expand macro="plot_projected_and_balanced"/> + </section> + </when> + <when value="ElbowPlot"> + <param argument="ndims" type="integer" value="30" label="Number of dimensions to plot standard deviation for"/> + <expand macro="select_reduction_pca"/> + </when> + <when value="FeaturePlot"> + <param argument="features" type="text" value="" label="Features to plot" help="e.g. gene, percent.mito, PC_1"> + <expand macro="valid_list"/> + </param> + <expand macro="plot_2_dims"/> + <expand macro="select_reduction_umap"/> + <section name="plot" title="Plot Formatting Options"> + <param name="keep_scale" type="select" label="How to handle colour scale across multiple plots" help="(keep.scale)"> + <option value="feature" selected="true">Scale each feature separately</option> + <option value="all">Scale all to same maximum</option> + </param> + <conditional name="blend"> + <param argument="blend" type="select" label="Scale and blend expression values to visualize coexpression" help="of two features entered as features to plot"> + <option value="TRUE">Yes</option> + <option value="FALSE" selected="true">No</option> + </param> + <when value="TRUE"> + <param name="blend_threshold" type="float" value="0.5" min="0" max="1" label="Colour cutoff from weak signal to strong signal" help="(blend.threshold)"/> + <param name="cols_1" type="select" label="Colour for double negatives"> + <option value="lightgrey" selected="true">lightgrey</option> + <option value="grey">grey</option> + <option value="black">black</option> + </param> + </when> + <when value="FALSE"> + <param name="by_col" type="boolean" truevalue="TRUE" falsevalue="FALSE" checked="false" label="If splitting by a factor, plot the splits per column with features as rows" help="ignored if blend = TRUE (by.col)"/> + </when> + </conditional> + <param name="cols_2" type="select" label="Colour for low values"> + <option value="lightgrey" selected="true">light grey</option> + <option value="grey">grey</option> + <option value="lightblue">light blue</option> + <option value="blue">blue</option> + <option value="palegreen">light green</option> + <option value="palegreen4">green</option> + <option value="red">red</option> + <option value="red4">dark red</option> + </param> + <param name="cols_3" type="select" label="Colour for high values"> + <option value="lightgrey">light grey</option> + <option value="grey">grey</option> + <option value="lightblue">light blue</option> + <option value="blue" selected="true">blue</option> + <option value="palegreen">light green</option> + <option value="palegreen4">green</option> + <option value="red">red</option> + <option value="red4">dark red</option> + </param> + <expand macro="plot_pt_size"/> + <expand macro="plot_alpha"/> + <param argument="order" type="boolean" truevalue="TRUE" falsevalue="FALSE" checked="false" label="Plot cells in order of expression"/> + <conditional name="label"> + <param argument="label" type="select" label="Add labels to the clusters"> + <option value="TRUE">Yes</option> + <option value="FALSE" selected="true">No</option> + </param> + <when value="TRUE"> + <param name="label_size" type="integer" value="4" label="Set size of labels" help="(label.size)"/> + <param name="label_color" type="select" label="Set colour of label text" help="(label.color)"> + <option value="black">black</option> + <option value="grey">grey</option> + </param> + <param argument="repel" type="boolean" truevalue="TRUE" falsevalue="FALSE" checked="false" label="Repel labels"/> + </when> + <when value="FALSE"> + </when> + </conditional> + <param name="coord_fixed" type="boolean" truevalue="TRUE" falsevalue="FALSE" checked="false" label="Plot cartesian coordinates with fixed aspect ratio" help="(coord.fixed)"/> + <expand macro="plot_ncol"/> + <expand macro="raster_select"/> + </section> + <section name="adv" title="Advanced Options"> + <param argument="cells" type="data" format="txt,tabular" optional="true" label="List of cells to include on plot" help="text file with one cell on each line"/> + <expand macro="select_slot_data"/> + <expand macro="plot_split_by"/> + <param name="shape_by" type="text" optional="true" value="" label="Shape points by a group or identity (only if raster is FALSE)" help="(shape.by)"/> + <param name="min_cutoff" type="integer" optional="true" value="" label="Minimum cutoff for features - as quantile" help="(min.cutoff)"/> + <param name="max_cutoff" type="integer" optional="true" value="" label="Maximum cutoff for features - as quantile" help="(max.cutoff)"/> + </section> + </when> + <when value="DoHeatmap"> + <param argument="features" type="data" format="txt,tabular" optional="true" label="List of features to plot" help="text file with one cell on each line, defaults to VariableFeatures"/> + <param argument="cells" type="data" format="txt,tabular" optional="true" label="List of cells to include on plot" help="text file with one cell on each line"/> + <section name="plot" title="Plot Formatting Options"> + <param name="group_bar" type="boolean" truevalue="TRUE" falsevalue="FALSE" checked="true" label="Add colour bar showing group status for cells" help="(group.bar)"/> + <param name="group_colors" type="text" optional="true" value="" label="Colours to use for colour bar" help="comma-separated list of colours, one for each identity(group.colors)"> + <expand macro="valid_list"/> + </param> + <expand macro="plot_disp_min_max"/> + <param argument="label" type="boolean" truevalue="TRUE" falsevalue="FALSE" checked="true" label="Label cell identities above the colour bar" help="(label)"/> + <param argument="size" type="float" value="5.5" label="Size of text above colour bar" help="(size)"/> + <param argument="hjust" type="float" value="0" label="Horizontal justification of text above colour bar" help="(hjust)"/> + <param argument="vjust" type="float" value="0" label="Vertical justification of text above colour bar" help="(vjust)"/> + <param argument="angle" type="integer" value="45" min="0" max="90" label="Angle of text above colour bar" help="(angle)"/> + <expand macro="raster_boolean"/> + <param name="draw_lines" type="boolean" truevalue="TRUE" falsevalue="FALSE" checked="true" label="Include white lines to separate the groups" help="(draw.lines)"/> + <param name="lines_width" type="integer" optional="true" value="" label="Integer number to adjust width of separating lines" help="corresponds to the number of 'cells' between groups (lines.width)"/> + <param name="group_bar_height" type="float" value="0.02" label="Scale the height of the colour bar" help="(group.bar.height)"/> + </section> + <section name="adv" title="Advanced options"> + <param name="group_by" type="text" optional="true" value="ident" label="Vector of variables to group cells by" help="use ident to group by cluster (group.by)"> + <expand macro="valid_list"/> + </param> + <expand macro="select_slot_scale"/> + <expand macro="select_assay"/> + </section> + </when> + <when value="DotPlot"> + <param argument="idents" type="text" optional="true" value="" label="Identity classes to include in plot" help="comma-separated list of clusters/idents, leave blank to include all"> + <expand macro="valid_list"/> + </param> + <param argument="features" type="text" value="" label="Features to plot" help="object or comma-separated list"> + <expand macro="valid_list"/> + </param> + <section name="plot" title="Plot Formatting Options"> + <conditional name="cols"> + <param name="cols" type="select" label="" help=""> + <option value="two" selected="true">two</option> + <option value="more">more</option> + </param> + <when value="two"> + <param name="cols_1" type="select" label="Colour for low values"> + <option value="lightgrey" selected="true">light grey</option> + <option value="grey">grey</option> + <option value="lightblue">light blue</option> + <option value="blue">blue</option> + <option value="palegreen">light green</option> + <option value="palegreen4">green</option> + <option value="red">light red</option> + <option value="red4">red</option> + </param> + <param name="cols_2" type="select" label="Colour for high values"> + <option value="lightgrey">light grey</option> + <option value="grey">grey</option> + <option value="lightblue">light blue</option> + <option value="blue" selected="true">blue</option> + <option value="palegreen">light green</option> + <option value="palegreen4">green</option> + <option value="red">red</option> + <option value="red4">dark red</option> + </param> + </when> + <when value="more"> + <param name="cols_more" type="text" value="RdBu" label="Colours to plot" help="comma-separated list or palette (cols)"> + <expand macro="valid_list"/> + </param> + </when> + </conditional> + <param name="col_min" type="float" value="-2.5" label="Minimum scaled average expression threshold" help="everything smaller will be set to this (col.min"/> + <param name="col_max" type="float" value="2.5" label="Maximum scaled average expression threshold" help="everything larger will be set to this (col.max"/> + <param name="dot_min" type="float" value="0" min="0" max="1" label="Fraction of cells at which to draw smallest dot" help="no dot drawn for groups where fewer cells express the gene (dot.min)"/> + <param name="dot_scale" type="float" value="6" label="Scale size of points" help="(dot.scale)"/> + <param name="cluster_idents" type="boolean" truevalue="TRUE" falsevalue="FALSE" checked="false" label="Order identities into hierarchy" help="based on the features being plotted (cluster.idents)"/> + <conditional name="scale"> + <param argument="scale" type="select" label="Scale the data"> + <option value="TRUE" selected="true">No</option> + <option value="FALSE">Yes</option> + </param> + <when value="FALSE"></when> + <when value="TRUE"> + <param name="scale_by" type="select" label="Scale by" help="(scale.by)"> + <option value="radius" selected="true">radius</option> + <option value="size">size</option> + </param> + <param name="scale_min" type="float" optional="true" value="" label="Lower limit for scaling" help="leave blank to use default (scale.min)"/> + <param name="scale_max" type="float" optional="true" value="" label="Upper limit for scaling" help="leave blank to use default (scale.max)"/> + </when> + </conditional> + </section> + <section name="adv" title="Advanced Options"> + <expand macro="select_assay"/> + <expand macro="plot_group_by"/> + <expand macro="plot_split_by"/> + </section> + </when> + </conditional> + <expand macro="plot_sizes"/> + <expand macro="inputs_common_advanced"/> + </inputs> + <outputs> + <expand macro="plot_out"/> + <expand macro="outputs_common_advanced"/> + </outputs> + <tests> + <test expect_num_outputs="2"> + <!-- test1: VlnPlot PNG --> + <param name="seurat_rds" location="https://zenodo.org/records/13732784/files/filtered.rds"/> + <param name="plot_format" value="png"/> + <conditional name="method"> + <param name="method" value="VlnPlot"/> + <param name="features" value="nFeature_RNA, nCount_RNA, percent.mt"/> + <section name="plot"> + <param name="ncol" value="2"/> + </section> + </conditional> + <section name="advanced_common"> + <param name="show_log" value="true"/> + </section> + <output name="hidden_output"> + <assert_contents> + <has_text_matching expression="VlnPlot"/> + </assert_contents> + </output> + <output name="plot_out_png" location="https://zenodo.org/records/13732784/files/VlnPlot.png" ftype="png" compare="image_diff"/> + </test> + <test expect_num_outputs="2"> + <!-- test2: FeatureScatter PDF --> + <param name="seurat_rds" location="https://zenodo.org/records/13732784/files/filtered.rds"/> + <param name="plot_format" value="png"/> + <conditional name="method"> + <param name="method" value="FeatureScatter"/> + <param name="feature1" value="nCount_RNA"/> + <param name="feature2" value="percent.mt"/> + </conditional> + <section name="advanced_common"> + <param name="show_log" value="true"/> + </section> + <output name="hidden_output"> + <assert_contents> + <has_text_matching expression="FeatureScatter"/> + </assert_contents> + </output> + <output name="plot_out_png" location="https://zenodo.org/records/13732784/files/FeatureScatter.png" ftype="png" compare="image_diff"/> + </test> + <test expect_num_outputs="2"> + <!-- test3: CellScatter PDF --> + <param name="seurat_rds" location="https://zenodo.org/records/13732784/files/variablefeatures.rds"/> + <param name="plot_format" value="pdf"/> + <conditional name="method"> + <param name="method" value="CellScatter"/> + <param name="cell1" value="X16cell"/> + <param name="cell2" value="midblast.9"/> + <param name="highlight" value="Pkd2l2, Gm4850, Nlrp9b"/> + <param name="label_points" value="true"/> + </conditional> + <section name="advanced_common"> + <param name="show_log" value="true"/> + </section> + <output name="hidden_output"> + <assert_contents> + <has_text_matching expression="CellScatter"/> + </assert_contents> + </output> + <output name="plot_out_pdf" location="https://zenodo.org/records/13732784/files/CellScatter.pdf" ftype="pdf" compare="diff" lines_diff="50"/> + </test> + <test expect_num_outputs="2"> + <!-- test4: VariableFeaturePlot SVG --> + <param name="seurat_rds" location="https://zenodo.org/records/13732784/files/variablefeatures.rds"/> + <param name="plot_format" value="svg"/> + <conditional name="method"> + <param name="method" value="VariableFeaturePlot"/> + <conditional name="label_topN"> + <param name="label_topN" value="true"/> + <param name="topN" value="5"/> + </conditional> + </conditional> + <section name="advanced_common"> + <param name="show_log" value="true"/> + </section> + <output name="hidden_output"> + <assert_contents> + <has_text_matching expression="VariableFeaturePlot"/> + </assert_contents> + </output> + <output name="plot_out_svg" location="https://zenodo.org/records/13732784/files/VariableFeaturePlot.svg" ftype="svg" compare="diff" lines_diff="50"/> + </test> + <test expect_num_outputs="2"> + <!-- test5: VizDimLoadings JPEG --> + <param name="seurat_rds" location="https://zenodo.org/records/13732784/files/pca.rds"/> + <param name="plot_format" value="jpeg"/> + <conditional name="method"> + <param name="method" value="VizDimLoadings"/> + <param name="dims" value="5"/> + <param name="nfeatures" value="10"/> + <param name="reduction" value="pca"/> + <section name="plot"> + <param name="col" value="magenta"/> + </section> + <param name="projected" value="FALSE"/> + <param name="balanced" value="TRUE"/> + </conditional> + <section name="advanced_common"> + <param name="show_log" value="true"/> + </section> + <output name="hidden_output"> + <assert_contents> + <has_text_matching expression="VizDimLoadings"/> + </assert_contents> + </output> + <output name="plot_out_jpeg" location="https://zenodo.org/records/13732784/files/VizDimLoadings.jpeg" ftype="jpeg" compare="image_diff"/> + </test> + <test expect_num_outputs="2"> + <!-- test6: DimPlot TEX --> + <param name="seurat_rds" location="https://zenodo.org/records/13732784/files/umap.rds"/> + <param name="plot_format" value="tex"/> + <conditional name="method"> + <param name="method" value="DimPlot"/> + <param name="dims" value="1, 2"/> + <param name="reduction" value="umap"/> + </conditional> + <section name="advanced_common"> + <param name="show_log" value="true"/> + </section> + <output name="hidden_output"> + <assert_contents> + <has_text_matching expression="DimPlot"/> + </assert_contents> + </output> + <output name="plot_out_tex" location="https://zenodo.org/records/13732784/files/DimPlot.tex" ftype="tex"> + <assert_contents> + <has_text_matching expression="beginpicture"/> + </assert_contents> + </output> + </test> + <test expect_num_outputs="2"> + <!-- test7: DimHeatmap TIFF --> + <param name="seurat_rds" location="https://zenodo.org/records/13732784/files/pca.rds"/> + <param name="plot_format" value="tiff"/> + <conditional name="method"> + <param name="method" value="DimHeatmap"/> + <param name="dims" value="1:3"/> + <param name="nfeatures" value="30"/> + <param name="reduction" value="pca"/> + <section name="adv"> + <param name="cells" value="50"/> + <param name="slot" value="scale.data"/> + <param name="balanced" value="TRUE"/> + </section> + <section name="plot"> + <param name="raster" value="TRUE"/> + <param name="ncol" value="1"/> + </section> + </conditional> + <section name="advanced_common"> + <param name="show_log" value="true"/> + </section> + <output name="hidden_output"> + <assert_contents> + <has_text_matching expression="DimHeatmap"/> + </assert_contents> + </output> + <output name="plot_out_tiff" location="https://zenodo.org/records/13732784/files/DimHeatmap.tiff" ftype="tiff" compare="image_diff"/> + </test> + <test expect_num_outputs="2"> + <!-- test8: ElbowPlot EPS --> + <param name="seurat_rds" location="https://zenodo.org/records/13732784/files/pca.rds"/> + <param name="plot_format" value="eps"/> + <conditional name="method"> + <param name="method" value="ElbowPlot"/> + <param name="ndims" value="50"/> + <param name="reduction" value="pca"/> + </conditional> + <section name="advanced_common"> + <param name="show_log" value="true"/> + </section> + <output name="hidden_output"> + <assert_contents> + <has_text_matching expression="ElbowPlot"/> + </assert_contents> + </output> + <output name="plot_out_eps" location="https://zenodo.org/records/13732784/files/ElbowPlot.eps" ftype="eps"/> + </test> + <test expect_num_outputs="2"> + <!-- test9: FeaturePlot PNG --> + <param name="seurat_rds" location="https://zenodo.org/records/13732784/files/umap.rds"/> + <param name="plot_format" value="png"/> + <conditional name="method"> + <param name="method" value="FeaturePlot"/> + <param name="features" value="Obox6"/> + <param name="dims" value="1, 2"/> + <param name="reduction" value="umap"/> + <section name="plot"> + <param name="cols_2" value="blue"/> + <param name="cols_3" value="lightblue"/> + </section> + </conditional> + <section name="advanced_common"> + <param name="show_log" value="true"/> + </section> + <output name="hidden_output"> + <assert_contents> + <has_text_matching expression="FeaturePlot"/> + </assert_contents> + </output> + <output name="plot_out_png" location="https://zenodo.org/records/13732784/files/FeaturePlot.png" ftype="png" compare="image_diff"/> + </test> + <test expect_num_outputs="2"> + <!-- test10: DoHeatmap PNG --> + <param name="seurat_rds" location="https://zenodo.org/records/13732784/files/clusters.rds"/> + <param name="plot_format" value="png"/> + <conditional name="method"> + <param name="method" value="DoHeatmap"/> + <section name="plot"> + <param name="raster" value="TRUE"/> + </section> + <section name="adv"> + <param name="group_by" value="ident"/> + </section> + </conditional> + <conditional name="resize"> + <param name="resize" value="true"/> + <param name="width" value="2100"/> + <param name="height" value="3100"/> + </conditional> + <section name="advanced_common"> + <param name="show_log" value="true"/> + </section> + <output name="hidden_output"> + <assert_contents> + <has_text_matching expression="DoHeatmap"/> + </assert_contents> + </output> + <output name="plot_out_png" location="https://zenodo.org/records/13732784/files/DoHeatmap.png" ftype="png" compare="image_diff"/> + </test> + <test expect_num_outputs="2"> + <!-- test11: DotPlot PNG --> + <param name="seurat_rds" location="https://zenodo.org/records/13732784/files/clusters.rds"/> + <param name="plot_format" value="png"/> + <conditional name="method"> + <param name="method" value="DotPlot"/> + <param name="features" value="Pkd2l2, Gm4850, Nlrp9b, Dnajb4, Siah2"/> + </conditional> + <section name="advanced_common"> + <param name="show_log" value="true"/> + </section> + <output name="hidden_output"> + <assert_contents> + <has_text_matching expression="DotPlot"/> + </assert_contents> + </output> + <output name="plot_out_png" location="https://zenodo.org/records/13732784/files/DotPlot.png" ftype="png" compare="image_diff"/> + </test> + </tests> + <help><![CDATA[ +Seurat +====== + +Seurat is an R package designed for QC, analysis, and exploration of single-cell RNA-seq data. + +Seurat aims to enable users to identify and interpret sources of heterogeneity from single-cell transcriptomic measurements, and to integrate diverse types of single-cell data. + +You can choose which type of file you want to produce, but be aware that some types (e.g. tex) may not be viewable on Galaxy, although you will be able to download them to use elsewhere. + +VlnPlot +======= + +Draw a violin plot of single cell data (gene expression, metrics, PC scores, etc.) + +More details on the `seurat documentation +<https://satijalab.org/seurat/reference/vlnplot>`__ + +FeatureScatter +============== + +Create a scatter plot of two features (typically feature expression), across a set of single cells. Cells are colored by their identity class. +Pearson correlation between the two features is displayed above the plot. + +More details on the `seurat documentation +<https://satijalab.org/seurat/reference/featurescatter>`__ + +CellScatter +=========== + +Creates a plot of scatter plot of features across two single cells. Pearson correlation between the two cells is displayed above the plot. + +More details on the `seurat documentation +<https://satijalab.org/seurat/reference/cellscatter>`__ + +VariableFeaturePlot +=================== + +View selected variable features on a plot of variances. + +More details on the `seurat documentation +<https://satijalab.org/seurat/reference/variablefeatureplot>`__ + +VizDimLoadings +============== + +Visualize top genes associated with reduction components - default reduction is PCA. + +More details on the `seurat documentation +<https://satijalab.org/seurat/reference/vizdimloadings>`__ + +DimPlot +======= + +Graph the output of a dimensional reduction technique on a 2D scatter plot where each point is a cell and it's positioned based on the cell embeddings determined by the reduction technique. +By default, cells are colored by their identity class (can be changed with the group.by parameter). + +More details on the `seurat documentation +<https://satijalab.org/seurat/reference/dimplot>`__ + +DimHeatmap +========== + +Draw a heatmap focusing on a principal component. Both cells and genes are sorted by their principal component scores. +Allows for nice visualization of sources of heterogeneity in the dataset. + +More details on the `seurat documentation +<https://satijalab.org/seurat/reference/dimheatmap>`__ + +ElbowPlot +========= + +Plot the standard deviations of the principal components for easy identification of an elbow in the graph - plots PCA as default reduction. + +More details on the `seurat documentation +<https://satijalab.org/seurat/reference/elbowplot>`__ + +FeaturePlot +=========== + +Color single cells on a dimensional reduction plot according to a 'feature' (i.e. gene expression, PC scores, number of genes detected, etc.) + +More details on the `seurat documentation +<https://satijalab.org/seurat/reference/featureplot>`__ + +DoHeatmap +========= + +Draw a heatmap of single cell feature expression. + +More details on the `seurat documentation +<https://satijalab.org/seurat/reference/doheatmap>`__ + +DotPlot +======= + +Visualize how feature expression changes across different identity classes (e.g. clusters). +The size of the dot encodes the percentage of cells within a class that express the gene, while the color encodes the AverageExpression level across all cells within a class. + +More details on the `seurat documentation +<https://satijalab.org/seurat/reference/dotplot>`__ + + ]]></help> + <expand macro="citations"/> +</tool> \ No newline at end of file