diff options
author | Hao Chen | 2019-05-08 16:11:19 -0500 |
---|---|---|
committer | Hao Chen | 2019-05-08 16:11:19 -0500 |
commit | 2fe62381ba9e0bda51205d708c62e36435c60ea7 (patch) | |
tree | dd1a115453b60f796fc79164b0d94758bca69127 | |
parent | 02311e25a43d9a9443149a0402279f0f8a48ce50 (diff) | |
download | genecup-2fe62381ba9e0bda51205d708c62e36435c60ea7.tar.gz |
clean up bold text
-rwxr-xr-x | ratspub.py | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -37,10 +37,12 @@ def gene_addiction(gene): for sent in sents.split("\n"): for drug0 in drug_d: if findWholeWord(drug_d[drug0])(sent) : + sent=sent.replace("<b>","").replace("</b>","") sent=re.sub(r'\b(%s)\b' % drug_d[drug0], r'<b>\1</b>', sent, flags=re.I) out+=gene+"\t"+"drug\t" + drug0+"\t"+sent+"\n" for add0 in addiction_d: if findWholeWord(addiction_d[add0])(sent) : + sent=sent.replace("<b>","").replace("</b>","") sent=re.sub(r'\b(%s)\b' % addiction_d[add0], r'<b>\1</b>', sent, flags=re.I) out+=gene+"\t"+"addiction\t"+add0+"\t"+sent+"\n" return(out) @@ -52,6 +54,7 @@ def gene_anatomical(gene): for sent in sents.split("\n"): for brain0 in brain_d: if findWholeWord(brain_d[brain0])(sent) : + sent=sent.replace("<b>","").replace("</b>","") sent=re.sub(r'\b(%s)\b' % brain_d[brain0], r'<b>\1</b>', sent, flags=re.I) out+=gene+"\t"+"brain\t"+brain0+"\t"+sent+"\n" return(out) @@ -63,6 +66,7 @@ def gene_functional(gene): for sent in sents.split("\n"): for bio0 in function_d: if findWholeWord(function_d[bio0])(sent) : + sent=sent.replace("<b>","").replace("</b>","") sent=re.sub(r'\b(%s)\b' % function_d[bio0], r'<b>\1</b>', sent, flags=re.I) out+=gene+"\t"+"function\t"+bio0+"\t"+sent+"\n" return(out) @@ -111,9 +115,9 @@ drug_d = {"alcohol":"alcohol|alcoholism|alcoholic", drug=undic(drug_d) brain_d ={"cortex":"cortex|prefrontal|pfc|mPFC|vmpfc|corticostriatal|cortico limbic|corticolimbic|prl|prelimbic|infralimbic|orbitofrontal|cingulate|cerebral|insular|insula", - "striatum":"striatum|STR|striatal|caudate|putamen", + "striatum":"striatum|STR|striatal|caudate|putamen|basal ganglia|globus pallidus", "accumbens":"accumbens|accumbal|shell|core|Nacc|NacSh|acbs|acbc", - "hippocampus":"hippocampus|hippocampal|hipp|hip|ca1|ca3|dentate gyrus|subiculum|vhipp", + "hippocampus":"hippocampus|hippocampal|hipp|hip|ca1|ca3|dentate gyrus|subiculum|vhipp|dhpc|vhpc", "amygdala":"amygdala|cea|bla|amy", "vta":"ventral tegmental|vta|pvta|mesolimbic|limbic|midbrain|mesoaccumbens" } |