comparison scripts/pickOverlapPair.in.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 28d1a6f8143f
children
comparison
equal deleted inserted replaced
20:6e02b9179a24 21:9672fe07a232
27 $b[0]=$c[0]; 27 $b[0]=$c[0];
28 $c[0]=$swap; 28 $c[0]=$swap;
29 } 29 }
30 my $lower=$b[0]-$frag; 30 my $lower=$b[0]-$frag;
31 my $upper=$c[0]+$frag; 31 my $upper=$c[0]+$frag;
32 system("samtools view -Xf 0x2 $title $a[0]\:$lower\-$upper > temp.sam"); 32 system("samtools view -f 0x2 $title $a[0]\:$lower\-$upper > temp.sam");
33 33
34 open in,"temp.sam"; 34 open in,"temp.sam";
35 my %ps=(); 35 my %ps=();
36 my %me=(); 36 my %me=();
37 my $ref_sup=0; 37 my $ref_sup=0;
39 while(<in>) 39 while(<in>)
40 { 40 {
41 chomp; 41 chomp;
42 my @f=split/\t/,$_,12; 42 my @f=split/\t/,$_,12;
43 ## read number 1 or 2 43 ## read number 1 or 2
44 my ($rnum)=$f[1]=~/(\d)$/; 44 #my ($rnum)=$f[1]=~/(\d)$/;
45 my $rnum=1;
46 if (($f[1] & 128) == 128) {$rnum=2;}
45 47
46 ## XT:A:* 48 ## XT:A:*
47 my ($xt)=$f[11]=~/XT:A:(.)/; 49 my ($xt)=$f[11]=~/XT:A:(.)/;
48 50
49 ## Coordinate 51 ## Coordinate
50 if ($f[1]=~/r/) 52 if (($f[1] & 16) == 16)
51 { 53 {
52 my (@cigar_m)=$f[5]=~/(\d+)M/g; 54 my (@cigar_m)=$f[5]=~/(\d+)M/g;
53 my (@cigar_d)=$f[5]=~/(\d+)D/g; 55 my (@cigar_d)=$f[5]=~/(\d+)D/g;
54 my (@cigar_s)=$f[5]=~/(\d+)S/g; 56 my (@cigar_s)=$f[5]=~/(\d+)S/g;
55 my (@cigar_i)=$f[5]=~/(\d+)I/g; 57 my (@cigar_i)=$f[5]=~/(\d+)I/g;