-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
schema support for regulatory fusions
- Loading branch information
Showing
16 changed files
with
216 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
server/app/graphql/types/fusion/regulatory_fusion_type_type.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module Types::Fusion | ||
class RegulatoryFusionTypeType < Types::BaseEnum | ||
Constants::REGULATORY_FUSION_ENUM_TYPES.each do |(name, _)| | ||
value name.upcase, value: name | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
server/db/migrate/20250102170055_add_regulatory_fusion_types_enum.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
class AddRegulatoryFusionTypesEnum < ActiveRecord::Migration[7.1] | ||
def up | ||
create_enum :regulatory_fusion_types, Constants::REGULATORY_FUSION_TYPES.map(&:first) | ||
add_enum_value :fusion_partner_status, "regulatory" | ||
|
||
add_column :variant_types, :regulatory_fusion_type, :enum, enum_type: :regulatory_fusion_types, null: true | ||
add_column :fusions, :regulatory_fusion_type, :enum, enum_type: :regulatory_fusion_types, null: true | ||
add_index :variant_types, :regulatory_fusion_type | ||
|
||
Constants::REGULATORY_FUSION_TYPES.each do |(type, soid)| | ||
if soid.present? | ||
vt = VariantType.find_by!(soid: soid) | ||
vt.regulatory_fusion_type = type | ||
vt.save! | ||
end | ||
end | ||
end | ||
|
||
def down | ||
remove_column :variant_types, :regulatory_fusion_type | ||
remove_column :fusions, :regulatory_fusion_type | ||
execute <<-SQL | ||
DROP TYPE regulatory_fusion_types; | ||
SQL | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
braf_vhl_fusion: | ||
five_prime_gene: braf | ||
three_prime_gene: vhl | ||
five_prime_partner_status: known | ||
three_prime_partner_status: known | ||
regulatory_fusion_type: reg_enhancer | ||
|
||
braf_fusion: | ||
five_prime_gene: braf | ||
three_prime_gene: null | ||
five_prime_partner_status: known | ||
three_prime_partner_status: unknown | ||
regulatory_fusion_type: null | ||
|
||
vhl_fusion: | ||
five_prime_gene: null | ||
three_prime_gene: vhl | ||
five_prime_partner_status: unknown | ||
three_prime_partner_status: known | ||
regulatory_fusion_type: null | ||
|
||
regulatory_fusion: | ||
five_prime_gene: braf | ||
three_prime_gene: vhl | ||
five_prime_partner_status: regulatory | ||
three_prime_partner_status: known | ||
regulatory_fusion_type: reg_enhancer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.