Skip to content

Commit 21a0117

Browse files
authored
Merge pull request #38 from GregFa/main
Update readme and project.toml
2 parents 22fb62a + a535c19 commit 21a0117

14 files changed

+514
-2780
lines changed

Project.toml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,25 @@ version = "0.1.0"
77
BigRiverQTLPlots = "042156b7-ffc6-4e52-80f3-70a9c31dd28f"
88
BulkLMM = "b8d15608-0852-4141-ae38-222578e2ed7b"
99
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
10-
CategoricalArrays = "324d7699-5711-5eae-9e2f-1d82baa6b597"
1110
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
12-
Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b"
1311
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
1412
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
13+
Missings = "e1d29d7a-bbdc-5cf2-9ac0-f12de2c33e28"
1514
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
1615
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
1716
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
1817

18+
[compat]
19+
BigRiverQTLPlots = "0.2"
20+
BulkLMM = "^1.2"
21+
CSV = "0.10, 1"
22+
DataFrames = "0.22, 1"
23+
JSON = "0.21, 1"
24+
Missings = "1"
25+
Reexport = "1.2"
26+
Statistics = "1"
27+
julia = "1"
28+
1929
[extras]
2030
DelimitedFiles = "8bb1440f-4735-579b-a4ab-409b98df4dab"
2131
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

README.md

Lines changed: 60 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
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+
25

6+
# BigRiverQTL.jl
37

48

59
*A Statistical Toolbox for QTL Analysis*
@@ -27,41 +31,67 @@ Pkg.add("BigRiverQTL")
2731
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
2832

2933

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+
3150
```julia
32-
using Plots
51+
# Libraries
3352
using BigRiverQTL
53+
using Plots
3454
```
3555

56+
#### Data
57+
58+
We assume that the data is stored in `..\data\BXD` directory.
3659

37-
```julia
38-
##############
39-
# BXD spleen #
40-
##############
4160

61+
```julia
4262
########
4363
# Data #
4464
########
4565
data_dir = joinpath(@__DIR__, "../data/BXD/");
4666
file = joinpath(data_dir, "bxd.json");
4767
```
4868

69+
Load bxd data using the function `get_geneticstudydata()`:
70+
4971

5072
```julia
51-
# Transforming data to a optimised and accessible data type
73+
# Load bxd data
5274
data = get_geneticstudydata(file);
5375
```
5476

5577

5678
```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);
6391
```
6492

93+
#### Preprocessing
94+
6595

6696
```julia
6797
#################
@@ -70,17 +100,22 @@ geno_processed=convert(Array{Float64}, geno);
70100
traitID = 1112;
71101
pheno_y = pheno[:, traitID];
72102
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];
74105
```
75106

107+
#### Kinship
108+
76109

77110
```julia
78111
###########
79112
# Kinship #
80113
###########
81-
kinship = kinship_gs(geno_processed,.99)
114+
kinship = kinship_gs(geno_processed,.99);
82115
```
83116

117+
#### Scan
118+
84119

85120
```julia
86121
########
@@ -96,22 +131,24 @@ single_results_perms = scan(
96131
);
97132
```
98133

134+
#### Preprocessing
135+
136+
#### Plots
137+
99138

100139
```julia
101-
########
102-
# Plot #
103-
########
140+
#########
141+
# Plots #
142+
#########
104143

105144
# QTL plots
106145
plot_QTL(single_results_perms, gInfo, mbColname = "Pos")
107146

108147
```
109-
![image](https://github.com/Durbadal0/BigRiverQTL.jl/blob/main/images/QTL_example.png)
148+
![image](images/QTL_example.png)
110149

111150
```julia
112151
# Manhattan plots
113152
plot_manhattan(single_results_perms, gInfo, mbColname = "Pos")
114-
115-
116153
```
117-
![image](https://github.com/Durbadal0/BigRiverQTL.jl/blob/main/images/manhattan_example.png)
154+
![image](images/manhattan_example.png)

0 commit comments

Comments
 (0)