comparison scripts/filterFalsePositive.in.pl @ 0:28d1a6f8143f draft

planemo upload for repository https://github.com/portiahollyoak/Tools commit 132bb96bba8e7aed66a102ed93b7744f36d10d37-dirty
author portiahollyoak
date Mon, 25 Apr 2016 13:08:56 -0400
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:28d1a6f8143f
1 #!/share/bin/perl
2 use List::Util qw(max min);
3 #system("windowBed -a $ARGV[0] -b /home/wangj2/flycommon/all_transposons.dml.rmskCrossmatch.bed -sw -r 1000 -l 0 > tmp");
4 #system("windowBed -a $ARGV[0] -b /home/wangj2/flycommon/soo.trnalnpos.map2.sort.bed -sw -r 1000 -l 0 > tmp");
5 system("bedtools window -a $ARGV[0] -b $ARGV[1] -sw -r 1000 -l 0 > tmp");
6
7 open in,"tmp";
8 my %read;
9 while(<in>)
10 {
11 chomp;
12 split/\t/;
13
14 ## if the same tpye of transposons
15 my @loc=map { [/(.*?),(\+|-)(.*)/] } split/;/,$_[4];
16 foreach my $l (@loc)
17 {
18 if($$l[0] eq $_[9])
19 {
20 ## if the same strand of transposons
21 if((($_[5] eq $$l[1]) && ($_[11] eq "-")) || (($_[5] ne $$l[1]) && ($_[11] eq "+")))
22 {
23 ## if the fragments of the exists transposons
24 {
25 my $s=max($$l[2],$_[12]);
26 my $e=min(($$l[2]+$_[2]-$_[1]),$_[13]);
27 if($s<$e)
28 {
29 print join("\t",@_[0..5]),"\n" if not exists $read{$_[3]};
30 $read{$_[3]}=1;
31 }
32 }
33 }
34 }
35 }
36 }
37 close in;
38
39 system("rm tmp");