Skip to content

Commit b4e13b3

Browse files
authored
Merge pull request #29 from Durbadal0/testing
Testing
2 parents 871057b + 9f78360 commit b4e13b3

File tree

5 files changed

+114
-231
lines changed

5 files changed

+114
-231
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "BigRiverQTL"
22
uuid = "8f8ec94a-26d1-428c-aa0e-4e66223094bc"
3-
authors = ["Gregory Farage, Harper Kolehmainen, Saunak Sen"]
3+
authors = ["Gregory Farage, Durbadal Ghosh, Harper Kolehmainen, Saunak Sen"]
44
version = "0.1.0"
55

66
[deps]

README.md

Lines changed: 100 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,103 @@ Pkg.add("BigRiverQTL")
2424

2525

2626
## Contribution
27-
Contributions to BigRiverQTLPlots.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
27+
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+
29+
30+
## Examples
31+
```julia
32+
using Pkg
33+
Pkg.activate("../")
34+
```
35+
36+
37+
```julia
38+
using Revise
39+
```
40+
41+
42+
```julia
43+
using BigRiverQTLPlots
44+
using BulkLMM
45+
using Random, Statistics
46+
using Plots
47+
using Helium
48+
using BigRiverQTL
49+
using CSV
50+
using DataFrames
51+
```
52+
53+
54+
```julia
55+
##############
56+
# BXD spleen #
57+
##############
58+
59+
########
60+
# Data #
61+
########
62+
data_dir = joinpath(@__DIR__, "../data/BXD/");
63+
file = joinpath(data_dir, "bxd.json");
64+
```
65+
66+
67+
```julia
68+
# Transforming data to a optimised and accessible data type
69+
data = get_geneticstudydata(file);
70+
```
71+
72+
73+
```julia
74+
gInfo=data.gmap;
75+
pInfo=data.phenocov;
76+
pheno=data.pheno;
77+
pheno=data.pheno.val;
78+
geno=data.geno.val[1];
79+
geno_processed=convert(Array{Float64}, geno);
80+
```
81+
82+
83+
```julia
84+
#################
85+
# Preprocessing #
86+
#################
87+
traitID = 1112;
88+
pheno_y = pheno[:, traitID];
89+
pheno_y2=ones(length(pheno_y));
90+
pheno_y2[findall(x->x!=nothing,pheno_y)]=pheno_y[findall(x->x!=nothing,pheno_y)];
91+
```
92+
93+
94+
```julia
95+
###########
96+
# Kinship #
97+
###########
98+
kinship = kinship_gs(geno_processed,.99)
99+
```
100+
101+
102+
```julia
103+
########
104+
# Scan #
105+
########
106+
107+
single_results_perms = scan(
108+
pheno_y2,
109+
geno_processed,
110+
kinship;
111+
permutation_test = true,
112+
nperms = 1000,
113+
);
114+
```
115+
116+
117+
```julia
118+
########
119+
# Plot #
120+
########
121+
122+
plot_QTL(single_results_perms, gInfo)
123+
124+
125+
```
126+
[]()

example/Example1.ipynb

Lines changed: 0 additions & 229 deletions
This file was deleted.

src/plots/plots_qtl.jl

Whitespace-only changes.

src/plots/plots_utils.jl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
function gmap2df(gmap::Gmap)
2+
v=reduce(vcat,gInfo.marker_name);
3+
Mb=reduce(vcat,gInfo.pos);
4+
start=0
5+
vchr=repeat(["0"],sum(length.(gInfo.marker_name)))
6+
for i in 1: eachindex()
7+
l_i=length(gInfo.marker_name[i])
8+
vchr[start+1:l_i+start] .= gInfo.chr[i]
9+
start=start+l_i
10+
end
11+
12+
13+
end

0 commit comments

Comments
 (0)