0001
0002
0003 function tests = diamondTests
0004 tests = functiontests(localfunctions);
0005 end
0006
0007 function testDiamond(testCase)
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019 [ST, I]=dbstack('-completenames');
0020 ravenPath=fileparts(fileparts(fileparts(ST(I).file)));
0021
0022
0023
0024 sourceDir = fileparts(which(mfilename));
0025 load([sourceDir,'/test_data/expDiamondResults.mat'],'expBlastStructure','expDiamondReport');
0026
0027 organismID='sce';
0028 fastaFile=fullfile(ravenPath,'testing','unit_tests','test_data','yeast_galactosidases.fa');
0029 modelIDs={'hsa' 'afv'};
0030 refFastaFiles={fullfile(ravenPath,'testing','unit_tests','test_data','human_galactosidases.fa') fullfile(ravenPath,'testing','unit_tests','test_data','aflavus_galactosidases.fa')};
0031
0032
0033
0034 [actBlastStructure,actDiamondReport]=getDiamond(organismID,fastaFile,modelIDs,refFastaFiles,true,true);
0035
0036
0037
0038 verifyEqual(testCase,actDiamondReport.dbHashes,expDiamondReport.dbHashes);
0039
0040
0041 actDiamondReport.dbHashes{1,1}=actDiamondReport.dbHashes{1,2};
0042 verifyNotEqual(testCase,actDiamondReport.dbHashes,expDiamondReport.dbHashes);
0043
0044
0045 verifyEqual(testCase,actDiamondReport.diamondTxtOutput,expDiamondReport.diamondTxtOutput);
0046
0047
0048 actDiamondReport.diamondTxtOutput='empty';
0049 verifyNotEqual(testCase,actDiamondReport.diamondTxtOutput,expDiamondReport.diamondTxtOutput);
0050
0051
0052 verifyEqual(testCase,actBlastStructure,expBlastStructure);
0053
0054
0055 actBlastStructure(1,1).toId=actBlastStructure(1,1).fromId;
0056 verifyNotEqual(testCase,actBlastStructure,expBlastStructure);
0057 end