-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #103 from snjlee58/master
Added node for Unclassified Sequences below root node + cleaned up code
- Loading branch information
Showing
2 changed files
with
69 additions
and
118 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
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 |
---|---|---|
@@ -1,75 +1,2 @@ | ||
/** Full rank order used for sorting/ordering of hierarchy */ | ||
export const rankOrderFull = [ | ||
"superkingdom", | ||
"kingdom", | ||
"subkingdom", | ||
"superphylum", | ||
"phylum", | ||
"subphylum", | ||
"superclass", | ||
"class", | ||
"subclass", | ||
"superorder", | ||
"order", | ||
"suborder", | ||
"infraorder", | ||
"parvorder", | ||
"superfamily", | ||
"family", | ||
"subfamily", | ||
"supergenus", | ||
"genus", | ||
"subgenus", | ||
"superspecies", | ||
"species", | ||
"subspecies", | ||
"no rank", | ||
"clade", | ||
]; | ||
|
||
/** Ranks displays as levels/columns on sankey diagram | ||
* Include 'no rank' for nodes displayed on sankey */ | ||
export const sankeyRankColumns = ["superkingdom", "kingdom", "phylum", "class", "order", "family", "genus", "species"]; | ||
|
||
const rankColors = [ | ||
// Superkingdom | ||
"#57291F", | ||
"#E63A06", | ||
"#EE9595", | ||
// Superphylum | ||
"#FF6200", | ||
"#FF9200", | ||
"#F7B267", | ||
// Superclass | ||
"#E8B600", | ||
"#FFD000", | ||
"#E6DB6A", | ||
// Superorder | ||
"#044036", | ||
"#0A7A26", | ||
"#46A74B", | ||
"#86B614", | ||
"#ABE188", | ||
// Superfamily | ||
"#0065A2", | ||
"#00A5E3", | ||
"#77D0D0", | ||
// Supergenus | ||
"#520073", | ||
"#9C47B0", | ||
"#C792C7", | ||
// Superspecies | ||
"#FD4BB9", | ||
"#F389F3", | ||
"#FAB3E3", | ||
// No rank | ||
"#8A9BA7", | ||
// Clade | ||
"#696B73", | ||
]; | ||
|
||
/** Function to retrieve color corresponding to rank */ | ||
export function getRankColor(rank) { | ||
const rankIndex = rankOrderFull.indexOf(rank); | ||
return rankColors[rankIndex % rankColors.length]; | ||
} | ||
// Ranks displays as levels/columns on sankey diagram | ||
export const sankeyRankColumns = ["root", "superkingdom", "kingdom", "phylum", "class", "order", "family", "genus", "species"]; |