-
Notifications
You must be signed in to change notification settings - Fork 4
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
Address issue #504 #507
base: main
Are you sure you want to change the base?
Address issue #504 #507
Conversation
Some imporvements probably needed
@dariober Changes looks good to me and works fine. If you don't want to use or we can access properties like this We might have to add after adding mapping make necessary change in
|
function convertFeatureAttributes( | ||
feature: SimpleFeatureSerializedNoId, | ||
): Record<string, string[]> { | ||
function convertFeatureAttributes(feature: Feature): Record<string, string[]> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add condition to filter attributes with undefined/null values
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unless I'm missing something, it seems enough to add source
and score
here:
Apollo3/packages/jbrowse-plugin-apollo/src/extensions/annotationFromJBrowseFeature.ts
Lines 60 to 71 in 572e33b
const defaultFields = new Set([ | |
'start', | |
'end', | |
'type', | |
'strand', | |
'refName', | |
'subfeatures', | |
'derived_features', | |
'phase', | |
'source', | |
'score', | |
]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense. Better to filter source and score here as they're getting added again in gff3ToAnnotationFeature.ts
.
Do we also need to filter attributes with undefined/null values ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If score or source are missing, they will not be included as attribute at all. There's a test here
Apollo3/packages/jbrowse-plugin-apollo/src/extensions/annotationFromJBrowseFeature.test.ts
Lines 96 to 97 in 572e33b
expect(af.attributes?.score).toBeUndefined() | |
expect(af.attributes?.gff_score).toBeUndefined() |
If I'm not mistaken, we should not end up with attributes with null/undefined values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, tested your recent changes and its working fine. Thanks
@@ -121,6 +121,9 @@ function convertFeatureAttributes( | |||
const newKey = isGFFReservedAttribute(key) ? gffToInternal[key] : key | |||
const existingVal = convertedAttributes[newKey] | |||
if (existingVal) { | |||
// if (JSON.stringify(existingVal) === JSON.stringify(val)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove comment
Some imporvements probably needed