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 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
| #!/usr/local/bin/perl
use strict;
use warnings;
open (DESC1, "coco_cds");
while (my $line = <DESC1>){
next if ($line =~ m/^\#/);
chomp $line;
my ( $id, $strand, $coord) = $line =~ m/[\w-]+\t([\w-]+)\t\d+\t([-+])\tORIGINAL JGI\t\d+\t[\#\w\.]+\t([,\d\.]+)/;
my @exon = split (/,/, $coord);
my @intron = ($coord =~ m/(\d+,\d+)/g);
if ($strand eq '-'){
@exon = reverse(@exon);
@intron = reverse(@intron);
}
my $cds;
my %hash;
# 3777..3857,4046..4192,4443..4561,4940..5234,5406..5540,5734..5847,6009..6098,6421..6492
# 324
for my $i (0..$#intron){
my ($s,$e)=(split/,/,$intron[$i]);
my $taille=abs($e-$s+1);
my ($s2,$e2)=(split/\.\./,$exon[$i]);
my $taille2 =abs($e2-$s2+1);
$cds += $taille2;
my $aa=int($cds/3);
$hash{$id}{$aa}=$taille;
}
}
open (DESC2, "aster_cds");
while (my $line = <DESC2>){
next if ($line =~ m/^\#/);
chomp $line;
my ( $id, $strand, $coord) = $line =~ m/[\w-]+\t([\w-]+)\t\d+\t([-+])\tORIGINAL JGI\t\d+\t[\#\w\.]+\t([,\d\.]+)/;
my @exon = split (/,/, $coord);
my @intron = ($coord =~ m/(\d+,\d+)/g);
if ($strand eq '-'){
@exon = reverse(@exon);
@intron = reverse(@intron);
}
my $cds;
my %hash;
# 3777..3857,4046..4192,4443..4561,4940..5234,5406..5540,5734..5847,6009..6098,6421..6492
# 324
for my $i (0..$#intron){
my ($s,$e)=(split/,/,$intron[$i]);
my $taille=abs($e-$s+1);
my ($s2,$e2)=(split/\.\./,$exon[$i]);
my $taille2 =abs($e2-$s2+1);
$cds += $taille2;
my $aa=int($cds/3);
$hash{$id}{$aa}=$taille;
}
}
open (DESC3, "reciprocal.txt");
while (my $ligne1 = <DESC3>){
my ($id1,$id2)=(split/\t/,$ligne1);
system("formatdb -o -pT -i DB.pep");
system("fastacmd -d DB.pep -s $id1>cv");
system("fastacmd -d DB.pep -s $id2>ast");
system("bl2seq -i cv -j ast -p blastp -o out.bl -e 1.e-5");
} |
Partager