comparison rDiff/src/process_configure_rdiff.m @ 0:0f80a5141704

version 0.3 uploaded
author vipints
date Thu, 14 Feb 2013 23:38:36 -0500
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:0f80a5141704
1 function CFG = process_configure_rdiff(CFG)
2 % process_configure_rDiff(CFG)
3
4 for i=1:length(CFG.BAM_FILES)
5 if isempty(CFG.NAMES{i})
6 CFG.NAMES{i}=CFG.BAM_FILES{i};
7 end
8 end
9
10 %Get the paths of the filenames
11 for i=find(CFG.SAMPLES==1)
12 CFG.BAM_FILES{i}=fullfile(CFG.data_dir,CFG.BAM_FILES{i});
13 end
14
15 for i=find(CFG.SAMPLES==2)
16 CFG.BAM_FILES{i}=fullfile(CFG.data_dir,CFG.BAM_FILES{i});
17 end
18
19
20 %Check that the variance functions are available if necessary
21 if or(CFG.perform_nonparametric,CFG.perform_parametric) && length(CFG.predefined_variance_function1)<3 && isempty(CFG.variance_function_1)
22 CFG.compute_variance_function_1=1;
23 end
24
25 if or(CFG.perform_nonparametric,CFG.perform_parametric) && length(CFG.predefined_variance_function2)<3 && isempty(CFG.variance_function_2)
26 CFG.compute_variance_function_2=1;
27 end
28
29 %Check that there are sufficient samples to estimate the variance funtions
30 if CFG.compute_variance_function_1==1
31 if and(length(find(CFG.SAMPLES==1))<2,not(CFG.merge_sample1))
32 error('Not sufficient samples to estimate variance function for sample 1');
33 end
34 end
35
36 if CFG.compute_variance_function_2==1
37 if and(length(find(CFG.SAMPLES==2))<2,not(CFG.merge_sample2))
38 error('Not sufficient samples to estimate variance function for sample 2');
39 end
40 end
41
42
43
44 %If a variance function can be loaded use this function and do not
45 %compute a new one
46 if or(CFG.perform_nonparametric,CFG.perform_parametric) && length(CFG.predefined_variance_function1)<3 && not(isempty(CFG.variance_function_1))
47 CFG.compute_variance_function_1=0;
48 end
49
50 if or(CFG.perform_nonparametric,CFG.perform_parametric) && length(CFG.predefined_variance_function2)<3 && not(isempty(CFG.variance_function_2))
51 CFG.compute_variance_function_2=0;
52 end
53
54
55 %If a variance function can be loaded use this function and do not
56 %compute a new one
57 if or(CFG.perform_nonparametric,CFG.perform_parametric) && length(CFG.predefined_variance_function1)<3 && not(isempty(CFG.variance_function_1))
58 CFG.compute_variance_function_1=0;
59 end
60
61 if or(CFG.perform_nonparametric,CFG.perform_parametric) && length(CFG.predefined_variance_function2)<3 && not(isempty(CFG.variance_function_2))
62 CFG.compute_variance_function_2=0;
63 end
64
65
66