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

Add support for additional ClinGen/ACMG code modifiers #882

Merged
merged 7 commits into from
Sep 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
(cvcOnModelChange)="props.change && props.change(field, $event)">
</cvc-entity-select>


<!-- <nz-select
[nzMode]="props.isMultiSelect ? 'multiple' : 'default'"
[nzCustomTemplate]="selectedTemplate"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ export class CvcAcmgCodeSelectField
else if (requiresAcmgCode) {
this.props.required = true
this.props.disabled = false
this.props.description = 'Please provide evidence criteria from the standards and guidelines for interpretation of sequence variants from ACMG/AMP in <a href="https://pubmed.ncbi.nlm.nih.gov/25741868/" target="_blank">Richards et. al. 2015</a>.',
this.props.description = 'Please provide evidence criteria from the standards and guidelines for interpretation of sequence variants from ACMG/AMP in <a href="https://pubmed.ncbi.nlm.nih.gov/25741868/" target="_blank">Richards et. al. 2015</a>. Review all codes and select each one that applies. If a code is not applied, it is inferred to not be met.',
this.props.extraType = 'description'
}
// field currently has a value, but state indicates no ACMG Code is required, or no type is provided && type is required, so reset field
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ export class CvcClingenCodeSelectField
} else {
this.exclusiveSelected = false
}
}
}
if(this.previousDescription && !this.exclusiveSelected) {
this.props.description = this.previousDescription
this.props.extraType = this.previousDescriptionType
Expand Down Expand Up @@ -235,7 +235,7 @@ export class CvcClingenCodeSelectField
else if (requiresClingenCode) {
this.props.required = true
this.props.disabled = false
this.props.description = 'Please provide the evidence classifications from the Standards for the classification of pathogenicity of somatic variants in cancer (oncogenicity) in <a href="https://pubmed.ncbi.nlm.nih.gov/25741868/" target="_blank">Horak et. al. 2022.</a>.'
this.props.description = 'Please provide the evidence classifications from the Standards for the classification of pathogenicity of somatic variants in cancer (oncogenicity) in <a href="https://pubmed.ncbi.nlm.nih.gov/25741868/" target="_blank">Horak et. al. 2022.</a>. Review all codes and select each one that applies. If a code is not applied, it is inferred to not be met.'
this.props.extraType = 'description'
}
// field currently has a value, but state indicates no ClinGen Code is required, or no type is provided && type is required, so reset field
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,29 @@
</nz-descriptions-item>

<!-- ACMG Codes -->
<nz-descriptions-item nzTitle="ACMG Codes">
<nz-descriptions-item [nzSpan]='2' [nzTitle]="acmgTitle">
<ng-template #acmgTitle>
ACMG Codes
<span nz-typography
nzType="secondary">
<i nz-icon
nzType="info-circle"
nz-tooltip
nzTooltipTitle="All codes are reviewed during acceptance. Absence of a code implies it is not met."
>
</i>
</span>
</ng-template>
<ng-container *ngIf="assertionRules.requiresAcmgCodes(assertion.assertionType); else valueNotApplicable">
<ng-container *ngIf="assertion.acmgCodes.length > 0">
<nz-tag
nz-tooltip
[nzTooltipTitle]="code.description"
*ngFor="let code of assertion.acmgCodes"
>{{ code.code }}</nz-tag
>
<cvc-tag-list>
<nz-tag
nz-tooltip
[nzTooltipTitle]="code.description"
*ngFor="let code of assertion.acmgCodes"
>{{ code.code }}</nz-tag
>
</cvc-tag-list>
</ng-container>
<ng-container *ngIf="assertion.acmgCodes.length == 0">
<span
Expand All @@ -116,15 +130,29 @@
</nz-descriptions-item>

<!-- ClinGen Codes -->
<nz-descriptions-item nzTitle="ClinGen/CGC/VICC Codes">
<nz-descriptions-item [nzSpan]='2' [nzTitle]="clingenTitle">
<ng-template #clingenTitle>
ClinGen/CGC/VICC Codes
<span nz-typography
nzType="secondary">
<i nz-icon
nzType="info-circle"
nz-tooltip
nzTooltipTitle="All codes are reviewed during acceptance. Absence of a code implies it is not met."
>
</i>
</span>
</ng-template>
<ng-container
*ngIf="assertionRules.requiresClingenCodes(assertion.assertionType); else valueNotApplicable">
<ng-container *ngIf="assertion.clingenCodes.length > 0">
<nz-tag
nz-tooltip
[nzTooltipTitle]="code.description"
*ngFor="let code of assertion.clingenCodes"
>{{ code.code }}</nz-tag>
<cvc-tag-list>
<nz-tag
nz-tooltip
[nzTooltipTitle]="code.description"
*ngFor="let code of assertion.clingenCodes"
>{{ code.code }}</nz-tag>
</cvc-tag-list>
</ng-container>
<ng-container *ngIf="assertion.clingenCodes.length == 0">
<span
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ nz-space-item {
.summary-block {
max-height: 200px;
overflow-y: auto;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import { startWith } from 'rxjs/operators'
import { pluck } from 'rxjs-etc/operators'
import { Observable } from 'rxjs'
import { AssertionState } from '@app/forms/config/states/assertion.state'
import { tag } from 'rxjs-spy/cjs/operators'

@Component({
selector: 'cvc-assertion-summary',
Expand Down
33 changes: 33 additions & 0 deletions server/app/admin/acmg_codes_admin.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
Trestle.resource(:acmg_codes) do
collection do
AcmgCode.all.order(code: :asc)
end

search do |q|
q ? collection.where("acmg_codes.code ILIKE ? OR acmg_codes.description ILIKE ?", "%#{q}%", "%#{q}%") : collection
end

remove_action :destroy, :new

menu do
item :acmg_codes, icon: "fas fa-project-diagram", priority: :last
end

scope :all

# Customize the table columns shown on the index view.
table do
column :code
column :description, truncate: false
end

# Customize the form fields shown on the new/edit views.
form do |code|
row do
col(sm: 2) { static_field :code }
end

text_area :description
end
end

33 changes: 33 additions & 0 deletions server/app/admin/clingen_codes_admin.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
Trestle.resource(:clingen_codes) do
collection do
ClingenCode.all.order(code: :asc)
end

search do |q|
q ? collection.where("clingen_codes.code ILIKE ? OR clingen_codes.description ILIKE ?", "%#{q}%", "%#{q}%") : collection
end

remove_action :destroy, :new

menu do
item :clingen_codes, icon: "fas fa-project-diagram", priority: :last
end

scope :all

# Customize the table columns shown on the index view.
table do
column :code
column :description, truncate: false
end

# Customize the form fields shown on the new/edit views.
form do |code|
row do
col(sm: 2) { static_field :code }
end

text_area :description
end
end

35 changes: 35 additions & 0 deletions server/db/migrate/20230830152401_add_new_codes.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
class AddNewCodes < ActiveRecord::Migration[6.1]
def up

#Add tiering for Clingen Codes. Issue#873
ClingenCode.where.not(code: ['OP3', 'OM3', 'OS3', 'N/A']).find_each do |code|
modifiers = [
'Very-strong',
'Strong',
'Moderate',
'Supporting',
]

if code.code =~ /VS\d/
modifiers.delete('Very-strong')
elsif code.code =~ /S\d/
modifiers.delete('Strong')
elsif code.code =~ /M\d/
modifiers.delete('Moderate')
elsif code.code =~ /P\d/
modifiers.delete('Supporting')
end

modifiers.each do |m|
ClingenCode.create!(code: "#{code.code}_#{m}", description: '')
end
end

ClingenCode.create!(code: "OS3_Very-strong", description: '')

end

def down
ClingenCode.where("code LIKE '%^_%' ESCAPE '^'").destroy_all
end
end
33 changes: 31 additions & 2 deletions server/db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 2023_06_22_140624) do
ActiveRecord::Schema.define(version: 2023_08_31_142739) do

# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
Expand Down Expand Up @@ -56,6 +56,31 @@
t.index ["blob_id", "variation_digest"], name: "index_active_storage_variant_records_uniqueness", unique: true
end

create_table "activities", force: :cascade do |t|
t.text "type", null: false
t.bigint "user_id", null: false
t.bigint "organization_id"
t.string "subject_type", null: false
t.bigint "subject_id", null: false
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.text "verbiage"
t.index ["organization_id"], name: "index_activities_on_organization_id"
t.index ["subject_type", "subject_id"], name: "index_activities_on_subject"
t.index ["type"], name: "index_activities_on_type"
t.index ["user_id"], name: "index_activities_on_user_id"
end

create_table "activity_linked_entities", force: :cascade do |t|
t.string "entity_type", null: false
t.bigint "entity_id", null: false
t.bigint "activity_id", null: false
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["activity_id"], name: "index_activity_linked_entities_on_activity_id"
t.index ["entity_type", "entity_id"], name: "index_activity_linked_entities_on_entity"
end

create_table "advanced_searches", id: :serial, force: :cascade do |t|
t.datetime "created_at"
t.datetime "updated_at"
Expand Down Expand Up @@ -358,6 +383,7 @@
t.text "user_role"
t.string "originating_object_type"
t.bigint "originating_object_id"
t.integer "activity_id"
t.index ["organization_id"], name: "index_events_on_organization_id"
t.index ["originating_object_id", "originating_object_type"], name: "idx_event_originating_obj"
t.index ["originating_object_type", "originating_object_id"], name: "index_events_on_originating_object"
Expand Down Expand Up @@ -643,11 +669,11 @@
t.text "journal"
t.string "full_journal_title"
t.text "title"
t.text "status", default: "fully curated", null: false
t.boolean "is_review"
t.integer "source_type", null: false
t.integer "asco_abstract_id"
t.text "asco_presenter"
t.boolean "fully_curated", default: false, null: false
t.index ["asco_abstract_id"], name: "index_sources_on_asco_abstract_id"
t.index ["asco_presenter"], name: "index_sources_on_asco_presenter"
t.index ["citation_id"], name: "index_sources_on_citation_id"
Expand Down Expand Up @@ -857,6 +883,8 @@
add_foreign_key "acmg_codes_assertions", "assertions"
add_foreign_key "active_storage_attachments", "active_storage_blobs", column: "blob_id"
add_foreign_key "active_storage_variant_records", "active_storage_blobs", column: "blob_id"
add_foreign_key "activities", "organizations"
add_foreign_key "activities", "users"
add_foreign_key "assertions", "nccn_guidelines"
add_foreign_key "assertions_clingen_codes", "assertions"
add_foreign_key "assertions_clingen_codes", "clingen_codes"
Expand All @@ -880,6 +908,7 @@
add_foreign_key "disease_aliases_diseases", "diseases"
add_foreign_key "domain_expert_tags", "users"
add_foreign_key "entity_mentions", "comments"
add_foreign_key "events", "activities"
add_foreign_key "events", "organizations"
add_foreign_key "events", "users", column: "originating_user_id"
add_foreign_key "evidence_items", "diseases"
Expand Down