Commit 4edf937b authored by Philippe Veber's avatar Philippe Veber
Browse files

Detection_pipeline: added signature and refactored

parent 4ed2be80
open Bistro
open File_formats
module type Dataset = sig
module type Query = sig
type t
val tree : t -> nhx file
val nucleotide_alignment : t -> nucleotide_fasta file
end
module Make(D : Dataset) = struct
open D
module type S = sig
type query
val amino_acid_alignment : query -> aminoacid_fasta file
val gene_tree : query -> nw file
val dn_tree : query -> text file
val ds_tree : query -> text file
val dnds_tree : query -> text file
val identical : query -> text file
val topological : query -> text file
val multinomial : query -> text file
val multinomial_simulation_lrt : query -> text file
val multinomial_simulation_sparse : query -> text file
val multinomial_asymptotic_lrt : query -> text file
val multinomial_asymptotic_sparse : query -> text file
val tdg09 : query -> text file
val pcoc : ?gamma:bool -> ?ncat:int -> query -> text file
val pcoc_v2 :
?gamma:bool ->
?aa_profiles:Pcoc.aa_profiles ->
query -> text file
val diffsel : query -> text file
val diffseldsparse :
?pi:float ->
?shiftprob:float * float ->
?eps:float ->
query ->
text file
end
module Make(Q : Query) = struct
open Q
let amino_acid_alignment d =
Bppsuite.fna2faa (nucleotide_alignment d)
......@@ -100,12 +130,12 @@ module Make(D : Dataset) = struct
let tree = tree d in
Pcoc.pcoc_v2 ~aa_profiles ~gamma ~faa ~tree ()
|> Pcoc.results
let dn_ds_dnds_trees d =
Testnh.dn_ds_trees_real_data ~fna:(nucleotide_alignment d) ~tree:(tree d) ()
let dn_tree d = (dn_ds_dnds_trees d).dn_tsv
let ds_tree d = (dn_ds_dnds_trees d).ds_tsv
let dnds_tree d = (dn_ds_dnds_trees d).dnds_tsv
end
open Bistro
open File_formats
module type Query = sig
type t
val tree : t -> nhx file
val nucleotide_alignment : t -> nucleotide_fasta file
end
module type S = sig
type query
val amino_acid_alignment : query -> aminoacid_fasta file
val gene_tree : query -> nw file
val dn_tree : query -> text file
val ds_tree : query -> text file
val dnds_tree : query -> text file
val identical : query -> text file
val topological : query -> text file
val multinomial : query -> text file
val multinomial_simulation_lrt : query -> text file
val multinomial_simulation_sparse : query -> text file
val multinomial_asymptotic_lrt : query -> text file
val multinomial_asymptotic_sparse : query -> text file
val tdg09 : query -> text file
val pcoc : ?gamma:bool -> ?ncat:int -> query -> text file
val pcoc_v2 :
?gamma:bool ->
?aa_profiles:Pcoc.aa_profiles ->
query -> text file
val diffsel : query -> text file
val diffseldsparse :
?pi:float ->
?shiftprob:float * float ->
?eps:float ->
query ->
text file
end
module Make(Q : Query) : S with type query := Q.t
......@@ -6,9 +6,10 @@ open Reviewphiltrans_toolbox
let ensembl_tree : nhx file =
Bistro_unix.wget "ftp://ftp.ensembl.org/pub/release-98/compara/species_trees/vertebrates_species-tree_Ensembl.nh"
type alignment = string
let alignments_of_db db =
Orthomam_db.list_alignments db
|> List.map ~f:Workflow.input
let%pworkflow fasta_of_phylip ali =
let ali =
......@@ -20,10 +21,10 @@ let%pworkflow fasta_of_phylip ali =
)
|> Biotk.Fasta.to_file [%dest]
module D = struct
type t = phylip file
module Q = struct
type t = string
let tree _ = ensembl_tree
let nucleotide_alignment = fasta_of_phylip
let nucleotide_alignment ali = fasta_of_phylip (Workflow.input ali)
end
include Detection_pipeline.Make(D)
include Detection_pipeline.Make(Q)
......@@ -2,8 +2,12 @@ open Reviewphiltrans_toolbox
open Bistro
open File_formats
type alignment
val ensembl_tree : nhx file
val alignments_of_db :
Orthomam_db.t ->
phylip file list
alignment list
include Detection_pipeline.S with type query := alignment
......@@ -28,7 +28,7 @@ module Family : sig
type t
val name : t -> string
val make : dataset -> name:string -> ext:string -> t
include Detection_pipeline.Dataset with type t := t
include Detection_pipeline.Query with type t := t
end
=
struct
......
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