liberu-genealogy / laravel-dna
Laravel wrapper around php-dna for DNA analysis and genealogy
Installs: 3 865
Dependents: 2
Suggesters: 0
Security: 0
Stars: 1
Watchers: 3
Forks: 0
Open Issues: 0
pkg:composer/liberu-genealogy/laravel-dna
Requires
- php: >=8.3
- illuminate/database: ^11.0||^12.0
- illuminate/support: ^11.0||^12.0
- liberu-genealogy/php-dna: ^1.0.1
Requires (Dev)
- driftingly/rector-laravel: ^2.0
- laravel/framework: ^11.0||^12.0
- mockery/mockery: ^1.6
- orchestra/testbench: ^9.0||^10.0
- phpunit/phpunit: ^10.0||^11.0||^12.0
- rector/rector: ^2.0.0
- dev-main
- v2.2.0
- v2.1.0
- v2.0.1
- v2.0.0
- v1.0.0
- dev-copilot/improve-php-dna-library-usage
- dev-sweep/Enhance-Laravel-DNA-Package-with-Improved-Type-Safety-and-Service-Configuration
- dev-sweep/add-missing-docstrings
- dev-sweep/docstrings-addition_d3e6f
- dev-sweep/merge_app_into_src
- dev-sweep/add-docstrings-to-test-methods
- dev-sweep/define_package_name_as_liberugenealogyla
- dev-sweep/docstrings-addition_695ba
- dev-sweep/add-missing-unit-tests
- dev-sweep/rename_app_to_src_and_add_composerjson_p
- dev-sweep/fix-docstring-placement_f01f1
- dev-sweep/fix-syntax-errors
- dev-sweep/unit-tests-processMatchkits
- dev-sweep/docstrings-addition_c89e8
- dev-sweep/docstrings-addition_9f43a
- dev-sweep/add-function-docstrings
- dev-sweep/fix-docstring-placement
- dev-sweep/create_laravel_interface
- dev-sweep/refactor-repeated-code
- dev-sweep/add-docstrings-to-tests
- dev-sweep/docstrings-addition
- dev-sweep/add-unit-tests
- dev-sweep/create_structure
This package is not auto-updated.
Last update: 2026-02-27 20:55:45 UTC
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.