Commit c1bf7f3b authored by Romain Therville's avatar Romain Therville 🐭
Browse files

Merge branch 'master' into 'dev'

# Conflicts:
#   ui/nG6/pi6/class.tx_nG6_pi6.php
parents c09faba0 2c2abe02
......@@ -112,7 +112,7 @@ class JFlowConfigReader(object):
def get_socket_options(self):
try:
return [self.reader.get("global", "server_socket_host"), int(self.reader.get("global", "server_socket_port")), self.reader.get("global", "server_socket_protocol")]
return [self.reader.get("global", "server_socket_host"), int(self.reader.get("global", "server_socket_port")), self.reader.get("global", "server_socket_protocol"), self.reader.get("global", "server_socket_proxied")]
except:
return ["127.0.0.1", 8080,"http"]
......
......@@ -530,7 +530,7 @@ class JFlowServer (object):
socket_opt = self.jflow_config_reader.get_socket_options()
if not os.path.isdir(path):
return {
'url':socket_opt[2]+'://' + socket_opt[0] + ':' + str(socket_opt[1]) + '/' + path.replace(work_dir, web_path),
'url':socket_opt[2]+'://' + str(socket_opt[3]) + '/' + path.replace(work_dir, web_path),
'size': get_octet_string_representation(os.path.getsize(os.path.abspath(path))),
'extension': os.path.splitext(path)[1]
}
......
......@@ -752,14 +752,19 @@ class Analysis (Component):
return [retcode, str_cmd]
def get_web_filepath(self, file_name, base_filepath='fileadmin' ):
def get_web_filepath(self, file_name, base_filepath='fileadmin' ):
"""
returns the full web filepath from a given filename
@param file_name : the path to the file to link
@param base_filepath : the first directory in the path (depends on the server's directory structure)
@return : the full web filepath
"""
return base_filepath + os.path.join(self.get_directory(), file_name)
curr_dir=self.directory
if self.id != None :
t3mysql = t3MySQLdb()
curr_dir= t3mysql.select_analysis_directory(self.id)
return base_filepath + os.path.join(self.directory, file_name)
......@@ -35,4 +35,17 @@ class UnsavedRunError(Exception):
def __str__(self):
return repr(self.message)
\ No newline at end of file
class UnsavedAnalysisError(Exception):
"""
Exception to be raised when an operation is performed and the analysis has not been saved yet
"""
def __init__(self, message=None):
if message is not None:
self.message = message
else:
self.message = "The analysis has to be saved before to call this method."
def __str__(self):
return repr(self.message)
\ No newline at end of file
......@@ -929,6 +929,8 @@ class tx_nG6_eid {
$purge_delay = trim(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('purge_delay'));
$purge_demand_filter_space = trim(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('purge_demand_filter_space'));
$purge_demand_filter_delay_exceeded = trim(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('purge_demand_filter_delay_exceeded'));
print json_encode(tx_nG6_db::get_purge_demand_list($purge_delay,$purge_demand_filter_space,$purge_demand_filter_delay_exceeded));
} elseif ($type == 'refresh_purge_list') {
$max_retention_date = trim(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('max_retention_date'));
......@@ -937,8 +939,6 @@ class tx_nG6_eid {
$without_laboratories_id = trim(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('without_lab'));
$with_laboratories_id = trim(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('with_lab'));
$create_users = trim(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('create_users'));
//Change date format
//print ('test');
print json_encode(tx_nG6_db::filter_list_retention_data_info($filter_space,$max_retention_date,$create_users, $without_laboratories_id,$with_laboratories_id));
} elseif ($type == 'delete_purge_data') {
//Delete data link to the list of purge demand
......
......@@ -194,6 +194,10 @@ class tx_nG6_db {
$conditions[] = "project_id in (" . $project_list_ids.")" ;
}
$where = join(' AND ', $conditions);
$log_file_path = tx_nG6_utils::get_log_path();
error_log(date("d/m/Y, h:i:s")." IN filter_list_retention_data_info(), where=".$where." \n", 3, $log_file_path);
//error_log(" IN filter_list_retention_data_info(), where=".$where." \n", 3, $log_file_path);
return (tx_nG6_db::select_list_retention_data_info($where));
}
......@@ -214,6 +218,7 @@ class tx_nG6_db {
}
static function select_list_retention_data_info($where) {
$by_project=array();
$empty_res_structure = array(
'project_name' => "",
......@@ -333,6 +338,10 @@ class tx_nG6_db {
}
}
$log_file_path = tx_nG6_utils::get_log_path();
error_log(date("d/m/Y, h:i:s")." IN filter_list_retention_data_info(), return=".print_r($by_project,TRUE)." \n", 3, $log_file_path);
//error_log(" IN filter_list_retention_data_info(), return=".print_r($by_project,TRUE)." \n", 3, $log_file_path);
return($by_project);
}
......@@ -3055,9 +3064,10 @@ static function get_project_runs($project_id, $get_hidden=TRUE, $orderby='', $li
* @param string $user_col the fe_users column to use
* @return array
*/
static function get_all_names_starting_with($name_start, $user_col) {
static function get_all_names_starting_with ($name_start, $user_col) {
$queryParts = Array(
'SELECT' => 'fe_users.uid, fe_users.username, fe_users.last_name, fe_users.first_name, fe_users.password, fe_users.email, fe_users.cruser_id, fe_groups.title, fe_groups.tx_nG6_organism, fe_groups.tx_nG6_location',
// 'SELECT' => 'fe_users.uid, fe_users.username, fe_users.last_name, fe_users.first_name, fe_users.password, fe_users.email, fe_users.cruser_id, fe_groups.title, fe_groups.tx_nG6_organism, fe_groups.tx_nG6_location',
'SELECT' => 'fe_users.uid, fe_users.username, fe_users.last_name, fe_users.first_name, fe_users.email, fe_users.cruser_id, fe_groups.title, fe_groups.tx_nG6_organism, fe_groups.tx_nG6_location',
'FROM' => 'fe_users INNER JOIN fe_groups ON fe_users.usergroup=fe_groups.uid',
'WHERE' => 'fe_users.'.$user_col.' LIKE "'.$name_start.'%"',
'GROUPBY' => '',
......@@ -3072,7 +3082,7 @@ static function get_project_runs($project_id, $get_hidden=TRUE, $orderby='', $li
'username' => $res_row['username'],
'first_name' => $res_row['first_name'],
'last_name' => $res_row['last_name'],
'password' => $res_row['password'],
// 'password' => $res_row['password'],
'email' => $res_row['email'],
'title' => $res_row['title'],
'cruser_id' => $res_row['cruser_id'],
......
......@@ -466,6 +466,29 @@ $template_mail.='<p>Yours sincerely</p>
return($path_to_save_dir);
}
static function get_log_path(){
$config_file_content = tx_nG6_utils::get_config_content();
$array_config_content = explode(PHP_EOL, $config_file_content);
$pattern_to_find = "log_file = ";
$log_file_path_found = FALSE;
//We want to return the log file path
foreach($array_config_content as $line_id => $line_content){
//if we found the right line
if(strpos ( $line_content , $pattern_to_find) === 0){
$log_file_path_found = TRUE;
}
if($log_file_path_found){
$log_file_path = str_replace($pattern_to_find,'',$line_content);
return($log_file_path);
}
}
return('0');
}
static function convert_epoch_timestamp_to_nice_date( $epoch_date ){
//return(gmdate('D, d M Y', $epoch_date));
return(gmdate('l jS \of F Y', $epoch_date));
......
......@@ -109,13 +109,13 @@ class Demultiplex_ONT (Analysis):
str_input = ""
str_output = ""
for fastq in self.fastq_files:
str_input = str_input + " $" + str(iter)
iter = iter + 1
str_output = " $"+ str(iter)
str_input += ' ${' + str(iter) + '}'
iter += 1
str_output = ' ${'+ str(iter) + '}'
# Create cmd
self.add_shell_execution(self.get_exec_path("seqkit") +" stats --all " + str_input + ">" + str_output,
cmd_format='{EXE} {IN} {OUT}' ,
cmd_format='{EXE} {IN} {OUT}',
map=False,
inputs = [self.fastq_files],
outputs = os.path.join(self.output_directory, "DemultiplexONT.output"))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment