Skip to content

Commit

Permalink
Merge branch 'main' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
acoffman committed Feb 10, 2025
2 parents 9428375 + 99ef5a0 commit 04bcd8d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
4 changes: 1 addition & 3 deletions server/app/graphql/types/queries/typeahead_queries.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,13 @@ def variants_typeahead(query_term:, feature_id: nil)
def disease_typeahead(query_term:)
base_query = Disease.where(deprecated: false)
results = base_query.where("diseases.name ILIKE ?", "%#{query_term}%")
.or(base_query.where("diseases.doid ILIKE ?", "#{query_term}%"))
.or(base_query.where("diseases.doid ILIKE ?", "#{query_term.gsub(/DOID:/i, "")}%"))
.order("LENGTH(diseases.name) ASC")
.limit(10)
if results.size < 10
secondary_results = base_query.eager_load(:disease_aliases)
.where("disease_aliases.name ILIKE ?", "%#{query_term}%")
.where.not(id: results.select('id'))
.order("LENGTH(diseases.name) ASC")
.distinct
.limit(10-results.size)
return results + secondary_results
Expand All @@ -110,7 +109,6 @@ def therapy_typeahead(query_term:)
tertiary_results = base_query.eager_load(:therapy_aliases)
.where("therapy_aliases.name ILIKE ?", "%#{query_term}%")
.where.not(id: results.select('id') + secondary_results.select('id'))
.order("LENGTH(therapies.name) ASC")
.distinct
.limit(10-results.size)

Expand Down
9 changes: 9 additions & 0 deletions server/app/jobs/populate_fusion_coordinates.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,19 @@ def perform(variant)
end

if variant.fusion.five_prime_partner_status == 'known'
if variant.five_prime_end_exon_coordinates.representative_transcript.blank?
return
end

populate_coords(variant.five_prime_end_exon_coordinates, variant.five_prime_start_exon_coordinates)
populate_representative_coordinates(variant.five_prime_coordinates, variant.five_prime_start_exon_coordinates, variant.five_prime_end_exon_coordinates)
end

if variant.fusion.three_prime_partner_status == 'known'
if variant.three_prime_start_exon_coordinates.representative_transcript.blank?
return
end

populate_coords(variant.three_prime_start_exon_coordinates, variant.three_prime_end_exon_coordinates)
populate_representative_coordinates(variant.three_prime_coordinates, variant.three_prime_start_exon_coordinates, variant.three_prime_end_exon_coordinates)
end
Expand Down
8 changes: 4 additions & 4 deletions server/app/models/variants/fusion_variant.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ def forbidden_fields
]
end

def on_revision_accepted
PopulateFusionCoordinates.perform_later(self)
end

private
def construct_five_prime_name(name_type:)
construct_partner_name(
Expand Down Expand Up @@ -157,9 +161,5 @@ def populate_coordinates
PopulateFusionCoordinates.perform_later(self)
end
end

def on_revision_accepted
PopulateFusionCoordinates.perform_later(self)
end
end
end

0 comments on commit 04bcd8d

Please # to comment.