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