[Biojava-l] Remove features from a sequence

Schreiber, Mark mark.schreiber at agresearch.co.nz
Sun Jun 22 17:44:41 EDT 2003


Hi -
 
As this is the second time this has come up, Keith, can I put your solution on Biojava in Anger?
 
- Mark
 

	-----Original Message----- 
	From: Keith James [mailto:kdj at sanger.ac.uk] 
	Sent: Thu 19/06/2003 9:33 p.m. 
	To: Ren, Zhen 
	Cc: biojava-l at biojava.org 
	Subject: Re: [Biojava-l] Remove features from a sequence
	
	

	>>>>> "Zhen" == Ren, Zhen <zren at amylin.com> writes:
	
	    Zhen> Hi, folks, How do I remove features from a sequence?  The
	    Zhen> interface FeatureHolder has a public method - public void
	    Zhen> removeFeature(Feature f) throws ChangeVetoException.  It is
	    Zhen> also the superinterface for Sequence.  However, I can not
	    Zhen> use the method (compile error) as shown in the following
	    Zhen> snippet.  Please help.  Thanks.
	
	
	[...]
	
	Hi,
	
	This will not compile because you have a typo at line 23: the method
	should be (as seq is a Sequence)
	
	 seq.removeFeature(feature)
	
	and not
	
	 seq.remove(feature)
	
	Note that when the typo is corrected the program will throw a
	java.util.ConcurrentModificationException as written because you are
	violating the Java Iterator contract. See the archive for messages
	from Mark and myself (in reply to Robert Stones) describing how to
	avoid this.
	
	hth, Keith
	
	--
	
	- Keith James <kdj at sanger.ac.uk> bioinformatics programming support -
	- Pathogen Sequencing Unit, The Wellcome Trust Sanger Institute, UK -
	
	_______________________________________________
	Biojava-l mailing list  -  Biojava-l at biojava.org
	http://biojava.org/mailman/listinfo/biojava-l
	


=======================================================================
Attention: The information contained in this message and/or attachments
from AgResearch Limited is intended only for the persons or entities
to which it is addressed and may contain confidential and/or privileged
material. Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipients is prohibited by AgResearch
Limited. If you have received this message in error, please notify the
sender immediately.
=======================================================================



More information about the Biojava-l mailing list