Example #1
0
    #                    Obj2NexDB(nex_session_maker, lambda x: x.query(Alignmentevidence),
    #                              name='convert.from_bud.evidence.alignment_evidence',
    #                              delete_untouched=True,
    #                              commit_interval=1000),
    #                    OutputTransformer(1000)])


    # ------------------------------------------ Perf ------------------------------------------
    from src.sgd.model.perf.bioentity_data import BioentityDetails

    from src.sgd.model.nex.bioentity import Locus
    nex_session = nex_session_maker()
    locus_ids = [x.id for x in nex_session.query(Locus).all()]
    nex_session.close()

    do_conversion(make_locus_data_backend_starter(nex_backend, 'alignment_bioent', locus_ids),
                   [Json2DataPerfDB(perf_session_maker, BioentityDetails, 'ALIGNMENT', locus_ids, name='convert.from_backend.alignment_details', commit_interval=100, sure=True),
                    OutputTransformer(100)])

    do_conversion(make_orphan_backend_starter(nex_backend, ['alignments']),
                  [Json2OrphanPerfDB(perf_session_maker, name='convert.from_backend.orphans', commit_interval=1000)])

    # ------------------------------------------ Perf2 ------------------------------------------
    perf_session_maker = prepare_schema_connection(perf, config.PERF_DBTYPE, 'sgd-db2.stanford.edu:1521', config.PERF_DBNAME, config.PERF_SCHEMA, config.PERF_DBUSER, config.PERF_DBPASS)
    perf_backend = PerfBackend(config.PERF_DBTYPE, 'sgd-db1.stanford.edu:1521', config.PERF_DBNAME, config.PERF_SCHEMA, config.PERF_DBUSER, config.PERF_DBPASS, None)

    do_conversion(make_locus_data_backend_starter(perf_backend, 'alignment_bioent', locus_ids),
                   [Json2DataPerfDB(perf_session_maker, BioentityDetails, 'ALIGNMENT', locus_ids, name='convert.from_backend.alignment_details', commit_interval=100, sure=True),
                    OutputTransformer(100)])

    do_conversion(make_orphan_backend_starter(perf_backend, ['alignments']),
Example #2
0
                                  delete_untouched=True,
                                  commit_interval=1000,
                                  already_deleted=clean_up_orphans(nex_session_maker, Physinteractionevidence, Evidence, 'PHYSINTERACTION'))])

    # ------------------------------------------ Perf ------------------------------------------
    from src.sgd.model.perf.bioentity_data import BioentityDetails
    from src.sgd.model.perf.reference_data import ReferenceDetails

    from src.sgd.model.nex.bioentity import Locus
    from src.sgd.model.nex.reference import Reference
    nex_session = nex_session_maker()
    locus_ids = [x.id for x in nex_session.query(Locus).all()]
    reference_ids = [x.id for x in nex_session.query(Reference).all()]
    nex_session.close()

    do_conversion(make_locus_data_backend_starter(nex_backend, 'interaction_details', locus_ids),
                   [Json2DataPerfDB(perf_session_maker, BioentityDetails, 'INTERACTION', locus_ids, name='convert.from_backend.interaction_details', commit_interval=1000)])

    do_conversion(make_reference_data_backend_starter(nex_backend, 'interaction_details', reference_ids),
                   [Json2DataPerfDB(perf_session_maker, ReferenceDetails, 'INTERACTION', reference_ids, name='convert.from_backend.interaction_details', commit_interval=1000)])

    # ------------------------------------------ Perf2 ------------------------------------------
    perf_session_maker = prepare_schema_connection(perf, config.PERF_DBTYPE, 'sgd-db2.stanford.edu:1521', config.PERF_DBNAME, config.PERF_SCHEMA, config.PERF_DBUSER, config.PERF_DBPASS)
    perf_backend = PerfBackend(config.PERF_DBTYPE, 'sgd-db1.stanford.edu:1521', config.PERF_DBNAME, config.PERF_SCHEMA, config.PERF_DBUSER, config.PERF_DBPASS, None)

    do_conversion(make_locus_data_backend_starter(perf_backend, 'interaction_details', locus_ids),
                   [Json2DataPerfDB(perf_session_maker, BioentityDetails, 'INTERACTION', locus_ids, name='convert.from_backend.interaction_details', commit_interval=1000)])

    do_conversion(make_reference_data_backend_starter(perf_backend, 'interaction_details', reference_ids),
                   [Json2DataPerfDB(perf_session_maker, ReferenceDetails, 'INTERACTION', reference_ids, name='convert.from_backend.interaction_details', commit_interval=1000)])
    from src.sgd.model.nex.bioconcept import Go, ECNumber, Phenotype, Observable
    from src.sgd.model.nex.bioitem import Domain, Chemical

    nex_session = nex_session_maker()
    locus_ids = [x.id for x in nex_session.query(Locus).all()]
    reference_ids = [x.id for x in nex_session.query(Reference).all()]
    go_ids = [x.id for x in nex_session.query(Go).all()]
    domain_ids = [x.id for x in nex_session.query(Domain).all()]
    ecnumber_ids = [x.id for x in nex_session.query(ECNumber).all()]
    phenotype_ids = [x.id for x in nex_session.query(Phenotype).all()]
    observable_ids = [x.id for x in nex_session.query(Observable).all()]
    chemical_ids = [x.id for x in nex_session.query(Chemical).all()]
    nex_session.close()

    # ------------------------------------------ GO Perf ------------------------------------------
    do_conversion(make_locus_data_backend_starter(nex_backend, 'go_details', locus_ids),
                   [Json2DataPerfDB(perf_session_maker, BioentityDetails, 'GO', locus_ids, name='convert.from_backend.go_details', commit_interval=1000, sure=True)])

    do_conversion(make_go_data_backend_starter(nex_backend, 'go_details', go_ids),
                   [Json2DataPerfDB(perf_session_maker, BioconceptDetails, 'GO_LOCUS', go_ids, name='convert.from_backend.go_details', commit_interval=1000, sure=True)])

    do_conversion(make_reference_data_backend_starter(nex_backend, 'go_details', reference_ids),
                   [Json2DataPerfDB(perf_session_maker, ReferenceDetails, 'GO', reference_ids, name='convert.from_backend.go_details', commit_interval=1000, sure=True)])

    do_conversion(make_go_data_with_children_backend_starter(nex_backend, 'go_details', go_ids),
                   [Json2DataPerfDB(perf_session_maker, BioconceptDetails, 'GO_LOCUS_ALL_CHILDREN', go_ids, name='convert.from_backend.go_details', commit_interval=1000, sure=True)])

    # ------------------------------------------ Misc Perf ------------------------------------------
    do_conversion(make_locus_data_backend_starter(nex_backend, 'ec_number_details', locus_ids),
                   [Json2DataPerfDB(perf_session_maker, BioentityDetails, 'EC_NUMBER', locus_ids, name='convert.from_backend.ec_number_details', commit_interval=1000, sure=True)])
Example #4
0
    from src.sgd.model.nex.evidence import Posttranslationalevidence, Evidence
    from src.sgd.convert.from_bud.evidence import make_posttranslational_evidence_starter

    do_conversion(make_posttranslational_evidence_starter(nex_session_maker),
                  [Json2Obj(Posttranslationalevidence),
                   Evidence2NexDB(nex_session_maker, lambda x: x.query(Posttranslationalevidence),
                                  name='convert.from_bud.evidence.posttranslationsl',
                                  delete_untouched=True,
                                  commit_interval=1000,
                                  already_deleted=clean_up_orphans(nex_session_maker, Posttranslationalevidence, Evidence, 'POSTTRANSLATIONAL')),
                   OutputTransformer(1000)])

    from src.sgd.model.nex.bioentity import Locus
    nex_session = nex_session_maker()
    locus_ids = [x.id for x in nex_session.query(Locus).all()]
    nex_session.close()

    from src.sgd.model.perf.bioentity_data import BioentityDetails
    do_conversion(make_locus_data_backend_starter(nex_backend, 'posttranslational_details', locus_ids),
                   [Json2DataPerfDB(perf_session_maker, BioentityDetails, 'POSTTRANSLATIONAL', locus_ids, name='convert.from_backend.posttranslational_details',
                                    commit_interval=1000, sure=True),
                    OutputTransformer(1000)])

    perf_session_maker = prepare_schema_connection(perf, config.PERF_DBTYPE, 'sgd-db2.stanford.edu:1521', config.PERF_DBNAME, config.PERF_SCHEMA, config.PERF_DBUSER, config.PERF_DBPASS)
    perf_backend = PerfBackend(config.PERF_DBTYPE, 'sgd-db1.stanford.edu:1521', config.PERF_DBNAME, config.PERF_SCHEMA, config.PERF_DBUSER, config.PERF_DBPASS, None)

    do_conversion(make_locus_data_backend_starter(nex_backend, 'posttranslational_details', locus_ids),
                   [Json2DataPerfDB(perf_session_maker, BioentityDetails, 'POSTTRANSLATIONAL', locus_ids, name='convert.from_backend.posttranslational_details',
                                    commit_interval=1000, sure=True),
                    OutputTransformer(1000)])
    from src.sgd.model.nex.bioentity import Locus
    from src.sgd.model.nex.reference import Reference
    from src.sgd.model.nex.bioconcept import Go, ECNumber, Phenotype, Observable
    from src.sgd.model.nex.bioitem import Domain, Chemical

    nex_session = nex_session_maker()
    locus_ids = [x.id for x in nex_session.query(Locus).all()]
    reference_ids = [x.id for x in nex_session.query(Reference).all()]
    phenotype_ids = [x.id for x in nex_session.query(Phenotype).all()]
    observable_ids = [x.id for x in nex_session.query(Observable).all()]
    chemical_ids = [x.id for x in nex_session.query(Chemical).all()]
    nex_session.close()

    # ------------------------------------------ Literature Perf ------------------------------------------
    do_conversion(make_locus_data_backend_starter(nex_backend, 'literature_details', locus_ids),
                   [Json2DataPerfDB(perf_session_maker, BioentityDetails, 'LITERATURE', locus_ids, name='convert.from_backend.literature_details', commit_interval=1000, sure=True)])

    do_conversion(make_reference_data_backend_starter(nex_backend, 'literature_details', reference_ids),
                   [Json2DataPerfDB(perf_session_maker, ReferenceDetails, 'LITERATURE', reference_ids, name='convert.from_backend.literature_details', commit_interval=1000, sure=True)])

    # ------------------------------------------ Phenotype Perf ------------------------------------------
    do_conversion(make_locus_data_backend_starter(nex_backend, 'phenotype_details', locus_ids),
                   [Json2DataPerfDB(perf_session_maker, BioentityDetails, 'PHENOTYPE', locus_ids, name='convert.from_backend.phenotype_details', commit_interval=1000, sure=True)])

    do_conversion(make_phenotype_data_backend_starter(nex_backend, 'phenotype_details', phenotype_ids),
                   [Json2DataPerfDB(perf_session_maker, BioconceptDetails, 'PHENOTYPE_LOCUS', phenotype_ids, name='convert.from_backend.phenotype_details', commit_interval=1000, sure=True)])

    do_conversion(make_reference_data_backend_starter(nex_backend, 'phenotype_details', reference_ids),
                   [Json2DataPerfDB(perf_session_maker, ReferenceDetails, 'PHENOTYPE', reference_ids, name='convert.from_backend.phenotype_details', commit_interval=1000, sure=True)])
Example #6
0

    # # ------------------------------------------ Perf ------------------------------------------
    from src.sgd.model.perf.bioentity_data import BioentityDetails
    from src.sgd.model.perf.bioitem_data import BioitemDetails
    from src.sgd.model.perf.core import Bioitem as PerfBioitem
    # from src.sgd.model.perf.core import Strain as PerfStrain
    #
    from src.sgd.model.nex.bioentity import Locus
    from src.sgd.model.nex.bioitem import Contig
    nex_session = nex_session_maker()
    locus_ids = [x.id for x in nex_session.query(Locus).all()]
    contig_ids = [x.id for x in nex_session.query(Contig).all()]
    nex_session.close()

    do_conversion(make_locus_data_backend_starter(nex_backend, 'neighbor_sequence_details', locus_ids),
                  [Json2DataPerfDB(perf_session_maker, BioentityDetails, 'NEIGHBOR_SEQUENCE', locus_ids,
                                   name='convert.from_backend.neighbor_sequence_details', commit_interval=1000)])

    do_conversion(make_locus_data_backend_starter(nex_backend, 'sequence_details', locus_ids),
                 [Json2DataPerfDB(perf_session_maker, BioentityDetails, 'SEQUENCE', locus_ids, name='convert.from_backend.sequence_details', commit_interval=1000)])

    do_conversion(make_contig_data_backend_starter(nex_backend, 'sequence_details', contig_ids),
                  [Json2DataPerfDB(perf_session_maker, BioitemDetails, 'SEQUENCE', contig_ids, name='convert.from_backend.sequence_details', commit_interval=1000)])

    do_conversion(make_backend_starter(nex_backend, 'all_bioitems', 1000),
                  [Json2CorePerfDB(perf_session_maker, PerfBioitem, name='convert.from_backend.bioitem', commit_interval=1000, delete_untouched=True)])

    # do_conversion(make_backend_starter(nex_backend, 'all_strains', 1000),
    #               [Json2CorePerfDB(perf_session_maker, PerfStrain, name='convert.from_backend.strain', commit_interval=1000, delete_untouched=True)])
Example #7
0
                                  delete_untouched=True,
                                  commit_interval=1000,
                                  already_deleted=clean_up_orphans(nex_session_maker, Regulationevidence, Evidence, 'REGULATION'))])

    # ------------------------------------------ Perf ------------------------------------------
    from src.sgd.model.perf.bioentity_data import BioentityDetails, BioentityEnrichment
    from src.sgd.model.perf.reference_data import ReferenceDetails

    from src.sgd.model.nex.bioentity import Locus
    from src.sgd.model.nex.reference import Reference
    nex_session = nex_session_maker()
    locus_ids = [x.id for x in nex_session.query(Locus).all()]
    reference_ids = [x.id for x in nex_session.query(Reference).all()]
    nex_session.close()

    do_conversion(make_locus_data_backend_starter(nex_backend, 'regulation_details', locus_ids),
                   [Json2DataPerfDB(perf_session_maker, BioentityDetails, 'REGULATION', locus_ids, name='convert.from_backend.regulation_details', commit_interval=1000)])

    do_conversion(make_reference_data_backend_starter(nex_backend, 'regulation_details', reference_ids),
                   [Json2DataPerfDB(perf_session_maker, ReferenceDetails, 'REGULATION', reference_ids, name='convert.from_backend.regulation_details', commit_interval=1000)])

    do_conversion(make_locus_data_backend_starter(nex_backend, 'regulation_target_enrichment', locus_ids),
                   [Json2DataPerfDB(perf_session_maker, BioentityEnrichment, 'REGULATION', locus_ids, name='convert.from_backend.regulation_target_enrichment', commit_interval=1000)])

    # ------------------------------------------ Perf2 ------------------------------------------
    perf_session_maker = prepare_schema_connection(perf, config.PERF_DBTYPE, 'sgd-db2.stanford.edu:1521', config.PERF_DBNAME, config.PERF_SCHEMA, config.PERF_DBUSER, config.PERF_DBPASS)
    perf_backend = PerfBackend(config.PERF_DBTYPE, 'sgd-db1.stanford.edu:1521', config.PERF_DBNAME, config.PERF_SCHEMA, config.PERF_DBUSER, config.PERF_DBPASS, None)

    do_conversion(make_locus_data_backend_starter(perf_backend, 'regulation_details', locus_ids),
                   [Json2DataPerfDB(perf_session_maker, BioentityDetails, 'REGULATION', locus_ids, name='convert.from_backend.regulation_details', commit_interval=1000)])