Exemplo n.º 1
0
def get_sequences(structures, args):
    utils.print_section_title("Getting Full Sequences")
    download_sequences(structures)
    extract_sequences(structures)
    utils.parallel("Writing deposited sequences", write_deposited_sequence,
                   structures, args, args.jobs)
    utils.parallel("Removing duplicate chains", remove_duplicate_chains,
                   structures, args, args.jobs)
    utils.parallel("Writing unique sequences", write_unique_sequence,
                   structures, args, args.jobs)
    print("")
Exemplo n.º 2
0
def choose_structures(structures):
    utils.print_section_title("Choosing Structures")
    res_bins = assign_resolution_bins(structures)
    chosen_clusters = set()
    cluster_attr = "cluster%d" % args.structure_structure_max_seqid
    res_bins.sort(key=lambda res_bin: len(res_bin.structures))
    for res_bin in res_bins:
        title = "Choosing %.2f-%.2fA structures (%d to choose from)" % (
            res_bin.min_res, res_bin.max_res, len(res_bin.structures))
        progress_bar = utils.ProgressBar(title, args.num_structures)
        random.shuffle(res_bin.structures)
        num_checked = 0
        num_missing_files = 0
        num_too_similar = 0
        num_failed_validation = 0
        for structure in res_bin.structures:
            passed = True
            num_checked += 1
            if not input_files_exist(structure):
                num_missing_files += 1
                passed = False
            clusters = {
                getattr(c, cluster_attr)
                for c in structure.chains.values()
            }
            if any(c in chosen_clusters for c in clusters):
                num_too_similar += 1
                passed = False
            if not validation_report_okay(structure):
                num_failed_validation += 1
                passed = False
            if passed:
                res_bin.chosen.append(models.Structure(structure))
                chosen_clusters.update(clusters)
                progress_bar.increment()
                if len(res_bin.chosen) == args.num_structures:
                    break
        progress_bar.finish()
        print("Total number checked:          %6d" % num_checked)
        print("Missing input files:           %6d" % num_missing_files)
        print("Too similar to already chosen: %6d" % num_too_similar)
        print("Failed validation checks:      %6d" % num_failed_validation)
        print("")
    return {s.id: s for r in res_bins for s in r.chosen}
Exemplo n.º 3
0
def prepare_structure_data(structures, args):
  utils.print_section_title("Preparing Structure Data")
  title = "Creating symlinks for files"
  progress_bar = utils.ProgressBar(title, len(structures))
  for structure in structures:
    progress_bar.increment()
    coords = args.pdb_coords
    sfs = args.pdb_sfs
    coords_source = path_coords(structure, args)
    sfs_source = path_sfs(structure, args)
    target_dir = os.path.join("structures", structure)
#    coords_target = os.path.join(target_dir, "%s_final.pdb" % structure)
#    sfs_target = os.path.join(target_dir, "%s_final.mtz" % structure)
    coords_target = os.path.join(target_dir, "refmac.pdb")
    sfs_target = os.path.join(target_dir, "refmac.mtz")
    os.symlink(coords_source, coords_target)
    os.symlink(sfs_source, sfs_target)
  print("")
  print("")
Exemplo n.º 4
0
def prepare_and_do_mr(homologues, args):
    utils.print_section_title("Running set of MR pipelines")
    utils.parallel("Iterating over homologues", run_mr_pipelines, homologues,
                   args, args.jobs)
    #utils.parallel("Iterating over homologues", run_mr_pipelines, homologues, args)

    #def prepare_and_do_mr(homologues, args):
    #utils.print_section_title("Running set of MR pipelines")
    #utils.parallel("Superposing homologues for sequence alignments", superpose_homologue, homologues, args, args.jobs)
    #utils.parallel("Preparing alignments for sculptor", prepare_sculptor_alignment, homologues, args, args.jobs)
    #utils.parallel("Trimming input models with sculptor", trim_model, homologues, args, args.jobs)

    #utils.print_section_title("SSM with Prosmart")
    #utils.parallel("Superpose target and model with prosmart", superpose_prosmart, homologues, args, args.jobs)
    #utils.parallel("Refining SSM models zero cycles", refine_ssm_model_zero, homologues, args, args.jobs)
    #utils.parallel("Combining SSM phases into a single MTZ file zero cycles", write_combined_mtz_afterSSM_zero, homologues, args, args.jobs)
    #utils.parallel("Comparing SSM phases with cphasematch", compare_phases_afterSSM_zero, homologues, args, args.jobs)
    #utils.parallel("Refining SSM models jelly body", refine_ssm_model_jelly, homologues, args, args.jobs)
    #utils.parallel("Combining SSM phases into a single MTZ file after jelly body", write_combined_mtz_afterSSM_jelly, homologues, args, args.jobs)
    #utils.parallel("Comparing SSM phases with cphasematch after jelly body", compare_phases_afterSSM_jelly, homologues, args, args.jobs)

    #utils.print_section_title("SSM with Molrep")
    #utils.parallel("Superpose target and model with Molrep", superpose_molrep, homologues, args, args.jobs)
    #utils.parallel("Refining Molrep models zero cycles", refine_molrep_model_zero, homologues, args, args.jobs)
    #utils.parallel("Combining Molrep phases into a single MTZ file zero cycles", write_combined_mtz_afterMolrep_zero, homologues, args, args.jobs)
    #utils.parallel("Comparing Molrep phases with cphasematch", compare_phases_afterMolrep_zero, homologues, args, args.jobs)
    #utils.parallel("Refining Molrep models jelly body", refine_molrep_model_jelly, homologues, args, args.jobs)
    #utils.parallel("Combining Molrep phases into a single MTZ file after jelly body", write_combined_mtz_afterMolrep_jelly, homologues, args, args.jobs)
    #utils.parallel("Comparing Molrep phases with cphasematch after jelly body", compare_phases_afterMolrep_jelly, homologues, args, args.jobs)

    #if not args.stop_before_mr:
    #utils.print_section_title("Performing Molecular Replacement")
    #utils.parallel("Performing molecular replacement with phaser", mr, homologues, args, int(args.jobs / 4))
    #utils.parallel("Refining placed models zero cycles", refine_placed_model_zero, homologues, args, args.jobs)
    #utils.parallel("Combining MR phases into a single MTZ file zero cycles", write_combined_mtz_afterMR_zero, homologues, args, args.jobs)
    #utils.parallel("Comparing MR phases with cphasematch zero cycles", compare_phases_afterMR_zero, homologues, args, args.jobs)
    #utils.parallel("Refining placed models jelly body", refine_placed_model_jelly, homologues, args, args.jobs)
    #utils.parallel("Combining MR phases into a single MTZ file after jelly body", write_combined_mtz_afterMR_jelly, homologues, args, args.jobs)
    #utils.parallel("Comparing MR phases with cphasematch after jelly body", compare_phases_afterMR_jelly, homologues, args, args.jobs)
    utils.remove_errors(homologues)
    print("")
Exemplo n.º 5
0
def find_homologues(chains, args):
    utils.print_section_title("Finding Homologues to Make MR Models From")
    search_for_homologues(chains, args)
    utils.parallel("Choosing from gesamt results", choose_hits, chains, args,
                   args.jobs)