forked from andor-halab1/FISHerMan
-
Notifications
You must be signed in to change notification settings - Fork 0
/
runOligoArray.m
83 lines (74 loc) · 3.74 KB
/
runOligoArray.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
function runOligoArray(species,varargin)
if length(varargin) == 1
params = varargin{1};
elseif length(varargin) == 2
params = varargin{1};
GC = varargin{2};
params(1).minPercentGC = GC(1);
params(1).maxPercentGC = GC(2);
params(1).minTm=floor(81.5+0.41*params(1).minPercentGC-500/params(1).probeLength)-2;
params(1).maxTm=ceil(81.5+0.41*params(1).maxPercentGC-500/params(1).probeLength)+2;
params(1).secstructT=params(1).minTm;
params(1).crosshybeT=params(1).minTm;
else
params = struct('species','Mouse','verbose',1,'GbMem',16,'maxFragment',1E3,...
'crosshybeT',75,'secstructT',75.0,'minTm',75,'maxTm',87,...
'minPercentGC',30.0,'maxPercentGC',50.0,'probeLength',30,...
'probeLengthMax',30,'minProbeDist',40,...
'maskedSeq','"GGGGGG;CCCCCC;TTTTTT;AAAAAA"',...
'oligoArrayPath','C:\OligoArray\','oligoArrayExe','C:\OligoArray\OligoArray2.jar',...
'blastDbPath','C:\OligoArray\BlastDb\','numParallel',10);
end
params(1).species=species;
%% Set up files for OligoArray; Not decided whether ncrna should be included in the database
if params.verbose
disp('setting up OligoArray run');
end
if exist([params.oligoArrayPath params.species '.target1kb.fas'], 'file')
delete([params.oligoArrayPath params.species '.target1kb.fas']);
end
copyfile([params.species '.target1kb.txt'], [params.oligoArrayPath params.species '.target1kb.fas']);
if exist([params.blastDbPath params.species '.cdna.fas'], 'file')
delete([params.blastDbPath params.species '.cdna.fas*']);
end
copyfile([params.species '.cdna.fas'], [params.blastDbPath params.species '.cdna.fas']);
blastformat('Inputdb', [params.blastDbPath params.species '.cdna.fas'],...
'FormatArgs', '-o T -p F');
if exist([params.oligoArrayPath 'oligos.txt'], 'file')
delete([params.oligoArrayPath 'oligos.txt']);
end
if exist([params.oligoArrayPath 'rejected.fas'], 'file')
delete([params.oligoArrayPath 'rejected.fas']);
end
if exist([params.oligoArrayPath 'OligoArray.log'], 'file')
delete([params.oligoArrayPath 'OligoArray.log']);
end
%% Execute OligoArray
oligoArrayCommand = ['java -Xmx',ceil(num2str(params.GbMem)),'g -jar ' params.oligoArrayExe ...
' -i ' params.oligoArrayPath params.species '.target1kb.fas' ...
' -d ' params.blastDbPath params.species '.cdna.fas'...
' -o ' params.oligoArrayPath 'oligos.txt' ...
' -r ' params.oligoArrayPath 'rejected.fas' ...
' -R ' params.oligoArrayPath 'OligoArray.log' ...
' -n ' num2str(round(params.maxFragment/params.minProbeDist)) ... % The maximum number of oligos per target sequence
' -l ' num2str(params.probeLength) ... % Minimum oligo length
' -L ' num2str(params.probeLengthMax) ... % Maximum oligo length
' -D ' num2str(params.maxFragment) ... % Maximum distance between 5' of oligo and 3' of target sequence
' -t ' num2str(params.minTm) ... % Minimum Tm
' -T ' num2str(params.maxTm) ... % Maximum Tm
' -s ' num2str(params.secstructT) ... % Threshold temperature for secondary structure prediction
' -x ' num2str(params.crosshybeT) ... % Threshold for cross-hybridization
' -p ' num2str(params.minPercentGC) ... % Minimum GC content
' -P ' num2str(params.maxPercentGC) ... % Maximum GC content
' -m ' params.maskedSeq ... % Masked sequences
' -g ' num2str(params.minProbeDist) ... % Minimum distance between 5' end of oligos
' -N ' num2str(params.numParallel)]; % Number of processes run in parallel
system(oligoArrayCommand);
if params.verbose
disp('done generating oligos');
end
tempOligos=[params.species '.tempoligos.txt'];
if exist(tempOligos,'file')
delete(tempOligos);
end
copyfile([params.oligoArrayPath 'oligos.txt'], tempOligos);