Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Docker-in-Docker (DinD) capabilities of public runners deactivated.
More info
Open sidebar
VEBER Philippe
codepi
Commits
c67a3c8f
Commit
c67a3c8f
authored
Oct 21, 2020
by
Louis Duchemin
Browse files
Gemma pipeline implementation : relatedness matrix
parent
6b7c7e02
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
2 deletions
+34
-2
lib/gemma.ml
lib/gemma.ml
+33
-2
lib/gemma.mli
lib/gemma.mli
+1
-0
No files found.
lib/gemma.ml
View file @
c67a3c8f
...
...
@@ -11,6 +11,29 @@ let%pworkflow genotype_of_fasta fasta =
let
module
G
=
Reviewphiltrans_toolbox
.
Gemma
in
G
.
write_genotypes
~
alignment
:
[
%
path
fasta
]
~
output
:
[
%
dest
]
let
%
pworkflow
phenotype_of_tree
nhx
=
let
open
Phylogenetics
in
let
module
U
=
Reviewphiltrans_toolbox
.
Utils
in
let
collect_leaves
t
=
let
rec
node
condition
t
acc
=
match
t
with
|
Tree
.
Node
n
->
List1
.
fold_right
n
.
branches
~
init
:
acc
~
f
:
branch
|
Leaf
_
->
condition
::
acc
and
branch
(
Tree
.
Branch
b
)
acc
=
node
(
snd
b
.
data
)
b
.
tip
acc
in
node
0
t
[]
in
let
leaves
=
U
.
tree_from_file
[
%
path
nhx
]
|>
collect_leaves
in
let
write_phenotypes
leaves
oc
=
List
.
iter
leaves
~
f
:
(
fprintf
oc
"%d
\n
"
)
in
Out_channel
.
with_file
[
%
dest
]
~
f
:
(
write_phenotypes
leaves
)
let
template_of_mode
m
=
int
(
match
m
with
...
...
@@ -18,12 +41,20 @@ let template_of_mode m =
|
`Standardized
->
2
)
let
relatedness_filename
=
function
|
`Centered
->
"result.cXX.txt"
|
`Standardized
->
"result.sXX.txt"
let
calculate_relatedness_matrix
~
mode
~
genotype
~
phenotype
=
Workflow
.
shell
~
descr
:
"gemma.calculate_relatedness_matrix"
[
cmd
"gemma"
[
opt
"-g"
dep
genotype
;
opt
"-p"
dep
phenotype
;
opt
"-gk"
template_of_mode
mode
;
opt
"-o"
Fn
.
id
dest
;
]
opt
"-outdir"
Fn
.
id
tmp
;
]
;
cmd
"cp"
[
tmp
//
(
relatedness_filename
mode
)
;
dest
;
]
;
]
\ No newline at end of file
lib/gemma.mli
View file @
c67a3c8f
...
...
@@ -7,6 +7,7 @@ class type relatedness_matrix = object
end
val
genotype_of_fasta
:
aminoacid_fasta
file
->
bimbam
file
val
phenotype_of_tree
:
nhx
file
->
bimbam
file
val
calculate_relatedness_matrix
:
mode
:
[
`Centered
|
`Standardized
]
->
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment