Entering edit mode
11.0 years ago
robjohn7000
▴
110
Hi,
I have a code bioperl (below) that does the job of extracting CDS locations (e.g., (234..1234) from a GenBank file, but does not extract the complement statement when they are indicated such as complement(234530..235249). How can I extract the complement statement together with the location whenever they indicated as mentioned.
if ($feat_object->primary_tag eq "CDS") {
my $start = $feat_object->location->start;
my $end = $feat_object->location->end;
print $start . ".." . $end . "\n";
}
Thanks
Thanks seninp. Unfortunately, I got the following error: Can't call "location" on an undefined value at line: foreach my $location ( $feature->location->each_Location ).
just updated the reply
Many thanks Pavel, updated solution using grep did the trick. Very much appreciated!