Mercurial > repos > iuc > sleuth
changeset 3:2c3d294dbe42 draft default tip
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sleuth commit 4adb19064a6973121680119529444286c24c1ac1
author | iuc |
---|---|
date | Mon, 02 Jun 2025 21:31:22 +0000 |
parents | d6b5fc94062c |
children | |
files | macros.xml sleuth.R sleuth.xml |
diffstat | 3 files changed, 103 insertions(+), 92 deletions(-) [+] |
line wrap: on
line diff
--- a/macros.xml Thu Jun 08 19:57:53 2023 +0000 +++ b/macros.xml Mon Jun 02 21:31:22 2025 +0000 @@ -3,13 +3,13 @@ <requirements> <requirement type="package" version="@TOOL_VERSION@">r-sleuth</requirement> <requirement type="package" version="0.2.0">r-annotables</requirement> - <requirement type="package" version="2.2.1">r-argparse</requirement> + <requirement type="package" version="2.2.5">r-argparse</requirement> <requirement type="package" version="2.0.0">r-tidyverse</requirement> </requirements> </xml> - <token name="@TOOL_VERSION@">0.30.1</token> - <token name="@SUFFIX_VERSION@">2</token> - <token name="@PROFILE@">20.01</token> + <token name="@TOOL_VERSION@">0.30.2</token> + <token name="@SUFFIX_VERSION@">0</token> + <token name="@PROFILE@">23.2</token> <xml name="citations"> <citations> <citation type="doi">10.1038/nmeth.4324</citation>
--- a/sleuth.R Thu Jun 08 19:57:53 2023 +0000 +++ b/sleuth.R Mon Jun 02 21:31:22 2025 +0000 @@ -1,6 +1,7 @@ library(sleuth, - quietly = TRUE, - warn.conflicts = FALSE) + quietly = TRUE, + warn.conflicts = FALSE +) library(annotables, quietly = TRUE, warn.conflicts = FALSE) library(argparse, quietly = TRUE, warn.conflicts = FALSE) library(tidyverse) @@ -8,11 +9,11 @@ # setup R error handling to go to stderr options( - show.error.messages = FALSE, - error = function() { - cat(geterrmessage(), file = stderr()) - q("no", 1, FALSE) - } + show.error.messages = FALSE, + error = function() { + cat(geterrmessage(), file = stderr()) + q("no", 1, FALSE) + } ) # we need that to not crash galaxy with an UTF8 error on German LC settings. @@ -28,113 +29,123 @@ parser$add_argument("--factorLevel", action = "append", required = FALSE) parser$add_argument("--factorLevel_counts", - action = "append", - required = FALSE) -parser$add_argument("--factorLevel_n", action = "append", required = FALSE) -parser$add_argument("--cores", type = "integer", required = FALSE) + action = "append", + required = FALSE +) +parser$add_argument("--factorLevel_n", action = "append", required = FALSE) +parser$add_argument("--cores", type = "integer", required = FALSE) parser$add_argument("--normalize", action = "store_true", required = FALSE) parser$add_argument("--nbins", type = "integer", required = FALSE) parser$add_argument("--lwr", type = "numeric", required = FALSE) parser$add_argument("--upr", type = "numeric", required = FALSE) parser$add_argument("--metadata_file", - action = "append", - required = FALSE) + action = "append", + required = FALSE +) parser$add_argument("--experiment_design", required = FALSE) args <- parser$parse_args() if (args$experiment_design == "complex") { - ## Complex experiment design - ############################ - - s2c <- - read.table(file = args$metadata_file, - header = TRUE, - sep = "\t") + ## Complex experiment design + ############################ - s2c$path <- file.path("./kallisto_outputs/", paste(s2c$path, ".h5", sep = "")) - for (f in args$factorLevel_counts) { - file.rename(f, paste(f, ".h5", sep = "")) - } + s2c <- + read.table( + file = args$metadata_file, + header = TRUE, + sep = "\t" + ) - so <- sleuth_prep(s2c, full_model = ~ condition, num_cores = 1) - so <- sleuth_fit(so) + s2c$path <- file.path("./kallisto_outputs/", paste(s2c$path, ".h5", sep = "")) + for (f in args$factorLevel_counts) { + file.rename(f, paste(f, ".h5", sep = "")) + } + so <- sleuth_prep(s2c, full_model = ~condition, num_cores = 1) + so <- sleuth_fit(so) } else { - ## Simple experiment design - ########################### + ## Simple experiment design + ########################### - conditions <- c() - for (x in seq_along(args$factorLevel)) { - temp <- append(conditions, rep(args$factorLevel[[x]])) - conditions <- temp - } + conditions <- c() + for (x in seq_along(args$factorLevel)) { + temp <- append(conditions, rep(args$factorLevel[[x]])) + conditions <- temp + } - sample_names <- - gsub(".fastq.+", "", basename(args$factorLevel_counts)) + sample_names <- + gsub(".fastq.+", "", basename(args$factorLevel_counts)) - design <- - data.frame(list( - sample = sample_names, - condition = conditions, - path = args$factorLevel_counts - )) - so <- sleuth_prep(design, - cores = args$cores, - normalize = args$normalize) + design <- + data.frame(list( + sample = sample_names, + condition = conditions, + path = args$factorLevel_counts + )) + so <- sleuth_prep(design, + cores = args$cores, + normalize = args$normalize + ) } so <- sleuth_fit( - so, - ~ condition, - "full", - n_bins = args$nbins, - lwr = args$lwr, - upr = args$upr + so, + ~condition, + "full", + n_bins = args$nbins, + lwr = args$lwr, + upr = args$upr ) so <- sleuth_fit( - so, - ~ 1, - "reduced", - n_bins = args$nbins, - lwr = args$lwr, - upr = args$upr + so, + ~1, + "reduced", + n_bins = args$nbins, + lwr = args$lwr, + upr = args$upr ) so <- sleuth_lrt(so, "reduced", "full") sleuth_table <- - sleuth_results(so, "reduced:full", "lrt", show_all = FALSE) + sleuth_results(so, "reduced:full", "lrt", show_all = FALSE) write.table( - sleuth_table, - file = "sleuth_table.tab", - quote = FALSE, - sep = "\t", - col.names = TRUE, - row.names = FALSE + sleuth_table, + file = "sleuth_table.tab", + quote = FALSE, + sep = "\t", + col.names = TRUE, + row.names = FALSE ) outputFile <- file.path(getwd(), "pca_plot.pdf") -pdf(file = outputFile, +pdf( + file = outputFile, height = 6, - width = 9) + width = 9 +) plot_pca(so, color_by = "condition") dev.off() outputFile <- file.path(getwd(), "group_density.pdf") -pdf(file = outputFile, +pdf( + file = outputFile, height = 6, - width = 9) + width = 9 +) plot_group_density( - so, - use_filtered = TRUE, - units = "est_counts", - trans = "log", - grouping = setdiff(colnames(so$sample_to_covariates), - "sample"), - offset = 1 + so, + use_filtered = TRUE, + units = "est_counts", + trans = "log", + grouping = setdiff( + colnames(so$sample_to_covariates), + "sample" + ), + offset = 1 ) dev.off()
--- a/sleuth.xml Thu Jun 08 19:57:53 2023 +0000 +++ b/sleuth.xml Mon Jun 02 21:31:22 2025 +0000 @@ -1,5 +1,5 @@ <tool id="sleuth" name="Sleuth" version="@TOOL_VERSION@+galaxy@SUFFIX_VERSION@" profile="@PROFILE@"> - <description>differential expression analysis</description> + <description>Differential expression analysis</description> <macros> <import>macros.xml</import> </macros> @@ -9,15 +9,15 @@ <regex match="Execution halted" source="both" level="fatal" - description="Execution halted." /> + description="Execution halted."/> <regex match="Error in" source="both" level="fatal" - description="An undefined error occurred, please check your input carefully and contact your administrator." /> + description="An undefined error occurred, please check your input carefully and contact your administrator."/> <regex match="Fatal error" source="both" level="fatal" - description="An undefined error occurred, please check your input carefully and contact your administrator." /> + description="An undefined error occurred, please check your input carefully and contact your administrator."/> </stdio> <version_command><![CDATA[echo $(R --version | grep version | grep -v GNU)", sleuth version" $(R --vanilla --slave -e "library(sleuth); cat(sessionInfo()\$otherPkgs\$sleuth\$Version)" 2> /dev/null | grep -v -i "WARNING: ")]]></version_command> <command><![CDATA[ @@ -74,7 +74,7 @@ <param name="factorLevel" type="text" value="FactorLevel" label="Specify a factor level, typical values could be 'tumor', 'normal', 'treated' or 'control'" help="Only letters, numbers and underscores will be retained in this field"> <sanitizer> - <valid initial="string.letters,string.digits"><add value="_" /></valid> + <valid initial="string.letters,string.digits"><add value="_"/></valid> </sanitizer> </param> <param name="countsFile" type="data" format="h5" multiple="true" label="Counts file(s)"/> @@ -82,26 +82,26 @@ </when> <when value="complex"> <param name="countsFile" type="data_collection" format="h5" multiple="true" label="Counts file(s)"/> - <param argument="--metadata_file" type="data" format="txt" label="Input metadata file" help="You can find more details about the format of the design table in the help section." /> + <param argument="--metadata_file" type="data" format="txt" label="Input metadata file" help="You can find more details about the format of the design table in the help section."/> </when> </conditional> <section name="advanced_options" title="Advanced options" expanded="true"> <param argument="normalization" type="boolean" truevalue="--normalize" falsevalue="" checked="true" label="Normalize data" help="If this is set to false, bootstraps will not be read and transformation of the data will not be done. This should - only be set to false if one desires to do a quick check of the raw data. " /> + only be set to false if one desires to do a quick check of the raw data. "/> <param argument="nbins" type="integer" min="0" value="100" label="NBins" help="The number of bins that the data should be - split for the sliding window shrinkage using the mean-variance curve." /> + split for the sliding window shrinkage using the mean-variance curve."/> <param argument="lwr" type="float" min="0" max="1" value="0.25" label="LWR" help="The lower range of variances within each - bin that should be included for the shrinkage procedure. " /> + bin that should be included for the shrinkage procedure. "/> <param argument="upr" type="float" min="0" max="1" value="0.75" label="UPR" help="The upper range of variances within each - bin that should be included for the shrinkage procedure." /> + bin that should be included for the shrinkage procedure."/> </section> </inputs> <outputs> <data name="sleuth_table" from_work_dir="sleuth_table.tab" format="tabular" label="${tool.name} on ${on_string}: DE table"> <actions> - <action name="column_names" type="metadata" default="target_id,pval,qval,test_stat,rss,degrees_free,mean_obs,var_obs,tech_var,sigma_sq,smooth_sigma_sq,final_sigma_sq" /> + <action name="column_names" type="metadata" default="target_id,pval,qval,test_stat,rss,degrees_free,mean_obs,var_obs,tech_var,sigma_sq,smooth_sigma_sq,final_sigma_sq"/> </actions> </data> <data name="pca_plot" from_work_dir="pca_plot.pdf" format="pdf" label="${tool.name} on ${on_string}: PCA plot"/> @@ -154,7 +154,7 @@ </section> <output name="sleuth_table" ftype="tabular"> <assert_contents> - <has_size value="756310" delta="100"/> + <has_size value="756425" delta="100"/> <has_text text="ENST00000394894.8"/> <has_text text="ENST00000524187.1"/> </assert_contents> @@ -183,7 +183,7 @@ </section> <output name="sleuth_table" ftype="tabular"> <assert_contents> - <has_size value="756310" delta="100"/> + <has_size value="756425" delta="100"/> <has_text text="ENST00000394894.8"/> <has_text text="ENST00000524187.1"/> </assert_contents> @@ -230,5 +230,5 @@ Additional factors can be included in the design table. ]]></help> - <expand macro="citations" /> + <expand macro="citations"/> </tool>