1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160
|
#!/usr/bin/perl -w
$id = "unknown";
$hasrange = 0; # nn..nn
$hassingle = 0; # nn
$hasbetween = 0; # nn^nn
$hasbetweencirc = 0; # nn^1
$hasset = 0; # (nn.nn)
$hasjoin = 0; # join(nn..nn,nn..nn)
$hasorder = 0; # order(
$hasgroup = 0; # group(
$hasoneof = 0; # one_of(
$hasbefore = 0; # <nn
$hasafter = 0; # >nn
$hascomplement = 0; # complement(nn..nn)
$hasjoincomplement = 0; # join(complement(nn..nn),
$hascomplementjoin = 0; # complement(join(nn..nn),
$has = 1;
@types = ("range", "single", "between", "betweencirc",
"set","join","order","group",
"one_of","before","after",
"complement","joincomplement","complementjoin",
);
%ids = ();
%locations = ();
while (<>) {
if(/^ID +(\S+)/) {
$id = $1;
$id =~ s/;$//;
$textstr = $_;
}
elsif(/^LOCUS +(\S+)/) {
$id = $1;
$id =~ s/;$//;
$textstr = $_;
}
else {
$textstr .= $_;
}
if(/^[F ][T ] (\S+) +(.*)/) {
$location = $2;
if(!$hasrange){
if($location =~ /^(\d+)\.\.(\d+)$/) {
$hasrange++;
$ids{"range"} = $id;
$locations{"range"} = $location;
}
}
if(!$hassingle){
if($location =~ /^\d+$/) {
$hassingle++;
$ids{"single"} = $id;
$locations{"single"} = $location;
}
}
if(!$hasbetween){
if($location =~ /^\d+[\^]\d+$/) {
$hasbetween++;
$ids{"between"} = $id;
$locations{"between"} = $location;
}
}
if(!$hasbetweencirc){
if($location =~ /^\d+[\^]1$/) {
$hasbetweencirc++;
$ids{"betweencirc"} = $id;
$locations{"betweencirc"} = $location;
}
}
if(!$hasset){
if($location =~ /\d+[\.]\d+/) {
$hasset++;
$ids{"set"} = $id;
$locations{"set"} = $location;
}
}
if(!$hasjoin){
if($location =~ /^join[\(]\d+\.\.\d+,[0-9.\(\),]+$/) {
$hasjoin++;
$ids{"join"} = $id;
$locations{"join"} = $location;
}
}
if(!$hasorder){
if($location =~ /^order[\(]\d+\.\.\d+,[0-9.\(\),]+$/) {
$hasorder++;
$ids{"order"} = $id;
$locations{"order"} = $location;
}
}
if(!$hasgroup){
if($location =~ /^group[\(]\d+\.\.\d+,[0-9.\(\),]+$/) {
$hasgroup++;
$ids{"group"} = $id;
$locations{"group"} = $location;
}
}
if(!$hasoneof){
if($location =~ /^one_of[\(]\d+\.\.\d+,[0-9.\(\),]+$/) {
$hasoneof++;
$ids{"one_of"} = $id;
$locations{"one_of"} = $location;
}
}
if(!$hasbefore){
if($location =~ /[<]\d+\.\./) {
$hasbefore++;
$ids{"before"} = $id;
$locations{"before"} = $location;
}
}
if(!$hasafter){
if($location =~ /\.\.[>]\d+/) {
$hasafter++;
$ids{"after"} = $id;
$locations{"after"} = $location;
}
}
if(!$hascomplement){
if($location =~ /^complement[\(]\d+\.\.\d+[\)]$/) {
$hascomplement++;
$ids{"complement"} = $id;
$locations{"complement"} = $location;
}
}
if(!$hasjoincomplement){
if($location =~ /^join[\(].*complement[\(]\d+\.\.\d+[\)]/) {
$hasjoincomplement++;
$ids{"joincomplement"} = $id;
$locations{"joincomplement"} = $location;
}
}
if(!$hascomplementjoin){
if($location =~ /^complement[\(]join[\(]\d+\.\.\d+/) {
$hascomplementjoin++;
$ids{"complementjoin"} = $id;
$locations{"complementjoin"} = $location;
}
}
if(!$has){
if($location =~ //) {
$has++;
$ids{""} = $id;
$locations{""} = $location;
}
}
}
}
foreach $id (@types){
if(defined($ids{$id})) {
printf "%15s %15s %s\n", $id, $ids{$id}, $locations{$id};
}
else {
printf "%15s %15s\n", $id, "......";
}
}
|