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
Open sidebar
VEBER Philippe
codepi
Commits
ad585854
Commit
ad585854
authored
May 07, 2020
by
Philippe Veber
Browse files
orthomam: pdf repr of convergence in tree
parent
812f0b25
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
65 additions
and
3 deletions
+65
-3
lib/dune
lib/dune
+1
-1
lib/orthomam.ml
lib/orthomam.ml
+59
-2
lib/orthomam.mli
lib/orthomam.mli
+5
-0
No files found.
lib/dune
View file @
ad585854
(library
(name reviewphiltrans)
(libraries core biotk biotope bistro.utils ocaml-r.graphics ocaml-r.grDevices phylogenetics.convergence reviewphiltrans_toolbox)
(libraries core biotk biotope bistro.utils
gsl
ocaml-r.graphics ocaml-r.grDevices phylogenetics.convergence reviewphiltrans_toolbox)
(preprocess
(pps ppx_jane ppx_csv_conv bistro.ppx ppx_here)))
...
...
lib/orthomam.ml
View file @
ad585854
...
...
@@ -424,8 +424,65 @@ include Q
include
Detection_pipeline
.
Make
(
Q
)
let
species_with_echolocation
=
[
"Rhinolophus ferrumequinum"
;
"Tursiops_truncatus"
;
"Orcinus_orca"
;
"Myotis_lucifugus"
;
"Eptesicus_fuscus"
;
"Tursiops_truncatus"
;
"Miniopterus_natalensis"
;
(* "Pteropus_vampyrus" ; unsure, i'd say no *)
(* "Pteropus alecto" ; unsure, i'd say no *)
"Lipotes_vexillifer"
;
"Hipposideros_armiger"
;
"Physeter_catodon"
;
"Rousettus_aegyptiacus"
;
(* unsure, i'd say yes *)
"Myotis_brandtii"
;
"Balaenoptera_acutorostrata_scammoni"
;
"Delphinapterus_leucas"
;
"Myotis_davidii"
;
(* "Rhinolophus ferrumequinum" ; in ensembl but not in orthomam *)
]
let
%
pworkflow
convergence_species_tree_pdf
~
convergent_species
db
=
let
convergent_species
=
[
%
param
convergent_species
]
in
let
tree_path
=
[
%
path
estimated_amino_acid_tree
db
]
in
let
open
Phylogenetics
in
let
convergent_species
=
String
.
Set
.
of_list
convergent_species
in
let
render_tree
(
tree_or_branch
:
Newick
.
t
)
=
let
module
P
=
Biotk
.
Phylo_tree_draw
in
let
rec
of_tree
:
Newick
.
tree
->
P
.
tree
=
function
|
Leaf
ni
->
let
col
,
text
=
match
ni
.
name
with
|
Some
name
->
let
col
=
if
String
.
Set
.
mem
convergent_species
name
then
Gg
.
Color
.
red
else
Gg
.
Color
.
black
in
col
,
String
.
tr
~
target
:
'
_'
~
replacement
:
'
'
name
|
None
->
Gg
.
Color
.
black
,
""
in
P
.
leaf
~
col
~
style
:
`oblique
text
|
Node
n
->
Phylogenetics
.
List1
.
map
n
.
branches
~
f
:
of_branch
|>
Phylogenetics
.
List1
.
to_list
|>
P
.
node
and
of_branch
:
Newick
.
branch
->
P
.
branch
=
fun
(
Branch
b
)
->
let
len
=
Option
.
value_exn
b
.
data
.
length
in
let
col
=
match
List
.
Assoc
.
find
b
.
data
.
tags
"Condition"
~
equal
:
String
.
equal
with
|
Some
"1"
->
Gg
.
Color
.
red
|
_
->
Gg
.
Color
.
black
in
P
.
branch
~
col
len
(
of_tree
b
.
tip
)
in
match
tree_or_branch
with
|
Tree
t
->
P
.
draw_tree
(
of_tree
t
)
|
Branch
b
->
P
.
draw_branch
(
of_branch
b
)
in
let
tree_or_branch
=
Newick
.
from_file
tree_path
|>
Newick
.
map_inner_tree
~
f
:
(
fun
t
->
tag_tree
t
convergent_species
)
in
render_tree
tree_or_branch
|>
Biotk_croquis
.
Croquis
.
Layout
.
simple
|>
Fn
.
flip
Biotk_croquis
.
Croquis
.
Layout
.
render_pdf
[
%
dest
]
lib/orthomam.mli
View file @
ad585854
...
...
@@ -66,3 +66,8 @@ val estimated_codon_tree :
val
estimated_amino_acid_tree
:
Orthomam_db
.
t
->
newick
file
val
convergence_species_tree_pdf
:
convergent_species
:
string
list
->
Orthomam_db
.
t
->
pdf
file
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