-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path07-EcophyCofog_R.Rmd
191 lines (133 loc) · 5.09 KB
/
07-EcophyCofog_R.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
# EcophyCofog Package
A package to handle routinely produced raw outputs of the CIRAS-3, MINIPAM II and PSYPRO of EcoFog's ecophysiology lab.
Package written by Tristan LAFONT RAPNOUIL and hosted on [github](https://github.com/LafontRapnouilTristan/EcophyCofog).
Can be installed running:
```
install.packages("devtools")
library(devtools)
install_github("https://github.com/LafontRapnouilTristan/EcophyCofog")
```
## Utilitaries
### Library
Used to load install (if required) and load multiple package at once.
usage:
```{r eval=F}
EcophyCofog::Library(c("pckg1","pckg2","pckg3"))
```
### NotIn
A custom operator to test the differences between vectors.
```{r eval=F}
x <- c("a","b","c")
y <- c("d","a","e")
x %notin% y
```
`[1] FALSE TRUE TRUE`
### xtract_legend
Store the legend of a ggplot object.
```{r eval=F}
legend <- xtract_legend(myggplot)
```
### dummy_data
Create a meaningless numeric data frame for testing things.
```{r eval=F}
data <- dummy_data(nbcol=4,nbrow=100)
```
## MiniPAM
### merge_minipam
Merge several miniPAM output files.
All files should be stored in one folder, and only them!!
See [Fluorescence] for more details.
```{r eval=F}
library(EcophyCofog)
input_path <- PATH_TO_THE_FOLDER
filename <- NAME_OF_THE_MERGED_OUTPUT
merge_minipam(input_path,filename)
```
### minipam
Take as input a csv dataframe containing output of the minipam.
For ETR and F<sub>v</sub>/F<sub>m</sub> measurements only.
And return clean files containing each type of measurements + the ETR curves.
```{r eval=F}
library(EcophyCofog)
Name_of_the_input_file <- NAME_OF_YOUR_MERGED_FILE
input_path <- PATH_TO_SAID_FILE
path_to_ID_match <- PATH_TO_YOUR_ID_MATCH_FILE
minipam(Name_of_the_input_file,
input_path,
path_to_ID_match)
```
## CIRAS-3
### merge_ciras
Used to merge all ciras output of a foled into one file.
*path_to_xls* a character string with your path to all your ciras `.xls` output.
Their name must always end as _treatment_sampleID.xls (e.g. CIRAS_3_Aechmea m _DP_1.xls).
*skip*: the number of useless rows at the top of your `.xls` file, Jean-Yves Goret template have three.
```{r eval=F}
merge_ciras(path_to_xls, skip=3)
```
## PSYPRO
### psypro
Transform psypro output files into csv dataframe with mean water potential of your triplicate.
`param` *usedset* the predetermined name of your set 0,1,2 or 3.
`param` *lim* min and max values expected out of the psypro for you samples.
Used to standardized graphs for faster reading.
Discuss with lab members to understand!!
`param` *ID_vec* a vector of length 8 (number of sensors) with your samples' ID.
Empty sensors are named 0!!
`param` *path_to_calibration* path to you calibration file.
`param` *psypro_output* path to your psypro output.
```{r eval=F}
psypro(usedset ,
lim = c(-3,2),
ID_vec,
path_to_calibration,
psypro_output)
```
## PASCO
### PASCO_transfo
An earlier version of PASCO_transfo2, should not be used anymore.
### PASCO_transfo2
Process the PASCO probe output csv to get the gasfluxes.
`param` *data* a data frame output from Sparkview (usually read from .csv)
`param` *ech* a character vector with either the probe or sample name
`param` *name_run* a character vector with the name of all your runs (e.g., c("stab1","RECO","NEE"))
`param` *select* a numeric vector of the runs you want to keep (e.g., c(2,3))
`param` *A* the Area
`param` *V* the Volume
```{r eval=F}
PASCO_transfo2(data,
ech,
name_run,
select,
A=1,
V=5)
```
## PCR layout
Functions to create excel files containing the PCR plate layout (with controls and all) from your sample list.
Both for sample names and then tags combination.
### plate_layout
`param` *samples* a vector containing all your samples ID, they will fill the plate in the order they are in this vector, when having replicates for one sample, plz index them as "SampleName 1" to "SampleName N" and not "SampleName_X" or "SampleName.X".
`param` *proj* name of your project to name your plates as : "proj-PLx"
`param` *name_file* a name to your output file
`param` *save_file_path* path to where you want to save the excel output
`param` *starting_plate_number* where from start plate numbering
```{r eval=F}
plate_layout (samples,
proj,
name_file,
save_file_path,
starting_plate_number = 1)
```
### tag_layout
`param` *tag_list* a dataframe with 3 column : 'tag_name' (e.g. f1 to fx and r1 to rx), 'tag_sequence' (e.g. ACACACAC) and 'tag_type' (i.e. forward or reverse)
`param` *PCR_plates* a matrix object representing your plates map/layout, output of "plate_layout" function of this package. MAKE SURE that ALL empty cells are filled with NA when importing to R
`param` *output_path* path to an output folder that will receive to new files
`param` *file_corresp_tag* name of the sample-tagpairs correspondance dataframe
`param` *file_tag_layout* name of your xlsx output, having the map of your tagz.
```{r eval=F}
tag_layout(tag_list,
PCR_plates,
output_path,
file_corresp_tag,
file_tag_layout)
```