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

Release PR for 2.1.0 #222

Merged
merged 48 commits into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
8788fd9
Added a scripts to validate ID generator
mgcam Feb 23, 2024
2f1b32f
Merge pull request #201 from mgcam/validate_id_generation
nerdstrike Feb 26, 2024
23ef830
Update PacBioProductMetrics definition to include new per-product met…
nerdstrike Feb 26, 2024
5daae74
Removed unused method
mgcam Feb 28, 2024
65bd045
Merge pull request #203 from mgcam/drop_unused_method
nerdstrike Feb 28, 2024
08cf2ee
Incorrect type for hifi_read_length_mean
nerdstrike Feb 28, 2024
ad384c8
Merge pull request #202 from nerdstrike/extend_orm_product_metrics
mgcam Feb 29, 2024
5c6dd8e
Ensure empty lists of qc states are not returned.
mgcam Mar 4, 2024
429911f
A single call to retrieve qc states for products.
mgcam Mar 4, 2024
ce953e3
Optimised qc state retrieval for a single product.
mgcam Mar 4, 2024
c08cd84
Uniform compute for wells that have not been qc-ed.
mgcam Mar 4, 2024
c89c411
Moved the code next to its doc
mgcam Mar 4, 2024
f5f79b7
Simplified getting qc states for multiple products.
mgcam Mar 4, 2024
c54de49
Use Optional type hint for fields with None default
mgcam Mar 5, 2024
392bdbc
Merge pull request #209 from mgcam/optimise_qc_state_retrieval
nerdstrike Mar 5, 2024
9d1c7ce
pydantic BaseModel is replaced by pydantic dataclass
mgcam Mar 5, 2024
bcbabcd
Make the dataclasses semi-immutable - no change for the values
mgcam Mar 5, 2024
064c2bb
Auto-map column names to model fields
mgcam Mar 6, 2024
4d2efbd
Update documentation
mgcam Mar 6, 2024
732f1ba
Merge pull request #210 from mgcam/towards_pydantic_dataclass
nerdstrike Mar 7, 2024
f8761b2
Incorrect column name in mlwh
nerdstrike Mar 15, 2024
7de46f6
Merge pull request #215 from nerdstrike/devel
mgcam Mar 15, 2024
d9c3751
Update documentation
mgcam Mar 6, 2024
85b9c1a
Added pb well summary model
mgcam Mar 7, 2024
d8a42a2
Added new test fixtures and tests.
mgcam Mar 11, 2024
9e78a06
Updated CHANGELOG.md
mgcam Mar 12, 2024
82493a0
Moved a utility function into the table class.
mgcam Mar 18, 2024
201b7d4
Merged two sets of mlwh db JSON fixtures
mgcam Mar 18, 2024
3094d9e
Used pytest fixtute to load run data from YAML.
mgcam Mar 18, 2024
a43b88a
Dropped explicit db tables clean-up.
mgcam Mar 18, 2024
f599e37
Merge pull request #212 from mgcam/study_name4summary
nerdstrike Mar 22, 2024
fa7df49
Added study names tooltip on hover and highlighted the BIOSCAN study.
mgcam Mar 12, 2024
0577d55
Introduced 'On hold external' QC state.
mgcam Mar 19, 2024
e65370d
Described recent changes.
mgcam Mar 22, 2024
5b9cafe
Merge pull request #213 from mgcam/display_study_names
nerdstrike Mar 25, 2024
5f744f6
Merge pull request #216 from mgcam/on_hold_external
nerdstrike Mar 25, 2024
25ce043
Merge pull request #217 from mgcam/changelog_update
nerdstrike Mar 25, 2024
f247412
Silence warnings from JS toolchain
nerdstrike Mar 26, 2024
938f879
Merge branch 'update_toolchain' of https://github.com/nerdstrike/npg_…
nerdstrike Mar 26, 2024
ba1b752
Update github test pipeline to use newer node versions in tests and a…
nerdstrike Apr 3, 2024
8535d01
Update action versions in other github pipelines
nerdstrike Apr 3, 2024
f23828c
Merge pull request #218 from nerdstrike/update_toolchain
mgcam Apr 3, 2024
a2ed838
Switched to light theme for the well button
mgcam Apr 5, 2024
7af0b49
Merge pull request #219 from mgcam/light_well_button
mgcam Apr 5, 2024
5c4e79c
Fixed an error in the db migration script
mgcam Apr 9, 2024
dc3f8fc
Merge pull request #220 from mgcam/migration_sql_fix
mgcam Apr 9, 2024
cb92794
Updated app version to 2.1.0
mgcam Apr 12, 2024
5ea356c
Merge pull request #221 from mgcam/prep_release_2.1
nerdstrike Apr 15, 2024
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
9 changes: 4 additions & 5 deletions .github/workflows/deploy-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ jobs:
DB_URL: "mysql+pymysql://q:q@q/q"

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install Poetry
run: |
pipx install poetry

- uses: actions/setup-python@v3
- uses: actions/setup-python@v5
with:
python-version: '3.10'
architecture: 'x64'
Expand All @@ -27,14 +27,13 @@ jobs:
run: |
poetry env use '3.10'
poetry install

- name: Build openapi.json
run: |
mkdir gh_pages
poetry run python -c "from lang_qc.main import app; import json; output = open('gh-pages/openapi.json', 'w'); json.dump(app.openapi(), output); output.close()"

- name: Deploy github pages
uses: JamesIves/github-pages-deploy-action@v4.3.3
uses: JamesIves/github-pages-deploy-action@v4.5.0
with:
branch: gh-pages
folder: gh-pages
6 changes: 3 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install Poetry
run: |
pipx install poetry

- uses: actions/setup-python@v3
- uses: actions/setup-python@v5
with:
python-version: '3.10'
architecture: 'x64'
Expand All @@ -41,7 +41,7 @@ jobs:
run: |
poetry run isort --check --diff --color .

- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 18.x

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
steps:

- name: Check out repository code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Log in to registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: actions/setup-python@v3
- uses: actions/setup-python@v5
with:
python-version: '3.10'
architecture: 'x64'
Expand Down Expand Up @@ -59,13 +59,13 @@ jobs:
MYSQL_DATABASE: "langqc"

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install Poetry
run: |
pipx install poetry

- uses: actions/setup-python@v3
- uses: actions/setup-python@v5
with:
python-version: '3.10'
architecture: 'x64'
Expand All @@ -82,10 +82,10 @@ jobs:
test-frontend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '18'
node-version: '20'
- run: npm install
working-directory: ./frontend
- run: npm run test
Expand Down
34 changes: 34 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,40 @@
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

## [2.1.0] - 2024-04-15

### Changed

* To simplify object instantiation and fields' assignment for some
of the response models, converted `PacBioWell` and `PacBioWellFull`
models to pydantic dataclasses.
* Changed the response model for filtered by either QC status or run wells from
`PacBioWell` to `PacBioWellSummary`, the latter initially being identical
the former. In order to propagate information about a study to the tabbed
well summary view, added a new field, study_names, to the `PacBioWellSummary`
model.
* Added a new event to the tabbed well summary view, to the button with the well
name. Mouse hover over this button displays study names associated with the
well.
* Changed the colour scheme of the above mentioned button from grey to orange
if one of the studies associated with the well is the BIOSCAN study, which
the QC team needs to deal with slightly differently.
* Added a new QC state 'On hold external'. Semantically the new state is similar
to the existing 'On hold' state. The intended purpose of the new QC state - to
highlight the wells, which are waiting for a completion of some off-site
process (example - deplexing at http://mbrave.net/).

### Added

* A new response model `PacBioWellSummary`, which replaces `PacBioWell`
in the latest's capacity of the response model for a PacBio well
summary.
* A new field, `study_names`, a potentially empty sorted array of
unique study names, is added to the response model for a PacBio
well summary.

## [2.0.0] - 2024-02-20

### Changed
Expand Down
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@ subjects other than development, testing and deployment.
- [The QC process](docs/qc_process.md)
- [The QC database schema](docs/qc_schema_explained.md)

## Prepare for release

Prior to merging to the master branch:

- Update CHANGELOG.md
- Update the hardcoded version in
- frontend/package.json
- lang_qc/__init__.py
- pyproject.toml
- If needed, update the Copyright year in frontend/src/App.vue

## Install and run locally

You can install the package with `pip install .` from the repository's root.
Expand Down
24 changes: 24 additions & 0 deletions alembic/versions/2.1.0_extend_qc_state_dict.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
"""extend_qc_state_dict

Revision ID: 2.1.0
Revises: 2.0.0
Create Date: 2024-03-19 12:31:26.359652

"""
from alembic import op

# revision identifiers, used by Alembic.
revision = "2.1.0"
down_revision = "2.0.0"
branch_labels = None
depends_on = None


def upgrade() -> None:
op.execute(
"INSERT INTO qc_state_dict (state, outcome) VALUES ('On hold external', NULL)"
)


def downgrade() -> None:
op.execute("DELETE FROM qc_state_dict WHERE state='On hold external'")
2 changes: 1 addition & 1 deletion frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:18-alpine as base-stage
FROM node:20-alpine as base-stage

COPY package.json /code/longue_vue/

Expand Down
3 changes: 3 additions & 0 deletions frontend/jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"exclude": ["node_modules"]
}
3 changes: 2 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{
"name": "npg-longue-vue",
"version": "2.0.0",
"version": "2.1.0",
"description": "UI for LangQC",
"author": "Kieron Taylor <[email protected]>",
"license": "GPL-3.0-or-later",
"engines": {
"node": ">=16.16.0",
"npm": ">=8.11.0"
},
"type": "module",
"scripts": {
"dev": "vite --port 3000",
"build": "vite build",
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ function notInWellsByRun() {

</el-main>

<el-footer>Copyright Genome Research Ltd 2023 - client version: {{ VERSION.replace(/['"]+/g) + (DEVMODE ? "+DEV" : "")
<el-footer>Copyright Genome Research Ltd 2023, 2024 - client version: {{ VERSION.replace(/['"]+/g) + (DEVMODE ? "+DEV" : "")
}}</el-footer>
</template>

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/QcView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import { computed } from "vue";
import groupMetrics from "../utils/metrics.js";
import combineLabelWithPlate from "../utils/text.js"
import { combineLabelWithPlate } from "../utils/text.js"

const props = defineProps({
// Well object representing one prepared input for the instrument
Expand Down
20 changes: 16 additions & 4 deletions frontend/src/components/WellTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
/*
* Renders a table for a list of wells and generates buttons for selecting wells
*/
import combineLabelWithPlate from "../utils/text.js"
import { combineLabelWithPlate, listStudiesForTooltip } from "../utils/text.js"
import { ElTooltip, ElButton } from "element-plus";

const tooltipDelay = 500
const studyNameHighlight = 'BIOSCAN UK for flying insects'

defineProps({
wellCollection: Object
Expand All @@ -28,9 +32,17 @@ defineEmits(['wellSelected'])
<tr :key="wellObj.id_product" v-for="wellObj in wellCollection">
<td>{{ wellObj.run_name }}</td>
<td class="well_selector">
<button v-on:click="$emit('wellSelected', { idProduct: wellObj.id_product })">
{{ combineLabelWithPlate(wellObj.label, wellObj.plate_number) }}
</button>
<el-tooltip placement="top" effect="light" :show-after="tooltipDelay"
:content="'<span>'.concat(listStudiesForTooltip(wellObj.study_names)).concat('</span>')"
raw-content
>
<el-button plain
:type="wellObj.study_names.includes(studyNameHighlight) ? 'warning' : 'info'"
v-on:click="$emit('wellSelected', { idProduct: wellObj.id_product })"
>
{{ combineLabelWithPlate(wellObj.label, wellObj.plate_number) }}
</el-button>
</el-tooltip>
</td>
<td>{{ wellObj.instrument_type }} {{ wellObj.instrument_name }}</td>
<td>{{ wellObj.qc_state ? wellObj.qc_state.qc_state : '&nbsp;' }}</td>
Expand Down
39 changes: 35 additions & 4 deletions frontend/src/components/__tests__/WellTable.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,33 @@ describe('Rows of data give rows in the table', () => {
const table = mount(WellTable, {
props: {
wellCollection: [
{run_name: 'TEST1', label: 'A1', plate_number: null, instrument_name: '1234', instrument_type: 'Revio', id_product: 'ABCDEF'},
{run_name: 'TEST1', label: 'B1', plate_number: null, instrument_name: '1234', instrument_type: 'Revio', id_product: '123456'},
{run_name: 'TEST2', label: 'A1', plate_number: 1, instrument_name: '1234', instrument_type: 'Revio', id_product: '123457'},
{
run_name: 'TEST1',
label: 'A1',
plate_number: null,
instrument_name: '1234',
instrument_type: 'Revio',
id_product: 'ABCDEF',
study_names: []
},
{
run_name: 'TEST1',
label: 'B1',
plate_number: null,
instrument_name: '1234',
instrument_type: 'Revio',
id_product: '123456',
study_names: ['Study name 1', 'Study name 2']
},
{
run_name: 'TEST2',
label: 'A1',
plate_number: 1,
instrument_name: '1234',
instrument_type: 'Revio',
id_product: '123457',
study_names: ['BIOSCAN UK for flying insects']
},
]
}
})
Expand Down Expand Up @@ -40,7 +64,14 @@ describe('Rows of data give rows in the table', () => {
expect(table.emitted().wellSelected[0][0]).toHaveProperty('idProduct')
expect(table.emitted().wellSelected[0][0].idProduct).toEqual('ABCDEF')

await rows[2].find('button').trigger('click')
let wellButton = rows[2].find('button')
await wellButton.trigger('click')
expect(table.emitted().wellSelected[1][0].idProduct).toEqual('123456')
expect(wellButton.classes('el-tooltip__trigger')).toBeTruthy()
expect(wellButton.classes('el-button--info')).toBeTruthy()

wellButton = rows[3].find('button')
expect(wellButton.classes('el-tooltip__trigger')).toBeTruthy()
expect(wellButton.classes('el-button--warning')).toBeTruthy()
})
})
19 changes: 17 additions & 2 deletions frontend/src/utils/__tests__/text.spec.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { describe, test, expect } from 'vitest'
import combineLabelWithPlate from '../text'
import { combineLabelWithPlate, listStudiesForTooltip } from '../text'

describe('Text processing', () => {
describe('Well label and plate display', () => {
test('Print well label without plate number', () => {
expect(combineLabelWithPlate('A1', undefined)).toEqual('A1')
expect(combineLabelWithPlate('A1', null)).toEqual('A1')
Expand All @@ -11,3 +11,18 @@ describe('Text processing', () => {
expect(combineLabelWithPlate('A1', 1)).toEqual('1-A1')
})
})

describe('Study names tooltip', () => {
test('Display a warning in case of an empty study array', () => {
expect(listStudiesForTooltip([])).toEqual('No study info')
})

test('Display a single study name for an array of one study', () => {
expect(listStudiesForTooltip(['My single study'])).toEqual('My single study')
})

test('Display multiple lines for multiple studies', () => {
expect(listStudiesForTooltip(['Study One', 'Study two', 'Study 3'])).toEqual(
'Study One<br />Study two<br />Study 3')
})
})
9 changes: 8 additions & 1 deletion frontend/src/utils/text.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
// Reusable text-mangling for the interface

export default function combineLabelWithPlate(well, plate) {
export { combineLabelWithPlate, listStudiesForTooltip }

function combineLabelWithPlate(well, plate) {
if (!plate) {
return well
} else {
return `${plate}-${well}`
}
}

function listStudiesForTooltip(study_names) {
let names = study_names.length == 0 ? ['No study info'] : study_names
return names.join('<br />')
}
3 changes: 2 additions & 1 deletion frontend/src/views/__tests__/WellsByRun.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ for (let index = 0; index < 2; index++) {
instrument_name: "1234",
instrument_type: "Revio",
id_product: `${index}23456`,
study_names: [`Study ${index}`, 'Another study'],
...someLinkGeneration
})
}
Expand All @@ -48,6 +49,7 @@ const secondaryRun = {
instrument_name: '1234',
instrument_type: 'Revio',
id_product: 'ABCDEF',
study_names: [],
...someLinkGeneration
}

Expand Down Expand Up @@ -141,7 +143,6 @@ describe('Does it work?', async () => {
let buttons = wrapper.findAll('button')
buttons[1].trigger('click')
await flushPromises()

expect(wrapper.get('#well_summary').exists()).toBe(true)
})

Expand Down
Loading