57 virtual void Init(
void);
58 virtual int Run (
void);
66 arg_desc->AddKey(
"ace",
"AceFile",
"Source ACE file",
69 arg_desc->AddOptionalKey(
"asn",
"AsnFile",
70 "Output ASN.1 text file",
72 arg_desc->AddOptionalKey(
"asnb",
"AsnBinFile",
73 "Output ASN.1 binary file",
77 arg_desc->AddDefaultKey(
"no_complement",
78 "fPhrap_NoComplement",
79 "Ignore 'complemented' flags of traces",
82 arg_desc->AddDefaultKey(
"pack_data",
84 "Use best coding to pack sequence data",
87 arg_desc->AddDefaultKey(
"gaps",
89 "Add features with list of gaps",
92 arg_desc->AddDefaultKey(
"base_segs",
93 "fPhrap_FeatBaseSegs",
94 "Add features with base segments",
97 arg_desc->AddDefaultKey(
"read_locs",
98 "fPhrap_FeatReadLocs",
99 "Add features with padded read starts",
102 arg_desc->AddDefaultKey(
"tags",
104 "Convert CT and RT tags to features",
107 arg_desc->AddDefaultKey(
"quality",
108 "fPhrap_FeatQuality",
109 "Add quality/alignment features",
112 arg_desc->AddDefaultKey(
"descr",
114 "Add descriptors (DS and WA tags)",
117 arg_desc->AddDefaultKey(
"fuzz",
119 "Add padded coordinates using int-fuzz",
122 arg_desc->AddDefaultKey(
"align",
"AlignType",
125 arg_desc->SetConstraint(
"align",
127 "none",
"optimized",
"all",
"pairs"));
128 arg_desc->AddDefaultKey(
"ace_version",
"AceVersion",
129 "ACE format version",
131 arg_desc->SetConstraint(
"ace_version",
133 "auto",
"old",
"new"));
135 string prog_description =
"ACE to ASN.1 converter\n";
136 arg_desc->SetUsageContext(GetArguments().GetProgramBasename(),
137 prog_description,
false);
139 SetupArgDescriptions(arg_desc.release());
151 if ( args[
"no_complement"].AsBoolean() ) {
154 if ( args[
"pack_data"].AsBoolean() ) {
157 if ( args[
"gaps"].AsBoolean() ) {
160 if ( args[
"base_segs"].AsBoolean() ) {
163 if ( args[
"read_locs"].AsBoolean() ) {
166 if ( args[
"tags"].AsBoolean() ) {
169 if ( args[
"quality"].AsBoolean() ) {
172 if ( args[
"descr"].AsBoolean() ) {
175 if ( args[
"fuzz"].AsBoolean() ) {
179 if (args[
"align"].AsString() ==
"optimized") {
182 else if (args[
"align"].AsString() ==
"all") {
185 else if (args[
"align"].AsString() ==
"pairs") {
189 if (args[
"ace_version"].AsString() ==
"new") {
192 if (args[
"ace_version"].AsString() ==
"old") {
198 bool to_file = args[
"asn"] || args[
"asnb"];
220 int main(
int argc,
const char* argv[])
int main(int argc, const char *argv[])
virtual void Init(void)
Initialize the application.
virtual int Run(void)
Run the application.
Include a standard set of the NCBI C++ Toolkit most basic headers.
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.
@ fBinary
Open as binary file; for eInputFile, eOutputFile, eIOFile.
@ eInputFile
Name of file (must exist and be readable)
@ eBoolean
{'true', 't', 'false', 'f'}, case-insensitive
@ eString
An arbitrary string.
@ eOutputFile
Name of file (must be writable)
@ eDS_Default
Try standard log file (app.name + ".log") in /log/, use stderr on failure.
#define MSerial_AsnBinary
#define MSerial_AsnText
I/O stream manipulators –.
void Run(void)
Enter the main loop.
Magic spell ;-) needed for some weird compilers... very empiric.
Defines the CNcbiApplication and CAppException classes for creating NCBI applications.
#define GetArgs
Avoid preprocessor name clash with the NCBI C Toolkit.
Defines command line argument related classes.
Defines unified interface to application:
CRef< CSeq_entry > ReadPhrap(CNcbiIstream &in, TPhrapReaderFlags flags=fPhrap_Default)
@ fPhrap_AlignAll
global all-in-one alignment
@ fPhrap_FeatBaseSegs
add features with base segments
@ fPhrap_AlignPairs
separate alignment for each trace
@ fPhrap_NoComplement
ignore "complemented" flags of traces.
@ fPhrap_FeatGaps
add features with list of gaps
@ fPhrap_NewVersion
force new ACE format
@ fPhrap_Descr
add descriptors (DS, WA)
@ fPhrap_PadsToFuzz
Add int-fuzz.p-m to indicate padded coordinates offset.
@ fPhrap_FeatReadLocs
add padded read starts
@ fPhrap_FeatQuality
add quality/alignment features
@ fPhrap_AlignOptimized
split global alignment into parts
@ fPhrap_OldVersion
force old ACE format
@ fPhrap_FeatTags
convert CT and RT tags to features
@ fPhrap_PackSeqData
use best coding to pack sequence data