{"id":27119133,"url":"https://github.com/tom-spalding/petrie","last_synced_at":"2026-01-20T20:33:14.701Z","repository":{"id":57322452,"uuid":"135207527","full_name":"tom-spalding/petrie","owner":"tom-spalding","description":"a Graph-based phylogenetic tree, implemented in Javascript.","archived":false,"fork":false,"pushed_at":"2018-06-16T20:12:37.000Z","size":41,"stargazers_count":1,"open_issues_count":4,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-12-19T20:49:10.914Z","etag":null,"topics":["algorithms","data-structures","graph","nature","petrie","phylogeny","taxonomy","tree"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tom-spalding.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-05-28T20:44:20.000Z","updated_at":"2023-03-08T03:33:04.000Z","dependencies_parsed_at":"2022-08-25T21:01:16.998Z","dependency_job_id":null,"html_url":"https://github.com/tom-spalding/petrie","commit_stats":null,"previous_names":["nebulousdog/petrie"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tom-spalding/petrie","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tom-spalding%2Fpetrie","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tom-spalding%2Fpetrie/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tom-spalding%2Fpetrie/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tom-spalding%2Fpetrie/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tom-spalding","download_url":"https://codeload.github.com/tom-spalding/petrie/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tom-spalding%2Fpetrie/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28612956,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T18:56:40.769Z","status":"ssl_error","status_checked_at":"2026-01-20T18:54:26.653Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["algorithms","data-structures","graph","nature","petrie","phylogeny","taxonomy","tree"],"created_at":"2025-04-07T08:29:33.421Z","updated_at":"2026-01-20T20:33:14.686Z","avatar_url":"https://github.com/tom-spalding.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Petrie\n\n![petrie](https://github.com/nebulousdog/petrie/blob/master/petrie.png)\n\n![vulnerabilities](https://snyk.io/test/github/nebulousdog/petrie/badge.svg?targetFile=package.json)\n![coverage](https://coveralls.io/repos/github/nebulousdog/petrie/badge.svg?branch=master)\n\na Graph-based phylogenetic tree, implemented in Javascript.\n\n## Phylogeny and Taxonomy\n\nWhether your purposes are phylogenetic or taxonomic in nature doesn't matter. That is, whether you are making a evolutional tree, or a species classification tree. Your source of graph data will determine the utility.\n\n* https://en.wikipedia.org/wiki/Phylogenetic_tree\n* https://en.wikipedia.org/wiki/Taxonomic_rank\n\n## Graph\n\n* https://github.com/trekhleb/javascript-algorithms/tree/master/src/data-structures/graph\n\n### Implementation\n\ntodo\n\n## Nepenthes Example\n\nI chose Nepenthes, because I grow them at home! This project is part of a bigger one related to carnivorous plants and terraria that I'm breaking apart.\n\n* http://www.carnivorousplants.org/cp/evolution/Nepenthes\n\nI'm a hobbiest, so if youre actually in a scientific field and have favorite phylogenetic database, data structure, protocol to share this kind of data, or other research I know nothing about!, I'd love to hear about it [in the issues](https://github.com/nebulousdog/petrie/issues).\n\n## Getting started\n\nInstall package.\n\n```bash\nyarn add petrie\n```\n\nImport module.\n\n```javascript\nimport Tree from 'petrie';\n```\n\nCreate a cached tree from the ICPS [Carnivorous Plant Names Database](http://cpnames.carnivorousplants.org/).\n\n```javascript\n\n```\n\nCreate a cached tree using NCBS.\n\n```javascript\n\n```\n\nCreating your own tree.\n\n```javascript\n\n```\n\nImport your data.\n\n```javascript\nimport data from './data'; // default export location\n```\n\nInitialize a new `Tree` instance.\n\n```javascript\nconst tree = new Tree(data);\n```\n\nSearching.\n\n```javascript\ntree.find('nepenthes');\n\ntree.find('nepenthes a');\n```\n\nTaxonomy\n\n```javascript\nconst ampullaria = tree.find('nepenthes ampullaria')[0];\n\nampullaria.name // binomial name\nampullaria.domain\nampullaria.order\nampullaria.species\n\nampullaria.divisions // synonymous with Species.prototype.children\nampullaria.order.divisions\n\n// using HAMT methods to determine parents and children\nampullaria.children\nconst nepenthes = tree.find('nepenthes')[0]\nampullaria.isParent(nepenthes);\n// false\nnepenthes.isParent(ampullaria);\n// true\n\n```\n\nPhylogeny\n\n```javascript\nconst nepenthes\nampullaria.geneticDistance();\n```\n\nHAMT\n\nUsing HAMT means that we have an entire tree-searching algorithm at our hands.\nLet's use it to create a binomial name searching autocomplete.\n\n```javascript\n\n```\n\nGraphing\n\nD3 is an optional dependency to try to keep this project footprint small, and because not everybody needs graphing. If you like other chart libraries, please feel free to let me know in the issues.\n\n```javascript\nimport d3 from 'd3';\n\n```\n\n## Contributing\n\nIssues and pull requests are very welcome!\n\n### Tests\n\n`yarn test`\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftom-spalding%2Fpetrie","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftom-spalding%2Fpetrie","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftom-spalding%2Fpetrie/lists"}