-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathaddAsterisk.pl
executable file
·40 lines (34 loc) · 967 Bytes
/
addAsterisk.pl
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
#!/usr/bin/perl
# Script: addAsterisk.pl
# Description: Appends sequences with an asterisk
# Author: Steven Ahrendt
# email: [email protected]
# Date: 03.11.2015
##################################
use warnings;
use strict;
use Getopt::Long;
use Bio::Seq;
use Bio::SeqIO;
use lib '/rhome/sahrendt/Scripts';
#####-----Global Variables-----#####
my $input;
my ($help,$verb);
GetOptions ('i|input=s' => \$input,
'h|help' => \$help,
'v|verbose' => \$verb);
my $usage = "Usage: addAsterisk.pl -i input\nAppends sequences with an asterisk\n";
die $usage if $help;
die "No input.\n$usage" if (!$input);
#####-----Main-----#####
my $seqin_obj = Bio::SeqIO->new(-file => "$input",
-format => "Fasta");
while(my $seq_obj = $seqin_obj->next_seq)
{
my $new_seq = $seq_obj->seq;
$new_seq = join("",$new_seq,"*") if($new_seq !~ /\*$/);
$seq_obj->seq
}
warn "Done.\n";
exit(0);
#####-----Subroutines-----#####