4 #use Data::Dump qw(ddx);
9 my ($chr,undef,$type,$start,$end,undef,$strand,undef,undef,$geneid) = split;
10 next if $type ne 'transcript';
11 $geneid =~ s/[\";\,]//g;
12 #$geneid =~ s/(\.\d+$)//g;
13 $Dat{"$chr\t$strand"}{$start}{$end} = $geneid;
14 #push @{$Dat{"$chr\t$strand"}{$start}},[$end,$geneid];
17 my ($chrStrand,$lastChrStrand);
18 my ($lastStart,$lastEnd,$laseGene) = (0,0,'');
19 for $chrStrand (sort keys %Dat) {
20 my $startDat = $Dat{$chrStrand};
22 for $start (sort {$a <=> $b} keys %{$startDat}) {
23 my $endGeneDat = $startDat->{$start};
25 #for $end (sort {$b <=> $a} keys %{$endGeneDat}) {
26 # my $gene = $endGeneDat->{$end};
27 # print join("\t",$chrStrand,$start,$end,$gene),"\n";
29 my @ends = sort {$b <=> $a} keys %{$endGeneDat};
30 my $thisGene = $endGeneDat->{$ends[0]};
31 if ($lastEnd >= $start and $thisGene ne $laseGene and $lastChrStrand eq $chrStrand) {
32 print join("\t",$chrStrand,$start,$ends[0],$thisGene,'<',$lastStart,$lastEnd,$laseGene,'=',$lastEnd-$start,$lastEnd-$ends[0]),"\n";
33 #ddx $Dat{$chrStrand}{$start};
36 $laseGene = $endGeneDat->{$lastEnd};
38 $lastChrStrand = $chrStrand;