From a2c7ca57f56024639a8cbe014e031bde896a3a15 Mon Sep 17 00:00:00 2001 From: Adam Coffman Date: Tue, 12 Apr 2022 17:31:49 -0500 Subject: [PATCH 1/8] correct handling of ref/var bases --- .../src/app/forms/variant-revise/variant-revise.form.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/client/src/app/forms/variant-revise/variant-revise.form.ts b/client/src/app/forms/variant-revise/variant-revise.form.ts index 4bfc5d42c..437631511 100644 --- a/client/src/app/forms/variant-revise/variant-revise.form.ts +++ b/client/src/app/forms/variant-revise/variant-revise.form.ts @@ -286,7 +286,7 @@ export class VariantReviseForm implements AfterViewInit, OnDestroy { type: 'cvc-ensembl-input', }, { - key: 'threePrimeCoordinates.referenceBases', + key: 'referenceBases', type: 'input', defaultValue: undefined, templateOptions: { @@ -299,7 +299,7 @@ export class VariantReviseForm implements AfterViewInit, OnDestroy { } }, { - key: 'threePrimeCoordinates.variantBases', + key: 'variantBases', type: 'input', defaultValue: undefined, templateOptions: { @@ -487,8 +487,8 @@ export class VariantReviseForm implements AfterViewInit, OnDestroy { ...variant, clinvarStatus: this.getClinvarStatus(variant.clinvarIds), clinvarIds: this.getClinvarIds(variant.clinvarIds), - referenceBases: variant.fivePrimeCoordinates?.referenceBases, - variantBases: variant.fivePrimeCoordinates?.variantBases, + referenceBases: variant.threePrimeCoordinates?.referenceBases, + variantBases: variant.threePrimeCoordinates?.variantBases, comment: this.formModel?.fields.comment, organization: this.formModel?.fields.organization, }, From c1fad5f9c743bf820ec6aee0b98f3d81eb7d60ec Mon Sep 17 00:00:00 2001 From: Susanna Kiwala Date: Tue, 12 Apr 2022 17:42:57 -0500 Subject: [PATCH 2/8] Fix transcript tag tooltip --- .../variants-detail/variants-summary/variants-summary.page.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/app/views/variants/variants-detail/variants-summary/variants-summary.page.html b/client/src/app/views/variants/variants-detail/variants-summary/variants-summary.page.html index 5562bad19..8d3158bb6 100644 --- a/client/src/app/views/variants/variants-detail/variants-summary/variants-summary.page.html +++ b/client/src/app/views/variants/variants-detail/variants-summary/variants-summary.page.html @@ -236,7 +236,7 @@ - {{ coords.representativeTranscript }} From 4cdcc14249a79f8d579c65acd3386ed66115e683 Mon Sep 17 00:00:00 2001 From: Susanna Kiwala Date: Wed, 13 Apr 2022 09:11:38 -0500 Subject: [PATCH 3/8] Fix second occurrence of incorrect tooltip --- .../variants-detail/variants-summary/variants-summary.page.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/app/views/variants/variants-detail/variants-summary/variants-summary.page.html b/client/src/app/views/variants/variants-detail/variants-summary/variants-summary.page.html index 8d3158bb6..46b0c2cf9 100644 --- a/client/src/app/views/variants/variants-detail/variants-summary/variants-summary.page.html +++ b/client/src/app/views/variants/variants-detail/variants-summary/variants-summary.page.html @@ -288,7 +288,7 @@ - {{ coords.representativeTranscript }} From 266aa6da29d7a6e6b97eb39507a4f5dbd8b3a904 Mon Sep 17 00:00:00 2001 From: Susanna Kiwala Date: Wed, 13 Apr 2022 09:30:53 -0500 Subject: [PATCH 4/8] Fix primary and secondary coordinates --- .../variant-revise/variant-revise.form.ts | 28 +++++----- .../variant-revise/variant-revise.query.gql | 4 +- client/src/app/generated/civic.apollo.ts | 20 +++---- .../app/generated/server.field-policies.ts | 6 +-- client/src/app/generated/server.model.graphql | 4 +- client/src/app/generated/server.schema.json | 48 ++++++++--------- .../variants-summary.page.html | 53 ++++++++----------- .../variants-summary.query.gql | 4 +- .../graphql/types/entities/variant_type.rb | 48 ++++++++++------- 9 files changed, 106 insertions(+), 109 deletions(-) diff --git a/client/src/app/forms/variant-revise/variant-revise.form.ts b/client/src/app/forms/variant-revise/variant-revise.form.ts index 437631511..003dd8a5f 100644 --- a/client/src/app/forms/variant-revise/variant-revise.form.ts +++ b/client/src/app/forms/variant-revise/variant-revise.form.ts @@ -70,8 +70,8 @@ interface FormModel { ensemblVersion?: number; hgvsDescriptions: string[]; variantTypes: FormVariantType[]; - fivePrimeCoordinates?: CoordinateFieldsFragment; - threePrimeCoordinates?: CoordinateFieldsFragment; + primaryCoordinates?: CoordinateFieldsFragment; + secondaryCoordinates?: CoordinateFieldsFragment; referenceBases: Maybe; variantBases: Maybe; comment?: string; @@ -312,7 +312,7 @@ export class VariantReviseForm implements AfterViewInit, OnDestroy { } }, { - key: 'threePrimeCoordinates.chromosome', + key: 'primaryCoordinates.chromosome', type: 'select', defaultValue: undefined, templateOptions: { @@ -323,7 +323,7 @@ export class VariantReviseForm implements AfterViewInit, OnDestroy { }, }, { - key: 'threePrimeCoordinates.start', + key: 'primaryCoordinates.start', type: 'input', templateOptions: { label: 'Start', @@ -335,7 +335,7 @@ export class VariantReviseForm implements AfterViewInit, OnDestroy { } }, { - key: 'threePrimeCoordinates.stop', + key: 'primaryCoordinates.stop', type: 'input', templateOptions: { label: 'Stop', @@ -347,7 +347,7 @@ export class VariantReviseForm implements AfterViewInit, OnDestroy { } }, { - key: 'threePrimeCoordinates.representativeTranscript', + key: 'primaryCoordinates.representativeTranscript', type: 'input', templateOptions: { label: 'Representative Transcript', @@ -358,7 +358,7 @@ export class VariantReviseForm implements AfterViewInit, OnDestroy { template: '

Secondary Coordinates

', }, { - key: 'fivePrimeCoordinates.chromosome', + key: 'secondaryCoordinates.chromosome', type: 'select', defaultValue: undefined, templateOptions: { @@ -370,7 +370,7 @@ export class VariantReviseForm implements AfterViewInit, OnDestroy { }, }, { - key: 'fivePrimeCoordinates.start', + key: 'secondaryCoordinates.start', type: 'input', templateOptions: { label: 'Start', @@ -381,7 +381,7 @@ export class VariantReviseForm implements AfterViewInit, OnDestroy { } }, { - key: 'fivePrimeCoordinates.stop', + key: 'secondaryCoordinates.stop', type: 'input', templateOptions: { label: 'Stop', @@ -392,7 +392,7 @@ export class VariantReviseForm implements AfterViewInit, OnDestroy { } }, { - key: 'fivePrimeCoordinates.representativeTranscript', + key: 'secondaryCoordinates.representativeTranscript', type: 'input', templateOptions: { label: 'Representative Transcript', @@ -487,8 +487,8 @@ export class VariantReviseForm implements AfterViewInit, OnDestroy { ...variant, clinvarStatus: this.getClinvarStatus(variant.clinvarIds), clinvarIds: this.getClinvarIds(variant.clinvarIds), - referenceBases: variant.threePrimeCoordinates?.referenceBases, - variantBases: variant.threePrimeCoordinates?.variantBases, + referenceBases: variant.primaryCoordinates?.referenceBases, + variantBases: variant.primaryCoordinates?.variantBases, comment: this.formModel?.fields.comment, organization: this.formModel?.fields.organization, }, @@ -534,8 +534,8 @@ export class VariantReviseForm implements AfterViewInit, OnDestroy { ensemblVersion: fmt.toNullableInput(fields.ensemblVersion), description: fmt.toNullableString(fields.description), clinvarIds: fmt.toClinvarInput(fields.clinvarIds, fields.clinvarStatus), - primaryCoordinates: fmt.toCoordinateInput(fields.threePrimeCoordinates), - secondaryCoordinates: fmt.toCoordinateInput(fields.fivePrimeCoordinates), + primaryCoordinates: fmt.toCoordinateInput(fields.primaryCoordinates), + secondaryCoordinates: fmt.toCoordinateInput(fields.secondaryCoordinates), referenceBases: fmt.toNullableString(fields.referenceBases), variantBases: fmt.toNullableString(fields.variantBases), referenceBuild: fmt.toNullableReferenceBuildInput(fields.referenceBuild), diff --git a/client/src/app/forms/variant-revise/variant-revise.query.gql b/client/src/app/forms/variant-revise/variant-revise.query.gql index 4336bda83..9fed25b90 100644 --- a/client/src/app/forms/variant-revise/variant-revise.query.gql +++ b/client/src/app/forms/variant-revise/variant-revise.query.gql @@ -29,10 +29,10 @@ fragment RevisableVariantFields on Variant { name soid } - fivePrimeCoordinates { + primaryCoordinates { ... CoordinateFields } - threePrimeCoordinates { + secondaryCoordinates { ... CoordinateFields } } diff --git a/client/src/app/generated/civic.apollo.ts b/client/src/app/generated/civic.apollo.ts index bff784a47..bcceeac9b 100644 --- a/client/src/app/generated/civic.apollo.ts +++ b/client/src/app/generated/civic.apollo.ts @@ -4096,7 +4096,6 @@ export type Variant = Commentable & EventOriginObject & EventSubject & Flaggable events: EventConnection; evidenceItems: EvidenceItemConnection; evidenceScore: Scalars['Float']; - fivePrimeCoordinates?: Maybe; flagged: Scalars['Boolean']; /** List and filter flags. */ flags: FlagConnection; @@ -4109,11 +4108,12 @@ export type Variant = Commentable & EventOriginObject & EventSubject & Flaggable link: Scalars['String']; myVariantInfo?: Maybe; name: Scalars['String']; + primaryCoordinates?: Maybe; referenceBuild?: Maybe; /** List and filter revisions. */ revisions: RevisionConnection; + secondaryCoordinates?: Maybe; sources: Array; - threePrimeCoordinates?: Maybe; variantAliases: Array; variantTypes: Array; }; @@ -6971,10 +6971,10 @@ export type RevisableVariantFieldsFragment = ( ), variantTypes: Array<( { __typename: 'VariantType' } & Pick - )>, fivePrimeCoordinates?: Maybe<( + )>, primaryCoordinates?: Maybe<( { __typename: 'Coordinate' } & CoordinateFieldsFragment - )>, threePrimeCoordinates?: Maybe<( + )>, secondaryCoordinates?: Maybe<( { __typename: 'Coordinate' } & CoordinateFieldsFragment )> } @@ -7946,10 +7946,10 @@ export type VariantSummaryFieldsFragment = ( )>, variantTypes: Array<( { __typename: 'VariantType' } & Pick - )>, fivePrimeCoordinates?: Maybe<( + )>, primaryCoordinates?: Maybe<( { __typename: 'Coordinate' } & Pick - )>, threePrimeCoordinates?: Maybe<( + )>, secondaryCoordinates?: Maybe<( { __typename: 'Coordinate' } & Pick )>, flags: ( @@ -9179,10 +9179,10 @@ export const RevisableVariantFieldsFragmentDoc = gql` name soid } - fivePrimeCoordinates { + primaryCoordinates { ...CoordinateFields } - threePrimeCoordinates { + secondaryCoordinates { ...CoordinateFields } } @@ -9878,7 +9878,7 @@ export const VariantSummaryFieldsFragmentDoc = gql` evidenceScore referenceBuild ensemblVersion - fivePrimeCoordinates { + primaryCoordinates { representativeTranscript chromosome start @@ -9886,7 +9886,7 @@ export const VariantSummaryFieldsFragmentDoc = gql` referenceBases variantBases } - threePrimeCoordinates { + secondaryCoordinates { representativeTranscript chromosome start diff --git a/client/src/app/generated/server.field-policies.ts b/client/src/app/generated/server.field-policies.ts index 140ac18c5..99adfedff 100644 --- a/client/src/app/generated/server.field-policies.ts +++ b/client/src/app/generated/server.field-policies.ts @@ -1274,7 +1274,7 @@ export type ValidationErrorsFieldPolicy = { genericErrors?: FieldPolicy | FieldReadFunction, validationErrors?: FieldPolicy | FieldReadFunction }; -export type VariantKeySpecifier = ('alleleRegistryId' | 'clinvarIds' | 'comments' | 'description' | 'ensemblVersion' | 'events' | 'evidenceItems' | 'evidenceScore' | 'fivePrimeCoordinates' | 'flagged' | 'flags' | 'gene' | 'hgvsDescriptions' | 'id' | 'lastAcceptedRevisionEvent' | 'lastCommentEvent' | 'lastSubmittedRevisionEvent' | 'link' | 'myVariantInfo' | 'name' | 'referenceBuild' | 'revisions' | 'sources' | 'threePrimeCoordinates' | 'variantAliases' | 'variantTypes' | VariantKeySpecifier)[]; +export type VariantKeySpecifier = ('alleleRegistryId' | 'clinvarIds' | 'comments' | 'description' | 'ensemblVersion' | 'events' | 'evidenceItems' | 'evidenceScore' | 'flagged' | 'flags' | 'gene' | 'hgvsDescriptions' | 'id' | 'lastAcceptedRevisionEvent' | 'lastCommentEvent' | 'lastSubmittedRevisionEvent' | 'link' | 'myVariantInfo' | 'name' | 'primaryCoordinates' | 'referenceBuild' | 'revisions' | 'secondaryCoordinates' | 'sources' | 'variantAliases' | 'variantTypes' | VariantKeySpecifier)[]; export type VariantFieldPolicy = { alleleRegistryId?: FieldPolicy | FieldReadFunction, clinvarIds?: FieldPolicy | FieldReadFunction, @@ -1284,7 +1284,6 @@ export type VariantFieldPolicy = { events?: FieldPolicy | FieldReadFunction, evidenceItems?: FieldPolicy | FieldReadFunction, evidenceScore?: FieldPolicy | FieldReadFunction, - fivePrimeCoordinates?: FieldPolicy | FieldReadFunction, flagged?: FieldPolicy | FieldReadFunction, flags?: FieldPolicy | FieldReadFunction, gene?: FieldPolicy | FieldReadFunction, @@ -1296,10 +1295,11 @@ export type VariantFieldPolicy = { link?: FieldPolicy | FieldReadFunction, myVariantInfo?: FieldPolicy | FieldReadFunction, name?: FieldPolicy | FieldReadFunction, + primaryCoordinates?: FieldPolicy | FieldReadFunction, referenceBuild?: FieldPolicy | FieldReadFunction, revisions?: FieldPolicy | FieldReadFunction, + secondaryCoordinates?: FieldPolicy | FieldReadFunction, sources?: FieldPolicy | FieldReadFunction, - threePrimeCoordinates?: FieldPolicy | FieldReadFunction, variantAliases?: FieldPolicy | FieldReadFunction, variantTypes?: FieldPolicy | FieldReadFunction }; diff --git a/client/src/app/generated/server.model.graphql b/client/src/app/generated/server.model.graphql index 23231ec1f..c3d099956 100644 --- a/client/src/app/generated/server.model.graphql +++ b/client/src/app/generated/server.model.graphql @@ -6760,7 +6760,6 @@ type Variant implements Commentable & EventOriginObject & EventSubject & Flaggab last: Int ): EvidenceItemConnection! evidenceScore: Float! - fivePrimeCoordinates: Coordinate flagged: Boolean! """ @@ -6816,6 +6815,7 @@ type Variant implements Commentable & EventOriginObject & EventSubject & Flaggab link: String! myVariantInfo: MyVariantInfo name: String! + primaryCoordinates: Coordinate referenceBuild: ReferenceBuild """ @@ -6867,8 +6867,8 @@ type Variant implements Commentable & EventOriginObject & EventSubject & Flaggab """ status: RevisionStatus ): RevisionConnection! + secondaryCoordinates: Coordinate sources: [Source!]! - threePrimeCoordinates: Coordinate variantAliases: [String!]! variantTypes: [VariantType!]! } diff --git a/client/src/app/generated/server.schema.json b/client/src/app/generated/server.schema.json index aec02762b..26110999f 100644 --- a/client/src/app/generated/server.schema.json +++ b/client/src/app/generated/server.schema.json @@ -28967,18 +28967,6 @@ "isDeprecated": false, "deprecationReason": null }, - { - "name": "fivePrimeCoordinates", - "description": null, - "args": [], - "type": { - "kind": "OBJECT", - "name": "Coordinate", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, { "name": "flagged", "description": null, @@ -29244,6 +29232,18 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "primaryCoordinates", + "description": null, + "args": [], + "type": { + "kind": "OBJECT", + "name": "Coordinate", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "referenceBuild", "description": null, @@ -29381,6 +29381,18 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "secondaryCoordinates", + "description": null, + "args": [], + "type": { + "kind": "OBJECT", + "name": "Coordinate", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "sources", "description": null, @@ -29405,18 +29417,6 @@ "isDeprecated": false, "deprecationReason": null }, - { - "name": "threePrimeCoordinates", - "description": null, - "args": [], - "type": { - "kind": "OBJECT", - "name": "Coordinate", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, { "name": "variantAliases", "description": null, diff --git a/client/src/app/views/variants/variants-detail/variants-summary/variants-summary.page.html b/client/src/app/views/variants/variants-detail/variants-summary/variants-summary.page.html index 5562bad19..e7826745a 100644 --- a/client/src/app/views/variants/variants-detail/variants-summary/variants-summary.page.html +++ b/client/src/app/views/variants/variants-detail/variants-summary/variants-summary.page.html @@ -194,10 +194,10 @@ - - - + + - - - {{ coords.referenceBases | ifEmpty: '--'}} - - - - - {{ coords.variantBases | ifEmpty: '--'}} - + + + + {{ coords.referenceBases | ifEmpty: '--'}} + + + + + {{ coords.variantBases | ifEmpty: '--'}} + + - - - - + + - - - {{ coords.referenceBases | ifEmpty: '--'}} - - - - - {{ coords.variantBases | ifEmpty: '--'}} - - diff --git a/client/src/app/views/variants/variants-detail/variants-summary/variants-summary.query.gql b/client/src/app/views/variants/variants-detail/variants-summary/variants-summary.query.gql index e8b91fabd..966cafe15 100644 --- a/client/src/app/views/variants/variants-detail/variants-summary/variants-summary.query.gql +++ b/client/src/app/views/variants/variants-detail/variants-summary/variants-summary.query.gql @@ -35,7 +35,7 @@ fragment VariantSummaryFields on Variant { evidenceScore referenceBuild ensemblVersion - fivePrimeCoordinates { + primaryCoordinates { representativeTranscript chromosome start @@ -43,7 +43,7 @@ fragment VariantSummaryFields on Variant { referenceBases variantBases } - threePrimeCoordinates { + secondaryCoordinates { representativeTranscript chromosome start diff --git a/server/app/graphql/types/entities/variant_type.rb b/server/app/graphql/types/entities/variant_type.rb index fe906a261..138c8da15 100644 --- a/server/app/graphql/types/entities/variant_type.rb +++ b/server/app/graphql/types/entities/variant_type.rb @@ -16,8 +16,8 @@ class VariantType < Types::BaseObject field :sources, [Types::Entities::SourceType], null: false field :reference_build, Types::ReferenceBuildType, null: true field :ensembl_version, Int, null: true - field :five_prime_coordinates, Types::Entities::CoordinateType, null: true - field :three_prime_coordinates, Types::Entities::CoordinateType, null: true + field :primary_coordinates, Types::Entities::CoordinateType, null: true + field :secondary_coordinates, Types::Entities::CoordinateType, null: true field :allele_registry_id, String, null: true field :evidence_score, Float, null: false field :variant_aliases, [String], null: false @@ -35,26 +35,34 @@ def evidence_items Loaders::AssociationLoader.for(Variant, :evidence_items).load(object) end - def three_prime_coordinates - { - representative_transcript: object.representative_transcript, - chromosome: object.chromosome, - start: object.start, - stop: object.stop, - reference_bases: object.reference_bases, - variant_bases: object.variant_bases - } + def primary_coordinates + if (object.representative_transcript.blank? && object.chromosome.blank? && object.start.blank? && object.stop.blank?) + return nil + else + return { + representative_transcript: object.representative_transcript, + chromosome: object.chromosome, + start: object.start, + stop: object.stop, + reference_bases: object.reference_bases, + variant_bases: object.variant_bases + } + end end - def five_prime_coordinates - { - representative_transcript: object.representative_transcript2, - chromosome: object.chromosome2, - start: object.start2, - stop: object.stop2, - reference_bases: nil, - variant_bases: nil, - } + def secondary_coordinates + if (object.representative_transcript2.blank? && object.chromosome2.blank? && object.start2.blank? && object.stop2.blank?) + return nil + else + return { + representative_transcript: object.representative_transcript2, + chromosome: object.chromosome2, + start: object.start2, + stop: object.stop2, + reference_bases: nil, + variant_bases: nil, + } + end end def evidence_score From 57661b4326534c347f2b7a4b4208e94c066a3b43 Mon Sep 17 00:00:00 2001 From: Susanna Kiwala Date: Wed, 13 Apr 2022 09:38:31 -0500 Subject: [PATCH 5/8] Move referenceBases and variantBases form the chromosomes to the variant --- .../variant-revise/variant-revise.form.ts | 4 +- .../variant-revise/variant-revise.query.gql | 4 +- client/src/app/generated/civic.apollo.ts | 24 ++++---- .../app/generated/server.field-policies.ts | 10 ++-- client/src/app/generated/server.model.graphql | 4 +- client/src/app/generated/server.schema.json | 56 +++++++++++-------- .../variants-summary.page.html | 4 +- .../variants-summary.query.gql | 6 +- .../graphql/types/entities/coordinate_type.rb | 2 - .../graphql/types/entities/variant_type.rb | 6 +- 10 files changed, 60 insertions(+), 60 deletions(-) diff --git a/client/src/app/forms/variant-revise/variant-revise.form.ts b/client/src/app/forms/variant-revise/variant-revise.form.ts index 003dd8a5f..5f341a69a 100644 --- a/client/src/app/forms/variant-revise/variant-revise.form.ts +++ b/client/src/app/forms/variant-revise/variant-revise.form.ts @@ -487,8 +487,8 @@ export class VariantReviseForm implements AfterViewInit, OnDestroy { ...variant, clinvarStatus: this.getClinvarStatus(variant.clinvarIds), clinvarIds: this.getClinvarIds(variant.clinvarIds), - referenceBases: variant.primaryCoordinates?.referenceBases, - variantBases: variant.primaryCoordinates?.variantBases, + referenceBases: variant.referenceBases, + variantBases: variant.variantBases, comment: this.formModel?.fields.comment, organization: this.formModel?.fields.organization, }, diff --git a/client/src/app/forms/variant-revise/variant-revise.query.gql b/client/src/app/forms/variant-revise/variant-revise.query.gql index 9fed25b90..1bbf65f4a 100644 --- a/client/src/app/forms/variant-revise/variant-revise.query.gql +++ b/client/src/app/forms/variant-revise/variant-revise.query.gql @@ -35,15 +35,15 @@ fragment RevisableVariantFields on Variant { secondaryCoordinates { ... CoordinateFields } + referenceBases + variantBases } fragment CoordinateFields on Coordinate { chromosome - referenceBases representativeTranscript start stop - variantBases } mutation SuggestVariantRevision($input: SuggestVariantRevisionInput!) { diff --git a/client/src/app/generated/civic.apollo.ts b/client/src/app/generated/civic.apollo.ts index bcceeac9b..35674d1bd 100644 --- a/client/src/app/generated/civic.apollo.ts +++ b/client/src/app/generated/civic.apollo.ts @@ -963,11 +963,9 @@ export type Contribution = { export type Coordinate = { __typename: 'Coordinate'; chromosome?: Maybe; - referenceBases?: Maybe; representativeTranscript?: Maybe; start?: Maybe; stop?: Maybe; - variantBases?: Maybe; }; export type CoordinateInput = { @@ -4109,12 +4107,14 @@ export type Variant = Commentable & EventOriginObject & EventSubject & Flaggable myVariantInfo?: Maybe; name: Scalars['String']; primaryCoordinates?: Maybe; + referenceBases: Scalars['String']; referenceBuild?: Maybe; /** List and filter revisions. */ revisions: RevisionConnection; secondaryCoordinates?: Maybe; sources: Array; variantAliases: Array; + variantBases: Scalars['String']; variantTypes: Array; }; @@ -6961,7 +6961,7 @@ export type VariantRevisableFieldsQuery = ( export type RevisableVariantFieldsFragment = ( { __typename: 'Variant' } - & Pick + & Pick & { sources: Array<( { __typename: 'Source' } & Pick @@ -6982,7 +6982,7 @@ export type RevisableVariantFieldsFragment = ( export type CoordinateFieldsFragment = ( { __typename: 'Coordinate' } - & Pick + & Pick ); export type SuggestVariantRevisionMutationVariables = Exact<{ @@ -7936,7 +7936,7 @@ export type VariantSummaryQuery = ( export type VariantSummaryFieldsFragment = ( { __typename: 'Variant' } - & Pick + & Pick & { gene: ( { __typename: 'Gene' } & Pick @@ -7948,10 +7948,10 @@ export type VariantSummaryFieldsFragment = ( & Pick )>, primaryCoordinates?: Maybe<( { __typename: 'Coordinate' } - & Pick + & Pick )>, secondaryCoordinates?: Maybe<( { __typename: 'Coordinate' } - & Pick + & Pick )>, flags: ( { __typename: 'FlagConnection' } & Pick @@ -9146,11 +9146,9 @@ export const SubmittableVariantGroupFieldsFragmentDoc = gql` export const CoordinateFieldsFragmentDoc = gql` fragment CoordinateFields on Coordinate { chromosome - referenceBases representativeTranscript start stop - variantBases } `; export const RevisableVariantFieldsFragmentDoc = gql` @@ -9185,6 +9183,8 @@ export const RevisableVariantFieldsFragmentDoc = gql` secondaryCoordinates { ...CoordinateFields } + referenceBases + variantBases } ${CoordinateFieldsFragmentDoc}`; export const AssertionDetailFieldsFragmentDoc = gql` @@ -9883,17 +9883,15 @@ export const VariantSummaryFieldsFragmentDoc = gql` chromosome start stop - referenceBases - variantBases } secondaryCoordinates { representativeTranscript chromosome start stop - referenceBases - variantBases } + referenceBases + variantBases flags(state: OPEN) { totalCount } diff --git a/client/src/app/generated/server.field-policies.ts b/client/src/app/generated/server.field-policies.ts index 99adfedff..b0f1fe699 100644 --- a/client/src/app/generated/server.field-policies.ts +++ b/client/src/app/generated/server.field-policies.ts @@ -431,14 +431,12 @@ export type ContributionFieldPolicy = { action?: FieldPolicy | FieldReadFunction, count?: FieldPolicy | FieldReadFunction }; -export type CoordinateKeySpecifier = ('chromosome' | 'referenceBases' | 'representativeTranscript' | 'start' | 'stop' | 'variantBases' | CoordinateKeySpecifier)[]; +export type CoordinateKeySpecifier = ('chromosome' | 'representativeTranscript' | 'start' | 'stop' | CoordinateKeySpecifier)[]; export type CoordinateFieldPolicy = { chromosome?: FieldPolicy | FieldReadFunction, - referenceBases?: FieldPolicy | FieldReadFunction, representativeTranscript?: FieldPolicy | FieldReadFunction, start?: FieldPolicy | FieldReadFunction, - stop?: FieldPolicy | FieldReadFunction, - variantBases?: FieldPolicy | FieldReadFunction + stop?: FieldPolicy | FieldReadFunction }; export type CountryKeySpecifier = ('id' | 'iso' | 'name' | CountryKeySpecifier)[]; export type CountryFieldPolicy = { @@ -1274,7 +1272,7 @@ export type ValidationErrorsFieldPolicy = { genericErrors?: FieldPolicy | FieldReadFunction, validationErrors?: FieldPolicy | FieldReadFunction }; -export type VariantKeySpecifier = ('alleleRegistryId' | 'clinvarIds' | 'comments' | 'description' | 'ensemblVersion' | 'events' | 'evidenceItems' | 'evidenceScore' | 'flagged' | 'flags' | 'gene' | 'hgvsDescriptions' | 'id' | 'lastAcceptedRevisionEvent' | 'lastCommentEvent' | 'lastSubmittedRevisionEvent' | 'link' | 'myVariantInfo' | 'name' | 'primaryCoordinates' | 'referenceBuild' | 'revisions' | 'secondaryCoordinates' | 'sources' | 'variantAliases' | 'variantTypes' | VariantKeySpecifier)[]; +export type VariantKeySpecifier = ('alleleRegistryId' | 'clinvarIds' | 'comments' | 'description' | 'ensemblVersion' | 'events' | 'evidenceItems' | 'evidenceScore' | 'flagged' | 'flags' | 'gene' | 'hgvsDescriptions' | 'id' | 'lastAcceptedRevisionEvent' | 'lastCommentEvent' | 'lastSubmittedRevisionEvent' | 'link' | 'myVariantInfo' | 'name' | 'primaryCoordinates' | 'referenceBases' | 'referenceBuild' | 'revisions' | 'secondaryCoordinates' | 'sources' | 'variantAliases' | 'variantBases' | 'variantTypes' | VariantKeySpecifier)[]; export type VariantFieldPolicy = { alleleRegistryId?: FieldPolicy | FieldReadFunction, clinvarIds?: FieldPolicy | FieldReadFunction, @@ -1296,11 +1294,13 @@ export type VariantFieldPolicy = { myVariantInfo?: FieldPolicy | FieldReadFunction, name?: FieldPolicy | FieldReadFunction, primaryCoordinates?: FieldPolicy | FieldReadFunction, + referenceBases?: FieldPolicy | FieldReadFunction, referenceBuild?: FieldPolicy | FieldReadFunction, revisions?: FieldPolicy | FieldReadFunction, secondaryCoordinates?: FieldPolicy | FieldReadFunction, sources?: FieldPolicy | FieldReadFunction, variantAliases?: FieldPolicy | FieldReadFunction, + variantBases?: FieldPolicy | FieldReadFunction, variantTypes?: FieldPolicy | FieldReadFunction }; export type VariantAliasKeySpecifier = ('name' | VariantAliasKeySpecifier)[]; diff --git a/client/src/app/generated/server.model.graphql b/client/src/app/generated/server.model.graphql index c3d099956..14a0223a4 100644 --- a/client/src/app/generated/server.model.graphql +++ b/client/src/app/generated/server.model.graphql @@ -1543,11 +1543,9 @@ type Contribution { type Coordinate { chromosome: String - referenceBases: String representativeTranscript: String start: Int stop: Int - variantBases: String } input CoordinateInput { @@ -6816,6 +6814,7 @@ type Variant implements Commentable & EventOriginObject & EventSubject & Flaggab myVariantInfo: MyVariantInfo name: String! primaryCoordinates: Coordinate + referenceBases: String! referenceBuild: ReferenceBuild """ @@ -6870,6 +6869,7 @@ type Variant implements Commentable & EventOriginObject & EventSubject & Flaggab secondaryCoordinates: Coordinate sources: [Source!]! variantAliases: [String!]! + variantBases: String! variantTypes: [VariantType!]! } diff --git a/client/src/app/generated/server.schema.json b/client/src/app/generated/server.schema.json index 26110999f..bec1844fd 100644 --- a/client/src/app/generated/server.schema.json +++ b/client/src/app/generated/server.schema.json @@ -7277,18 +7277,6 @@ "isDeprecated": false, "deprecationReason": null }, - { - "name": "referenceBases", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, { "name": "representativeTranscript", "description": null, @@ -7324,18 +7312,6 @@ }, "isDeprecated": false, "deprecationReason": null - }, - { - "name": "variantBases", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null } ], "inputFields": null, @@ -29244,6 +29220,22 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "referenceBases", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "referenceBuild", "description": null, @@ -29441,6 +29433,22 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "variantBases", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "variantTypes", "description": null, diff --git a/client/src/app/views/variants/variants-detail/variants-summary/variants-summary.page.html b/client/src/app/views/variants/variants-detail/variants-summary/variants-summary.page.html index e7826745a..103a0f363 100644 --- a/client/src/app/views/variants/variants-detail/variants-summary/variants-summary.page.html +++ b/client/src/app/views/variants/variants-detail/variants-summary/variants-summary.page.html @@ -225,13 +225,13 @@ - {{ coords.referenceBases | ifEmpty: '--'}} + {{ variant.referenceBases | ifEmpty: '--'}} - {{ coords.variantBases | ifEmpty: '--'}} + {{ variant.variantBases | ifEmpty: '--'}} diff --git a/client/src/app/views/variants/variants-detail/variants-summary/variants-summary.query.gql b/client/src/app/views/variants/variants-detail/variants-summary/variants-summary.query.gql index 966cafe15..f7876d963 100644 --- a/client/src/app/views/variants/variants-detail/variants-summary/variants-summary.query.gql +++ b/client/src/app/views/variants/variants-detail/variants-summary/variants-summary.query.gql @@ -40,17 +40,15 @@ fragment VariantSummaryFields on Variant { chromosome start stop - referenceBases - variantBases } secondaryCoordinates { representativeTranscript chromosome start stop - referenceBases - variantBases } + referenceBases + variantBases flags(state: OPEN) { totalCount } diff --git a/server/app/graphql/types/entities/coordinate_type.rb b/server/app/graphql/types/entities/coordinate_type.rb index 9ecffccf1..969e3612f 100644 --- a/server/app/graphql/types/entities/coordinate_type.rb +++ b/server/app/graphql/types/entities/coordinate_type.rb @@ -4,7 +4,5 @@ class CoordinateType < Types::BaseObject field :chromosome, String, null: true field :start, Int, null: true field :stop, Int, null: true - field :reference_bases, String, null: true - field :variant_bases, String, null: true end end diff --git a/server/app/graphql/types/entities/variant_type.rb b/server/app/graphql/types/entities/variant_type.rb index 138c8da15..3cfe492c5 100644 --- a/server/app/graphql/types/entities/variant_type.rb +++ b/server/app/graphql/types/entities/variant_type.rb @@ -18,6 +18,8 @@ class VariantType < Types::BaseObject field :ensembl_version, Int, null: true field :primary_coordinates, Types::Entities::CoordinateType, null: true field :secondary_coordinates, Types::Entities::CoordinateType, null: true + field :reference_bases, String, null: false + field :variant_bases, String, null: false field :allele_registry_id, String, null: true field :evidence_score, Float, null: false field :variant_aliases, [String], null: false @@ -44,8 +46,6 @@ def primary_coordinates chromosome: object.chromosome, start: object.start, stop: object.stop, - reference_bases: object.reference_bases, - variant_bases: object.variant_bases } end end @@ -59,8 +59,6 @@ def secondary_coordinates chromosome: object.chromosome2, start: object.start2, stop: object.stop2, - reference_bases: nil, - variant_bases: nil, } end end From dba31c496c678c90e4904436128b26eab3881428 Mon Sep 17 00:00:00 2001 From: Susanna Kiwala Date: Wed, 13 Apr 2022 10:44:44 -0500 Subject: [PATCH 6/8] Fix validator error --- .../app/graphql/resolvers/validate_revisions_for_acceptance.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/server/app/graphql/resolvers/validate_revisions_for_acceptance.rb b/server/app/graphql/resolvers/validate_revisions_for_acceptance.rb index 0c04ba4bf..57df18533 100644 --- a/server/app/graphql/resolvers/validate_revisions_for_acceptance.rb +++ b/server/app/graphql/resolvers/validate_revisions_for_acceptance.rb @@ -69,6 +69,7 @@ def resolve(revision_ids:) end if !subject.valid? subject.errors.each do |attribute, message| + attribute = attribute.to_s if attribute.ends_with?("_ids") formatted_attribute = attribute.singularize.humanize.pluralize else From 4c79113fea0e03ff2a864150631f5ab406f41a41 Mon Sep 17 00:00:00 2001 From: Thomas Mooney Date: Wed, 13 Apr 2022 11:56:07 -0500 Subject: [PATCH 7/8] Consistent capitalization of "CIViC". --- client/src/app/generated/server.model.graphql | 2 +- client/src/app/generated/server.schema.json | 2 +- client/src/app/views/pages/pages-help/pages-help.page.html | 4 ++-- docs/config.yml | 2 +- server/app/graphql/mutations/add_remote_citation.rb | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/client/src/app/generated/server.model.graphql b/client/src/app/generated/server.model.graphql index 23231ec1f..667bf96aa 100644 --- a/client/src/app/generated/server.model.graphql +++ b/client/src/app/generated/server.model.graphql @@ -3094,7 +3094,7 @@ type Mutation { ): AddDrugPayload """ - Add a stub record for an external source that is not yet in CiVIC. + Add a stub record for an external source that is not yet in CIViC. This is for adding a new Source inline while performing other curation activities such as adding new evidence items and is distinct from suggesting a source for curation. """ diff --git a/client/src/app/generated/server.schema.json b/client/src/app/generated/server.schema.json index aec02762b..4e6554cdd 100644 --- a/client/src/app/generated/server.schema.json +++ b/client/src/app/generated/server.schema.json @@ -14116,7 +14116,7 @@ }, { "name": "addRemoteCitation", - "description": "Add a stub record for an external source that is not yet in CiVIC.\nThis is for adding a new Source inline while performing other curation activities\nsuch as adding new evidence items and is distinct from suggesting a source for curation.\n", + "description": "Add a stub record for an external source that is not yet in CIViC.\nThis is for adding a new Source inline while performing other curation activities\nsuch as adding new evidence items and is distinct from suggesting a source for curation.\n", "args": [ { "name": "input", diff --git a/client/src/app/views/pages/pages-help/pages-help.page.html b/client/src/app/views/pages/pages-help/pages-help.page.html index 8d9c2405f..bc8c9dde4 100644 --- a/client/src/app/views/pages/pages-help/pages-help.page.html +++ b/client/src/app/views/pages/pages-help/pages-help.page.html @@ -56,8 +56,8 @@ - Please follow our twitter account @CIVICdb. + Please follow our Twitter account @CIViCdb. diff --git a/docs/config.yml b/docs/config.yml index 32f9cb818..16de6680c 100644 --- a/docs/config.yml +++ b/docs/config.yml @@ -4,7 +4,7 @@ introspection: schemaFile: ./client/src/app/generated/server.model.graphql info: - title: CiVIC 2 API Documentation + title: CIViC 2 API Documentation description: Documentation for the CIViC GraphQL API contact: name: The CIViC Development Team diff --git a/server/app/graphql/mutations/add_remote_citation.rb b/server/app/graphql/mutations/add_remote_citation.rb index 291716511..56695d0b8 100644 --- a/server/app/graphql/mutations/add_remote_citation.rb +++ b/server/app/graphql/mutations/add_remote_citation.rb @@ -1,6 +1,6 @@ class Mutations::AddRemoteCitation < Mutations::BaseMutation description <<~DOC - Add a stub record for an external source that is not yet in CiVIC. + Add a stub record for an external source that is not yet in CIViC. This is for adding a new Source inline while performing other curation activities such as adding new evidence items and is distinct from suggesting a source for curation. DOC From 7eacc23be67a72c47ee3cc18dd817a4f025c19d6 Mon Sep 17 00:00:00 2001 From: Susanna Kiwala Date: Wed, 13 Apr 2022 12:05:49 -0500 Subject: [PATCH 8/8] Ensure that ready? on RejectRevision returns true at the end --- server/app/graphql/mutations/reject_revisions.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/server/app/graphql/mutations/reject_revisions.rb b/server/app/graphql/mutations/reject_revisions.rb index 911e7cf78..75b81e567 100644 --- a/server/app/graphql/mutations/reject_revisions.rb +++ b/server/app/graphql/mutations/reject_revisions.rb @@ -39,11 +39,10 @@ def ready?(organization_id: nil, ids: nil, revision_set_id: nil, **_) @revisions = Revision.where(revisionset_id: revision_set_id, status: 'new') if revisions.count == 0 raise GraphQL::ExecutionError, "Revisions with status 'new' in revision_set_id #{revision_set_id} don't exist." - else end - - return true end + + return true end def authorized?(organization_id: nil, **_)