-
Notifications
You must be signed in to change notification settings - Fork 1
/
signalp2circos.pl
executable file
·48 lines (42 loc) · 1.04 KB
/
signalp2circos.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
41
42
43
44
45
46
47
48
#!/usr/bin/env perl
use strict;
use warnings;
my $pep = $ARGV[0] || "data/refseq/FG.RR.27.pep.all.fa";
my $signalp_out = $ARGV[1] || "data/signalp/signalp.out";
my $gff = $ARGV[2] || "data/refseq/FG.RR.27.gff3";
my $circos = $ARGV[3] || "data/circos/signalp.txt";
my $id = $ARGV[4] || "id.signalp";
# predict pep with siganlp
system("signalp -t euk -f short -m hmm $pep > $signalp_out");
system("grep 'Y' $signalp_out | grep 'noTM' | cut -d ' ' -f 1 > $id");
# load id
my @id = ();
open (ID, $id) or die "Cannot open file $id: $!\n";
while (<ID>) {
chomp;
s/\s+//g;
if (/(\S+)/) {
push @id, $1;
}
}
close ID;
# load gff
open (GFF, "$gff") or die "Cannot open file $gff: $!\n";
open (OUT, ">$circos") or die "Cannot open file $circos: $!\n";
while (<GFF>) {
next if /^#/;
my @w = split /\t/;
if ($w[2] eq "transcript") {
# transcript id
my @tid = split /\;/, $w[8];
$tid[0] =~ s/ID\=transcript\://;
foreach my $id (@id) {
if ( $tid[0] eq $id) {
print OUT "Chr$w[0]\t$w[3]\t$w[4]\t1\n";
}
}
}
}
close GFF;
close OUT;
#unlink $id;