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

Merge branch 'master' into 'issue#129'

# Conflicts:
#   ui/nG6/lib/class.tx_nG6_db.php
parents db1b75b8 2a4a90d8
...@@ -190,9 +190,6 @@ class NG6Workflow (BasicNG6Workflow): ...@@ -190,9 +190,6 @@ class NG6Workflow (BasicNG6Workflow):
pidx = 1 pidx = 1
nidx = 1 nidx = 1
for rang, sample in enumerate(self.samples) : for rang, sample in enumerate(self.samples) :
print(sample)
print("sample readsi")
print(sample.readsi)
if sample.name : if sample.name :
self.samples_names.append(sample.name) self.samples_names.append(sample.name)
else : else :
...@@ -686,15 +683,15 @@ class CasavaNG6Workflow(NG6Workflow): ...@@ -686,15 +683,15 @@ class CasavaNG6Workflow(NG6Workflow):
# 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("readsi")
saved_files = filtered_read1_files + filtered_read2_files + self.get_all_reads("index")
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 reads_prefixes = " + ",".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
logging.getLogger("CasavaNG6Workflow").debug("illumina_process after concatenatefastq, saved_files = " + ",".join(saved_files)) logging.getLogger("CasavaNG6Workflow").debug("illumina_process after concatenatefastq, saved_files = " + ",".join(saved_files))
......
...@@ -2174,7 +2174,7 @@ static function get_project_runs($project_id, $orderby='', $limit='') { ...@@ -2174,7 +2174,7 @@ static function get_project_runs($project_id, $orderby='', $limit='') {
* Returns a run's retention status and date * Returns a run's retention status and date
* *
* @param string $r_id the analyze ids * @param string $r_id the analyze ids
* @return['run_data_state'] purged=> the date is purged, stored=> the data is stored * @return['run_data_state'] purged=> the date is purged, stored=> the data is stored, extended=>retention extended and data still stored
* @return['run_retention_date'] the unix epoch timestamp * @return['run_retention_date'] the unix epoch timestamp
*/ */
static function select_run_retention_status($r_id) { static function select_run_retention_status($r_id) {
...@@ -2182,7 +2182,8 @@ static function get_project_runs($project_id, $orderby='', $limit='') { ...@@ -2182,7 +2182,8 @@ static function get_project_runs($project_id, $orderby='', $limit='') {
// First select the run from the database // First select the run from the database
$queryParts = Array( $queryParts = Array(
'SELECT' => 'tx_nG6_run.data_state AS run_data_state, '. 'SELECT' => 'tx_nG6_run.data_state AS run_data_state, '.
'tx_nG6_run.retention_date AS run_retention_date ', 'tx_nG6_run.retention_date AS run_retention_date, '.
'tx_nG6_run.purged_date AS run_purged_date ',
'FROM' => 'tx_nG6_run ', 'FROM' => 'tx_nG6_run ',
'WHERE' => 'tx_nG6_run.uid='.$r_id, 'WHERE' => 'tx_nG6_run.uid='.$r_id,
'GROUPBY' => '', 'GROUPBY' => '',
...@@ -2194,8 +2195,9 @@ static function get_project_runs($project_id, $orderby='', $limit='') { ...@@ -2194,8 +2195,9 @@ static function get_project_runs($project_id, $orderby='', $limit='') {
$res = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts); $res = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts);
while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
$result['run_data_state'] = $row['run_data_state']; $result['run_data_state'] = $row['run_data_state'];
//$result['run_retention_date'] = $row['run_data_state'];
$result['run_retention_date'] = tx_nG6_utils::convert_epoch_timestamp_to_nice_date($row['run_retention_date']); $result['run_retention_date'] = tx_nG6_utils::convert_epoch_timestamp_to_nice_date($row['run_retention_date']);
$result['run_purge_date'] = tx_nG6_utils::convert_epoch_timestamp_to_nice_date($row['run_purged_date']);
//$result['run_purge_date'] = $row['run_purged_date'];
} }
return $result; return $result;
} }
...@@ -2565,14 +2567,16 @@ static function get_project_runs($project_id, $orderby='', $limit='') { ...@@ -2565,14 +2567,16 @@ static function get_project_runs($project_id, $orderby='', $limit='') {
* *
* @param string $a_id the analysis id * @param string $a_id the analysis id
* @return['analysis_data_state'] purged=> the date is purged, stored=> the data is stored * @return['analysis_data_state'] purged=> the date is purged, stored=> the data is stored
* @return['analysis_retention_date'] the unix epoch timestamp * @return['analysis_retention_date'] the retention unix epoch timestamp converted to a nice date
* @return['analysis_purged_date'] the purge unix epoch timestamp converted to a nice date
*/ */
static function select_analysis_retention_status($a_id) { static function select_analysis_retention_status($a_id) {
// First select the analysis from the database // First select the analysis from the database
$queryParts = Array( $queryParts = Array(
'SELECT' => 'tx_nG6_analyze.data_state AS analysis_data_state, '. 'SELECT' => 'tx_nG6_analyze.data_state AS analysis_data_state, '.
'tx_nG6_analyze.retention_date AS analysis_retention_date ', 'tx_nG6_analyze.retention_date AS analysis_retention_date, '.
'tx_nG6_analyze.purged_date AS analysis_purged_date ',
'FROM' => 'tx_nG6_analyze ', 'FROM' => 'tx_nG6_analyze ',
'WHERE' => 'tx_nG6_analyze.uid='.$a_id, 'WHERE' => 'tx_nG6_analyze.uid='.$a_id,
'GROUPBY' => '', 'GROUPBY' => '',
...@@ -2584,8 +2588,8 @@ static function get_project_runs($project_id, $orderby='', $limit='') { ...@@ -2584,8 +2588,8 @@ static function get_project_runs($project_id, $orderby='', $limit='') {
$res = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts); $res = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts);
while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
$result['analysis_data_state'] = $row['analysis_data_state']; $result['analysis_data_state'] = $row['analysis_data_state'];
//$result['analysis_retention_date'] = $row['analysis_retention_date'];
$result['analysis_retention_date'] = tx_nG6_utils::convert_epoch_timestamp_to_nice_date($row['analysis_retention_date']); $result['analysis_retention_date'] = tx_nG6_utils::convert_epoch_timestamp_to_nice_date($row['analysis_retention_date']);
$result['analysis_purge_date'] = tx_nG6_utils::convert_epoch_timestamp_to_nice_date($row['analysis_purged_date']);
} }
return $result; return $result;
} }
......
...@@ -288,12 +288,10 @@ please have a look at our storage fees (<a href="###URL_PRICE###">###URL_PRICE## ...@@ -288,12 +288,10 @@ please have a look at our storage fees (<a href="###URL_PRICE###">###URL_PRICE##
static function get_retention_policy_from_space_id($space_id = "default"){ static function get_retention_policy_from_space_id($space_id = "default"){
$config_file_content = tx_nG6_utils::get_config_content("default"); $config_file_content = tx_nG6_utils::get_config_content("default");
//file_put_contents("/work/ng6-test/jflow_rtherville/ng6_php.log", "tx_nG6_utils, get_retention_policy_from_space_id(), config_file_content: \n".$config_file_content."\n", FILE_APPEND);
//To explode the file content by line, we use PHP_EOL //To explode the file content by line, we use PHP_EOL
$array_config_content = explode(PHP_EOL, $config_file_content); $array_config_content = explode(PHP_EOL, $config_file_content);
//file_put_contents("/work/ng6-test/jflow_rtherville/ng6_php.log", "tx_nG6_utils, get_retention_policy_from_space_id(), array_config_content: \n".print_r($array_config_content,TRUE)."\n", FILE_APPEND);
$space_id_retention_config = array(); $space_id_retention_config = array();
$pattern_to_find = "[space_".$space_id."]"; $pattern_to_find = "[space_".$space_id."]";
$is_space_id_found = FALSE; $is_space_id_found = FALSE;
......
...@@ -30,12 +30,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. ...@@ -30,12 +30,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<div class="ng6-content-header-right"> <div class="ng6-content-header-right">
{$analyse.description} {$analyse.description}
<br /> <br />
All data related to this analysis use <strong> {$analyse_size} </strong> on the hard drive. All data related to this analysis use <strong> {$analyse_size} </strong> on the hard drive.<br />
{block name=description_update}{/block} {block name=description_update}{/block}
{if $analysis_data_state == 'stored'} {if $analysis_data_state == 'stored'}
The analysis data is <strong>stored</strong>. It will be kept until {$analysis_retention_date}.<br/> The analysis data is <strong>stored</strong>. It will be kept until {$analysis_retention_date}.<br/>
{else} {elseif $analysis_data_state == 'purged'}
The analysis data has been <strong>purged</strong>.<br/> The analysis data has been <strong>purged</strong> on {$analysis_purge_date}.<br/>
{elseif $analysis_data_state == 'extended'}
The analysis data retention has been <strong>extended</strong> to {$analysis_retention_date}.<br/>
{/if} {/if}
</div> </div>
<div style="clear:both"></div> <div style="clear:both"></div>
......
...@@ -79,7 +79,7 @@ $(function () { ...@@ -79,7 +79,7 @@ $(function () {
//Build tbody //Build tbody
var tbody = "" ; var tbody = "" ;
var pattern_regexp = new RegExp( '<a[^>]+class="[^"]*imglink[^"]*"[^>]+href="(fileadmin\/data\/analyze\/[^"]+)' ) ; var pattern_regexp = new RegExp( '<a[^>]+class="[^"]*imglink[^"]*"[^>]+href="(fileadmin\/data[_]*[a-z]*\/analyze\/[^"]+)' ) ;
for( var i = 0 ; i < samples.length ; i++ ) { for( var i = 0 ; i < samples.length ; i++ ) {
tbody += '<tr>' ; tbody += '<tr>' ;
for( var j = 0 ; j < columns.length ; j++ ) { for( var j = 0 ; j < columns.length ; j++ ) {
......
...@@ -325,6 +325,7 @@ class tx_nG6_pi1 extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin { ...@@ -325,6 +325,7 @@ class tx_nG6_pi1 extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
$retention_policy = tx_nG6_db::select_run_retention_status($runs[key($runs)]['id']); $retention_policy = tx_nG6_db::select_run_retention_status($runs[key($runs)]['id']);
$smarty->assign('run_data_state', $retention_policy['run_data_state']); $smarty->assign('run_data_state', $retention_policy['run_data_state']);
$smarty->assign('run_retention_date', $retention_policy['run_retention_date']); $smarty->assign('run_retention_date', $retention_policy['run_retention_date']);
$smarty->assign('run_purge_date', $retention_policy['run_purge_date']);
$run_analysis = tx_nG6_db::get_run_analysis($runs[key($runs)]['id']); $run_analysis = tx_nG6_db::get_run_analysis($runs[key($runs)]['id']);
// Add some information to the table // Add some information to the table
...@@ -404,6 +405,7 @@ class tx_nG6_pi1 extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin { ...@@ -404,6 +405,7 @@ class tx_nG6_pi1 extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
$retention_policy = tx_nG6_db::select_analysis_retention_status($this->piVars['analyze_id']); $retention_policy = tx_nG6_db::select_analysis_retention_status($this->piVars['analyze_id']);
$smarty->assign('analysis_data_state', $retention_policy['analysis_data_state']); $smarty->assign('analysis_data_state', $retention_policy['analysis_data_state']);
$smarty->assign('analysis_retention_date', $retention_policy['analysis_retention_date']); $smarty->assign('analysis_retention_date', $retention_policy['analysis_retention_date']);
$smarty->assign('analysis_purge_date', $retention_policy['analysis_purge_date']);
// Then select analyse results // Then select analyse results
$results = tx_nG6_db::select_analyse_results($this->piVars['analyze_id']); $results = tx_nG6_db::select_analyse_results($this->piVars['analyze_id']);
......
...@@ -86,8 +86,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. ...@@ -86,8 +86,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
{/if} {/if}
{if $run_data_state == 'stored'} {if $run_data_state == 'stored'}
The run data is <strong>stored</strong>. It will be kept until {$run_retention_date}.<br/> The run data is <strong>stored</strong>. It will be kept until {$run_retention_date}.<br/>
{else} {elseif $run_data_state == 'purged'}
The run data has been <strong>purged</strong>.<br/> The run data has been <strong>purged</strong> on {$run_purge_date}.<br/>
{elseif $run_data_state == 'extended'}
The run data retention has been <strong>extended</strong> to {$run_retention_date}.<br/>
{/if} {/if}
......
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