ajseqwrite.c
Datatypes: AjPSeqout AjPStr
Sequence output
Sections: Sequence Output Constructors destructors
All constructors return a new sequence output object by pointer. It
is the responsibility of the user to first destroy any previous
sequence output object. The target pointer does not need to be
initialised to NULL, but it is good programming practice to do so
anyway.
Functions: ajSeqoutNew ajSeqoutNewFile ajSeqoutNewFormatC ajSeqoutNewFormatS
Creates a new sequence output object.
Synopsis
Prototype
AjPSeqout ajSeqoutNew (
void
);
Type | Name | Read/Write | Description |
AjPSeqout | | RETURN | New sequence output object. |
Returns
AjPSeqout: | New sequence output object. |
Description
Creates a new sequence output object.
See Also
See other functions in this section
Availability
In release 6.4.0
Creates a new sequence output object using a pre-opened file.
Synopsis
Prototype
AjPSeqout ajSeqoutNewFile (
AjPFile file
);
Type | Name | Read/Write | Description |
AjPFile | file | Modify | Open file object |
AjPSeqout | | RETURN | New sequence output object. |
Input & Output
file: | (Modify) | Open file object |
Returns
AjPSeqout: | New sequence output object. |
Description
Creates a new sequence output object using a pre-opened file.
See Also
See other functions in this section
Availability
In release 6.4.0
Creates a new sequence output object with a specified format.
Synopsis
Prototype
AjPSeqout ajSeqoutNewFormatC (
const char* txt
);
Type | Name | Read/Write | Description |
const char* | txt | Input | Output sequence format |
AjPSeqout | | RETURN | New sequence output object. |
Input
txt: | (Input) | Output sequence format |
Returns
AjPSeqout: | New sequence output object. |
Description
Creates a new sequence output object with a specified format.
See Also
See other functions in this section
Availability
In release 6.4.0
Creates a new sequence output object with a specified format.
Synopsis
Prototype
AjPSeqout ajSeqoutNewFormatS (
const AjPStr str
);
Type | Name | Read/Write | Description |
const AjPStr | str | Input | Output sequence format |
AjPSeqout | | RETURN | New sequence output object. |
Input
str: | (Input) | Output sequence format |
Returns
AjPSeqout: | New sequence output object. |
Description
Creates a new sequence output object with a specified format.
See Also
See other functions in this section
Availability
In release 6.4.0
Destruction destroys all internal data structures and frees the
memory allocated for the sequence output object.
Functions: ajSeqoutDel
Destructor for AjPSeqout objects
Synopsis
Prototype
void ajSeqoutDel (
AjPSeqout* Pseqout
);
Type | Name | Read/Write | Description |
AjPSeqout* | Pseqout | Delete | Sequence output object |
void | | RETURN | |
Output
Pseqout: | (Delete) | Sequence output object |
Returns
Description
Destructor for AjPSeqout objects
See Also
See other functions in this section
Availability
In release 6.4.0
These functions output the contents of a sequence stream object.
As the input is a stream they expect to be called again.
Functions: ajSeqoutWriteSeq ajSeqoutWriteSet
Write next sequence out - continue until done.
Synopsis
Prototype
AjBool ajSeqoutWriteSeq (
AjPSeqout outseq,
const AjPSeq seq
);
Type | Name | Read/Write | Description |
AjPSeqout | outseq | Modify | Sequence output. |
const AjPSeq | seq | Input | Sequence. |
AjBool | | RETURN | True if sequence was successfully written.
Note if the save flag is true this means it was saved
to be written later when the output is closed. |
Input
Input & Output
outseq: | (Modify) | Sequence output. |
Returns
AjBool: | True if sequence was successfully written.
Note if the save flag is true this means it was saved
to be written later when the output is closed. |
Description
Write next sequence out - continue until done.
See Also
See other functions in this section
Availability
In release 6.4.0
Write a set of sequences out.
Synopsis
Prototype
AjBool ajSeqoutWriteSet (
AjPSeqout outseq,
const AjPSeqset seq
);
Type | Name | Read/Write | Description |
AjPSeqout | outseq | Modify | Sequence output. |
const AjPSeqset | seq | Input | Sequence set. |
AjBool | | RETURN | True on success |
Input
Input & Output
outseq: | (Modify) | Sequence output. |
Returns
Description
Write a set of sequences out.
See Also
See other functions in this section
Availability
In release 6.4.0
Writes a sequence string in SWISSPROT format with a user-defined line code
Functions: ajSeqoutDumpSwisslike
Writes a sequence in SWISSPROT format with a user-defined line code
Synopsis
Prototype
void ajSeqoutDumpSwisslike (
AjPSeqout outseq,
const AjPStr seq,
const char* prefix
);
Type | Name | Read/Write | Description |
AjPSeqout | outseq | Output | Sequence output object |
const AjPStr | seq | Input | sequence |
const char* | prefix | Input | line prefix code - should be 2 characters |
void | | RETURN | |
Input
seq: | (Input) | sequence |
prefix: | (Input) | line prefix code - should be 2 characters |
Output
outseq: | (Output) | Sequence output object |
Returns
Description
Writes a sequence in SWISSPROT format with a user-defined line code
See Also
See other functions in this section
Availability
In release 6.4.0
These functions use the contents of a sequence output object and
update them.
Functions: ajSeqoutClear ajSeqoutClearUsa ajSeqoutClose ajSeqoutFlush ajSeqoutOpen ajSeqoutOpenFilename ajSeqoutReset
Clears a Sequence output object back to "as new" condition
Synopsis
Prototype
void ajSeqoutClear (
AjPSeqout seqout
);
Type | Name | Read/Write | Description |
AjPSeqout | seqout | Modify | Sequence output object |
void | | RETURN | |
Input & Output
seqout: | (Modify) | Sequence output object |
Returns
Description
Clears a Sequence output object back to "as new" condition
See Also
See other functions in this section
Availability
In release 6.4.0
Creates or resets a sequence output object using a new Universal
Sequence Address
Synopsis
Prototype
void ajSeqoutClearUsa (
AjPSeqout seqout,
const AjPStr usa
);
Type | Name | Read/Write | Description |
AjPSeqout | seqout | Modify | Sequence output object. |
const AjPStr | usa | Input | USA |
void | | RETURN | |
Input
Input & Output
seqout: | (Modify) | Sequence output object. |
Returns
Description
Creates or resets a sequence output object using a new Universal
Sequence Address
See Also
See other functions in this section
Availability
In release 6.4.0
Close a sequence output file. For formats that save everything up
and write at the end, call the Write function first.
Synopsis
Prototype
void ajSeqoutClose (
AjPSeqout seqout
);
Type | Name | Read/Write | Description |
AjPSeqout | seqout | Modify | Sequence output |
void | | RETURN | |
Input & Output
seqout: | (Modify) | Sequence output |
Returns
Description
Close a sequence output file. For formats that save everything up
and write at the end, call the Write function first.
See Also
See other functions in this section
Availability
In release 6.4.0
Flush output to a sequence output file. For formats that save everything up
and write at the end, call the Write function first.
Do not close the file. It can be reused for more output
Synopsis
Prototype
void ajSeqoutFlush (
AjPSeqout seqout
);
Type | Name | Read/Write | Description |
AjPSeqout | seqout | Modify | Sequence output |
void | | RETURN | |
Input & Output
seqout: | (Modify) | Sequence output |
Returns
Description
Flush output to a sequence output file. For formats that save everything up
and write at the end, call the Write function first.
Do not close the file. It can be reused for more output
See Also
See other functions in this section
Availability
In release 6.4.0
If the file is not yet open, calls seqoutUsaProcess to convert the USA into
an open output file stream.
Returns the results in the AjPSeqout object.
Synopsis
Prototype
AjBool ajSeqoutOpen (
AjPSeqout seqout
);
Type | Name | Read/Write | Description |
AjPSeqout | seqout | Output | Sequence output object. |
AjBool | | RETURN | ajTrue on success. |
Output
seqout: | (Output) | Sequence output object. |
Returns
AjBool: | ajTrue on success. |
Description
If the file is not yet open, calls seqoutUsaProcess to convert the USA into
an open output file stream.
Returns the results in the AjPSeqout object.
See Also
See other functions in this section
Availability
In release 6.4.0
Opens an output file for sequence writing. 'stdout' and 'stderr' are
special cases using standard output and standard error respectively.
Synopsis
Prototype
AjBool ajSeqoutOpenFilename (
AjPSeqout seqout,
const AjPStr name
);
Type | Name | Read/Write | Description |
AjPSeqout | seqout | Modify | Sequence output object. |
const AjPStr | name | Input | Output filename. |
AjBool | | RETURN | ajTrue on success. |
Input
name: | (Input) | Output filename. |
Input & Output
seqout: | (Modify) | Sequence output object. |
Returns
AjBool: | ajTrue on success. |
Description
Opens an output file for sequence writing. 'stdout' and 'stderr' are
special cases using standard output and standard error respectively.
See Also
See other functions in this section
Availability
In release 6.4.0
Clears a Sequence output object ready to accept further sequences
Synopsis
Prototype
void ajSeqoutReset (
AjPSeqout seqout
);
Type | Name | Read/Write | Description |
AjPSeqout | seqout | Modify | Sequence output object |
void | | RETURN | |
Input & Output
seqout: | (Modify) | Sequence output object |
Returns
Description
Clears a Sequence output object ready to accept further sequences
See Also
See other functions in this section
Availability
In release 6.4.0
Functions: ajSeqoutSetFormatC ajSeqoutSetFormatS ajSeqoutSetNameDefaultC ajSeqoutSetNameDefaultS
Sets the output format. Currently hard coded but will be replaced
in future by a variable.
Synopsis
Prototype
AjBool ajSeqoutSetFormatC (
AjPSeqout seqout,
const char* txt
);
Type | Name | Read/Write | Description |
AjPSeqout | seqout | Modify | Sequence output object. |
const char* | txt | Input | Output format. |
AjBool | | RETURN | ajTrue on success. |
Input
txt: | (Input) | Output format. |
Input & Output
seqout: | (Modify) | Sequence output object. |
Returns
AjBool: | ajTrue on success. |
Description
Sets the output format. Currently hard coded but will be replaced
in future by a variable.
See Also
See other functions in this section
Availability
In release 6.4.0
Sets the output format. Currently hard coded but will be replaced
in future by a variable.
Synopsis
Prototype
AjBool ajSeqoutSetFormatS (
AjPSeqout seqout,
const AjPStr str
);
Type | Name | Read/Write | Description |
AjPSeqout | seqout | Modify | Sequence output object. |
const AjPStr | str | Input | Output format. |
AjBool | | RETURN | ajTrue on success. |
Input
str: | (Input) | Output format. |
Input & Output
seqout: | (Modify) | Sequence output object. |
Returns
AjBool: | ajTrue on success. |
Description
Sets the output format. Currently hard coded but will be replaced
in future by a variable.
See Also
See other functions in this section
Availability
In release 6.4.0
Provides a unique (for this program run) name for a sequence.
Synopsis
Prototype
AjBool ajSeqoutSetNameDefaultC (
AjPSeqout seqout,
AjBool multi,
const char* txt
);
Type | Name | Read/Write | Description |
AjPSeqout | seqout | Output | Sequence output object |
AjBool | multi | Input | If true, appends a number to the name. |
const char* | txt | Input | Name set by caller |
AjBool | | RETURN | True on success |
Input
multi: | (Input) | If true, appends a number to the name. |
txt: | (Input) | Name set by caller |
Output
seqout: | (Output) | Sequence output object |
Returns
Description
Provides a unique (for this program run) name for a sequence.
See Also
See other functions in this section
Availability
In release 6.4.0
Provides a unique (for this program run) name for a sequence.
Synopsis
Prototype
AjBool ajSeqoutSetNameDefaultS (
AjPSeqout seqout,
AjBool multi,
const AjPStr str
);
Type | Name | Read/Write | Description |
AjPSeqout | seqout | Output | Sequence output object |
AjBool | multi | Input | If true, appends a number to the name. |
const AjPStr | str | Input | Name set by caller |
AjBool | | RETURN | True on success |
Input
multi: | (Input) | If true, appends a number to the name. |
str: | (Input) | Name set by caller |
Output
seqout: | (Output) | Sequence output object |
Returns
Description
Provides a unique (for this program run) name for a sequence.
See Also
See other functions in this section
Availability
In release 6.4.0
Functions: ajSeqoutPrintFormat ajSeqoutPrintbookFormat ajSeqoutPrinthtmlFormat ajSeqoutPrintwikiFormat
Reports the internal data structures
Synopsis
Prototype
void ajSeqoutPrintFormat (
AjPFile outf,
AjBool full
);
Type | Name | Read/Write | Description |
AjPFile | outf | Modify | Output file |
AjBool | full | Input | Full report (usually ajFalse) |
void | | RETURN | |
Input
full: | (Input) | Full report (usually ajFalse) |
Input & Output
Returns
Description
Reports the internal data structures
See Also
See other functions in this section
Availability
In release 6.4.0
Reports the internal data structures as EMBOSS book format
Synopsis
Prototype
void ajSeqoutPrintbookFormat (
AjPFile outf
);
Type | Name | Read/Write | Description |
AjPFile | outf | Modify | Output file |
void | | RETURN | |
Input & Output
Returns
Description
Reports the internal data structures as EMBOSS book format
See Also
See other functions in this section
Availability
In release 6.4.0
Reports the internal data structures as wikitext
Synopsis
Prototype
void ajSeqoutPrinthtmlFormat (
AjPFile outf
);
Type | Name | Read/Write | Description |
AjPFile | outf | Modify | Output file |
void | | RETURN | |
Input & Output
Returns
Description
Reports the internal data structures as wikitext
See Also
See other functions in this section
Availability
In release 6.4.0
Reports the internal data structures as wikitext
Synopsis
Prototype
void ajSeqoutPrintwikiFormat (
AjPFile outf
);
Type | Name | Read/Write | Description |
AjPFile | outf | Modify | Output file |
void | | RETURN | |
Input & Output
Returns
Description
Reports the internal data structures as wikitext
See Also
See other functions in this section
Availability
In release 6.4.0
Functions: ajSeqoutGetBasecount ajSeqoutGetCheckgcg ajSeqoutGetFilename
Counts the numbers of A, C, G and T in a nucleotide sequence.
Synopsis
Prototype
void ajSeqoutGetBasecount (
const AjPSeqout seqout,
ajuint* bases
);
Type | Name | Read/Write | Description |
const AjPSeqout | seqout | Input | Sequence output object |
ajuint* | bases | Output | Integer array, minimum size 5,
to hold the results. |
void | | RETURN | |
Input
seqout: | (Input) | Sequence output object |
Output
bases: | (Output) | Integer array, minimum size 5,
to hold the results. |
Returns
Description
Counts the numbers of A, C, G and T in a nucleotide sequence.
See Also
See other functions in this section
Availability
In release 6.4.0
Calculates a GCG checksum for an output sequence.
Synopsis
Prototype
ajint ajSeqoutGetCheckgcg (
const AjPSeqout seqout
);
Type | Name | Read/Write | Description |
const AjPSeqout | seqout | Input | Output sequence. |
ajint | | RETURN | GCG checksum. |
Input
seqout: | (Input) | Output sequence. |
Returns
Description
Calculates a GCG checksum for an output sequence.
See Also
See other functions in this section
Availability
In release 6.4.0
Returns the filename for a sequence output object
Synopsis
Prototype
const AjPStr ajSeqoutGetFilename (
const AjPSeqout seqout
);
Type | Name | Read/Write | Description |
const AjPSeqout | seqout | Input | Sequence output object |
const AjPStr | | RETURN | Filename |
Input
seqout: | (Input) | Sequence output object |
Returns
Description
Returns the filename for a sequence output object
See Also
See other functions in this section
Availability
In release 6.4.0
Functions for reporting of a string object.
Functions: ajSeqoutTrace
Debug calls to trace the data in a sequence object.
Synopsis
Prototype
void ajSeqoutTrace (
const AjPSeqout seqout
);
Type | Name | Read/Write | Description |
const AjPSeqout | seqout | Input | Sequence output object. |
void | | RETURN | |
Input
seqout: | (Input) | Sequence output object. |
Returns
Description
Debug calls to trace the data in a sequence object.
See Also
See other functions in this section
Availability
In release 6.4.0
Functions called on exit
Functions: ajSeqoutExit
Cleans up sequence output processing internal memory
Synopsis
Prototype
void ajSeqoutExit (
void
);
Type | Name | Read/Write | Description |
void | | RETURN | |
Returns
Description
Cleans up sequence output processing internal memory
See Also
See other functions in this section
Availability
In release 6.4.0
Sequence output strings
Sections: other
Functions: ajSeqoutstrGetFormatDefault ajSeqoutstrIsFormatExists ajSeqoutstrIsFormatSingle
Sets the default output format.
Checks the _OUTFORMAT variable,
and uses FASTA if no other definition is found.
Synopsis
Prototype
AjBool ajSeqoutstrGetFormatDefault (
AjPStr* Pformat
);
Type | Name | Read/Write | Description |
AjPStr* | Pformat | Output | Default output format. |
AjBool | | RETURN | ajTrue on success. |
Output
Pformat: | (Output) | Default output format. |
Returns
AjBool: | ajTrue on success. |
Description
Sets the default output format.
Checks the _OUTFORMAT variable,
and uses FASTA if no other definition is found.
See Also
See other functions in this section
Availability
In release 6.4.0
Checks whether an output format name exists.
Synopsis
Prototype
AjBool ajSeqoutstrIsFormatExists (
const AjPStr format
);
Type | Name | Read/Write | Description |
const AjPStr | format | Input | Output format required. |
AjBool | | RETURN | ajTrue if format is known. |
Input
format: | (Input) | Output format required. |
Returns
AjBool: | ajTrue if format is known. |
Description
Checks whether an output format name exists.
See Also
See other functions in this section
Availability
In release 6.4.0
Checks whether an output format should go to single files, rather than
all sequences being written to one file. Some formats do not work when
more than one sequence is written to a file. Obvious examples are plain
text and GCG formats.
Synopsis
Prototype
AjBool ajSeqoutstrIsFormatSingle (
const AjPStr format
);
Type | Name | Read/Write | Description |
const AjPStr | format | Input | Output format required. |
AjBool | | RETURN | ajTrue if separate file is needed for each sequence. |
Input
format: | (Input) | Output format required. |
Returns
AjBool: | ajTrue if separate file is needed for each sequence. |
Description
Checks whether an output format should go to single files, rather than
all sequences being written to one file. Some formats do not work when
more than one sequence is written to a file. Obvious examples are plain
text and GCG formats.
See Also
See other functions in this section
Availability
In release 6.4.0