You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/description.md
+2-4Lines changed: 2 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,12 +52,10 @@ The average absolute difference between AAF<sub>present</sub> and AAF<sub>future
52
52
53
53
The RONA method as implemented in *pyRona* is not performed exactly as the original from [Rellstab et al. 2016](doi.wiley.com/10.1111/mec.13889).
54
54
55
-
Instead of relying on LFFM like the original, *pyRona* is instead prepared to get association data from the software [*Baypass*](http://www1.montpellier.inra.fr/CBGP/software/baypass/). The method can be red about in [Gautier 2015](https://www.ncbi.nlm.nih.gov/pubmed/26482796). Being able to use output from LFMM is also in the [future plans](https://github.com/StuntsPT/pyRona/issues/7).
56
-
57
-
This means the instead of using allele frequencies, *pyRona* uses the normalized allele frequencies outputted by *Baypass*. This is in our opinion superior to using the allele frequencies directly, since it removes any potential effect of population structuring.
58
-
59
55
Instead of ranking the environmental factors by *p*-value of the difference teste between present and future values, *pyRona* will calculate the RONA value for the "N" environmental variables ranked by the number of associated loci. By default "N" is 3, but *pyRona* can take any user provided value.
60
56
61
57
*pyRona* offers an option to remove outliers before calculating the regression. This removal uses the ["Mahalanobis distance"](https://en.wikipedia.org/wiki/Mahalanobis_distance) to remove 0, 1 or "all" the outliers in the data. By default, no outlier removal is performed.
62
58
59
+
In addition to relying on LFFM like the original, *pyRona* is also prepared to get association data from the software [*Baypass*](http://www1.montpellier.inra.fr/CBGP/software/baypass/). The method can be red about in [Gautier 2015](https://www.ncbi.nlm.nih.gov/pubmed/26482796). When *Baypass* results are provided as input, instead of using allele frequencies, *pyRona* uses the normalized allele frequencies calculated by *Baypass*. This is in our opinion superior to using the allele frequencies directly, since it removes any potential effect of population structuring.
60
+
63
61
Finally, similar to the original method, *pyRona* provides an average RONA value for each selected environmental variable, but unlike the the original method,our implementation will calculate the average RONA weighted by the regression R² value. This means that associations with a lower regression coefficient will contribute less to the final RONA value than those with higher R² values.
Copy file name to clipboardExpand all lines: docs/install.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,7 +30,7 @@ Due to the way different Operating Systems handle dependencies specific instruct
30
30
31
31
## Important note
32
32
33
-
Note that *pyRona* will also automatically install an*R*script called `Baypass_workflow.R` under `~/.local/bin` that can be used to automate the usage of the software *BayPass*, whose output can be used as input for *pyRona*. For more information on this script, please see the [baypass section](baypass.md).
33
+
Note that *pyRona* will also automatically install two*R*scripts called `Baypass_workflow.R`and `LFMM_workflow.R`under `~/.local/bin` that can be used to automate the usage of the upstream software *BayPass* and *LFMM*, whose output can be used as input for *pyRona*. For more information on these scripts, please see the [baypass](baypass.md) and [LFMM](lfmm.md) sections.
*pyRona* can take the output of *LFMM* as input to calculate the RONA values. Due to this, *pyRona* includes an `R` script named `LFMM_workflow.R` that can be used to automate and wrap *LFMM* analyses.
4
+
Not that it is highly recommended that you give *LFMM*'s [manual](https://bcm-uga.github.io/lfmm/reference/index.html), [tutorial](https://bcm-uga.github.io/lfmm/articles/lfmm), and [paper](http://dx.doi.org/10.1093%2Fmolbev%2Fmst063) a through read before using this script.
5
+
6
+
7
+
## LFMM_workflow.R
8
+
9
+
This script will automate the workflow for the [LFMM](https://bcm-uga.github.io/lfmm/index.html)
10
+
software by Olivier François and Kevin Caye, which is described in [this paper](http://dx.doi.org/10.1093%2Fmolbev%2Fmst063).
11
+
It does **no error handling** of any kind, nor any logging. It just automates
12
+
the procedures outlined in the manual with some degrees of freedom.
13
+
Please be careful when using it. It may kill your kittens and/or burn your
14
+
house down, but worst of all, it will tend to make you lazy regarding the inner
15
+
workings of *LFMM*.
16
+
The script takes no arguments, but all the variables you should need to edit
17
+
are presented at the start of the script, coupled with a short description.
18
+
19
+
20
+
### Variables
21
+
22
+
In the beginning of the script there are several line with empty variables. You should fill in the correct values for your case in order to use it.
23
+
Each option is pretty much self documented with both an explanation of what is expected and an example.
24
+
25
+
26
+
### Functions
27
+
28
+
The rest of the script is comprised of functions to wrap the LFMM functionality. You should not have to change anything here to get a complete run as all the parameters that are likely be changed can be from the "Variables" section.
29
+
30
+
31
+
### Running the script
32
+
33
+
Simply enter values for the variables at the beginning of the script and run it in R. It is recommended that you take a close look at the "PCA variance explained" plot to choose the best "K" to use, which will likely mean perform multiple runs.
Copy file name to clipboardExpand all lines: docs/usage.md
+42-18Lines changed: 42 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,32 +7,56 @@ This section describes how to use *pyRona*. All options as of version 0.2.0 are
7
7
* Getting help
8
8
- Simply calling the program, or issuing the single argument `-h` will print all the available options on the console
9
9
10
+
* Positional arguments:
11
+
- The first argument should be the name of the program whose results you wish to analyse. *pyRona* can take one of two options here:
12
+
- `baypass`:Process Baypass results
13
+
- `lfmm`:Process LFMM results
14
+
15
+
- Depending on which you choose, some of the other options will be different.
16
+
10
17
* I/O options
11
-
-*pyRona***requires** several files as input, that should be specified inn the following options:
12
-
- `-pc`: File containing current environmental variables (formatted as per *BayPass* input)
13
-
- `-fc`: File containing future environmental variables (formatted the same as the present conditions file)
14
-
- `-pop`: File with names of populations (one population per line)
15
-
- `-beta`: *BayPass* output "summary_betai"
16
-
- `-pij`: *BayPass* output "PIJ"
17
-
- Furthermore, *pyRona* also requires an output to be specified, for saving the RONA plot.
18
-
-`-out`: File where the plot will be saved. This option is extension aware, and entering the extension as "PDF", "SVG" or "PNG", will make *pyRona* save the plot in the respective format.
18
+
-*pyRona***requires** several files as input, that should be specified in the following options:
19
+
- Common options to both *Baypass* and *LFMM*:
20
+
- `-pc`: File containing current environmental variables, formatted as per the upstream program input (*Baypass* or *LFMM*)
21
+
- `-fc`: File containing future environmental variables, formatted as per the upstream program input (*Baypass* or *LFMM*)
22
+
- `-out`: File where the plot will be saved. This option is extension aware, and entering the extension as "PDF", "SVG" or "PNG", will make *pyRona* save the plot in the respective format
23
+
- *Baypass* specific options:
24
+
- `-pop`: File with names of populations (one population per line)
25
+
- `-beta`: *BayPass* output "summary_betai"
26
+
- `-pij`: *BayPass* output "PIJ"
27
+
- *LFMM* specific options:
28
+
- `-assoc`: File containing a matrix of *p*-values as outputted by *LFMM*
29
+
- `-geno`: The input file used for *LFMM*. Should be in the *LFMM* format
30
+
19
31
* Parameters
20
32
-*pyRona* requires some parameters to be set in order to perform the analysis. These are:
21
-
- `-bf`: Bayes Factor threshold. This is the value above which associations are considered significant.
22
-
- `-covars`: [**optional**] Number of covars to calculate the RONA for (default: 3)
23
-
- `-outliers`: [**optional**] Number of outliers to remove - "0" skips outlier removal, "1" removes a maximum of 1 outlier (if there is one), "2" removes any number of markers considered outliers (default: 2)
24
-
- `-immutables`: Number of covariates to skip from the environmental variables file. Usefull to skip variables that are the same in te present covars and future covars file, such as latitude (default: 3).
25
-
- `-ronatype`: Defines the RONA is calculated. `absdiff` performs calculations as described in Rellstab et al. 2016 - using the absolute value of the differences, `diff` uses the differences without modulus, and `dist` accounts simply for the distance between the future condition and the trendline (default: `absdiff`).
33
+
- Common options to both *Baypass* and *LFMM*:
34
+
- `-covars`: [**optional**] Number of covars to calculate the RONA for (default: 3)
35
+
- `-outliers`: [**optional**] Number of outliers to remove - "0" skips outlier removal, "1" removes a maximum of 1 outlier (if there is one), "2" removes any number of markers considered outliers (default: 2)
36
+
- `-immutables`: Covariates to skip from the environmental variables file. Useful to skip variables that are the same in te present covars and future covars file, such as latitude (default: 1 2 3)
37
+
- `-ronatype`: Defines the RONA is calculated. `absdiff` performs calculations as described in Rellstab et al. 2016 - using the absolute value of the differences, `diff` uses the differences without modulus, and `dist` accounts simply for the distance between the future condition and the trendline (default: `absdiff`)
38
+
- *Baypass* specific options:
39
+
- `-bf`: Bayes Factor threshold. This is the value above which associations are considered significant
40
+
- *LFMM* specific options:
41
+
- `-P`: *p*-value threshold. This is the value below which associations are considered significant
42
+
26
43
* Other options (**all optional**)
27
44
-*pyRona* allows for setting some further miscellaneous options:
28
-
- `-no-plots`: Do not draw the individual regression plots.
29
-
- `-no-weighted-means`: Use this option if you wish to use *means* instead of *weighted means* for the RONA calculation.
45
+
- `-no-plots`: Do not draw the individual regression plots. This is the default, and you should set it to "0" or "False" to draw the individual plots
46
+
- `-no-weighted-means`: Set this option to "1" or "True" if you wish to use *means* instead of *weighted means* for the RONA calculation
This command will execute *pyRona* set to analyse *Baypass* output using the input files specified by `-pc`, `-fc`, `-beta`, `-pij` and `-pop`, using the value `15` as the BF threshold, skipping outlier removal and calculating the RONA value for the most frequent 4 associated environmental variables. The plot will be saved as a PDF under `~/Desktop/rpc26.pdf`.
This command will execute *pyRona* using the input files specified by `-pc`, `-fc`, `-be`, `-pij`and `-pop`, using the value `15` as the BF threshold, skipping outlier removal and calculating the RONA value for the most frequent 4 associated environmental variables. The plot will be saved as a PDF under `~/Desktop/rpc26.pdf`.
62
+
This command will execute *pyRona*set to analyse *LFMM* output using the input files specified by `-pc`, `-fc`, `-assoc`and `-geno`, using the value `0.01` as the *p*-value threshold, skipping outlier removal (default) and calculating the RONA value for the most frequent 3 associated environmental variables (default). The plot will be saved as a PDF under `~/Desktop/LFMM_rpc26.pdf`.
0 commit comments