Repository 'pampa_plotglm'
hg clone https://toolshed.g2.bx.psu.edu/repos/ecology/pampa_plotglm

Changeset 0:3ab852a7ff53 (2020-11-16)
Next changeset 1:5ddca052c314 (2021-04-26)
Commit message:
"planemo upload for repository https://github.com/ColineRoyaux/PAMPA-Galaxy commit 04381ca7162ec3ec68419e308194b91d11cacb04"
added:
FunctExePlotGLMGalaxy.r
FunctPAMPAGalaxy.r
PAMPA_PLOT_GLM.xml
pampa_macros.xml
test-data/GLM_table_population_analysis_on_Presence_absence_sansszcl_cropped.tabular
test-data/Presence_absence_table_sansszcl_cropped.tabular
test-data/Unitobs.tabular
b
diff -r 000000000000 -r 3ab852a7ff53 FunctExePlotGLMGalaxy.r
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/FunctExePlotGLMGalaxy.r Mon Nov 16 11:02:43 2020 +0000
[
b'@@ -0,0 +1,403 @@\n+#Rscript\r\n+\r\n+#####################################################################################################################\r\n+#####################################################################################################################\r\n+###################################### Create a plot from your community data #######################################\r\n+#####################################################################################################################\r\n+#####################################################################################################################\r\n+\r\n+###################### Packages\r\n+suppressMessages(library(ggplot2))\r\n+suppressMessages(library(boot))\r\n+\r\n+###################### Load arguments and declaring variables\r\n+\r\n+args <- commandArgs(trailingOnly = TRUE)\r\n+\r\n+\r\n+if (length(args) < 2) {\r\n+    stop("At least 3 arguments must be supplied input dataset file with GLM results (.tabular)", call. = FALSE) #if no args -> error and exit1\r\n+\r\n+} else {\r\n+    import_data <- args[1] ###### file name : glm results table\r\n+    data_tab <- args[2] ###### file name : Metrics table\r\n+    unitobs_tab <- args[3] ###### file name : Unitobs table\r\n+    source(args[4]) ###### Import functions\r\n+\r\n+}\r\n+\r\n+#Import data\r\n+glmtable <- read.table(import_data, sep = "\\t", dec = ".", header = TRUE, encoding = "UTF-8") #\r\n+datatable <- read.table(data_tab, sep = "\\t", dec = ".", header = TRUE, encoding = "UTF-8") #\r\n+unitobs <- read.table(unitobs_tab, sep = "\\t", dec = ".", header = TRUE, encoding = "UTF-8") #\r\n+\r\n+#Check files\r\n+\r\n+vars_data1 <- c("analysis", "Interest.var", "distribution")\r\n+err_msg_data1 <- "The input GLM results dataset doesn\'t have the right format. It needs to have at least the following 3 fields :\\n- analysis\\n- Interest.var\\n- distribution\\n"\r\n+check_file(glmtable, err_msg_data1, vars_data1, 4)\r\n+\r\n+if (length(grep("[0-2][0|9][0-9][0-9].[Estimate|Pvalue]", colnames(glmtable))) == 0) {\r\n+    stop("The input GLM results dataset doesn\'t have the right format or informations. This tool is to represent temporal trends, if your GLM doesn\'t take the year variable as a fixed effect this tool is not proper to make any representation of it. It needs to have at least estimates and p-value for every year from your time series GLM as columns with name formated as : yyyy Estimate (example : 2020 Estimate) and  yyyy Pvalue (example : 2020 Pvalue).")\r\n+}\r\n+\r\n+if (length(grep("[0-2][0|9][0-9][0-9].IC_[up|inf]", colnames(glmtable))) == 0) {\r\n+    assess_ic <- FALSE\r\n+}else{\r\n+    assess_ic <- TRUE\r\n+}\r\n+\r\n+metric <- as.character(glmtable[1, "Interest.var"])\r\n+\r\n+vars_data2 <- c("observation.unit", "location", metric)\r\n+err_msg_data2 <- "The input metrics dataset doesn\'t have the right format. It needs to have at least the following 3 fields :\\n- observation.unit\\n- location\\n- the name of the interest metric\\n"\r\n+check_file(datatable, err_msg_data2, vars_data2, 4)\r\n+\r\n+vars_data3 <- c("observation.unit", "year")\r\n+err_msg_data3 <- "The input unitobs dataset doesn\'t have the right format. It needs to have at least the following 2 fields :\\n- observation.unit\\n- year\\n"\r\n+check_file(unitobs, err_msg_data3, vars_data3, 2)\r\n+if (length(grep("[0-2][0|9][0-9][0-9]", unitobs$year)) == 0) {\r\n+    stop("The year column in the input unitobs dataset doesn\'t have the right format. Years must be fully written as : yyyy (example : 2020).")\r\n+}\r\n+\r\n+if (all(is.na(match(datatable[, "observation.unit"], unitobs[, "observation.unit"])))) {\r\n+    stop("Observation units doesn\'t match in the inputs metrics dataset and unitobs dataset")\r\n+}\r\n+\r\n+####################################################################################################################\r\n+######################### Creating plot from time series GLM data ## Function : ggplot_glm #########################\r\n+###########################################################################################################'..b' is.null(tab1t)) {\r\n+        if (assess_ic) {\r\n+            txt_pente1 <- paste("Global trend : ", tab1t$Est,\r\n+                               ifelse(tab1t$signif, " *", ""),\r\n+                               ifelse(tab1t$signif, paste("\\n", ifelse(tab1t$pourcent > 0, "+ ", "- "),\r\n+                                                         abs(tab1t$pourcent), " % in ", pasdetemps, " years", sep = ""), ""), sep = "")\r\n+        }else{\r\n+            txt_pente1 <- ifelse(tab1t$signif, paste("\\n", ifelse(tab1t$pourcent > 0, "+ ", "- "),\r\n+                                                   abs(tab1t$pourcent), " % in ", pasdetemps, " years", sep = ""), "")\r\n+        }\r\n+    }else{\r\n+        trend_on_graph <- FALSE\r\n+    }\r\n+\r\n+    ## table of the text for the population evolution trend\r\n+    tab_text_pent <- data.frame(y = c(max(c(dgg$val, dgg$ul), na.rm = TRUE) * .9),\r\n+                              x = median(dgg$year),\r\n+                              txt = ifelse(trend_on_graph, c(txt_pente1), ""),\r\n+                              courbe = c(vpan[1]), panel = c(vpan[1]))\r\n+\r\n+    dgg <- rbind(tab1, tab2)\r\n+\r\n+    ## colors for plots\r\n+    vec_col_point <- c("#ffffff", "#eeb40f", "#ee0f59")\r\n+    names(vec_col_point) <- c("significatif", "infSeuil", "0")\r\n+    vec_col_courbe <- c("#3c47e0", "#5b754d", "#55bb1d", "#973ce0")\r\n+    names(vec_col_courbe) <- c(vpan[1], "loc", "presence", vpan[2])\r\n+    vec_col_hline <- c("#ffffff", "#e76060")\r\n+    names(vec_col_hline) <- c("var estimates", "seuil")\r\n+\r\n+    col <- c(vec_col_point, vec_col_courbe, vec_col_hline)\r\n+    names(col) <- c(names(vec_col_point), names(vec_col_courbe), names(vec_col_hline))\r\n+\r\n+    p <- ggplot2::ggplot(data = dgg, mapping = ggplot2::aes_string(x = "year", y = "val"))\r\n+    ## Titles and scales\r\n+    p <- p + facet_grid(panel ~ ., scale = "free") +\r\n+    theme(legend.position = "none",\r\n+          panel.grid.minor = element_blank(),\r\n+          panel.grid.major.y = element_blank(),\r\n+          axis.text.x = element_text(angle = 90, vjust = 0.5, hjust = 1))  +\r\n+    ylab("") + xlab("year") + ggtitle(titre) +\r\n+    scale_colour_manual(values = col, name = "",\r\n+                             breaks = names(col)) +\r\n+    scale_x_continuous(breaks = min(dgg$year):max(dgg$year))\r\n+    p <- p + ggplot2::geom_hline(data = hline_data, mapping = ggplot2::aes_string(yintercept = "z", colour = "couleur", linetype = "type"),\r\n+                    alpha = 1, size = 1.2)\r\n+    if (assess_ic) { ############# ONLY FOR THE CONFIDENCE INTERVAL\r\n+        p <- p + ggplot2::geom_ribbon(mapping = ggplot2::aes_string(ymin = "ll", ymax = "ul"), fill = col[vpan[1]], alpha = .2)\r\n+        p <- p + ggplot2::geom_pointrange(mapping = ggplot2::aes_string(y = "val", ymin = "ll", ymax = "ul"), fill = col[vpan[1]], alpha = .2)\r\n+    }\r\n+\r\n+    p <- p + ggplot2::geom_line(mapping = ggplot2::aes_string(colour = "courbe"), size = 1.5)\r\n+    p <- p + ggplot2::geom_point(mapping = ggplot2::aes_string(colour = "courbe"), size = 3)\r\n+    alph <- ifelse(!is.na(dgg$catPoint), 1, 0)\r\n+    p <- p + ggplot2::geom_point(mapping = ggplot2::aes_string(colour = "catPoint", alpha = alph), size = 2)\r\n+    p <- p + ggplot2::geom_text(data = tab_text_pent, mapping = ggplot2::aes_string("x", "y", label = "txt"), parse = FALSE, color = col[vpan[1]], fontface = 2, size = 4)\r\n+    ggplot2::ggsave(figname, p, width = 16, height = 15, units = "cm")\r\n+}\r\n+############################################################################################################ fin fonction graphique / end of function for graphical output\r\n+\r\n+################# Analysis\r\n+\r\n+for (sp in glmtable[, 1]) {\r\n+\r\n+    if (!all(is.na(glmtable[glmtable[, 1] == sp, 4:(length(glmtable) - 1)]))) { ##ignore lines with only NA\r\n+        ggplot_glm(glmtable = glmtable, datatable = datatable, unitobs = unitobs, metric = metric, sp = sp, description = TRUE, trend_on_graph = TRUE, assess_ic = assess_ic)\r\n+    }\r\n+}\r\n+\r\n+sink("stdout.txt", split = TRUE)\r\n'
b
diff -r 000000000000 -r 3ab852a7ff53 FunctPAMPAGalaxy.r
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/FunctPAMPAGalaxy.r Mon Nov 16 11:02:43 2020 +0000
[
b'@@ -0,0 +1,1625 @@\n+#Rscript\n+\n+\n+##################################################################################################################################\n+####################### PAMPA Galaxy tools functions : Calculate metrics, compute GLM and plot   #################################\n+##################################################################################################################################\n+\n+#### Based on Yves Reecht R script\n+#### Modified by Coline ROYAUX for integrating within Galaxy-E\n+\n+######################################### start of the function fact.def.f called by FunctExeCalcCommIndexesGalaxy.r and FunctExeCalcPresAbsGalaxy.r\n+####### Define the finest aggregation with the observation table\n+\n+fact_det_f <- function(obs,\n+                       size_class = "size.class",\n+                       code_species = "species.code",\n+                       unitobs = "observation.unit") {\n+    if (any(is.element(c(size_class), colnames(obs))) && all(! is.na(obs[, size_class]))) {\n+            factors <- c(unitobs, code_species, size_class)\n+        }else{\n+            factors <- c(unitobs, code_species)\n+        }\n+    return(factors)\n+}\n+\n+######################################### end of the function fact.def.f\n+\n+######################################### start of the function def_typeobs_f called by FunctExeCalcCommIndexesGalaxy.r and FunctExeCalcPresAbsGalaxy.r\n+####### Define observation type from colnames\n+\n+def_typeobs_f <- function(obs) {\n+    if (any(is.element(c("rotation", "rot", "rotate"), colnames(obs)))) {\n+        obs_type <- "SVR"\n+    }else{\n+        obs_type <- "other"\n+    }\n+    return(obs_type)\n+}\n+######################################### end of the function fact.def.f\n+\n+######################################### start of the function create_unitobs called by FunctExeCalcCommIndexesGalaxy.r and FunctExeCalcPresAbsGalaxy.r\n+####### Create unitobs column when inexistant\n+create_unitobs <- function(data, year = "year", location = "location", unitobs = "observation.unit") {\n+    if (is.element(paste(unitobs), colnames(data))) {\n+            unitab <- data\n+    }else{\n+\n+        unitab <- tidyr::unite(data, col = "observation.unit", c(year, location))\n+    }\n+    return(unitab)\n+}\n+######################################### start of the function create_unitobs\n+\n+######################################### start of the function create_year_location called by FunctExeCalcCommIndexesGalaxy.r and FunctExeCalcPresAbsGalaxy.r\n+####### separate unitobs column when existant\n+create_year_location <- function(data, year = "year", location = "location", unitobs = "observation.unit") {\n+    if (all(grepl("[1-2][0|8|9][0-9]{2}_.*", data[, unitobs])) == TRUE) {\n+        tab <- tidyr::separate(data, col = unitobs, into = c(year, location), sep = "_")\n+    }else{\n+        if (all(grepl("[A-Z]{2}[0-9]{2}.*", data[, unitobs]) == TRUE)) {\n+            tab <- tidyr::separate(data, col = unitobs, into = c("site1", year, "obs"), sep = c(2, 4))\n+            tab <- tidyr::unite(tab, col = location, c("site1", "obs"))\n+        }else{\n+            tab <- data\n+        }\n+    }\n+\n+    tab <- cbind(tab, observation.unit = data[, unitobs])\n+\n+    return(tab)\n+}\n+######################################### start of the function create_year_location\n+\n+######################################### start of the function check_file called by every Galaxy Rscripts\n+\n+check_file <- function(dataset, err_msg, vars, nb_vars) {\n+\n+    ## Purpose: General function to check integrity of input file. Will\n+    ##          check numbers and contents of variables(colnames).\n+    ##          return an error message and exit if mismatch detected\n+    ## ----------------------------------------------------------------------\n+    ## Arguments: dataset : dataset name\n+    ##            err_msg : output error\n+    ##            vars : expected name of variables\n+    ##            nb_vars : expected number of variables\n+    ## -'..b'---------------------------------\n+    ## Author: Yves Reecht, Date: 11 sept. 2012, 10:41 modified by Coline ROYAUX 04 june 2020\n+\n+    cat("\\n##################################################\\n",\n+        "Metrics and factors (and possible units/selections):\\n",\n+        sep = "", file = f_ile, append = TRUE)\n+\n+    ## metric info :\n+    cat("\\n Metrics:", metrique,\n+        "\\n", file = f_ile, append = TRUE)\n+\n+    ## Clustering factors :\n+    if (is.element(agreg_level, c("spCL_unitobs", "spCL_espece", "spSpecies", "spEspece",\n+                                 "spUnitobs", "spUnitobs(CL)"))) {\n+                                                                     type <- "spatialGraph"\n+                                                                 }\n+\n+    cat(switch(type,\n+               "graph" = "\\nGrouping factor(s): \\n * ",\n+               "stat" = "\\nAnalyses factor(s): \\n * ",\n+               "spatialGraph" = "\\nSpatial aggregation factor(s): \\n * "),\n+        paste(list_fact, collaspe = "\\n * "), "\\n", file = f_ile, append = TRUE)\n+\n+}\n+\n+######################################### end of the function print_selection_info_f\n+\n+\n+######################################### start of the function print_stats_f called by info_stats_f\n+\n+print_stats_f <- function(d_ata, metrique, list_fact, f_ile, headline = NULL) {\n+    ## Purpose: Write general statistics table\n+    ## ----------------------------------------------------------------------\n+    ## Arguments: d_ata : Analysis data\n+    ##            metrique : metric\'s name\n+    ##            list_fact : Factor\'s list\n+    ##            f_ile : Simple statistics file name\n+    ## ----------------------------------------------------------------------\n+    ## Author: Yves Reecht, Date: 11 sept. 2012, 10:09 modified by Coline ROYAUX 04 june 2020\n+\n+    ## Header :\n+    if (! is.null(headline)) {\n+        cat("\\n", rep("#", nchar(headline) + 3), "\\n",\n+            "## ", headline, "\\n",\n+            sep = "", file = f_ile, append = TRUE)\n+    }\n+\n+    cat("\\n########################\\nBase statistics:\\n\\n", file = f_ile, append = TRUE)\n+\n+    capture.output(print(summary_fr(d_ata[, metrique])), file = f_ile, append = TRUE)\n+\n+    if (! is.null(list_fact)) {\n+        cat("\\n#########################################",\n+            "\\nStatistics per combination of factor levels:\\n\\n", file = f_ile, sep = "", append = TRUE)\n+\n+        ## Compute summary for each existing factor\'s cross :\n+        res <- with(d_ata,\n+                    tapply(eval(parse(text = metrique)),\n+                           INDEX = do.call(paste,\n+                                         c(lapply(list_fact,\n+                                                  function(y)eval(parse(text = y))),\n+                                           sep = ".")),\n+                           FUN = summary_fr))\n+\n+        ## results in table\n+        capture.output(print(do.call(rbind, res)),\n+                       file = f_ile, append = TRUE)\n+    }\n+\n+    ## empty line :\n+    cat("\\n", file = f_ile, append = TRUE)\n+}\n+\n+######################################### end of the function print_stats_f\n+\n+\n+######################################### start of the function summary_fr called by print_stats_f\n+summary_fr <- function(object, digits = max(3, getOption("digits") - 3), ...) {\n+    ## Purpose: Adding SD and N to summary\n+    ## ----------------------------------------------------------------------\n+    ## Arguments: object : Object to summarise\n+    ## ----------------------------------------------------------------------\n+    ## Author: Yves Reecht, Date: 13 sept. 2012, 15:47 modified by Coline ROYAUX 04 june 2020\n+\n+    if (! is.numeric(object)) stop("Programming error")\n+\n+    ## Compute summary :\n+    res <- c(summary(object = object, digits, ...), "sd" = signif(sd(x = object), digits = digits), "N" = length(object))\n+\n+    return(res)\n+}\n+\n+######################################### start of the function summary_fr\n'
b
diff -r 000000000000 -r 3ab852a7ff53 PAMPA_PLOT_GLM.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/PAMPA_PLOT_GLM.xml Mon Nov 16 11:02:43 2020 +0000
[
@@ -0,0 +1,147 @@
+<tool id="pampa_plotglm" name="Create a plot from GLM data" version="@VERSION@">
+    <description>as temporal trend</description>
+    <macros>
+        <import>pampa_macros.xml</import>
+    </macros>
+    <expand macro="Plot_requirements"/>
+    <command detect_errors="exit_code"><![CDATA[
+        Rscript 
+         '$__tool_directory__/FunctExePlotGLMGalaxy.r' 
+         '$input'
+         '$datatable'
+         '$unitobstable'
+         '$__tool_directory__/FunctPAMPAGalaxy.r' 
+         '$report'
+         '$plots'
+    ]]>
+    </command>
+    <inputs>
+        <param name="input" type="data" format="tabular" label="Input glm results file" help=""/>
+        <param name="datatable" type="data" format="tabular" label="Data table used for glm" help=""/>
+        <param name="unitobstable" type="data" format="tabular" label="Unitobs table used for glm" help=""/>
+    </inputs>
+    <outputs>
+       <data name="report" from_work_dir="stdout.txt" label="Report" format="txt"/>
+       <collection type="list" name="plots">
+            <discover_datasets pattern="(?P&lt;designation&gt;.+)\.png" visible="false" format="png"/>
+       </collection>
+    </outputs>
+    <tests>
+        <test expect_num_outputs="2"> 
+            <param name="input" value="GLM_table_population_analysis_on_Presence_absence_sansszcl_cropped.tabular"/>
+            <param name="datatable" value="Presence_absence_table_sansszcl_cropped.tabular"/>
+            <param name="unitobstable" value="Unitobs.tabular"/>
+            <output name="report">
+                <assert_contents>
+                    <has_size value="0"/>
+                </assert_contents>
+            </output>
+            <output_collection name="plots"  type="list" count="3">
+                <element name="Abalstel" ftype="png">
+                    <assert_contents>
+                        <has_text text="PNG"/>
+                    </assert_contents>
+                </element>
+                <element name="Hemifasc" ftype="png">
+                    <assert_contents>
+                        <has_text text="PNG"/>
+                    </assert_contents>
+                </element>
+                <element name="Zebrscop" ftype="png">
+                    <assert_contents>
+                        <has_text text="PNG"/>
+                    </assert_contents>
+                </element>
+            </output_collection>
+        </test>
+    </tests>
+    <edam_topics>
+       <edam_topic>topic_0610</edam_topic>
+       <edam_topic>topic_3050</edam_topic>
+    </edam_topics>
+    <help><![CDATA[
+=============================================
+Create plot(s) from GLM results output
+=============================================
+
+**What it does**
+
+This tool from PAMPA toolsuite creates one or several png plots from GLM results table. 
+
+|
+
+**Input description**
+
+A tabular file with GLM results data. Must at least contain three columns + columns of GLM results : 
+
+- 'analysis' : representing the part of data used for each GLM computed. With "global" if GLM computed on the whole dataset or, if several GLM have been computed on several subsections of the dataset, the name of the level from the separation factor used to split the dataset.
+- 'Interest.var' : representing the metric selected as interest variable in the GLM(s).
+- 'distribution' : representing the probability distribution used for GLM(s).
+- At least estimates and p value for every year of the time series analysed. Formated as 'yyyy Estimate' and 'yyyy Pvalue'.
+
++----------+--------------+--------------+---------------+-------------+-----+       
+| analysis | Interest.var | distribution | 2020 Estimate | 2020 Pvalue | ... |            
++==========+==============+==============+===============+=============+=====+        
+|  global  |   metric1    |   gaussian   |   1.4533246   |    0.007    | ... |            
++----------+--------------+--------------+---------------+-------------+-----+        
+|   ...    |     ...      |      ...     |      ...      |     ...     | ... |       
++----------+--------------+--------------+---------------+-------------+-----+    
+
+The first input may be extracted from the 'Compute GLM on population data' or 'Compute GLM on community data' tools.  
+
+
+A tabular file with community data, the same used to compute the GLM in the 'Compute GLM' tools. Must at least contain three columns : 
+
+- 'observation.unit'
+
+- 'location'
+
+- At least the community metric used as interest variable in the GLM(s). 
+
++------------------+----------+---------+-----+
+| observation.unit | location | metric1 | ... |
++==================+==========+=========+=====+
+|   site_yearID    |locationID|    2    | ... |
++------------------+----------+---------+-----+
+|        ...       |    ...   |   ...   | ... |
++------------------+----------+---------+-----+
+
+The second input may be extracted from the 'Calculate community metrics' or 'Calculate presence absence table' tools.
+
+
+A tabular file with unitobs data which contains at least two or three columns depending on the case : 
+
+- 'observation.unit'
+
+- 'year' : formated as yyyy (example : 2020)
+
+- if the GLM is a community analysis with a separation factor : the separation factor used to split data
+
++------------------+--------+---------------------+-----+       
+| observation.unit |  year  |  separation_factor  | ... |            
++==================+========+=====================+=====+        
+|   site_yearID    |  2020  |          A          | ... |            
++------------------+--------+---------------------+-----+        
+|      ...         |  ...   |         ...         | ... |       
++------------------+--------+---------------------+-----+ 
+
+|
+
+**Output**
+
+Two outputs : 
+
+- A report file on the computation (can be blank).
+
+- A data collection containing plot(s) created by the tool.
+
+|
+
+**Source**
+
+Derived from PAMPA scripts (https://wwz.ifremer.fr/pampa/Meth.-Outils/Outils) written by Yves Reecht.
+
+  ]]></help>
+
+  <expand macro="pampa_bibref" />
+</tool>
b
diff -r 000000000000 -r 3ab852a7ff53 pampa_macros.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/pampa_macros.xml Mon Nov 16 11:02:43 2020 +0000
[
@@ -0,0 +1,89 @@
+<macros>
+    <token name="@VERSION@">0.0.2</token>
+    <xml name="Pampa_requirements">
+        <requirements>
+            <requirement type="package" version="1.0.2">r-tidyr</requirement>
+        </requirements>    
+    </xml>
+    <xml name="GLM_requirements">
+        <requirements>
+            <requirement type="package" version="1.2.2">r-gap</requirement>
+            <requirement type="package" version="1.0.1">r-glmmtmb</requirement>
+            <requirement type="package" version="1.4_13">r-multcomp</requirement>
+            <requirement type="package" version="0.3.3.0">r-dharma</requirement>
+        </requirements>    
+    </xml>
+    <xml name="Plot_requirements">
+        <requirements>
+            <requirement type="package" version="3.1.1">r-ggplot2</requirement>
+            <requirement type="package" version="1.3_25">r-boot</requirement>
+        </requirements>    
+    </xml>
+    <xml name="pampa_input_calculate">
+        <param name="input" type="data" format="tabular" label="Input file" help="Observation data file, with location, year, species and abundance."/>
+    </xml>
+    <xml name="pampa_advanced_params_select">
+        <param name="advanced" type="select" label="Specify advanced parameters">
+            <option value="simple" selected="true">No, use program defaults.</option>
+            <option value="advanced">Yes, see full parameter list.</option>
+        </param>        
+        <when value="simple">
+        </when>        
+    </xml>
+    <xml name="pampa_advanced_params_select_GLM">
+        <param name="advanced" type="select" label="Specify advanced parameters">
+            <option value="simple" selected="true">No, use program defaults.</option>
+            <option value="advanced">Yes, see full parameter list.</option>
+        </param>        
+        <when value="simple">
+        </when>        
+        <when value="advanced">
+            <param name="distrib" type="select" label="Distribution for model">
+                <option selected="true" value="None">Auto</option>
+                <option value="gaussian">Gaussian</option>
+                <option value="inverse.gaussian">Inverse Gaussian</option>
+                <option value="poisson">Poisson</option>
+                <option value="quasipoisson">Quasi-Poisson</option>
+                <option value="binomial">Binomial</option>
+                <option value="quasibinomial">Quasi-Binomial</option>
+                <option value="Gamma">Gamma</option>
+            </param>
+            <param name="rdata" type="boolean" checked="yes" label="GLM object(s) as .Rdata output ?"/>
+        </when>
+    </xml>
+    <xml name="pampa_input_GLM">
+        <param name="input_metric" type="data" format="tabular" label="Input metrics file" help="Metrics data file, with location, year, and metrics informations that can be used as interest variable."/>
+        <param name="input_unitobs" type="data" format="tabular" label="Unitobs informations file" help="Unitobs file, with all informations available about unitobs."/>
+        <param name="varint" type="data_column" data_ref="input_metric" label="Interest variable from metrics file" help= "Choose the field of the interest variable."/>
+    </xml>
+    <xml name="pampa_var_GLM">
+        <param name="varrep" type="select" label="Response variables" help= "Choose the response variables you want to include in your analysis." multiple="true">
+            <option selected="true" value="year">Year</option>
+            <option selected="true" value="site">Site</option>
+            <option selected="true" value="habitat">Habitat</option>
+        </param>
+        <param name="varrand" type="select" label="Random effect ?" help="Allocate a random effect on site or year makes your model more reliable as random events on a peculiar site or year can affect populations, it takes account of pseudoreplication. However, avoid applying it on a less than 10 levels variable (less than 10 different sites and/or year)." multiple="true">
+            <option value="year">Year</option>
+            <option selected="true" value="site">Site</option>
+        </param>
+    </xml>
+    <xml name="pampa_output_GLM">
+        <data name="output_recap" from_work_dir="GLMSummaryFull.txt" format="txt" label="Simple statistics on chosen variables on ${on_string}"/>
+        <data name="output_rate" from_work_dir="RatingGLM.txt" format="txt" label="Your analysis rating file on ${on_string}"/>
+        <collection type="list" name="output_GLM">
+            <discover_datasets pattern="(?P&lt;designation&gt;.+)\.Rdata" visible="false" format="Rdata"/>
+            <filter> settings['advanced'] == 'advanced' and settings['rdata']</filter>
+        </collection>
+    </xml>
+    <xml name="pampa_bibref">
+        <citations>
+            <citation type="bibtex">
+     @unpublished{pampayves,
+     title={ PAMPA "ressources et biodiversité" scripts },
+            author={Yves Reecht},
+            url={https://wwz.ifremer.fr/pampa/Meth.-Outils/Outils}
+            }
+            </citation>
+        </citations>
+    </xml>
+</macros>
b
diff -r 000000000000 -r 3ab852a7ff53 test-data/GLM_table_population_analysis_on_Presence_absence_sansszcl_cropped.tabular
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/GLM_table_population_analysis_on_Presence_absence_sansszcl_cropped.tabular Mon Nov 16 11:02:43 2020 +0000
b
@@ -0,0 +1,4 @@
+"analysis" "Interest.var" "distribution" "AIC" "BIC" "logLik" "deviance" "df.resid" "site Std.Dev" "site NbObservation" "site NbLevels" "(Intercept) Estimate" "(Intercept) Std.Err" "(Intercept) Zvalue" "(Intercept) Pvalue" "(Intercept) IC_up" "(Intercept) IC_inf" "(Intercept) signif" "year Estimate" "year Std.Err" "year Zvalue" "year Pvalue" "year IC_up" "year IC_inf" "year signif" "2007 Estimate" "2007 Std.Err" "2007 Zvalue" "2007 Pvalue" "2007 IC_up" "2007 IC_inf" "2007 signif" "2008 Estimate" "2008 Std.Err" "2008 Zvalue" "2008 Pvalue" "2008 IC_up" "2008 IC_inf" "2008 signif" "2009 Estimate" "2009 Std.Err" "2009 Zvalue" "2009 Pvalue" "2009 IC_up" "2009 IC_inf" "2009 signif" "2010 Estimate" "2010 Std.Err" "2010 Zvalue" "2010 Pvalue" "2010 IC_up" "2010 IC_inf" "2010 signif" "2012 Estimate" "2012 Std.Err" "2012 Zvalue" "2012 Pvalue" "2012 IC_up" "2012 IC_inf" "2012 signif" "2013 Estimate" "2013 Std.Err" "2013 Zvalue" "2013 Pvalue" "2013 IC_up" "2013 IC_inf" "2013 signif" "2014 Estimate" "2014 Std.Err" "2014 Zvalue" "2014 Pvalue" "2014 IC_up" "2014 IC_inf" "2014 signif" "2015 Estimate" "2015 Std.Err" "2015 Zvalue" "2015 Pvalue" "2015 IC_up" "2015 IC_inf" "2015 signif" "2017 Estimate" "2017 Std.Err" "2017 Zvalue" "2017 Pvalue" "2017 IC_up" "2017 IC_inf" "2017 signif" "Algueraie Estimate" "Algueraie Std.Err" "Algueraie Zvalue" "Algueraie Pvalue" "Algueraie IC_up" "Algueraie IC_inf" "Algueraie signif" "Corail vivant Estimate" "Corail vivant Std.Err" "Corail vivant Zvalue" "Corail vivant Pvalue" "Corail vivant IC_up" "Corail vivant IC_inf" "Corail vivant signif" "Detritique Estimate" "Detritique Std.Err" "Detritique Zvalue" "Detritique Pvalue" "Detritique IC_up" "Detritique IC_inf" "Detritique signif" "Fond lagonaire Estimate" "Fond lagonaire Std.Err" "Fond lagonaire Zvalue" "Fond lagonaire Pvalue" "Fond lagonaire IC_up" "Fond lagonaire IC_inf" "Fond lagonaire signif" "Herbier Estimate" "Herbier Std.Err" "Herbier Zvalue" "Herbier Pvalue" "Herbier IC_up" "Herbier IC_inf" "Herbier signif"
+"Abalstel" "number" "gaussian" 465.778668402852 530.012669606292 -217.889334201426 435.778668402852 520 2.02893200110294e-11 535 87 0.582003897784078 0.16995917980052 3.42437459669534 0.000616216168469682 NA NA "yes" 0.00992836047436523 0.00862832391722565 1.15067081041593 0.249867689448308 NA NA "no" NA NA NA NA NA NA NA -0.19415426356584 0.145972631275553 -1.33007305458058 0.183494202488272 0.0919468364627885 -0.480255363594468 "no" 0.00824541649995591 0.132249306065064 0.0623475218531531 0.950286085093627 0.267449293367896 -0.250958460367984 "no" -0.0469231466299359 0.127874642775125 -0.366946453273407 0.713658960013819 0.203706547745233 -0.297552841005105 "no" -0.026333156943764 0.127546916274464 -0.206458593535093 0.83643270551623 0.223654205293331 -0.276320519180859 "no" 0.0449902599405432 0.123577649181079 0.364064701332996 0.715809694931448 0.287198001629583 -0.197217481748497 "no" -0.00566671318079257 0.12968331601722 -0.0436965475191898 0.965146291270581 0.248507915608685 -0.25984134197027 "no" -0.00315955678300799 0.134390106623576 -0.023510337646043 0.981243192515925 0.260240212077698 -0.266559325643714 "no" -0.0211838550997583 0.134469226544777 -0.157536825666981 0.874821787532576 0.242370985956962 -0.284738696156479 "no" NA NA NA NA NA NA NA -0.584431910188132 0.17913769577747 -3.26247308056328 0.00110444661730468 -0.233328478190797 -0.935535342185467 "yes" -0.555457917136758 0.181703900796363 -3.05693997048123 0.00223609052438647 -0.199324815725448 -0.911591018548068 "yes" -0.533422320342636 0.181778685227503 -2.9344602183421 0.00334128381555499 -0.177142644139688 -0.889701996545584 "yes" 2.60899691274078 0.221452905612334 11.7812719843377 4.87517680861174e-32 3.04303663201271 2.17495719346886 "yes"
+"Hemifasc" "number" "gaussian" 989.708308026567 1053.94230923001 -479.854154013284 959.708308026567 520 0.0731913677511507 535 87 0.80188975303788 0.301651463759325 2.65833204667515 0.00785284807116327 NA NA "yes" 0.107783893220846 0.0227668717427192 4.73424256256526 2.19874649708671e-06 NA NA "yes" NA NA NA NA NA NA NA 0.481141192254312 0.272853104782075 1.76337078018076 0.0778379746547175 1.01592345069711 -0.0536410661884893 "no" 0.491975244697431 0.258717316966712 1.9015937953652 0.0572242797228078 0.999051868129021 -0.0151013787341585 "no" 0.52417509191558 0.257940994484472 2.03215116295574 0.0421383552019658 1.02973015124159 0.0186200325895696 "yes" 0.704061126955671 0.258153165214832 2.72729999792859 0.00638549547621618 1.21003203327176 0.198090220639581 "yes" 0.922884191406201 0.242885260944276 3.79967144905484 0.000144888046528251 1.39893055523259 0.446837827579807 "yes" 1.07227573954628 0.268950382217829 3.98689055841469 6.69448864477017e-05 1.59940880232151 0.545142676771058 "yes" 1.20570832792662 0.291950452161748 4.12983887847734 3.63017553679052e-05 1.77792069943383 0.633495956419416 "yes" 0.952662560597608 0.276776209505792 3.44199583590898 0.000577439138478601 1.49513396300647 0.410191158188743 "yes" NA NA NA NA NA NA NA -1.4622104258899 0.300994684364961 -4.85792773707906 1.18620683066582e-06 -0.872271684996577 -2.05214916678323 "yes" -1.44397094980884 0.305397744683802 -4.72816507307175 2.26557963478985e-06 -0.845402369268825 -2.04253953034885 "yes" -1.45728966857269 0.302234347092491 -4.82172090165093 1.42324990478013e-06 -0.864921233380426 -2.04965810376495 "yes" -1.34910839377147 0.366744594037812 -3.67860471757186 0.000234513401805964 -0.630302197932598 -2.06791458961035 "yes"
+"Zebrscop" "number" "gaussian" 2937.50168275753 3001.73568396097 -1453.75084137876 2907.50168275753 520 6.86847494946857 535 87 -0.783376806033906 1.96843225335046 -0.397969909658067 0.690652366321943 NA NA "no" 0.425673771504629 0.178356213176719 2.38664952525574 0.0170026915984915 NA NA "yes" NA NA NA NA NA NA NA -2.46263154439423 1.71419485921636 -1.43661120621959 0.150828497639506 0.897128642153544 -5.822391730942 "no" -2.81277062425383 1.65194192826306 -1.70270551048445 0.0886231931264859 0.424976059693421 -6.05051730820109 "no" -2.24200293533928 1.6471883066992 -1.36110906459264 0.173479225491309 0.986426821546673 -5.47043269222523 "no" 1.92420443459089 1.66604387989188 1.15495423488832 0.248109168047627 5.18959043584236 -1.34118156666057 "no" 5.03567066902903 1.4881081746922 3.38394127165561 0.00071453285120286 7.95230909652538 2.11903224153268 "yes" 2.56255810319688 1.81706438444276 1.41027369483263 0.158458882708268 6.12393885429513 -0.99882264790138 "no" 0.73344942166209 1.94553641122863 0.37699084809156 0.706180406176162 4.5466307182815 -3.07973187495732 "no" 0.419840113473674 1.90401994599711 0.220501951335289 0.825480252830466 4.15165063347391 -3.31197040652656 "no" NA NA NA NA NA NA NA 1.33928270409068 1.87987517063075 0.712431721538894 0.47619747813314 5.02377033395804 -2.34520492577667 "no" 0.437923054943406 1.89963982379853 0.230529519047318 0.817680328217623 4.16114869318654 -3.28530258329972 "no" 0.52253919562426 1.87614268249488 0.278517833691301 0.780614877108231 4.19971128317258 -3.15463289192406 "no" -1.7132623404351 2.24757733331173 -0.762270697004523 0.445898459177794 2.69190828532447 -6.11843296619467 "no"
b
diff -r 000000000000 -r 3ab852a7ff53 test-data/Presence_absence_table_sansszcl_cropped.tabular
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/Presence_absence_table_sansszcl_cropped.tabular Mon Nov 16 11:02:43 2020 +0000
b
b'@@ -0,0 +1,2134 @@\n+"location"\t"year"\t"species.code"\t"number"\t"number.max"\t"number.sd"\t"presence_absence"\t"observation.unit"\n+"AB_0008"\t"08"\t"Abalstel"\t0\t0\t0\t0\t"AB080008"\n+"AB_0015"\t"08"\t"Abalstel"\t0\t0\t0\t0\t"AB080015"\n+"AB_0027"\t"08"\t"Abalstel"\t0\t0\t0\t0\t"AB080027"\n+"AB_0031"\t"08"\t"Abalstel"\t0\t0\t0\t0\t"AB080031"\n+"AB_0037"\t"08"\t"Abalstel"\t0\t0\tNA\t0\t"AB080037"\n+"AB_0042"\t"08"\t"Abalstel"\t0\t0\tNA\t0\t"AB080042"\n+"AB_0057"\t"08"\t"Abalstel"\t0\t0\t0\t0\t"AB080057"\n+"AB_0076"\t"09"\t"Abalstel"\t0\t0\t0\t0\t"AB090076"\n+"AB_0081"\t"09"\t"Abalstel"\t0\t0\t0\t0\t"AB090081"\n+"AB_0095"\t"09"\t"Abalstel"\t0\t0\t0\t0\t"AB090095"\n+"AB_0097"\t"09"\t"Abalstel"\t0\t0\t0\t0\t"AB090097"\n+"AB_0098"\t"09"\t"Abalstel"\t0\t0\tNA\t0\t"AB090098"\n+"AB_0104"\t"09"\t"Abalstel"\t0\t0\t0\t0\t"AB090104"\n+"AB_0105"\t"09"\t"Abalstel"\t0\t0\t0\t0\t"AB090105"\n+"AB_0106"\t"09"\t"Abalstel"\t0\t0\tNA\t0\t"AB090106"\n+"AB_0120"\t"09"\t"Abalstel"\t0\t0\tNA\t0\t"AB090120"\n+"AB_0121"\t"09"\t"Abalstel"\t0\t0\t0\t0\t"AB090121"\n+"AB_0122"\t"09"\t"Abalstel"\t0\t0\t0\t0\t"AB090122"\n+"AB_0123"\t"09"\t"Abalstel"\t0\t0\t0\t0\t"AB090123"\n+"AB_0124"\t"09"\t"Abalstel"\t0\t0\tNA\t0\t"AB090124"\n+"AB_0125"\t"09"\t"Abalstel"\t0\t0\t0\t0\t"AB090125"\n+"AB_0126"\t"09"\t"Abalstel"\t0\t0\t0\t0\t"AB090126"\n+"AB_0127"\t"09"\t"Abalstel"\t0\t0\t0\t0\t"AB090127"\n+"AB_0132"\t"09"\t"Abalstel"\t0\t0\tNA\t0\t"AB090132"\n+"AB_0133"\t"09"\t"Abalstel"\t0\t0\t0\t0\t"AB090133"\n+"AB_0134"\t"09"\t"Abalstel"\t0\t0\t0\t0\t"AB090134"\n+"AB_0135"\t"09"\t"Abalstel"\t0\t0\t0\t0\t"AB090135"\n+"AB_0143"\t"09"\t"Abalstel"\t0\t0\tNA\t0\t"AB090143"\n+"AB_0148"\t"09"\t"Abalstel"\t0\t0\tNA\t0\t"AB090148"\n+"AB_0149"\t"09"\t"Abalstel"\t0\t0\t0\t0\t"AB090149"\n+"AB_0151"\t"09"\t"Abalstel"\t0\t0\t0\t0\t"AB090151"\n+"AB_0601"\t"09"\t"Abalstel"\t0\t0\t0\t0\t"AB090601"\n+"AB_0602"\t"09"\t"Abalstel"\t0\t0\t0\t0\t"AB090602"\n+"AB_0603"\t"09"\t"Abalstel"\t0\t0\tNA\t0\t"AB090603"\n+"AB_0001"\t"10"\t"Abalstel"\t0\t0\tNA\t0\t"AB100001"\n+"AB_0002"\t"10"\t"Abalstel"\t0\t0\t0\t0\t"AB100002"\n+"AB_0006"\t"10"\t"Abalstel"\t0\t0\t0\t0\t"AB100006"\n+"AB_0008"\t"10"\t"Abalstel"\t0\t0\t0\t0\t"AB100008"\n+"AB_0009"\t"10"\t"Abalstel"\t0\t0\t0\t0\t"AB100009"\n+"AB_0010"\t"10"\t"Abalstel"\t0\t0\t0\t0\t"AB100010"\n+"AB_0011"\t"10"\t"Abalstel"\t0\t0\t0\t0\t"AB100011"\n+"AB_0015"\t"10"\t"Abalstel"\t0\t0\t0\t0\t"AB100015"\n+"AB_0017"\t"10"\t"Abalstel"\t0\t0\t0\t0\t"AB100017"\n+"AB_0019"\t"10"\t"Abalstel"\t0\t0\t0\t0\t"AB100019"\n+"AB_0020"\t"10"\t"Abalstel"\t0\t0\t0\t0\t"AB100020"\n+"AB_0021"\t"10"\t"Abalstel"\t0\t0\t0\t0\t"AB100021"\n+"AB_0023"\t"10"\t"Abalstel"\t0\t0\t0\t0\t"AB100023"\n+"AB_0024"\t"10"\t"Abalstel"\t0\t0\t0\t0\t"AB100024"\n+"AB_0025"\t"10"\t"Abalstel"\t0\t0\t0\t0\t"AB100025"\n+"AB_0028"\t"10"\t"Abalstel"\t0\t0\t0\t0\t"AB100028"\n+"AB_0029"\t"10"\t"Abalstel"\t0\t0\t0\t0\t"AB100029"\n+"AB_0031"\t"10"\t"Abalstel"\t0\t0\t0\t0\t"AB100031"\n+"AB_0035"\t"10"\t"Abalstel"\t0\t0\tNA\t0\t"AB100035"\n+"AB_0036"\t"10"\t"Abalstel"\t0\t0\t0\t0\t"AB100036"\n+"AB_0038"\t"10"\t"Abalstel"\t0\t0\t0\t0\t"AB100038"\n+"AB_0042"\t"10"\t"Abalstel"\t0\t0\t0\t0\t"AB100042"\n+"AB_0046"\t"10"\t"Abalstel"\t0\t0\t0\t0\t"AB100046"\n+"AB_0047"\t"10"\t"Abalstel"\t0\t0\t0\t0\t"AB100047"\n+"AB_0048"\t"10"\t"Abalstel"\t0\t0\t0\t0\t"AB100048"\n+"AB_0049"\t"10"\t"Abalstel"\t0\t0\t0\t0\t"AB100049"\n+"AB_0052"\t"10"\t"Abalstel"\t0\t0\t0\t0\t"AB100052"\n+"AB_0055"\t"10"\t"Abalstel"\t0\t0\tNA\t0\t"AB100055"\n+"AB_0060"\t"10"\t"Abalstel"\t0\t0\t0\t0\t"AB100060"\n+"AB_0061"\t"10"\t"Abalstel"\t0\t0\t0\t0\t"AB100061"\n+"AB_0062"\t"10"\t"Abalstel"\t0\t0\t0\t0\t"AB100062"\n+"AB_0072"\t"10"\t"Abalstel"\t0\t0\tNA\t0\t"AB100072"\n+"AB_0077"\t"10"\t"Abalstel"\t0\t0\tNA\t0\t"AB100077"\n+"AB_0078"\t"10"\t"Abalstel"\t0\t0\tNA\t0\t"AB100078"\n+"AB_0079"\t"10"\t"Abalstel"\t0\t0\t0\t0\t"AB100079"\n+"AB_0081"\t"10"\t"Abalstel"\t0\t0\t0\t0\t"AB100081"\n+"AB_0082"\t"10"\t"Abalstel"\t0\t0\tNA\t0\t"AB100082"\n+"AB_0085"\t"10"\t"Abalstel"\t0\t0\t0\t0\t"AB100085"\n+"AB_0086"\t"10"\t"Abalstel"\t0\t0\t0\t0\t"AB100086"\n+"AB_0087"\t"10"\t"Abalstel"\t0\t0\t0\t0\t"AB100087"\n+"AB_0088"\t"10"\t"Abalstel"\t0\t0\t0\t0\t"AB100088"\n+"AB_0089"\t"10"\t"Abalstel"\t0\t0\tNA\t0\t"AB100089"\n+"AB_0090"\t"10"\t"Abalstel"\t0\t0\t0\t0\t"AB100090"\n+"AB_0091"\t"10"\t"Abalstel"\t0\t0\t0\t0\t"AB100091"\n+"AB_0092"\t"10"\t"Abalstel"\t0\t0\t0\t0\t"AB100092"\n+"AB_0093"\t"10"\t"Abalstel"\t0\t0\t0\t0\t"AB100093"\n+"AB_0094"\t"10"\t"Abalstel"\t0\t0\t0\t0\t"AB100094"\n+"AB_0095"\t"10"\t"Abalstel"\t0\t0\tNA\t0\t"AB100095"\n+"AB_0096"\t"10"\t"Abalstel"\t0\t0\t0\t0\t"AB100096"\n+"AB_0097"\t"10"\t"Abalstel"\t0\t0\t0\t0\t"A'..b'"PA_0044"\t"17"\t"Zebrscop"\t1\t1\tNA\t1\t"PA170044"\n+"PA_0050"\t"17"\t"Zebrscop"\t1\t2\t1\t1\t"PA170050"\n+"PA_0051"\t"17"\t"Zebrscop"\t0.5\t1\t0.707106781186548\t1\t"PA170051"\n+"PA_0054"\t"17"\t"Zebrscop"\t0\t0\tNA\t0\t"PA170054"\n+"PA_0055"\t"17"\t"Zebrscop"\t1\t1\tNA\t1\t"PA170055"\n+"PA_0056"\t"17"\t"Zebrscop"\t4\t5\t1.73205080756888\t1\t"PA170056"\n+"PA_0057"\t"17"\t"Zebrscop"\t9.66666666666667\t17\t6.35085296108588\t1\t"PA170057"\n+"PA_0058"\t"17"\t"Zebrscop"\t18\t25\t6.08276253029822\t1\t"PA170058"\n+"PA_0059"\t"17"\t"Zebrscop"\t0\t0\tNA\t0\t"PA170059"\n+"PA_0060"\t"17"\t"Zebrscop"\t5.33333333333333\t8\t2.51661147842358\t1\t"PA170060"\n+"PA_0066"\t"17"\t"Zebrscop"\t2\t2\tNA\t1\t"PA170066"\n+"PA_0068"\t"17"\t"Zebrscop"\t1\t1\t0\t1\t"PA170068"\n+"PA_0074"\t"17"\t"Zebrscop"\t0\t0\tNA\t0\t"PA170074"\n+"PA_0079"\t"17"\t"Zebrscop"\t1\t1\tNA\t1\t"PA170079"\n+"PA_0080"\t"17"\t"Zebrscop"\t5.66666666666667\t7\t1.52752523165195\t1\t"PA170080"\n+"PA_0081"\t"17"\t"Zebrscop"\t2.5\t4\t2.12132034355964\t1\t"PA170081"\n+"PA_0083"\t"17"\t"Zebrscop"\t1\t1\tNA\t1\t"PA170083"\n+"PA_0084"\t"17"\t"Zebrscop"\t2.33333333333333\t3\t1.15470053837925\t1\t"PA170084"\n+"PA_0088"\t"17"\t"Zebrscop"\t1.5\t2\t0.707106781186548\t1\t"PA170088"\n+"PA_0091"\t"17"\t"Zebrscop"\t1.33333333333333\t2\t0.577350269189626\t1\t"PA170091"\n+"PA_0093"\t"17"\t"Zebrscop"\t1\t1\t0\t1\t"PA170093"\n+"PA_0094"\t"17"\t"Zebrscop"\t3\t3\tNA\t1\t"PA170094"\n+"PA_0100"\t"17"\t"Zebrscop"\t0\t0\tNA\t0\t"PA170100"\n+"PE_0007"\t"14"\t"Zebrscop"\t1\t1\t0\t1\t"PE140007"\n+"PE_0025"\t"14"\t"Zebrscop"\t0\t0\tNA\t0\t"PE140025"\n+"PE_0029"\t"14"\t"Zebrscop"\t0\t0\tNA\t0\t"PE140029"\n+"PE_0031"\t"14"\t"Zebrscop"\t1\t1\t0\t1\t"PE140031"\n+"PE_0033"\t"14"\t"Zebrscop"\t0\t0\t0\t0\t"PE140033"\n+"PE_0035"\t"14"\t"Zebrscop"\t2.33333333333333\t3\t1.15470053837925\t1\t"PE140035"\n+"PO_0001"\t"12"\t"Zebrscop"\t1\t1\tNA\t1\t"PO120001"\n+"PO_0004"\t"12"\t"Zebrscop"\t1.5\t2\t0.707106781186548\t1\t"PO120004"\n+"PO_0007"\t"12"\t"Zebrscop"\t2\t3\t1\t1\t"PO120007"\n+"PO_0018"\t"12"\t"Zebrscop"\t1\t1\tNA\t1\t"PO120018"\n+"PO_0028"\t"12"\t"Zebrscop"\t2\t3\t1.4142135623731\t1\t"PO120028"\n+"PO_0045"\t"12"\t"Zebrscop"\t2.33333333333333\t3\t0.577350269189626\t1\t"PO120045"\n+"PO_0048"\t"12"\t"Zebrscop"\t1\t1\tNA\t1\t"PO120048"\n+"PO_0053"\t"12"\t"Zebrscop"\t1\t1\t0\t1\t"PO120053"\n+"PO_0066"\t"12"\t"Zebrscop"\t1\t1\t0\t1\t"PO120066"\n+"PO_0092"\t"12"\t"Zebrscop"\t6.16666666666667\t8.5\t2.25462487641145\t1\t"PO120092"\n+"PO_0094"\t"12"\t"Zebrscop"\t1\t1\t0\t1\t"PO120094"\n+"PO_0096"\t"12"\t"Zebrscop"\t2\t3\t1\t1\t"PO120096"\n+"PO_0121"\t"12"\t"Zebrscop"\t5\t6\t1.4142135623731\t1\t"PO120121"\n+"PO_0134"\t"12"\t"Zebrscop"\t0\t0\tNA\t0\t"PO120134"\n+"PO_0136"\t"12"\t"Zebrscop"\t1\t1\tNA\t1\t"PO120136"\n+"PO_0200"\t"12"\t"Zebrscop"\t2\t2\tNA\t1\t"PO120200"\n+"PO_0203"\t"12"\t"Zebrscop"\t3.6\t4\t0.565685424949238\t1\t"PO120203"\n+"PO_0205"\t"12"\t"Zebrscop"\t1\t1\tNA\t1\t"PO120205"\n+"PO_0206"\t"12"\t"Zebrscop"\t1.33333333333333\t2\t0.577350269189626\t1\t"PO120206"\n+"PO_0233"\t"12"\t"Zebrscop"\t2\t2\tNA\t1\t"PO120233"\n+"RD_0219"\t"07"\t"Zebrscop"\t0\t0\t0\t0\t"RD070219"\n+"RD_0230"\t"07"\t"Zebrscop"\t0\t0\tNA\t0\t"RD070230"\n+"RD_0031"\t"08"\t"Zebrscop"\t0\t0\tNA\t0\t"RD080031"\n+"RD_0103"\t"09"\t"Zebrscop"\t0\t0\tNA\t0\t"RD090103"\n+"RD_0105"\t"09"\t"Zebrscop"\t0\t0\tNA\t0\t"RD090105"\n+"RD_0108"\t"09"\t"Zebrscop"\t0\t0\tNA\t0\t"RD090108"\n+"RD_0109"\t"09"\t"Zebrscop"\t0\t0\tNA\t0\t"RD090109"\n+"RD_0107"\t"10"\t"Zebrscop"\t0\t0\tNA\t0\t"RD100107"\n+"RL_0250"\t"07"\t"Zebrscop"\t1\t1\tNA\t1\t"RL070250"\n+"RL_0145"\t"08"\t"Zebrscop"\t1\t1\t0\t1\t"RL080145"\n+"RL_0078"\t"09"\t"Zebrscop"\t1.33333333333333\t2\t0.577350269189626\t1\t"RL090078"\n+"RL_0089"\t"09"\t"Zebrscop"\t2\t2\t0\t1\t"RL090089"\n+"RL_0093"\t"09"\t"Zebrscop"\t1\t1\t0\t1\t"RL090093"\n+"RL_0066"\t"10"\t"Zebrscop"\t1\t1\tNA\t1\t"RL100066"\n+"RL_0076"\t"10"\t"Zebrscop"\t1.33333333333333\t2\t0.577350269189626\t1\t"RL100076"\n+"RS_0169"\t"07"\t"Zebrscop"\t2.33333333333333\t3\t0.577350269189626\t1\t"RS070169"\n+"RS_0189"\t"07"\t"Zebrscop"\t1\t1\t0\t1\t"RS070189"\n+"SI_0078"\t"07"\t"Zebrscop"\t1\t1\tNA\t1\t"SI070078"\n+"SI_0079"\t"07"\t"Zebrscop"\t8.33333333333333\t12\t4.04145188432738\t1\t"SI070079"\n+"SI_0080"\t"07"\t"Zebrscop"\t2\t3\t1.4142135623731\t1\t"SI070080"\n+"SI_0082"\t"07"\t"Zebrscop"\t0\t0\tNA\t0\t"SI070082"\n+"SI_0197"\t"07"\t"Zebrscop"\t0\t0\tNA\t0\t"SI070197"\n+"SI_0222"\t"07"\t"Zebrscop"\t0\t0\tNA\t0\t"SI070222"\n+"SI_0194"\t"08"\t"Zebrscop"\t0\t0\t0\t0\t"SI080194"\n+"WA_0002"\t"14"\t"Zebrscop"\t1\t1\t0\t1\t"WA140002"\n'
b
diff -r 000000000000 -r 3ab852a7ff53 test-data/Unitobs.tabular
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/Unitobs.tabular Mon Nov 16 11:02:43 2020 +0000
b
b'@@ -0,0 +1,2862 @@\n+"AMP"\t"observation.unit"\t"type"\t"site"\t"station"\t"carac1"\t"carac2"\t"fraction"\t"jour"\t"mois"\t"year"\t"heure"\t"nebulosite"\t"dirVent"\t"forceVent"\t"etatMer"\t"courant"\t"maree"\t"lune"\t"latitude"\t"longitude"\t"statut_protection"\t"avant_apres"\t"biotop1"\t"biotop2"\t"habitat"\t"habitat2"\t"habitat3"\t"visibilite"\t"prof_min"\t"prof_max"\t"DimObs1"\t"DimObs2"\t"nb_observateur"\t"observateur"\n+"AMP"\t"AB080001"\t"SVR"\t"Abore"\tNA\tNA\tNA\t1\t10\t7\t2008\tNA\tNA\tNA\t3\t-999\tNA\t"MM"\t"PQ"\t-22.43877\t166.34874\t"RE"\t"AP"\t"Complexe de recif barriere externe"\t"terrasse peu profonde"\t"Fond lagonaire"\t"Recif barriere interne"\t"SA1"\t6\t4.2\t-999\t-999\t-999\t-999\t"Delphine Mallet"\n+"AMP"\t"AB080002"\t"SVR"\t"Abore"\tNA\tNA\tNA\t1\t10\t7\t2008\tNA\tNA\tNA\t3\t-999\tNA\t"MM"\t"PQ"\t-22.43975\t166.35523\t"RE"\t"AP"\t"Complexe de recif barriere externe"\t"terrasse peu profonde"\t"Fond lagonaire"\t"Recif barriere interne"\t"SA1"\t6\t2.2\t-999\t-999\t-999\t-999\t"Delphine Mallet"\n+"AMP"\t"AB080003"\t"SVR"\t"Abore"\tNA\tNA\tNA\t1\t10\t7\t2008\tNA\tNA\tNA\t2\t-999\tNA\t"MM"\t"PQ"\t-22.4474\t166.36406\t"RE"\t"AP"\t"Complexe de recif barriere externe"\t"terrasse peu profonde"\t"Fond lagonaire"\t"Recif barriere interne"\t"SA1"\t8\t2.2\t-999\t-999\t-999\t-999\t"Delphine Mallet"\n+"AMP"\t"AB080004"\t"SVR"\t"Abore"\tNA\tNA\tNA\t1\t10\t7\t2008\tNA\tNA\tNA\t2\t-999\tNA\t"MM"\t"PQ"\t-22.44773\t166.36715\t"RE"\t"AP"\t"Complexe de recif barriere externe"\t"terrasse peu profonde"\t"Herbier"\t"Recif barriere interne"\t"SG1"\t8\t2.7\t-999\t-999\t-999\t-999\t"Delphine Mallet"\n+"AMP"\t"AB080005"\t"SVR"\t"Abore"\tNA\tNA\tNA\t1\t10\t7\t2008\tNA\tNA\tNA\t3\t-999\tNA\t"MM"\t"PQ"\t-22.45701\t166.37434\t"RE"\t"AP"\t"Complexe de recif barriere externe"\t"terrasse peu profonde"\t"Fond lagonaire"\t"Recif barriere interne"\tNA\t7\t4.1\t-999\t-999\t-999\t-999\t"Delphine Mallet"\n+"AMP"\t"AB080006"\t"SVR"\t"Abore"\tNA\tNA\tNA\t1\t10\t7\t2008\tNA\tNA\tNA\t3\t-999\tNA\t"MM"\t"PQ"\t-22.45893\t166.3782\t"RE"\t"AP"\t"Complexe de recif barriere externe"\t"terrasse peu profonde"\t"Fond lagonaire"\t"Recif barriere interne"\t"SA1"\t10\t1.8\t-999\t-999\t-999\t-999\t"Delphine Mallet"\n+"AMP"\t"AB080007"\t"SVR"\t"Abore"\tNA\tNA\tNA\t1\t10\t7\t2008\tNA\tNA\t"0"\t0\t-999\tNA\t"MM"\t"PQ"\t-22.46091\t166.37847\t"RE"\t"AP"\t"Complexe de recif barriere externe"\t"terrasse peu profonde"\t"Fond lagonaire"\t"Recif barriere interne"\t"SA1"\t7\t1.6\t-999\t-999\t-999\t-999\t"Delphine Mallet"\n+"AMP"\t"AB080008"\t"SVR"\t"Abore"\tNA\tNA\tNA\t1\t10\t7\t2008\tNA\tNA\t"0"\t0\t-999\tNA\t"MM"\t"PQ"\t-22.46931\t166.38774\t"RE"\t"AP"\t"Complexe de recif barriere externe"\t"terrasse peu profonde"\t"Corail vivant"\t"Recif barriere interne"\t"LC3"\t8\t2.3\t-999\t-999\t-999\t-999\t"Delphine Mallet"\n+"AMP"\t"AB080009"\t"SVR"\t"Abore"\tNA\tNA\tNA\t1\t10\t7\t2008\tNA\tNA\t"0"\t0\t-999\tNA\t"MM"\t"PQ"\t-22.47137\t166.39462\t"RE"\t"AP"\t"Complexe de recif barriere externe"\t"terrasse peu profonde"\t"Fond lagonaire"\t"Recif barriere interne"\t"SA1"\t10\t3\t-999\t-999\t-999\t-999\t"Delphine Mallet"\n+"AMP"\t"AB080010"\t"SVR"\t"Abore"\tNA\tNA\tNA\t1\t10\t7\t2008\tNA\tNA\t"0"\t0\t-999\tNA\t"MM"\t"PQ"\t-22.47395\t166.39954\t"RE"\t"AP"\t"Complexe de recif barriere externe"\t"platier recifal"\t"Fond lagonaire"\t"Recif barriere interne"\t"SA3"\t7\t3.7\t-999\t-999\t-999\t-999\t"Delphine Mallet"\n+"AMP"\t"AB080011"\t"SVR"\t"Abore"\tNA\tNA\tNA\t1\t10\t7\t2008\tNA\tNA\t"0"\t0\t-999\tNA\t"MM"\t"PQ"\t-22.47507\t166.39572\t"RE"\t"AP"\t"Complexe de recif barriere externe"\t"terrasse peu profonde"\t"Fond lagonaire"\t"Recif barriere interne"\t"SA3"\t10\t2\t-999\t-999\t-999\t-999\t"Delphine Mallet"\n+"AMP"\t"AB080012"\t"SVR"\t"Abore"\tNA\tNA\tNA\t1\t10\t7\t2008\tNA\tNA\t"0"\t0\t-999\tNA\t"MM"\t"PQ"\t-22.48081\t166.41733\t"RE"\t"AP"\t"Complexe de recif barriere externe"\t"platier recifal"\t"Detritique"\t"Recif barriere interne"\t"SA5"\t9\t2\t-999\t-999\t-999\t-999\t"Delphine Mallet"\n+"AMP"\t"AB080013"\t"SVR"\t"Abore"\tNA\tNA\tNA\t1\t10\t7\t2008\tNA\tNA\t"0"\t0\t-999\tNA\t"MM"\t"PQ"\t-22.48161\t166.41947\t"RE"\t"AP"\t"Complexe de recif barriere externe"\t"platier recifal"\t"Detritique"\t"Recif barriere interne"\t"D7"\t8\t2.2\t-999\t-999\t-999\t-999\t"Delphine Mallet"\n+"AMP"\t"AB080014"\t"SVR"\t"Abore"\tNA\tNA\tNA\t1\t10\t7\t2008\tNA\tNA\t"0"\t0\t-999\tNA\t"PM"\t"PQ"\t-22.48274\t166.42438\t"RE"\t"AP"\t"Complexe de recif barriere externe"\t"platier recifal"\t"Detritique"\t"Recif barriere i'..b'\t0\t-999\tNA\t"MD"\t"LM"\t-22.3063035\t166.2917041\t"RE"\t"AP"\t"Complexe de massif corallien de lagon"\t"front recifal"\t"Detritique"\t"Frangeant ilot"\t"D1"\t6\t10.2\t-999\t-999\t-999\t-999\t"Drelon"\n+"AMP"\t"SI100129"\t"SVR"\t"Ilot Signal"\t"SI"\tNA\tNA\t1\t26\t4\t2010\tNA\tNA\t"0"\t0\t-999\tNA\t"MD"\t"LM"\t-22.2955173\t166.2967791\t"RE"\t"AP"\t"Complexe de massif corallien de lagon"\t"terrasse peu profonde"\t"Detritique"\t"Frangeant ilot"\t"D2"\t6.5\t5.3\t-999\t-999\t-999\t-999\t"Drelon"\n+"AMP"\t"SI100130"\t"SVR"\t"Ilot Signal"\t"SI"\tNA\tNA\t1\t26\t4\t2010\tNA\tNA\t"0"\t0\t-999\tNA\t"MD"\t"LM"\t-22.2947766\t166.2960761\t"RE"\t"AP"\t"Complexe de massif corallien de lagon"\t"terrasse peu profonde"\t"Detritique"\t"Frangeant ilot"\t"D1"\t7\t5.4\t-999\t-999\t-999\t-999\t"Drelon"\n+"AMP"\t"SI100131"\t"SVR"\t"Ilot Signal"\t"SI"\tNA\tNA\t1\t26\t4\t2010\tNA\tNA\t"0"\t0\t-999\tNA\t"MD"\t"LM"\t-22.2937402\t166.2949608\t"RE"\t"AP"\t"Complexe de massif corallien de lagon"\t"terrasse peu profonde"\t"Fond lagonaire"\t"Frangeant ilot"\t"SA3"\t7\t4.8\t-999\t-999\t-999\t-999\t"Drelon"\n+"AMP"\t"SI100132"\t"SVR"\t"Ilot Signal"\t"SI"\tNA\tNA\t1\t16\t4\t2010\tNA\tNA\tNA\t5\t-999\tNA\t"MD"\t"PC"\t-22.2929916\t166.2928995\t"RE"\t"AP"\t"Complexe de massif corallien de lagon"\t"terrasse peu profonde"\t"Fond lagonaire"\t"Frangeant ilot"\t"SA4"\t7.5\t3.8\t-999\t-999\t-999\t-999\t"Drelon"\n+"AMP"\t"SI100133"\t"SVR"\t"Ilot Signal"\t"SI"\tNA\tNA\t1\t26\t4\t2010\tNA\tNA\t"0"\t0\t-999\tNA\t"MD"\t"LM"\t-22.2930767\t166.2914348\t"RE"\t"AP"\t"Complexe de massif corallien de lagon"\t"terrasse peu profonde"\t"Detritique"\t"Frangeant ilot"\t"D2"\t6.5\t3.7\t-999\t-999\t-999\t-999\t"Drelon"\n+"AMP"\t"SI100136"\t"SVR"\t"Ilot Signal"\t"SI"\tNA\tNA\t1\t26\t4\t2010\tNA\tNA\t"0"\t0\t-999\tNA\t"MD"\t"LM"\t-22.3052715\t166.2907546\t"RE"\t"AP"\t"Ile lagonaire"\t"lagon profond"\t"Detritique"\t"Frangeant ilot"\t"D3"\t6.5\t10.5\t-999\t-999\t-999\t-999\t"Drelon"\n+"AMP"\t"SI100138"\t"SVR"\t"Ilot Signal"\t"SI"\tNA\tNA\t1\t26\t4\t2010\tNA\tNA\t"0"\t0\t-999\tNA\t"MD"\t"LM"\t-22.3022725\t166.2895628\t"RE"\t"AP"\t"Ile lagonaire"\t"lagon profond"\t"Detritique"\t"Frangeant ilot"\t"D2"\t6\t8\t-999\t-999\t-999\t-999\t"Drelon"\n+"AMP"\t"SI100151"\t"SVR"\t"Ilot Signal"\t"SI"\tNA\tNA\t1\t26\t4\t2010\tNA\tNA\t"0"\t0\t-999\tNA\t"MD"\t"LM"\t-22.2940228\t166.2910229\t"RE"\t"AP"\t"Complexe de massif corallien de lagon"\t"platier recifal"\t"Detritique"\t"Frangeant ilot"\t"D6"\t5\t3.5\t-999\t-999\t-999\t-999\t"Drelon"\n+"AMP"\t"SI100152"\t"SVR"\t"Ilot Signal"\t"SI"\tNA\tNA\t1\t26\t4\t2010\tNA\tNA\t"0"\t0\t-999\tNA\t"MD"\t"LM"\t-22.2951626\t166.2903255\t"RE"\t"AP"\t"Complexe de massif corallien de lagon"\t"terrasse peu profonde"\t"Fond lagonaire"\t"Frangeant ilot"\t"LC3"\t7\t5.4\t-999\t-999\t-999\t-999\t"Drelon"\n+"AMP"\t"SI100153"\t"SVR"\t"Ilot Signal"\t"SI"\tNA\tNA\t1\t27\t4\t2010\tNA\tNA\tNA\t2\t-999\tNA\t"MD"\t"LM"\t-22.2960763\t166.2901483\t"RE"\t"AP"\t"Complexe de massif corallien de lagon"\t"platier recifal"\t"Detritique"\t"Frangeant ilot"\t"D6"\t7\t3.5\t-999\t-999\t-999\t-999\t"Drelon"\n+"AMP"\t"SI100154"\t"SVR"\t"Ilot Signal"\t"SI"\tNA\tNA\t1\t27\t4\t2010\tNA\tNA\tNA\t2\t-999\tNA\t"MD"\t"LM"\t-22.2968722\t166.2895325\t"RE"\t"AP"\t"Complexe de massif corallien de lagon"\t"platier recifal"\t"Fond lagonaire"\t"Frangeant ilot"\t"D7"\t6\t4.6\t-999\t-999\t-999\t-999\t"Drelon"\n+"AMP"\t"SI100155"\t"SVR"\t"Ilot Signal"\t"SI"\tNA\tNA\t1\t26\t4\t2010\tNA\tNA\t"0"\t0\t-999\tNA\t"MD"\t"LM"\t-22.2981441\t166.2895349\t"RE"\t"AP"\t"Complexe de massif corallien de lagon"\t"platier recifal"\t"Detritique"\t"Frangeant ilot"\t"D6"\t7\t4.1\t-999\t-999\t-999\t-999\t"Drelon"\n+"AMP"\t"WA140001"\t"SVR"\t"Walpole"\tNA\t"Recif ilot"\tNA\t1\t1\t7\t2014\tNA\tNA\t"SW"\t3\t3\tNA\tNA\t"LM"\t-22.59854\t168.95012\t"HR"\t"AP"\t"Recif frangeant expose a l\\92ocean"\t"front recifal"\t"Corail vivant"\t"Frangeant oceanique"\t"D6"\t10\t10\t-999\t-999\t-999\t-999\t"William Roman"\n+"AMP"\t"WA140002"\t"SVR"\t"Walpole"\tNA\t"Recif ilot"\tNA\t1\t1\t7\t2014\tNA\tNA\t"SW"\t3\t3\tNA\tNA\t"LM"\t-22.60011\t168.94862\t"HR"\t"AP"\t"Recif frangeant expose a l\\92ocean"\t"front recifal"\t"Corail vivant"\t"Frangeant oceanique"\t"LC1"\t10\t15\t-999\t-999\t-999\t-999\t"William Roman"\n+"AMP"\t"WA140003"\t"SVR"\t"Walpole"\tNA\t"Recif ilot"\tNA\t1\t1\t7\t2014\tNA\tNA\t"SW"\t3\t4\tNA\tNA\t"LM"\t-22.60251\t168.94389\t"HR"\t"AP"\t"Recif frangeant expose a l\\92ocean"\t"front recifal"\t"Detritique"\t"Frangeant oceanique"\t"D1"\t10\t23.3\t-999\t-999\t-999\t-999\t"William Roman"\n'