Mercurial > repos > ecology > tool_biogeochemical_calibration
view bgc_calib.xml @ 5:e3b3794bc806 draft default tip
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/ocean_data_view_manager commit 9439bd5028eacdaaaff42dd2e095cb6ddc5af56e
author | ecology |
---|---|
date | Fri, 25 Jul 2025 09:44:10 +0000 |
parents | c15538b093e0 |
children |
line wrap: on
line source
<tool id="tool_biogeochemical_calibration" name="BioGeoChemical calibration" version="@VERSION@+galaxy@VERSION_SUFFIX@" profile="22.05" license="MIT"> <description>for sensors according to Argo recommendations</description> <macros> <token name="@VERSION@">2.1</token> <token name="@VERSION_SUFFIX@">2</token> </macros> <requirements> <container type="docker">easyqcvbgc/easy-qcv_calibration-methods_tool:cm@VERSION@</container> </requirements> <command detect_errors="exit_code"><![CDATA[ export HOME=\$PWD && mkdir -p /runtime/config && mkdir -p '/runtime/data-in-raw/' && mkdir -p '/runtime/data-in-ref/' && mkdir -p '/runtime/data-out/' && mkdir -p ./outputs && #for $i, $infile in enumerate($input_raw): #set real_name = $infile.element_identifier #set extension = $real_name.split('.')[-1] #if $extension == 'nc': cp '${infile.file_name}' "/runtime/data-in-raw/${infile.element_identifier}" && #else cp '${infile.file_name}' "/runtime/data-in-raw/${infile.element_identifier}.nc" && #end if #end for #if $input_ref: #for $i, $infile in enumerate($input_ref): cp '$infile' '/runtime/data-in-ref/${infile.element_identifier}' && #end for #end if #if $config.type == 'yes': ## Write YAML content cp '${config_file}' '/runtime/config/config_user_calibration.yml' && #end if #if $dmfiller.dmfiller_value == 'yes': #for $i, $infile in enumerate($dmfiller.input_origin): #set real_name = $infile.element_identifier #set extension = $real_name.split('.')[-1] #if $extension == 'nc': cp '${infile.file_name}' "/runtime/data-in-origin/${infile.element_identifier}" && #else cp '${infile.file_name}' "/runtime/data-in-origin/${infile.element_identifier}.nc" && #end if #end for #if $dmfiller.input_histo: #for $j, $infile in enumerate($dmfiller.input_histo): #set real_name = $infile.element_identifier #set extension = $real_name.split('.')[-1] #if $extension == 'csv': cp '${infile.file_name}' "/runtime/data-in-history/${infile.element_identifier}" && #else cp '${infile.file_name}' "/runtime/data-in-history/${infile.element_identifier}.csv" && #end if #end for #end if #end if #set $mode="R_APP_CN" /app/launchers/start-app.sh $mode && cp -r '/runtime/log/' './outputs/' && cp -r '/runtime/data-out/' './outputs/' ]]></command> <configfiles> <configfile name="config_file"> #if $config.type == 'yes': default : file_name_list_raw: #for $infile in $input_raw: #set real_name = $infile.element_identifier #set extension = $real_name.split('.')[-1] #if $extension == 'nc': - ${infile.element_identifier} #else - ${infile.element_identifier}.nc #end if #end for param : nitrate param_qc : bad : ${param_qc_bad} to_be_replaced : ${param_qc_toreplaced} replaced_by : ${param_qc_replacedby} #if $dmfiller.dmfiller_value == 'yes': dmfiller : active : TRUE mandating_institution : ${dmfiller.mandating_institution} dm_operator : name : ${dmfiller.dm_operator_name} orcid : ${dmfiller.orcid} institution : ${dmfiller.institution} contact_point : name : ${dmfiller.contact_point} orcid : ${dmfiller.orcid_contact} institution : ${dmfiller.institution_contact} file_name_list_history : #if $dmfiller.input_histo #for $infile in $dmfiller.input_histo: - ${infile.element_identifier} #end for #end if #else: dmfiller : active : FALSE #end if calib_configs : #set number = 1 #for $i, $file in enumerate($config.section_config): #set number = $number + $i - number : ${number} method_raw : name : method1 options : bypass_P : ${file.bypass.bypass_value} P : ${file.bypass.p_value} multiple_linear_regression : ${file.regression.reg_value} #if $file.favored == 'false:' single_favored : FALSE #else single_favored : TRUE #end if method_ref : name : ${file.method_ref.method_ref_name} reference : name : ${file.method_ref.reference} #if $file.method_ref.reference == 'woa': resolution : ${file.method_ref.resolution} #end if #end for #end if </configfile> </configfiles> <inputs> <param name="input_raw" type="data" format="netcdf" multiple="true" label="Input harmonized netcdf data" help="This netcdf should come from the ODV history manager or the QCV harmonizer."/> <param name="input_ref" type="data" format="netcdf" optional="true" multiple="true" label="Input reference data" help="Comes from QCV harmonizer"/> <param name="param_qc_bad" type="text" optional="true" value="4" label="Bad data QC value"/> <param name="param_qc_toreplaced" type="text" optional="true" value="3" label="Nitrate QC value to be replaced"/> <param name="param_qc_replacedby" type="text" optional="true" value="1" label="QC value of replacement"/> <conditional name="config"> <param name="type" type="select" label="Select if you want to write your own configuration file or not."> <option value="no">No, I don't want to, I'll use the default one</option> <option value="yes">Yes, I to write my own configuration file</option> </param> <when value="yes"> <repeat name="section_config" title="Configurations" min="0" max="10"> <!--<param name="method_name" type="select" label="Enter methode name"> <option value="method1">method1<option> </param>--> <conditional name="bypass"> <param name="bypass_value" type="select" label="Bypass"> <option value="0">The tool defines the P of reference for adjustment</option> <option value="1">The user defines P and chooses P below</option> </param> <when value="0"> <param name="p_value" type="select" label="Fixed P_value"> <option value="NULL">In this case the P value is NULL (no option)</option> </param> </when> <when value="1"> <param name="p_value" type="integer" value="0" min="0" max="20000" label="Enter P_value"/> </when> </conditional> <conditional name="regression"> <param name="ml_regression" type="select" label="Enter multiple linear regression"> <option value="0">Automatic choice of N</option> <option value="1">Single linear regression</option> <option value="N>1">N linear regressions</option> </param> <when value="0"> <param name="reg_value" type="select" label="Regression choice"> <option value="0">Automatic choice of N</option> </param> </when> <when value="1"> <param name="reg_value" type="select" label="Regression choice"> <option value="1">Single linear regression</option> </param> </when> <when value="N>1"> <param name="reg_value" type="integer" min="2" value="2" label="Regression choice, enter the N linear regressions"/> </when> </conditional> <param name="favored" type="boolean" label="Enter FALSE or TRUE to favored the single linear regression"/> <conditional name="method_ref"> <param name="method_ref_name" type="select" label="Reference method"> <option value="model">Model</option> <option value="clim">Climatology</option> </param> <when value="clim"> <param name="reference" type="select" label="Reference"> <option value="woa">WOA</option> </param> <param name="resolution" type="select" label="Resolution"> <option value="annual">Annual</option> <option value="monthly">Monthly</option> <option value="seasonal">Seasonal</option> </param> </when> <when value="model"> <param name="reference" type="select" label="Reference"> <option value="canyon_b">CanyonB</option> <option value="canyon_med">Canyon Med</option> </param> </when> </conditional> </repeat> </when> <when value="no"> </when> </conditional> <conditional name="dmfiller"> <param name="dmfiller_value" type="select" label="Do you want to use the DMfiller option ?" help="To fill the ARGO BD files with DM adjustment according to argo recommendations (scientific calib coef, comment, equations)"> <option value="no">No, I don't want to</option> <option value="yes">Yes, I want to use it</option> </param> <when value="yes"> <param name="input_origin" type="data" format="netcdf" multiple="true" label="Input original raw netcdf data" help="This netcdf should be te same ones than for the QCV harmonizer."/> <param name="input_histo" type="data" format="csv" optional="true" multiple="true" label="Input csv files" help="This csv should come from the ODV history manager tool."/> <param name="mandating_institution" type="select" label="Data centres and institutions handling or managing Argo data" help="To know more about the institution go there https://vocab.nerc.ac.uk/collection/R04/current/"> <option value="LV">Laboratoire Océanographique de Villefranche</option> <option value="AO">Atlantic Oceanographic and Meteorological Laboratory (AOML)</option> <option value="BO">British Oceanographic Data Centre (BODC)</option> <option value="GE">Federal Maritime and Hydrographic Agency (BSH)</option> <option value="HZ">China Second Institute of Oceanography (CSIO)</option> <option value="CS">Commonwealth Scientific and Industrial Research Organisation (CSIRO)</option> <option value="VL">Far Eastern Regional Hydrometeorological Research Institute of Vladivostock (FERHRI)</option> <option value="GT">Global Telecommunication System (GTS)</option> <option value="IN">Indian National Centre for Ocean Information Services (INCOIS)</option> <option value="PL">Institute of Oceanology Polish Academy of Science (IOPAN)</option> <option value="IF">French Research Institute for the Sustainable Exploration of the Sea (Ifremer),</option> <option value="CI">Institute of Ocean Sciences (IOS)</option> <option value="JA">Japan Meteorological Agency (JMA)</option> <option value="JM">Japan Agency for Marine-Earth Science and Technology (JAMSTEC)</option> <option value="KM">Korean Meteorological Administration (KMA)</option> <option value="KO">Korea Institute of Ocean Science and Technology (KORDI)</option> <option value="MB">Monterey Bay Aquarium Research Institute (MBARI)</option> <option value="ME">Marine Environmental Data Service (MEDS)</option> <option value="NA">Naval Oceanographic Office (NAVO)</option> <option value="NM">National Marine Data and Information Service (NMDIS)</option> <option value="PM">Pacific Marine Environmental Laboratory (PMEL), a National Oceanic and Atmospheric Administration (NOAA) laboratory</option> <option value="RU">Russia</option> <option value="SI">Scripps Institution of Oceanography (SIO), a division of the University of California San Diego (UCSD)</option> <option value="SP">Spain</option> <option value="UW">University of Washington (UW)</option> <option value="WH">Woods Hole Oceanographic Institution (WHOI)</option> </param> <param name="dm_operator_name" type="text" optional="false" label="Enter First_name Last_name of the dm operator" help="The dm operator is the person in charge of the dmqc of the float (write the name without accent like é or è...)"/> <param name="orcid" type="text" optional="false" label="Enter its orcid number"/> <param name="institution" type="text" optional="false" label="Enter its institution"/> <param name="contact_point" type="text" optional="false" label="Enter First_name Last_name of the contact point" help="This refers to the BGC contact point for the dac (write the name without accent like é or è...)"/> <param name="orcid_contact" type="text" optional="false" label="Enter the contact point's orcid number"/> <param name="institution_contact" type="text" optional="false" label="Enter the contact point's institution"/> </when> <when value="no"> </when> </conditional> </inputs> <outputs> <collection type="list" name="nc_files" label="BGC calibration netcdf collection"> <discover_datasets pattern="(?P<designation>.+)\.nc" directory="./outputs" recurse="true" format="netcdf"/> </collection> <collection type="list" name="tar_files" label="BGC calibration tar.gz collection"> <discover_datasets pattern="(?P<designation>.+)\.tar.gz" directory="./outputs" recurse="true" format="tar.gz"/> </collection> <collection type="list" name="png_files" label="BGC calibration figure collection"> <discover_datasets pattern="(?P<designation>.+)\.png" directory="./outputs" recurse="true" format="png"/> </collection> <collection type="list" name="log_files" label="BGC calibration log files"> <discover_datasets pattern="(?P<designation>.+)\.log" directory="./outputs" recurse="true" format="txt"/> </collection> </outputs> <tests> <test expect_num_outputs="4"> <param name="input_raw" location="https://gitlab.com/pokapok-projects/easy-qcv-bgc/qcv-bgc-tools/-/raw/3ae832154f55c76a7c95a5dc1e6bb19946917233/galaxy_tool/test-data/QCV_harmonizer_NetCDF_data_0_qced.nc"/> <conditional name="config"> <param name="type" value="no"/> </conditional> <output_collection name="nc_files" type="list" count="1"/> <output_collection name="png_files" type="list" count="4"/> <output_collection name="log_files" type="list" count="3"/> <output_collection name="tar_files" type="list" count="0"/> </test> <test expect_num_outputs="4"> <param name="input_raw" location="https://gitlab.com/pokapok-projects/easy-qcv-bgc/qcv-bgc-tools/-/raw/3ae832154f55c76a7c95a5dc1e6bb19946917233/galaxy_tool/test-data/QCV_harmonizer_NetCDF_data_0_qced.nc"/> <conditional name="dmfiller"> <param name="dmfiller_value" value="no"/> </conditional> <conditional name="config"> <param name="type" value="yes"/> <repeat name="section_config"> <conditional name="bypass"> <param name="bypass_value" value="0"/> </conditional> <conditional name="regression"> <param name="ml_regression" value="0"/> <param name="reg_value" value="0"/> </conditional> <param name="favored" value="FALSE"/> <conditional name="method_ref"> <param name="method_ref_name" value="model"/> <param name="reference" value="canyon_b"/> </conditional> </repeat> </conditional> <output_collection name="nc_files" type="list" count="1"/> <output_collection name="png_files" type="list" count="4"/> <output_collection name="log_files" type="list" count="3"/> <output_collection name="tar_files" type="list" count="0"/> </test> </tests> <help><![CDATA[ ========================== BioGeoChemical calibration ========================== **What it does** This tool calibrates BioGeoChemical (BGC) data measured by ARGO or GLIDER network. The BGC variables managed by the tool for the moment are : NITRATE using methods published in `archimer <https://archimer.ifremer.fr/doc/00350/46121/>` **Input description** - file_name_raw : nc file to be qualified - param_qc$bad : qc values to be removed from param before calibration - param_qc$to_be_replaced : raw qc values to be replaced for building the adjusted qc values - param_qc$replaced_by : good qc value replacing raw qc values for building adjusted qc values - method_raw$name which method/equation will be used for estimating the adjusted variable - method_raw$options : - bypass_P : 0 (tool defines the P of reference for adjustment ) OR 1 (user defines P and chooses P below) - P : NULL (if bypass_P = 0) OR numeric_values (if bypass_P = 1) - multiple_linear_regression : 0 (automatic choice of N) or 1 (single linear regression) or N>1 (N linear regressions) - single_favored : FALSE or TRUE to favored the single linear regression - method_ref$name : which kind of reference method (for example model or climatology) will be used by the method_raw for estimating the adjusted variable. - reference : which reference method like canyonb or woa will be used by the method_raw for estimating the adjusted variable. If the list of raw file name is empty, the tool stops If the user makes an error in the file extension, tool changes it by itself. If the user misses the yaml configuration, tool uses its default config and upload available files in data-in-raw compatibility matrix : - variable / application mode / [method_raw.name, method_ref.name, reference] - nitrate / R_APP_CN / [method1, model, canyon_b] & [method1, model, canyon_med] & [method1, clim, woa] **Output** - an extended nc file including the _adjusted and _adjusted_qc - figures helping to understand the adjustment The folder where to write the ODV generic spreadsheet. the output folder is organized like this : - /<file_name_raw>_C<calib_configs$number>-<param> - /figures - <file_name_raw>_C<calib_configs$number>-<param>.nc - /BDfiles_from_<file_name_raw>_C<calib_configs$number>-<param>.tar.gz (when dmfiller=true) ]]></help> <citations> <citation type="bibtex"> @Manual{, title = {ODV tool}, author = {Pokapok}, year = {2024}, note = {https://gitlab.com/pokapok-projects/easy-qcv-bgc/qcv-odv-tool} </citation> </citations> </tool>