annotate SMART/bacteriaRegulatoryRegion_Detection/splitTranscriptGff.pl @ 18:94ab73e8a190

Uploaded
author m-zytnicki
date Mon, 29 Apr 2013 03:20:15 -0400
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
18
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
1 #!/usr/bin/perl -w
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
2 ###
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
3 # Main : defining utr and intergenic operonic intervalles from a transcripts file following a referencies file
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
4 #
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
5 # Input : 2 gff files to intersect, transcript queries vs referencies
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
6 #
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
7 # Output : resulting gff file printing to standard output
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
8 #
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
9 ###------------------------------------------------------
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
10 use vars qw($USAGE);
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
11 use strict;
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
12
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
13 =head1 NAME
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
14
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
15 splitTranscriptGff.pl - compare 2 input gff files and define utr and intergenic operonic intervalles by couple of overlapping elements
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
16
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
17 =head1 SYNOPSIS
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
18
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
19 % intervallsExtractorGff.pl -i referencies.gff -j transcriptQueries.gff -s strand [-h]
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
20
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
21 =head1 DESCRIPTION
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
22 This script will intersect 2 gff files and compute distance between 2 successives lines. Take care both of sorting by positions the input files and of that referencies are included in transcriptQueries.
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
23
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
24 -i|--input1 fileName gff input file name: included elements
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
25 -j|--input2 fileName gff input file name: extended elements
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
26 [-s|--strand] [s|d] s for single strand (colinear) or d for double strands (antisense) [default d]
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
27 [-h|--help] help mode then die
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
28
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
29 =head1 USECASE
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
30 Define many fragments for each extended element (transcript): UTR5, gene, UTR3, "inOperon" for intergenomic region between 2 genes
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
31 intervallsExtractorGff.pl -i CDSannotations.gff -j RNAseqTranscripts.gff > UTRsGenesOperonsLists.gff;
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
32
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
33 =head1 KWON BUGS
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
34 No disjonction of overlapping elements of the included elements (-i file).
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
35 In usecase, overlapping genes are fused in one long gene.
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
36
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
37 =head1 AUTHOR
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
38 Claire Toffano-Nioche - sep.11
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
39
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
40 =cut
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
41 #-----------------------
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
42 sub feedPositionTab { my ($val, $pF, $pB, @info) = @_ ;
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
43 #print "feedPositionTab::$#info, ", ($#info+1)/4," \n";
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
44 for (my $i=0 ; $i <= $#info ; $i+=4) { # for each extended element
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
45 #print "....$info[$i+2]\n";
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
46 if ($info[$i+3] =~ /\+/) {
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
47 for (my $c = $info[$i+1] ; $c <= $info[$i+2] ; $c++) { @$pF[$c]=$val } ; # sequence Forward
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
48 } else {
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
49 for (my $c = $info[$i+1] ; $c <= $info[$i+2] ; $c++) { @$pB[$c]=$val } ; # sequence Backward
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
50 }
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
51 }
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
52 #print "feedPos...:: ", join(".", @$pF[0..100]), "\n";
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
53 #print "feedPos...:: ", join(".", @$pB[0..100]), "\n";
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
54 }
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
55 #-----------------------
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
56 sub recupInfo { my ($pInfo, @lines) = @_ ;
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
57 for (my $i=0 ; $i <= ($#lines+1)*4-1 ; $i+=4) {
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
58 my @line = split("\t",$lines[$i/4]);
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
59 push(@$pInfo, $line[0], $line[3], $line[4], $line[6]) ; # 0=nom, 3=debut, 4=fin, 6=sens
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
60 }
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
61 #print "recupInfo::fin=", ($#lines+1)*4, "\n" ;
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
62 }
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
63 #-----------------------
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
64 sub tagName { my ($seqN, $posB, $posE, $strand) = @_ ;
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
65 my $tagN=$seqN.$strand.$posB."..".$posE;
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
66 #print "tagName:",join("_",@_)," et tagName:$tagN\n";
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
67 return $tagN;
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
68 }
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
69 #-----------------------
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
70 sub transitionAnalysis {
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
71 my ($pos, $seq, $s, $pdebAmont, $pfinAmont, $pdebIn, $pfinIn, $pdebAval, $pfinAval, $ptag) = @_ ;
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
72 my $enCours = 0 ; my $precedant = 0 ;
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
73 $enCours = @$ptag[$pos] ;
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
74 $precedant = ($s =~ /\+/?@$ptag[$pos-1]:@$ptag[$pos+1]) ;
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
75 if ($enCours ne $precedant) {
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
76 #print "transi...:: $s, $pos, $precedant, $enCours\n";
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
77 #print "transition::$$pdebAmont, $$pfinAmont, $$pdebIn, $$pfinIn, $$pdebAval, $$pfinAval\n";
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
78 SWITCH: for ($precedant.$enCours) {
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
79 /01/ && do { $$pdebAmont = $pos ; last SWITCH ;};
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
80 /02/ && do { $$pdebIn = $pos ; last SWITCH ;};
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
81 /10/ && do { $$pfinAval = ($s =~/\+/?$pos-1:$pos+1) ;
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
82 if (($s =~ /\+/)and ($$pdebAval!=$$pfinAval)) {
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
83 printf "%s\tsplit\tutr3\t%s\t%s\t.\t%s\t.\tName=%s;\n",
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
84 $seq, $$pdebAval, $$pfinAval, $s, &tagName($seq, $$pdebAval, $$pfinAval, $s) ;
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
85 #if ($$pdebAval==$$pfinAval) { print "transition 10 +\n"};
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
86 } elsif ($$pfinAval!=$$pdebAval) {
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
87 printf "%s\tsplit\tutr3\t%s\t%s\t.\t%s\t.\tName=%s;\n",
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
88 $seq, $$pfinAval, $$pdebAval, $s, &tagName($seq, $$pfinAval, $$pdebAval, $s) ;
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
89 #if ($$pfinAval==$$pdebAval){ print "transition 10 -\n"};
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
90 }
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
91 $$pdebAval = 0 ; $$pfinAval = 0 ;
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
92 last SWITCH ;
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
93 };
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
94 /12/ && do { $$pdebIn = $pos ; $$pfinAmont=($s =~/\+/?$pos-1:$pos+1) ;
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
95 my $type="utr5";
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
96 if ($$pdebAmont == 0) { # in case of interOperon : utr5-CDS-interOperon-CDS-utr3
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
97 $$pdebAmont=($s =~/\+/?$$pfinIn+1:$$pfinIn-1) ;
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
98 $type="inOperon" ;
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
99 }
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
100 if (($s =~ /\+/) and ($$pdebAmont!=$$pfinAmont)) {
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
101 printf "%s\tsplit\t%s\t%s\t%s\t.\t%s\t.\tName=%s;\n",
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
102 $seq, $type, $$pdebAmont, $$pfinAmont, $s, &tagName($seq, $$pdebAmont, $$pfinAmont, $s) ;
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
103 # if ($$pdebAmont==$$pfinAmont) { print "transition 12 +\n"};
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
104 } elsif ($$pfinAmont!=$$pdebAmont) {
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
105 printf "%s\tsplit\t%s\t%s\t%s\t.\t%s\t.\tName=%s;\n",
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
106 $seq, $type, $$pfinAmont, $$pdebAmont, $s, &tagName($seq, $$pfinAmont, $$pdebAmont, $s) ;
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
107 #if ($$pfinAmont==$$pdebAmont) { print "transition 12 -\n"} ;
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
108 }
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
109 $$pdebAmont = 0 ; $$pfinAmont = 0 ;
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
110 last SWITCH ;
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
111 };
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
112 /20/ && do { $$pfinIn=($s =~/\+/?$pos-1:$pos+1) ;
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
113 if (($s =~ /\+/) and ($$pdebIn!=$$pfinIn)) {
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
114 printf "%s\tsplit\tgene\t%s\t%s\t.\t%s\t.\tName=%s;\n",
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
115 $seq, $$pdebIn, $$pfinIn, $s, &tagName($seq, $$pdebIn, $$pfinIn, $s) ;
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
116 } elsif ($$pfinIn!=$$pdebIn) {
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
117 printf "%s\tsplit\tgene\t%s\t%s\t.\t%s\t.\tName=%s;\n",
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
118 $seq, $$pfinIn, $$pdebIn, $s, &tagName($seq, $$pfinIn, $$pdebIn, $s) ;
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
119 }
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
120 $$pdebIn = 0 ; $$pfinIn = 0 ;
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
121 last SWITCH ;
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
122 };
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
123 /21/ && do { $$pdebAval=$pos ; $$pfinIn=($s =~/\+/?$pos-1:$pos+1) ;
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
124 if (($s =~ /\+/) and ($$pdebIn!=$$pfinIn)) {
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
125 printf "%s\tsplit\tgene\t%s\t%s\t.\t%s\t.\tName=%s;\n",
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
126 $seq, $$pdebIn, $$pfinIn, $s, &tagName($seq, $$pdebIn, $$pfinIn, $s) ;
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
127 } elsif ($$pfinIn!=$$pdebIn) {
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
128 printf "%s\tsplit\tgene\t%s\t%s\t.\t%s\t.\tName=%s;\n",
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
129 $seq, $$pfinIn, $$pdebIn, $s, &tagName($seq, $$pfinIn, $$pdebIn, $s) ;
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
130 }
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
131 #$$pdebIn = 0 ; $$pfinIn = 0 ;
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
132 last SWITCH ;
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
133 };
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
134 }
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
135 }
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
136 }
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
137 #-----------------------
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
138 my ($fileNameI, $fileNameE, $strand) = ("", "", 0) ;
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
139 # command line check
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
140 foreach my $num (0 .. $#ARGV) {
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
141 SWITCH: for ($ARGV[$num]) {
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
142 /--input1|-i/ && do {
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
143 $fileNameI=$ARGV[$num+1];
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
144 open ( fichierGffI, "< $fileNameI" ) or die "Can't open gff file: \"$fileNameI\"\n" ;
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
145 last };
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
146 /--input2|-j/ && do {
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
147 $fileNameE=$ARGV[$num+1];
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
148 open ( fichierGffE, "< $fileNameE" ) or die "Can't open gff file: \"$fileNameE\"\n" ;
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
149 last };
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
150 /--strand|-s/ && do {
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
151 if ($ARGV[$num+1] eq "s") { $strand=1};
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
152 last };
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
153 /--help|-h/ && do { exec("pod2text $0\n") ; die };
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
154 }
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
155 }
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
156 # memory declarations:
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
157 my @infoI ; my @infoE ;
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
158 my $seqName ;
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
159 my @tagF ; my @tagB ; # Forward and Backward sequence
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
160 # data retrieval:
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
161 my @linesI = <fichierGffI> ; my @linesE = <fichierGffE> ;
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
162 close fichierGffI ; close fichierGffE ;
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
163 #print "gff files read ; number of lines : $#lines1 + $#lines2\n";
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
164 # positions management
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
165 &recupInfo(\@infoI, @linesI) ;
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
166 &recupInfo(\@infoE, @linesE) ;
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
167 # treatement:
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
168 # transform gff lines into chromosomal position tags : 0 for nothing, 1 resp. 2 for extended resp. included elements
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
169 if (($#infoI) and ($#infoE)) {
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
170 $seqName=$infoI[0] ;
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
171 #print "fin : $infoE[$#infoE-1]\n";
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
172 for (my $i=0 ; $i <= $infoE[$#infoE-1] ; $i++) { $tagF[$i] = 0 ; $tagB[$i] = 0 ; } ; # "O" tag in all chr. positions
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
173 #print "seqName : $seqName\n" ;
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
174 &feedPositionTab(1, \@tagF, \@tagB, @infoE) ; # "1" tag for all extended elements
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
175 &feedPositionTab(2, \@tagF, \@tagB, @infoI) ; # "2" tag for all included elements
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
176 #print join("", @tagF), "\n";
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
177 #print join("", @tagB), "\n";
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
178 # transition management:
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
179 my ($beginUpstream, $endUpstream, $beginIncluded, $endIncluded, $beginDownstream, $endDownstream)
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
180 = (0, 0, 0, 0, 0, 0) ;
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
181 for (my $i=1 ; $i <= $#tagF-1 ; $i+=1) {
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
182 &transitionAnalysis($i, $seqName, "+", \$beginUpstream, \$endUpstream, \$beginIncluded, \$endIncluded, \$beginDownstream, \$endDownstream, \@tagF) ;
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
183 }
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
184 ($beginUpstream, $endUpstream, $beginIncluded, $endIncluded, $beginDownstream, $endDownstream) = ($infoE[$#infoE-1], $infoE[$#infoE-1], $infoE[$#infoE-1], $infoE[$#infoE-1], $infoE[$#infoE-1], $infoE[$#infoE-1]) ;
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
185 for (my $i=$#tagB-1 ; $i >= 1 ; $i-=1) {
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
186 &transitionAnalysis($i, $seqName, "-", \$beginUpstream, \$endUpstream, \$beginIncluded, \$endIncluded, \$beginDownstream, \$endDownstream, \@tagB) ;
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
187 }
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
188 }
94ab73e8a190 Uploaded
m-zytnicki
parents:
diff changeset
189 exit(0) ;