Skip to content

Commit

Permalink
Merge pull request #1145 from griffithlab/civicpy
Browse files Browse the repository at this point in the history
Change top level genes/fusions/factors resolver to add configurable status filter
  • Loading branch information
acoffman authored Oct 30, 2024
2 parents fdc1a01 + 7286038 commit e8bb009
Show file tree
Hide file tree
Showing 11 changed files with 197 additions and 152 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
MolecularProfileConnection,
MolecularProfileMenuQueryVariables,
MolecularProfileMenuGQL,
MolecularProfileDisplayFilter,
AssociatedEvidenceStatusFilter,
} from '@app/generated/civic.apollo'
import { map, debounceTime, filter, startWith } from 'rxjs/operators'
import { Observable, Subject } from 'rxjs'
Expand All @@ -32,8 +32,8 @@ export class CvcMolecularProfilesMenuComponent implements OnInit {
loading$?: Observable<boolean>;

mpNameFilter: Maybe<string>
statusFilter: MolecularProfileDisplayFilter =
MolecularProfileDisplayFilter.All
statusFilter: AssociatedEvidenceStatusFilter =
AssociatedEvidenceStatusFilter.All

private debouncedQuery = new Subject<void>()
private result$!: Observable<ApolloQueryResult<MolecularProfileMenuQuery>>
Expand Down Expand Up @@ -91,7 +91,7 @@ export class CvcMolecularProfilesMenuComponent implements OnInit {
this.debouncedQuery.next()
}

onMolecularProfileStatusFilterChanged(filter: MolecularProfileDisplayFilter) {
onMolecularProfileStatusFilterChanged(filter: AssociatedEvidenceStatusFilter) {
this.queryRef$.refetch({
first: this.pageSize,
evidenceStatusFilter: filter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ query MolecularProfileMenu(
$last: Int
$before: String
$after: String
$evidenceStatusFilter: MolecularProfileDisplayFilter
$evidenceStatusFilter: AssociatedEvidenceStatusFilter
) {
molecularProfiles(
geneId: $geneId
Expand Down
33 changes: 17 additions & 16 deletions client/src/app/generated/civic.apollo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,17 @@ export enum AssertionType {
Prognostic = 'PROGNOSTIC'
}

export enum AssociatedEvidenceStatusFilter {
/** Apply no status filter to an entity in order to display all entities regardless of attached evidence status. */
All = 'ALL',
/** Apply filter to an entity to display only those which have at least one accepted associated evidence item. */
WithAccepted = 'WITH_ACCEPTED',
/** Apply filter to an entity to display only those which have at least one accepted or submitted associated evidence item. */
WithAcceptedOrSubmitted = 'WITH_ACCEPTED_OR_SUBMITTED',
/** Apply filter to an entity to display only those which have at least one submitted associated evidence item. */
WithSubmitted = 'WITH_SUBMITTED'
}

export enum BooleanOperator {
And = 'AND',
Or = 'OR'
Expand Down Expand Up @@ -3965,17 +3976,6 @@ export enum MolecularProfileDeprecationReasonMutationInput {
Other = 'OTHER'
}

export enum MolecularProfileDisplayFilter {
/** Display all molecular profiles regardless of attached evidence status. */
All = 'ALL',
/** Display only molecular profiles which have at least one accepted evidence item. */
WithAccepted = 'WITH_ACCEPTED',
/** Display only molecular profiles which have evidence in either an accepted or submitted state. */
WithAcceptedOrSubmitted = 'WITH_ACCEPTED_OR_SUBMITTED',
/** Display molecular profiles which have at least one submitted evidence item. */
WithSubmitted = 'WITH_SUBMITTED'
}

/** An edge in a connection. */
export type MolecularProfileEdge = {
__typename: 'MolecularProfileEdge';
Expand Down Expand Up @@ -5280,6 +5280,7 @@ export type QueryFactorArgs = {
export type QueryFactorsArgs = {
after?: InputMaybe<Scalars['String']['input']>;
before?: InputMaybe<Scalars['String']['input']>;
evidenceStatusFilter?: InputMaybe<AssociatedEvidenceStatusFilter>;
first?: InputMaybe<Scalars['Int']['input']>;
last?: InputMaybe<Scalars['Int']['input']>;
name?: InputMaybe<Array<Scalars['String']['input']>>;
Expand Down Expand Up @@ -5324,8 +5325,7 @@ export type QueryFusionArgs = {
export type QueryFusionsArgs = {
after?: InputMaybe<Scalars['String']['input']>;
before?: InputMaybe<Scalars['String']['input']>;
entrezIds?: InputMaybe<Array<Scalars['Int']['input']>>;
entrezSymbols?: InputMaybe<Array<Scalars['String']['input']>>;
evidenceStatusFilter?: InputMaybe<AssociatedEvidenceStatusFilter>;
first?: InputMaybe<Scalars['Int']['input']>;
genePartnerId?: InputMaybe<Scalars['Int']['input']>;
last?: InputMaybe<Scalars['Int']['input']>;
Expand All @@ -5343,6 +5343,7 @@ export type QueryGenesArgs = {
before?: InputMaybe<Scalars['String']['input']>;
entrezIds?: InputMaybe<Array<Scalars['Int']['input']>>;
entrezSymbols?: InputMaybe<Array<Scalars['String']['input']>>;
evidenceStatusFilter?: InputMaybe<AssociatedEvidenceStatusFilter>;
first?: InputMaybe<Scalars['Int']['input']>;
last?: InputMaybe<Scalars['Int']['input']>;
};
Expand All @@ -5357,7 +5358,7 @@ export type QueryMolecularProfilesArgs = {
after?: InputMaybe<Scalars['String']['input']>;
alleleRegistryId?: InputMaybe<Scalars['String']['input']>;
before?: InputMaybe<Scalars['String']['input']>;
evidenceStatusFilter?: InputMaybe<MolecularProfileDisplayFilter>;
evidenceStatusFilter?: InputMaybe<AssociatedEvidenceStatusFilter>;
featureId?: InputMaybe<Scalars['Int']['input']>;
first?: InputMaybe<Scalars['Int']['input']>;
geneId?: InputMaybe<Scalars['Int']['input']>;
Expand Down Expand Up @@ -8287,7 +8288,7 @@ export type MolecularProfileMenuQueryVariables = Exact<{
last?: InputMaybe<Scalars['Int']['input']>;
before?: InputMaybe<Scalars['String']['input']>;
after?: InputMaybe<Scalars['String']['input']>;
evidenceStatusFilter?: InputMaybe<MolecularProfileDisplayFilter>;
evidenceStatusFilter?: InputMaybe<AssociatedEvidenceStatusFilter>;
}>;


Expand Down Expand Up @@ -14472,7 +14473,7 @@ export const BrowseMolecularProfilesDocument = gql`
}
}
export const MolecularProfileMenuDocument = gql`
query MolecularProfileMenu($geneId: Int, $featureId: Int, $mpName: String, $first: Int, $last: Int, $before: String, $after: String, $evidenceStatusFilter: MolecularProfileDisplayFilter) {
query MolecularProfileMenu($geneId: Int, $featureId: Int, $mpName: String, $first: Int, $last: Int, $before: String, $after: String, $evidenceStatusFilter: AssociatedEvidenceStatusFilter) {
molecularProfiles(
geneId: $geneId
featureId: $featureId
Expand Down
65 changes: 35 additions & 30 deletions client/src/app/generated/server.model.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -796,6 +796,28 @@ enum AssertionType {
PROGNOSTIC
}

enum AssociatedEvidenceStatusFilter {
"""
Apply no status filter to an entity in order to display all entities regardless of attached evidence status.
"""
ALL

"""
Apply filter to an entity to display only those which have at least one accepted associated evidence item.
"""
WITH_ACCEPTED

"""
Apply filter to an entity to display only those which have at least one accepted or submitted associated evidence item.
"""
WITH_ACCEPTED_OR_SUBMITTED

"""
Apply filter to an entity to display only those which have at least one submitted associated evidence item.
"""
WITH_SUBMITTED
}

enum BooleanOperator {
AND
OR
Expand Down Expand Up @@ -6978,28 +7000,6 @@ enum MolecularProfileDeprecationReasonMutationInput {
OTHER
}

enum MolecularProfileDisplayFilter {
"""
Display all molecular profiles regardless of attached evidence status.
"""
ALL

"""
Display only molecular profiles which have at least one accepted evidence item.
"""
WITH_ACCEPTED

"""
Display only molecular profiles which have evidence in either an accepted or submitted state.
"""
WITH_ACCEPTED_OR_SUBMITTED

"""
Display molecular profiles which have at least one submitted evidence item.
"""
WITH_SUBMITTED
}

"""
An edge in a connection.
"""
Expand Down Expand Up @@ -8946,6 +8946,11 @@ type Query {
"""
before: String

"""
Limit factors by the status of attached evidence.
"""
evidenceStatusFilter: AssociatedEvidenceStatusFilter

"""
Returns the first _n_ elements from the list.
"""
Expand Down Expand Up @@ -9048,14 +9053,9 @@ type Query {
before: String

"""
List of Entrez Gene IDs to return results for
Limit fusions by the status of attached evidence.
"""
entrezIds: [Int!]

"""
List of Entrez Gene symbols to return results for
"""
entrezSymbols: [String!]
evidenceStatusFilter: AssociatedEvidenceStatusFilter

"""
Returns the first _n_ elements from the list.
Expand Down Expand Up @@ -9102,6 +9102,11 @@ type Query {
"""
entrezSymbols: [String!]

"""
Limit genes by the status of attached evidence.
"""
evidenceStatusFilter: AssociatedEvidenceStatusFilter

"""
Returns the first _n_ elements from the list.
"""
Expand Down Expand Up @@ -9140,7 +9145,7 @@ type Query {
"""
Limit molecular profiles by the status of attached evidence.
"""
evidenceStatusFilter: MolecularProfileDisplayFilter
evidenceStatusFilter: AssociatedEvidenceStatusFilter

"""
Filter molecular profiles to the CIViC ID of the feature(s) involved.
Expand Down
Loading

0 comments on commit e8bb009

Please sign in to comment.