1
- # BigRiverQTL.jl
1
+ [ ![ CI] ( https://github.com/senresearch/BigRiverQTL.jl/actions/workflows/ci.yml/badge.svg?branch=testing )] ( https://github.com/senresearch/BigRiverQTL.jl/actions/workflows/ci.yml )
2
+ [ ![ codecov] ( https://codecov.io/gh/senresearch/BigRiverQTL.jl/branch/testing/graph/badge.svg?token=uHM6utUQoi )] ( https://codecov.io/gh/senresearch/BigRiverQTL.jl )
3
+ [ ![ Pkg Status] ( https://www.repostatus.org/badges/latest/active.svg )] ( https://www.repostatus.org/#active )
4
+
2
5
6
+ # BigRiverQTL.jl
3
7
4
8
5
9
* A Statistical Toolbox for QTL Analysis*
@@ -27,41 +31,67 @@ Pkg.add("BigRiverQTL")
27
31
Contributions to BigRiverQTL.jl are welcome and appreciated. If you'd like to contribute, please fork the repository and make changes as you'd like. If you have any questions or issues, feel free to open an
28
32
29
33
30
- ## Examples
34
+ # Example QTL
35
+ ___
36
+
37
+ This example is also available as a [ notebook] ( example/example_qtl.ipynb ) in the 'example' directory.
38
+
39
+ ## Data
40
+
41
+ In this example, we will use a dataset available from the ` R/qtl2 ` package. Specifically, we will use the BXD dataset, which is obtained from the [ GeneNetwork] ( https://genenetwork.org/ ) website.
42
+
43
+ You can download the BXD genotype data from the following link:
44
+ [ Download BXD Genotype Data] ( https://raw.githubusercontent.com/rqtl/qtl2data/master/BXD/bxd.zip )
45
+
46
+
47
+ ### Example - BXD
48
+
49
+
31
50
``` julia
32
- using Plots
51
+ # Libraries
33
52
using BigRiverQTL
53
+ using Plots
34
54
```
35
55
56
+ #### Data
57
+
58
+ We assume that the data is stored in ` ..\data\BXD ` directory.
36
59
37
- ``` julia
38
- # #############
39
- # BXD spleen #
40
- # #############
41
60
61
+ ``` julia
42
62
# #######
43
63
# Data #
44
64
# #######
45
65
data_dir = joinpath (@__DIR__ , " ../data/BXD/" );
46
66
file = joinpath (data_dir, " bxd.json" );
47
67
```
48
68
69
+ Load bxd data using the function ` get_geneticstudydata() ` :
70
+
49
71
50
72
``` julia
51
- # Transforming data to a optimised and accessible data type
73
+ # Load bxd data
52
74
data = get_geneticstudydata (file);
53
75
```
54
76
55
77
56
78
``` julia
57
- gInfo= data. gmap;
58
- pInfo= data. phenocov;
59
- pheno= data. pheno;
60
- pheno= data. pheno. val;
61
- geno= data. geno. val[1 ];
62
- geno_processed= convert (Array{Float64}, geno);
79
+ # Data types
80
+ # makers info
81
+ gInfo = data. gmap;
82
+ # pehnotype info
83
+ pInfo = data. phenocov;
84
+ # phenotype values
85
+ pheno = data. pheno. val;
86
+
87
+ # We can get the genotype matrix using the following command:
88
+ geno = reduce (hcat, data. geno. val);
89
+ # For computing reasons, we need to convert the geno matrix in Float64
90
+ geno_processed = convert (Array{Float64}, geno);
63
91
```
64
92
93
+ #### Preprocessing
94
+
65
95
66
96
``` julia
67
97
# ################
@@ -70,17 +100,22 @@ geno_processed=convert(Array{Float64}, geno);
70
100
traitID = 1112 ;
71
101
pheno_y = pheno[:, traitID];
72
102
pheno_y2= ones (length (pheno_y));
73
- pheno_y2[findall (x-> x!= nothing ,pheno_y)]= pheno_y[findall (x-> x!= nothing ,pheno_y)];
103
+ idx_nothing = findall (x-> x!= nothing ,pheno_y)
104
+ pheno_y2[idx_nothing]= pheno_y[idx_nothing];
74
105
```
75
106
107
+ #### Kinship
108
+
76
109
77
110
``` julia
78
111
# ##########
79
112
# Kinship #
80
113
# ##########
81
- kinship = kinship_gs (geno_processed,.99 )
114
+ kinship = kinship_gs (geno_processed,.99 );
82
115
```
83
116
117
+ #### Scan
118
+
84
119
85
120
``` julia
86
121
# #######
@@ -96,22 +131,24 @@ single_results_perms = scan(
96
131
);
97
132
```
98
133
134
+ #### Preprocessing
135
+
136
+ #### Plots
137
+
99
138
100
139
``` julia
101
- # #######
102
- # Plot #
103
- # #######
140
+ # ########
141
+ # Plots #
142
+ # ########
104
143
105
144
# QTL plots
106
145
plot_QTL (single_results_perms, gInfo, mbColname = " Pos" )
107
146
108
147
```
109
- ![ image] ( https://github.com/Durbadal0/BigRiverQTL.jl/blob/main/ images/QTL_example.png)
148
+ ![ image] ( images/QTL_example.png )
110
149
111
150
``` julia
112
151
# Manhattan plots
113
152
plot_manhattan (single_results_perms, gInfo, mbColname = " Pos" )
114
-
115
-
116
153
```
117
- ![ image] ( https://github.com/Durbadal0/BigRiverQTL.jl/blob/main/ images/manhattan_example.png)
154
+ ![ image] ( images/manhattan_example.png )
0 commit comments