Commit 383dc119 authored by peguerin's avatar peguerin
Browse files

readme udpate

parent 837ac791
Scripts to assign environmental descriptor to sample
====================================================
Scripts to assign environmental descriptors to samples
======================================================
2019
# Table of contents
1. [Introduction](#1-introduction)
2. [Installation](#2-installation)
1. [Prerequisite](#21-prerequisite)
1. [Prerequisites](#21-prerequisite)
2. [Data files](#22-data_files)
3. [Reporting bugs](#3-reporting-bugs)
4. [Running the pipeline](#4-running-the-pipeline)
......@@ -14,7 +14,7 @@ Scripts to assign environmental descriptor to sample
# 1. Introduction
R scripts to assign environmental data to sample according to their coordinates.
R scripts to assign environmental data to samples according to their coordinates.
# 2. Installation
......@@ -30,7 +30,7 @@ git clone https://gitlab.mbb.univ-montp2.fr/reservebenefit/environmental_assign_
cd environmental_assign_data
```
## 2.1 Prerequisite
## 2.1 Prerequisites
You must install the following softwares and packages :
- [R Version 3.2.3](https://cran.r-project.org/) to run the scripts
......@@ -64,16 +64,25 @@ To access to our private server, please follow these instructions
Now you are connected to our server and you can download the required files. They are stored into : /DataEnvironment/resources
Download the content of /DataEnvironment/resources and copy it into the folder [01-infos](01-infos). Your data should be stored this way :
* 01-infos/habitat/EUSeaMap2016_substrate_levels_med_res200m.tsv
* 01-infos/habitat/EUSeaMap2016_substrate_levels_med_res200m.tif
* 01-infos/chlorophyll/benthic/Present.Benthic.Mean.Depth.Chlorophyll.Max.tif.zip
* 01-infos/chlorophyll/benthic/Present.Benthic.Mean.Depth.Chlorophyll.Mean.tif.zip
* 01-infos/chlorophyll/benthic/Present.Benthic.Mean.Depth.Chlorophyll.Min.tif.zip
* 01-infos/chlorophyll/surface/Present.Surface.Chlorophyll.Max.tif
* 01-infos/chlorophyll/surface/Present.Surface.Chlorophyll.Mean.tif
* 01-infos/chlorophyll/surface/Present.Surface.Chlorophyll.Min.tif
* 01-infos/salinity/MEDSEA_PHY_006_004_SSS_jan1987-nov2016_monthly.nc
* 01-infos/temperature/MEDSEA_PHY_006_004_SST_jan1987-nov2016_monthly.nc
```
01-infos/
├── chlorophyll
│   ├── benthic
│   │   ├── Present.Benthic.Mean.Depth.Chlorophyll.Max.tif.zip
│   │   ├── Present.Benthic.Mean.Depth.Chlorophyll.Mean.tif.zip
│   │   └── Present.Benthic.Mean.Depth.Chlorophyll.Min.tif.zip
│   └── surface
│   ├── Present.Surface.Chlorophyll.Max.tif.zip
│   ├── Present.Surface.Chlorophyll.Mean.tif.zip
│   └── Present.Surface.Chlorophyll.Min.tif.zip
├── habitat
│   ├── EUSeaMap2016_substrate_levels_med_res200m.tsv
│   └── EUSeaMap2016_substrate_raster_med_res200m.tif
├── salinity_et_temperature
   └── CMEMS-MedSea_Reanalysis_Phys_006_004_0to210m_1987-2015_1m_votemper_vosaline_SampleLoc.nc
```
# 3. Reporting bugs
......@@ -87,32 +96,64 @@ verbose as possible — e.g. include the command line, etc
# 4. Running the pipeline
You must have download required data files into [01-infos](01-infos) (see [Data files](#22-data_files) section)
:point_right: You must have download required data files into [01-infos](01-infos) (see [Data files](#22-data_files) section)
To attribute "habitat" information (this will generate [03-results/all_habitat.tsv](03-results/all_habitat.tsv))
### 4.1. Assign `habitat` (substrat) values to samples
To attribute `habitat` information (this will generate [03-results/all_habitat.tsv](03-results/all_habitat.tsv))
```
Rscript 00-scripts/habitat.R
```
### 4.2. Assign `chlorophyll A abundance` values to samples
To attribute "chlorophyll A" information (this will generate [03-results/all_habitat.tsv](03-results/all_chlorophyll.tsv))
```
Rscript 00-scripts/chlorophyll.R
```
To attribute "salinity" information (this will generate [03-results/all_monthly_salinity.tsv](03-results/all_monthly_salinity.tsv))
```
Rscript 00-scripts/sss.R
### 4.3. Assign `mounthly temperature & salinity` values to samples for each sea depth
To attribute `mounthly temperature & salinity` by sea depth information (this will generate [03-results/all_depth_repro_temperature_salinity.tsv](03-results/all_depth_repro_temperature_salinity.tsv))
```
To attribute "temperature" information (this will generate [03-results/all_monthly_temperature.tsv](03-results/all_monthly_temperature.tsv))
Rscript 00-scripts/salt_temp.R
```
Rscript 00-scripts/sst.R
### 4.4. Correct environmental data values
* Correct `mounthly temperature & salinity` values
:warning: `mounthly temperature & salinity` values for these following samples were missing data and then have been **_manually_** fullfiled:
(ce serait bien de savoir _COMMENT ?_)
```
mul_bal_115
mul_bal_116
mul_bal_117
mul_bal_118
mul_bal_119
mul_bal_120
mul_bal_121
mul_bal_122
mul_bal_123
mul_bal_124
mul_bal_125
mul_bal_126
mul_bal_127
mul_bal_128
mul_bal_129
mul_bal_130
mul_bal_131
```
(see file [03-results/all_depth_repro_CORRECTED_temperature_salinity.csv](03-results/03-results/all_depth_repro_CORRECTED_temperature_salinity.csv))
### 4.5. All environmental descriptors into one single table
To merge all data into one single table (this will generate [03-results/all.tsv](03-results/all.tsv))
To merge all data into one single table (this will generate [03-results/final_chloro_temperature_salinity.tsv](03-results/final_chloro_temperature_salinity.tsv)
```
Rscript 00-scripts/merge_table.R
```
......@@ -121,7 +162,5 @@ Rscript 00-scripts/merge_table.R
# 5. Results
* [03-results/all_habitat.tsv](03-results/all_habitat.tsv) : table of samples with WGS84 coordinates and predicted habitat
* [03-results/all_chlorophyll.tsv](03-results/all_chlorophyll.tsv) : table of samples with WGS84 coordinates and chlorophyll A - benthic and surface - mean,max,min values
* [03-results/all_monthly_salinity.tsv](03-results/all_monthly_salinity.tsv) : table of samples with WGS84 coordinates and monthly salinity - mean,max,min values
* [03-results/all_monthly_temperature.tsv](03-results/all_monthly_temperature.tsv) : table of samples with WGS84 coordinates and monthly temperature - mean,max,min values
* [03-results/all.tsv](03-results/all.tsv) : table of samples with WGS84 coordinates and all the environmental data (predicted habitat, chlorophyll A)
* [03-results/all_CHECKED_chlorophyll.tsv](03-results/all_CHECKED_chlorophyll.tsv) : table of samples with WGS84 coordinates and chlorophyll A - benthic and surface - mean,max,min values
* [03-results/final_chloro_temperature_salinity.tsv](03-results/final_chloro_temperature_salinity.tsv) : table of samples with WGS84 coordinates and all the environmental data (predicted habitat, chlorophyll A, temperature, salinity by mounth and by depth values)
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment