liberu-genealogy/laravel-dna
Composer 安装命令:
composer require liberu-genealogy/laravel-dna
包简介
Laravel wrapper around php-dna for DNA analysis and genealogy
README 文档
README
Laravel 11 or Laravel 12 wrapper around php-dna
Installation
To install the laravel-dna dependency in your Laravel project, run the following command in your terminal:
composer require liberu-genealogy/laravel-dna
This will download and install the laravel-dna package, making it available for use within your Laravel application.
Dispatching the DispatchMatchkitsJob
To dispatch the DispatchMatchkitsJob for processing DNA matchkits, you can use the following code snippet:
use LaravelDna\Jobs\DispatchMatchkitsJob; use Dna\MatchKits; // Option 1: Using dependency injection dispatch(new DispatchMatchkitsJob(app(MatchKits::class))); // Option 2: Using the service container binding dispatch(app('dispatchMatchkits'));
This will enqueue the job for processing by the Laravel queue system. Make sure your queue worker is running to process the job.
Usage
Using the Facade
You can use the MatchKitsFacade to access MatchKits functionality:
use LaravelDna\Facades\MatchKitsFacade; use Dna\Snps\SNPs; // Load DNA kits $kit1 = new SNPs('/path/to/kit1.txt'); $kit2 = new SNPs('/path/to/kit2.txt'); // Get MatchKits instance via facade $matchKits = app('matchKits'); $matchKits->setKitsData([$kit1, $kit2]); // Match the kits $matchKits->matchKits(); // Get matched data $matchedData = $matchKits->getMatchedData(); // Visualize the results $matchKits->visualizeMatchedData('matched_data.png', 'DNA Match Results', 'GRCh37', 'png');
Direct Usage
You can also use the MatchKits class directly:
use Dna\MatchKits; use Dna\Snps\SNPs; $matchKits = app(MatchKits::class); // Load your DNA kit files $kit1 = new SNPs('/path/to/kit1.txt'); $kit2 = new SNPs('/path/to/kit2.txt'); $matchKits->setKitsData([$kit1, $kit2]); $matchKits->matchKits(); $matchedData = $matchKits->getMatchedData();
After setting up the php-dna dependency and dispatching the DispatchMatchkitsJob, you can start integrating DNA processing functionalities into your Laravel application. Refer to the php-dna documentation for more details on available methods and their usage.
For any custom functionalities or issues, feel free to extend the job or service provider classes as needed.
liberu-genealogy/laravel-dna 适用场景与选型建议
liberu-genealogy/laravel-dna 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 4.88k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2024 年 03 月 14 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 liberu-genealogy/laravel-dna 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 liberu-genealogy/laravel-dna 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 4.88k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 27
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-03-14