-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpairwise.pl
More file actions
52 lines (39 loc) · 1.45 KB
/
pairwise.pl
File metadata and controls
52 lines (39 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#! perl -w
use strict;
use Bio::SeqIO;
use Bio::AlignIO;
my $seq1 = Bio::SeqIO->new(-file => $ARGV[0], -format => 'fasta')->next_seq;
my $seq2 = Bio::SeqIO->new(-file => $ARGV[1], -format => 'fasta')->next_seq;
my @aln=($seq1,$seq2);
my $aln;
my $factory;
=head1
#make alignment by bioperl-ext package
use Bio::Tools::dpAlign;
$factory = new dpAlign(-match => 3,
-mismatch => -1,
-gap => 3,
-ext => 1,
-alg => Bio::Tools::dpAlign::DPALIGN_ENDSFREE_MILLER_MYERS);
my $out = $factory->pairwise_alignment($seq1->next_seq, $seq2->next_seq);
my $alnout = Bio::AlignIO->new(-format => 'pfam', -fh => \*STDOUT);
$alnout->write_aln($out);
=cut
#make alignment by blast2
use Bio::Tools::Run::StandAloneBlast;
$factory = Bio::Tools::Run::StandAloneBlast->new(-program => 'blastn',
-outfile => 'bl2seq.out');
my $bl2seq_report = $factory->bl2seq($seq1, $seq2);
# Use AlignIO.pm to create a SimpleAlign object from the bl2seq report
$aln = Bio::AlignIO->new(-file=> 'bl2seq.out',-format => 'bl2seq')->next_aln();
=head
#make alignment by clustalw
use Bio::Tools::Run::Alignment::Clustalw;
my @params=('ktuple'=>4,
'pairgap'=>400,
'quiet'=>1);
$factory=Bio::Tools::Run::Alignment::Clustalw->new(@params);
$aln=$factory->align(\@aln);
my $alnout = Bio::AlignIO->new(-format => 'fasta', -fh => \*STDOUT);
$alnout->write_aln($aln);
=cut