ajseqwrite.c

Datatypes:
AjPSeqout Sequence output
AjPStr Sequence output strings


Datatype: AjPSeqout

Function is for manipulating sequence output objects

Sections:
Sequence Output ConstructorsConstructors
destructorsDestructors


AjPSeqout: Sequence Output Constructors

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:
ajSeqoutNewCreates a new sequence output object.
ajSeqoutNewFileCreates a new sequence output object using a pre-opened file.
ajSeqoutNewFormatCCreates a new sequence output object with a specified format.
ajSeqoutNewFormatSCreates a new sequence output object with a specified format.


Function ajSeqoutNew

Creates a new sequence output object.

Prototype

AjPSeqout ajSeqoutNew (
      void
);

TypeNameRead/WriteDescription
AjPSeqout RETURNNew sequence output object.

From EMBOSS 1.0.0


Function ajSeqoutNewFile

Creates a new sequence output object using a pre-opened file.

Prototype

AjPSeqout ajSeqoutNewFile (
      AjPFile file
);

TypeNameRead/WriteDescription
AjPFilefileModifyOpen file object
AjPSeqout RETURNNew sequence output object.

From EMBOSS 4.1.0


Function ajSeqoutNewFormatC

Creates a new sequence output object with a specified format.

Prototype

AjPSeqout ajSeqoutNewFormatC (
      const char* txt
);

TypeNameRead/WriteDescription
const char*txtInputOutput sequence format
AjPSeqout RETURNNew sequence output object.

From EMBOSS 5.0.0


Function ajSeqoutNewFormatS

Creates a new sequence output object with a specified format.

Prototype

AjPSeqout ajSeqoutNewFormatS (
      const AjPStr str
);

TypeNameRead/WriteDescription
const AjPStrstrInputOutput sequence format
AjPSeqout RETURNNew sequence output object.

From EMBOSS 5.0.0


AjPSeqout: destructors

Destruction destroys all internal data structures and frees the memory allocated for the sequence output object.

Functions:
ajSeqoutDelDestructor for AjPSeqout objects


Function ajSeqoutDel

Destructor for AjPSeqout objects

Prototype

void ajSeqoutDel (
      AjPSeqout* Pseqout
);

TypeNameRead/WriteDescription
AjPSeqout*PseqoutDeleteSequence output object
void RETURN

From EMBOSS 2.9.0


AjPSeqout: Sequence Stream output

These functions output the contents of a sequence stream object. As the input is a stream they expect to be called again.

Functions:
ajSeqoutWriteSeqWrite next sequence out - continue until done.
ajSeqoutWriteSetWrite a set of sequences out.


Function ajSeqoutWriteSeq

Write next sequence out - continue until done.

Prototype

AjBool ajSeqoutWriteSeq (
      AjPSeqout outseq,
      const AjPSeq seq
);

TypeNameRead/WriteDescription
AjPSeqoutoutseqModifySequence output.
const AjPSeqseqInputSequence.
AjBool RETURNTrue 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.

From EMBOSS 4.1.0


Function ajSeqoutWriteSet

Write a set of sequences out.

Prototype

AjBool ajSeqoutWriteSet (
      AjPSeqout outseq,
      const AjPSeqset seq
);

TypeNameRead/WriteDescription
AjPSeqoutoutseqModifySequence output.
const AjPSeqsetseqInputSequence set.
AjBool RETURNTrue on success

From EMBOSS 4.1.0


AjPSeqout: non-standard output

Writes a sequence string in SWISSPROT format with a user-defined line code

Functions:
ajSeqoutDumpSwisslikeWrites a sequence in SWISSPROT format with a user-defined line code


Function ajSeqoutDumpSwisslike

Writes a sequence in SWISSPROT format with a user-defined line code

Prototype

void ajSeqoutDumpSwisslike (
      AjPSeqout outseq,
      const AjPStr seq,
      const char* prefix
);

TypeNameRead/WriteDescription
AjPSeqoutoutseqOutputSequence output object
const AjPStrseqInputsequence
const char*prefixInputline prefix code - should be 2 characters
void RETURN

From EMBOSS 5.0.0


AjPSeqout: sequence output opening

These functions use the contents of a sequence output object and update them.

Functions:
ajSeqoutClearClears a Sequence output object back to "as new" condition
ajSeqoutClearUsaCreates or resets a sequence output object using a new Universal Sequence Address
ajSeqoutCloseClose a sequence output file. For formats that save everything up and write at the end, call the Write function first.
ajSeqoutFlushFlush output to a sequence output file. For formats that save everything up and write at the end, call the Write function first.
ajSeqoutOpenIf the file is not yet open, calls seqoutUsaProcess to convert the USA into an open output file stream.
ajSeqoutOpenFilenameOpens an output file for sequence writing. 'stdout' and 'stderr' are special cases using standard output and standard error respectively.
ajSeqoutResetClears a Sequence output object ready to accept further sequences


Function ajSeqoutClear

Clears a Sequence output object back to "as new" condition

Prototype

void ajSeqoutClear (
      AjPSeqout seqout
);

TypeNameRead/WriteDescription
AjPSeqoutseqoutModifySequence output object
void RETURN

From EMBOSS 1.0.0


Function ajSeqoutClearUsa

Creates or resets a sequence output object using a new Universal Sequence Address

Prototype

void ajSeqoutClearUsa (
      AjPSeqout seqout,
      const AjPStr usa
);

TypeNameRead/WriteDescription
AjPSeqoutseqoutModifySequence output object.
const AjPStrusaInputUSA
void RETURN

From EMBOSS 5.0.0


Function ajSeqoutClose

Close a sequence output file. For formats that save everything up and write at the end, call the Write function first.

Prototype

void ajSeqoutClose (
      AjPSeqout seqout
);

TypeNameRead/WriteDescription
AjPSeqoutseqoutModifySequence output
void RETURN

From EMBOSS 4.1.0


Function ajSeqoutFlush

Flush output to a sequence output file. For formats that save everything up and write at the end, call the Write function first.

Prototype

void ajSeqoutFlush (
      AjPSeqout seqout
);

TypeNameRead/WriteDescription
AjPSeqoutseqoutModifySequence output
void RETURN

From EMBOSS 6.1.0


Function ajSeqoutOpen

If the file is not yet open, calls seqoutUsaProcess to convert the USA into an open output file stream.

Prototype

AjBool ajSeqoutOpen (
      AjPSeqout seqout
);

TypeNameRead/WriteDescription
AjPSeqoutseqoutOutputSequence output object.
AjBool RETURNajTrue on success.

From EMBOSS 1.0.0


Function ajSeqoutOpenFilename

Opens an output file for sequence writing. 'stdout' and 'stderr' are special cases using standard output and standard error respectively.

Prototype

AjBool ajSeqoutOpenFilename (
      AjPSeqout seqout,
      const AjPStr name
);

TypeNameRead/WriteDescription
AjPSeqoutseqoutModifySequence output object.
const AjPStrnameInputOutput filename.
AjBool RETURNajTrue on success.

From EMBOSS 4.1.0


Function ajSeqoutReset

Clears a Sequence output object ready to accept further sequences

Prototype

void ajSeqoutReset (
      AjPSeqout seqout
);

TypeNameRead/WriteDescription
AjPSeqoutseqoutModifySequence output object
void RETURN

From EMBOSS 6.1.0


AjPSeqout: set

Functions:
ajSeqoutSetFormatCSets the output format. Currently hard coded but will be replaced in future by a variable.
ajSeqoutSetFormatSSets the output format. Currently hard coded but will be replaced in future by a variable.
ajSeqoutSetNameDefaultCProvides a unique (for this program run) name for a sequence.
ajSeqoutSetNameDefaultSProvides a unique (for this program run) name for a sequence.


Function ajSeqoutSetFormatC

Sets the output format. Currently hard coded but will be replaced in future by a variable.

Prototype

AjBool ajSeqoutSetFormatC (
      AjPSeqout seqout,
      const char* txt
);

TypeNameRead/WriteDescription
AjPSeqoutseqoutModifySequence output object.
const char*txtInputOutput format.
AjBool RETURNajTrue on success.

From EMBOSS 5.0.0


Function ajSeqoutSetFormatS

Sets the output format. Currently hard coded but will be replaced in future by a variable.

Prototype

AjBool ajSeqoutSetFormatS (
      AjPSeqout seqout,
      const AjPStr str
);

TypeNameRead/WriteDescription
AjPSeqoutseqoutModifySequence output object.
const AjPStrstrInputOutput format.
AjBool RETURNajTrue on success.

From EMBOSS 5.0.0


Function ajSeqoutSetNameDefaultC

Provides a unique (for this program run) name for a sequence.

Prototype

AjBool ajSeqoutSetNameDefaultC (
      AjPSeqout seqout,
      AjBool multi,
      const char* txt
);

TypeNameRead/WriteDescription
AjPSeqoutseqoutOutputSequence output object
AjBoolmultiInputIf true, appends a number to the name.
const char*txtInputName set by caller
AjBool RETURNTrue on success

From EMBOSS 5.0.0


Function ajSeqoutSetNameDefaultS

Provides a unique (for this program run) name for a sequence.

Prototype

AjBool ajSeqoutSetNameDefaultS (
      AjPSeqout seqout,
      AjBool multi,
      const AjPStr str
);

TypeNameRead/WriteDescription
AjPSeqoutseqoutOutputSequence output object
AjBoolmultiInputIf true, appends a number to the name.
const AjPStrstrInputName set by caller
AjBool RETURNTrue on success

From EMBOSS 5.0.0


AjPSeqout: print

Functions:
ajSeqoutPrintFormatReports the internal data structures
ajSeqoutPrintbookFormatReports the internal data structures as EMBOSS book format
ajSeqoutPrinthtmlFormatReports the internal data structures as wikitext
ajSeqoutPrintwikiFormatReports the internal data structures as wikitext


Function ajSeqoutPrintFormat

Reports the internal data structures

Prototype

void ajSeqoutPrintFormat (
      AjPFile outf,
      AjBool full
);

TypeNameRead/WriteDescription
AjPFileoutfModifyOutput file
AjBoolfullInputFull report (usually ajFalse)
void RETURN

From EMBOSS 5.0.0


Function ajSeqoutPrintbookFormat

Reports the internal data structures as EMBOSS book format

Prototype

void ajSeqoutPrintbookFormat (
      AjPFile outf
);

TypeNameRead/WriteDescription
AjPFileoutfModifyOutput file
void RETURN

From EMBOSS 6.2.0


Function ajSeqoutPrinthtmlFormat

Reports the internal data structures as wikitext

Prototype

void ajSeqoutPrinthtmlFormat (
      AjPFile outf
);

TypeNameRead/WriteDescription
AjPFileoutfModifyOutput file
void RETURN

From EMBOSS 6.2.0


Function ajSeqoutPrintwikiFormat

Reports the internal data structures as wikitext

Prototype

void ajSeqoutPrintwikiFormat (
      AjPFile outf
);

TypeNameRead/WriteDescription
AjPFileoutfModifyOutput file
void RETURN

From EMBOSS 6.2.0


AjPSeqout: Sequence Output Casts

Functions:
ajSeqoutGetBasecountCounts the numbers of A, C, G and T in a nucleotide sequence.
ajSeqoutGetCheckgcgCalculates a GCG checksum for an output sequence.
ajSeqoutGetFilenameReturns the filename for a sequence output object


Function ajSeqoutGetBasecount

Counts the numbers of A, C, G and T in a nucleotide sequence.

Prototype

void ajSeqoutGetBasecount (
      const AjPSeqout seqout,
      ajuint* bases
);

TypeNameRead/WriteDescription
const AjPSeqoutseqoutInputSequence output object
ajuint*basesOutputInteger array, minimum size 5, to hold the results.
void RETURN

From EMBOSS 5.0.0


Function ajSeqoutGetCheckgcg

Calculates a GCG checksum for an output sequence.

Prototype

ajint ajSeqoutGetCheckgcg (
      const AjPSeqout seqout
);

TypeNameRead/WriteDescription
const AjPSeqoutseqoutInputOutput sequence.
ajint RETURNGCG checksum.

From EMBOSS 5.0.0


Function ajSeqoutGetFilename

Returns the filename for a sequence output object

Prototype

const AjPStr ajSeqoutGetFilename (
      const AjPSeqout seqout
);

TypeNameRead/WriteDescription
const AjPSeqoutseqoutInputSequence output object
const AjPStr RETURNFilename

From EMBOSS 6.1.0


AjPSeqout: debugging

Functions for reporting of a string object.

Functions:
ajSeqoutTraceDebug calls to trace the data in a sequence object.


Function ajSeqoutTrace

Debug calls to trace the data in a sequence object.

Prototype

void ajSeqoutTrace (
      const AjPSeqout seqout
);

TypeNameRead/WriteDescription
const AjPSeqoutseqoutInputSequence output object.
void RETURN

From EMBOSS 1.0.0


AjPSeqout: exit

Functions called on exit

Functions:
ajSeqoutExitCleans up sequence output processing internal memory


Function ajSeqoutExit

Cleans up sequence output processing internal memory

Prototype

void ajSeqoutExit (
      void
);

TypeNameRead/WriteDescription
void RETURN

From EMBOSS 5.0.0


Datatype: AjPStr

Function is for manipulating sequence output objects

Sections:
otherGeneral use


AjPStr: other

Functions:
ajSeqoutstrGetFormatDefaultSets the default output format. Checks the _OUTFORMAT variable, and uses FASTA if no other definition is found.
ajSeqoutstrIsFormatExistsChecks whether an output format name exists.
ajSeqoutstrIsFormatSingleChecks 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.


Function ajSeqoutstrGetFormatDefault

Sets the default output format. Checks the _OUTFORMAT variable, and uses FASTA if no other definition is found.

Prototype

AjBool ajSeqoutstrGetFormatDefault (
      AjPStr* Pformat
);

TypeNameRead/WriteDescription
AjPStr*PformatOutputDefault output format.
AjBool RETURNajTrue on success.

From EMBOSS 5.0.0


Function ajSeqoutstrIsFormatExists

Checks whether an output format name exists.

Prototype

AjBool ajSeqoutstrIsFormatExists (
      const AjPStr format
);

TypeNameRead/WriteDescription
const AjPStrformatInputOutput format required.
AjBool RETURNajTrue if format is known.

From EMBOSS 5.0.0


Function ajSeqoutstrIsFormatSingle

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.

Prototype

AjBool ajSeqoutstrIsFormatSingle (
      const AjPStr format
);

TypeNameRead/WriteDescription
const AjPStrformatInputOutput format required.
AjBool RETURNajTrue if separate file is needed for each sequence.

From EMBOSS 5.0.0