Skip to content

Commit

Permalink
update xls2tab_R
Browse files Browse the repository at this point in the history
  • Loading branch information
bernt-matthias committed Oct 29, 2024
1 parent 541105e commit 543c6ab
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 25 deletions.
1 change: 1 addition & 0 deletions tools/Xlsxtotabular/.lint_skip
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
WARNING
11 changes: 11 additions & 0 deletions tools/Xlsxtotabular/.shed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: xls2tabular
owner: ylebras
categories:
- Ecology
- Convert Formats
description: Xlsx sheet to tabular by name
homepage_url: https://github.com/tidyverse/readxl/
long_description: |
Extract a Xlsx sheet using sheet name to a tabular dataset
remote_repository_url: https://github.com/65MO/Galaxy-E/tree/master/tools/tabular2csv
type: unrestricted
6 changes: 3 additions & 3 deletions tools/Xlsxtotabular/xls2tab.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#Read xls/xlsx sheets - return tabular
library(readxl)

args = commandArgs(trailingOnly=TRUE)
args <- commandArgs(trailingOnly=TRUE)

sheet<-read_excel(args[1],sheet=args[2])
write.table(sheet,"out.tabular",sep="\t",row.names=FALSE)
sheet <- read_excel(args[1], sheet=args[2])
write.table(sheet, args[3], sep="\t", quote=FALSE, row.names=FALSE)
36 changes: 14 additions & 22 deletions tools/Xlsxtotabular/xls2tab.xml
Original file line number Diff line number Diff line change
@@ -1,31 +1,35 @@
<tool id="xls2tab_R" name="XLS sheet to Tabular" version="0.1">
<tool id="xls2tab_R" name="XLS sheet to Tabular" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="23.1">
<macros>
<token name="@TOOL_VERSION@">1.4.3</token>
<token name="@VERSION_SUFFIX@">0</token>
</macros>
<requirements>
<requirement type="package" version="3.2.1">R</requirement>
<requirement type="package" version="1.1.0">r-readxl</requirement>
<requirement type="package" version="@TOOL_VERSION@">r-readxl</requirement>
</requirements>
<command detect_errors="exit_code"><![CDATA[
Rscript '$__tool_directory__/xls2tab.R' '$input1' '$sheet' '$output' ]]>
</command>
<inputs>
<param format="excel.xls,xlsx" name="input1" type="data" label="XLS/XLSX file"/>
<param name="sheet" type="text" label="Excel sheet name" value="biodiv_data">
<sanitizer sanitize="False"/>
<param name="sheet" type="text" label="Excel sheet name" value="">
<sanitizer>
<valid initial="string.printable">
<remove value="\\"/>
<remove value="'"/>
</valid>
</sanitizer>
</param>

</inputs>

<outputs>
<data format="tabular" name="output" from_work_dir="out.tabular" />
<data format="tabular" name="output"/>
</outputs>

<tests>
<test>
<param name="input1" value="example_xlsx.xlsx"/>
<param name="sheet" value="data"/>
<output name="output" file="out.tabular"/>
</test>
</tests>

<help>
**What it does**

Expand All @@ -39,17 +43,5 @@ Extract a sheet from XLS/XLSX file to a tabular file.
Input XLS/XLSX with a sheet named 'données in situ'

Output tabular


------

**Arguments**

Input: xls/xlsx file.
Excel sheet name: données in situ




</help>
</tool>

0 comments on commit 543c6ab

Please sign in to comment.