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

def Bio::GenBank::_FeatureConsumer::_set_ordering_info (   self,
  function,
  cur_feature 
) [private]

Parse a join or order and all of the information in it.

This deals with functions that order a bunch of locations,
specifically 'join' and 'order'. The inner locations are
added as subfeatures of the top level feature

Definition at line 679 of file __init__.py.

00679                                                        :
        """Parse a join or order and all of the information in it.

        This deals with functions that order a bunch of locations,
        specifically 'join' and 'order'. The inner locations are
        added as subfeatures of the top level feature
        """
        from Bio import SeqFeature
        # for each inner element, create a sub SeqFeature within the
        # current feature, then get the information for this feature
        for inner_element in function.args:
            new_sub_feature = SeqFeature.SeqFeature()
            # inherit the type from the parent
            new_sub_feature.type = cur_feature.type 
            # add the join or order info to the location_operator
            cur_feature.location_operator = function.name
            new_sub_feature.location_operator = function.name
            # inherit references and strand from the parent feature
            new_sub_feature.ref = cur_feature.ref
            new_sub_feature.ref_db = cur_feature.ref_db
            new_sub_feature.strand = cur_feature.strand

            # set the information for the inner element
            self._set_location_info(inner_element, new_sub_feature)

            # now add the feature to the sub_features
            cur_feature.sub_features.append(new_sub_feature)

        # set the location of the top -- this should be a combination of
        # the start position of the first sub_feature and the end position
        # of the last sub_feature

        # these positions are already converted to python coordinates 
        # (when the sub_features were added) so they don't need to
        # be converted again
        feature_start = cur_feature.sub_features[0].location.start
        feature_end = cur_feature.sub_features[-1].location.end
        cur_feature.location = SeqFeature.FeatureLocation(feature_start,
                                                          feature_end)

    def _set_location_info(self, parse_info, cur_feature):


Generated by  Doxygen 1.6.0   Back to index