Skip to content
Snippets Groups Projects

Release 2.0

Merged Loraine Gueguen requested to merge release_2.0 into dev
+ 14
9
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import re
import bioblend
import argparse
@@ -9,6 +10,7 @@ import sys
import time
import json
import yaml
import subprocess
from bioblend import galaxy
from bioblend.galaxy.objects import GalaxyInstance
@@ -141,7 +143,7 @@ class LoadData(speciesData.SpeciesData):
for fname, files in folders.items():
if fname and files:
folder_name = fname[len(CONTAINER_DATA_DIR_ROOT) + 1:]
folder_name = re.sub(data_dir_root + "/", "", fname)
logging.info("Creating folder: %s" % folder_name)
folder = self.create_deep_folder(prj_lib, folder_name)
@@ -183,9 +185,12 @@ class LoadData(speciesData.SpeciesData):
logging.info("Skipping useless file '%s'" % single_file)
continue
logging.info("Adding file '%s' with type '%s' and name '%s'" % (single_file, ftype, clean_name))
single_file_relative_path = re.sub(data_dir_root, CONTAINER_DATA_DIR_ROOT, single_file)
single_file_path_in_container=os.path.join(CONTAINER_DATA_DIR_ROOT, single_file_relative_path)
logging.info("Adding file '%s' with type '%s' and name '%s'" % (single_file_path_in_container, ftype, clean_name))
datasets = prj_lib.upload_from_galaxy_fs(
single_file,
single_file_path_in_container,
folder=folder,
link_data_only='link_to_files',
file_type=ftype,
@@ -201,10 +206,10 @@ class LoadData(speciesData.SpeciesData):
time.sleep(1)
# Wait for uploads to complete
logging.info("Waiting for import jobs to finish... please wait")
# Checking job state (only necessary if ran using SLURM)
# # Wait for uploads to complete
# logging.info("Waiting for import jobs to finish... please wait")
#
# # Checking job state (only necessary if ran using SLURM)
# while True:
# try:
# # "C" state means the job is completed, no need to wait for it
@@ -218,8 +223,8 @@ class LoadData(speciesData.SpeciesData):
# break
# else:
# raise
time.sleep(10)
#
# time.sleep(10)
# Batch renaming --> Throws a critical error at the moment
# logging.info("Import finished, now renaming datasets with pretty names")
Loading