本文整理汇总了Python中bcbio.galaxy.api.GalaxyApiAccess.upload_directory方法的典型用法代码示例。如果您正苦于以下问题:Python GalaxyApiAccess.upload_directory方法的具体用法?Python GalaxyApiAccess.upload_directory怎么用?Python GalaxyApiAccess.upload_directory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类bcbio.galaxy.api.GalaxyApiAccess
的用法示例。
在下文中一共展示了GalaxyApiAccess.upload_directory方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from bcbio.galaxy.api import GalaxyApiAccess [as 别名]
# 或者: from bcbio.galaxy.api.GalaxyApiAccess import upload_directory [as 别名]
def main(config_file, fc_dir, analysis_dir, run_info_yaml=None):
with open(config_file) as in_handle:
config = yaml.load(in_handle)
fc_name, fc_date = get_flowcell_info(fc_dir)
galaxy_api = GalaxyApiAccess(config["galaxy_url"], config["galaxy_api_key"])
# run_info will override some galaxy details, if present
if run_info_yaml:
with open(run_info_yaml) as in_handle:
run_details = yaml.load(in_handle)
run_info = dict(details=run_details, run_id="")
else:
run_info = galaxy_api.run_details(fc_name, fc_date)
base_folder_name = "%s_%s" % (fc_date, fc_name)
run_details = lims_run_details(run_info, fc_name, base_folder_name)
for (library_name, access_role, dbkey, lane, bc_id, name, desc, local_name) in run_details:
library_id = get_galaxy_library(library_name, galaxy_api) if library_name else None
upload_files = list(select_upload_files(local_name, bc_id, fc_dir, analysis_dir, config))
if len(upload_files) > 0:
print lane, bc_id, name, desc, library_name
print "Creating storage directory"
if library_id:
folder, cur_galaxy_files = get_galaxy_folder(library_id, base_folder_name, name, desc, galaxy_api)
else:
cur_galaxy_files = []
store_dir = move_to_storage(lane, bc_id, base_folder_name, upload_files, cur_galaxy_files, config)
if store_dir and library_id:
print "Uploading directory of files to Galaxy"
print galaxy_api.upload_directory(library_id, folder["id"], store_dir, dbkey, access_role)
if galaxy_api:
add_run_summary_metrics(analysis_dir, galaxy_api)
示例2: main
# 需要导入模块: from bcbio.galaxy.api import GalaxyApiAccess [as 别名]
# 或者: from bcbio.galaxy.api.GalaxyApiAccess import upload_directory [as 别名]
def main(config_file, fc_dir, analysis_dir):
with open(config_file) as in_handle:
config = yaml.load(in_handle)
galaxy_api = GalaxyApiAccess(config["galaxy_url"], config["galaxy_api_key"])
fc_name, fc_date = get_flowcell_info(fc_dir)
folder_name = "%s_%s" % (fc_date, fc_name)
run_info = lims_run_details(galaxy_api, fc_name, folder_name)
for (dl_folder, access_role, dbkey, lane, bc_id, name, desc) in run_info:
print folder_name, lane, bc_id, name, desc, dl_folder
library_id = get_galaxy_library(dl_folder, galaxy_api)
folder, cur_galaxy_files = get_galaxy_folder(library_id, folder_name, name, desc, galaxy_api)
print "Creating storage directory"
base_select = "%s_%s" % (lane, folder_name)
store_dir = move_to_storage(
lane,
bc_id,
folder_name,
select_upload_files(base_select, bc_id, fc_dir, analysis_dir),
cur_galaxy_files,
config,
)
if store_dir:
print "Uploading directory of files to Galaxy"
print galaxy_api.upload_directory(library_id, folder["id"], store_dir, dbkey, access_role)
add_run_summary_metrics(analysis_dir, galaxy_api)