annotate scripts/pickOverlapPair.ex_MEM.pl @ 21:9672fe07a232 draft default tip

planemo upload for repository https://github.com/portiahollyoak/Tools commit 0fea84d05f8976b8360a8b4943ecb01b87e3ade0-dirty
author mvdbeek
date Mon, 05 Dec 2016 09:58:47 -0500
parents ca36262102d8
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
12
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
1 #!/share/bin/perl
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
2 use Bio::Seq;
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
3 use List::Util qw(sum);
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
4
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
5 die "perl $0 <*.excision.cluster.rpmk.refined.bp>\n" if @ARGV<0;
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
6
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
7 my $title=$ARGV[0];
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
8 if ($title =~ /annotation/) {
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
9 $title =~ s/excision.cluster.annotation.refined.bp/sorted.bam/;
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
10 }
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
11 else {$title =~ s/excision.cluster.rpmk.refined.bp/sorted.bam/;}
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
12 #system("samtools index /home/wangj2/scratch/bill/bill_genomic/$title");
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
13
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
14 my %chrs=();
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
15 system("samtools view -H $title > header");
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
16 open (input, "<header") or die "Can't open header since $!\n";
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
17 while (my $line=<input>) {
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
18 if ($line =~ /^\@SQ/) {
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
19 my @a=split(/\t/, $line);
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
20 for my $j (0..$#a) {
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
21 if ($a[$j] =~ /^SN:/) {
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
22 $a[$j] =~ s/^SN://;
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
23 $chrs{$a[$j]}=1;
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
24 }
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
25 }
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
26 }
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
27 }
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
28 close input;
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
29 system("rm header");
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
30
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
31 open (input, "<$ARGV[0]") or die "Can't open $ARGV[0] since $!\n";
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
32 my $header=<input>;
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
33 while (my $line=<input>) {
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
34 chomp($line);
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
35 my @a=split(/\t/, $line);
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
36
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
37 my $left=0;
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
38 my $right=0;
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
39 if ($a[4] eq "") {$left=$a[1];}
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
40 else {
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
41 my @t=split(/\,/, $a[4]);
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
42 my @p=split(/\(/, $t[$#t]);
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
43 $left=$p[0];
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
44 }
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
45 if ($a[5] eq "") {$right=$a[2];}
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
46 else {
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
47 my @t=split(/\,/, $a[5]);
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
48 my @p=split(/\(/, $t[0]);
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
49 $right=$p[0];
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
50 }
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
51
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
52 my $leftlower=$left-500;
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
53 my $leftupper=$left+500;
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
54 my $rightlower=$right-500;
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
55 my $rightupper=$right+500;
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
56 my $chr_num=$a[0];
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
57 $chr_num =~ s/chr//;
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
58 if (($chrs{$a[0]} == 1) && (! defined $chrs{$chr_num})) {$chr_num=$a[0];}
21
9672fe07a232 planemo upload for repository https://github.com/portiahollyoak/Tools commit 0fea84d05f8976b8360a8b4943ecb01b87e3ade0-dirty
mvdbeek
parents: 12
diff changeset
59 system("samtools view -f 0x2 $title $chr_num\:$leftlower\-$leftupper $chr_num\:$rightlower\-$rightupper > temp.sam");
12
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
60
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
61 open in,"temp.sam";
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
62 my %ps=();
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
63 my %me=();
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
64 my %uniqp=();
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
65 my %uniqm=();
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
66 my $ref_sup=0;
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
67
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
68 while(<in>)
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
69 {
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
70 chomp;
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
71 my @f=split/\t/,$_,12;
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
72 ## read number 1 or 2
21
9672fe07a232 planemo upload for repository https://github.com/portiahollyoak/Tools commit 0fea84d05f8976b8360a8b4943ecb01b87e3ade0-dirty
mvdbeek
parents: 12
diff changeset
73 #my ($rnum)=$f[1]=~/(\d)$/;
9672fe07a232 planemo upload for repository https://github.com/portiahollyoak/Tools commit 0fea84d05f8976b8360a8b4943ecb01b87e3ade0-dirty
mvdbeek
parents: 12
diff changeset
74 my $rnum=1;
9672fe07a232 planemo upload for repository https://github.com/portiahollyoak/Tools commit 0fea84d05f8976b8360a8b4943ecb01b87e3ade0-dirty
mvdbeek
parents: 12
diff changeset
75 if (($f[1] & 128) == 128) {$rnum=2;}
12
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
76
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
77 ## XT:A:*
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
78 my $xt="";
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
79 my @a=split(/\s+/, $_);
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
80 my $as=0;
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
81 my $xs=0;
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
82 for my $i (11..$#a) {
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
83 if ($a[$i] =~ /^AS:i:/) {
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
84 $a[$i] =~ s/AS:i://;
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
85 $as=$a[$i];
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
86 }
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
87 elsif ($a[$i] =~ /^XS:i:/) {
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
88 $a[$i] =~ s/XS:i://;
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
89 $xs=$a[$i];
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
90 }
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
91 if (($xs > 0) && ($as-$xs <= $ARGV[2])) {$xt="R";}
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
92 elsif ($as > 0) {$xt="U";}
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
93 }
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
94
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
95 ## Coordinate
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
96 my $coor=$f[3];
21
9672fe07a232 planemo upload for repository https://github.com/portiahollyoak/Tools commit 0fea84d05f8976b8360a8b4943ecb01b87e3ade0-dirty
mvdbeek
parents: 12
diff changeset
97 if (($f[1] & 16) == 16)
12
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
98 {
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
99 if ($xt eq "U") {$uniqm{$f[0]}=1;}
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
100 my (@cigar_m)=$f[5]=~/(\d+)M/g;
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
101 my (@cigar_d)=$f[5]=~/(\d+)D/g;
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
102 my (@cigar_s)=$f[5]=~/(\d+)S/g;
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
103 my (@cigar_i)=$f[5]=~/(\d+)I/g;
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
104 my $aln_ln=sum(@cigar_m,@cigar_d);
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
105 $me{$f[0]}=$f[3]+$aln_ln-1;
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
106 }
21
9672fe07a232 planemo upload for repository https://github.com/portiahollyoak/Tools commit 0fea84d05f8976b8360a8b4943ecb01b87e3ade0-dirty
mvdbeek
parents: 12
diff changeset
107 elsif (($f[1] & 32) == 32) {
12
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
108 $ps{$f[0]}=$f[3];
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
109 if ($xt eq "U") {$uniqp{$f[0]}=1;}
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
110 }
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
111
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
112 # ${$pe{$f[0]}}[$rnum-1]=[$xt,$coor];
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
113 }
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
114 close in;
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
115
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
116 foreach my $id (keys %ps)
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
117 {
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
118 # my @rid=@{$pe{$id}};
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
119
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
120 # if(($rid[0][0] eq "U" && $rid[1][0] eq "M") || ($rid[0][0] eq "M" && $rid[1][0] eq "U"))
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
121 # {
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
122 # $soft_clip++;
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
123 # print "$id\n";
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
124 # }
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
125
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
126 if ((defined $me{$id})&&((defined $uniqp{$id})||(defined $uniqm{$id})))
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
127 {
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
128 if (((($ps{$id}+5)<=$right)&&($me{$id}>$right)&&($uniqm{$id}==1)) || ((($me{$id}-5)>=$left)&&($ps{$id}<$left)&&($uniqp{$id}==1))) {
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
129 $ref_sup++;
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
130 }
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
131 }
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
132 }
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
133
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
134 print "$a[0]\t$a[1]\t$a[2]\t$a[3]\t$left\t$right\t$ref_sup\n";
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
135 system("rm temp.sam");
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
136 }
ca36262102d8 planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
portiahollyoak
parents:
diff changeset
137