Exemplo n.º 1
0
def load(species, chipseq, paired, project_name, rerun_number, pi, investigator, tumor_type, pipeline, revision_number, project_dir, conn, log_file):
    stats = list()

    if species.lower() in ['human','hg18','hg19','hybrid','b37','grch37','xenograft']:
        stats = load_exome_stats.human_stats.values()
        if chipseq:
            stats = load_exome_stats.human_chipseq_stats.values()
    elif species.lower() in ['mouse','mm9','mm10']:
        stats = load_exome_stats.mouse_stats.values()
        if chipseq:
            stats = load_exome_stats.mouse_chipseq_stats.values()
    else:
        log_helper.report_error_and_exit(log_file, "species is not recognized: '%s'" % (species))

    ## If paired add the one PE dependent stat
    if paired:
        stats.extend(load_exome_stats.paired_end_stats.values())

    validate_files(project_name, project_dir, stats, log_file)
    # now load data 
    log_file.write("LOG: Loading title file\n")
    load_exome_samples.load(project_name, rerun_number, pi, investigator, 'unknown', pipeline, revision_number, get_title_file(project_name, project_dir), conn, log_file)
    for stat in stats:
        file_name = get_stat_file(project_name, project_dir, stat)
        log_file.write("LOG: Loading stat '%s' from '%s'\n" % (stat.name, file_name))
        load_exome_stats.load(species, chipseq, paired, stat.name, project_name, pi, investigator, rerun_number, revision_number, file_name, conn, log_file)
def load(species, assay, chipseq, paired, project_name, rerun_number, pi, investigator, tumor_type, pipeline, revision_number, project_dir, conn, log_file):
    stats = list()

    if species.lower() in ['human','hg18','hg19','hybrid','b37','grch37','xenograft']:
        stats = load_exome_stats.human_stats.values()
        if chipseq:
            stats = load_exome_stats.human_chipseq_stats.values()
        if 'wgs' in assay.lower():
            stats = load_exome_stats.human_wgs_stats.values()
    elif species.lower() in ['mouse','mm9','mm10']:
        stats = load_exome_stats.mouse_stats.values()
        if chipseq:
            stats = load_exome_stats.mouse_chipseq_stats.values()
    else:
        log_helper.report_error_and_exit(log_file, "species is not recognized: '%s'" % (species))

    ## If paired add the one PE dependent stat
    if paired:
        stats.extend(load_exome_stats.paired_end_stats.values())

    validate_files(project_name, project_dir, stats, log_file)
    # now load data 
    log_file.write("LOG: Loading title file\n")
    load_exome_samples.load(project_name, rerun_number, pi, investigator, 'unknown', pipeline, revision_number, get_title_file(project_name, project_dir), conn, log_file)
    for stat in stats:
        file_name = get_stat_file(project_name, project_dir, stat)
        log_file.write("LOG: Loading stat '%s' from '%s'\n" % (stat.name, file_name))
        load_exome_stats.load(species, assay, chipseq, paired, stat.name, project_name, pi, investigator, rerun_number, revision_number, file_name, conn, log_file)