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
Assembly annotation #1736
Assembly annotation #1736
Conversation
Code Climate has analyzed commit 63a3ae0 and detected 1 issue on this pull request. Here's the issue category breakdown:
View more on Code Climate. |
app/models/pipeline_run.rb
Outdated
taxid_list = [] | ||
contig2taxid.values.each { |entry| taxid_list += entry.values } | ||
taxon_lineage_map = {} | ||
TaxonLineage.where(taxid: taxid_list.uniq).each { |t| taxon_lineage_map[t.taxid.to_i] = t.to_a } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you need to select only the most recent / the most appropriate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great point. i can make it oder by id so the latest one will always be there.
app/models/taxon_lineage.rb
Outdated
@@ -159,6 +159,21 @@ def self.fill_lineage_details(tax_map, pipeline_run_id) | |||
tax_map | |||
end | |||
|
|||
def to_a | |||
[species_taxid, genus_taxid, family_taxid, order_taxid, class_taxid, phylum_taxid, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could the following help with maintainability?
def to_a
TaxonLineage.names_a.map { |col| self[col] }
end
and
def self.null_array
TaxonLineage.column_defaults.values_at(*TaxonLineage.names_a)
end
That way, the list of columns is only hardcoded in names_a. I think it would be preferable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Made some more nits
app/models/pipeline_run.rb
Outdated
@@ -365,9 +419,15 @@ def db_load_contig_counts | |||
tax_level: tax_entry['tax_level'], | |||
contig_name: contig_name, | |||
count: count } | |||
if tax_entry['tax_level'].to_i == 1 # species |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TaxonCount:: TAX_LEVEL_SPECIES?
app/models/pipeline_run.rb
Outdated
end | ||
|
||
def contigs_fasta_s3_path | ||
return "#{postprocess_output_s3_path}/#{ASSEMBLED_CONTIGS_NAME}" if pipeline_version && pipeline_version.to_f >= 3.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we define ASSEMBLY_PIPELINE_VERSION = '3.1'.freeze
?
Validate names after group lanes for BaseSpace data
Description
Type of change
Test and Reproduce
Outline the steps to test or reproduce the PR here.
Impacted Areas in Application
List general components of the application that this PR will affect:
Which pages?
Specific components
Testing Script:
###Login Page
###Single Upload
###Batch Upload
###All Project Page
###Sample Details Page
###Report Page
Checklist: