def testPseudomonasSymbol(self): """ Test to check that the output of Pseudomonas GO test files is what we expect, and that the 'xrdb' is 'Symbol', not 'PseudoCAP'. """ test_ini_file = 'test_files/test_pseudomonas.ini' go_terms = process_go.process_go_terms(test_ini_file, 'test_files/') desired_go_term = None for term in go_terms: if term['title'] == 'GO-BP-0015838:amino-acid betaine transport': desired_go_term = term desired_go_term_info = { 'title': 'GO-BP-0015838:amino-acid betaine transport', 'abstract': 'The directed movement of betaine, the N-trimethyl derivative ' 'of an amino acid, into, out of or within a cell, or between ' 'cells, by means of some agent such as a transporter or pore. ' 'Annotations are propagated through transitive closure as ' 'recommended by the GO Consortium. Only annotations with ' 'evidence coded as EXP, IDA, IPI, IMP, IGI or IEP ' 'are included.', 'organism': 'Pseudomonas aeruginosa', 'xrdb': 'Symbol', 'slug': 'go0015838-pseudomonas-aeruginosa', 'annotations': {'PA3236': [19919675], 'PA5388': [19919675]} } self.assertEqual(desired_go_term, desired_go_term_info)
def setUp(self): """""" species_ini_file = 'test_files/test_human.ini' self.kegg_sets = process_kegg.process_kegg_sets( species_ini_file, 'test_files/') self.go_terms = process_go.process_go_terms( species_ini_file, 'test_files/') self.do_terms = process_do.process_do_terms(species_ini_file) self.main_config_file = 'test_files/test_main_config.ini'
def setUp(self): """""" species_ini_file = 'test_files/test_human.ini' self.kegg_sets = process_kegg.process_kegg_sets( species_ini_file, 'test_files/') self.go_terms = process_go.process_go_terms( species_ini_file, 'test_files/') self.do_terms = process_do.process_do_terms(species_ini_file) self.main_config_file = 'test_files/test_main_config.ini' mc_file_parser = SafeConfigParser() mc_file_parser.read(self.main_config_file) tribe_url = mc_file_parser.get('Tribe parameters', 'TRIBE_URL') secrets_file = mc_file_parser.get('main', 'SECRETS_FILE') self.tribe_token = get_oauth_token(tribe_url, secrets_file)
def testCorrectPublications(self): test_ini_file = 'test_files/test_zebrafish.ini' go_terms = process_go.process_go_terms(test_ini_file, 'test_files/') annotations = None for term in go_terms: if term['title'] == 'GO-BP-0009100:glycoprotein metabolic process': annotations = term['annotations'] retrieved_annotations = {gene: set(annots) for gene, annots in annotations.iteritems()} desired_annotations = { 'ZDB-GENE-061110-16': set([22522421, 22522421]), 'ZDB-GENE-040315-1': set([19125692]), 'ZDB-GENE-030131-3222': set([25609749]), 'ZDB-GENE-070412-4': set([22522421]), 'ZDB-GENE-050213-1': set([21294126]), 'ZDB-GENE-020419-3': set([21294126, 22869369]), 'ZDB-GENE-030131-3127': set([22869369]), 'ZDB-GENE-121129-1': set([22869369]), 'ZDB-GENE-030131-9631': set([16188232]), 'ZDB-GENE-010102-1': set([19211552]), 'ZDB-GENE-060628-3': set([16672343]), 'ZDB-GENE-030131-5186': set([22869369]), 'ZDB-GENE-070112-1002': set([20466645]), 'ZDB-GENE-011119-1': set([21294126]), 'ZDB-GENE-040630-9': set([16156897]), 'ZDB-GENE-040724-125': set([21901110]), 'ZDB-GENE-030131-4714': set([25505245]), 'ZDB-GENE-121001-5': set([23359570]), 'ZDB-GENE-040801-234': set([23768512]), 'ZDB-GENE-041124-3': set([22869369, 15603738, 21294126]), 'ZDB-GENE-041124-2': set([22869369, 15603738]), 'ZDB-GENE-050522-358': set([23453667]), 'ZDB-GENE-111017-2': set([21901110]), 'ZDB-GENE-030722-6': set([22956764]), 'ZDB-GENE-020419-37': set([20226781, 21294126, 22869369, 20226781]), 'ZDB-GENE-070410-96': set([22522421]), 'ZDB-GENE-060929-966': set([20466645])} self.assertEqual(retrieved_annotations, desired_annotations)
def testProcessGOTerms(self): test_ini_file = 'test_files/test_human.ini' go_terms = process_go.process_go_terms(test_ini_file, 'test_files/') desired_output = [ {'abstract': 'Enables the transfer of a solute or solutes from one side of ' 'a membrane to the other according to the reaction: Zn2+(out) ' '= Zn2+(in), probably powered by proton motive force. In ' 'high-affinity transport the transporter is able to bind the ' 'solute even if it is only present at very low concentrations.' ' Annotations are propagated through transitive closure as ' 'recommended by the GO Consortium. Only annotations with ' 'evidence coded as EXP, IDA, IPI, IMP, IGI or IEP are ' 'included.', 'organism': 'H**o sapiens', 'annotations': {'A0A024QZP7': [], 'A0A024R216': [], 'A0A024R214': []}, 'xrdb': 'UniProtKB', 'title': 'GO-BP-0000006:la liga', 'slug': 'go0000006-h**o-sapiens', 'tags': ['xi', 'omicron', 'pi']}, {'abstract': 'Catalysis of the transfer of a solute or solutes ' 'from one side of a membrane to the other according to the ' 'reaction: Zn2+ = Zn2+, probably powered by proton motive ' 'force. In low-affinity transport the transporter is able to ' 'bind the solute only if it is present at very high ' 'concentrations. Annotations are propagated through transitive' ' closure as recommended by the GO Consortium. Only ' 'annotations with evidence coded as EXP, IDA, IPI, IMP, IGI or' ' IEP are included.', 'organism': 'H**o sapiens', 'annotations': {'A0A024R1V6': [], 'A0A024R214': [], 'A0A024QZP7': [], 'A0A024R216': []}, 'xrdb': 'UniProtKB', 'title': 'GO-BP-0000007:european team', 'slug': 'go0000007-h**o-sapiens', 'tags': ['rho', 'sigma']}, {'abstract': "RZ - We're making this bogus term not OBSOLETE. Assists in " "the correct assembly of ribosomes or ribosomal subunits in " "vivo, but is not a component of the assembled ribosome when " "performing its normal biological function. Annotations are " "propagated through transitive closure as recommended by the " "GO Consortium. Only annotations with evidence coded as EXP, " "IDA, IPI, IMP, IGI or IEP are included.", 'organism': 'H**o sapiens', 'annotations': {'A0A024R214': []}, 'xrdb': 'UniProtKB', 'title': 'GO-BP-0000005:premier league', 'slug': 'go0000005-h**o-sapiens', 'tags': ['lambda', 'mu', 'nu']}, {'abstract': 'The maintenance of the structure and integrity of the ' 'mitochondrial genome; includes replication and segregation of' ' the mitochondrial chromosome. Annotations are propagated ' 'through transitive closure as recommended by the GO ' 'Consortium. Only annotations with evidence coded as EXP, ' 'IDA, IPI, IMP, IGI or IEP are included.', 'organism': 'H**o sapiens', 'annotations': {'A0A024R214': []}, 'xrdb': 'UniProtKB', 'title': 'GO-BP-0000002:liverpool', 'slug': 'go0000002-h**o-sapiens', 'tags': ['delta', 'epsilon', 'zeta']}, {'abstract': 'The production of new individuals that contain some portion ' 'of genetic material inherited from one or more parent ' 'organisms. Annotations are propagated through transitive ' 'closure as recommended by the GO Consortium. Only ' 'annotations with evidence coded as EXP, IDA, IPI, IMP, IGI ' 'or IEP are included.', 'organism': 'H**o sapiens', 'annotations': {'A0A024QZP7': [], 'A0A024R214': []}, 'xrdb': 'UniProtKB', 'title': 'GO-BP-0000003:eibar', 'slug': 'go0000003-h**o-sapiens', 'tags': ['eta', 'theta', 'iota']}, {'abstract': 'The distribution of mitochondria, including the ' 'mitochondrial genome, into daughter cells after mitosis or ' 'meiosis, mediated by interactions between mitochondria and ' 'the cytoskeleton. Annotations are propagated through ' 'transitive closure as recommended by the GO Consortium. Only' ' annotations with evidence coded as EXP, IDA, IPI, IMP, IGI ' 'or IEP are included.', 'organism': 'H**o sapiens', 'annotations': {'A0A024R216': []}, 'xrdb': 'UniProtKB', 'title': 'GO-BP-0000001:barcelona', 'slug': 'go0000001-h**o-sapiens', 'tags': ['alpha', 'beta', 'gamma']} ] self.assertEqual(go_terms, desired_output)