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

Dpl 917 scrna faculty input submission #4067

Merged
merged 11 commits into from
Apr 4, 2024

Conversation

andrewsparkes
Copy link
Member

Closes #3901

Changes proposed in this pull request

Adds submission template for faculty input plate

studies: [study],
sample_metadata_attributes: {
supplier_name: sample_name,
cohort: "Cohort#{plate.human_barcode}",
Copy link

Choose a reason for hiding this comment

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

UatActions::GeneratePlates#build_sample calls 'plate.human_barcode' 2 times

# Ensures number of samples per occupied well is at least 1
def num_samples_per_well
@num_samples_per_well ||=
if number_of_samples_in_each_well.present? && number_of_samples_in_each_well.to_i.positive?
Copy link

Choose a reason for hiding this comment

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

UatActions::GeneratePlates#num_samples_per_well calls 'number_of_samples_in_each_well.to_i' 2 times

sample.save!(validate: false)

if num_samples_per_well > 1
well.aliquots.create!(sample: sample, study: study, tag_depth: sample_index)
Copy link

Choose a reason for hiding this comment

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

UatActions::GeneratePlates#save_sample calls 'well.aliquots' 2 times

studies: [study],
sample_metadata_attributes: {
supplier_name: sample_name,
cohort: "Cohort#{plate.human_barcode}",
Copy link

Choose a reason for hiding this comment

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

UatActions::GeneratePlates#build_sample refers to 'plate' more than self (maybe move it to another class?)

}
)
sample.save!(validate: false)
num_samples_per_well.times { |sample_index| create_sample(plate, well, sample_index + 1) }
Copy link

Choose a reason for hiding this comment

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

UatActions::GeneratePlates#construct_wells contains iterators nested 2 deep

sample_name = "sample_#{sample_index}_#{plate.human_barcode}_#{well.map.description}"
sample = build_sample(sample_name, plate)
save_sample(sample, well, sample_index)
rescue ActiveRecord::RecordInvalid => e
Copy link

Choose a reason for hiding this comment

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

UatActions::GeneratePlates#create_sample has the variable name 'e'

# Ensures number of samples per occupied well is at least 1
def num_samples_per_well
@num_samples_per_well ||=
if number_of_samples_in_each_well.present? && number_of_samples_in_each_well.to_i.positive?
Copy link

Choose a reason for hiding this comment

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

UatActions::TestSubmission#num_samples_per_well calls 'number_of_samples_in_each_well.to_i' 2 times

# The well layout is set to 'Random'.
# The number of samples in each well is set to num_samples_per_well.
# @return [UatActions::GeneratePlates] the configured plate generator
def setup_generator
Copy link

Choose a reason for hiding this comment

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

UatActions::TestSubmission#setup_generator has approx 6 statements

Copy link

codeclimate bot commented Apr 4, 2024

Code Climate has analyzed commit 8ce8f7e and detected 11 issues on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 11

The test coverage on the diff in this pull request is 97.8% (50% is the threshold).

This pull request will bring the total coverage in the repository to 86.7% (0.0% change).

View more on Code Climate.

@andrewsparkes andrewsparkes merged commit 5bb51ae into develop Apr 4, 2024
11 checks passed
@andrewsparkes andrewsparkes deleted the dpl-917-scrna-faculty-input-submission branch April 4, 2024 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DPL-917 Submit plate of PBMC pools for cDNA prep
2 participants