Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix general regression issues and implement other requested changes #105

Merged
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -7,56 +7,60 @@ <h5>Mouse <{{ mouse?.subject_nickname }}> Info</h5>
</div>
<div class="row mouse-info-table">
<table class="table col-lg-4 col-sm-6 col-xs-12 table-striped table-bordered table-sm">
<tr>
<th>Mouse Nickname</th>
<td>{{ mouse?.subject_nickname }}</td>
</tr>
<tr>
<th>Mouse UUID</th>
<td>{{ mouse?.subject_uuid }}</td>
</tr>
<tr>
<th>Mouse DOB</th>
<td>{{ mouse?.subject_birth_date }}</td>
</tr>
<tr>
<th>Lab</th>
<td>{{ mouse?.lab_name }}</td>
</tr>
<tr>
<th>Sex</th>
<td>{{ mouse?.sex }}</td>
</tr>
<tr>
<th>Project</th>
<td>{{ mouse?.projects }}</td>
</tr>
<tr>
<th>User</th>
<td>{{ mouse?.responsible_user }}</td>
</tr>
<tbody>
<tr>
<th>Mouse Nickname</th>
<td>{{ mouse?.subject_nickname }}</td>
</tr>
<tr>
<th>Mouse UUID</th>
<td>{{ mouse?.subject_uuid }}</td>
</tr>
<tr>
<th>Mouse DOB</th>
<td>{{ mouse?.subject_birth_date }}</td>
</tr>
<tr>
<th>Lab</th>
<td>{{ mouse?.lab_name }}</td>
</tr>
<tr>
<th>Sex</th>
<td>{{ mouse?.sex }}</td>
</tr>
<tr>
<th>Project</th>
<td>{{ mouse?.projects }}</td>
</tr>
<tr>
<th>User</th>
<td>{{ mouse?.responsible_user }}</td>
</tr>
</tbody>
</table>
<table class="table col-lg-3 col-sm-6 col-xs-12 table-striped table-bordered table-sm">
<tr>
<th>Ear Mark</th>
<td>{{ mouse?.ear_mark }}</td>
</tr>
<tr>
<th>Mouse Line</th>
<td>{{ mouse?.subject_line }}</td>
</tr>
<tr>
<th>Source</th>
<td>{{ mouse?.subject_source }}</td>
</tr>
<tr>
<th>Protocol Number</th>
<td>{{ mouse?.protocol_number }}</td>
</tr>
<tr>
<th>Description</th>
<td>{{ mouse?.subject_description }}</td>
</tr>
<tbody>
<tr>
<th>Ear Mark</th>
<td>{{ mouse?.ear_mark }}</td>
</tr>
<tr>
<th>Mouse Line</th>
<td>{{ mouse?.subject_line }}</td>
</tr>
<tr>
<th>Source</th>
<td>{{ mouse?.subject_source }}</td>
</tr>
<tr>
<th>Protocol Number</th>
<td>{{ mouse?.protocol_number }}</td>
</tr>
<tr>
<th>Description</th>
<td>{{ mouse?.subject_description }}</td>
</tr>
</tbody>
</table>
<div class="spinning-brain-container col-xs-12 col-sm-6 col-lg-4" *ngIf="mouse">
<app-spinning-brain [mouseInfo]="mouse"></app-spinning-brain>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,14 @@ label {
position: relative;
overflow-x: auto;
}

.flipped, .flipped .col-12
{
transform:rotateX(180deg);
-ms-transform:rotateX(180deg); /* IE 9 */
-webkit-transform:rotateX(180deg); /* Safari and Chrome */
}

td.mat-cell,
td.mat-footer-cell,
th.mat-header-cell {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,11 @@ <h4>
<div class="brain-tree-zone">
<mat-form-field>
<label>Brain Regions</label>
<input matInput (input)="filterChanged($event.target.value.toLowerCase())">
<input matInput type="text" name="brain_regions" formControlName="brain_regions">
<mat-autocomplete #autoCompRU="matAutocomplete">
<mat-option *ngFor="let responsible_user of dropDownMenuOptions.filteredResponsibleUserOptions | async"[value]="brain_regions"
(click)="updateMenu()">{{ brain_regions }}</mat-option>
</mat-autocomplete>
</mat-form-field>
<!-- <div>Selected Brain Region:
<div class="chip-list">
Expand Down Expand Up @@ -219,7 +223,7 @@ <h4>
<button mat-raised-button class="btn btn-refresh" (click)="refreshData()">Refresh Data</button>
</div>
</div>
<!-- <div class="checkbox-filters">
<div class="checkbox-filters">
<div class="chbox-filter">
<mat-checkbox class="nplot_status_chbox" [checked]="hideMissingPlots" (change)="toggleNplotStatus()">
Only show sessions with behavior plots
Expand All @@ -235,15 +239,15 @@ <h4>
Only show sessions with ephys data
</mat-checkbox>
</div>
</div> -->
</div>
</div>
</form>

<div [class]="isLoading && initialLoad ? 'loading-icon loading initial': isLoading ? 'loading-icon loading': 'loading-icon'">
<img src="assets/images/loading_icon.gif">
<p [class]="initialLoad ? 'session-list-loading-message show' : 'session-list-loading-message'"></p>
</div>
<div class="table-container">
<div class="table-container flipped">
<div class="session-list-loading-shade"
*ngIf="isLoadingTable">
<mat-spinner *ngIf="isLoadingTable"></mat-spinner>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ export class SessionListComponent implements OnInit, OnDestroy {
sex: new FormArray([new FormControl(), new FormControl(), new FormControl()]),
subject_birth_date: new FormControl(),
subject_line: new FormControl(),
responsible_user: new FormControl()
responsible_user: new FormControl(),
brain_regions: new FormControl()
});
isLoading;
isLoadingTable = true;
Expand Down Expand Up @@ -340,11 +341,26 @@ export class SessionListComponent implements OnInit, OnDestroy {
switchMap(() => {
this.isLoadingTable = true;
if(this.sort.direction == ''){
this.sort.active = 'session_start_time';
this.sort.active = 'nprobe';
this.sort.direction = 'desc'
}
let filter = Object.assign({}, this.session_filter_form.getRawValue());
let newFilter = JSON.stringify(filter)

if(this.hideMissingPlots){
filter["nplot"] = 1
guzman-raphael marked this conversation as resolved.
Show resolved Hide resolved
}

if(this.hideNG4BrainMap){
filter["good_enough_for_brainwide_map"] = 1
}

if(this.hideNotReady4Delay){
filter["training_status"] = "ready4delay"
}

if(this.hideMissingEphys){
filter["__json"] = '["nprobe>0"]'
}

for (const [key, value] of Object.entries(filter)) {
if(key == 'sex'){
Expand Down Expand Up @@ -375,6 +391,10 @@ export class SessionListComponent implements OnInit, OnDestroy {
continue
}
}
if(key == 'brain_regions' && value !== null){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There appears to be a small bug related to 'unsetting' the brain filter after use. For instance, when I apply HPF as a filter, it appropriately restricts to 2 records but when I simply empty the text box, it shows 0 results.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This been address in the latest commit!

newObject["__json_kwargs"] = `{"brain_regions": ["${value}"]}`
continue
}
if(value !== null){
newObject[key] = value
}
Expand Down Expand Up @@ -474,7 +494,7 @@ export class SessionListComponent implements OnInit, OnDestroy {
private createMenu(restrictedSessions: Array<any>) {
const keys = ['task_protocol', 'session_start_time',
'session_uuid', 'session_lab', 'subject_birth_date', 'subject_line',
'subject_uuid', 'sex', 'subject_nickname', 'responsible_user', 'session_project'];
'subject_uuid', 'sex', 'subject_nickname', 'responsible_user', 'session_project', 'brain_regions'];

keys.forEach(key => {
this.uniqueValuesForEachAttribute[key] = new Set();
Expand Down Expand Up @@ -545,6 +565,7 @@ export class SessionListComponent implements OnInit, OnDestroy {
this.setDropDownFormOptions('filteredTaskProtocolOptions', this.session_filter_form.controls.task_protocol, 'task_protocol');
this.setDropDownFormOptions('filteredSubjectLineOptions', this.session_filter_form.controls.subject_line, 'subject_line');
this.setDropDownFormOptions('filteredResponsibleUserOptions', this.session_filter_form.controls.responsible_user, 'responsible_user');
this.setDropDownFormOptions('filteredBrainRegionsOptions', this.session_filter_form.controls.brain_regions, 'brain_regions');
}

/**
Expand Down Expand Up @@ -1157,27 +1178,31 @@ export class SessionListComponent implements OnInit, OnDestroy {
}
toggleNplotStatus() {
// hide or show sessions that have missing session plots
this.hideMissingPlots = !this.hideMissingPlots;
this.updateSelection();
this.isLoading = false;
this.paginator.pageIndex = 0;
this.ngAfterViewInit();
}
toggleNprobeStatus() {
// hide or show sessions that have missing ephys data (based on existence of probe insertion)
this.hideMissingEphys = !this.hideMissingEphys;
this.updateSelection();
this.isLoading = false;
this.paginator.pageIndex = 0;
this.ngAfterViewInit();
}

toggleG4BMviewStatus() {
// hide or show sessions that are not good enough for brain map
this.hideNG4BrainMap = !this.hideNG4BrainMap;
this.updateSelection();
this.isLoading = false;
this.paginator.pageIndex = 0;
this.ngAfterViewInit();
}

toggleR4DviewStatus() {
// hide or show session that are not ready for delay
this.hideNotReady4Delay = !this.hideNotReady4Delay;
this.updateSelection();
this.isLoading = false;
this.paginator.pageIndex = 0;
this.ngAfterViewInit();
}

//==**==**==**==**+=**+== [START] brain tree functions **==**==**==**==**==**==**==**==**==**+=//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ h5 {

.fitParTable {
font-size: 75%;
display: table-footer-group;
display: table-row;
guzman-raphael marked this conversation as resolved.
Show resolved Hide resolved
}

.fitParTable th {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,52 +3,61 @@
<div class="session-header"><h5>Session Info</h5><span *ngIf="session?.good_enough_for_brainwide_map" class="badge badge-success">Good enough for brainwide map</span></div>
<div class="row session-info-table">
<table class="table col-lg-4 col-sm-6 col-xs-12 table-striped table-bordered table-sm" >
<tr>
<th>Lab Name</th><td>{{ session?.lab_name }}</td>
</tr>
<tr>
<th>Session Start Time</th><td>{{ session?.session_start_time.split("T")[0] }} {{ session?.session_start_time.split("T")[1] }}</td>
</tr>
<tr>
<th>Task Protocol</th><td>{{ session?.task_protocol }}</td>
</tr>
<tr>
<th>Session UUID</th><td>{{ session?.session_uuid }}</td>
</tr>
<tr>
<th>User</th><td>{{ session?.responsible_user }}</td>
</tr>
<tr>
<th>Session Project</th>
<td>{{ session?.session_project }}</td>
</tr>
<tbody>
<tr>
<th>Lab Name</th><td>{{ session?.lab_name }}</td>
</tr>
<tr>
<th>Session Start Time</th><td>{{ session?.session_start_time.split("T")[0] }} {{ session?.session_start_time.split("T")[1] }}</td>
</tr>
<tr>
<th>Task Protocol</th><td>{{ session?.task_protocol }}</td>
</tr>
<tr>
<th>Session UUID</th><td>{{ session?.session_uuid }}</td>
</tr>
<tr>
<th>User</th><td>{{ session?.responsible_user }}</td>
</tr>
<tr>
<th>Session Project</th>
<td>{{ session?.session_project }}</td>
</tr>
</tbody>
</table>
<table class="table col-lg-4 col-sm-6 col-xs-12 table-striped table-bordered table-sm">
<tr>
<th>Mouse Nickame</th>
<td><a routerLink="/mouse/{{session?.subject_uuid}}">{{ session?.subject_nickname }}</a></td>
</tr>
<tr>
<th>Mouse DOB</th>
<td>{{ session?.subject_birth_date }}</td>
</tr>
<tr>
<th>Mouse Line</th>
<td>{{ session?.subject_line }}</td>
</tr>
<tr>
<th>Mouse Sex</th>
<td>{{ session?.sex }}</td>
</tr>
<tr>
<th>Mouse UUID</th>
<td>{{ session?.subject_uuid }}</td>
</tr>
<tbody>
<tr>
<th>Mouse Nickame</th>
<td><a routerLink="/mouse/{{session?.subject_uuid}}">{{ session?.subject_nickname }}</a></td>
</tr>
<tr>
<th>Mouse DOB</th>
<td>{{ session?.subject_birth_date }}</td>
</tr>
<tr>
<th>Mouse Line</th>
<td>{{ session?.subject_line }}</td>
</tr>
<tr>
<th>Mouse Sex</th>
<td>{{ session?.sex }}</td>
</tr>
<tr>
<th>Mouse UUID</th>
<td>{{ session?.subject_uuid }}</td>
</tr>
</tbody>
</table>
</div>
<hr>
<h5>Session Plots</h5>
<div class="sessionBehaviorPlotSection">
<div class="behavior-plots" *ngIf="session">
<app-session-psych-plot [sessionData]="session" [dialogClosed]="dialogClosedSPC" (openSPCplot)="openDialog($event)" (psychCurveFitPars)="fitParsReady($event)"></app-session-psych-plot>
<app-session-rtc-plot [sessionData]="session" [dialogClosed]="dialogClosedSRTC" (openSRTCplot)="openDialog($event)"></app-session-rtc-plot>
<app-session-rttn-plot [sessionData]="session" [dialogClosed]="dialogClosedSRTTN" (openSRTTNplot)="openDialog($event)"></app-session-rttn-plot>
</div>
<table *ngIf="PCplotFitParameter" class="table table-bordered table-sm col-3 fitParTable">
<tr>
<th>prob_left</th>
Expand Down Expand Up @@ -79,12 +88,6 @@ <h5>Session Plots</h5>
<td>{{ PCplotFitParameter[2]?.lapse_high}}</td>
</tr>
</table>

<div class="behavior-plots" *ngIf="session">
<app-session-psych-plot [sessionData]="session" [dialogClosed]="dialogClosedSPC" (openSPCplot)="openDialog($event)" (psychCurveFitPars)="fitParsReady($event)"></app-session-psych-plot>
<app-session-rtc-plot [sessionData]="session" [dialogClosed]="dialogClosedSRTC" (openSRTCplot)="openDialog($event)"></app-session-rtc-plot>
<app-session-rttn-plot [sessionData]="session" [dialogClosed]="dialogClosedSRTTN" (openSRTTNplot)="openDialog($event)"></app-session-rttn-plot>
</div>
</div>
<br>
<hr>
Expand Down