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

artbio ❤️ Eco #56

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
tool_test_output.html
tool_test_output.json
.DS_Store
.tox
*.pyc
.*.log
.idea/*
.git/*
.Rhistory
.RData
43 changes: 43 additions & 0 deletions tools/Xlsxtotabular/test-data/dummy.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
"sample" "nb_mutations" "TMB" "cohort"
"PAMXZY" 2 "0.0606770343493" "TARGET"
"PAMYMA" 1 "0.0303385171746" "TARGET"
"PANVPB" 1 "0.0303385171746" "TARGET"
"PANZLR" 2 "0.0606770343493" "TARGET"
"PARBTV" 1 "0.0303385171746" "TARGET"
"PARHRS" 0 "0.0" "TARGET"
"PARLSL" 3 "0.0910155515239" "TARGET"
"PARNAW" 0 "0.0" "TARGET"
"PARXYR" 2 "0.0606770343493" "TARGET"
"PARZIA" 1 "0.0303385171746" "TARGET"
"PASDKZ" 1 "0.0303385171746" "TARGET"
"PASDXR" 1 "0.0303385171746" "TARGET"
"PASFHK" 2 "0.0606770343493" "TARGET"
"PASFJJ" 3 "0.0910155515239" "TARGET"
"PASFLG" 1 "0.0303385171746" "TARGET"
"PASIGA" 1 "0.0303385171746" "TARGET"
"PASLZE" 1 "0.0303385171746" "TARGET"
"PASNKZ" 1 "0.0303385171746" "TARGET"
"PASSLT" 0 "0.0" "TARGET"
"PASTZK" 6 "0.182031103048" "TARGET"
"PASVJS" 2 "0.0606770343493" "TARGET"
"PASYEJ" 1 "0.0303385171746" "TARGET"
"PASYWA" 3 "0.0910155515239" "TARGET"
"PATAIJ" 0 "0.0" "TARGET"
"PATHIU" 1 "0.0303385171746" "TARGET"
"PATISD" 1 "0.0303385171746" "TARGET"
"PATJMY" 1 "0.0303385171746" "TARGET"
"PATKBK" 3 "0.0910155515239" "TARGET"
"PATKKJ" 7 "0.212369620222" "TARGET"
"PATKWH" 2 "0.0606770343493" "TARGET"
"cBOURI" 549 "16.6558459289" "CONECT"
"c29007" 57 "1.72929547895" "CONECT"
"c21006" 152 "4.61145461054" "CONECT"
"c20017" 41 "1.24387920416" "CONECT"
"c17009" 140 "4.24739240445" "CONECT"
"c13026" 38 "1.15286365264" "CONECT"
"c13009" 87 "2.63945099419" "CONECT"
"c08006" 171 "5.18788643686" "CONECT"
"c05007" 80 "2.42708137397" "CONECT"
"c01044" 58 "1.75963399613" "CONECT"
"c01021" 357 "10.8308506313" "CONECT"
"c01002" 75 "2.2753887881" "CONECT"
Binary file added tools/Xlsxtotabular/test-data/dummy.xlsx
Binary file not shown.
1 change: 1 addition & 0 deletions tools/Xlsxtotabular/test-data/out.tabular
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"french museum"
11 changes: 6 additions & 5 deletions tools/Xlsxtotabular/xls2tab.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!/usr/bin/env Rscript
#Read xls/xlsx sheets - return tabular
library(readxl)

args = commandArgs(trailingOnly=TRUE)
# Read xls/xlsx sheets - return tabular

library(readxl)

sheet<-read_excel(args[1],sheet=args[2])
write.table(sheet,"out.tabular",sep="\t",row.names=FALSE)
args = commandArgs(trailingOnly = TRUE)
sheet <- read_excel(args[1],sheet = args[2])
write.table(sheet,"out.tabular", sep = "\t", row.names = FALSE)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we also get rid of the quotes for every cell or are they needed?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes... I had the same idea. I guess it is up to @yvanlebras. We can leave with it

Copy link

@ColineRoyaux ColineRoyaux Apr 23, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just asked him, ok to remove the quotes :)

15 changes: 10 additions & 5 deletions tools/Xlsxtotabular/xls2tab.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<tool id="xls2tab_R" name="XLS sheet to Tabular" version="0.1">
<tool id="xls2tab_R" name="XLS sheet to Tabular" version="0.2">
<requirements>
<requirement type="package" version="3.2.1">R</requirement>
<requirement type="package" version="1.1.0">r-readxl</requirement>
<requirement type="package" version="1.3.1">r-readxl</requirement>
</requirements>
<command detect_errors="exit_code"><![CDATA[
Rscript '$__tool_directory__/xls2tab.R' '$input1' '$sheet' '$output' ]]>
Expand All @@ -24,6 +23,12 @@
<param name="sheet" value="data"/>
<output name="output" file="out.tabular"/>
</test>
<test>
<param name="input1" value="dummy.xlsx"/>
<param name="sheet" value="Feuille 1"/>
<output name="output" file="dummy.tsv"/>
</test>

</tests>

<help>
Expand All @@ -45,8 +50,8 @@ Output tabular

**Arguments**

Input: xls/xlsx file.
Excel sheet name: données in situ
Input: xls/xlsx file. (xls not tested)
Excel sheet name: 'données in situ' (for instance)



Expand Down