Skip to content

Commit

Permalink
Merge branch 'develop' into 1390-dpl-916-pbmc-donor-pooling-create-plate
Browse files Browse the repository at this point in the history
  • Loading branch information
yoldas committed Feb 23, 2024
2 parents f8483ac + 77f7eb1 commit cb5599e
Show file tree
Hide file tree
Showing 57 changed files with 2,346 additions and 510 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/compile_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Test compilation

on:
- push
- pull_request

env:
BUNDLE_WITHOUT: 'test lint'

jobs:
Build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: nelonoel/[email protected]

- name: Setup node
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true # runs 'bundle install' and caches installed gems automatically

# Actually run our build
- name: Create Build
run: ./compile-build

# Create a release tag based on the branch name and .release-version file
- name: Set release tag
# https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable
# On the develop branch this might create RELEASE_VERSION=2.4.6-987654321-develop
# On the master branch this would then only create RELEASE_VERSION=2.4.6
run: echo "RELEASE_VERSION=$(printf -- '%s%s\n' $(cat .release-version) $([ ${BRANCH_NAME} = "develop" ] && printf -- '-%s-develop' ${GITHUB_RUN_ID} || echo ""))" >> $GITHUB_ENV

# Do not actually save build or create release itself
25 changes: 0 additions & 25 deletions .github/workflows/js_test.yml

This file was deleted.

33 changes: 33 additions & 0 deletions .github/workflows/test_js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Javascript testing

on:
- push
- pull_request

jobs:
js_test:
runs-on: ubuntu-latest
env:
TZ: Europe/London

steps:
- uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- name: Node Information
run: node --version
- name: Install
run: yarn install
- name: Run yarn test
run: yarn test
- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: javascript,${{ github.event_name }}
fail_ci_if_error: true
disable_search: true
files: ${{ github.workspace }}/app/javascript/coverage/lcov.info
# Note: see codecov.yml for more additional settings
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,17 @@ jobs:
# example if you need more control over bundler.
- name: Additional setup
run: bin/setup
- name: Test & publish code coverage
- name: Run rspec
run: bundle exec rspec
- name: Publish code coverage to Code Climate
uses: paambaati/[email protected]
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID || '1735fdb62543d410c5ed4469e402641a7986f1ebf62ff7398f3ab8ccc98069ef' }}
- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
with:
coverageCommand: bundle exec rspec
token: ${{ secrets.CODECOV_TOKEN }}
flags: ruby,${{ github.event_name }}
fail_ci_if_error: true
disable_search: true
files: ${{ github.workspace }}/lcov.info
2 changes: 1 addition & 1 deletion .release-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.45.0
3.47.0
35 changes: 17 additions & 18 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
Copyright (c) 2011-2021 Genome Research Ltd.
MIT License

Author:
Eduardo Martin Rojo <[email protected]>
James Glover <[email protected]>
Matthew Denner <[email protected]>
Sean Dunn <[email protected]>
Stephen Inglis <[email protected]>
Yana Proskurina <[email protected]>
Copyright (c) 2024 Wellcome Sanger Institute - PSD

This program is free software: you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; either version 3 of the License, or (at your option) any later
version.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details.
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

You should have received a copy of the GNU General Public License along with
this program. If not, see <http://www.gnu.org/licenses/>.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
2 changes: 1 addition & 1 deletion app/assets/stylesheets/limber/pipeline-graph.scss
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
ul {
@extend .list-group;
@extend .list-group-flush;
max-height: 500px;
max-height: 50vh;
overflow-y: auto;

li {
Expand Down
6 changes: 6 additions & 0 deletions app/assets/stylesheets/limber/screen.scss
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,13 @@ footer.version-info {
/* Set the fixed height of the footer here */
height: 50px;
line-height: 50px; /* Vertically center the text there */
overflow: hidden;
background-color: $gray-100;

.container {
@extend .text-center;
@extend .text-nowrap;
}
}

.asset-warnings {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# frozen_string_literal: true

# Part of the Labware creator classes
module LabwareCreators
require_dependency 'labware_creators/pcr_cycles_binned_plate/csv_file_for_duplex_seq'

module PcrCyclesBinnedPlate::CsvFile
#
# This version of the row is for the Duplex Seq pipeline.
#
class DuplexSeq::Row < RowBase
include ActiveModel::Validations

SUB_POOL_NOT_BLANK = 'has a value when Submit for Sequencing is N, it should be empty, in %s'
SUBMIT_FOR_SEQ_INVALID = 'is empty or has an unrecognised value (should be Y or N), in %s'
COVERAGE_MISSING = 'is missing but should be present when Submit for Sequencing is Y, in %s'
COVERAGE_NEGATIVE = 'is negative but should be a positive value, in %s'

attr_reader :submit_for_sequencing, :sub_pool, :coverage

validate :submit_for_sequencing_has_expected_value
validate :sub_pool_within_expected_range
validates :coverage,
presence: {
message: ->(object, _data) { COVERAGE_MISSING % object }
},
numericality: {
greater_than: 0,
message: ->(object, _data) { COVERAGE_NEGATIVE % object }
},
unless: -> { empty? || !submit_for_sequencing? }

delegate :submit_for_sequencing_column, :sub_pool_column, :coverage_column, to: :header

def initialize_pipeline_specific_columns
@submit_for_sequencing_as_string = @row_data[submit_for_sequencing_column]&.strip&.upcase
@sub_pool = @row_data[sub_pool_column]&.strip&.to_i
@coverage = @row_data[coverage_column]&.strip&.to_i
end

def submit_for_sequencing?
@submit_for_sequencing ||= (@submit_for_sequencing_as_string == 'Y')
end

def submit_for_sequencing_has_expected_value
return if empty?

return if %w[Y N].include? @submit_for_sequencing_as_string

errors.add('submit_for_sequencing', format(SUBMIT_FOR_SEQ_INVALID, to_s))
end

def sub_pool_within_expected_range
return if empty?

# check the value is within range when we do expect a value to be present
if submit_for_sequencing?
in_range('sub_pool', sub_pool, @row_config.sub_pool_min, @row_config.sub_pool_max)
else
# expect sub-pool field to be blank, possible mistake by user if not
return if sub_pool.blank?

# sub-pool is NOT blank and should be
errors.add('sub_pool', format(SUB_POOL_NOT_BLANK, to_s))
end
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# frozen_string_literal: true

# Part of the Labware creator classes
module LabwareCreators
require_dependency 'labware_creators/pcr_cycles_binned_plate/csv_file_for_duplex_seq'

module PcrCyclesBinnedPlate::CsvFile
#
# Class WellDetailsHeader provides a simple wrapper for handling and validating
# the plate barcode header row from the customer csv file
#
class DuplexSeq::WellDetailsHeader < WellDetailsHeaderBase
# Return the index of the respective column.
attr_reader :submit_for_sequencing_column, :sub_pool_column, :coverage_column

SUBMIT_FOR_SEQUENCING_COLUMN = 'Submit for sequencing (Y/N)?'
SUB_POOL_COLUMN = 'Sub-Pool'
COVERAGE_COLUMN = 'Coverage'
NOT_FOUND = 'could not be found in: '

validates :submit_for_sequencing_column, presence: { message: ->(object, _data) { "#{NOT_FOUND}'#{object}'" } }
validates :sub_pool_column, presence: { message: ->(object, _data) { "#{NOT_FOUND}'#{object}'" } }
validates :coverage_column, presence: { message: ->(object, _data) { "#{NOT_FOUND}'#{object}'" } }

private

def initialize_pipeline_specific_columns
@submit_for_sequencing_column = index_of_header(SUBMIT_FOR_SEQUENCING_COLUMN)
@sub_pool_column = index_of_header(SUB_POOL_COLUMN)
@coverage_column = index_of_header(COVERAGE_COLUMN)
end
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Part of the Labware creator classes
module LabwareCreators
require_dependency 'labware_creators/custom_pooled_tubes/csv_file'
require_dependency 'labware_creators/pcr_cycles_binned_plate/csv_file_base'

#
# Class PlateBarcodeHeader provides a simple wrapper for handling and validating
Expand All @@ -22,9 +22,10 @@ class PcrCyclesBinnedPlate::CsvFile::PlateBarcodeHeader
BARCODE_NOT_MATCHING =
'The plate barcode in the file (%s) does not match the barcode of ' \
'the plate being uploaded to (%s), please check you have the correct file.'
NOT_FOUND = 'could not be found in: '

validates :barcode_lbl_index, presence: { message: ->(object, _data) { "could not be found in: '#{object}'" } }
validates :plate_barcode, presence: { message: ->(object, _data) { "could not be found in: '#{object}'" } }
validates :barcode_lbl_index, presence: { message: ->(object, _data) { "#{NOT_FOUND}'#{object}'" } }
validates :plate_barcode, presence: { message: ->(object, _data) { "#{NOT_FOUND}'#{object}'" } }
validate :plate_barcode_matches_parent?

#
Expand Down
Loading

0 comments on commit cb5599e

Please sign in to comment.