Mercurial > repos > vipints > rdiff
comparison rDiff/src/tests/get_nonparametric_masks.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 [MASKS]=get_nonparametric_masks(CFG,reads1,reads2) | |
2 | |
3 %What fracitons should be choosen for the cutoff | |
4 cen_arr=0.1:0.1:1; | |
5 | |
6 % Define the mask which should be used in order to mask high | |
7 % expresse genes | |
8 MASKS=zeros(length(cen_arr),size(reads1,2)); | |
9 | |
10 COUNTER=1; | |
11 for censor_frac= cen_arr | |
12 temp_reads1=reads1; | |
13 temp_reads2=reads2; | |
14 %cut to relvant position | |
15 read_coverage=sum(reads1,1)+sum(reads2,1); | |
16 % get positions with a positive coverage | |
17 nonzero_position=read_coverage>0; | |
18 %Determine the cutoff values | |
19 sorted_coverage=sort(read_coverage(nonzero_position)); | |
20 nr_of_nonzero_positions=sum(nonzero_position); | |
21 relevant_positions=read_coverage<=sorted_coverage(ceil(nr_of_nonzero_positions*censor_frac)); | |
22 MASKS(COUNTER,relevant_positions)=1; | |
23 COUNTER=COUNTER+1; | |
24 end |