pub fn map_transfer(
    transfers: Vec<(String, String)>,
    parasite_tree: &mut ArenaTree<String>
) -> Vec<(String, String)>
Expand description

Map a transfer in gene tree to the species tree.

Examples found in repository?
examples/read_recphyloxml_2.rs (line 87)
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
fn main() {


    let mut options: Options = Options::new();
    let config: Config = Config::new();
    let transfers = vec![];
    let infile_gene_para = "examples/gene_parasite_page2.recphylo".to_string();
    let infile_para_host = "examples/hote_parasite_page2.recphylo".to_string();

    let outfile_gene_para = String::from("gene_para.svg");
    let outfile_para = String::from("para.svg");
    let outfile_para_rec = String::from("para_rec.svg");
    let outfile_para_host = String::from("para_host.svg");
    let outfile_host = String::from("host.svg");

    // On cree une structure Arena pour l'arbre d'espece
    // et un vecteur de  structures Arena pour le(s) arbres de gènes
    // -------------------------------------------------------------
    // Creation de la structure ArenaTree pour l'arbre d'espece
    // --------------------------------------------------------
    let mut tree_para_pipe: ArenaTree<String> = ArenaTree::default();
    // Creation du vecteur de structure ArenaTree pour les genes
    // ---------------------------------------------------------
    let mut gene_trees:std::vec::Vec<ArenaTree<String>> = Vec::new();
    let mut global_roots: std::vec::Vec<usize> = Vec::new();
    read_recphyloxml_multi(infile_gene_para,&mut tree_para_pipe,&mut gene_trees, &mut global_roots);
    let  nb_gntree =  gene_trees.len().clone();
    println!("Number of gene trees : {}",nb_gntree);
    info!("List of gene trees : {:?}",gene_trees);
    recphyloxml_processing(&mut tree_para_pipe,&mut  gene_trees, &mut options, &config,true,
        &transfers,outfile_gene_para);
    reset_pos(&mut tree_para_pipe);
    phyloxml_processing(&mut tree_para_pipe, &mut options, &config,outfile_para);

    // On cree une structure Arena pour l'arbre d'espece
    // et un vecteur de  structures Arena pour le(s) arbres de gènes
    // -------------------------------------------------------------
    // Creation de la structure ArenaTree pour l'arbre d'espece
    // --------------------------------------------------------
    let mut tree_host_pipe: ArenaTree<String> = ArenaTree::default();
    // Creation du vecteur de structure ArenaTree pour les genes
    // ---------------------------------------------------------
    let mut para_trees:std::vec::Vec<ArenaTree<String>> = Vec::new();
    let mut global_roots: std::vec::Vec<usize> = Vec::new();
    read_recphyloxml_multi(infile_para_host,&mut tree_host_pipe,&mut para_trees, &mut  global_roots);
    let  nb_paratree =  para_trees.len().clone();
    println!("Number of gene trees : {}",nb_paratree);
    info!("List of gene trees : {:?}",para_trees);
    recphyloxml_processing(&mut tree_host_pipe,&mut  para_trees, &mut options, &config,
        true, &transfers,outfile_para_host);
    reset_pos(&mut tree_host_pipe);
    phyloxml_processing(&mut tree_host_pipe, &mut options, &config,outfile_host);
    reset_pos(&mut para_trees[0]);
    phyloxml_processing(&mut para_trees[0], &mut options, &config,outfile_para_rec);

    // Generation du svg 3 niveaux
    println!("Parasite trees as a 'gene tree' : {:?}",para_trees);
    println!("Parasite tree as a 'species tree' : {:?}",tree_para_pipe);
    println!("Map parasite as 'gene' to parasite as 'species'");
    println!("==============================================");
    map_parasite_g2s(&mut tree_para_pipe, &mut para_trees[0]);
    println!("Map parasite as 'species' to paraiste as 'gene'");
    println!("==============================================");
    map_parasite_s2g(&mut tree_para_pipe, &mut para_trees[0], &mut gene_trees);
    println!("Mapping again!");
    println!("Map parasite as 'gene' to parasite as 'species'");
    println!("==============================================");
    map_parasite_g2s(&mut tree_para_pipe, &mut para_trees[0]);
    summary(&mut tree_para_pipe);

    reset_pos(&mut tree_para_pipe);
    reset_pos(&mut gene_trees[0]);
    recphyloxml_processing(&mut tree_para_pipe, &mut gene_trees, &mut options, &config, false,
        &transfers,"test_mapped.svg".to_string());

    // Generation des svg hote parsite  +transfert gene

    let gene_transfers = get_gtransfer(&mut gene_trees[0]);
    println!("Transfers = {:?}",gene_transfers);
    let mapped_gene_transfers = map_transfer(gene_transfers, &mut para_trees[0]);
    println!("Mapped transfers = {:?}",mapped_gene_transfers);
    reset_pos(&mut tree_host_pipe);
    reset_pos(&mut para_trees[0]);
    recphyloxml_processing(&mut tree_host_pipe, &mut para_trees, &mut options, &config,
        false, &mapped_gene_transfers,"test_mapped_2levels.svg".to_string());



}
More examples
Hide additional examples
examples/read_recphyloxml_3.rs (line 119)
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
fn main() {


    let mut options: Options = Options::new();
    let mut config: Config = Config::new();
    config.species_opacity = "0.7".to_string();
    config.gene_opacity = "0.9".to_string();
    let transfers = vec![];
    let infile_gene_para = "examples/recgs_dtl.recphyloxml".to_string();
    let infile_para_host = "examples/rechp_dtl.recphyloxml".to_string();

    // let infile_gene_para = "examples/gene_parasite_page4.recphylo".to_string();
    // let infile_para_host = "examples/hote_parasite_page4.recphylo".to_string();


    let outfile_gene_para = String::from("gene_para.svg");
    let outfile_para = String::from("para.svg");
    let outfile_para_rec = String::from("para_rec.svg");
    let outfile_para_host = String::from("para_host.svg");
    let outfile_host = String::from("host.svg");

    // On cree une structure Arena pour l'arbre d'espece
    // et un vecteur de  structures Arena pour le(s) arbres de gènes
    // -------------------------------------------------------------
    // Creation de la structure ArenaTree pour l'arbre d'espece
    // --------------------------------------------------------
    let mut tree_para_pipe: ArenaTree<String> = ArenaTree::default();
    // Creation du vecteur de structure ArenaTree pour les genes
    // ---------------------------------------------------------
    let mut gene_trees:std::vec::Vec<ArenaTree<String>> = Vec::new();
    let mut global_roots: std::vec::Vec<usize> = Vec::new();
    read_recphyloxml_multi(infile_gene_para, &mut tree_para_pipe, &mut gene_trees, &mut global_roots);
    let  nb_gntree =  gene_trees.len().clone();
    // let mut gene_trees_clone:std::vec::Vec<ArenaTree<String>> = Vec::new();
    // let mut i = 0;
    // while i < nb_gntree {
    //  gene_trees_clone.push(gene_trees[i].clone());
    // i = i + 1;
    // }
    println!("Number of gene trees : {}",nb_gntree);
    info!("List of gene trees : {:?}",gene_trees);
    recphyloxml_processing(&mut tree_para_pipe,&mut  gene_trees, &mut options, &config,true,
        &transfers,outfile_gene_para);
    reset_pos(&mut tree_para_pipe);
    phyloxml_processing(&mut tree_para_pipe, &mut options, &config,outfile_para);

    // On cree une structure Arena pour l'arbre d'espece
    // et un vecteur de  structures Arena pour le(s) arbres de gènes
    // -------------------------------------------------------------
    // Creation de la structure ArenaTree pour l'arbre d'espece
    // --------------------------------------------------------
    let mut tree_host_pipe: ArenaTree<String> = ArenaTree::default();
    // Creation du vecteur de structure ArenaTree pour les genes
    // ---------------------------------------------------------
    let mut para_trees:std::vec::Vec<ArenaTree<String>> = Vec::new();
    let mut global_roots: std::vec::Vec<usize> = Vec::new();
    read_recphyloxml_multi(infile_para_host,&mut tree_host_pipe,&mut para_trees, &mut global_roots);
    let  nb_paratree =  para_trees.len().clone();
    assert_eq!(nb_paratree,1,"I want only one parasite tree");
    println!("Number of gene trees : {}",nb_paratree);
    info!("List of gene trees : {:?}",para_trees);
    recphyloxml_processing(&mut tree_host_pipe,&mut  para_trees, &mut options, &config,
        true, &transfers,outfile_para_host);
    reset_pos(&mut tree_host_pipe);
    phyloxml_processing(&mut tree_host_pipe, &mut options, &config,outfile_host);
    reset_pos(&mut para_trees[0]);
    phyloxml_processing(&mut para_trees[0], &mut options, &config,outfile_para_rec);

    // Generation du svg 3 niveaux
    println!("Parasite trees as a 'gene tree' : {:?}",para_trees);
    println!("Parasite tree as a 'species tree' : {:?}",tree_para_pipe);
    println!("Map parasite as 'gene' to parasite as 'species'");
    println!("==============================================");
    map_parasite_g2s(&mut tree_para_pipe, &mut para_trees[0]);
    println!("Map parasite as 'species' to paraiste as 'gene'");
    println!("==============================================");
    map_parasite_s2g(&mut tree_para_pipe, &mut para_trees[0], &mut gene_trees);
    println!("MAP AGAIN!");
    println!("MON GROS DEBUG PARAPIPE1{:?}",&mut tree_para_pipe);
    println!("Map parasite as 'gene' to parasite as 'species'");
    println!("==============================================");
    map_parasite_g2s(&mut tree_para_pipe, &mut para_trees[0]);
    summary(&mut tree_para_pipe);


    reset_pos(&mut tree_para_pipe);
    let mut i = 0;
    while i < nb_gntree {
    reset_pos(&mut gene_trees[i]);
    i = i + 1;
    }
    // reset_pos(&mut gene_trees[0]);
    // reset_pos(&mut gene_trees[1]);
    // reset_pos(&mut gene_trees[2]);
    // reset_pos(&mut gene_trees[2]);
    // options.species_internal = true;
    // options.gene_internal = true;
//     options.verbose = true;
//     env::set_var("RUST_LOG", "info");
// env_logger::init();
// info!("Verbosity set to Info");

    // attention on ne remape pas
    recphyloxml_processing(&mut tree_para_pipe, &mut gene_trees, &mut options, &config, false,
        &transfers,"visu_3levels_1.svg".to_string());

    // Generation des svg hote parsite  +transfert gene

    let gene_transfers = get_gtransfer(&mut gene_trees[0]);
    println!("Transfers = {:?}",gene_transfers);
    let mut mapped_gene_transfers = map_transfer(gene_transfers, &mut para_trees[0]);
    println!("Mapped transfers = {:?}",mapped_gene_transfers);
    let mut i = 1;
    while i < nb_gntree {
        let gene_transfers = get_gtransfer(&mut gene_trees[i]);
        println!("Transfers = {:?}",gene_transfers);
        let mapped = map_transfer(gene_transfers, &mut para_trees[0]);
        println!("Mapped transfers = {:?}",mapped);
        for val in mapped {
            mapped_gene_transfers.push(val);
        }
        i = i + 1;
    }
    reset_pos(&mut tree_host_pipe);
    reset_pos(&mut para_trees[0]);
    // attention on ne remape pas
    recphyloxml_processing(&mut tree_host_pipe, &mut para_trees, &mut options, &config,
        false, &mapped_gene_transfers,"visu_3levels_2.svg".to_string());


    // mapping des gene sur les hotes via les parasites
    map_gene_host(&mut gene_trees, &mut para_trees, &mut tree_host_pipe);
    reset_pos(&mut tree_host_pipe);
    let mut i = 0;
    while i < nb_gntree {
        reset_pos(&mut gene_trees[i]);
        i = i + 1;
    }
    recphyloxml_processing(&mut tree_host_pipe, &mut gene_trees, &mut options, &config,
        true, &vec![],"visu_3levels_3.svg".to_string());
}
examples/read_recphyloxml_thirdlevel_5.rs (line 136)
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
fn main() {


    let mut options: Options = Options::new();
    let mut config: Config = Config::new();
    config.species_opacity = "0.7".to_string();
    config.gene_opacity = "0.9".to_string();
    let transfers = vec![];
    let infile_gs = "examples/test4/gene_parasite_page4.recphylo".to_string();
    let infile_sh = "examples/test4/hote_parasite_page4.recphylo".to_string();
    // Traitement de 2 fichier fichiers recPhyloXML
    println!("Two reconciled files => displaying 3-levels reconciliations. ");
    let  outfile_gene_para = String::from("gene_para.svg");
    let  outfile_para_host = String::from("para_host.svg");
    let  outfile_mapped_1 = String::from("mapped_1.svg");
    let  outfile_mapped_2 = String::from("mapped_2.svg");

// ---------------------------------------------------------
// Create a structure Arena for the global parasite pipe
// tree and a vector of structures Arena for gene path trees
// ---------------------------------------------------------
let mut global_pipe_parasite: ArenaTree<String> = ArenaTree::default();
let mut global_roots: std::vec::Vec<usize> = Vec::new();
let mut path_genes: std::vec::Vec<ArenaTree<String>> = Vec::new();
// ---------------------------------------------------------
// Fill global parasite pipe tree and is roots and path
// genes trees
// ---------------------------------------------------------
read_recphyloxml_multi(infile_gs,&mut global_pipe_parasite,&mut path_genes,&mut global_roots);
let  nb_gntree =  path_genes.len().clone();
println!("Number of gene trees : {}",nb_gntree);
info!("List of gene trees : {:?}",path_genes);
let  nb_parasite_pipe =  global_roots.len().clone();
println!("Number of parasite trees : {}",nb_parasite_pipe);
println!("List of species trees roots : {:?}",global_roots);
info!("Global parasite pipe tree : {:?}",global_pipe_parasite);
// ---------------------------------------------------------
// Generate svg of the lobal parasite pipe tree and  path
// genes trees
// ---------------------------------------------------------
recphyloxml_processing(&mut global_pipe_parasite,&mut  path_genes, &mut options, &config,true,
    &transfers,outfile_gene_para);
// ---------------------------------------------------------
// Create a structure Arena for the host pipe tree and a
// vector of structures Arena for parasite path trees
// ---------------------------------------------------------
let mut tree_host_pipe: ArenaTree<String> = ArenaTree::default();
let mut path_para_trees:std::vec::Vec<ArenaTree<String>> = Vec::new();
// ---------------------------------------------------------
// Fill  host pipe tree and is roots and path parasite trees
// ---------------------------------------------------------
let mut global_roots: std::vec::Vec<usize> = Vec::new();
read_recphyloxml_multi(infile_sh,&mut tree_host_pipe,&mut path_para_trees, &mut global_roots);
let  nb_parasite_path =  path_para_trees.len().clone();
println!("Number of pipe parasite trees in gene-parasite file : {}",nb_parasite_pipe);
println!("Number of path parasite trees in parasite-host file : {}",nb_parasite_path);
if nb_parasite_path != nb_parasite_pipe {
println!();
println!("==============================================");
println!("Error! Different number of parasite trees in the 2 files!");
println!("       Resulting svg will be incomplete.");
println!("==============================================");
println!();
}
// ---------------------------------------------------------
// Generate svg of the host pipe tree and path parasite trees
// ---------------------------------------------------------
recphyloxml_processing(&mut tree_host_pipe,&mut  path_para_trees, &mut options, &config,
true, &transfers,outfile_para_host);
// ---------------------------------------------------------
// Generation of first 3 levels svg
// ---------------------------------------------------------
info!("Parasite trees as a 'path tree' : {:?}",path_para_trees);
info!("Parasite tree as a 'pipe tree' : {:?}",global_pipe_parasite);
println!("==============================================");
println!("Map parasite as 'path' to parasite as 'pipe'");
println!("==============================================");
let mut i = 0;
while i < nb_parasite_pipe {
    map_parasite_g2s(&mut global_pipe_parasite, &mut path_para_trees[i]);
i = i + 1;
}
info!("Global parasite tree wih events : {:?}",global_pipe_parasite);
reset_pos(&mut global_pipe_parasite);
let mut i = 0;
while i < nb_gntree {
reset_pos(&mut path_genes[i]);
i = i + 1;
}
println!("==============================================");
println!("Map parasite as 'species' to parasite as 'gene'");
println!("==============================================");
let mut i = 0;
while i < nb_parasite_pipe {
map_parasite_s2g(&mut global_pipe_parasite, &mut path_para_trees[i],&mut path_genes);
i = i +  1;
}
info!("Global pipe parasite after mapping s2g : {:?}",global_pipe_parasite);
println!("==============================================");
println!("Map parasite as 'gene' to parasite as 'species' again");
println!("==============================================");
let mut i = 0;
while i < nb_parasite_pipe {
map_parasite_g2s(&mut global_pipe_parasite, &mut path_para_trees[i]);
i = i + 1;
}
reset_pos(&mut global_pipe_parasite);
let mut i = 0;
while i < nb_gntree {
reset_pos(&mut path_genes[i]);
i = i + 1;
}
// attention on ne remape pas
recphyloxml_processing(&mut global_pipe_parasite,&mut  path_genes, &mut options, &config,false,
    &transfers,outfile_mapped_1);
// ---------------------------------------------------------
// Generation of second 3 levels svg
// ---------------------------------------------------------
let mut i = 0;
let gene_transfers = get_gtransfer(&mut path_genes[i]);
info!("Transfers = {:?}",gene_transfers);
let mut mapped_gene_transfers = map_transfer_mul(gene_transfers, &mut path_para_trees);
info!("Mapped transfers = {:?}",mapped_gene_transfers);
i = i + 1;
while i < nb_gntree {
let gene_transfers = get_gtransfer(&mut path_genes[i]);
info!("Transfers = {:?}",gene_transfers);
let mapped = map_transfer(gene_transfers, &mut path_para_trees[0]);
info!("Mapped transfers = {:?}",mapped);
for val in mapped {
    mapped_gene_transfers.push(val);
}
i = i + 1;
}
reset_pos(&mut tree_host_pipe);
let mut i = 0;
while i < nb_parasite_pipe {
reset_pos(&mut path_para_trees[i]);
i = i + 1;
}
println!("Building svg 2:  parasite tree within host pipe tree and mapped tarnsfers {}",
outfile_mapped_2);
// attention on ne remape pas
recphyloxml_processing(&mut tree_host_pipe, &mut path_para_trees, &mut options, &config,
false, &mapped_gene_transfers,outfile_mapped_2);

reset_pos(&mut global_pipe_parasite);
phyloxml_processing(&mut global_pipe_parasite, &mut options, &config,"para_simple.svg".to_string());
reset_pos(&mut tree_host_pipe);
phyloxml_processing(&mut tree_host_pipe, &mut options, &config,"host_simple.svg".to_string());
let mut i = 0;
while i < nb_parasite_pipe {
reset_pos(&mut path_para_trees[i]);
phyloxml_processing(&mut path_para_trees[i], &mut options, &config,("gene_simple_".to_owned()+&i.to_string()+".svg").to_string());
i = i + 1;
}

//llmlmlmlmlmlm
// mapping des gene sur les hotes via les parasites
// let mut i = 0;
// while i < nb_parasite_pipe {
// map_gene_host(&mut path_genes, &mut path_para_trees[i], &mut tree_host_pipe);
// i = i + 1;
// }
map_gene_host(&mut path_genes, &mut path_para_trees, &mut tree_host_pipe);

// map_gene_host(&mut path_genes, &mut path_para_trees[1], &mut tree_host_pipe);
reset_pos(&mut tree_host_pipe);
let mut i = 0;
while i < nb_gntree {
reset_pos(&mut path_genes[i]);
i = i + 1;
}
recphyloxml_processing(&mut tree_host_pipe, &mut path_genes, &mut options, &config,
true, &vec![],"mapped_3.svg".to_string());
// lmlmlmlm

println!("Output files:");

println!(" - host_simple.svg ...... 1 level: host tree");
let mut i = 0;
while i < nb_parasite_pipe {
println!(" - para_simple.svg ...... 2 levels: gene_simple_{}.svg",&i);
i = i + 1;
}
println!(" - para_simple.svg ...... 2 levels: parasite tree(s)");
println!(" - gene_para.svg ........ 2 levels: pipe parasite tree(s) with gene tree(s) inside");
println!(" - para_host.svg ........ 2 levels: pipe host tree with parasite tree(s) inside");
println!(" - mapped_1.svg ........  3 levels: reconciled pipe parasite tree(s) with gene tree(s)");
println!(" - mapped_2.svg ........  3 levels: parasite-host reconciliation plus gene transfers");
println!(" - mapped_3.svg ........  3 levels: pipe host tree with gene tree(s) inside");

if nb_parasite_path != nb_parasite_pipe {
println!();
println!("==============================================");
println!("Error! Different number of parasite trees in the 2 files!");
println!("       Resulting svg will be incomplete.");
println!("==============================================");
println!();
}
}
examples/read_recphyloxml_thirdlevel_6.rs (line 139)
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
fn main() {
    // env::set_var("RUST_LOG", "info");
    // env_logger::init();

    let mut options: Options = Options::new();
    options.gene_internal = true;
    let mut config: Config = Config::new();
    config.species_opacity = "0.7".to_string();
    config.gene_opacity = "0.9".to_string();
    let transfers = vec![];

    let infile_gs = "examples/rec0.recphyloxml".to_string();
    let infile_sh = "examples/rec0upper.recphyloxml".to_string();
    // Traitement de 2 fichier fichiers recPhyloXML
    println!("Two reconciled files => displaying 3-levels reconciliations. ");
    let  outfile_gene_para = String::from("gene_para.svg");
    let  outfile_para_host = String::from("para_host.svg");
    let  outfile_mapped_1 = String::from("mapped_1.svg");
    let  outfile_mapped_2 = String::from("mapped_2.svg");

// ---------------------------------------------------------
// Create a structure Arena for the global parasite pipe
// tree and a vector of structures Arena for gene path trees
// ---------------------------------------------------------
let mut global_pipe_parasite: ArenaTree<String> = ArenaTree::default();
let mut global_roots: std::vec::Vec<usize> = Vec::new();
let mut path_genes: std::vec::Vec<ArenaTree<String>> = Vec::new();
// ---------------------------------------------------------
// Fill global parasite pipe tree and is roots and path
// genes trees
// ---------------------------------------------------------
read_recphyloxml_multi(infile_gs,&mut global_pipe_parasite,&mut path_genes,&mut global_roots);
let  nb_gntree =  path_genes.len().clone();
println!("Number of gene trees : {}",nb_gntree);
info!("List of gene trees : {:?}",path_genes);
let  nb_parasite_pipe =  global_roots.len().clone();
println!("Number of parasite trees : {}",nb_parasite_pipe);
println!("List of species trees roots : {:?}",global_roots);
info!("Global parasite pipe tree : {:?}",global_pipe_parasite);
// ---------------------------------------------------------
// Generate svg of the lobal parasite pipe tree and  path
// genes trees
// ---------------------------------------------------------
recphyloxml_processing(&mut global_pipe_parasite,&mut  path_genes, &mut options, &config,true,
    &transfers,outfile_gene_para);
// ---------------------------------------------------------
// Create a structure Arena for the host pipe tree and a
// vector of structures Arena for parasite path trees
// ---------------------------------------------------------
let mut tree_host_pipe: ArenaTree<String> = ArenaTree::default();
let mut path_para_trees:std::vec::Vec<ArenaTree<String>> = Vec::new();
// ---------------------------------------------------------
// Fill  host pipe tree and is roots and path parasite trees
// ---------------------------------------------------------
let mut global_roots: std::vec::Vec<usize> = Vec::new();
read_recphyloxml_multi(infile_sh,&mut tree_host_pipe,&mut path_para_trees, &mut global_roots);
let  nb_parasite_path =  path_para_trees.len().clone();
println!("Number of pipe parasite trees in gene-parasite file : {}",nb_parasite_pipe);
println!("Number of path parasite trees in parasite-host file : {}",nb_parasite_path);
if nb_parasite_path != nb_parasite_pipe {
println!();
println!("==============================================");
println!("Error! Different number of parasite trees in the 2 files!");
println!("       Resulting svg will be incomplete.");
println!("==============================================");
println!();
}
// ---------------------------------------------------------
// Generate svg of the host pipe tree and path parasite trees
// ---------------------------------------------------------
recphyloxml_processing(&mut tree_host_pipe,&mut  path_para_trees, &mut options, &config,
true, &transfers,outfile_para_host);
// ---------------------------------------------------------
// Generation of first 3 levels svg
// ---------------------------------------------------------
info!("Parasite trees as a 'path tree' : {:?}",path_para_trees);
info!("Parasite tree as a 'pipe tree' : {:?}",global_pipe_parasite);
println!("==============================================");
println!("Map parasite as 'path' to parasite as 'pipe'");
println!("==============================================");
let mut i = 0;
while i < nb_parasite_pipe {
    map_parasite_g2s(&mut global_pipe_parasite, &mut path_para_trees[i]);
i = i + 1;
}
info!("Global parasite tree wih events : {:?}",global_pipe_parasite);
reset_pos(&mut global_pipe_parasite);
let mut i = 0;
while i < nb_gntree {
reset_pos(&mut path_genes[i]);
i = i + 1;
}
println!("==============================================");
println!("Map parasite as 'species' to parasite as 'gene'");
println!("==============================================");
let mut i = 0;
while i < nb_parasite_pipe {
map_parasite_s2g(&mut global_pipe_parasite, &mut path_para_trees[i],&mut path_genes);
i = i +  1;
}
info!("Global pipe parasite after mapping s2g : {:?}",global_pipe_parasite);
println!("==============================================");
println!("Map parasite as 'gene' to parasite as 'species' again");
println!("==============================================");
let mut i = 0;
while i < nb_parasite_pipe {
map_parasite_g2s(&mut global_pipe_parasite, &mut path_para_trees[i]);
i = i + 1;
}
reset_pos(&mut global_pipe_parasite);
let mut i = 0;
while i < nb_gntree {
reset_pos(&mut path_genes[i]);
i = i + 1;
}
// attention on ne remape pas
recphyloxml_processing(&mut global_pipe_parasite,&mut  path_genes, &mut options, &config,false,
    &transfers,outfile_mapped_1);
// ---------------------------------------------------------
// Generation of second 3 levels svg
// ---------------------------------------------------------
let mut i = 0;
let gene_transfers = get_gtransfer(&mut path_genes[i]);
info!("Transfers = {:?}",gene_transfers);
let mut mapped_gene_transfers = map_transfer_mul(gene_transfers, &mut path_para_trees);
info!("Mapped transfers = {:?}",mapped_gene_transfers);
i = i + 1;
while i < nb_gntree {
let gene_transfers = get_gtransfer(&mut path_genes[i]);
info!("Transfers = {:?}",gene_transfers);
let mapped = map_transfer(gene_transfers, &mut path_para_trees[0]);
info!("Mapped transfers = {:?}",mapped);
for val in mapped {
    mapped_gene_transfers.push(val);
}
i = i + 1;
}
reset_pos(&mut tree_host_pipe);
let mut i = 0;
while i < nb_parasite_pipe {
reset_pos(&mut path_para_trees[i]);
i = i + 1;
}
println!("Building svg 2:  parasite tree within host pipe tree and mapped tarnsfers {}",
outfile_mapped_2);
// attention on ne remape pas
recphyloxml_processing(&mut tree_host_pipe, &mut path_para_trees, &mut options, &config,
false, &mapped_gene_transfers,outfile_mapped_2);

reset_pos(&mut global_pipe_parasite);
phyloxml_processing(&mut global_pipe_parasite, &mut options, &config,"para_simple.svg".to_string());
reset_pos(&mut tree_host_pipe);
phyloxml_processing(&mut tree_host_pipe, &mut options, &config,"host_simple.svg".to_string());
let mut i = 0;
while i < nb_parasite_pipe {
reset_pos(&mut path_para_trees[i]);
phyloxml_processing(&mut path_para_trees[i], &mut options, &config,("gene_simple_".to_owned()+&i.to_string()+".svg").to_string());
i = i + 1;
}

//llmlmlmlmlmlm
// mapping des gene sur les hotes via les parasites
println!("Building svg 3: gene  tree within host pipe tree");
map_gene_host(&mut path_genes, &mut path_para_trees, &mut tree_host_pipe);

// map_gene_host(&mut path_genes, &mut path_para_trees[1], &mut tree_host_pipe);
reset_pos(&mut tree_host_pipe);
let mut i = 0;
while i < nb_gntree {
reset_pos(&mut path_genes[i]);
i = i + 1;
}

recphyloxml_processing(&mut tree_host_pipe, &mut path_genes, &mut options, &config,
true, &vec![],"mapped_3.svg".to_string());
// println!("DEBUG  FINAL HOST = {:?}",tree_host_pipe);
// lmlmlmlm

println!("Output files:");

println!(" - host_simple.svg ...... 1 level: host tree");
let mut i = 0;
while i < nb_parasite_pipe {
println!(" - para_simple.svg ...... 2 levels: gene_simple_{}.svg",&i);
i = i + 1;
}
println!(" - para_simple.svg ...... 2 levels: parasite tree(s)");
println!(" - gene_para.svg ........ 2 levels: pipe parasite tree(s) with gene tree(s) inside");
println!(" - para_host.svg ........ 2 levels: pipe host tree with parasite tree(s) inside");
println!(" - mapped_1.svg ........  3 levels: reconciled pipe parasite tree(s) with gene tree(s)");
println!(" - mapped_2.svg ........  3 levels: parasite-host reconciliation plus gene transfers");
println!(" - mapped_3.svg ........  3 levels: pipe host tree with gene tree(s) inside");

if nb_parasite_path != nb_parasite_pipe {
println!();
println!("==============================================");
println!("Error! Different number of parasite trees in the 2 files!");
println!("       Resulting svg will be incomplete.");
println!("==============================================");
println!();
}
}
examples/read_recphyloxml_thirdlevel_bug.rs (line 140)
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
fn main() {
    // env::set_var("RUST_LOG", "info");
    // env_logger::init();

    let mut options: Options = Options::new();
    options.gene_internal = true;
    options.species_internal = true;
    let mut config: Config = Config::new();
    config.species_opacity = "0.7".to_string();
    config.gene_opacity = "0.9".to_string();
    let transfers = vec![];

    let infile_gs = "examples/rec0.bug.recphyloxml".to_string();
    let infile_sh = "examples/rec0upper.bug.recphyloxml".to_string();
    // Traitement de 2 fichier fichiers recPhyloXML
    println!("Two reconciled files => displaying 3-levels reconciliations. ");
    let  outfile_gene_para = String::from("gene_para.svg");
    let  outfile_para_host = String::from("para_host.svg");
    let  outfile_mapped_1 = String::from("mapped_1.svg");
    let  outfile_mapped_2 = String::from("mapped_2.svg");

// ---------------------------------------------------------
// Create a structure Arena for the global parasite pipe
// tree and a vector of structures Arena for gene path trees
// ---------------------------------------------------------
let mut global_pipe_parasite: ArenaTree<String> = ArenaTree::default();
let mut global_roots: std::vec::Vec<usize> = Vec::new();
let mut path_genes: std::vec::Vec<ArenaTree<String>> = Vec::new();
// ---------------------------------------------------------
// Fill global parasite pipe tree and is roots and path
// genes trees
// ---------------------------------------------------------
read_recphyloxml_multi(infile_gs,&mut global_pipe_parasite,&mut path_genes,&mut global_roots);
let  nb_gntree =  path_genes.len().clone();
println!("Number of gene trees : {}",nb_gntree);
info!("List of gene trees : {:?}",path_genes);
let  nb_parasite_pipe =  global_roots.len().clone();
println!("Number of parasite trees : {}",nb_parasite_pipe);
println!("List of species trees roots : {:?}",global_roots);
info!("Global parasite pipe tree : {:?}",global_pipe_parasite);
// ---------------------------------------------------------
// Generate svg of the lobal parasite pipe tree and  path
// genes trees
// ---------------------------------------------------------
recphyloxml_processing(&mut global_pipe_parasite,&mut  path_genes, &mut options, &config,true,
    &transfers,outfile_gene_para);
// ---------------------------------------------------------
// Create a structure Arena for the host pipe tree and a
// vector of structures Arena for parasite path trees
// ---------------------------------------------------------
let mut tree_host_pipe: ArenaTree<String> = ArenaTree::default();
let mut path_para_trees:std::vec::Vec<ArenaTree<String>> = Vec::new();
// ---------------------------------------------------------
// Fill  host pipe tree and is roots and path parasite trees
// ---------------------------------------------------------
let mut global_roots: std::vec::Vec<usize> = Vec::new();
read_recphyloxml_multi(infile_sh,&mut tree_host_pipe,&mut path_para_trees, &mut global_roots);
let  nb_parasite_path =  path_para_trees.len().clone();
println!("Number of pipe parasite trees in gene-parasite file : {}",nb_parasite_pipe);
println!("Number of path parasite trees in parasite-host file : {}",nb_parasite_path);
if nb_parasite_path != nb_parasite_pipe {
println!();
println!("==============================================");
println!("Error! Different number of parasite trees in the 2 files!");
println!("       Resulting svg will be incomplete.");
println!("==============================================");
println!();
}
// ---------------------------------------------------------
// Generate svg of the host pipe tree and path parasite trees
// ---------------------------------------------------------
recphyloxml_processing(&mut tree_host_pipe,&mut  path_para_trees, &mut options, &config,
true, &transfers,outfile_para_host);
// ---------------------------------------------------------
// Generation of first 3 levels svg
// ---------------------------------------------------------
info!("Parasite trees as a 'path tree' : {:?}",path_para_trees);
info!("Parasite tree as a 'pipe tree' : {:?}",global_pipe_parasite);
println!("==============================================");
println!("Map parasite as 'path' to parasite as 'pipe'");
println!("==============================================");
let mut i = 0;
while i < nb_parasite_pipe {
    map_parasite_g2s(&mut global_pipe_parasite, &mut path_para_trees[i]);
i = i + 1;
}
info!("Global parasite tree wih events : {:?}",global_pipe_parasite);
reset_pos(&mut global_pipe_parasite);
let mut i = 0;
while i < nb_gntree {
reset_pos(&mut path_genes[i]);
i = i + 1;
}
println!("==============================================");
println!("Map parasite as 'species' to parasite as 'gene'");
println!("==============================================");
let mut i = 0;
while i < nb_parasite_pipe {
map_parasite_s2g(&mut global_pipe_parasite, &mut path_para_trees[i],&mut path_genes);
i = i +  1;
}
info!("Global pipe parasite after mapping s2g : {:?}",global_pipe_parasite);
println!("==============================================");
println!("Map parasite as 'gene' to parasite as 'species' again");
println!("==============================================");
let mut i = 0;
while i < nb_parasite_pipe {
map_parasite_g2s(&mut global_pipe_parasite, &mut path_para_trees[i]);
i = i + 1;
}
reset_pos(&mut global_pipe_parasite);
let mut i = 0;
while i < nb_gntree {
reset_pos(&mut path_genes[i]);
i = i + 1;
}
// attention on ne remape pas
recphyloxml_processing(&mut global_pipe_parasite,&mut  path_genes, &mut options, &config,false,
    &transfers,outfile_mapped_1);
// ---------------------------------------------------------
// Generation of second 3 levels svg
// ---------------------------------------------------------
let mut i = 0;
let gene_transfers = get_gtransfer(&mut path_genes[i]);
info!("Transfers = {:?}",gene_transfers);
let mut mapped_gene_transfers = map_transfer_mul(gene_transfers, &mut path_para_trees);
info!("Mapped transfers = {:?}",mapped_gene_transfers);
i = i + 1;
while i < nb_gntree {
let gene_transfers = get_gtransfer(&mut path_genes[i]);
info!("Transfers = {:?}",gene_transfers);
let mapped = map_transfer(gene_transfers, &mut path_para_trees[0]);
info!("Mapped transfers = {:?}",mapped);
for val in mapped {
    mapped_gene_transfers.push(val);
}
i = i + 1;
}
reset_pos(&mut tree_host_pipe);
let mut i = 0;
while i < nb_parasite_pipe {
reset_pos(&mut path_para_trees[i]);
i = i + 1;
}
println!("Building svg 2:  parasite tree within host pipe tree and mapped tarnsfers {}",
outfile_mapped_2);
// attention on ne remape pas
recphyloxml_processing(&mut tree_host_pipe, &mut path_para_trees, &mut options, &config,
false, &mapped_gene_transfers,outfile_mapped_2);

reset_pos(&mut global_pipe_parasite);
phyloxml_processing(&mut global_pipe_parasite, &mut options, &config,"para_simple.svg".to_string());
reset_pos(&mut tree_host_pipe);
phyloxml_processing(&mut tree_host_pipe, &mut options, &config,"host_simple.svg".to_string());
let mut i = 0;
while i < nb_parasite_pipe {
reset_pos(&mut path_para_trees[i]);
phyloxml_processing(&mut path_para_trees[i], &mut options, &config,("gene_simple_".to_owned()+&i.to_string()+".svg").to_string());
i = i + 1;
}

//llmlmlmlmlmlm
// mapping des gene sur les hotes via les parasites
println!("Building svg 3: gene  tree within host pipe tree");
map_gene_host(&mut path_genes, &mut path_para_trees, &mut tree_host_pipe);

// map_gene_host(&mut path_genes, &mut path_para_trees[1], &mut tree_host_pipe);
reset_pos(&mut tree_host_pipe);
let mut i = 0;
while i < nb_gntree {
reset_pos(&mut path_genes[i]);
i = i + 1;
}

recphyloxml_processing(&mut tree_host_pipe, &mut path_genes, &mut options, &config,
true, &vec![],"mapped_3.svg".to_string());
// println!("DEBUG  FINAL HOST = {:?}",tree_host_pipe);
// lmlmlmlm

println!("Output files:");

println!(" - host_simple.svg ...... 1 level: host tree");
let mut i = 0;
while i < nb_parasite_pipe {
println!(" - para_simple.svg ...... 2 levels: gene_simple_{}.svg",&i);
i = i + 1;
}
println!(" - para_simple.svg ...... 2 levels: parasite tree(s)");
println!(" - gene_para.svg ........ 2 levels: pipe parasite tree(s) with gene tree(s) inside");
println!(" - para_host.svg ........ 2 levels: pipe host tree with parasite tree(s) inside");
println!(" - mapped_1.svg ........  3 levels: reconciled pipe parasite tree(s) with gene tree(s)");
println!(" - mapped_2.svg ........  3 levels: parasite-host reconciliation plus gene transfers");
println!(" - mapped_3.svg ........  3 levels: pipe host tree with gene tree(s) inside");

if nb_parasite_path != nb_parasite_pipe {
println!();
println!("==============================================");
println!("Error! Different number of parasite trees in the 2 files!");
println!("       Resulting svg will be incomplete.");
println!("==============================================");
println!();
}
}
examples/read_recphyloxml_thirdlevel_1.rs (line 139)
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
fn main() {


    let mut options: Options = Options::new();
    options.gene_internal = true;
    options.species_internal = true;
    let mut config: Config = Config::new();
    config.species_opacity = "0.7".to_string();
    config.gene_opacity = "0.9".to_string();
    let transfers = vec![];
    // let infile_gs = "examples/recgs_mult_host_dtl.recphyloxml".to_string();
        let infile_gs = "examples/test1/recgs_dtl.recphyloxml".to_string();
    let infile_sh = "examples/test1/rechp_dtl.recphyloxml".to_string();
    // Traitement de 2 fichier fichiers recPhyloXML
    println!("Two reconciled files => displaying 3-levels reconciliations. ");
    let  outfile_gene_para = String::from("gene_para.svg");
    let  outfile_para_host = String::from("para_host.svg");
    let  outfile_mapped_1 = String::from("mapped_1.svg");
    let  outfile_mapped_2 = String::from("mapped_2.svg");

// ---------------------------------------------------------
// Create a structure Arena for the global parasite pipe
// tree and a vector of structures Arena for gene path trees
// ---------------------------------------------------------
let mut global_pipe_parasite: ArenaTree<String> = ArenaTree::default();
let mut global_roots: std::vec::Vec<usize> = Vec::new();
let mut path_genes: std::vec::Vec<ArenaTree<String>> = Vec::new();
// ---------------------------------------------------------
// Fill global parasite pipe tree and is roots and path
// genes trees
// ---------------------------------------------------------
read_recphyloxml_multi(infile_gs,&mut global_pipe_parasite,&mut path_genes,&mut global_roots);
let  nb_gntree =  path_genes.len().clone();
println!("Number of gene trees : {}",nb_gntree);
info!("List of gene trees : {:?}",path_genes);
let  nb_parasite_pipe =  global_roots.len().clone();
println!("Number of parasite trees : {}",nb_parasite_pipe);
println!("List of species trees roots : {:?}",global_roots);
info!("Global parasite pipe tree : {:?}",global_pipe_parasite);
// ---------------------------------------------------------
// Generate svg of the lobal parasite pipe tree and  path
// genes trees
// ---------------------------------------------------------
recphyloxml_processing(&mut global_pipe_parasite,&mut  path_genes, &mut options, &config,true,
    &transfers,outfile_gene_para);
// ---------------------------------------------------------
// Create a structure Arena for the host pipe tree and a
// vector of structures Arena for parasite path trees
// ---------------------------------------------------------
let mut tree_host_pipe: ArenaTree<String> = ArenaTree::default();
let mut path_para_trees:std::vec::Vec<ArenaTree<String>> = Vec::new();
// ---------------------------------------------------------
// Fill  host pipe tree and is roots and path parasite trees
// ---------------------------------------------------------
let mut global_roots: std::vec::Vec<usize> = Vec::new();
read_recphyloxml_multi(infile_sh,&mut tree_host_pipe,&mut path_para_trees, &mut global_roots);
let  nb_parasite_path =  path_para_trees.len().clone();
println!("Number of pipe parasite trees in gene-parasite file : {}",nb_parasite_pipe);
println!("Number of path parasite trees in parasite-host file : {}",nb_parasite_path);
if nb_parasite_path != nb_parasite_pipe {
println!();
println!("==============================================");
println!("Error! Different number of parasite trees in the 2 files!");
println!("       Resulting svg will be incomplete.");
println!("==============================================");
println!();
}
// ---------------------------------------------------------
// Generate svg of the host pipe tree and path parasite trees
// ---------------------------------------------------------
recphyloxml_processing(&mut tree_host_pipe,&mut  path_para_trees, &mut options, &config,
true, &transfers,outfile_para_host);
// ---------------------------------------------------------
// Generation of first 3 levels svg
// ---------------------------------------------------------
info!("Parasite trees as a 'path tree' : {:?}",path_para_trees);
info!("Parasite tree as a 'pipe tree' : {:?}",global_pipe_parasite);
println!("==============================================");
println!("Map parasite as 'path' to parasite as 'pipe'");
println!("==============================================");
let mut i = 0;
while i < nb_parasite_pipe {
    map_parasite_g2s(&mut global_pipe_parasite, &mut path_para_trees[i]);
i = i + 1;
}
info!("Global parasite tree wih events : {:?}",global_pipe_parasite);
reset_pos(&mut global_pipe_parasite);
let mut i = 0;
while i < nb_gntree {
reset_pos(&mut path_genes[i]);
i = i + 1;
}
println!("==============================================");
println!("Map parasite as 'species' to parasite as 'gene'");
println!("==============================================");
let mut i = 0;
while i < nb_parasite_pipe {
map_parasite_s2g(&mut global_pipe_parasite, &mut path_para_trees[i],&mut path_genes);
i = i +  1;
}
info!("Global pipe parasite after mapping s2g : {:?}",global_pipe_parasite);
println!("==============================================");
println!("Map parasite as 'gene' to parasite as 'species' again");
println!("==============================================");
let mut i = 0;
while i < nb_parasite_pipe {
map_parasite_g2s(&mut global_pipe_parasite, &mut path_para_trees[i]);
i = i + 1;
}
reset_pos(&mut global_pipe_parasite);
let mut i = 0;
while i < nb_gntree {
reset_pos(&mut path_genes[i]);
i = i + 1;
}
// attention on ne remape pas
recphyloxml_processing(&mut global_pipe_parasite,&mut  path_genes, &mut options, &config,false,
    &transfers,outfile_mapped_1);
// ---------------------------------------------------------
// Generation of second 3 levels svg
// ---------------------------------------------------------
let mut i = 0;
let gene_transfers = get_gtransfer(&mut path_genes[i]);
info!("Transfers = {:?}",gene_transfers);
let mut mapped_gene_transfers = map_transfer_mul(gene_transfers, &mut path_para_trees);
info!("Mapped transfers = {:?}",mapped_gene_transfers);
i = i + 1;
while i < nb_gntree {
let gene_transfers = get_gtransfer(&mut path_genes[i]);
info!("Transfers = {:?}",gene_transfers);
let mapped = map_transfer(gene_transfers, &mut path_para_trees[0]);
info!("Mapped transfers = {:?}",mapped);
for val in mapped {
    mapped_gene_transfers.push(val);
}
i = i + 1;
}
reset_pos(&mut tree_host_pipe);
let mut i = 0;
while i < nb_parasite_pipe {
reset_pos(&mut path_para_trees[i]);
i = i + 1;
}
println!("Building svg 2:  parasite tree within host pipe tree and mapped tarnsfers {}",
outfile_mapped_2);
// attention on ne remape pas
recphyloxml_processing(&mut tree_host_pipe, &mut path_para_trees, &mut options, &config,
false, &mapped_gene_transfers,outfile_mapped_2);

reset_pos(&mut global_pipe_parasite);
phyloxml_processing(&mut global_pipe_parasite, &mut options, &config,"para_simple.svg".to_string());
reset_pos(&mut tree_host_pipe);
phyloxml_processing(&mut tree_host_pipe, &mut options, &config,"host_simple.svg".to_string());
let mut i = 0;
while i < nb_parasite_pipe {
reset_pos(&mut path_para_trees[i]);
phyloxml_processing(&mut path_para_trees[i], &mut options, &config,("gene_simple_".to_owned()+&i.to_string()+".svg").to_string());
i = i + 1;
}

//llmlmlmlmlmlm
// mapping des gene sur les hotes via les parasites
println!("Building svg 3: gene  tree within host pipe tree");
map_gene_host(&mut path_genes, &mut path_para_trees, &mut tree_host_pipe);

// map_gene_host(&mut path_genes, &mut path_para_trees[1], &mut tree_host_pipe);
reset_pos(&mut tree_host_pipe);
let mut i = 0;
while i < nb_gntree {
reset_pos(&mut path_genes[i]);
i = i + 1;
}

recphyloxml_processing(&mut tree_host_pipe, &mut path_genes, &mut options, &config,
true, &vec![],"mapped_3.svg".to_string());
// println!("DEBUG  FINAL HOST = {:?}",tree_host_pipe);
// lmlmlmlm

println!("Output files:");

println!(" - host_simple.svg ...... 1 level: host tree");
let mut i = 0;
while i < nb_parasite_pipe {
println!(" - para_simple.svg ...... 2 levels: gene_simple_{}.svg",&i);
i = i + 1;
}
println!(" - para_simple.svg ...... 2 levels: parasite tree(s)");
println!(" - gene_para.svg ........ 2 levels: pipe parasite tree(s) with gene tree(s) inside");
println!(" - para_host.svg ........ 2 levels: pipe host tree with parasite tree(s) inside");
println!(" - mapped_1.svg ........  3 levels: reconciled pipe parasite tree(s) with gene tree(s)");
println!(" - mapped_2.svg ........  3 levels: parasite-host reconciliation plus gene transfers");
println!(" - mapped_3.svg ........  3 levels: pipe host tree with gene tree(s) inside");

if nb_parasite_path != nb_parasite_pipe {
println!();
println!("==============================================");
println!("Error! Different number of parasite trees in the 2 files!");
println!("       Resulting svg will be incomplete.");
println!("==============================================");
println!();
}
}