Skip to content

Commit 000346b

Browse files
authored
Merge pull request #605 from SysBioChalmers/develop
RAVEN 2.11.1
2 parents c27145a + 9ff834b commit 000346b

23 files changed

Lines changed: 399 additions & 271 deletions

.gitattributes

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,3 @@ mafft binary
1010
.gitattributes export-ignore
1111
.gitignore export-ignore
1212
.github export-ignore
13-
*.mat filter=lfs diff=lfs merge=lfs -text

doc/external/kegg/getGenesFromKEGG.html

Lines changed: 332 additions & 266 deletions
Large diffs are not rendered by default.

doc/external/kegg/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ <h2>Matlab files in this directory:</h2>
2323

2424
<h2>Other Matlab-specific files in this directory:</h2>
2525
<ul style="list-style-image:url(../../matlabicon.gif)">
26-
<li>keggGenes.mat</li><li>keggMets.mat</li><li>keggPhylDist.mat</li><li>keggRxns.mat</li></ul>
26+
<li>keggMets.mat</li><li>keggPhylDist.mat</li><li>keggRxns.mat</li></ul>
2727

2828

2929
<hr><address>Generated by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>

external/kegg/getGenesFromKEGG.m

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,13 @@
7171

7272
ravenPath=findRAVENroot();
7373
genesFile=fullfile(ravenPath,'external','kegg','keggGenes.mat');
74+
if ~exist(genesFile, 'file')
75+
try
76+
downloadKEGGgenes();
77+
catch
78+
%Download failed; fall through to local regeneration below
79+
end
80+
end
7481
if exist(genesFile, 'file')
7582
fprintf(['Importing KEGG genes from ' strrep(genesFile,'\','/') '... ']);
7683
load(genesFile);
@@ -338,3 +345,62 @@
338345
end
339346
allKOs=unique(allKOs);
340347
end
348+
349+
function downloadKEGGgenes()
350+
% downloadKEGGgenes
351+
% Downloads keggGenes.mat from the RAVEN GitHub release into
352+
% external/kegg/. This file is distributed as a release asset rather
353+
% than shipped in the repository because it exceeds GitHub's 100 MB
354+
% file-size limit.
355+
%
356+
% The following asset is expected on the release tag defined below:
357+
% keggGenes.zip containing keggGenes.mat
358+
%
359+
% To force a refresh (for example, after a new KEGG snapshot has been
360+
% published with a new RAVEN release), delete
361+
% external/kegg/keggGenes.mat and call getGenesFromKEGG again.
362+
%
363+
% Usage: downloadKEGGgenes()
364+
365+
% Release tag that hosts the data archive. Bump this for any RAVEN
366+
% release that ships an updated keggGenes.mat.
367+
releaseTag = 'v2.11.1';
368+
369+
archiveName = 'keggGenes.zip';
370+
targetDir = fullfile(findRAVENroot(),'external','kegg');
371+
targetFile = fullfile(targetDir,'keggGenes.mat');
372+
url = ['https://github.com/SysBioChalmers/RAVEN/releases/download/',...
373+
releaseTag,'/',archiveName];
374+
zipPath = fullfile(targetDir,archiveName);
375+
376+
fprintf(['Downloading ' archiveName ' from RAVEN ' releaseTag ' release... ']);
377+
try
378+
websave(zipPath,url);
379+
catch ME
380+
if strcmp(ME.identifier,'MATLAB:webservices:HTTP404StatusCodeError')
381+
error(['Failed to download ' archiveName ': the server returned ' ...
382+
'a 404 error. If this persists, please report it at ' ...
383+
'https://github.com/SysBioChalmers/RAVEN/issues']);
384+
else
385+
rethrow(ME);
386+
end
387+
end
388+
fprintf('COMPLETE\n');
389+
390+
fprintf(['Extracting ' archiveName ' to ' strrep(targetDir,'\','/') '... ']);
391+
try
392+
unzip(zipPath,targetDir);
393+
catch ME
394+
if isfile(zipPath); delete(zipPath); end
395+
error(['Failed to extract ' archiveName '. The downloaded archive ' ...
396+
'may be corrupted.\nOriginal error: %s'],ME.message);
397+
end
398+
fprintf('COMPLETE\n');
399+
400+
if isfile(zipPath); delete(zipPath); end
401+
402+
if ~isfile(targetFile)
403+
error(['keggGenes.mat was not found in ' archiveName ...
404+
'. Please verify the release asset contents.']);
405+
end
406+
end

external/kegg/keggGenes.mat

Lines changed: 0 additions & 3 deletions
This file was deleted.

external/kegg/keggMets.mat

2.04 MB
Binary file not shown.

external/kegg/keggPhylDist.mat

4.81 MB
Binary file not shown.

external/kegg/keggRxns.mat

1.06 MB
Binary file not shown.
1.26 MB
Binary file not shown.

external/metacyc/metaCycMets.mat

2.86 MB
Binary file not shown.

0 commit comments

Comments
 (0)