std::map<ncbi::CFormatGuess::EFormat, std::string>
FormatMap;
83 virtual void Init(
void);
84 virtual int Run(
void);
85 virtual void Exit(
void);
114arg_desc->SetUsageContext
116 "CFormatGuess front end: Guess various file formats");
121arg_desc->AddDefaultKey
122(
"i",
"InputFile",
123 "Input File Name or '-' for stdin.",
129 "Use the canonical name which is the name of the format as " 130 "given by the underlying C++ format guesser.");
134 "Make output include the type of the object. If it cannot be " 135 "determined or does not make sense for the given format then it " 136 "considers it 'unknown'" 139arg_desc->AddDefaultKey(
140 "output-format",
"OutputFormat",
141 "How this program should send the results of its guesses.",
166 if( args[
"canonical-name"] ) {
185 "Five column feature table";
190 "Flat file sequence portion";
201 FormatIterit = FormatStrings.find( uFormat );
202 if( it == FormatStrings.end() ) {
207format_name = it->second;
211 stringobject_type_to_show(
"unknown");
212 if( args[
"show-object-type"] ) {
225 const stringoutput_format = args[
"output-format"].AsString();
227 stringname_of_input_stream = args[
"i"].AsString();
228 if( name_of_input_stream.empty() || name_of_input_stream ==
"-") {
229name_of_input_stream =
"stdin";
231 if( output_format ==
"text") {
232cout << name_of_input_stream <<
" : ";
234 _ASSERT( ! format_name.empty() );
238 if( ! object_type_to_show.empty() ) {
239cout <<
", object type: "<< object_type_to_show;
243}
else if( output_format ==
"XML") {
249 xml::nodeinput_stream_node(
"input_stream");
251stream_attribs.
insert(
"name", name_of_input_stream.c_str());
252stream_attribs.
insert(
"format_name", format_name.c_str());
253 if( ! object_type_to_show.empty() ) {
254stream_attribs.
insert(
"object_type", object_type_to_show.c_str());
257output_node.
push_back(input_stream_node);
276 int main(
intargc,
const char* argv[])
User-defined methods of the data storage class.
This file contains the definition of the xml::attributes class.
static string guess_object_type(CObjectIStream &obj_istrm)
virtual int Run(void)
Run the application.
virtual void Init(void)
Initialize the application.
virtual void Exit(void)
Cleanup on application exit.
Wraps CFormatGuess, and if CFormatGuess's result is Unknown, it tries every file reader until one wor...
CFormatGuess::EFormat GuessFormatAndContent(CFileContentInfo &contentInfo)
void SetRecognizedGenbankTypes(const set< TTypeInfo > &recognizedGenbankTypes)
EFormat
The formats are checked in the same order as declared here.
@ eFiveColFeatureTable
Five-column feature table.
@ eBinaryASN
Binary ASN.1.
@ eGff2
GFF2, CGff2Reader, any GFF-like that doesn't fit the others.
@ eBed
UCSC BED file format, CBedReader.
@ eGtf
New GTF, CGtfReader.
@ eSnpMarkers
SNP Marker flat file.
@ eHgvs
HGVS, CHgvsParser.
@ eAgp
AGP format assembly, AgpRead.
@ eDistanceMatrix
Distance matrix file.
@ ePhrapAce
Phrap ACE assembly file.
@ eFlatFileSequence
GenBank/GenPept/DDBJ/EMBL flat-file sequence portion.
@ eGff3
GFF3, CGff3Reader.
@ eGlimmer3
Glimmer3 predictions.
@ eFasta
FASTA format sequence record, CFastaReader.
@ eUnknown
unknown format
@ eRmo
RepeatMasker Output.
@ eAlignment
Text alignment.
@ eBed15
UCSC BED15 or microarray format.
@ eWiggle
UCSC WIGGLE file format.
static const char * GetFormatName(EFormat format)
The xml::attributes class is used to access all the attributes of one xml::node.
void insert(const char *name, const char *value, const ns *nspace=NULL)
Add an attribute to the attributes list.
The xml::document class is used to hold the XML tree and various bits of information about it.
void save_to_stream(std::ostream &stream, save_option_flags flags=save_op_default) const
Convert the XML document tree into XML text data and then insert it into the given stream.
The xml::node class is used to hold information about one XML node.
void push_back(const node &child)
Add a child xml::node to this node.
xml::attributes & get_attributes(void)
Get the list of attributes.
int main(int argc, const char *argv[])
FormatMap::iterator FormatIter
std::map< ncbi::CFormatGuess::EFormat, std::string > FormatMap
set< TTypeInfo > sDefaultRecognizedGenbankObjectTypes
virtual const CArgs & GetArgs(void) const
Get parsed command line arguments.
int AppMain(int argc, const char *const *argv, const char *const *envp=0, EAppDiagStream diag=eDS_Default, const char *conf=NcbiEmptyCStr, const string &name=NcbiEmptyString)
Main function (entry point) for the NCBI application.
virtual void SetupArgDescriptions(CArgDescriptions *arg_desc)
Setup the command line argument descriptions.
const CNcbiArguments & GetArguments(void) const
Get the application's cached unprocessed command-line arguments.
@ eInputFile
Name of file (must exist and be readable)
@ eString
An arbitrary string.
@ fBinary
Open file in binary mode.
void SetDiagStream(CNcbiOstream *os, bool quick_flush=true, FDiagCleanup cleanup=0, void *cleanup_data=0, const string &stream_name="")
Set diagnostic stream.
@ eDS_Default
Try standard log file (app.name + ".log") in /log/, use stderr on failure.
static TTypeInfo GetTypeInfo(void)
IO_PREFIX::istream CNcbiIstream
Portable alias for istream.
This file contains the definition of the xml::document class.
This file contains the definition of the xml::node class.
Defines the CNcbiApplication and CAppException classes for creating NCBI applications.
Defines command line argument related classes.
Defines unified interface to application:
CFileContentInfoGenbank mInfoGenbank
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4