Skip to content

Commit

Permalink
Merge branch 'develop' into feat/gene-essentiality-workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
mihai-sysbio committed Oct 6, 2023
2 parents 07329bc + 4af2c44 commit c3db9c5
Show file tree
Hide file tree
Showing 10 changed files with 474 additions and 1,301 deletions.
5 changes: 4 additions & 1 deletion code/addMetabolicNetwork.m
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,11 @@
newGenes = setdiff(newGenes, newModel.genes);
end

% append new genes to list of model genes
% append new genes and their names to model
newModel.genes = [newModel.genes; newGenes];
emptyGeneNames = newGenes;
emptyGeneNames(:) = {''};
newModel.geneShortNames = [newModel.geneShortNames; emptyGeneNames];

% add new columns to rxnGeneMat will be updated after the new reactions are added below.
newModel.rxnGeneMat(:, end+1:end+numel(newGenes)) = 0;
Expand Down
22 changes: 16 additions & 6 deletions code/test/sanityCheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,12 @@ def checkRxnAnnotation(rxns):
rxnList = get_column_from_tsv("model/reactions.tsv", "rxns")
spontaneous = get_column_from_tsv("model/reactions.tsv", "spontaneous", False)
rxnDeprecated = get_column_from_tsv("data/deprecatedIdentifiers/deprecatedReactions.tsv", "rxns")
assert set(rxnList).isdisjoint(set(rxnDeprecated)), "Deprecated reaction reused!"
assert rxnList == rxns, "Reaction annotation mismatch!"
rxnMisused = set(rxns).intersection(set(rxnDeprecated))
assert len(rxnMisused) == 0, "Deprecated reaction(s) used: {}".format(rxnMisused)
rxnMisused = set(rxns).difference(set(rxnList))
assert len(rxnMisused) == 0, "Reaction(s) not annotated in reactions.tsv: {}".format(rxnMisused)
rxnMisused = set(rxnList).difference(set(rxns))
assert len(rxnMisused) == 0, "Annotated reactions are missing from the model: {}".format(rxnMisused)
assert pd.api.types.is_numeric_dtype(spontaneous), "Spontaneous column should be in numeric!"


Expand All @@ -49,16 +53,22 @@ def checkMetAnnotation(mets):
"""
metList = get_column_from_tsv("model/metabolites.tsv", "mets")
metDeprecated = get_column_from_tsv("data/deprecatedIdentifiers/deprecatedMetabolites.tsv", "mets")
assert set(metList).isdisjoint(set(metDeprecated)), "Deprecated metabolite reused!"
assert metList == mets, "Metabolite annotation mismatch!"

metMisused = set(mets).intersection(set(metDeprecated))
assert len(metMisused) == 0, "Deprecated metabolite(s) used: {}".format(metMisused)
metMisused = set(mets).difference(set(metList))
assert len(metMisused) == 0, "Metabolite(s) not annotated in metabolites.tsv: {}".format(metMisused)
metMisused = set(metList).difference(set(mets))
assert len(metMisused) == 0, "Annotated metabolite(s) are missing from the model: {}".format(metMisused)

def checkGeneAnnotation(genes):
"""
check consistency of gene lists between model and annotation file
"""
geneList = get_column_from_tsv("model/genes.tsv", "genes")
assert geneList == genes, "Gene annotation mismatch!"
geneMisused = set(genes).difference(set(geneList))
assert len(geneMisused) == 0, "Gene(s) not annotated in genes.tsv: {}".format(geneMisused)
geneMisused = set(geneList).difference(set(genes))
assert len(geneMisused) == 0, "Annotated gene(s) are missing from the model: {}".format(geneMisused)


def find_unused_entities(model, entity_type):
Expand Down
9 changes: 6 additions & 3 deletions code/updateAnimalGEM.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function [animalGEM, speciesSpecNetwork, gapfillNetwork]=updateAnimalGEM(orthologPairs,rxnsToAdd,metsToAdd,modelId)
function [animalGEM, speciesSpecNetwork, gapfillNetwork]=updateAnimalGEM(orthologPairs,rxnsToAdd,metsToAdd,modelId,resetBiomass)
% updateAnimalGEM
% Generate a model by using the Human-GEM as a template and taking into
% account species-specific pathways/reactions
Expand All @@ -11,7 +11,9 @@
% rxnsToAdd the structure of species-specific reactions
% metsToAdd the structure of species-specific metabolites
% modelId model id
%
% resetBiomass reset biomass objective function to "biomass_components"
% which is constituted by generic componenets that
% suppose to occur in a eukaryotic cell (opt, default TRUE)
%
% Output:
% animalGEM an updated animal GEM
Expand Down Expand Up @@ -81,7 +83,8 @@


%% Gap-filling
[animalGEM, gapfillNetwork]=gapfill4EssentialTasks(animalGEM,ihuman);
[animalGEM, gapfillNetwork]=gapfill4EssentialTasks(animalGEM,ihuman,resetBiomass);
animalGEM.b = animalGEM.b(:,1); % ensure b field in single column


%% post-gapfilling procedures
Expand Down
18 changes: 18 additions & 0 deletions data/deprecatedIdentifiers/deprecatedMetabolites.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -2228,4 +2228,22 @@ mets metsNoComp metBiGGID metKEGGID metHMDBID metChEBIID metPubChemID metLipidMa
"MAM03368m" "MAM03368" "" "C05467" "HMDB0006891" "CHEBI:27379" "440690" "" "CE5169" "" "CE5169" "" "" "CE5169_m"
"MAM03368x" "MAM03368" "" "C05467" "HMDB0006891" "CHEBI:27379" "440690" "" "CE5169" "" "CE5169" "" "" "CE5169_p"
"MAM00902c" "MAM00902" "" "" "" "" "" "" "CE4820" "" "CE4820" "MNXM164259" "m00902c" "m00902c"
"MAM00616m" "MAM00616" "cholcoar" "C15613" "" "CHEBI:37642" "15942889" "LMST01010218" "CE5165" "HC01348" "cholcoar" "MNXM549;MNXM90922;MNXM91096" "m00616p" "m00616p"
"MAM00749m" "MAM00749" "cholcoads" "C05460" "HMDB0006889" "CHEBI:27505" "5280797" "LMST01010217" "" "HC01466" "cholcoads" "MNXM162945;MNXM2747" "m00749m" "m00749m"
"MAM00036m" "MAM00036" "" "C05450" "" "CHEBI:52050" "46224537" "" "CE5168" "" "HC01459" "MNXM732;MNXM827" "m00036m" "m00036m"
"MAM00748m" "MAM00748" "cholcoaone" "C05467" "HMDB0006891" "CHEBI:27379" "440690" "LMST01010216" "CE5169" "HC01473" "cholcoaone" "MNXM162946;MNXM873" "m00748m" "m00748m"
"MAM03367m" "MAM03367" "" "" "" "" "" "" "CE5168" "" "CE5168" "" "" "CE5168_m"
"MAM00618m" "MAM00618" "cholcoas" "C17343" "" "CHEBI:37643" "15942888" "" "CE5166" "" "CE5166;cholcoas" "MNXM1201;MNXM8131" "m00618m" "m00618m"
"MAM01445m" "MAM01445" "cholate" "C00695" "HMDB0000619" "CHEBI:16359" "221493" "LMST04010001" "" "HC00502" "cholate" "MNXM450" "m01445m" "m01445m"
"MAM01514m" "MAM01514" "cholcoa" "C01794" "HMDB0001374" "CHEBI:15519" "439573" "" "" "HC00844" "cholcoa" "MNXM162468;MNXM431" "m01514m" "m01514m"
"MAM00759c" "MAM00759" "" "C13712" "" "" "" "LMST02030130" "" "" "M00759" "MNXM3494" "m00759c" "m00759c"
"MAM01268c" "MAM01268" "" "" "" "" "" "PROTEIN" "" "" "M01268" "" "m01268c" "m01268c"
"MAM01268m" "MAM01268" "" "" "" "" "" "PROTEIN" "" "" "M01268" "" "m01268m" "m01268m"
"MAM01268n" "MAM01268" "" "" "" "" "" "PROTEIN" "" "" "M01268" "" "m01268n" "m01268n"
"MAM01268x" "MAM01268" "" "" "" "" "" "PROTEIN" "" "" "M01268" "" "m01268p" "m01268p"
"MAM01268r" "MAM01268" "" "" "" "" "" "PROTEIN" "" "" "M01268" "" "m01268r" "m01268r"
"MAM01268e" "MAM01268" "" "" "" "" "" "PROTEIN" "" "" "M01268" "" "m01268s" "m01268s"
"MAM02757c" "MAM02757" "" "" "" "" "" "" "" "" "M02757" "" "m02757c" "m02757c"
"MAM02757l" "MAM02757" "" "" "" "" "" "" "" "" "M02757" "" "m02757l" "m02757l"
"MAM02757n" "MAM02757" "" "" "" "" "" "" "" "" "M02757" "" "m02757n" "m02757n"
"MAM01816n" "MAM01816" "" "" "" "" "" "PROTEIN" "" "" "M01816" "" "m01816n" "m01816n"
36 changes: 36 additions & 0 deletions data/deprecatedIdentifiers/deprecatedReactions.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -194,4 +194,40 @@ rxns rxnKEGGID rxnBiGGID rxnEHMNID rxnHepatoNET1ID rxnREACTOMEID rxnRecon3DID rx
"MAR03441" "" "RE3150C" "" "" "" "RE3150C" "MNXR103806" "" "" "" 0 "" "" "RE3150C"
"MAR10164" "" "" "" "" "" "CE2516t" "" "" "" "" 0 "" "" "CE2516t"
"MAR10433" "" "" "" "" "" "EX_CE2516[e]" "" "" "" "" 0 "" "" "EX_CE2516[e]"
"MAR01630" "" "" "" "" "R-HSA-192325" "HMR_1630" "MNXR125295" "HMR_1630" "RCR20511" "" 0 "" "" "HMR_1630"
"MAR01635" "R08734" "" "RE2624M" "" "R-HSA-192056" "HMR_1635;RE2624M" "MNXR112240" "HMR_1635" "RCR13606" "" 0 "RHEA:40456" "RHEA:40455" "HMR_1635"
"MAR01637" "" "" "RE3247M" "r0706" "R-HSA-192335" "HMR_1637;RE3247M" "MNXR105369;MNXR124225" "HMR_1637" "RCR13607" "" 0 "" "" "HMR_1637"
"MAR01644" "R04813" "" "RE3248M" "" "" "HMR_1644" "" "HMR_1644" "RCR12830" "" 0 "" "RHEA:18933" "HMR_1644"
"MAR01653" "R03719" "SCPx" "R03719X" "r0628" "" "HMR_1653" "MNXR104297;MNXR108369" "HMR_1653" "RCR13610" "" 0 "" "RHEA:16865" "HMR_1653"
"MAR03754" "" "" "" "" "" "RE3248M" "" "" "" "" 0 "" "" "RE3248M"
"MAR03760" "" "" "" "" "" "RE3250M" "" "" "" "" 0 "" "" "RE3250M"
"MAR01656" "" "" "" "r0990" "" "r0990" "MNXR105412" "HMR_1656" "RCR20134" "" 0 "" "" "HMR_1656"
"MAR07758" "" "" "RT0402" "" "" "HMR_7758" "" "HMR_7758" "RCR20277" "" 0 "" "" "HMR_7758"
"MAR01662" "R07296" "" "RE1834M" "" "" "RE1834M" "MNXR103558;MNXR110971" "HMR_1662" "RCR13611" "" 0 "RHEA:14542" "RHEA:14541" "HMR_1662"
"MAR01666" "" "" "" "" "R-HSA-193399" "HMR_1666" "MNXR125298" "HMR_1666" "RCR20514" "" 0 "RHEA:72683" "RHEA:72683" "HMR_1666"
"MAR01458" "" "HSD17B4x" "" "" "" "HSD17B4x" "MNXR100720" "" "" "" 0 "" "" "HSD17B4x"
"MAR01651" "R04812" "" "RE3250M" "" "" "HMR_1651" "" "HMR_1651" "RCR12831" "" 0 "" "" "HMR_1651"
"MAR01639" "" "" "RE3247X;RE3247M" "r0706" "R-HSA-192335" "RE3247X;r0706;HMR_1637;RE3247M" "MNXR105369;MNXR124225" "HMR_1639;HMR_1637" "RCR10917;RCR13607" "" 0 "" "" "HMR_1639;HMR_1637;MAR01637"
"MAR03301" "" "" "RE1516X" "" "" "" "" "HMR_3301" "RCR12606" "" 0 "" "" "HMR_3301"
"MAR03306" "" "" "RE1517X" "" "" "" "" "HMR_3306" "RCR12610" "" 0 "" "" "HMR_3306"
"MAR03311" "" "" "RE1518X" "" "" "" "" "HMR_3311" "RCR14519" "" 0 "" "" "HMR_3311"
"MAR04966" "" "FAOXC101C102x" "" "" "" "FAOXC101C102x" "" "" "" "" 0 "" "" "FAOXC101C102x"
"MAR03364" "" "" "RE2913X" "" "" "" "" "HMR_3364" "RCR12576" "" 0 "" "" "HMR_3364"
"MAR03369" "" "" "RE2914X" "" "" "" "" "HMR_3369" "RCR12580" "" 0 "" "" "HMR_3369"
"MAR09887" "" "GLNB0AT3tc" "" "" "" "GLNB0AT3tc" "" "" "" "" 0 "" "" "GLNB0AT3tc"
"MAR00059" "" "ACOX22x" "" "" "" "ACOX22x" "MNXR95389" "" "" "" 0 "" "" "ACOX22x"
"MAR00024" "" "" "" "" "" "HMR_0024" "" "HMR_0024" "RCR13367" "" 0 "" "" "HMR_0024"
"MAR00025" "" "" "" "" "" "HMR_0025;HMR_0030" "" "HMR_0025;HMR_0030" "RCR20226;RCR20227" "" 0 "" "" "HMR_0025;HMR_0030;MAR00030"
"MAR00026" "" "" "" "" "" "HMR_0026" "" "HMR_0026" "RCR21051" "" 0 "" "" "HMR_0026"
"MAR00027" "" "" "" "" "" "HMR_0027" "" "HMR_0027" "RCR21052" "" 0 "" "" "HMR_0027"
"MAR00028" "" "" "" "" "" "HMR_0028" "" "HMR_0028" "RCR21053" "" 0 "" "" "HMR_0028"
"MAR00029" "" "" "" "" "" "HMR_0029" "" "HMR_0029" "RCR40953" "" 0 "" "" "HMR_0029"
"MAR05173" "" "" "" "" "" "HMR_5173" "" "HMR_5173" "RCR14475" "" 0 "" "" "HMR_5173"
"MAR05289" "" "" "" "" "" "HMR_5289" "" "HMR_5289" "RCR14478" "" 0 "" "" "HMR_5289"
"MAR13064" "" "" "" "" "" "EX_M01268[e]" "" "" "" "" 0 "" "" "EX_M01268[e]"
"MAR01515" "" "MAOX" "" "" "" "MAOX" "MNXR101406" "" "" "" 0 "RHEA:59421" "RHEA:59420" "MAOX"
"MAR00039" "" "13DAMPPOX" "" "" "" "13DAMPPOX" "MNXR94687" "" "" "" 0 "" "" "13DAMPPOX"
"MAR00096" "" "BUP2" "" "" "" "BUP2" "MNXR96346" "" "" "" 0 "" "" "BUP2"
"MAR02027" "" "r0193" "" "" "" "r0193" "MNXR105313" "" "" "" 0 "" "" "r0193"
"MAR02006" "" "CPS_m" "" "" "" "r0034" "" "" "" "" 0 "" "" "r0034"
"MAR03940" "R01795" "PHETHPTOX" "R01795C" "r0399" "" "r0399" "MNXR102632;MNXR107174" "HMR_3940" "RCR11388" "" 0 "" "RHEA:30787" "HMR_3940"
4 changes: 2 additions & 2 deletions data/metabolicTasks/metabolicTasks_CellfieConsensus.txt
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@
NAD+[m] 1 1 CO2[m] 1 1
NADH[m] 1 1
34 Synthesis of fructose-6-phosphate from erythrose-4-phosphate (HMP shunt) fructose-6-phosphate[c] 1 1 erythrose-4-phosphate[c] 1 1
GAP[c] 1 1 D-xylulose-5-phosphate[c] 1 1
D-glyceraldehyde 3-phosphate[c] 1 1 D-xylulose-5-phosphate[c] 1 1
35 Synthesis of ribose-5-phosphate glucose[c] 1 1 ribose-5-phosphate[c] 1 1
ATP[c] 1 1 ADP[c] 1 1
NADP+[c] 2 2 H+[c] 3 3
Expand All @@ -226,7 +226,7 @@
38 Glycogen degradation glycogenin G4G7[c] 1 1 glucose[c] 8
Pi[c] 3 NA[c] 1 1
H2O[c] 8 glucose-1-phosphate[c] 3
39 Fructose degradation (to glucose-3-phosphate) fructose[c] 1 1 GAP[c] 2 2
39 Fructose degradation (to glucose-3-phosphate) fructose[c] 1 1 D-glyceraldehyde 3-phosphate[c] 2 2
ATP[c] 2 2 ADP[c] 2 2
H+[c] 2 2
40 Fructose to glucose conversion (via fructose-6-phosphate) fructose[c] 1 1 glucose[c] 1 1
Expand Down
Loading

0 comments on commit c3db9c5

Please sign in to comment.