Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
162 commits
Select commit Hold shift + click to select a range
627907c
Add reactivity display.
bcorrie Dec 3, 2024
d5ccbad
Refactor sequence_list
bcorrie Dec 3, 2024
5a23091
Add reactivity to list of fields displayed
bcorrie Dec 3, 2024
f76aadd
Add turnkey-test2.ireceptor.org to repositories.
bcorrie Dec 3, 2024
da34b2b
Apply fixes from StyleCI
StyleCIBot Dec 3, 2024
934669f
Merge pull request #826 from sfu-ireceptor/analysis-32lVN9
bcorrie Dec 3, 2024
80db256
Add code to handle reactivity filters
bcorrie Dec 4, 2024
4b816d0
Add UI for reactivity searching
bcorrie Dec 4, 2024
ba3fc1d
Merge branch 'reactivity' of https://github.com/sfu-ireceptor/gateway…
bcorrie Dec 4, 2024
fd1898d
Apply fixes from StyleCI
StyleCIBot Dec 4, 2024
430710a
Merge pull request #827 from sfu-ireceptor/analysis-e0ejV2
bcorrie Dec 4, 2024
100408c
Bump laravel/framework from 10.9.0 to 10.48.23
dependabot[bot] Dec 4, 2024
2a882b8
Merge pull request #829 from sfu-ireceptor/dependabot/composer/larave…
bcorrie Dec 4, 2024
cc79e8e
Bump symfony/process from 6.2.8 to 6.4.15
dependabot[bot] Dec 4, 2024
1195849
Bump symfony/http-foundation from 6.2.8 to 6.4.16
dependabot[bot] Dec 4, 2024
23b0e4a
Refactor name of SequenceCell to Cell
bcorrie Dec 4, 2024
5c21ce7
Apply fixes from StyleCI
StyleCIBot Dec 4, 2024
7fdd609
Merge pull request #832 from sfu-ireceptor/analysis-9bNynw
bcorrie Dec 4, 2024
a339b3b
Merge branch 'reactivity' into dependabot/composer/symfony/http-found…
bcorrie Dec 4, 2024
8c88bf9
Merge pull request #833 from sfu-ireceptor/dependabot/composer/symfon…
bcorrie Dec 4, 2024
cb1cc9c
Merge pull request #834 from sfu-ireceptor/dependabot/composer/symfon…
bcorrie Dec 4, 2024
f2cbc2d
Refactor SequenceClone class to Clones class.
bcorrie Dec 4, 2024
fcc166c
Minor fix to return to metadata links.
bcorrie Dec 4, 2024
f249bef
Refactor RestService function names, add comments.
bcorrie Dec 4, 2024
b331385
Apply fixes from StyleCI
StyleCIBot Dec 4, 2024
bdc4e27
Merge pull request #835 from sfu-ireceptor/analysis-MPmbZK
bcorrie Dec 4, 2024
f8ac258
Refactor to get rid of incorrect sequence variable names.
bcorrie Dec 4, 2024
4fc77c9
Merge branch 'reactivity' of https://github.com/sfu-ireceptor/gateway…
bcorrie Dec 4, 2024
1f05aa7
Consisency and comment cleanup
bcorrie Dec 4, 2024
61c3475
Apply fixes from StyleCI
StyleCIBot Dec 4, 2024
b7d961c
Merge pull request #836 from sfu-ireceptor/analysis-rrmgk9
bcorrie Dec 4, 2024
3eb2dd8
Add documentation on what queries look like as stored
bcorrie Dec 5, 2024
340b3b3
Added documentation
bcorrie Dec 5, 2024
49d5a9c
Add some better docs, handle reactivity CURIEs in UI
bcorrie Dec 10, 2024
ecf3b7d
Handle CURIE URLs for antigen/epitope
bcorrie Dec 10, 2024
9e682b7
Minor code cleanup
bcorrie Dec 10, 2024
f1f5d4f
Merge branch 'reactivity' of https://github.com/sfu-ireceptor/gateway…
bcorrie Dec 10, 2024
8b66f37
Apply fixes from StyleCI
StyleCIBot Dec 10, 2024
813e108
Merge pull request #838 from sfu-ireceptor/analysis-RPBKbK
bcorrie Dec 10, 2024
d3c50c3
Remove conflict header
bcorrie Dec 10, 2024
eae8c08
Merge branch 'reactivity' of https://github.com/sfu-ireceptor/gateway…
bcorrie Dec 10, 2024
469958c
Additions for providing Reactivity info
bcorrie Dec 11, 2024
a185c20
Additions to UI for Reactivity
bcorrie Dec 11, 2024
4ef8aac
Updates to output file.
bcorrie Dec 12, 2024
d2749c8
Changes to file output.
bcorrie Dec 12, 2024
443d9e4
Fixes to summary file generation
bcorrie Dec 12, 2024
b0591b0
Print out info about SLURM_TMPDIR
bcorrie Dec 12, 2024
32d4f6a
TCRMatch generates single file, one line per sequence.
bcorrie Dec 13, 2024
277b9f0
Get rid of old AGAVE variable use Tapis equivalent
bcorrie Dec 13, 2024
50b5be4
Merge branch 'reactivity' of https://github.com/sfu-ireceptor/gateway…
bcorrie Dec 13, 2024
86a2d43
Use SLURM_TMPDIR during computation
bcorrie Dec 13, 2024
d56cef3
Merge branch 'reactivity' of https://github.com/sfu-ireceptor/gateway…
bcorrie Dec 13, 2024
3c5fb47
Keep track of and report analysis performance
bcorrie Dec 13, 2024
772f4b6
Clean up slurm tmp after each repertoire.
bcorrie Dec 13, 2024
3d257de
Add epitope, antigen, organism reports
bcorrie Dec 14, 2024
ae5a457
Make more robust for missing columns
bcorrie Dec 14, 2024
99b0af3
Change max length of width
bcorrie Dec 14, 2024
72f19ac
Add reports for epitope, antigen, and organism.
bcorrie Dec 14, 2024
cd242ca
Add counts to CDR report
bcorrie Dec 14, 2024
c67d9e4
Improvements to reporting and summary data.
bcorrie Dec 15, 2024
72aad28
Change URL for TCRMatch
bcorrie Dec 15, 2024
8cd5845
Add Reactivity download to Cell downloads
bcorrie Dec 18, 2024
ceaa8bb
Apply fixes from StyleCI
StyleCIBot Dec 18, 2024
43a6971
Merge pull request #839 from sfu-ireceptor/analysis-6VaPwN
bcorrie Dec 18, 2024
7f50ba9
Refactor of object counting based on query type.
bcorrie Dec 31, 2024
2ae0503
Remove productive from clone filters (IR-3156).
bcorrie Dec 31, 2024
8bb0fe2
Add Greiff lab repositories.
bcorrie Dec 31, 2024
f4553ed
Apply fixes from StyleCI
StyleCIBot Dec 31, 2024
664225a
Merge pull request #840 from sfu-ireceptor/analysis-W6OQwe
bcorrie Dec 31, 2024
3099989
Remove use of old method, add comments.
bcorrie Jan 1, 2025
7e7208f
Add code to handle split out cell/gex/reactivity queries
bcorrie Jan 1, 2025
fe065e3
Refactor to determine cell_ids that meet query criteria
bcorrie Jan 1, 2025
005eb68
Add method to return list of objects.
bcorrie Jan 1, 2025
f42143e
New AIRR mapping to include reactivity.
bcorrie Jan 1, 2025
fbe517b
Merge branch 'reactivity' of https://github.com/sfu-ireceptor/gateway…
bcorrie Jan 1, 2025
22a7017
Apply fixes from StyleCI
StyleCIBot Jan 1, 2025
1f7b045
Merge pull request #841 from sfu-ireceptor/analysis-VBVv5P
bcorrie Jan 1, 2025
6bce949
Remove log output - too verbose.
bcorrie Jan 3, 2025
ce0cacc
Clean up of code.
bcorrie Jan 3, 2025
42baa53
Merge branch 'reactivity' of https://github.com/sfu-ireceptor/gateway…
bcorrie Jan 3, 2025
5c80e21
Apply fixes from StyleCI
StyleCIBot Jan 3, 2025
d2e5195
Merge pull request #842 from sfu-ireceptor/analysis-kY32lG
bcorrie Jan 3, 2025
07acb44
Refactor computation of Cell IDs.
bcorrie Jan 6, 2025
a6c7738
Refactor of filter and service processing
bcorrie Jan 6, 2025
088e4b6
Apply fixes from StyleCI
StyleCIBot Jan 6, 2025
a6c4dc5
Merge pull request #843 from sfu-ireceptor/analysis-PG15nP
bcorrie Jan 6, 2025
487e7c5
Move helper function to Cell from CellController.
bcorrie Jan 6, 2025
d653d39
Move code into Cell class
bcorrie Jan 7, 2025
023f240
Refactor for downloads with complex cell queries
bcorrie Jan 7, 2025
0f9cf9d
Refactor for downloads for complex cell queries, code cleanup
bcorrie Jan 7, 2025
f524840
Merge branch 'reactivity' of https://github.com/sfu-ireceptor/gateway…
bcorrie Jan 7, 2025
4f77a6d
Apply fixes from StyleCI
StyleCIBot Jan 7, 2025
678018f
Merge pull request #844 from sfu-ireceptor/analysis-YOnRZd
bcorrie Jan 7, 2025
7bc0870
Handle case when analyzing a single repertoire.
bcorrie Jan 8, 2025
63773b5
Handle repository groups for expression and reactivity downloads
bcorrie Jan 8, 2025
5f00254
Change label to "Data Filters" in UI.
bcorrie Jan 8, 2025
8d46866
Remove debug statement
bcorrie Jan 8, 2025
6d6dd18
Improve output messages
bcorrie Jan 8, 2025
21ea4a8
Remove debug output
bcorrie Jan 8, 2025
7118634
Apply fixes from StyleCI
StyleCIBot Jan 8, 2025
a256c7d
Merge pull request #845 from sfu-ireceptor/analysis-yrOlQp
bcorrie Jan 8, 2025
09cc2fa
Handle non string fields in debug output
bcorrie Feb 6, 2025
3295290
Add requirement for expresison data to single cell apps.
bcorrie Feb 6, 2025
0462096
Merge pull request #847 from sfu-ireceptor/reactivity
bcorrie Feb 6, 2025
3da6c46
Revert "Merger Reactivity into Master"
bcorrie Feb 7, 2025
2ff8614
Merge pull request #848 from sfu-ireceptor/revert-847-reactivity
bcorrie Feb 7, 2025
3a860b7
Revert "Bump laravel/framework from 10.9.0 to 10.48.23"
bcorrie Feb 10, 2025
27a66f6
Merge pull request #849 from sfu-ireceptor/revert-829-dependabot/comp…
bcorrie Feb 10, 2025
0c693f2
Revert "Bump symfony/process from 6.2.8 to 6.4.15"
bcorrie Feb 10, 2025
fa81552
Merge pull request #850 from sfu-ireceptor/revert-834-dependabot/comp…
bcorrie Feb 10, 2025
90a43c7
Add ability to handle array based fields for anaylsis app run checks.
bcorrie Feb 12, 2025
13e5fb6
Make debug messages more concise and informative.
bcorrie Feb 12, 2025
9d34aae
Optimizations to handle large numbers of cells.
bcorrie Feb 13, 2025
efc280a
Refactor cleanup after reactivity refactor.
bcorrie Feb 13, 2025
7dca877
Apply fixes from StyleCI
StyleCIBot Feb 13, 2025
9f68de3
Merge pull request #851 from sfu-ireceptor/analysis-O3lovk
bcorrie Feb 13, 2025
94502a9
Fix for performing searches properly.
bcorrie Feb 13, 2025
8c51109
Merge branch 'reactivity' of https://github.com/sfu-ireceptor/gateway…
bcorrie Feb 13, 2025
981a22d
Apply fixes from StyleCI
StyleCIBot Feb 13, 2025
17d77cf
Merge pull request #852 from sfu-ireceptor/analysis-lZbagr
bcorrie Feb 13, 2025
5fa92ec
Fixes for downloading cells.
bcorrie Feb 13, 2025
7b7ed03
Clean up log/debug messages.
bcorrie Feb 13, 2025
54748da
Apply fixes from StyleCI
StyleCIBot Feb 13, 2025
26759d8
Merge pull request #853 from sfu-ireceptor/analysis-W6RAde
bcorrie Feb 13, 2025
cf077a8
Fixes to definitions and messages.
bcorrie Feb 14, 2025
591b9de
Clean up messages
bcorrie Feb 14, 2025
d660e18
Cleanup debug messages
bcorrie Feb 14, 2025
efe7cde
Merge branch 'reactivity' of https://github.com/sfu-ireceptor/gateway…
bcorrie Feb 14, 2025
7392666
Minor bug fixes caught by feature tests
bcorrie Feb 14, 2025
ee0fb7d
Fixes for test after refactor
bcorrie Feb 14, 2025
e3db49e
Add feature tests for Cells and Clones
bcorrie Feb 14, 2025
5f5ff40
Fix Cell test data.
bcorrie Feb 14, 2025
facaafb
Apply fixes from StyleCI
StyleCIBot Feb 14, 2025
6d69282
Merge pull request #854 from sfu-ireceptor/analysis-a6B1mB
bcorrie Feb 14, 2025
93da1fd
Fixes - handle special characters and simplify file names
bcorrie Feb 20, 2025
01f7b66
Merge branch 'reactivity' of https://github.com/sfu-ireceptor/gateway…
bcorrie Feb 20, 2025
054e861
Fix special characters in file names - IR-3151
bcorrie Feb 20, 2025
2216fe4
Revert "Bump symfony/http-foundation from 6.2.8 to 6.4.16"
bcorrie Feb 20, 2025
47f4eae
Merge pull request #857 from sfu-ireceptor/revert-831-dependabot/comp…
bcorrie Feb 20, 2025
f3102dd
Merge branch 'master' into reactivity
bcorrie Feb 24, 2025
cba117f
Fix error handling bug
bcorrie Feb 25, 2025
6f10475
Add back in use of cache if possible.
bcorrie Feb 25, 2025
ad814cd
Fix issue with single repertoire job query file.
bcorrie Feb 26, 2025
610590b
New method for extracting rearrangements based on cell_id
bcorrie Feb 26, 2025
a212827
Fixes to cell/rearrangement linking
bcorrie Feb 26, 2025
7812171
Conga fixes - error messages when no clone data
bcorrie Feb 26, 2025
7870c36
Minor change to documentation for users.
bcorrie Feb 26, 2025
f0f1dd9
Minor change to user documentation
bcorrie Feb 26, 2025
074c0d2
Fix to info output
bcorrie Feb 26, 2025
cdb0210
Fixes for displaying files.
bcorrie Feb 27, 2025
3714879
Apply fixes from StyleCI
StyleCIBot Feb 27, 2025
1f1875d
Merge pull request #860 from sfu-ireceptor/analysis-01RYge
bcorrie Feb 27, 2025
a20c383
Change GW-INFO header
bcorrie Feb 27, 2025
b04ce30
Merge branch 'gateway-util-update' of https://github.com/sfu-irecepto…
bcorrie Feb 27, 2025
4c54db3
Add description of why Tapis errors happen
bcorrie Feb 27, 2025
a0342a6
Prettify the output of gateway_utilties
bcorrie Feb 27, 2025
d534f93
Merge pull request #859 from sfu-ireceptor/gateway-util-update
bcorrie Feb 27, 2025
446e83e
Merge branch 'master' of https://github.com/sfu-ireceptor/gateway
bcorrie Feb 27, 2025
1b24e87
Apply fixes from StyleCI
StyleCIBot Feb 27, 2025
d8f1eec
Merge pull request #861 from sfu-ireceptor/analysis-RPar59
bcorrie Feb 27, 2025
92cda80
Fix a couple of typos
bcorrie Feb 27, 2025
9396dba
Merge branch 'master' of https://github.com/sfu-ireceptor/gateway
bcorrie Feb 27, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
390 changes: 326 additions & 64 deletions app/SequenceCell.php → app/Cell.php

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions app/SequenceClone.php → app/Clones.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@
use Illuminate\Support\Facades\Storage;
use ZipArchive;

class SequenceClone
class Clones
{
public static function summary($filters, $username)
{
// get clones summary
$response_list_clones_summary = RestService::sequences_summary($filters, $username, true, 'clone');
$response_list_clones_summary = RestService::data_summary($filters, $username, true, 'clone');

// generate stats
$data = self::process_response($response_list_clones_summary);

// get a few clones from each service
$response_list = RestService::sequence_list($filters, $response_list_clones_summary, 10, 'clone');
$response_list = RestService::data_subset($filters, $response_list_clones_summary, 10, 'clone');

// merge responses
$clone_list = [];
Expand Down Expand Up @@ -76,9 +76,9 @@ public static function summary($filters, $username)
return $data;
}

public static function expectedSequenceClonesByRestSevice($filters, $username)
public static function expectedClonesByRestSevice($filters, $username)
{
$response_list = RestService::sequences_summary($filters, $username, false, 'clone');
$response_list = RestService::data_summary($filters, $username, false, 'clone');
$expected_nb_clones_by_rs = [];
foreach ($response_list as $response) {
$rest_service_id = $response['rs']->id;
Expand Down Expand Up @@ -128,11 +128,11 @@ public static function clonesTSVFolder($filters, $username, $url = '',
set_time_limit(config('ireceptor.gateway_file_request_timeout'));

// do extra clone summary request
$response_list = RestService::sequences_summary($filters, $username, false, 'clone');
$response_list = RestService::data_summary($filters, $username, false, 'clone');

// do extra clone summary request to get expected number of clones
// for sanity check after download
$expected_nb_clones_by_rs = self::expectedSequenceClonesByRestSevice($filters, $username);
$expected_nb_clones_by_rs = self::expectedClonesByRestSevice($filters, $username);

// get filtered list of repertoires ids
$filtered_samples_by_rs = self::filteredSamplesByRestService($response_list);
Expand Down Expand Up @@ -168,7 +168,7 @@ public static function clonesTSVFolder($filters, $username, $url = '',
if ($download_data) {
$clone_response_list = RestService::clones_data($filters, $folder_path, $username, $expected_nb_clones_by_rs);
} else {
Log::debug('Sequence::sequencesTSVFolder - SKIPPING DOWNLOAD');
Log::debug('Clones::clonesTSVFolder - SKIPPING DOWNLOAD');
}

// Get a list of file information as a block of data.
Expand Down
14 changes: 12 additions & 2 deletions app/FieldName.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,15 +154,21 @@ public static function getGroups()
$l['PCRTarget'] = 'PCR Target';

$l['Genotype'] = 'Receptor Genotype';
$l['MHCGenotype'] = 'MHC Genotype';
$l['GenotypeSet'] = 'Receptor Genotype Set';
$l['DeletedGene'] = 'Receptor Genotype Deleted Gene';
$l['DocumentedAllele'] = 'Receptor Genotype Documented Allele';
$l['UndocumentedAllele'] = 'Receptor Genotype Undocumented Allele';

$l['MHCGenotype'] = 'MHC Genotype';
$l['MHCGenotypeSet'] = 'MHC Genotype Set';
$l['MHCAllele'] = 'MHC Allele';

$l['Rearrangement'] = 'Rearrangement';

$l['Clone'] = 'Clone';
$l['Cell'] = 'Cell';

$l['IR_Repertoire'] = 'iReceptor Repertoire';
$l['ir_metadata'] = 'iReceptor Metadata';
$l['IR_Parameter'] = 'iReceptor Parameter';
$l['IR_API'] = 'iReceptor API';
Expand Down Expand Up @@ -191,7 +197,11 @@ public static function getFieldsGrouped($ir_class_list)
foreach ($l as $t) {
// if ir_subclass is not known, log warning and override it to 'other'
if (! isset($groups[$t['ir_subclass']])) {
Log::warning($t['ir_subclass'] . ' ir_subclass needs to be defined as a group in ' . static::class);
if ($t['ir_subclass'] == '') {
Log::warning($t['ir_id'] . ' does not have an ir_subclass value');
} else {
Log::warning($t['ir_subclass'] . ' ir_subclass needs to be defined as a group in ' . static::class);
}
$t['ir_subclass'] = 'other';
}

Expand Down
90 changes: 44 additions & 46 deletions app/Http/Controllers/CellController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
namespace App\Http\Controllers;

use App\Bookmark;
use App\Cell;
use App\Download;
use App\FieldName;
use App\QueryLog;
use App\Sample;
use App\SequenceCell;
use App\System;
use App\Tapis;
use Facades\App\Query;
Expand Down Expand Up @@ -38,7 +38,7 @@ public function index(Request $request)

// if request without query id, generate query id and redirect
if (! $request->has('query_id')) {
$query_id = Query::saveParams($request->except(['_token']), 'sequences');
$query_id = Query::saveParams($request->except(['_token']), 'cells');

return redirect('cells?query_id=' . $query_id)->withInput();
}
Expand All @@ -56,20 +56,19 @@ public function index(Request $request)
$filters = Query::getParams($query_id);
$username = auth()->user()->username;

// allow only Cell filters, or only GEX filters, based on currently opened panel
if (isset($filters['open_filter_panel_list'])) {
$open_filter_panel_list = $filters['open_filter_panel_list'];
if ($open_filter_panel_list[0] == 0) {
unset($filters['property_expression']);
unset($filters['value_expression']);
} else {
unset($filters['expression_study_method_cell']);
unset($filters['virtual_pairing_cell']);
}
}
// Basic filters are of the form:
// - a set of service arrays, with keys of the form "ir_project_sample_id_list_N"
// where N is the integer ID of the service. Each array is a set of repertoire_id's
// that the service should query.
// - cols: a comma separated list if columnas
// - open_filter_panel_list: a list of which fitler panels are open
// - sample_query_id: the query ID of the query that was the source of this query
// - the fields from the form that are queryable, key the field name,
// value the filter value.
//

// retrieve data
$cell_data = SequenceCell::summary($filters, $username);
// Retrieve cell data given the filters.
$cell_data = Cell::summary($filters, $username);

// store data size in user query log
$query_log_id = $request->get('query_log_id');
Expand All @@ -80,11 +79,11 @@ public function index(Request $request)
}

/*************************************************
* Prepare view data */

// sequence data
* Prepare Cell view data */
$data = [];

// Get the relevant data that is displayed for each Cell in the UI table.
// This information is stored in the 'items' attribute of the the cell_data.
$data['cell_list'] = $cell_data['items'];

// Fields we want to graph. The UI/blade expects six fields
Expand Down Expand Up @@ -241,28 +240,26 @@ public function index(Request $request)
foreach ($appTemplates as $app_tag => $app_info) {
$app_config = $app_info['config'];
$app_ui_info = [];
Log::debug('Processing app ' . $app_tag);
Log::debug('App config = ' . json_encode($app_config));
Log::debug('CellController::index - Processing app ' . $app_tag);

// Process the parameters.
$parameter_list = [];
//foreach ($app_config['parameters'] as $parameter_info) {
foreach ($app_config['jobAttributes']['parameterSet']['appArgs'] as $parameter_info) {
// We only want the visible parameters to be visible. The
// UI uses the Tapis ID as a label and the Tapis paramenter
// "label" as the human readable name of the parameter.
//if ($parameter_info['value']['visible']) {
if ($parameter_info['inputMode'] != 'FIXED') {
$parameter = [];
Log::debug(' Processing parameter - ' . $parameter_info['name']);
Log::debug(' Processing parameter - ' . $parameter_info['notes']['label']);
Log::debug('CellController::index - Processing parameter - ' . $parameter_info['name']);
Log::debug('CellController::index - Processing parameter - ' . $parameter_info['notes']['label']);
$parameter['label'] = $parameter_info['notes']['label'];
$parameter['name'] = $parameter_info['name'];
$parameter['description'] = $parameter_info['description'];
$parameter['type'] = 'string';
$parameter['default'] = $parameter_info['arg'];
$parameter_list[$parameter_info['name']] = $parameter;
} else {
Log::debug(' Not displaying invisible parameter ' . $parameter_info['id']);
Log::debug('CellController::index - Not displaying invisible parameter ' . $parameter_info['id']);
}
}

Expand Down Expand Up @@ -294,7 +291,8 @@ public function index(Request $request)
// Get the number of rearrangements in the larges repertoire
$repertoire_objects = 0;
foreach ($cell_data['summary'] as $sample) {
if ($sample->ir_filtered_cell_count > $repertoire_objects) {
if (property_exists($sample, 'ir_filtered_cell_count') &&
$sample->ir_filtered_cell_count > $repertoire_objects) {
$repertoire_objects = $sample->ir_filtered_cell_count;
}
}
Expand All @@ -314,9 +312,9 @@ public function index(Request $request)
// If required memory is more than node memory, disable the app and
// generate an error message.
if ($required_memory > $node_memory) {
Log::debug(' Memory exceeded');
Log::debug(' Required memory = ' . human_filesize($required_memory));
Log::debug(' Node memory = ' . human_filesize($node_memory));
Log::debug('CellController::index - Memory exceeded');
Log::debug('CellController::index - Required memory = ' . human_filesize($required_memory));
Log::debug('CellController::index - Node memory = ' . human_filesize($node_memory));
$app_ui_info['runnable'] = false;
$app_ui_info['runnable_comment'] = 'Unable to run Analysis Job. It is estmated that "' . $app_ui_info['name'] . '" will require ' . human_filesize($required_memory) . ' of memory to process ' . human_number($num_objects) . ' rearrangements' . $added_string . '. Compute nodes are limited to ' . human_filesize($node_memory) . ' of memory.';
}
Expand All @@ -331,9 +329,9 @@ public function index(Request $request)
$required_time_secs = ($num_objects / 1000000) * $app_info['time_secs_per_million'];
// If requried is greater than run time, disable the app.
if ($required_time_secs > $job_runtime_secs) {
Log::debug(' Run time exceeded');
Log::debug(' Required run time (s) = ' . human_number($required_time_secs));
Log::debug(' Max run time (s) = ' . human_number($job_runtime_secs));
Log::debug('CellController::index - Run time exceeded');
Log::debug('CellController::index - Required run time (s) = ' . human_number($required_time_secs));
Log::debug('CellController::index - Max run time (s) = ' . human_number($job_runtime_secs));
$app_ui_info['runnable'] = false;
$error_string = 'It is estimated that "' . $app_ui_info['name'] . '" will require ' . human_number($required_time_secs / 60) . ' minutes to process ' . human_number($num_objects) . ' rearrangements. Current maximum job run time is ' . human_number($tapis->maxRunTimeMinutes()) . ' minutes.';
// If we have a comment already, then add to it, otherwise generate new comment.
Expand All @@ -347,20 +345,21 @@ public function index(Request $request)

// Check the field requirements for the app.
if (array_key_exists('requirements', $app_info) && array_key_exists('Fields', $app_info['requirements']) && count($app_info['requirements']['Fields']) > 0) {
foreach ($app_info['requirements']['Fields'] as $field => $value) {
Log::debug(' checking requirement ' . $field . ' = ' . json_encode($value));
foreach ($app_info['requirements']['Fields'] as $field => $value_array) {
Log::debug('CellController::index - checking requirement ' . $field . ' = ' . json_encode($value_array));
// For each sample being processed, make sure the field values are valid.
foreach ($cell_data['summary'] as $sample) {
$error_string = '';
$got_error = false;
if (property_exists($sample, $field)) {
// If the property exists and is a mismatch, disable app
Log::debug(' found field ' . $field . ' = ' . $sample->$field);
if (! in_array($sample->$field, $value)) {
Log::debug(' Requirement field is not in sample.');
$got_error = true;
$app_ui_info['runnable'] = false;
$error_string = 'A required value is missing from the "' . $field . '" field in one of the repertoires. Please filter the data so that all repertoires have one of the following values (' . json_encode($value) . ') in the "' . $field . '" field.';
foreach ($value_array as $value) {
// If the property exists and is a mismatch, disable app
if ((is_array($sample->$field) && ! in_array($value, $sample->$field)) || (! is_array($sample->$field) && $value != $sample->$field)) {
Log::debug('CellController::index - Requirement field is not in sample.');
$got_error = true;
$app_ui_info['runnable'] = false;
$error_string = 'A required value (one of ' . json_encode($value_array) . ') is missing from the "' . $field . '" field in one of the repertoires. Please filter the data so that all repertoires have one of the following values (' . json_encode($value_array) . ') in the "' . $field . '" field.';
}
}
} else {
// If the property doesn't exist, disable the app
Expand All @@ -387,7 +386,6 @@ public function index(Request $request)
// Save the info in the app list given to the UI.
$app_list[$app_tag] = $app_ui_info;
}
// Log::debug($app_list);

// Add the app list to the data returned to the View.
$data['app_list'] = $app_list;
Expand All @@ -401,15 +399,15 @@ public function index(Request $request)
return view('cell', $data);
}

public function timeEstimate($nb_sequences)
public function timeEstimate($nb_cells)
{
$time_estimate_max = '24 hours';

if ($nb_sequences < 500000) {
if ($nb_cells < 500000) {
$time_estimate_max = '20 min';
}

if ($nb_sequences < 100000) {
if ($nb_cells < 100000) {
$time_estimate_max = '';
}

Expand Down Expand Up @@ -450,7 +448,7 @@ public function removeFilter(Request $request)
$new_filters = $filters;
}

$new_query_id = Query::saveParams($new_filters, 'sequences');
$new_query_id = Query::saveParams($new_filters, 'cells');

$uri = $request->route()->uri;

Expand Down
Loading
Loading