-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #232 from nerdstrike/actually_render_product_metrics
Actually render product metrics
- Loading branch information
Showing
13 changed files
with
183 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<script setup> | ||
import { ref } from "vue"; | ||
import { ElTooltip, ElCollapse, ElCollapseItem } from "element-plus"; | ||
const props = defineProps({ | ||
pool: Object, | ||
}) | ||
const active = ref([]) | ||
</script> | ||
|
||
<template> | ||
<el-collapse v-model="active" accordion> | ||
<el-collapse-item name="1"> | ||
<template #title><slot>Pool composition</slot></template> | ||
<el-tooltip content="Caution, this value is of low signficance when the pool size is small"> | ||
<p>Coefficient of Variance: {{ props.pool.pool_coeff_of_variance }}</p> | ||
</el-tooltip> | ||
<table> | ||
<tr> | ||
<th>Tag 1</th> | ||
<th>Tag 2</th> | ||
<th>Deplexing barcode ID</th> | ||
<th>HiFi bases (Gb)</th> | ||
<th>HiFi reads</th> | ||
<th>HiFi mean read length</th> | ||
<th>Percentage of HiFi bases</th> | ||
<th>Percentage of total reads</th> | ||
</tr> | ||
<tr :key="library.id_product" v-for="library in props.pool.products"> | ||
<td>{{ library.tag1_name }}</td> | ||
<td>{{ library.tag2_name }}</td> | ||
<td>{{ library.deplexing_barcode }}</td> | ||
<td>{{ library.hifi_read_bases }}</td> | ||
<td>{{ library.hifi_num_reads }}</td> | ||
<td>{{ library.hifi_read_length_mean }}</td> | ||
<td>{{ library.hifi_bases_percent }}</td> | ||
<td>{{ library.percentage_total_reads }}</td> | ||
</tr> | ||
</table> | ||
</el-collapse-item> | ||
</el-collapse> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import { describe, expect, test } from 'vitest' | ||
import { mount } from '@vue/test-utils' | ||
import ElementPlus from 'element-plus' | ||
|
||
import PoolStats from '../PoolStats.vue' | ||
|
||
const wrapper = mount(PoolStats, { | ||
global: { | ||
plugins: [ElementPlus], | ||
}, | ||
props: { | ||
pool: { | ||
pool_coeff_of_variance: 47.2, | ||
products: [{ | ||
id_product: 'A'.repeat(64), | ||
tag1_name: 'TTTTTTTT', | ||
tag2_name: null, | ||
deplexing_barcode: 'bc10--bc10', | ||
hifi_read_bases: 900, | ||
hifi_num_reads: 20, | ||
hifi_read_length_mean: 45, | ||
hifi_bases_percent: 90.001, | ||
percentage_total_reads: 66.6 | ||
},{ | ||
id_product: 'B'.repeat(64), | ||
tag1_name: 'GGGGGGGG', | ||
tag2_name: null, | ||
deplexing_barcode: 'bc11--bc11', | ||
hifi_read_bases: 100, | ||
hifi_num_reads: 10, | ||
hifi_read_length_mean: 10, | ||
hifi_bases_percent: 100, | ||
percentage_total_reads: 33.3 | ||
}] | ||
} | ||
} | ||
}) | ||
|
||
describe('Create poolstats table with good data', () => { | ||
test('Component is "folded" by default', () => { | ||
expect(wrapper.getComponent('transition-stub').attributes()['appear']).toEqual('false') | ||
}) | ||
|
||
test('Coefficient of variance showing', async () => { | ||
let topStat = wrapper.find('p') | ||
await topStat.trigger('focus') | ||
expect(topStat.classes('el-tooltip__trigger')).toBeTruthy() | ||
|
||
expect(topStat.text()).toEqual('Coefficient of Variance: 47.2') | ||
}) | ||
|
||
test('Table looks about right', () => { | ||
let rows = wrapper.findAll('tr') | ||
expect(rows.length).toEqual(3) | ||
|
||
// Check tag 1 has been set | ||
expect(rows[1].find('td').text()).toEqual('TTTTTTTT') | ||
expect(rows[2].find('td').text()).toEqual('GGGGGGGG') | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters