Mercurial > repos > portiahollyoak > temp
annotate scripts/pickOverlapPair.ex_MEM.pl @ 14:bc39ae53be03 draft
planemo upload for repository https://github.com/portiahollyoak/Tools commit bcb1f256bca5591aa3df390a302c19d52fba14c2
| author | portiahollyoak | 
|---|---|
| date | Mon, 23 May 2016 06:53:10 -0400 | 
| parents | ca36262102d8 | 
| children | 9672fe07a232 | 
| 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];} | 
| 
ca36262102d8
planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
 portiahollyoak parents: diff
changeset | 59 system("samtools view -Xf 0x2 $title $chr_num\:$leftlower\-$leftupper $chr_num\:$rightlower\-$rightupper > temp.sam"); | 
| 
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 | 
| 
ca36262102d8
planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
 portiahollyoak parents: diff
changeset | 73 my ($rnum)=$f[1]=~/(\d)$/; | 
| 
ca36262102d8
planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
 portiahollyoak parents: diff
changeset | 74 | 
| 
ca36262102d8
planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
 portiahollyoak parents: diff
changeset | 75 ## XT:A:* | 
| 
ca36262102d8
planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
 portiahollyoak parents: diff
changeset | 76 my $xt=""; | 
| 
ca36262102d8
planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
 portiahollyoak parents: diff
changeset | 77 my @a=split(/\s+/, $_); | 
| 
ca36262102d8
planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
 portiahollyoak parents: diff
changeset | 78 my $as=0; | 
| 
ca36262102d8
planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
 portiahollyoak parents: diff
changeset | 79 my $xs=0; | 
| 
ca36262102d8
planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
 portiahollyoak parents: diff
changeset | 80 for my $i (11..$#a) { | 
| 
ca36262102d8
planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
 portiahollyoak parents: diff
changeset | 81 if ($a[$i] =~ /^AS:i:/) { | 
| 
ca36262102d8
planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
 portiahollyoak parents: diff
changeset | 82 $a[$i] =~ s/AS:i://; | 
| 
ca36262102d8
planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
 portiahollyoak parents: diff
changeset | 83 $as=$a[$i]; | 
| 
ca36262102d8
planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
 portiahollyoak parents: diff
changeset | 84 } | 
| 
ca36262102d8
planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
 portiahollyoak parents: diff
changeset | 85 elsif ($a[$i] =~ /^XS:i:/) { | 
| 
ca36262102d8
planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
 portiahollyoak parents: diff
changeset | 86 $a[$i] =~ s/XS:i://; | 
| 
ca36262102d8
planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
 portiahollyoak parents: diff
changeset | 87 $xs=$a[$i]; | 
| 
ca36262102d8
planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
 portiahollyoak parents: diff
changeset | 88 } | 
| 
ca36262102d8
planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
 portiahollyoak parents: diff
changeset | 89 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 | 90 elsif ($as > 0) {$xt="U";} | 
| 
ca36262102d8
planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
 portiahollyoak parents: diff
changeset | 91 } | 
| 
ca36262102d8
planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
 portiahollyoak parents: diff
changeset | 92 | 
| 
ca36262102d8
planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
 portiahollyoak parents: diff
changeset | 93 ## Coordinate | 
| 
ca36262102d8
planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
 portiahollyoak parents: diff
changeset | 94 my $coor=$f[3]; | 
| 
ca36262102d8
planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
 portiahollyoak parents: diff
changeset | 95 if ($f[1]=~/r/) | 
| 
ca36262102d8
planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
 portiahollyoak parents: diff
changeset | 96 { | 
| 
ca36262102d8
planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
 portiahollyoak parents: diff
changeset | 97 if ($xt eq "U") {$uniqm{$f[0]}=1;} | 
| 
ca36262102d8
planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
 portiahollyoak parents: diff
changeset | 98 my (@cigar_m)=$f[5]=~/(\d+)M/g; | 
| 
ca36262102d8
planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
 portiahollyoak parents: diff
changeset | 99 my (@cigar_d)=$f[5]=~/(\d+)D/g; | 
| 
ca36262102d8
planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
 portiahollyoak parents: diff
changeset | 100 my (@cigar_s)=$f[5]=~/(\d+)S/g; | 
| 
ca36262102d8
planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
 portiahollyoak parents: diff
changeset | 101 my (@cigar_i)=$f[5]=~/(\d+)I/g; | 
| 
ca36262102d8
planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
 portiahollyoak parents: diff
changeset | 102 my $aln_ln=sum(@cigar_m,@cigar_d); | 
| 
ca36262102d8
planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
 portiahollyoak parents: diff
changeset | 103 $me{$f[0]}=$f[3]+$aln_ln-1; | 
| 
ca36262102d8
planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
 portiahollyoak parents: diff
changeset | 104 } | 
| 
ca36262102d8
planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
 portiahollyoak parents: diff
changeset | 105 elsif ($f[1]=~/R/) { | 
| 
ca36262102d8
planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
 portiahollyoak parents: diff
changeset | 106 $ps{$f[0]}=$f[3]; | 
| 
ca36262102d8
planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
 portiahollyoak parents: diff
changeset | 107 if ($xt eq "U") {$uniqp{$f[0]}=1;} | 
| 
ca36262102d8
planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
 portiahollyoak parents: diff
changeset | 108 } | 
| 
ca36262102d8
planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
 portiahollyoak parents: diff
changeset | 109 | 
| 
ca36262102d8
planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
 portiahollyoak parents: diff
changeset | 110 # ${$pe{$f[0]}}[$rnum-1]=[$xt,$coor]; | 
| 
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 close in; | 
| 
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 foreach my $id (keys %ps) | 
| 
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 # my @rid=@{$pe{$id}}; | 
| 
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 # 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 | 119 # { | 
| 
ca36262102d8
planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
 portiahollyoak parents: diff
changeset | 120 # $soft_clip++; | 
| 
ca36262102d8
planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
 portiahollyoak parents: diff
changeset | 121 # print "$id\n"; | 
| 
ca36262102d8
planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
 portiahollyoak parents: diff
changeset | 122 # } | 
| 
ca36262102d8
planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
 portiahollyoak parents: diff
changeset | 123 | 
| 
ca36262102d8
planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
 portiahollyoak parents: diff
changeset | 124 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 | 125 { | 
| 
ca36262102d8
planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
 portiahollyoak parents: diff
changeset | 126 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 | 127 $ref_sup++; | 
| 
ca36262102d8
planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
 portiahollyoak parents: diff
changeset | 128 } | 
| 
ca36262102d8
planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
 portiahollyoak parents: diff
changeset | 129 } | 
| 
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 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 | 133 system("rm temp.sam"); | 
| 
ca36262102d8
planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
 portiahollyoak parents: diff
changeset | 134 } | 
| 
ca36262102d8
planemo upload for repository https://github.com/portiahollyoak/Tools commit 5d021f520b653582862ec98dd812a051b804aa50
 portiahollyoak parents: diff
changeset | 135 | 
