Alien-SeqAlignment-edlib

 view release on metacpan or  search on metacpan

lib/Alien/SeqAlignment/edlib.pm  view on Meta::CPAN

 Alien::SeqAlignment::edlib->edlib_aligner

Returns the command name for running the CLI version of the edlib aligner
Since the command line tool is not built under Windows by the edlib project
make files, this method will return undef under Windows. 

=cut

sub edlib_aligner {
    my ($class) = @_;
    $^O ne 'MSWin32' ? $class->runtime_prop->{command} : undef;
}

=head1 USAGE

=head2 Command line tool

 use v5.38;
 use Alien::SeqAlignment::edlib;
 use Env qw( @PATH );

 unshift @PATH, Alien::SeqAlignment::edlib->bin_dir;
 my $string1 =      "ACGACG";
 my $string2 = "CCCCCACGTCG";

 # save sequences
 open my $fh, '>', 'seq1.fasta';
 say $fh ">Seq1\n$string1";
 close $fh;
 open my $fh, '>', 'seq2.fasta';
 say $fh ">Seq2\n$string2";
 close $fh;

 system Alien::SeqAlignment::edlib->edlib_aligner, '-m', 'HW','-n','0', '-k','-1','-p','-f' ,'NICE','seq1.fasta', 'seq2.fasta';

Output

	Using HW alignment mode.
	Reading queries...
	Read 1 queries, 6 residues total.
	Reading target fasta file...
	Read target, 11 residues.

	Comparing queries to target...

	Query #0 (6 residues): score = 1
	T: ACGTCG (5 - 10)
	   ||| ||
	Q: ACGACG (0 - 5)

=head1 SEE ALSO

=over 4

=item * L<edlib|https://github.com/Martinsos/edlib>

Edlib is a lightweight and superfast C/C++ library for sequence 
alignment using the edit (Levenshtein) distance between two or more
biological (usually) sequences. It can calculate the edit distance, 
find the optimal aligment path and the coordinates (start/end) 
locations. It supports multiple alignment modes such as global (NW), 
prefix (SHW) and infix (HW). The library does not handle utf8 and its
primary use is to compute edit distances and alignments over small 
(255 characters or fewer) alphabets as they occur in bioinformatic
applications.


=item * L<Text::Levenshtein::Edlib|https://metacpan.org/pod/Text::Levenshtein::Edlib>

An XS library that also wraps around the edlib library and returns
edit distances, as well as alignment paths.

=item * L<Text::Levenshtein::XS|https://metacpan.org/pod/Text::Levenshtein::XS>

An XS library that computes edit distances but not alignment paths. See also 
its github repository at: L<https://github.com/ugexe/Text--Levenshtein--XS/>)


=item * L<Text::LevenshteinXS|https://metacpan.org/pod/Text::LevenshteinXS>

Yet another XS implementation of Levenshtein distance over strings 
(no alignment path).

=back

=over 4

=item * L<Alien>

Documentation on the Alien concept itself.

=item * L<Alien::Base|https://metacpan.org/pod/Alien::Base>

The base class for this Alien. The methods in that class allow you to use
the static and the dynamic edlib library in your code. 

=item * L<Alien::Build::Manual::AlienUser|https://metacpan.org/dist/Alien-Build/view/lib/Alien/Build/Manual/AlienUser.pod>

Detailed manual for users of Alien classes.

=item * L<Bio::SeqAlignment|https://metacpan.org/pod/Bio::SeqAlignment>

A collection of tools and libraries for aligning biological sequences 
from within Perl. 

=back

=head1 AUTHOR

Christos Argyropoulos <chrisarg@gmail.com>

=head1 COPYRIGHT AND LICENSE

This software is copyright (c) 2023 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.

=cut

1;



( run in 0.353 second using v1.01-cache-2.11-cpan-119454b85a5 )