Standardising program output

David Martin damartin at ulrik.uio.no
Sun Sep 10 12:19:34 UTC 2000


To make it easier for script addicts like me, would it be possible to get
som esort of standardised output for certain types of analysis programs
that calculate a single value (or values) for a sequence. 

eg
#Name	Start	End	Value1	[Value2	[Value3...]]


This would make automated provessing of large numbers of sequences much
easier. (Yes I know that btwisted doesn't conform to this.) 

I looked at infoseq and it looks kind of ugly with all the if
(html) clauses.

Would it not be easier to have a single function

ajFmtPrintData( AjPFile outfile, int outputtype, AjPSeq sequence, AjPList
results);

where the outfile is the file to which to print, outputtype is the type
of text output to produce and is handled by defines so you would use
PLAIN_TEXT, HTML_TEXT, XML_TEXT etc. allowing for more text formats to be 
coded without having to touch the application (*), the sequence is used to
get the name, start and
end, and the list contains a list of results that are then printed in a
tab separated manner (probably already converted to strings before adding
to the list.)

There would be a similar function 
ajFmtPrintDataHeader( AjPFile outfile, int outputtype , char * appname,
AjPSeq
sequence, AjPList results);

which would print the header line:

#Output from appname at date and time
#Name	Start	End	Val1 	Val2 ...

where val1, val2, and so on are teh headers put in an AjList.

It tidies up the coding somewhat and enforces a consistency of output. It
also means that every program can easily be upgraded without recoding when
someone wants a new format.

This could possibly be done better by creating a 'data outfile' object
 (-odata output -odformat html or -oresults outfile -orformat plain)

possible output formats could be:

plain  	(tab delimited columns)
csv	(Comma Separated Values)
html	
xml	(in some format yet to be determined.)
sql 	(INSERT INTO appnameresults (name, start, end, val1, val2) VALUES
( ... ));
 
or even some binary formats if people really want to code them.


Thoughts?

..d


---------------------------------------------------------------------
*  Dr. David Martin                  Biotechnology Centre of Oslo   *
*  Node Manager                      Gaustadalleen 21               *
*  The Norwegian EMBNet Node         P.O. box 1125 Blindern         *
*  tel +47 22 95 87 56               N-0317 Oslo                    *
*  fax +47 22 69 41 30               Norway                         * 
---------------------------------------------------------------------








More information about the emboss-dev mailing list