Commit 8f94341b authored by Romain Therville's avatar Romain Therville 🐭

Merge branch 'master' into 'issue#151'

# Conflicts:
#   ui/nG6/pi6/administration_view.tpl
parents d6928bee 6c16a1fa
...@@ -743,7 +743,7 @@ class Analysis (Component): ...@@ -743,7 +743,7 @@ class Analysis (Component):
raise Exception("Error while trying to rsync " + old_path + " to " + new_absolute_path + "\n" + raise Exception("Error while trying to rsync " + old_path + " to " + new_absolute_path + "\n" +
"Command : " + str_cmd + "\n" + "Error code : " + str(retcode) + "\n") "Command : " + str_cmd + "\n" + "Error code : " + str(retcode) + "\n")
else: else:
print ("rsync could not be launched because the source and destination are the same, from " + old_path + " to " + new_absolute_path + "\n") str_cmd = "Source and destination directories are the same : " + old_path + " , ignored.\n"
new_retention = ng6conf.get_retention_date(space_id, self.date) new_retention = ng6conf.get_retention_date(space_id, self.date)
...@@ -751,4 +751,4 @@ class Analysis (Component): ...@@ -751,4 +751,4 @@ class Analysis (Component):
t3mysql.update_fields('tx_nG6_analyze', str(self.id), ['directory','retention_date'], [str("/"+new_relative_path),new_retention] ) t3mysql.update_fields('tx_nG6_analyze', str(self.id), ['directory','retention_date'], [str("/"+new_relative_path),new_retention] )
return [retcode, str_cmd] return [retcode, str_cmd]
\ No newline at end of file
...@@ -446,6 +446,7 @@ class CasavaNG6Workflow(NG6Workflow): ...@@ -446,6 +446,7 @@ class CasavaNG6Workflow(NG6Workflow):
if self.is_casava: if self.is_casava:
self.group_prefix = list((Utils.get_group_basenames(self.get_all_reads(), "read")).keys()) self.group_prefix = list((Utils.get_group_basenames(self.get_all_reads(), "read")).keys())
logging.getLogger("ng6").debug("CasavaNG6Workflow._preprocess enter" + str(self.group_prefix))
def _process_casava_18(self, casava_directory, project_name, lane_number, input_files): def _process_casava_18(self, casava_directory, project_name, lane_number, input_files):
logging.getLogger("ng6").debug("CasavaNG6Workflow._process_casava_18 enter") logging.getLogger("ng6").debug("CasavaNG6Workflow._process_casava_18 enter")
...@@ -643,10 +644,14 @@ class CasavaNG6Workflow(NG6Workflow): ...@@ -643,10 +644,14 @@ class CasavaNG6Workflow(NG6Workflow):
concatenatefastq = None concatenatefastq = None
filtered_read1_files = [] filtered_read1_files = []
filtered_read2_files = [] filtered_read2_files = []
filtered_index_files = []
analysis_files = []
saved_files = [] saved_files = []
logging.getLogger("ng6").debug("illumina_process entering") logging.getLogger("ng6").debug("illumina_process entering")
if self.is_casava : if self.is_casava :
logging.getLogger("ng6").debug("illumina_process self.is_casava") logging.getLogger("ng6").debug("illumina_process self.is_casava")
analysis_files = self.get_all_reads("read1") + self.get_all_reads("read2")
if len(self.log_files) > 0 : if len(self.log_files) > 0 :
add_log = self.add_component("BasicAnalysis", [self.log_files,"Log Files","Log files generated during primary analysis","-","-","-","gz", "","log.gz"]) add_log = self.add_component("BasicAnalysis", [self.log_files,"Log Files","Log files generated during primary analysis","-","-","-","gz", "","log.gz"])
...@@ -657,39 +662,48 @@ class CasavaNG6Workflow(NG6Workflow): ...@@ -657,39 +662,48 @@ class CasavaNG6Workflow(NG6Workflow):
demultiplex_stats = self.add_component("Demultiplex10XStats", [self.get_all_reads("read1"), self.undetermined_reads1, self.get_files_index("read1")]) demultiplex_stats = self.add_component("Demultiplex10XStats", [self.get_all_reads("read1"), self.undetermined_reads1, self.get_files_index("read1")])
else : else :
demultiplex_stats = self.add_component("DemultiplexStats", [self.get_all_reads("read1"), self.undetermined_reads1]) demultiplex_stats = self.add_component("DemultiplexStats", [self.get_all_reads("read1"), self.undetermined_reads1])
#analysis files for fastq illumina and fastqc analysis
if self.keep_reads != "all" : if self.keep_reads != "all" :
logging.getLogger("ng6").debug("illumina_process self.keep_reads != all") logging.getLogger("ng6").debug("illumina_process self.keep_reads != all")
logging.getLogger("ng6").debug("illumina_process BEFORE FASTQILLUMINAFILTER self.get_all_reads() = " + ",".join(self.get_all_reads())) logging.getLogger("ng6").debug("illumina_process BEFORE FASTQILLUMINAFILTER self.get_all_reads() = " + ",".join(self.get_all_reads()))
logging.getLogger("ng6").debug("illumina_process self.group_prefix = " + ",".join(self.group_prefix)) logging.getLogger("ng6").debug("illumina_process self.group_prefix = " + ",".join(self.group_prefix))
# fastq illumina filter # fastq illumina filter
fastqilluminafilter = self.add_component("FastqIlluminaFilter", [self.runobj,self.get_all_reads(), self.keep_reads, self.group_prefix])
fastqilluminafilter = self.add_component("FastqIlluminaFilter", [self.runobj, self.get_all_reads(), self.keep_reads, self.group_prefix])
logging.getLogger("ng6").debug("illumina_process fastqilluminafilter = " + ",".join(filtered_read1_files))
# list filtered files # list filtered files
if self.is_paired_end() : if self.is_paired_end() :
# split read 1 and read 2 from filtered files list # split read 1 and read 2 from filtered files list
[filtered_read1_files, filtered_read2_files] = Utils.split_pair(fastqilluminafilter.fastq_files_filtered, (self.group_prefix is not None)) if self.is_10Xcasava :
[filtered_read1_files, filtered_read2_files, filtered_index_files] = Utils.split_pair_and_index(fastqilluminafilter.fastq_files_filtered, (self.group_prefix is not None))
else:
[filtered_read1_files, filtered_read2_files] = Utils.split_pair(fastqilluminafilter.fastq_files_filtered, (self.group_prefix is not None))
else: else:
filtered_read1_files = fastqilluminafilter.fastq_files_filtered filtered_read1_files = fastqilluminafilter.fastq_files_filtered
filtered_read2_files = [] filtered_read2_files = []
filtered_index_files = []
filtered_read1_files = sorted(filtered_read1_files) filtered_read1_files = sorted(filtered_read1_files)
filtered_read2_files = sorted(filtered_read2_files) filtered_read2_files = sorted(filtered_read2_files)
filtered_index_files = sorted(filtered_index_files)
else: else:
fastqilluminafilter = None fastqilluminafilter = None
filtered_read1_files = self.get_all_reads("read1") filtered_read1_files = self.get_all_reads("read1")
filtered_read2_files = self.get_all_reads("read2") filtered_read2_files = self.get_all_reads("read2")
filtered_index_files = self.get_all_reads("index")
# archive the files # archive the files
#TODO : if self.group_prefix == None, the create the output of fastqilluminafilter in the run.get_work_directory() #TODO : if self.group_prefix == None, the create the output of fastqilluminafilter in the run.get_work_directory()
saved_files = filtered_read1_files + filtered_read2_files + self.get_all_reads("index") saved_files = filtered_read1_files + filtered_read2_files + filtered_index_files
logging.getLogger("CasavaNG6Workflow").debug("illumina_process saved_files = " + ",".join(saved_files)) logging.getLogger("CasavaNG6Workflow").debug("illumina_process saved_files = " + ",".join(saved_files))
reads_prefixes = None reads_prefixes = None
if self.group_prefix != None : if self.group_prefix != None :
# concatenate fastq # concatenate fastq
reads_prefixes = list((Utils.get_group_basenames(saved_files, "read")).keys()) reads_prefixes = list((Utils.get_group_basenames(saved_files, "read")).keys())
logging.getLogger("CasavaNG6Workflow").debug("illumina_process read_predixes = " + ",".join(reads_prefixes))
logging.getLogger("CasavaNG6Workflow").debug("illumina_process saved_files = " + ",".join(saved_files)) logging.getLogger("CasavaNG6Workflow").debug("illumina_process saved_files = " + ",".join(saved_files))
concatenatefastq = self.add_component("ConcatenateFilesGroups", [self.runobj,saved_files,reads_prefixes]) concatenatefastq = self.add_component("ConcatenateFilesGroups", [self.runobj,saved_files,reads_prefixes])
saved_files = concatenatefastq.concat_files saved_files = concatenatefastq.concat_files
...@@ -700,8 +714,11 @@ class CasavaNG6Workflow(NG6Workflow): ...@@ -700,8 +714,11 @@ class CasavaNG6Workflow(NG6Workflow):
fastqilluminafilter = None fastqilluminafilter = None
filtered_read1_files = self.get_all_reads("read1") filtered_read1_files = self.get_all_reads("read1")
filtered_read2_files = self.get_all_reads("read2") filtered_read2_files = self.get_all_reads("read2")
filtered_index_files = self.get_all_reads("index")
saved_files = self.get_all_reads() saved_files = self.get_all_reads()
# reads prefixes
reads_prefixes =list((Utils.get_group_basenames(analysis_files, "read")).keys())
# add raw # add raw
addrawfiles = self.add_component("AddRawFiles", [self.runobj, saved_files, self.compression]) addrawfiles = self.add_component("AddRawFiles", [self.runobj, saved_files, self.compression])
contam = [] contam = []
...@@ -711,6 +728,9 @@ class CasavaNG6Workflow(NG6Workflow): ...@@ -711,6 +728,9 @@ class CasavaNG6Workflow(NG6Workflow):
contam.append(self.get_resource("yeast_bwa")) contam.append(self.get_resource("yeast_bwa"))
except : pass except : pass
logging.getLogger("CasavaNG6Workflow").debug("illumina_process files_analysis = " + ",".join(filtered_read1_files))
logging.getLogger("CasavaNG6Workflow").debug("illumina_process files_analysis = " + ",".join(filtered_read2_files))
logging.getLogger("CasavaNG6Workflow").debug("illumina_process files_analysis = " + ",".join(filtered_index_files))
# contamination_search # contamination_search
if contam : if contam :
if self.contamination_databank: contam.extend(self.contamination_databank) if self.contamination_databank: contam.extend(self.contamination_databank)
......
...@@ -494,7 +494,7 @@ class Run(object): ...@@ -494,7 +494,7 @@ class Run(object):
raise Exception("Error while trying to rsync " + old_path + " to " + new_absolute_path + "\n" + raise Exception("Error while trying to rsync " + old_path + " to " + new_absolute_path + "\n" +
"Command : " + str_cmd + "\n" + "Error code : " + str(retcode) + "\n") "Command : " + str_cmd + "\n" + "Error code : " + str(retcode) + "\n")
else: else:
print ("rsync could not be launched because the source and destination are the same, from " + old_path + " to " + new_absolute_path + "\n") str_cmd = "Source and destination directories are the same : " + old_path + " , ignored.\n"
new_retention = ng6conf.get_retention_date(space_id, self.date) new_retention = ng6conf.get_retention_date(space_id, self.date)
......
...@@ -202,7 +202,7 @@ class t3MySQLdb(object): ...@@ -202,7 +202,7 @@ class t3MySQLdb(object):
right_level_id = qresult.rows[0][0] right_level_id = qresult.rows[0][0]
sql = "INSERT INTO tx_nG6_project (pid, tstamp, crdate, cruser_id, description, name, hidden, space_id) \ sql = "INSERT INTO tx_nG6_project (pid, tstamp, crdate, cruser_id, description, name, hidden, space_id) \
VALUES ('%s','%s','%s','%s','%s','%s','%s','%s')" % (self.cfg_reader.get_pid(), crdate, crdate, admin_id, VALUES ('%s','%s','%s','%s','%s','%s','%s','%s')" % (self.cfg_reader.get_pid(), crdate, crdate, admin_id,
self.esc_q(pdescription), self.esc_q(name), hidden, space_id) self.esc_q(pdescription), self.esc_q(name), int(hidden), space_id)
qresult = self.execute(sql, commit = True) qresult = self.execute(sql, commit = True)
project_id = qresult.lastrowid project_id = qresult.lastrowid
self.execute("INSERT INTO fe_rights (fe_user_id, project_id, right_id) VALUES ('%s','%s','%s')" % (admin_id, project_id, right_level_id), self.execute("INSERT INTO fe_rights (fe_user_id, project_id, right_id) VALUES ('%s','%s','%s')" % (admin_id, project_id, right_level_id),
...@@ -320,7 +320,7 @@ class t3MySQLdb(object): ...@@ -320,7 +320,7 @@ class t3MySQLdb(object):
'%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s')" % ( self.cfg_reader.get_pid(), crdate, crdate, cruser_id, self.esc_q(name), '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s')" % ( self.cfg_reader.get_pid(), crdate, crdate, cruser_id, self.esc_q(name),
calendar.timegm(date.timetuple()), directory, self.esc_q(species), calendar.timegm(date.timetuple()), directory, self.esc_q(species),
self.esc_q(data_nature), self.esc_q(type), nb_sequences, self.esc_q(data_nature), self.esc_q(type), nb_sequences,
full_seq_size, self.esc_q(description), hidden, self.esc_q(sequencer),retention_date, "stored","0","0","0") full_seq_size, self.esc_q(description), int(hidden), self.esc_q(sequencer),retention_date, "stored","0","0","0")
qresult = self.execute(sql, commit = True) qresult = self.execute(sql, commit = True)
run_id = qresult.lastrowid run_id = qresult.lastrowid
...@@ -471,7 +471,7 @@ class t3MySQLdb(object): ...@@ -471,7 +471,7 @@ class t3MySQLdb(object):
if description: if description:
set_values.append( "description='%s'" % self.esc_q(description)) set_values.append( "description='%s'" % self.esc_q(description))
if hidden: if hidden:
set_values.append( "hidden=%s" % hidden ) set_values.append( "hidden=%s" % int(hidden) )
if sequencer: if sequencer:
set_values.append( "sequencer='%s'" % self.esc_q(sequencer)) set_values.append( "sequencer='%s'" % self.esc_q(sequencer))
if storage_size: if storage_size:
...@@ -673,7 +673,8 @@ class t3MySQLdb(object): ...@@ -673,7 +673,8 @@ class t3MySQLdb(object):
#-------------------------------------------------------------------- #--------------------------------------------------------------------
# Analyze functions # Analyze functions
def add_analysis(self, aclass, name, description, cruser_login, date, directory, software, version, params, is_editable, retention_date, hidden=1, parent_uid=0): def add_analysis(self, aclass, name, description, cruser_login, date, \
directory, software, version, params, is_editable, retention_date, hidden=1, parent_uid=0):
""" """
Update an Analyze Update an Analyze
@param aclass : the class of the analysis @param aclass : the class of the analysis
...@@ -703,7 +704,7 @@ class t3MySQLdb(object): ...@@ -703,7 +704,7 @@ class t3MySQLdb(object):
'%s', '%s', '%s', '%s', '%s', '%s' ,'%s', '%s', '%s', '%s', '%s', '%s', '%s')" % ( self.cfg_reader.get_pid(), crdate, crdate, cruser_id, aclass, '%s', '%s', '%s', '%s', '%s', '%s' ,'%s', '%s', '%s', '%s', '%s', '%s', '%s')" % ( self.cfg_reader.get_pid(), crdate, crdate, cruser_id, aclass,
self.esc_q(name), self.esc_q(description), crdate, self.esc_q(name), self.esc_q(description), crdate,
directory, self.esc_q(software), self.esc_q(version), directory, self.esc_q(software), self.esc_q(version),
hidden, self.esc_q(params), analysis_is_editable, parent_uid, retention_date, "stored","0","0","0") int(hidden), self.esc_q(params), analysis_is_editable, parent_uid, retention_date, "stored","0","0","0")
qresult = self.execute(sql, commit= True) qresult = self.execute(sql, commit= True)
analysis_id = qresult.lastrowid analysis_id = qresult.lastrowid
...@@ -1065,4 +1066,4 @@ class t3MySQLdb(object): ...@@ -1065,4 +1066,4 @@ class t3MySQLdb(object):
qresult = self.execute(sql) qresult = self.execute(sql)
return [ r[0] for r in qresult.rows ] return [ r[0] for r in qresult.rows ]
\ No newline at end of file
...@@ -290,7 +290,44 @@ class Utils(object): ...@@ -290,7 +290,44 @@ class Utils(object):
return [read_1_list, read_2_list] return [read_1_list, read_2_list]
@staticmethod
def split_pair_and_index ( file_list, is_casava=False ):
"""
Return the list of read 1, the list of read 2 and the list of index read from a list
@param file_list : the list
@param is_casava : files names in file_list are in CASVAVA format
"""
read_1_list = []
read_2_list = []
read_index_list = []
logging.getLogger("Utils").debug("split_pair_and_index. Entering")
if is_casava:
logging.getLogger("Utils").debug("split_pair_and_index. is_casava")
for file in file_list:
logging.getLogger("Utils").debug("split_pair_and_index. file = " + file)
basename_without_ext = os.path.basename(file).split(".")[0]
file_name_fields = basename_without_ext.split(Utils.CASAVA_FILENAME_SEPARATOR)
read_tag = file_name_fields[Utils.CASAVA_FILENAME['read']-1]
if read_tag == "R1":
read_1_list.append(file)
elif read_tag == "R2":
read_2_list.append(file)
else:
read_index_list.append(file)
else:
sorted_list = sorted( file_list )
logging.getLogger("Utils").debug("split_pair_and_index. file_list = " + ", ".join(file_list))
logging.getLogger("Utils").debug("split_pair_and_index. sorted_list = " + ", ".join(sorted_list))
for i in range(0,len(sorted_list),3):
logging.getLogger("Utils").debug("split_pair_and_index. sorted_list[i] = " + sorted_list[i])
logging.getLogger("Utils").debug("split_pair_and_index. sorted_list[i+1] = " + sorted_list[i+1])
logging.getLogger("Utils").debug("split_pair_and_index. sorted_list[i+1] = " + sorted_list[i+2])
read_1_list.append(sorted_list[i])
read_2_list.append(sorted_list[i+1])
read_index_list.append(sorted_list[i+2])
return [read_1_list, read_2_list, read_index_list]
@staticmethod @staticmethod
def get_group_basenames( file_list, group_by ): def get_group_basenames( file_list, group_by ):
""" """
...@@ -361,6 +398,17 @@ class Utils(object): ...@@ -361,6 +398,17 @@ class Utils(object):
return "".join(dec) return "".join(dec)
""" """
@staticmethod
def get_project_dirname(project_id, project_name):
return "Project_%s.%s" % ( re.sub( r"[\s\/]", "_", project_name), project_id )
@staticmethod
def get_run_dirname(run_id, run_name):
return "Run_%s.%s" % ( re.sub( r"[^A-Za-z0-9]", "_", run_name), run_id)
@staticmethod
def get_analyse_dirname(analyse_id, analyse_name):
return "Analyse_%s.%s"%( re.sub( r"[\s\/]", "_", analyse_name), analyse_id )
@staticmethod @staticmethod
def get_directories_structure_and_content(ng6_username, data_folder, output_folder, prefixed_ids): def get_directories_structure_and_content(ng6_username, data_folder, output_folder, prefixed_ids):
from ng6.t3MySQLdb import t3MySQLdb from ng6.t3MySQLdb import t3MySQLdb
...@@ -372,20 +420,21 @@ class Utils(object): ...@@ -372,20 +420,21 @@ class Utils(object):
try : user_id = t3mysql.get_user_id(ng6_username) try : user_id = t3mysql.get_user_id(ng6_username)
except : pass except : pass
for prefixed_id in prefixed_ids.split(';') : for prefixed_id in prefixed_ids.split(';') :
vals = prefixed_id.split('_') vals = prefixed_id.split('_')
prefix = vals[0] prefix = vals[0]
id = vals[1] id = vals[1]
if prefix == "data" or prefix == "run" : if prefix == "data" or prefix == "run" :
run = t3mysql.select_run_informations(id) run = t3mysql.select_run_informations(id)
source_dir = data_folder +'/'+ run['directory'] source_dir = data_folder +'/'+ run['directory']
project_name = "Project_%s.%s" % ( re.sub( r"[\s\/]", "_", run['project_name']), run['project_id'] ) project_name = Utils.get_project_dirname(run['project_id'],run['project_name'])
#run_name = "Run_%s.%s" %( run['name'].replace(' ', '_').replace('/', '_'), id ) #run_name = "Run_%s.%s" %( run['name'].replace(' ', '_').replace('/', '_'), id )
run_name = "Run_%s.%s" % ( re.sub( r"[^A-Za-z0-9]", "_", run['name']), id) run_name = Utils.get_run_dirname(id,run['name'])
raw_data_dir = os.path.join( output_folder, project_name, run_name, "RawData" ) raw_data_dir = os.path.join( output_folder, project_name, run_name, "RawData" )
print (run, source_dir,project_name,run_name)
if source_dir not in src_directories : if source_dir not in src_directories :
src_directories.append(source_dir) src_directories.append(source_dir)
if raw_data_dir not in dest_directories : if raw_data_dir not in dest_directories :
...@@ -394,7 +443,7 @@ class Utils(object): ...@@ -394,7 +443,7 @@ class Utils(object):
if prefix == "run" : if prefix == "run" :
for analyse_id, analyse_values in t3mysql.get_user_run_analysis(user_id, id, 'tx_nG6_analyze.name').items() : for analyse_id, analyse_values in t3mysql.get_user_run_analysis(user_id, id, 'tx_nG6_analyze.name').items() :
analysis_dir = data_folder + '/' + analyse_values["directory"] analysis_dir = data_folder + '/' + analyse_values["directory"]
analysis_name = "Analyse_%s.%s"%( re.sub( r"[\s\/]", "_", analyse_values['name']), analyse_id ) analysis_name = Utils.get_analyse_dirname(analyse_id, analyse_values['name'] )
dest_analysis_dir = os.path.join( output_folder, project_name, run_name, analysis_name ) dest_analysis_dir = os.path.join( output_folder, project_name, run_name, analysis_name )
if analysis_dir not in src_directories : if analysis_dir not in src_directories :
...@@ -409,19 +458,19 @@ class Utils(object): ...@@ -409,19 +458,19 @@ class Utils(object):
if source_dir not in src_directories : if source_dir not in src_directories :
src_directories.append(source_dir) src_directories.append(source_dir)
project_name = "Project_%s.%s" % ( re.sub( r"[\s\/]", "_", analyse["project_name"]), analyse["project_id"]) project_name = Utils.get_project_dirname(analyse['project_id'],analyse['project_name'])
# it's a run analysis # it's a run analysis
if analyse["run_id"]: if analyse["run_id"]:
run_name = "Run_%s.%s" % ( re.sub( r"[\s\/]", "_", analyse["run_name"]), analyse["run_id"]) run_name = Utils.get_run_dirname(analyse["run_id"], analyse["run_name"])
analysis_name = "Analyse_%s.%s" % ( re.sub( r"[\s\/]", "_", analyse["name"]), id) analysis_name = Utils.get_analyse_dirname(id, analyse['name'] )
dest_analysis_dir = os.path.join( output_folder, project_name, run_name, analysis_name ) dest_analysis_dir = os.path.join( output_folder, project_name, run_name, analysis_name )
if dest_analysis_dir not in dest_directories : if dest_analysis_dir not in dest_directories :
dest_directories.append(dest_analysis_dir) dest_directories.append(dest_analysis_dir)
# it's a project analysis # it's a project analysis
else : else :
analysis_name = "Project_analyses/%s.%s" % ( re.sub( r"[\s\/]", "_", analyse["name"]), id) analysis_name = "Project_"+ Utils.get_analyse_dirname(id, analyse['name'] )
dest_analysis_dir = os.path.join( output_folder, project_name, analysis_name ) dest_analysis_dir = os.path.join( output_folder, project_name, analysis_name )
if dest_analysis_dir not in dest_directories : if dest_analysis_dir not in dest_directories :
dest_directories.append(dest_analysis_dir) dest_directories.append(dest_analysis_dir)
...@@ -439,6 +488,9 @@ class Utils(object): ...@@ -439,6 +488,9 @@ class Utils(object):
@staticmethod @staticmethod
def rsync_getcmd( source, destination): def rsync_getcmd( source, destination):
if source == "" or not os.path.isdir(source) :
return [ 0, "Source directory '" + source + "' doesn't exist, ignored."]
if not source.endswith("/"): if not source.endswith("/"):
source+="/" source+="/"
cmd = ["rsync", "-avh", "--perms", "--times", "--remove-sent-files", source, destination] cmd = ["rsync", "-avh", "--perms", "--times", "--remove-sent-files", source, destination]
......
...@@ -50,8 +50,6 @@ ...@@ -50,8 +50,6 @@
<div class="sub-content sc-top-bottom"> <div class="sub-content sc-top-bottom">
<div class="ng6-content-header-left"> <div class="ng6-content-header-left">
<h2>###STATUS_HEADER###</h2>
<p>###STATUS_MESSAGE###</p>
<!-- ###LOGIN_FORM### --> <!-- ###LOGIN_FORM### -->
<form action="###ACTION_URI###" target="_top" method="post" onsubmit="###ON_SUBMIT###" class="form-horizontal"> <form action="###ACTION_URI###" target="_top" method="post" onsubmit="###ON_SUBMIT###" class="form-horizontal">
<fieldset> <fieldset>
...@@ -130,8 +128,6 @@ ...@@ -130,8 +128,6 @@
<div class="sub-content sc-top-bottom"> <div class="sub-content sc-top-bottom">
<div class="ng6-content-header-left"> <div class="ng6-content-header-left">
<h2>###STATUS_HEADER###</h2>
<p>###STATUS_MESSAGE###</p>
<!-- ###LOGIN_FORM### --> <!-- ###LOGIN_FORM### -->
<form action="###ACTION_URI###" target="_top" method="post" onsubmit="###ON_SUBMIT###" class="form-horizontal"> <form action="###ACTION_URI###" target="_top" method="post" onsubmit="###ON_SUBMIT###" class="form-horizontal">
<fieldset> <fieldset>
......
...@@ -109,6 +109,8 @@ function get_casava_1_8_desc($string, $desc) { ...@@ -109,6 +109,8 @@ function get_casava_1_8_desc($string, $desc) {
$best_description = $description." (R1)"; $best_description = $description." (R1)";
} elseif (preg_match("/_R2/i", $string)) { } elseif (preg_match("/_R2/i", $string)) {
$best_description = $description." (R2)"; $best_description = $description." (R2)";
} elseif (preg_match("/_I1/i", $string)) {
$best_description = $description." (I1)";
} }
} }
} }
......
...@@ -68,20 +68,22 @@ a img { border: 0; } ...@@ -68,20 +68,22 @@ a img { border: 0; }
} }
.ng6-content-header-left { .ng6-content-header-left {
box-shadow: -4px 0 5px -5px grey, 5px 0 5px -6px grey; box-shadow: -4px 0 5px -5px grey, 5px 0 5px -6px grey;
margin: 0; margin: 0;
margin-left: 10px;
margin-right: 20px;
padding: 10px; padding: 10px;
width: 375px; width: 400px;
height: 275px; height: 275px;
text-align: justify; text-align: justify;
float: left; float: left;
background-color: #FaFaFa; background-color: #FaFaFa;
} }
.ng6-content-header-right { .ng6-content-header-right {
box-shadow: -4px 0 5px -5px grey, 5px 0 5px -6px grey; box-shadow: -4px 0 5px -5px grey, 5px 0 5px -6px grey;
margin: 0; margin: 0;
padding: 10px; padding: 10px;
width: 625px; width: 710px;
text-align: justify; text-align: justify;
float: left; float: left;
background-color: #FaFaFa; background-color: #FaFaFa;
...@@ -143,7 +145,7 @@ a img { border: 0; } ...@@ -143,7 +145,7 @@ a img { border: 0; }
padding: 0; padding: 0;
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
width: 1300px; width: 1000px;
color: #BBBABA; color: #BBBABA;
display: block; display: block;
line-height: 1.5em; line-height: 1.5em;
......
...@@ -37,4 +37,4 @@ class Illumina10XQualityCheck (CasavaNG6Workflow): ...@@ -37,4 +37,4 @@ class Illumina10XQualityCheck (CasavaNG6Workflow):
def process(self): def process(self):
fastqilluminafilter, filtered_read1_files, filtered_read2_files, concat_files = self.illumina_process() fastqilluminafilter, filtered_read1_files, filtered_read2_files, concat_files, concatenatefastq = self.illumina_process()
\ No newline at end of file \ No newline at end of file
...@@ -29,53 +29,54 @@ def migrate_project (project_id, new_space_id, output): ...@@ -29,53 +29,54 @@ def migrate_project (project_id, new_space_id, output):
from ng6.analysis import Analysis from ng6.analysis import Analysis
from ng6.project import Project from ng6.project import Project
from ng6.run import Run from ng6.run import Run
with open( output,'w') as fh : def log_to_output_files (log_text, log_file):
ng6conf = NG6ConfigReader() fh = open(log_file, "a")
base_path = ng6conf.get_save_directory() fh.write(log_text)
fh.close()
project = Project.get_from_id(project_id) logging.getLogger("move_project.py").debug(log_text)
print( "os.path.exists("+log_file+")=" + str(os.path.exists(log_file)))
logging.getLogger("migrate_project").debug("Migrating project '" + str(project.name) + "' (" + str(project.id) + ") to " + str(new_space_id) + "\n")
fh.write("Migrating project '" + str(project.name) + "' (" + str(project.id) + ") to " + str(new_space_id) + "\n") ng6conf = NG6ConfigReader()
base_path = ng6conf.get_save_directory()
old_space_id = project.space_id project = Project.get_from_id(project_id)
logging.getLogger("migrate_project").debug("old_space_id = " + old_space_id + ", new_space_id = " + new_space_id + "\n") old_space_id = project.space_id
fh.write("old_space_id = " + old_space_id + ", new_space_id = " + new_space_id + "\n")
str_log="MIGRATE PROJECT: '" + str(project.name) + "' (" + str(project.id) + ") from " + old_space_id + " to " + str(new_space_id) + "\n"
log_to_output_files(str_log, output)
runs = project.get_runs()
for run in runs :
str_log="\t - ##RUN '" + run.name + "' (" + str(run.id) + ") - " + run.directory + "\n"
log_to_output_files(str_log, output)
str_cmds = [] (ret_code, ret_command) = run.change_space(new_space_id)
runs = project.get_runs() str_log = "\t RET CODE: " + str(ret_code) + " CMD : " + ret_command + "\n"
for run in runs : log_to_output_files(str_log, output)
fh.write("Migrating run '" + run.name + "' (" + str(run.id) + ")" + " to " + str(new_space_id) + "\n")
logging.getLogger("migrate_project").debug("Migrating run '" + run.name + "' (" + str(run.id) + ")" + " to " + str(new_space_id) + "\n") run_analyzes = run.get_analysis()
str_cmds.append(run.change_space(new_space_id) ) for analysis in run_analyzes :
fh.write("Migrating successful! \n") str_log = "\t\t - ###ANALYSE " + analysis.name+ "' (" + str(analysis.id) + ") - " + analysis.directory + "\n"
logging.getLogger("migrate_project").debug("Migrating successful! \n") log_to_output_files(str_log, output)
run_analyzes = run.get_analysis()
for analysis in run_analyzes :
fh.write("Migrating analysis '" + analysis.name + "' (" + str(analysis.id) + ")" + " to " + str(new_space_id) + "\n")
logging.getLogger("migrate_project").debug("Migrating analysis '" + analysis.name + "' (" + str(analysis.id) + ")" + " to " + str(new_space_id) + "\n")
str_cmds.append(analysis.change_space(new_space_id) )
fh.write("Migrating successful! \n")
logging.getLogger("migrate_project").debug("Migrating successful! \n")
analyzes = project.get_analysis() (ret_code, ret_command) = analysis.change_space(new_space_id)
for analysis in analyzes : str_log = "\t\t RET CODE: " + str(ret_code) + " CMD : " + ret_command + "\n"
fh.write("Migrating analysis '" + analysis.name + "' (" + str(analysis.id) + ")" + " to " + str(new_space_id) + "\n") log_to_output_files(str_log, output)
logging.getLogger("migrate_project").debug("Migrating analysis '" + analysis.name + "' (" + str(analysis.id) + ")" + " to " + str(new_space_id) + "\n")
str_cmds.append(analysis.change_space(new_space_id) )
fh.write("Migrating successful! \n")
logging.getLogger("migrate_project").debug("Migrating successful! \n")
for command in str_cmds:
fh.write("Command launched : "+ str(command[1]) + "\n" )
logging.getLogger("migrate_project").debug("Command launched : "+ str(command[1]) + "\n" )
fh.write("Returned code : "+ str(command[0]) + "\n" )
logging.getLogger("migrate_project").debug("Returned code : "+ str(command[0]) + "\n" )
project.update_space_id(new_space_id)
analyzes = project.get_analysis()
for analysis in analyzes :
str_log="\t - ##ANALYSE PROJECT '" + analysis.name + "' (" + str(analysis.id) + ") - " + analysis.directory + "\n"
log_to_output_files(str_log, output)
(ret_code, ret_command) = analysis.change_space(new_space_id)
str_log = "\tRET CODE: " + str(ret_code) + " CMD : " + ret_command + "\n"
log_to_output_files(str_log, output)
project.update_space_id(new_space_id)
str_log = "project.update_space_id DONE\n"
log_to_output_files(str_log, output)