{"id":27335273,"url":"https://github.com/dcdanko/capalyzer","last_synced_at":"2025-04-12T14:47:38.255Z","repository":{"id":62560816,"uuid":"130472354","full_name":"dcdanko/capalyzer","owner":"dcdanko","description":null,"archived":false,"fork":false,"pushed_at":"2020-01-27T18:25:07.000Z","size":63635,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-12T22:59:20.489Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dcdanko.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-04-21T12:39:19.000Z","updated_at":"2022-12-15T04:11:16.000Z","dependencies_parsed_at":"2022-11-03T14:45:24.073Z","dependency_job_id":null,"html_url":"https://github.com/dcdanko/capalyzer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcdanko%2Fcapalyzer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcdanko%2Fcapalyzer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcdanko%2Fcapalyzer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcdanko%2Fcapalyzer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dcdanko","download_url":"https://codeload.github.com/dcdanko/capalyzer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248585290,"owners_count":21128974,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2025-04-12T14:47:37.265Z","updated_at":"2025-04-12T14:47:38.245Z","avatar_url":"https://github.com/dcdanko.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Capalyzer\n\n[![CircleCI](https://circleci.com/gh/dcdanko/capalyzer.svg?style=svg)](https://circleci.com/gh/dcdanko/capalyzer)\n[![](https://img.shields.io/pypi/v/capalyzer.svg)](https://pypi.org/project/capalyzer/)\n[![Documentation Status](https://readthedocs.org/projects/capalyzer/badge/?version=latest)](https://capalyzer.readthedocs.io/en/latest/?badge=latest)\n\nCAPalyzer provides two utilities connected to the [MetaSUB Core Analysis Pipeline](https://github.com/MetaSUB/MetaSUB_CAP). It condenses the results of the CAP into summary data tables and it provides utilities to parse those tables.\n\n[Read The Docs](https://capalyzer.readthedocs.io/en/latest/)\n\n## Installation\n\nFrom PyPi\n```\npip install capalyzer\n```\n\nFrom source\n```\ngit clone git@github.com:dcdanko/capalyzer.git\ncd capalyzer\npython setup.py install\n```\n\n## Building a data packet\n\nFrom the command line\n```\ncapalyzer make-tables \u003ccap result dir\u003e \u003cdata packet dir\u003e\n```\n\nIn Code\n```\n#! /bin/env python3\n\nfrom capalyzer.packet_builder import make_all_tables\n\n\nfilenames = make_all_tables(\u003ccap result dir\u003e, \u003cdata packet dir\u003e)\nfor filename in filenames:\n    print(filename)\n```\n\n## Parsing a data packet\n```\n#! /bin/env python3\n\nfrom capalyzer.packet_parser import DataTableFactory\n\ntable_factory = DataTableFactory(\u003cdata packet dir\u003e)\ntaxa_tbl = table_factory.taxonomy()\namr_tbl = table_factory.amrs()\nhmp-tbl = table_factory.hmp()\n```\n\n### Getting diversity scores\n\nYou can generate alpha diversity metrics using this package.\n\nAvailable metrics\n- shannon entropy\n- richness\n- chao1 richness\n\nAll metrics can be rarefied to a certain number of reads with the `rarefy` parameter. \n```\nfrom capalyzer.packet_parser import DataTableFactory\n\ntable_factory = DataTableFactory(\u003cdata packet dir\u003e)\n\nkrakenhll_richness = table_factory.taxa_alpha_diversity(metric='richness', rarefy=1000000)  # krakenhll is the default tool\nmetaphlan2_entropy = table_factory.taxa_alpha_diversity(tool='metaphlan2')  # entropy is the default metric\n```\n\nGenerally `krakenhll` is prefereable to `metaphlan2` as it captures more diversity.\n\nbeta diversity scores are also supported\n```\nfrom capalyzer.packet_parser import DataTableFactory\n\ntable_factory = DataTableFactory(\u003cdata packet dir\u003e)\n\njensen_shannon = table_factory.taxa_beta_diversity(metric='jsd')\nrho_proportionality = table_factory.taxa_beta_diversity(metric='rho')\n```\n\nDiversity metrics may also be generated using the CLI.\n```\ncapalyzer diversity alpha --help\ncapalyzer diversity beta --help\n```\n\n## Credits\n\nThis package is written and maintained by [David C. Danko](mailto:dcdanko@gmail.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcdanko%2Fcapalyzer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdcdanko%2Fcapalyzer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcdanko%2Fcapalyzer/lists"}