Commit b9037fb3 authored by Jerome Mariette's avatar Jerome Mariette
Browse files

add datatable and summary to each run/project/analysis + change some design

parent 3217561d
......@@ -120,12 +120,6 @@ class tx_nG6_eid {
} else {
print "pid=".$process->getPid()."&archive_path=".$archive_path;
}
// If file information is requested
} else if ($type == 'get_file_size') {
$ids = trim(t3lib_div::_GP('ids'));
$data_folder = trim(t3lib_div::_GP('data_folder'));
print $this->get_file_size($user_group, $ids, $data_folder);
// If asked to hide a {project/run}
} else if ($type == 'hide') {
......@@ -323,29 +317,6 @@ class tx_nG6_eid {
return 0;
}
/**
* for each $id, get the total size of all files in the corresponding folder
*
* @param string $user_group the user group
* @param string $ids names of run or analysis for which we want to get the sizes of the contained files
* @param string $data_folder root directory where the folders of the runs and analysis can be found
* @return integer total size of the files
*/
function get_file_size($user_group, $ids, $data_folder) {
// First get the directories structure
$directories = $this->get_directories_structure_and_content($user_group, $ids, $data_folder, "/");
$full_size = 0;
foreach($directories[0] as $index => $src_directory) {
// For each files in the source directory
foreach(scandir($src_directory) as $file) {
if (is_file($src_directory."/".$file) and $file != "analyse.xml" and $file != "index.html" and $file != "run.cfg") {
$full_size += filesize($src_directory."/".$file);
}
}
}
return $full_size;
}
/**
* Returns a table with the right directories structure considering ids
*
......
plugin.tx_nG6_pi1 {
view = project
results_at_a_time = 20
}
\ No newline at end of file
......@@ -374,6 +374,29 @@ class tx_nG6_db {
return $res;
}
/**
* Return the size of the project
*
* @param string $p_id the project id to return the size
* @param string $data_folder the data folder
* @param string $user_group the user group
*/
function get_project_size($p_id, $data_folder, $user_group) {
$full_size = 0;
// All runs
$project_runs = tx_nG6_db::get_project_runs($user_group, $p_id);
foreach($project_runs as $run_id => $run_values) {
$full_size += tx_nG6_db::get_run_size($run_values['id'], $data_folder, $user_group);
}
// All analysis
$project_analysis = tx_nG6_db::get_project_analysis($user_group, $p_id);
foreach($project_analysis as $analyse_id => $analyze_values) {
$full_size += tx_nG6_db::get_analysis_size($analyze_values['id'], $data_folder);
}
return $full_size;
}
/*
* Run functions
......@@ -660,6 +683,29 @@ class tx_nG6_db {
return $res;
}
/**
* Return the size of the run
*
* @param string $r_id the run id to return the size
* @param string $data_folder the data folder
* @param string $user_group the user group
*/
function get_run_size($r_id, $data_folder, $user_group) {
$full_size = 0;
$run_analysis = tx_nG6_db::get_run_analysis($user_group, $r_id);
foreach($run_analysis as $analyse_id => $analyze_values) {
$full_size += tx_nG6_db::get_analysis_size($analyze_values['id'], $data_folder);
}
// Then select the run
$my_run = tx_nG6_db::select_run($r_id);
foreach(scandir($data_folder.$my_run['directory']) as $file) {
if (is_file($data_folder.$my_run['directory']."/".$file)) {
$full_size += filesize($data_folder.$my_run['directory']."/".$file);
}
}
return $full_size;
}
/**
* Hide a run and sublevels (analysis)
*
......@@ -822,6 +868,24 @@ class tx_nG6_db {
return $result;
}
/**
* Return the size of the analysis
*
* @param string $a_id the analysis id to return the size
* @param string $data_folder the data folder
*/
function get_analysis_size($a_id, $data_folder) {
// First select the analyse
$my_analysis = tx_nG6_db::select_analyse($a_id);
$full_size = 0;
foreach(scandir($data_folder.$my_analysis['directory']) as $file) {
if (is_file($data_folder.$my_analysis['directory']."/".$file)) {
$full_size += filesize($data_folder.$my_analysis['directory']."/".$file);
}
}
return $full_size;
}
/**
* Hide an analysis
*
......
......@@ -79,6 +79,22 @@ class tx_nG6_utils {
return 0;
}
/**
* Return the string representation of a byte
*
* @param string $size
*/
function get_octet_string_representation($size) {
$octets_link = array("bytes", "Kb", "Mb", "Gb", "Tb", "Pb", "Eb", "Zb");
$p = (int)(ceil((float)(strlen(strval($size)))/(float)(3) - (float)(1)));
$pow_needed = $p * 10;
$pow_needed = pow(2, $pow_needed);
$value = (float)($size)/(float)($pow_needed);
$tmp = explode(".", $value);
$value = $tmp[0].".".substr($tmp[1], 0, 2);
$value = $value." ".$octets_link[$p];
return $value;
}
}
if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/nG6/class.tx_nG6_utils.php']) {
......
......@@ -16,13 +16,18 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*}
<div id="img_dialog" title=""></div>
<input type="hidden" id="analyse_name" value="{$analyse.name}"/>
<div class="tx-nG6-pi1-singleView">
<h2>Analyse {$analyse.name}: <span> {$analyse.description} </span> </h2>
<div class="analysis">
<h2>{$llang.analyse} {$analyse.name} :</h2>
<p><strong>{$analyse.description}</strong> <br />
<br />
{($llang.analyse_desc|replace:"###ANALYSE_SIZE###":"<strong>###ANALYSE_SIZE###</strong>")|replace:"###ANALYSE_SIZE###":$analyse_size}
</p>
</div>
<h3> {$llang.AdaptorcleanerAnalyse_params_title} </h3>
<div class="underline"> </div>
{assign var="params" value=" "|explode:$analyse.params}
<ul>
{assign var="score_index" value=$params|@array_keys:"--score"}
......@@ -48,6 +53,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
{assign var="analyse_results_sorted" value=$analyse_results|@ksort}
<h3> {$llang.AdaptorcleanerAnalyse_result_title} </h3>
<div class="underline"> </div>
<table class="tx-nG6-pi1-listrow">
<tr>
{if $analyse_results|@count > 1 }
......@@ -74,6 +80,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
</table>
<h3> {$llang.AdaptorcleanerAnalyse_adaptor_title} </h3>
<div class="underline"> </div>
{* First find out all adaptors used *}
{assign var="adaptors" value=array()}
{foreach from=$analyse_results key=sample item=sample_results}
......@@ -105,10 +112,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
</table>
<h3> {$llang.Analyse_archives_title} </h3>
{$dir=$data_folder|cat:$analyse.directory}
{foreach $dir|scandir as $file}
{if $file != "." and $file != ".." and ($file|substr:-strlen(".png")) != ".png"}
{$link=(('fileadmin'|cat:$analyse.directory)|cat:'/')|cat:$file}
<a href="{$link}">{$file}</a> <br />
{/if}
{/foreach}
<div class="underline"> </div>
<p><ul>
{$dir=$data_folder|cat:$analyse.directory}
{foreach $dir|scandir as $file}
{if $file != "." and $file != ".." and ($file|substr:-strlen(".png")) != ".png"}
{$link=(('fileadmin'|cat:$analyse.directory)|cat:'/')|cat:$file}
<li><a href="{$link}">{$file}</a> </li>
{/if}
{/foreach}
</ul></p>
......@@ -16,13 +16,18 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*}
<div id="img_dialog" title=""></div>
<input type="hidden" id="analyse_name" value="{$analyse.name}"/>
<div class="tx-nG6-pi1-singleView">
<h2>Analyse {$analyse.name}: <span> {$analyse.description} </span> </h2>
<div class="analysis">
<h2>{$llang.analyse} {$analyse.name} :</h2>
<p><strong>{$analyse.description}</strong> <br />
<br />
{($llang.analyse_desc|replace:"###ANALYSE_SIZE###":"<strong>###ANALYSE_SIZE###</strong>")|replace:"###ANALYSE_SIZE###":$analyse_size}
</p>
</div>
<h3> {$llang.BWAContaminationSearchAnalyse_result_title} </h3>
<div class="underline"> </div>
{* First find out all databse used *}
{assign var="database" value=array()}
{foreach from=$analyse_results key=sample item=sample_results}
......@@ -60,10 +65,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
</table>
<h3> {$llang.Analyse_archives_title} </h3>
{$dir=$data_folder|cat:$analyse.directory}
{foreach $dir|scandir as $file}
{if $file != "." and $file != ".." and ($file|substr:-strlen(".png")) != ".png"}
{$link=(('fileadmin'|cat:$analyse.directory)|cat:'/')|cat:$file}
<a href="{$link}">{$file}</a> <br />
{/if}
{/foreach}
\ No newline at end of file
<div class="underline"> </div>
<p><ul>
{$dir=$data_folder|cat:$analyse.directory}
{foreach $dir|scandir as $file}
{if $file != "." and $file != ".." and ($file|substr:-strlen(".png")) != ".png"}
{$link=(('fileadmin'|cat:$analyse.directory)|cat:'/')|cat:$file}
<li><a href="{$link}">{$file}</a> </li>
{/if}
{/foreach}
</ul></p>
\ No newline at end of file
......@@ -16,22 +16,30 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*}
<div id="img_dialog" title=""></div>
<input type="hidden" id="analyse_name" value="{$analyse.name}"/>
<div class="tx-nG6-pi1-singleView">
<h2>Analyse {$analyse.name}: <span> {$analyse.description} </span> </h2>
<div class="analysis">
<h2>{$llang.analyse} {$analyse.name} :</h2>
<p><strong>{$analyse.description}</strong> <br />
<br />
{($llang.analyse_desc|replace:"###ANALYSE_SIZE###":"<strong>###ANALYSE_SIZE###</strong>")|replace:"###ANALYSE_SIZE###":$analyse_size}
</p>
</div>
<h3> {$llang.Analyse_params} </h3>
<div class="underline"> </div>
<ul>
<li>{$analyse.params}</li>
</ul>
<h3> {$llang.Analyse_archives_title} </h3>
{$dir=$data_folder|cat:$analyse.directory}
{foreach $dir|scandir as $file}
{if $file != "." and $file != ".." and ($file|substr:-strlen(".png")) != ".png"}
{$link=(('fileadmin'|cat:$analyse.directory)|cat:'/')|cat:$file}
<a href="{$link}">{$file}</a> <br />
{/if}
{/foreach}
<div class="underline"> </div>
<p><ul>
{$dir=$data_folder|cat:$analyse.directory}
{foreach $dir|scandir as $file}
{if $file != "." and $file != ".." and ($file|substr:-strlen(".png")) != ".png"}
{$link=(('fileadmin'|cat:$analyse.directory)|cat:'/')|cat:$file}
<li><a href="{$link}">{$file}</a> </li>
{/if}
{/foreach}
</ul></p>
\ No newline at end of file
......@@ -16,13 +16,18 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*}
<div id="img_dialog" title=""></div>
<input type="hidden" id="analyse_name" value="{$analyse.name}"/>
<div class="tx-nG6-pi1-singleView">
<h2>Analyse {$analyse.name}: <span> {$analyse.description} </span> </h2>
<div class="analysis">
<h2>{$llang.analyse} {$analyse.name} :</h2>
<p><strong>{$analyse.description}</strong> <br />
<br />
{($llang.analyse_desc|replace:"###ANALYSE_SIZE###":"<strong>###ANALYSE_SIZE###</strong>")|replace:"###ANALYSE_SIZE###":$analyse_size}
</p>
</div>
<h3> {$llang.BlastContaminationSearchAnalyse_params_title} </h3>
<div class="underline"> </div>
{assign var="params" value=";"|explode:$analyse.params}
<ul>
<li>{$params[0]}</li>
......@@ -30,6 +35,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
</ul>
<h3> {$llang.BlastContaminationSearchAnalyse_result_title} </h3>
<div class="underline"> </div>
{* First find out all databse used *}
{assign var="database" value=array()}
{foreach from=$analyse_results key=sample item=sample_results}
......@@ -67,10 +73,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
</table>
<h3> {$llang.Analyse_archives_title} </h3>
{$dir=$data_folder|cat:$analyse.directory}
{foreach $dir|scandir as $file}
{if $file != "." and $file != ".." and ($file|substr:-strlen(".png")) != ".png"}
{$link=(('fileadmin'|cat:$analyse.directory)|cat:'/')|cat:$file}
<a href="{$link}">{$file}</a> <br />
{/if}
{/foreach}
\ No newline at end of file
<div class="underline"> </div>
<p><ul>
{$dir=$data_folder|cat:$analyse.directory}
{foreach $dir|scandir as $file}
{if $file != "." and $file != ".." and ($file|substr:-strlen(".png")) != ".png"}
{$link=(('fileadmin'|cat:$analyse.directory)|cat:'/')|cat:$file}
<li><a href="{$link}">{$file}</a> </li>
{/if}
{/foreach}
</ul></p>
\ No newline at end of file
......@@ -16,13 +16,18 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*}
<div id="img_dialog" title=""></div>
<input type="hidden" id="analyse_name" value="{$analyse.name}"/>
<div class="tx-nG6-pi1-singleView">
<h2>Analyse {$analyse.name}: <span> {$analyse.description} </span> </h2>
<div class="analysis">
<h2>{$llang.analyse} {$analyse.name} :</h2>
<p><strong>{$analyse.description}</strong> <br />
<br />
{($llang.analyse_desc|replace:"###ANALYSE_SIZE###":"<strong>###ANALYSE_SIZE###</strong>")|replace:"###ANALYSE_SIZE###":$analyse_size}
</p>
</div>
<h3> {$llang.CutAdaptAnalyse_params_title} </h3>
<div class="underline"> </div>
{assign var="params" value=" "|explode:$analyse.params}
{assign var="error_index" value=$params|@array_keys:"-e"}
{assign var="min_index" value=$params|@array_keys:"-m"}
......@@ -35,6 +40,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
</ul>
<h3> {$llang.CutAdaptAnalyse_result_title} </h3>
<div class="underline"> </div>
<table class="tx-nG6-pi1-listrow">
<tr>
{if $analyse_results|@count > 1 }
......@@ -72,10 +78,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
{/if}
<h3> {$llang.Analyse_archives_title} </h3>
{$dir=$data_folder|cat:$analyse.directory}
{foreach $dir|scandir as $file}
{if $file != "." and $file != ".." and ($file|substr:-strlen(".png")) != ".png"}
{$link=(('fileadmin'|cat:$analyse.directory)|cat:'/')|cat:$file}
<a href="{$link}">{$file}</a> <br />
{/if}
{/foreach}
\ No newline at end of file
<div class="underline"> </div>
<p><ul>
{$dir=$data_folder|cat:$analyse.directory}
{foreach $dir|scandir as $file}
{if $file != "." and $file != ".." and ($file|substr:-strlen(".png")) != ".png"}
{$link=(('fileadmin'|cat:$analyse.directory)|cat:'/')|cat:$file}
<li><a href="{$link}">{$file}</a> </li>
{/if}
{/foreach}
</ul></p>
\ No newline at end of file
......@@ -15,14 +15,19 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*}
<input type="hidden" id="analyse_name" value="{$analyse.name}"/>
<div id="img_dialog" title=""></div>
<input type="hidden" id="analyse_name" value="{$analyse.name}"/>
<div class="tx-nG6-pi1-singleView">
<h2>Analyse {$analyse.name}: <span> {$analyse.description} </span> </h2>
<div class="analysis">
<h2>{$llang.analyse} {$analyse.name} :</h2>
<p><strong>{$analyse.description}</strong> <br />
<br />
{($llang.analyse_desc|replace:"###ANALYSE_SIZE###":"<strong>###ANALYSE_SIZE###</strong>")|replace:"###ANALYSE_SIZE###":$analyse_size}
</p>
</div>
<h3> {$llang.FastqcAnalyse_stat_title} </h3>
<div class="underline"> </div>
<table class="tx-nG6-pi1-listrow">
<tr>
{if $analyse_results|@count > 1 }
......@@ -93,10 +98,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
</div>
<h3> {$llang.Analyse_archives_title} </h3>
{$dir=$data_folder|cat:$analyse.directory}
{foreach $dir|scandir as $file}
{if $file != "." and $file != ".." and ($file|substr:-strlen(".png")) != ".png"}
{$link=(('fileadmin'|cat:$analyse.directory)|cat:'/')|cat:$file}
<a href="{$link}">{$file}</a> <br />
{/if}
{/foreach}
<div class="underline"> </div>
<p><ul>
{$dir=$data_folder|cat:$analyse.directory}
{foreach $dir|scandir as $file}
{if $file != "." and $file != ".." and ($file|substr:-strlen(".png")) != ".png"}
{$link=(('fileadmin'|cat:$analyse.directory)|cat:'/')|cat:$file}
<li><a href="{$link}">{$file}</a></li>
{/if}
{/foreach}
</ul></p>
......@@ -16,13 +16,18 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*}
<div id="img_dialog" title=""></div>
<input type="hidden" id="analyse_name" value="{$analyse.name}"/>
<div class="tx-nG6-pi1-singleView">
<h2>Analyse {$analyse.name}: <span> {$analyse.description} </span> </h2>
<div class="analysis">
<h2>{$llang.analyse} {$analyse.name} :</h2>
<p><strong>{$analyse.description}</strong> <br />
<br />
{($llang.analyse_desc|replace:"###ANALYSE_SIZE###":"<strong>###ANALYSE_SIZE###</strong>")|replace:"###ANALYSE_SIZE###":$analyse_size}
</p>
</div>
<h3> {$llang.IlluminaMidSearchAnalyse_result_title} </h3>
<div class="underline"> </div>
{* First find out all mid names tested *}
{assign var="mids" value=array()}
{foreach from=$analyse_results key=sample item=sample_results}
......@@ -50,10 +55,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
</table>
<h3> {$llang.Analyse_archives_title} </h3>
{$dir=$data_folder|cat:$analyse.directory}
{foreach $dir|scandir as $file}
{if $file != "." and $file != ".." and ($file|substr:-strlen(".png")) != ".png"}
{$link=(('fileadmin'|cat:$analyse.directory)|cat:'/')|cat:$file}
<a href="{$link}">{$file}</a> <br />
{/if}
{/foreach}
<div class="underline"> </div>
<p><ul>
{$dir=$data_folder|cat:$analyse.directory}
{foreach $dir|scandir as $file}
{if $file != "." and $file != ".." and ($file|substr:-strlen(".png")) != ".png"}
{$link=(('fileadmin'|cat:$analyse.directory)|cat:'/')|cat:$file}
<li><a href="{$link}">{$file}</a> </li>
{/if}
{/foreach}
</ul></p>
\ No newline at end of file
......@@ -16,13 +16,18 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*}
<div id="img_dialog" title=""></div>
<input type="hidden" id="analyse_name" value="{$analyse.name}"/>
<div class="tx-nG6-pi1-singleView">
<h2>Analyse {$analyse.name}: <span> {$analyse.description} </span> </h2>
<div class="analysis">
<h2>{$llang.analyse} {$analyse.name} :</h2>
<p><strong>{$analyse.description}</strong> <br />
<br />
{($llang.analyse_desc|replace:"###ANALYSE_SIZE###":"<strong>###ANALYSE_SIZE###</strong>")|replace:"###ANALYSE_SIZE###":$analyse_size}
</p>
</div>
<h3> {$llang.MidsContaminationSearchAnalyse_result_title} </h3>
<div class="underline"> </div>
{* First find out all mid names tested *}
{assign var="mids" value=array()}
{foreach from=$analyse_results key=sample item=sample_results}
......@@ -50,10 +55,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
</table>
<h3> {$llang.Analyse_archives_title} </h3>
{$dir=$data_folder|cat:$analyse.directory}
{foreach $dir|scandir as $file}
{if $file != "." and $file != ".." and ($file|substr:-strlen(".png")) != ".png"}
{$link=(('fileadmin'|cat:$analyse.directory)|cat:'/')|cat:$file}
<a href="{$link}">{$file}</a> <br />
{/if}
{/foreach}
<div class="underline"> </div>
<p><ul>
{$dir=$data_folder|cat:$analyse.directory}
{foreach $dir|scandir as $file}
{if $file != "." and $file != ".." and ($file|substr:-strlen(".png")) != ".png"}
{$link=(('fileadmin'|cat:$analyse.directory)|cat:'/')|cat:$file}
<li><a href="{$link}">{$file}</a> </li>
{/if}
{/foreach}
</ul></p>
......@@ -16,13 +16,18 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*}
<div id="img_dialog" title=""></div>
<input type="hidden" id="analyse_name" value="{$analyse.name}"/>
<div class="tx-nG6-pi1-singleView">
<h2>Analyse {$analyse.name}: <span> {$analyse.description} </span> </h2>
<div class="analysis">
<h2>{$llang.analyse} {$analyse.name} :</h2>
<p><strong>{$analyse.description}</strong> <br />
<br />
{($llang.analyse_desc|replace:"###ANALYSE_SIZE###":"<strong>###ANALYSE_SIZE###</strong>")|replace:"###ANALYSE_SIZE###":$analyse_size}
</p>
</div>
<h3> {$llang.PyrocleanerAnalyse_params_title} </h3>
<div class="underline"> </div>
{assign var="params" value=" "|explode:$analyse.params}
<ul>
{if in_array("--clean-length-std", $params)}
......@@ -67,6 +72,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
</ul>
<h3> {$llang.PyrocleanerAnalyse_result_title} </h3>
<div class="underline"> </div>
<table class="tx-nG6-pi1-listrow">
<tr>
{if $analyse_results|@count > 1 }
......@@ -202,10 +208,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
{/if}
<h3> {$llang.Analyse_archives_title} </h3>
{$dir=$data_folder|cat:$analyse.directory}
{foreach $dir|scandir as $file}
{if $file != "." and $file != ".." and ($file|substr:-strlen(".png")) != ".png"}
{$link=(('fileadmin'|cat:$analyse.directory)|cat:'/')|cat:$file}
<a href="{$link}">{$file}</a> <br />
{/if}
{/foreach}
\ No newline at end of file
<div class="underline"> </div>
<p><ul>
{$dir=$data_folder|cat:$analyse.directory}
{foreach $dir|scandir as $file}
{if $file != "." and $file != ".." and ($file|substr:-strlen(".png")) != ".png"}
{$link=(('fileadmin'|cat:$analyse.directory)|cat:'/')|cat:$file}
<li><a href="{$link}">{$file}</a> </li>
{/if}
{/foreach}
</ul></p>
\ No newline at end of file
......@@ -16,14 +16,19 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*}
<div id="img_dialog" title=""></div>