Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated RAMClustR to allow tsv for rectetox-aplcms inputs #539

Merged
merged 3 commits into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tools/ramclustr/macros.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@

<xml name="parameters_recetox_aplcms">
<section name="ms_dataframe" title="Input MS Data as parquet (output from recetox-aplcms)" expanded="true">
<param label="Input MS1 featureDefinitions" name="ms1_featureDefinitions" type="data" format="parquet"
<param label="Input MS1 featureDefinitions" name="ms1_featureDefinitions" type="data" format="parquet,tabular"
help="Metadata with columns: mz, rt, feature names containing MS data."/>
<param label="Input MS1 featureValues" name="ms1_featureValues" type="data" format="parquet"
<param label="Input MS1 featureValues" name="ms1_featureValues" type="data" format="parquet,tabular"
help="data with rownames = sample names, colnames = feature names containing MS data."/>
<param label="phenoData" name="df_phenoData" type="data" format="tsv,csv" optional="true"
help="CSV/TSV file containing phenoData (optional)."/>
Expand Down
4 changes: 3 additions & 1 deletion tools/ramclustr/ramclustr.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<tool id="ramclustr" name="RAMClustR" version="@TOOL_VERSION@+galaxy5" profile="21.09">
<tool id="ramclustr" name="RAMClustR" version="@TOOL_VERSION@+galaxy6" profile="21.09">
<description>A feature clustering algorithm for non-targeted mass spectrometric metabolomics data.</description>
<macros>
<import>macros.xml</import>
Expand Down Expand Up @@ -56,6 +56,8 @@
ramclustObj = read_ramclustr_aplcms(
ms1_featuredefinitions = "$filetype.ms_dataframe.ms1_featureDefinitions",
ms1_featurevalues = "$filetype.ms_dataframe.ms1_featureValues",
ms1_featuredefinitions_ext = "$filetype.ms_dataframe.ms1_featureDefinitions.ext",
ms1_featurevalues_ext = "$filetype.ms_dataframe.ms1_featureValues.ext",
#if $filetype.ms_dataframe.df_phenoData:
df_phenodata = "$filetype.ms_dataframe.df_phenoData",
phenodata_ext = "${filetype.ms_dataframe.df_phenoData.ext}",
Expand Down
19 changes: 16 additions & 3 deletions tools/ramclustr/ramclustr_wrapper.R
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,22 @@ read_ramclustr_aplcms <- function(ms1_featuredefinitions = NULL,
phenodata_ext = NULL,
exp_des = NULL,
st = NULL,
ensure_no_na = TRUE) {
ms1_featuredefinitions <- arrow::read_parquet(ms1_featuredefinitions)
ms1_featurevalues <- arrow::read_parquet(ms1_featurevalues)
ensure_no_na = TRUE,
ms1_featuredefinitions_ext = "parquet",
ms1_featurevalues_ext = "parquet") {
if (ms1_featuredefinitions_ext == "parquet") {
ms1_featuredefinitions <- arrow::read_parquet(ms1_featuredefinitions)
} else {
ms1_featuredefinitions <- read.csv(ms1_featuredefinitions,
header = TRUE, sep = "\t"
)
}

if (ms1_featurevalues_ext == "parquet") {
ms1_featurevalues <- arrow::read_parquet(ms1_featurevalues)
} else {
ms1_featurevalues <- read.csv(ms1_featurevalues, header = TRUE, sep = "\t")
}

if (!is.null(df_phenodata)) {
if (phenodata_ext == "csv") {
Expand Down