This repository has been archived by the owner on Aug 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathpsom_visu_dependencies.m
97 lines (84 loc) · 3.3 KB
/
psom_visu_dependencies.m
1
2
3
4
5
6
7
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
function [] = psom_visu_dependencies(pipeline,opt)
% Visualize the graph of dependencies of a pipeline
%
% SYNTAX:
% [FILE_TMP] = PSOM_VISU_DEPENDENCIES(PIPELINE)
%
% _________________________________________________________________________
% INPUTS:
%
% PIPELINE
% (structure) a pipeline structure, see PSOM_RUN_PIPELINE. The dependency
% graph of a pipeline can also be directly submitted instead of a
% pipeline.
%
%
% OPT
% (structure) with the following fields :
%
% TYPE_FILTER
% (string, default 'dot') available options :
% 'dot', 'neato', 'twopi', 'circo', 'fdp'
% Type "man dot" in a terminal for more infos.
%
% _________________________________________________________________________
% OUTPUTS:
%
% FILE_TMP
% (spring) if GRAPHVIZ is used to generate the graph, this function is going
% to produce a temporary file (the pdf with the graph). This file needs to
% be cleaned out manually.
%
% _________________________________________________________________________
% SEE ALSO:
% PSOM_BUILD_DEPENDENCIES, PSOM_RUN_PIPELINE, PSOM_WRITE_DEPENDENCIES,
% PSOM_WRITE_DEPENDENCIES
%
% _________________________________________________________________________
% COMMENTS:
%
% Copyright (c) Pierre Bellec, Montreal Neurological Institute, 2008.
% Maintainer : [email protected]
% See licensing information in the code.
% Keywords : pipeline, PSOM
% Permission is hereby granted, free of charge, to any person obtaining a copy
% of this software and associated documentation files (the "Software"), to deal
% in the Software without restriction, including without limitation the rights
% to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
% copies of the Software, and to permit persons to whom the Software is
% furnished to do so, subject to the following conditions:
%
% The above copyright notice and this permission notice shall be included in
% all copies or substantial portions of the Software.
%
% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
% IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
% FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
% AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
% LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
% OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
% THE SOFTWARE.
psom_gb_vars
%% Options
gb_name_structure = 'opt';
gb_list_fields = {'type_filter' };
gb_list_defaults = {'dot' };
psom_set_defaults
if exist('biograph')
[graph_deps,list_jobs,files_in,files_out,files_clean] = psom_build_dependencies(pipeline);
bg = biograph(graph_deps,list_jobs);
dolayout(bg);
view(bg);
file_tmp = '';
else
[flag_dot,msg] = system('dot -V');
if flag_dot==0
file_tmp = psom_file_tmp('_graph.pdf');
psom_write_dependencies(file_tmp,pipeline,opt);
system([gb_psom_pdf_viewer ' ' file_tmp]);
delete(file_tmp)
else
warning('I could not find the BIOGRAPH command or the DOT command. This probably means that the Matlab bioinformatics toolbox is not installed and that you did not install the GRAPHVIZ package on your system. Sorry dude, I can''t plot the graph.')
file_tmp = '';
end
end