[Biojava-l] Propsed change for fastaFormat

Cox, Greg gcox@netgenics.com
Mon, 18 Feb 2002 17:34:00 -0500


What I'd like to do is write the name + description of a sequence out in
fasta format.  Right now, it prints the name for a non-phred file, and the
description of a phred file (greped the code for the key used; it's only in
phredFormat).  I don't work with phred files, so I don't want to bull in and
break things.  Could someone who uses phred look at this proposed change and
tell me if it would cause problems for you?	

	public static String PROPERTY_DESCRIPTIONLINE = "description_line";

	public void setPropertyDescriptionLine(String theLine) // New method
	{
		PROPERTY_DESCRIPTIONLINE = theLine;
	}

	public String getPropertyDescriptionLine() // New method
	{
		return PROPERTY_DESCRIPTIONLINE;
	}

	protected String describeSequence(Sequence seq) // Rewritten method
	{
	StringBuffer description = new StringBuffer(seq.getName());
	try 
	{
	description.append(" " +
seq.getAnnotation().getProperty(this.getPropertyDescriptionLine()).toString(
));
	} 
	catch (NoSuchElementException ex) 
	{
		// Intentionally blank
	}
	return description.toString();
	}

Thanks,
Greg Cox