def get_resources(genome, ref_file, data): """Retrieve genome information from a genome-references.yaml file. """ base_dir = os.path.normpath(os.path.dirname(ref_file)) resource_file = os.path.join(base_dir, "%s-resources.yaml" % genome.replace("-test", "")) if not os.path.exists(resource_file): raise IOError("Did not find resource file for %s: %s\n" "To update bcbio_nextgen.py with genome resources for standard builds, run:\n" "bcbio_nextgen.py upgrade -u skip" % (genome, resource_file)) with open(resource_file) as in_handle: resources = yaml.load(in_handle) def resource_file_path(x): if isinstance(x, basestring) and os.path.exists(os.path.join(base_dir, x)): return os.path.normpath(os.path.join(base_dir, x)) return x cleaned = utils.dictapply(resources, resource_file_path) return ensure_annotations(cleaned, data)
def get_resources(genome, ref_file): """Retrieve genome information from a genome-references.yaml file. """ base_dir = os.path.normpath(os.path.dirname(ref_file)) resource_file = os.path.join(base_dir, "%s-resources.yaml" % genome.replace("-test", "")) if not os.path.exists(resource_file): raise IOError("Did not find resource file for %s: %s\n" "To update bcbio_nextgen.py with genome resources for standard builds, run:\n" "bcbio_nextgen.py upgrade -u skip" % (genome, resource_file)) with open(resource_file) as in_handle: resources = yaml.load(in_handle) def resource_file_path(x): if isinstance(x, basestring) and os.path.exists(os.path.join(base_dir, x)): return os.path.normpath(os.path.join(base_dir, x)) return x return utils.dictapply(resources, resource_file_path)