-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: refactor adding of new grRules
- Loading branch information
Showing
7 changed files
with
156 additions
and
292 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,28 @@ | ||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
% addTransNewGPR | ||
% Add changes from the database new anootation for new genes + manual curation on those changes | ||
% Input: model, databasenewGPR.tsv,SGDgeneNames.tsv. | ||
% As for the reference of new GPR, please find detailed information in: | ||
% data/databases/DBnewGeneAnnotation.tsv | ||
% NOTE: changeGeneAssociation.m is a function from cobra | ||
% Add changes from the database new anootation for new genes + manual | ||
% curation on those changes | ||
% As for the reference of new GPRs, please find detailed information in: | ||
% data/modelCuration/transRxnNewGPR/TransRxnNewGPR.tsv | ||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
|
||
% Load model | ||
cd .. | ||
model = loadYeastModel; | ||
|
||
% Add new genes | ||
newModel = curateMetsRxnsGenes(model,'none','../data/modelCuration/transRxnNewGPR/transRxnNewGPRGenes.tsv'); | ||
|
||
% Change GPR relations | ||
fid = fopen('../data/modelCuration/TransRxnNewGPR.tsv'); | ||
changegpr = textscan(fid,'%s %s','Delimiter','\t','HeaderLines',1); | ||
fid = fopen('../data/modelCuration/transRxnNewGPR/TransRxnNewGPR.tsv'); | ||
changegpr = textscan(fid,'%q %q %q','Delimiter','\t','HeaderLines',1); | ||
newGPR.ID = changegpr{1}; | ||
newGPR.GPR = changegpr{2}; | ||
fclose(fid); | ||
for i = 1:length(newGPR.ID) | ||
rxnIndex = find(strcmp(model.rxns, newGPR.ID(i))); | ||
model = changeGrRules(model, model.rxns{rxnIndex}, newGPR.GPR{i}); | ||
end | ||
|
||
% Delete unused genes (if any) | ||
model = deleteUnusedGenes(model); | ||
newModel=changeGrRules(newModel,newGPR.ID,newGPR.GPR); | ||
|
||
% Add gene standard name for new genes | ||
fid = fopen('../data/databases/SGDgeneNames.tsv'); | ||
yeast_gene_annotation = textscan(fid,'%s %s','Delimiter','\t','HeaderLines',1); | ||
fclose(fid); | ||
for i = 1: length(model.genes) | ||
geneIndex = strcmp(yeast_gene_annotation{1}, model.genes{i}); | ||
if sum(geneIndex) == 1 && ~isempty(yeast_gene_annotation{2}{geneIndex}) | ||
model.geneNames{i} = yeast_gene_annotation{2}{geneIndex}; | ||
else | ||
model.geneNames{i} = model.genes{i}; | ||
end | ||
end | ||
|
||
saveYeastModel(model) | ||
% Delete unused genes (if any) | ||
newModel = deleteUnusedGenes(newModel); | ||
saveYeastModel(newModel) | ||
cd modelCuration |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.