-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tkakar/cat 946 map ensemble ids (#1970)
Co-authored-by: Mark Keller <7525285+keller-mark@users.noreply.github.com>
- Loading branch information
1 parent
5503589
commit ffa8d5f
Showing
29 changed files
with
336 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
"@vitessce/feature-list": patch | ||
"@vitessce/heatmap": patch | ||
"@vitessce/tooltip": patch | ||
"@vitessce/vit-s": patch | ||
--- | ||
|
||
Added support for mapping ensemble gene ids to gene symbols. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { cleanFeatureId } from '@vitessce/utils'; | ||
|
||
/** | ||
* Use the featureLabelsMap to transform the values in the info object. | ||
* For example, there are cases where the info object looks like | ||
* { "Marker Gene ID": "ENSG00000123456.1" } | ||
* And we want to transform the values into Gene Symbols instead of Ensembl IDs. | ||
* @param {object} info | ||
* @param {string} featureType | ||
* @param {Map<string,string>} featureLabelsMap | ||
* @returns | ||
*/ | ||
export function transformInfoValues(info, featureType, featureLabelsMap) { | ||
if (info) { | ||
const newInfo = Object.fromEntries( | ||
Object.entries(info).map(([key, value]) => { | ||
if (key.toLowerCase().includes(featureType.toLowerCase())) { | ||
const newValue = ( | ||
featureLabelsMap?.get(value) | ||
|| featureLabelsMap?.get(cleanFeatureId(value)) | ||
|| value | ||
); | ||
return [key, newValue]; | ||
} | ||
return [key, value]; | ||
}), | ||
); | ||
return newInfo; | ||
} | ||
return info; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.