Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Human 1.13 #441

Merged
merged 72 commits into from
Dec 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
63fd042
feat: add script to merge/remove duplicate reactions
JonathanRob Jul 21, 2022
7965328
feat: remove duplicated rxns and update remaining rxn annotation
JonathanRob Jul 21, 2022
3bca620
chore: add deleted duplicate reactions to deprecatedReactions.tsv doc
JonathanRob Jul 21, 2022
36aa20d
feat: remove duplicated rxns and update annotations for remaining rxns
JonathanRob Jul 21, 2022
c772e6f
Merge pull request #403 from SysBioChalmers/fix/issue345
JonathanRob Jul 23, 2022
c5e262c
feat: update script to merge eccodes and rxnReferences model fields
JonathanRob Jul 27, 2022
192bded
feat: merge rxn eccode and rxnReference fields from duplicated rxns
JonathanRob Jul 27, 2022
78a08fa
Merge pull request #405 from SysBioChalmers/fix/issue345
JonathanRob Jul 28, 2022
4c14f8b
fix: mark MAR05998 as reversible
Sep 15, 2022
e953f1d
feat: add referencess for MAR05998 from UniProt
Sep 15, 2022
b73137c
Merge pull request #415 from stairs/fix/set-MAR05998-reversible
haowang-bioinfo Sep 18, 2022
380c0b1
fix: curate GPR rule for mitochondrial pyruvate carrier complex
haowang-bioinfo Sep 30, 2022
2d4dec6
fix: curate PMIDs
haowang-bioinfo Sep 30, 2022
484e530
Merge pull request #419 from SysBioChalmers/fix/curateGPR4MAR04926
haowang-bioinfo Oct 2, 2022
b0ee81e
fix: remove some empty fields from imported yaml model
JonathanRob Oct 7, 2022
b609bfe
Merge pull request #420 from SysBioChalmers/fix/importYaml
haowang-bioinfo Oct 10, 2022
93e302a
fix: prepHumanModelForftINIT now allows for specifying the paths to t…
johan-gson Oct 12, 2022
a55f8d8
feat: Added an install script identical to that in GECKO3.
johan-gson Oct 12, 2022
809d85c
fix: added filtering of .deprecated in the install script.
johan-gson Oct 13, 2022
45b6441
Update HumanGEMInstaller.m
johan-gson Oct 16, 2022
e71bd50
Update HumanGEMInstaller.m
johan-gson Oct 16, 2022
badcee3
Update HumanGEMInstaller.m
johan-gson Oct 16, 2022
4bbcbc2
Update HumanGEMInstaller.m
johan-gson Oct 16, 2022
dd2b8bc
Update HumanGEMInstaller.m
johan-gson Oct 16, 2022
7f0e874
Update HumanGEMInstaller.m
johan-gson Oct 17, 2022
312ea7f
fix: Fixed a bug in HumanGEMInstaller - could not uninstall if in the…
johan-gson Oct 17, 2022
2e3f01c
refactor: move file and add documentation
mihai-sysbio Oct 18, 2022
0c351a4
Update code/HumanGEMInstaller.m
johan-gson Oct 18, 2022
cd7a55a
fix: changed directories for install, added ../ to them
johan-gson Oct 19, 2022
3ff0e24
style: improve styling of installation commands
mihai-sysbio Oct 19, 2022
465efc0
Merge pull request #423 from SysBioChalmers/feat/AddInstallScript
johan-gson Oct 20, 2022
03c5b83
Update code/tINIT/prepHumanModelForftINIT.m
johan-gson Oct 21, 2022
b591169
Update code/tINIT/prepHumanModelForftINIT.m
johan-gson Oct 21, 2022
da4dd40
Update code/tINIT/prepHumanModelForftINIT.m
johan-gson Oct 21, 2022
81a2c7f
style: Added some comments
johan-gson Oct 21, 2022
d542521
fix: add missing PMID prefix for references
mihai-sysbio Nov 2, 2022
e99f5a3
Merge pull request #428 from SysBioChalmers/fix/pmid-prefix
haowang-bioinfo Nov 2, 2022
1f992ae
feat: add cis-aconitate decarboxylase reaction catalyzed by ACOD1 (IRG1)
haowang-bioinfo Nov 2, 2022
086d082
fix: make sure pmid is followed by colon
mihai-sysbio Nov 3, 2022
341f7b0
fix: leave reference filed blank if no PMID is available
haowang-bioinfo Nov 3, 2022
cac4b8b
Merge pull request #431 from SysBioChalmers/fix/pmid-formatting
mihai-sysbio Nov 3, 2022
b500274
Merge pull request #422 from SysBioChalmers/fix/ftINITPathsAsParams
johan-gson Nov 6, 2022
eb4442e
Merge branch 'develop' into feat/addACOD1
haowang-bioinfo Nov 9, 2022
4d94a2d
fix-rxn: change MAR09498 to irreversible
haowang-bioinfo Nov 9, 2022
1892dde
feat-rxn: add new reaction MAR13087
haowang-bioinfo Nov 9, 2022
9328eb0
feat: update reaction annotation file
haowang-bioinfo Nov 9, 2022
5dc9498
feat: update gene annotation file
haowang-bioinfo Nov 9, 2022
e2fff54
Merge pull request #429 from SysBioChalmers/feat/addACOD1
haowang-bioinfo Nov 10, 2022
ebc4934
fix: remove reaction MAR02517
JonathanRob Nov 16, 2022
cb3f31e
fix: correct ec-code for reaction MAR02519
JonathanRob Nov 16, 2022
d2132da
fix: remove newly orphaned mets no longer involved in any rxns
JonathanRob Nov 16, 2022
130e0e7
Merge pull request #432 from SysBioChalmers/fix_issue381
haowang-bioinfo Nov 17, 2022
49136b1
fix: update HMDB ID format to version 4
haowang-bioinfo Nov 18, 2022
e03eb8c
fix: update HMDB ID for MAM03055r
haowang-bioinfo Nov 18, 2022
a6f7f92
fix-met: revert unnecessary inserting of zeros
haowang-bioinfo Nov 20, 2022
995fe24
fix-met: remove deprecated HMDB ids
haowang-bioinfo Nov 20, 2022
6b171ed
fix-met: replace old ids with updated ones
haowang-bioinfo Nov 20, 2022
3c9e657
feat: add compartment annotation extracted from SwissProt
haowang-bioinfo Nov 29, 2022
0181082
feat: add Cell Atlas compartment location
haowang-bioinfo Nov 29, 2022
815edd0
fix: reextract SwissProt subcellular location annotation in devel branch
haowang-bioinfo Nov 30, 2022
828d6fa
feat: improved mapping of Swissprot Mitochondria compartment annotation
haowang-bioinfo Dec 1, 2022
25ae2e4
style: rename Swissprot compartment annotation file
haowang-bioinfo Dec 1, 2022
b2c9f14
feat: append genes.tsv with two columns: comps and data source
haowang-bioinfo Dec 1, 2022
ceab2ca
feat: add code used for compartment info extraction
haowang-bioinfo Dec 1, 2022
06aa71f
fix: [i] assignment by SwissProt overrides [m] assignment by Cell Atlas
haowang-bioinfo Dec 2, 2022
f2d1569
fix: incorporate miscellaneous fixes
haowang-bioinfo Dec 3, 2022
42dae44
Merge pull request #437 from SysBioChalmers/feat/addCompartmentInfo
haowang-bioinfo Dec 5, 2022
4e99f62
Merge branch 'develop' into fix/HMDB_ids_issue434
haowang-bioinfo Dec 8, 2022
c3b720f
doc: update README files
haowang-bioinfo Dec 10, 2022
315d2c7
Merge pull request #435 from SysBioChalmers/fix/HMDB_ids_issue434
haowang-bioinfo Dec 10, 2022
15a08a6
feat: add compartment info from deeploc2 prediction
feiranl Dec 15, 2022
bcde094
Merge pull request #440 from SysBioChalmers/addCompartmentPrediction
haowang-bioinfo Dec 15, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,15 @@ Detailed instructions on the installation and use of the Human-GEM model and rep

### Installation Instructions
* Clone the [main branch](https://github.com/SysBioChalmers/Human-GEM/tree/main) of this repository, or [download the latest release](https://github.com/SysBioChalmers/Human-GEM/releases/latest).
* Add the directory to your MATLAB path (instructions [here](https://se.mathworks.com/help/matlab/ref/addpath.html?requestedDomain=www.mathworks.com)).

* Add the directory to your MATLAB path either by using the lines below or manually (instructions [here](https://se.mathworks.com/help/matlab/ref/addpath.html?requestedDomain=www.mathworks.com)).
```matlab
% Replace "/my/path/" with the actual path to the Human-GEM folder
cd /my/path/Human-GEM/code
% This will add the relevant paths to the path variable in MATLAB
HumanGEMInstaller.install
% It is also possible to remove Human-GEM from the MATLAB path using
HumanGEMInstaller.uninstall
```

## Model Files

Expand Down Expand Up @@ -149,4 +156,4 @@ A collection of manually curated 2D metabolic maps associated with Human-GEM are
<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->

<!-- ALL-CONTRIBUTORS-LIST:END -->
<!-- ALL-CONTRIBUTORS-LIST:END -->
44 changes: 44 additions & 0 deletions code/HumanGEMInstaller.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
classdef HumanGEMInstaller
% HumanGEMInstaller
% Support for installing and uninstalling
% Run HumanGEMInstaller.install to install (will set up the path in MATLAB)
% Run HumanGEMInstaller.uninstall to clear the path from MATLAB
% To install, you first need to cd to the HumanGEM root.

methods (Static)
function install
sourceDir = fileparts(which(mfilename));
paths = HumanGEMInstaller.GetFilteredSubPaths(sourceDir);
addpath(paths);
savepath;
end
function uninstall
sourceDir = fileparts(which(mfilename));
paths = HumanGEMInstaller.GetFilteredSubPaths(sourceDir);
rmpath(paths);
savepath;
end
function path = getHumanGEMMainPath()
path = fileparts(which(mfilename));
path = strrep(path, '\', '/'); %get rid of backslashes in Windows
if ~endsWith(path, '/')
path = strcat(path,'/');
end
end

function newPaths = GetFilteredSubPaths(path_)
pathSep = pathsep();
%Check that there are no separators in the path - that will cause
%problems since the separator is used to separate paths in a string
if contains(path_, pathSep)
error('The path in which Human-GEM resides may not contain path separator chars such as semicolon for this installation to work!');
end
subpaths = arrayfun(@(subf) sprintf('%s', genpath([path_ filesep subf{:}])), HumanGEMInstaller.SUBFOLDERS, 'UniformOutput', false);
newPaths = strjoin(subpaths, '');
end
end

properties (Constant)
SUBFOLDERS = {'../code', '../data', '../model'};
end
end
6 changes: 5 additions & 1 deletion code/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Human-GEM code

This directory contains functions and scripts that facilitate work with the Human-GEM model and other content in the repository. This directory is organized as follows:
A handy installer script is provided via _HumanGEMInstaller.m_, which can add and remove, via _HumanGEMInstaller.install_ and
_HumanGEMInstaller.uninstall_, all necessary subfolders of Human-GEM to the Matlab path.

This directory contains functions and scripts that facilitate work with the Human-GEM model and other content in the repository.
This directory is organized as follows:

```
code
Expand Down
11 changes: 11 additions & 0 deletions code/io/importYaml.m
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,17 @@
[~, metIdx] = ismember(model.mets, newMets);
model.S = S(metIdx, :);

% remove empty fields
modelFields = fieldnames(model);
emptyFields = modelFields(structfun(@isempty, model));
keepFields = {'description', 'version'}; % some fields can be empty
removeFields = setdiff(emptyFields, keepFields);
model = rmfield(model, removeFields);
if ~silentMode && (numel(removeFields) > 0)
fprintf('\nThe following empty fields were removed from the model:\n');
fprintf('\t%s\n', removeFields{:});
end

if ~silentMode
fprintf(' Done!\n');
end
Expand Down
2 changes: 1 addition & 1 deletion code/modelCuration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

This directory contains curation-related scripts and functions used to make changes to the Human-GEM repository. These curation scripts help to improve transparency of changes made to the model when the number of changes is too large to view practically.


- `getCompFromUniprotCellAtlas.py`: Code for collecting subcellular localization information for existing metabolic enzymes from **Swissprot** and **Cell Atlas** ([HPA](https://www.proteinatlas.org/search/has_protein_data_in%3ACell)), and then incorporating the compartment info from both sources into `genes.tsv`.
33 changes: 33 additions & 0 deletions code/modelCuration/addRxnACOD1_20221102.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
% load model and new reaction info
ihuman = importYaml('../../model/Human-GEM.yml');
rxnsToAdd = importTsvFile('../../data/modelCuration/addRxnACOD1_20221102.tsv');

% add new genes to Human-GEM
newGEM = ihuman;
newGEM.genes = [newGEM.genes; rxnsToAdd.grRules];
newGEM.rxnGeneMat(:, end+1) = 0;

% reformat subsystem
if ~iscell(rxnsToAdd.subSystems{1})
rxnsToAdd.subSystems = cellfun(@(s) {{s}}, rxnsToAdd.subSystems);
end
% add new reaction
newGEM = addRxns(newGEM, rxnsToAdd, 3);

% add reaction annotation
rxnAssoc = importTsvFile('../../model/reactions.tsv');
annoNames = fieldnames(rxnAssoc);
for i=1:length(annoNames)
if ismember(annoNames{i}, fieldnames(rxnsToAdd))
rxnAssoc.(annoNames{i}) = [rxnAssoc.(annoNames{i}); rxnsToAdd.(annoNames{i})];
elseif isequal(annoNames{i},'spontaneous')
rxnAssoc.(annoNames{i}) = [rxnAssoc.(annoNames{i}); 0];
else
rxnAssoc.(annoNames{i}) = [rxnAssoc.(annoNames{i}); {''}];
end
end

% update yaml model and reaction association file
exportYaml(newGEM, '../../model/Human-GEM.yml');
exportTsvFile(rxnAssoc,'../../model/reactions.tsv');

60 changes: 60 additions & 0 deletions code/modelCuration/getCompFromDeepLoc2.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
% This function is to extract the compartment prediction from DeepLoc2 tool
% to expand the gene.tsv file.
% Only when there is not such info from cellAtlas or SwissPort, we use the
% compartment prediction from the DeepLoc2.
% DeepLoc2 is used for the localization prediction, the protein fasta file
% for all metabolic proteins in the model was used as the input file, the
% default parameter was used in the prediction, output file is stored as
% DeepLoc2_compartment.tsv in ../../data/modelCuration

% Read the predicted compartment info
fileName = '../../data/modelCuration/DeepLoc2_compartment.csv';
fid = fopen(fileName);
DeeplocData = textscan(fid,[repmat('%s ',[1,12]) '%s'],'Delimiter',',');
DeeplocData = [DeeplocData{1:end}];
DeeplocData = DeeplocData(2:end,:);
DeeplocData(:,[1,14]) = split(DeeplocData(:,1),';');
fclose(fid);

% Read gene.tsv
fileName = '../../model/genes.tsv';
fid = fopen(fileName);
geneData = textscan(fid,[repmat('%s ',[1,9]) '%s'],'Delimiter','\t');
geneData = [geneData{1:end}];
fclose(fid);
geneData = strrep(geneData,'"','');

% index the DeeplocDdata by geneData order
DeeplocDdata_sorted(1:length(geneData(:,1)),1:length(DeeplocData(1,:))) = {''};
[~,idx] = ismember(geneData(:,1),DeeplocData(:,1));
DeeplocDdata_sorted(idx~=0,:) = DeeplocData(idx(idx~=0),:);


% build a dict for key word mapping of compartment assignment
DeepLoc_keywords = {'Cytoplasm','Cytosol';
'Nucleus','Nucleus';
'Extracellular','Extracellular';
'Cell membrane','Cell membrane';
'Mitochondrion','Mitochondria';
'Plastid','';
'Endoplasmic reticulum','Endoplasmic reticulum';
'Lysosome/Vacuole','Lysosome';
'Golgi apparatus','Golgi apparatus';
'Peroxisome','Peroxisome'
'|',';'};
for i = 1:length(DeepLoc_keywords(:,1))
DeeplocDdata_sorted(:,2) = strrep(DeeplocDdata_sorted(:,2),DeepLoc_keywords{i,1},DeepLoc_keywords{i,2});
end
% fill the compartment for protein without localization info from CellAtlas
%and SwissPort
idx = cellfun(@isempty,geneData(:,9)) & ~(cellfun(@isempty,DeeplocDdata_sorted(:,1)));
geneData(idx,9) = DeeplocDdata_sorted(idx,2);
geneData(idx,10) = {'DeepLoc2'};

% write out gene.tsv
out = geneData';
fID = fopen('../../model/genes.tsv','w');
fprintf(fID,[repmat('%s\t',[1,9]) '%s\n'],out{1:10});
fprintf(fID,[repmat('"%s"\t',[1,9]) '"%s"\n'],out{11:end});
fclose(fID);

141 changes: 141 additions & 0 deletions code/modelCuration/getCompFromUniprotCellAtlas.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
# collect subcellular localization for existing enzymes from Uniprot/Swissprot and Cell Atlas
# compartment info from both sources were combined and integrated into genes.tsv

import pandas as pd
import csv

# import subcellular location from SwissProt annotation
SwissProt_tsv = pd.read_table("~/Downloads/SwissProt_20221115.tsv")
SwissProt_proteins = SwissProt_tsv['Entry'].to_list()
SwissProt_subCellularlocation = SwissProt_tsv['Subcellular location [CC]'].to_list()


# build a dict for key word mapping of compartment assignment
swissprot_keywords = {
#'Extracellular': ['',''], # e
'Peroxisome': ['peroxisome'], # x
'Mitochondria': ['mitochondrion {','mitochondrion matrix'], # m
'Cytosol': ['cytoplasm','cytosol','cytoskeleton'], # c
'Lysosome': ['lysosome','lysosome lumen','lysosome membrane'], # l
'Endoplasmic reticulum': ['endoplasmic reticulum','Endoplasmic reticulum lumen','endoplasmic reticulum membrane'], # r
'Golgi apparatus': ['golgi apparatus','golgi apparatus lumen','golgi apparatus membrane'], # g
'Nucleus': ['nucleus','nucleolus'], # n
'Inner mitochondria': ['mitochondrion inner membrane','mitochondrion intermembrane space'] # i
}


# store swissport compartment info as a dict with a key of uniprot id
comps_from_swissprot = {}
for i, text in enumerate(SwissProt_subCellularlocation):
out_list = [] # output compartmetns as a list
comps_from_swissprot[SwissProt_proteins[i]] = out_list
if not pd.isna(text):
for key in swissprot_keywords:
# check if cellular location text contains any keyword from a compartment
if any(word in text.lower() for word in swissprot_keywords[key]):
out_list.append(key)
comps_from_swissprot[SwissProt_proteins[i]] = out_list


# load Human-GEM gene annotation file
HumanGenes_tsv = pd.read_table("../../model/genes.tsv")
Human_genes = HumanGenes_tsv['genes'].to_list()
Human_proteins = HumanGenes_tsv['geneUniProtID'].to_list()


# save SwissProt compartment information to tsv file
swissprot_compList = ['']*len(Human_genes)
for i in range(len(Human_genes)):
if not pd.isna(Human_proteins[i]):
if Human_proteins[i] in SwissProt_proteins:
swissprot_compList[i] = ';'.join(comps_from_swissprot[Human_proteins[i]])
swissprot_compartments = pd.DataFrame()
swissprot_compartments['genes'] = Human_genes
swissprot_compartments['geneUniProtID'] = Human_proteins
swissprot_compartments['compartments'] = swissprot_compList
swissprot_compartments.to_csv('../../data/modelCuration/Swissprot_compartments.tsv', sep="\t", index=False)


# import Cell Atlas compartment info
cell_atlas_compartments = pd.read_table("../../data/modelCuration/CellAtlasCompartments_science_2017.tsv")
cellAtlas_comps = cell_atlas_compartments['Subcellular location'].to_list()
cellAtlas_ensembl_id = cell_atlas_compartments['Ensembl'].to_list()
cellAtlas_uniprot_id = cell_atlas_compartments['Uniprot'].to_list()

# investigate key words
compartment_names = []
for comps in cellAtlas_comps:
compartment_names.extend(comps.split(','))
unique_compartments = set(compartment_names)
unique_compartments
# Cell Atlas compartments were sorted and the following ones were discarded:
# 'Microtubules', 'Midbody ring', 'Midbody', 'Cytokinetic bridge', 'Microtubule ends', 'Mitotic spindle'
# 'Intermediate filaments', 'Actin filaments', 'Focal adhesion sites', 'Cleavage furrow',
# 'Lipid droplets', 'Vesicles', 'Endosomes', 'Plasma membrane', 'Cell Junctions'
# 'Centrosome', 'Centriolar satellite'

# construct a dict for key word mapping to Cell Atlas compartments
cellatlas_keywords = {
#'Extracellular': [''], # e
'Peroxisome': ['Peroxisomes'], # x
'Mitochondria': ['Mitochondria'], # m
'Cytosol': ['Cytosol', 'Cytoplasmic bodies', 'Rods & Rings', 'Aggresome'], # c
'Lysosome': ['Lysosomes'], # l
'Endoplasmic reticulum': ['Endoplasmic reticulum'], # r
'Golgi apparatus': ['Golgi apparatus'], # g
'Nucleus': ['Nuclear membrane', 'Nucleoli rim', 'Nucleoli', 'Nuclear bodies', 'Nucleoli fibrillar center', 'Nucleoplasm', 'Kinetochore', 'Mitotic chromosome', 'Nuclear speckles'], # n
#'Inner mitochondria': [''] # i, Cell Atlas does provide such location info
}


# store CellAtlas compartment info to a dict with keys as ensembl ids
geneComps_from_cell_atlas = {}
for gene in Human_genes:
out_list = [] # store compartments as a list
if gene not in cellAtlas_ensembl_id:
geneComps_from_cell_atlas[gene] = out_list
else:
gene_ind = cellAtlas_ensembl_id.index(gene)
for key in cellatlas_keywords:
# check if cellular location text contains any keyword from a compartment
if any(word in cellAtlas_comps[gene_ind] for word in cellatlas_keywords[key]):
out_list.append(key)
geneComps_from_cell_atlas[gene] = out_list


# integrate compartment info from cellAtlas and SwissProt with following rules:
# 1. output two columns: "compartments" and "compDataSource"
# 2. use one source if another has no assigned compartments
# 3. union compartments if both source are provided
swissprot_comps = pd.read_table("../../data/modelCuration/Swissprot_compartments.tsv")
geneComps_from_swissprot = swissprot_comps['compartments'].to_list()

# combine compartment info from two data sources
geneComps_combined = []
source = ['']*len(Human_genes)
for i, gene in enumerate(Human_genes):
out_list = [] # save compartmetns as a list
if pd.isna(geneComps_from_swissprot[i]) and geneComps_from_cell_atlas[gene] != []:
out_list = geneComps_from_cell_atlas[gene]
source[i] = 'CellAtlas'
elif not pd.isna(geneComps_from_swissprot[i]) and geneComps_from_cell_atlas[gene] == []:
out_list = geneComps_from_swissprot[i].split(';')
source[i] = 'SwissProt'
elif not pd.isna(geneComps_from_swissprot[i]) and geneComps_from_cell_atlas[gene] != []:
union = set(geneComps_from_swissprot[i].split(';')+ geneComps_from_cell_atlas[gene])
out_list = list(union)
source[i] = 'SwissProt;CellAtlas'
if 'Mitochondria' not in geneComps_from_swissprot[i].split(';') and 'Inner mitochondria' in geneComps_from_swissprot[i].split(';'):
if 'Mitochondria' in geneComps_from_cell_atlas[gene]:
out_list.remove('Mitochondria')
# manual inspection of integration
print(gene+': '+geneComps_from_swissprot[i]+'\t'+';'.join(geneComps_from_cell_atlas[gene])+'\t'+';'.join(out_list))
geneComps_combined.append(';'.join(out_list))


# append columns to genes.tsv
HumanGenes_tsv['compartments'] = geneComps_combined
HumanGenes_tsv['compDataSource'] = source
HumanGenes_tsv[:0].to_csv('../../model/genes.tsv', sep="\t", index=False)
HumanGenes_tsv.to_csv('../../model/genes.tsv', sep="\t", index=False, quoting=csv.QUOTE_NONNUMERIC, header=False, mode="a")

Loading