Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
VEBER Philippe
codepi
Commits
b882da10
Commit
b882da10
authored
Dec 20, 2020
by
Philippe Veber
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tk/Note: support for croquis
parent
34c1af61
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
11 deletions
+26
-11
lib/detection_pipeline.ml
lib/detection_pipeline.ml
+6
-3
lib/orthomam.ml
lib/orthomam.ml
+6
-4
lib/tk/note.ml
lib/tk/note.ml
+13
-3
lib/tk/note.mli
lib/tk/note.mli
+1
-1
No files found.
lib/detection_pipeline.ml
View file @
b882da10
...
...
@@ -250,9 +250,12 @@ module Make (Q : Query) = struct
Biotk
.
Fasta
.
from_file
alignment_path
|>
Base
.
Result
.
ok_or_failwith
|>
snd
in
CS
.
make
~
condition
tree
alignment
site_pos
|>
CS
.
draw
|>
Biotk_croquis
.
Croquis
.
Layout
.
simple
|>
Base
.
Fn
.
flip
Biotk_croquis
.
Croquis
.
Layout
.
render_pdf
dest
let
layout
=
CS
.
make
~
condition
tree
alignment
site_pos
|>
CS
.
draw
|>
Biotk_croquis
.
Croquis
.
Layout
.
simple
in
Biotk_croquis
.
Croquis
.
Layout
.
render
`pdf
layout
(
`File
dest
)
in
Workflow
.
path_plugin
~
descr
:
"detection_pipeline.view_site"
f
...
...
lib/orthomam.ml
View file @
b882da10
...
...
@@ -466,9 +466,11 @@ let convergence_species_tree_pdf ~convergent_species db =
Codepitk
.
Convergence_tree
.
infer_binary_condition_on_branches
t
~
convergent_leaves
:
convergent_species
)
in
render_tree
tree_or_branch
|>
Biotk_croquis
.
Croquis
.
Layout
.
simple
|>
Fn
.
flip
Biotk_croquis
.
Croquis
.
Layout
.
render_pdf
dest
let
layout
=
render_tree
tree_or_branch
|>
Biotk_croquis
.
Croquis
.
Layout
.
simple
in
Biotk_croquis
.
Croquis
.
Layout
.
render
`pdf
layout
(
`File
dest
)
in
Workflow
.
path_plugin
~
descr
:
"orthomam.convergence_species_tree_pdf"
f
...
...
@@ -589,7 +591,7 @@ let draw_site q pos =
|>
Candidate_site
.
draw
|>
Croquis
.
Layout
.
simple
in
Croquis
.
Layout
.
render
_
pdf
picture
dest
Croquis
.
Layout
.
render
`
pdf
picture
(
`File
dest
)
|
Error
msg
->
failwith
msg
in
Workflow
.
path_plugin
~
descr
:
"orthomam."
f
lib/tk/note.ml
View file @
b882da10
...
...
@@ -5,7 +5,7 @@ type elt =
|
Dataframe
of
Dataframe
.
t
*
(
string
*
Dataframe
.
html_formatter
)
list
|
Png
of
string
|
Svg
of
string
|
Vg
of
Vg
.
image
|
Croquis
of
Biotk_croquis
.
Croquis
.
Picture
.
t
type
t
=
{
title
:
string
;
...
...
@@ -21,7 +21,7 @@ let text x = Text x
let
dataframe
?
(
formatters
=
[]
)
d
=
Dataframe
(
d
,
formatters
)
let
png
fn
=
Png
fn
let
svg
fn
=
Svg
fn
let
vg
i
=
Vg
i
let
croquis
c
=
Croquis
c
let
render_picture
format
data
buf
=
let
format
=
match
format
with
...
...
@@ -39,6 +39,16 @@ let render_dataframe formatters data buf =
Tyxml
.
Html
.
pp_elt
()
fmt
(
Dataframe
.
to_html
~
formatters
data
)
;
Format
.
pp_print_flush
fmt
()
let
render_croquis
croquis
buf
=
let
open
Biotk_croquis
.
Croquis
in
let
data
=
let
pic_buf
=
Buffer
.
create
253
in
Layout
.(
render
`svg
(
simple
croquis
)
(
`Buffer
pic_buf
))
;
Buffer
.
contents
pic_buf
in
render_picture
`svg
data
buf
let
header
doc
=
sprintf
{
|---
title
:
%
s
...
...
@@ -55,7 +65,7 @@ let render_doc doc =
|
Png
fn
->
render_picture_on_disk
`png
fn
buf
|
Svg
fn
->
render_picture_on_disk
`svg
fn
buf
|
Dataframe
(
data
,
formatters
)
->
render_dataframe
formatters
data
buf
|
Vg
_
->
assert
false
|
Croquis
croquis
->
render_croquis
croquis
buf
)
;
Buffer
.
add_string
buf
"
\n\n
"
)
;
...
...
lib/tk/note.mli
View file @
b882da10
...
...
@@ -11,7 +11,7 @@ val dataframe :
val
png
:
string
->
elt
val
svg
:
string
->
elt
val
vg
:
Vg
.
image
->
elt
val
croquis
:
Biotk_croquis
.
Croquis
.
Picture
.
t
->
elt
val
make
:
?
toc
:
bool
->
...
...
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