Logo Search packages:      
Sourcecode: python-biopython version File versions

def Bio::GenBank::_FeatureConsumer::_get_location (   self,
  range_info 
) [private]

Return a (possibly fuzzy) location from a Range object.

Arguments:
o range_info - A location range (ie. something like 67..100). This
may also be a single position (ie 27).

This returns a FeatureLocation object.
If parser.use_fuzziness is set at one, the positions for the
end points will possibly be fuzzy.

Definition at line 759 of file __init__.py.

00759                                        :
        """Return a (possibly fuzzy) location from a Range object.

        Arguments:
        o range_info - A location range (ie. something like 67..100). This
        may also be a single position (ie 27).

        This returns a FeatureLocation object.
        If parser.use_fuzziness is set at one, the positions for the
        end points will possibly be fuzzy.
        """
        from Bio import SeqFeature
        from Bio.GenBank import LocationParser
        # check if we just have a single base
        if not(isinstance(range_info, LocationParser.Range)):
            pos = self._get_position(range_info)
            # move the single position back one to be consistent with how
            # python indexes numbers (starting at 0)
            pos.position = pos.position  - 1
            return SeqFeature.FeatureLocation(pos, pos)
        # otherwise we need to get both sides of the range
        else:
            # get *Position objects for the start and end
            start_pos = self._get_position(range_info.low)
            end_pos = self._get_position(range_info.high)

            start_pos.position, end_pos.position = \
              self._convert_to_python_numbers(start_pos.position,
                                              end_pos.position)

            return SeqFeature.FeatureLocation(start_pos, end_pos)

    def _get_position(self, position):


Generated by  Doxygen 1.6.0   Back to index