The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Bio::SeqAlignment::Components::Libraries::edlib::OpenMP - basic edlib library that uses OpenMP for parallelism

VERSION

version 0.03

SYNOPSIS

  use Bio::SeqAlignment::Components::Libraries::edlib::OpenMP;
  my $ffi = Bio::SeqAlignment::Components::Libraries::edlib::OpenMP->new_edlib_aligner();
  my $configuration = Bio::SeqAlignment::Components::Libraries::edlib::OpenMP->configure_edlib_aligner( $ffi, %config );
  my $align = Bio::SeqAlignment::Components::Libraries::edlib::OpenMP->edlibAlign( $query_seq, $query_len, $ref_seq, $ref_seq_len, $configuration->{edlib_config} );
  Bio::SeqAlignment::Components::Libraries::edlib::OpenMP->edlibFreeAlignResult( $align );

DESCRIPTION

This module provides a basic interface to the edlib library that uses OpenMP for parallelism. In its current form, it is a thin wrapper around the edlib library, that only finds the best alignment (smaller edit distance) of a query against a collection of reference sequences. This particular module is meant to be used as a component in a larger sequence alignment tool, e.g. one that combines a Linear dataflow and a generic sequence mapper. Future versions will include the alignment path and the alignment locations in order to handle multiple/overlapping hits.

METHODS

configure_edlib_aligner

  my $configuration = Bio::SeqAlignment::Components::Libraries::edlib::OpenMP->configure_edlib_aligner( $ffi, %config );

This method configures the edlib aligner with the given configuration. The configuration is a hash with the following keys: mode, task, filter, additionalEqualities, and additionalEqualitiesLength. The configuration is returned as a hash reference with two keys: edlib_config and align_config. The edlib_config key contains the configuration for the edlib aligner, while the align_config key contains the configuration for the alignment.

edlibAlign

  my $align = Bio::SeqAlignment::Components::Libraries::edlib::OpenMP->edlibAlign( $query_seq, $query_len, $ref_seq, $ref_seq_len, $configuration->{edlib_config} );

This method aligns the query sequence against the reference sequences using the given configuration.

make_C_index

  my $C_index = Bio::SeqAlignment::Components::Libraries::edlib::OpenMP->make_C_index( $sequences );

This method creates a C index from the given sequences.

  Bio::SeqAlignment::Components::Libraries::edlib::OpenMP->print_config( $configuration->{edlib_config} );

This method prints the configuration to the standard output (only meant for debugging)

fork_around_find_out

  Bio::SeqAlignment::Components::Libraries::edlib::OpenMP->fork_around_find_out();

This method pauses all OpenMP resources and allows the user to generate multiple threads for parallel processing, from forked Perl processes

SEE ALSO

TODO

  • Add support for obtaining/parsing the alignment path

  • Add support for obtaining/parsing the alignment locations

  • Add support for mapping multiple and/or overlapping hits

AUTHOR

Christos Argyropoulos <chrisarg@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2024 by Christos Argyropoulos.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.