Docker-in-Docker (DinD) capabilities of public runners deactivated. More info

Commit ea7e0019 authored by Philippe Veber's avatar Philippe Veber
Browse files

moved Orthomam.Candidate_site to toolbox

parent 7ea2c671
......@@ -12,6 +12,6 @@ let () =
)
|> Top.eval
|> Core.(Fn.flip List.take 10)
|> List.iter Reviewphiltrans.Orthomam.Candidate_site.(fun x -> print_endline x.alignment_id)
|> List.iter Reviewphiltrans_toolbox.Candidate_site.(fun x -> print_endline x.alignment_id)
with
| Failure _ -> ()
......@@ -442,58 +442,6 @@ let%pworkflow convergence_species_tree_pdf ~convergent_species db =
|> Biotk_croquis.Croquis.Layout.simple
|> Fn.flip Biotk_croquis.Croquis.Layout.render_pdf [%dest]
module Candidate_site = struct
open Phylogenetics
module T = struct
type t = {
alignment_id : string ;
pos : int ;
contents : (unit, string * char * bool, float) Tree.t ;
score : float ;
}
let leq s1 s2 = Float.(s1.score <= s2.score)
end
include T
module Heap = CCHeap.Make(T)
let aa_counts s =
let leaves =
Tree.leaves s.contents
|> List.filter_map ~f:(fun (_, aa, cond) ->
match Amino_acid.of_char aa with
| Some aa -> Some (Amino_acid.to_int aa, cond)
| None -> (
match aa with
| '-' -> None
| _ -> invalid_arg "not an AA"
)
)
in
let f sel =
let r = Array.create ~len:Amino_acid.card 0 in
List.iter leaves ~f:(fun (aa, cond) ->
if Bool.(cond = sel) then r.(aa) <- r.(aa) + 1
) ;
r
in
f false, f true
let profile_of_counts k =
let sum = float (Array.fold k ~init:0 ~f:( + )) in
Array.map k ~f:(fun k -> float k /. sum)
let mean_profile s =
let k1, k2 = aa_counts s in
let k = Array.map2_exn k1 k2 ~f:( + ) in
profile_of_counts k
let profiles s =
let k1, k2 = aa_counts s in
profile_of_counts k1, profile_of_counts k2
end
let%workflow ranking_of_results ~alignment_ids ~convergent_species (alignments : aminoacid_fasta file list) (trees : newick file list) result_files ~column_label =
let ranking_size = 1_000 in
let column_label = [%param column_label] in
......
......@@ -76,21 +76,6 @@ val convergence_species_tree_pdf :
Orthomam_db.t ->
pdf file
module Candidate_site : sig
open Phylogenetics
type t = {
alignment_id : string ;
pos : int ;
contents : (unit, string * char * bool, float) Tree.t ;
score : float ;
}
val aa_counts : t -> int array * int array
val mean_profile : t -> float array
val profiles : t -> float array * float array
end
val site_ranking :
?subset:int ->
meth:[`multinomial_asymptotic_lrt | `tdg09] ->
......
open Core_kernel
open Phylogenetics
type t = {
alignment_id : string ;
pos : int ;
contents : (unit, string * char * bool, float) Tree.t ;
score : float ;
}
let aa_counts s =
let leaves =
Tree.leaves s.contents
|> List.filter_map ~f:(fun (_, aa, cond) ->
match Amino_acid.of_char aa with
| Some aa -> Some (Amino_acid.to_int aa, cond)
| None -> (
match aa with
| '-' -> None
| _ -> invalid_arg "not an AA"
)
)
in
let f sel =
let r = Array.create ~len:Amino_acid.card 0 in
List.iter leaves ~f:(fun (aa, cond) ->
if Bool.(cond = sel) then r.(aa) <- r.(aa) + 1
) ;
r
in
f false, f true
let profile_of_counts k =
let sum = float (Array.fold k ~init:0 ~f:( + )) in
Array.map k ~f:(fun k -> float k /. sum)
let mean_profile s =
let k1, k2 = aa_counts s in
let k = Array.map2_exn k1 k2 ~f:( + ) in
profile_of_counts k
let profiles s =
let k1, k2 = aa_counts s in
profile_of_counts k1, profile_of_counts k2
open Phylogenetics
type t = {
alignment_id : string ;
pos : int ;
contents : (unit, string * char * bool, float) Tree.t ;
score : float ;
}
val aa_counts : t -> int array * int array
val mean_profile : t -> float array
val profiles : t -> float array * float array
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment