-
Notifications
You must be signed in to change notification settings - Fork 21
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
Add metashrimps tool suite #73
Open
TanguyGen
wants to merge
49
commits into
master
Choose a base branch
from
TanguyGen-patch-2
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
49 commits
Select commit
Hold shift + click to select a range
6d54a4a
Add files via upload
TanguyGen 348afd9
Add files via upload
TanguyGen 62966ed
Add files via upload
TanguyGen 82c3609
Update .shed.yml
TanguyGen 5aa6917
Update .shed.yml
TanguyGen 036b977
Add files via upload
TanguyGen b25bba0
Update DataPaper.xml
TanguyGen 44c50dd
Update DataPaper.xml
TanguyGen 6c010c2
Update DataPaper.xml
TanguyGen 2598001
Update DataPaper.R
TanguyGen 73444b2
Update DataPaper.xml
TanguyGen 927a21f
Remove extensions
TanguyGen 128e7a3
Update DataPaper.xml
TanguyGen 5b83553
Update DataPaper.xml
TanguyGen efd45b4
Update DataPaper.xml
TanguyGen b9e5462
Update DataPaper.xml
TanguyGen 2edb116
Update DataPaper.R
TanguyGen a071344
Update DataPaper.xml
TanguyGen e9dcab5
Update DataPaper.xml
TanguyGen 9d0caa7
Add files via upload
TanguyGen 9d71e84
Update DataPaper.xml
TanguyGen 2c033c2
Update DataPaper.xml
TanguyGen 987749e
Update DataPaper.xml
TanguyGen d696225
Update DataPaper.xml
TanguyGen ea07435
Update DataPaper.xml
TanguyGen 844525a
Update DataPaper.xml
TanguyGen 0489090
reformatting
bgruening cb648a9
change the id to make it a bit more informative
bgruening 29cd255
Update .shed.yml
TanguyGen 429f319
Update DataPaper.xml
TanguyGen b44b5e3
Update DataPaper.xml
TanguyGen 154b442
Update DataPaper.xml
TanguyGen 2f91ecc
Update DataPaper.xml
TanguyGen 6d65451
Update DataPaper.xml
TanguyGen c5e708d
Update DataPaper.xml
TanguyGen b5a9de8
Update DataPaper.R
TanguyGen 611479e
Update DataPaper.xml
TanguyGen 9685cb4
Update DataPaper.xml
TanguyGen 3b2f3f1
Add files via upload
yvanlebras c46f92e
Add files via upload
TanguyGen 283b107
Update DataPaper.xml
TanguyGen 47e06be
Update DataPaper.xml r-dplyr requirements as last place in order inst…
yvanlebras 727b51d
Update DataPaper.xml add r-codetools 0.2_18 requirement
yvanlebras 66d5e3a
Update footer.xsl add https for http://unconf17.ropensci.org/images/r…
yvanlebras b8fe7f1
Update .shed.yml to retest through CI
yvanlebras faffc64
Update DataPaper.xml try reorganise dependencies order
yvanlebras 3046d26
Update DataPaper.xml try letting conda find good dependendcies versio…
yvanlebras 677cd96
Update DataPaper.xml retry dependencies versions
yvanlebras cc5056a
Update DataPaper.xml test depednanecies versions
yvanlebras File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: MetaShRIMPS | ||
owner: ecology | ||
description: Tools to operate machine actionnable actions on EML metadata | ||
homepage_url: https://github.com/tanguygen/metacure | ||
long_description: | | ||
Tools to operate machine actionnable jobs to EML metadata from MetaShRIMPS, a project from the PNDB (French hub for biodiversity data) | ||
remote_repository_url: https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline | ||
type: unrestricted | ||
categories: | ||
- Ecology | ||
auto_tool_repositories: | ||
name_template: "{{ tool_id }}" | ||
description_template: "MetaShRIMPS: {{ tool_name }}" | ||
suite: | ||
name: "suite_metashrimps" | ||
description: Tools to operate machine actionnable jobs on EML metadata | ||
long_description: | | ||
Tools to operate machine actionnable jobs to EML metadata from MetaShRIMPS, a project from the PNDB (French hub for biodiversity data). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
##07/06/2023 | ||
##Genthon Tanguy | ||
### Data Paper draft production | ||
|
||
#load arguments | ||
args = commandArgs(trailingOnly=TRUE) | ||
if (length(args)==0) | ||
{ | ||
stop("This tool needs at least one argument") | ||
}else{ | ||
path_temp <- args[1] | ||
data <- args[2] | ||
edit <- args[3] | ||
} | ||
|
||
library(dplyr) | ||
##################################################################################################### | ||
#Functions for creation of Data Papers | ||
|
||
#' map_geographical_coverage | ||
#'Make a map from EML | ||
#' @param eml Metadata using EML standard in XML format | ||
#' | ||
#' @return A map | ||
#' @export | ||
map_geographical_coverage <- function(eml,editable=edit){ | ||
name <- xml2::xml_find_all(eml, "//geographicCoverage/geographicDescription") | ||
name <- unlist(xml2::as_list(name)) | ||
|
||
west <- xml2::xml_find_all(eml, "//geographicCoverage/boundingCoordinates/westBoundingCoordinate") | ||
west <- as.numeric(unlist(xml2::as_list(west))) | ||
|
||
east <- xml2::xml_find_all(eml, "//geographicCoverage/boundingCoordinates/eastBoundingCoordinate") | ||
east <- as.numeric(unlist(xml2::as_list(east))) | ||
|
||
north <- xml2::xml_find_all(eml, "//geographicCoverage/boundingCoordinates/northBoundingCoordinate") | ||
north <- as.numeric(unlist(xml2::as_list(north))) | ||
|
||
south <- xml2::xml_find_all(eml, "//geographicCoverage/boundingCoordinates/southBoundingCoordinate") | ||
south <- as.numeric(unlist(xml2::as_list(south))) | ||
|
||
geo_info <- data.frame(name = name, | ||
west = west, east = east, | ||
south = south, north = north) | ||
|
||
map <- leaflet::leaflet(geo_info) %>% | ||
leaflet::addProviderTiles("CartoDB.Positron") %>% | ||
leaflet::addRectangles( | ||
lng1 = west, lat1 = south, | ||
lng2 = east, lat2 = north, | ||
popup = name, | ||
fillColor = "transparent" | ||
) | ||
if (editable=="true") { | ||
mapview::mapshot(map,file="map.png") | ||
} | ||
mapview::mapshot(map, url = "map.html") | ||
} | ||
|
||
|
||
##' Render EML metadata into a webpage | ||
##' | ||
##' Pass in an xml file of EML metadata and generate a nice webpage describing | ||
##' the dataset. | ||
##' | ||
##' @title Render EML | ||
##' @param eml A valid Ecological Metadata Language file to be rendered to html. | ||
##' @param open Whether to open the file in a browser. Defaults to TRUE. | ||
##' @param publish_mode TRUE. If TRUE the website is pretty without warnings for weird stuff. | ||
##' @param output_dir directory where will be stored the result file | ||
##' @param encoding "" encoding of the EML file if necessary | ||
##' @return HTML file containing dataset information | ||
render_eml <- function(eml, open = FALSE, | ||
publish_mode = TRUE, output_dir = "/docs", | ||
encoding = "",editable) { | ||
eml <- xml2::read_xml(eml, encoding = encoding) | ||
if (editable=="true"){ | ||
style2 <- xml2::read_xml(paste0(path_temp,"/bootstrap2.xsl")) | ||
html <- xslt::xml_xslt(eml, style2) | ||
# make map | ||
xml2::write_html(html, "DataPaper2.html") | ||
rmarkdown::pandoc_convert("DataPaper2.html", output="DataPaper.docx", options =c("--standalone")) | ||
file.copy("DataPaper.docx",".") | ||
} | ||
style <- xml2::read_xml(paste0(path_temp,"/bootstrap.xsl")) | ||
html <- xslt::xml_xslt(eml, style) | ||
# make map | ||
map_geographical_coverage(eml) | ||
xml2::write_html(html, "DataPaper.html") | ||
} | ||
|
||
####################################################################################################### | ||
#exportation of Data Paper | ||
|
||
render_eml(data,editable=edit) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
<tool id="metashrimp_datapaper" name="Production of a draft of Data Paper" version="0.1.0+galaxy0" profile="22.05"> | ||
<description>Create a draft of Data Paper from metadata</description> | ||
<requirements> | ||
<requirement type="package">r-base</requirement> | ||
<requirement type="package">r-dplyr</requirement> | ||
<requirement type="package">r-xml2</requirement> | ||
<requirement type="package">r-xslt</requirement> | ||
<requirement type="package">r-mapview</requirement> | ||
<requirement type="package">r-leaflet</requirement> | ||
<requirement type="package">gmp</requirement> | ||
<requirement type="package" version="2.1.1">phantomjs</requirement> | ||
<requirement type="package" version="2.19.2">pandoc</requirement> | ||
<requirement type="package" version="2.23">r-rmarkdown</requirement> | ||
<requirement type="package" version="0.2_18">r-codetools</requirement> | ||
</requirements> | ||
<command detect_errors="exit_code"><![CDATA[ | ||
Rscript | ||
'$__tool_directory__/DataPaper.R' | ||
'$__tool_directory__/template_emldown' | ||
'$data' | ||
'$editable' | ||
]]></command> | ||
<inputs> | ||
<param name="data" type="data" format="xml" label="Upload metadata" help="Insert only metadata using EML standard"/> | ||
<param name="editable" type="boolean" checked="false" label="Would you like to include a docx editable file instead of an HTML?" help= "HTML files are better for visualisation but are more difficult to edit than a docx."/> | ||
</inputs> | ||
<outputs> | ||
<collection name="draft_html" type="list" label="Data Paper Draft"> | ||
<data name="DataPaper" from_work_dir="DataPaper.html" format="html" label="Data Paper"/> | ||
<data name="map" from_work_dir="map.html" format="html" label="Leaflet Map"/> | ||
</collection> | ||
<collection name="draft_docx" type="list" label="Editable Data Paper Draft"> | ||
<data name="DataPaper" from_work_dir="DataPaper.docx" format="docx" label="Data Paper docx"/> | ||
<data name="map" from_work_dir="map.png" format="png" label="Leaflet Map Image"/> | ||
<filter>editable</filter> | ||
</collection> | ||
</outputs> | ||
<tests> | ||
<test expect_num_outputs="6"> | ||
<param name="data" value="Assessing_the_importance_of_field_margins_for_bat_species.xml"/> | ||
<param name="editable" value="true"/> | ||
<output_collection name="draft_html" type="list"> | ||
<element name="DataPaper" file="DataPaper.html" ftype="html" /> | ||
</output_collection> | ||
<output_collection name="draft_docx" type="list"> | ||
<element name="DataPaper" file="DataPaper.docx" ftype="docx" /> | ||
<element name="map" file="map.png" ftype="png" /> | ||
</output_collection> | ||
</test> | ||
</tests> | ||
<help><![CDATA[ | ||
|
||
.. class:: warningmark | ||
|
||
'''TIP''' This tool requires metadata with **XML** format and using **EML** standard | ||
|
||
**What it does?** | ||
-------------------- | ||
|
||
This tool aims to produce, from a metadata using EML standard, a draft of Data Paper. | ||
A Data Paper is an scientific publication describing the collect of data and thus highlighting the work of all data producers. | ||
This Draft of Data Paper may be used to present your metadata in a more esthetetic and comprehensible way to others or can be modified and completed to help | ||
the data producers redacting their publication. | ||
|
||
**How to use it?** | ||
-------------------- | ||
|
||
To use this tool, you have to upload a metadata written in XML and using EML standard. | ||
You can then select whether you want an editable version of your Data Paper. | ||
By clicking the **Execute** button, the work will launch and you will be able to get your results in the historic on your right. | ||
|
||
|
||
]]></help> | ||
<citations> | ||
<citation type="bibtex">@misc{githubsurvey2023, | ||
author = {ropensci-archive }, | ||
title = {{EMLdown}}, | ||
publisher = {Github}, | ||
url = {https://github.com/ropensci-archive/emldown} | ||
} | ||
}</citation> | ||
</citations> | ||
</tool> |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't remove version here.
What you can do is ... outside of Galaxy do:
Then you get an ouput and you take the versions numbers from that output and add it here.