From c7d723cc3e5017f5af8374803f16a9a9d079362d Mon Sep 17 00:00:00 2001 From: warrenmcg Date: Sat, 25 Feb 2017 04:44:41 -0600 Subject: [PATCH 1/3] added '*.pyc' and 'mpmath/**/*.pyc' to .gitignore --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 03a576d..21e6556 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ - +mpmath/**/*.pyc +*.pyc *.zip From db97bc288a9528c17c9d66384d9b3e823298551a Mon Sep 17 00:00:00 2001 From: warrenmcg Date: Sat, 25 Feb 2017 04:46:19 -0600 Subject: [PATCH 2/3] fix bug that failed to recognize mm_symbols in updated HMD_Phenotype.rpt file, causing MPhenoOntology building to fail --- GeneSetDownloader.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GeneSetDownloader.py b/GeneSetDownloader.py index 3f52ed5..ab9954b 100755 --- a/GeneSetDownloader.py +++ b/GeneSetDownloader.py @@ -486,7 +486,7 @@ def importPhenotypeOntologyGeneAssociations(): t = string.split(data,'\t') hs_symbol=t[0]; hs_entrez=t[1]; mm_symbol=t[2]; mgi=t[3]; pheno_ids=t[4] if 'MP' not in pheno_ids: - try: pheno_ids = t[5] + try: mm_symbol=t[3]; mgi=t[4]; pheno_ids=t[5] except Exception: pass hs_symbol = string.lower(hs_symbol) mm_symbol = string.lower(mm_symbol) @@ -1243,4 +1243,4 @@ def buildAccessoryPathwayDatabases(selected_species,additional_resources,force): additional_resources+=['miRNA Targets','GOSlim','Disease Ontology','Phenotype Ontology','KEGG','RVista Transcription Factor Sites'] additional_resources=['BioGRID'] buildAccessoryPathwayDatabases(selected_species,additional_resources,force) - \ No newline at end of file + From b132f0bca3baaeab4afbe5475f6e47a496b79d46 Mon Sep 17 00:00:00 2001 From: warrenmcg Date: Mon, 27 Feb 2017 02:37:29 -0600 Subject: [PATCH 3/3] change WikiPathway pathway values to UTF-8 encoding to prevent bug that fails on non-ASCII characters in human WikiPathways database --- gene_associations.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gene_associations.py b/gene_associations.py index 4d9c6e7..aee4fba 100755 --- a/gene_associations.py +++ b/gene_associations.py @@ -1349,7 +1349,7 @@ def __init__(self,system_name,geneID,pathway): except Exception: null=[] def GeneID(self): return str(self.geneID) def System(self): return str(self.system_name) - def Pathway(self): return str(self.pathway) + def Pathway(self): return self.pathway ## Returning str() threw an error for non-ASCII characters in HsWikiPathways def setGraphID(self,graphID): self.graphID = graphID def setGroupID(self,groupid): self.groupid = groupid def GraphID(self): return self.graphID @@ -1396,6 +1396,7 @@ def exportWikiPathwayData(species_name,pathway_db,type): values +=[wpd.Uniprot(), wpd.Unigene(), wpd.Refseq(), wpd.MOD(), wpd.Pubchem(), wpd.CAS(), wpd.Chebi()] values = string.join(values,'\t') values = string.replace(values,'\n','') ###Included by mistake + values = values.encode('UTF-8', 'replace') ## Need this line to prevent non-ASCII characters from HsWikiPathways throwing an error export_data.write(values+'\n') export_data.close() #print 'WikiPathways data exported to:',export_dir