annotate rDiff/tools/determine_engine.m @ 2:233c30f91d66

updated python based GFF parsing module which will handle GTF/GFF/GFF3 file types
author vipints <vipin@cbio.mskcc.org>
date Tue, 08 Oct 2013 07:15:44 -0400
parents 0f80a5141704
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
1 function [engine, environment, basedir, mccdir, license_type] = determine_engine()
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
2 % DETERMINES_ENGINE Determines used interpreter.
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
3 %
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
4 % [engine, environment, basedir, mccdir, license_type] = determine_engine() ;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
5 %
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
6 % returns either 'matlab' or 'octave' in variable engine
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
7 % and 'internal' or 'galaxy' in variable environment
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
8 % basedir is the directory of the matlab or octave instance
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
9 % mccdir is the directory of the matlab compiler (does not yet exist for octave)
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
10 %
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
11 %
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
12 % This program is free software; you can redistribute it and/or modify
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
13 % it under the terms of the GNU General Public License as published by
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
14 % the Free Software Foundation; either version 3 of the License, or
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
15 % (at your option) any later version.
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
16 %
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
17 % Written (W) 2009-2010 Gunnar Raetsch
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
18 % Copyright (C) 2009-2010 Max Planck Society
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
19 %
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
20
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
21
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
22 global g_license_type ;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
23
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
24 if isempty(g_license_type),
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
25 g_license_type = 'academic' ;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
26 end ;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
27 license_type = g_license_type ;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
28
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
29 lic=license ;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
30 if ~isequal(lic, 'GNU General Public License'),
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
31 engine='matlab' ;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
32 else
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
33 engine='octave' ;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
34 end ;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
35
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
36 environment='internal' ;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
37 if isequal(whoami, 'galaxy'),
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
38 environment='galaxy' ;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
39 end ;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
40
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
41 if isequal(engine, 'matlab') && isequal(environment, 'internal'),
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
42 basedir = '' ;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
43 elseif isequal(engine, 'matlab') && isequal(environment, 'galaxy'),
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
44 basedir = '' ;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
45 elseif isequal(engine, 'octave') && isequal(environment, 'internal'),
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
46 basedir = '' ;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
47 elseif isequal(engine, 'octave') && isequal(environment, 'galaxy'),
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
48 basedir = '' ;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
49 end ;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
50
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
51 if isequal(environment, 'internal'),
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
52 mccdir = '' ;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
53 elseif isequal(environment, 'galaxy'),
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
54 mccdir = '' ;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
55 end ;
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
56
0f80a5141704 version 0.3 uploaded
vipints
parents:
diff changeset
57 return