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 ability to get parent ID in feature from features endpoint #357

Open
garrettjstevens opened this issue Feb 20, 2024 · 2 comments · May be fixed by #361
Open

Add ability to get parent ID in feature from features endpoint #357

garrettjstevens opened this issue Feb 20, 2024 · 2 comments · May be fixed by #361
Assignees

Comments

@garrettjstevens
Copy link
Contributor

From Havana, when they process the changes, they need the parent ID of a changed feature. This could possibly be added in packages/apollo-common/src/FeatureChange.ts.

@shashankbrgowda, could you expand a bit more on the use case for this?

@shashankbrgowda
Copy link
Contributor

We need to add parent id attribute when we process the change (Coordinate change / Attribute change etc.)
or retain the "Parent" field in the attributes which is present in gff, so that when we get feature its already available.

1	ensembl_havana	exon	177280412	177282422	.	+	.	Parent=transcript:ENST00000361539;Name=ENSE00001166070;constitutive=0;ensembl_end_phase=-1;ensembl_phase=2;exon_id=ENSE00001166070;rank=8;version=9

@garrettjstevens garrettjstevens changed the title Need parent ID of changed feature Add ability to get parent ID in feature from features endpoint Feb 21, 2024
@garrettjstevens
Copy link
Contributor Author

We're going to go the route of obtaining the parent ID from the endpoint call instead.

In packages/apollo-collaboration-server/src/features/features.controller.ts @Get(':featureid') endpoint, add the ability to have a URL parameter that requests that the parent ID be returned as well (e.g. /features/624ab4c0f8ac0187ed22b563?parentId=true).

In packages/apollo-collaboration-server/src/features/features.service.ts, first the parent feature is queried from the database and then if the requested feature is a child feature, it returns that sub-document of the parent feature. We will add an option if parentId is true and the requests feature is a child feature, then the parent ID is added to childFeature.attributes before returning it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants