コード例 #1
0
def convert(old_session_maker, new_session_maker):
    log = set_up_logging('convert.chemical')
    
    log.info('begin')
        
    convert_allele(old_session_maker, new_session_maker)
    
    convert_chemical(old_session_maker, new_session_maker)
コード例 #2
0
def convert(new_session_maker):
    log = set_up_logging('convert.binding')
    
    log.info('begin')
    
    convert_evidence(new_session_maker, 10000)    
    
    log.info('complete')
コード例 #3
0
def convert(old_session_maker, new_session_maker):  
    log = set_up_logging('convert.protein')
    log.info('begin')
        
    convert_domain(new_session_maker, 5000)
    
    convert_domain_evidence(new_session_maker, 5000)
    
    log.info('complete')
コード例 #4
0
def convert(old_session_maker, new_session_maker):  
    log = set_up_logging('convert.bioentity')
    
    log.info('begin')
        
    convert_locus(old_session_maker, new_session_maker)

    convert_protein(old_session_maker, new_session_maker)
    
    log.info('complete')
コード例 #5
0
def convert(old_session_maker, new_session_maker):
    log = set_up_logging('convert.physical_interaction')
    
    log.info('begin')
    
    convert_physical_interevidence(old_session_maker, new_session_maker, 10000)
        
    from model_new_schema.interaction import Physinteractionevidence
    get_bioent_ids_f = lambda x: [x.bioentity1_id, x.bioentity2_id]
    convert_bioentity_reference(new_session_maker, Physinteractionevidence, 'PHYSINTERACTION', 'convert.physical_interaction.bioentity_reference', 10000, get_bioent_ids_f)
           
    log.info('complete')
コード例 #6
0
def convert(old_session_maker, new_session_maker):  
    log = set_up_logging('convert.bioentity_in_depth')
    
    log.info('begin')
            
    convert_alias(old_session_maker, new_session_maker)
    
    convert_url(old_session_maker, new_session_maker, 1000)
    
    convert_qualifier_evidence(old_session_maker, new_session_maker)
    
    convert_bioentitytabs(new_session_maker)
    
    log.info('complete')
コード例 #7
0
def convert(old_session_maker, new_session_maker):
    log = set_up_logging('convert.evelements')
    
    log.info('begin')
    
    convert_experiment(old_session_maker, new_session_maker)
    
    convert_experiment_alias(old_session_maker, new_session_maker)
    
    convert_experiment_relation(old_session_maker, new_session_maker)
    
    convert_strain(old_session_maker, new_session_maker)

    log.info('complete')
コード例 #8
0
def convert(old_session_maker, new_session_maker):
    log = set_up_logging('convert.reference')
    requests_log = logging.getLogger("requests")
    requests_log.setLevel(logging.WARNING)
            
    log.info('begin')
        
    convert_journal(old_session_maker, new_session_maker)
    
    convert_book(old_session_maker, new_session_maker)
    
    convert_reference(old_session_maker, new_session_maker, 3000)
    
    log.info('complete')
コード例 #9
0
def convert(old_session_maker, new_session_maker):
    log = set_up_logging('convert.go')
    
    log.info('begin')
        
    #convert_go(old_session_maker, new_session_maker) 
    
    convert_evidence(old_session_maker, new_session_maker, 10000)
    
    from model_new_schema.go import Goevidence
    get_bioent_ids_f = lambda x: [x.bioentity_id]
    convert_bioentity_reference(new_session_maker, Goevidence, 'GO', 'convert.go.bioentity_reference', 10000, get_bioent_ids_f)

    log.info('complete')
コード例 #10
0
def convert(old_session_maker, new_session_maker):
    log = set_up_logging('convert.phenotype')
    
    log.info('begin')
        
    convert_phenotype(old_session_maker, new_session_maker)
    
    convert_evidence(old_session_maker, new_session_maker, 10000)
    
    convert_evidence_chemical(old_session_maker, new_session_maker, 10000)
        
    from model_new_schema.phenotype import Phenotypeevidence
    get_bioent_ids_f = lambda x: [x.bioentity_id]
    convert_bioentity_reference(new_session_maker, Phenotypeevidence, 'PHENOTYPE', 'convert.phenotype.bioentity_reference', 10000, get_bioent_ids_f)

    log.info('complete')
コード例 #11
0
def convert(new_session_maker):
    log = set_up_logging('convert.regulation')
    
    log.info('begin')
    
    convert_evidence(new_session_maker, 10000)    
        
    from model_new_schema.regulation import Regulationevidence
    get_bioent_ids_f = lambda x: [x.bioentity1_id, x.bioentity2_id]
    
    convert_paragraph(new_session_maker)
    
    convert_paragraph_reference(new_session_maker)
    
    convert_bioentity_reference(new_session_maker, Regulationevidence, 'REGULATION', 'convert.regulation.bioentity_reference', 10000, get_bioent_ids_f)
            
    log.info('complete')
コード例 #12
0
def convert(new_session_maker):
    log = set_up_logging('convert.interaction_families')
    
    log.info('begin')

    from model_new_schema.interaction import Physinteractionevidence
    convert_interaction(new_session_maker, Physinteractionevidence, 'PHYSINTERACTION', 'convert.physical_interaction.interaction', 10000, False)
    
    from model_new_schema.interaction import Geninteractionevidence
    convert_interaction(new_session_maker, Geninteractionevidence, 'GENINTERACTION', 'convert.genetic_interaction.interaction', 10000, False)

    convert_interaction_family(new_session_maker, 100)
    
    from model_new_schema.regulation import Regulationevidence
    convert_interaction(new_session_maker, Regulationevidence, 'REGULATION', 'convert.interaction.regulation_interaction', 10000, True)

    convert_regulation_family(new_session_maker, 100)

    log.info('complete')
コード例 #13
0
def convert(old_session_maker, new_session_maker):
    log = set_up_logging('convert.literature')
    
    log.info('begin')
    
    convert_litevidence(old_session_maker, new_session_maker, 100000)
    
    from model_new_schema.literature import Literatureevidence
    get_bioent_ids_f = lambda x: [x.bioentity_id]
    convert_bioentity_reference(new_session_maker, Literatureevidence, 'PRIMARY_LITERATURE', 'convert.literature.primary_bioentity_reference', 
                                100000, get_bioent_ids_f, filter_f = lambda x: x.topic=='Primary Literature')
    convert_bioentity_reference(new_session_maker, Literatureevidence, 'ADDITIONAL_LITERATURE', 'convert.literature.additional_bioentity_reference', 
                                100000, get_bioent_ids_f, filter_f = lambda x: x.topic=='Additional Literature')
    convert_bioentity_reference(new_session_maker, Literatureevidence, 'OMICS_LITERATURE', 'convert.literature.omics_bioentity_reference', 
                                100000, get_bioent_ids_f, filter_f = lambda x: x.topic=='Omics')
    convert_bioentity_reference(new_session_maker, Literatureevidence, 'REVIEW_LITERATURE', 'convert.literature.review_bioentity_reference', 
                                100000, get_bioent_ids_f, filter_f = lambda x: x.topic=='Reviews')
    
    log.info('complete')
コード例 #14
0
def convert(old_session_maker, new_session_maker):
    log = set_up_logging("convert.genetic_interaction")

    log.info("begin")

    convert_genetic_interevidence(old_session_maker, new_session_maker, 10000)

    from model_new_schema.interaction import Geninteractionevidence

    get_bioent_ids_f = lambda x: [x.bioentity1_id, x.bioentity2_id]
    convert_bioentity_reference(
        new_session_maker,
        Geninteractionevidence,
        "GENINTERACTION",
        "convert.genetic_interaction.bioentity_reference",
        10000,
        get_bioent_ids_f,
    )

    log.info("complete")
コード例 #15
0
def convert(old_session_maker, new_session_maker):
    log = set_up_logging('convert.reference_in_depth')
    requests_log = logging.getLogger("requests")
    requests_log.setLevel(logging.WARNING)
            
    log.info('begin')
    
    convert_abstract(old_session_maker, new_session_maker, 3000)
    
    convert_author(old_session_maker, new_session_maker, 10000)
    
    convert_author_reference(old_session_maker, new_session_maker, 10000)
    
    convert_reftype(old_session_maker, new_session_maker)
    
    convert_reference_relation(old_session_maker, new_session_maker)
    
    convert_alias(old_session_maker, new_session_maker, 3000)
    
    convert_url(new_session_maker, 3000)
        
    convert_bibentry(new_session_maker, 3000)
    
    log.info('complete')
コード例 #16
0
    convert_evelements, convert_chemical, set_up_logging
from convert_evidence import convert_literature, \
    convert_regulation, convert_phenotype, convert_go, convert_protein, \
    convert_bioentity_in_depth, convert_reference_in_depth, convert_binding, \
    convert_genetic_interaction, convert_physical_interaction
from schema_conversion import new_config, old_config, prepare_schema_connection
from threading import Thread
import model_new_schema
import model_old_schema
import sys

if __name__ == "__main__":    
    old_session_maker = prepare_schema_connection(model_old_schema, old_config)
    new_session_maker = prepare_schema_connection(model_new_schema, new_config)
    
    log = set_up_logging('convert')
    log.info('begin')
    
    ################# Core Converts ###########################
    #Evelement
    try:
        convert_evelements.convert(old_session_maker, new_session_maker)
    except Exception:
        log.exception( "Unexpected error:" + str(sys.exc_info()[0]) )
    
    #Reference
    try:
        convert_reference.convert(old_session_maker, new_session_maker)
    except Exception:
        log.exception( "Unexpected error:" + str(sys.exc_info()[0]) )