-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathgetaccnos.pl
More file actions
executable file
·35 lines (30 loc) · 830 Bytes
/
getaccnos.pl
File metadata and controls
executable file
·35 lines (30 loc) · 830 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
27
28
29
30
31
32
33
34
35
#!/usr/bin/perl
# Script: getaccnos.pl
# Description: Gets names of all sequences in a .fasta file (this is done using seqcount.pl as well)
# Author: Steven Ahrendt
# email: sahrendt0@gmail.com
# Date: 9.2.13
#####################################
# Usage: getaccnos.pl -i seqfilename
#####################################
use warnings;
use strict;
use Bio::Perl;
use Bio::Seq;
use Bio::SeqIO;
use Getopt::Long;
my $seqfilename;
my $help;
GetOptions ("i|input=s" => \$seqfilename,
"h|help" => \$help);
my $usage = "Usage: getaccnos.pl -i seqfilename\n";
die $usage if $help;
die $usage if (!$seqfilename);
my $seqfile = Bio::SeqIO->new(-file=>$seqfilename,
-format=>'fasta');
while (my $seq_obj = $seqfile->next_seq)
{
print $seq_obj->display_id,"\n";
}
warn "Done.\n";
exit(0);