[gt-users] method to either delete a child from a FeatureNode, or to update its type
La Rota, Mauricio
MAURICIO.LAROTA at PIONEER.COM
Thu Apr 30 22:37:04 CEST 2009
Thanks Gordon,
This did the job. Thanks a second time for the explanation of how it works.
-M
> -----Original Message-----
> From: gt-users-bounces at genometools.org [mailto:gt-users-
> bounces at genometools.org] On Behalf Of Gordon Gremme
> Sent: Thursday, April 30, 2009 6:13 AM
> To: GenomeTools Users
> Subject: Re: [gt-users] method to either delete a child from a
> FeatureNode, or to update its type
>
> Hi Mauricio,
>
> > Is there a way to update the type of an already existing child feature?
> What about to remove it and recreate a correct one?
>
> there wasn't any, but I just added a set_type method to the C lib and
> the python bindings ;-)
> I didn't need one before...
>
>
> > I am trying to correct the type for the wrongly labeled UTRs in the
> GFF files I am working with (I sent two sample GFF files yesterday in the
> thread "A series of questions regarding GenomeTools C and its Python
> interface") and since I don't see a way to modify (or have access to) a
> FeatureNode's type with something like FeatureNode.setType() I was instead
> trying to remove the child node (with fn.__del__) and recreating a new one
> in its place.
> >
> > Of the two choices, it might be cleaner just o update the type. The
> sample GFF contains some gene models for which the UTRs labels are
> reversed (5' should be 3' or viceversa).
> >
> > Please see my python function below where I was trying to take a pointer
> to the current child_feature, checking it and returning the same one if
> nothing needed updating or destroying it and recreating a new one. See
> line annotated with "****"
>
> Your code didn't work, because the feature iterator gives you new
> references during the traversal. I.e., fn.__del__() just deletes the
> new reference but leaves the traversed feature intact. You would have
> to modify the traversed feature (i.e., remove a child), but that isn't
> available in the Python bindings yet. In the C library I have a method
> which removes a leaf (i.e., a feature without any children), because
> in this case it is clear what to do.
>
> But in your case, just using set_type is the better solution anyway.
>
> Gordon
> _______________________________________________
> gt-users mailing list
> gt-users at genometools.org
> http://genometools.org/mailman/listinfo/gt-users
This communication is for use by the intended recipient and contains
information that may be Privileged, confidential or copyrighted under
applicable law. If you are not the intended recipient, you are hereby
formally notified that any use, copying or distribution of this e-mail,
in whole or in part, is strictly prohibited. Please notify the sender by
return e-mail and delete this e-mail from your system. Unless explicitly
and conspicuously designated as "E-Contract Intended", this e-mail does
not constitute a contract offer, a contract amendment, or an acceptance
of a contract offer. This e-mail does not constitute a consent to the
use of sender's contact information for direct marketing purposes or for
transfers of data to third parties.
Francais Deutsch Italiano Espanol Portugues Japanese Chinese Korean
http://www.DuPont.com/corp/email_disclaimer.html
More information about the gt-users
mailing list