-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathx2y.pl
More file actions
26 lines (22 loc) · 882 Bytes
/
x2y.pl
File metadata and controls
26 lines (22 loc) · 882 Bytes
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
#!/bin/perl
use strict;
use Bio::SeqIO;
# get command-line arguments, or die with a usage statement
my $usage = "x2y.pl infile infileformat outfile outfileformat\n";
my $infile = shift or die $usage;
my $infileformat = shift or die $usage;
my $outfile = shift or die $usage;
my $outfileformat = shift or die $usage;
# create one SeqIO object to read in, and another to write out
my $seq_in = Bio::SeqIO->new(
-file => "<$infile",
-format => $infileformat,
);
my $seq_out = Bio::SeqIO->new(
-file => ">$outfile",
-format => $outfileformat,
);
# write each entry in the input file to the output file
while (my $inseq = $seq_in->next_seq) {
$seq_out->write_seq($inseq);
}