ajseqread.c


Section: Sequence Input Constructors

All constructors return a new sequence input object by pointer. It is the responsibility of the user to first destroy any previous sequence input object. The target pointer does not need to be initialised to NULL, but it is good programming practice to do so anyway.

Functions:
ajSeqinNewCreates a new sequence input object.


Function ajSeqinNew

Creates a new sequence input object.

Prototype

AjPSeqin ajSeqinNew (
      void
);

TypeNameRead/WriteDescription
AjPSeqin RETURNNew sequence input object.

From EMBOSS 1.0.0


Section: Sequence Input Destructors

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

Functions:
ajSeqinDelDeletes a sequence input object.


Function ajSeqinDel

Deletes a sequence input object.

Prototype

void ajSeqinDel (
      AjPSeqin* pthis
);

TypeNameRead/WriteDescription
AjPSeqin*pthisDeleteSequence input
void RETURN

From EMBOSS 1.0.0


Section: Sequence Input Modifiers

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

Functions:
ajSeqinUsaCreates or resets a sequence input object using a new Universal Sequence Address
ajSeqinSetNucSets the type to be forced as nucleic for a sequence input object
ajSeqinSetProtSets the type to be forced as protein for a sequence input object
ajSeqinSetRangeSets the start and end positions for a sequence input object


Function ajSeqinUsa

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

Prototype

void ajSeqinUsa (
      AjPSeqin* pthis,
      const AjPStr Usa
);

TypeNameRead/WriteDescription
AjPSeqin*pthisModifySequence input object.
const AjPStrUsaInputUSA
void RETURN

From EMBOSS 1.0.0


Function ajSeqinSetNuc

Sets the type to be forced as nucleic for a sequence input object

Prototype

void ajSeqinSetNuc (
      AjPSeqin seqin
);

TypeNameRead/WriteDescription
AjPSeqinseqinModifySequence input object to be set.
void RETURN

From EMBOSS 1.0.0


Function ajSeqinSetProt

Sets the type to be forced as protein for a sequence input object

Prototype

void ajSeqinSetProt (
      AjPSeqin seqin
);

TypeNameRead/WriteDescription
AjPSeqinseqinModifySequence input object to be set.
void RETURN

From EMBOSS 1.0.0


Function ajSeqinSetRange

Sets the start and end positions for a sequence input object

Prototype

void ajSeqinSetRange (
      AjPSeqin seqin,
      ajint ibegin,
      ajint iend
);

TypeNameRead/WriteDescription
AjPSeqinseqinModifySequence input object to be set.
ajintibeginInputStart position. Negative values are from the end.
ajintiendInputEnd position. Negative values are from the end.
void RETURN

From EMBOSS 1.0.0


Section: Sequence Input Operators

These functions use the contents of a sequence input object but do not make any changes.

Functions:
ajSeqAllReadParse a USA Uniform Sequence Address into format, access, file and entry
ajSeqallFileParse a USA Uniform Sequence Address
ajSeqallNextReads the next sequence into a sequence stream. For the first call this simply returns the sequence already loaded. For later calls a new sequence is read.
ajSeqinClearPosClears a Sequence input object position information as possibly read from a USA that included the begin, end and direction
ajSeqinClearClears a Sequence input object back to "as new" condition, except for the USA list and the features setting which must be preserved.


Function ajSeqAllRead

Parse a USA Uniform Sequence Address into format, access, file and entry

Prototype

AjBool ajSeqAllRead (
      AjPSeq thys,
      AjPSeqin seqin
);

TypeNameRead/WriteDescription
AjPSeqthysOutputSequence returned.
AjPSeqinseqinModifySequence input definitions
AjBool RETURNajTrue on success.

From EMBOSS 1.0.0


Function ajSeqallFile

Parse a USA Uniform Sequence Address

Prototype

AjPSeqall ajSeqallFile (
      const AjPStr usa
);

TypeNameRead/WriteDescription
const AjPStrusaInputsequence usa.
AjPSeqall RETURNseqall object

From EMBOSS 1.13.0


Function ajSeqallNext

Reads the next sequence into a sequence stream. For the first call this simply returns the sequence already loaded. For later calls a new sequence is read.

Prototype

AjBool ajSeqallNext (
      AjPSeqall seqall,
      AjPSeq* retseq
);

TypeNameRead/WriteDescription
AjPSeqallseqallModifySequence stream
AjPSeq*retseqOutputSequence
AjBool RETURNajTrue if a sequence was refound. ajFalse when all is done.

From EMBOSS 1.0.0


Function ajSeqinClearPos

Clears a Sequence input object position information as possibly read from a USA that included the begin, end and direction

Prototype

void ajSeqinClearPos (
      AjPSeqin thys
);

TypeNameRead/WriteDescription
AjPSeqinthysModifySequence input
void RETURN

From EMBOSS 2.9.0


Function ajSeqinClear

Clears a Sequence input object back to "as new" condition, except for the USA list and the features setting which must be preserved.

Prototype

void ajSeqinClear (
      AjPSeqin thys
);

TypeNameRead/WriteDescription
AjPSeqinthysOutputSequence input
void RETURN

From EMBOSS 1.0.0


Section: Sequence inputs

These functions read the sequence provided by the first argument

Functions:
ajSeqReadIf the file is not yet open, calls seqinUsaProcess to convert the USA into an open file stream.


Function ajSeqRead

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

Prototype

AjBool ajSeqRead (
      AjPSeq thys,
      AjPSeqin seqin
);

TypeNameRead/WriteDescription
AjPSeqthysOutputSequence returned.
AjPSeqinseqinModifySequence input definitions
AjBool RETURNajTrue on success.

From EMBOSS 1.0.0


Section: Sequence Set Inputs

These functions read the sequence set object provided as the first argument.

Functions:
ajSeqsetReadParse a USA Uniform Sequence Address into format, access, file and entry
ajSeqsetallReadParse a USA Uniform Sequence Address into format, access, file and entry
ajSeqsetFromListBuilds a sequence set from a list of sequences
ajSeqsetFromPairBuilds a sequence set from a pair of sequences
ajSeqsetAppAdds a sequence to a sequence set
ajSeqPrintInFormatReports the internal data structures
ajSeqPrintbookInFormatReports the internal data structures as a Docbook table
ajSeqPrinthtmlInFormatReports the internal data structures as an HTML table
ajSeqPrintwikiInFormatReports the internal data structures as a wiki table
ajSeqFormatTesttests whether a named format is known
ajSeqUsaGetBaseExtracts the base part from a USA, suitable for use in fetching other sequences from the same source


Function ajSeqsetRead

Parse a USA Uniform Sequence Address into format, access, file and entry

Prototype

AjBool ajSeqsetRead (
      AjPSeqset thys,
      AjPSeqin seqin
);

TypeNameRead/WriteDescription
AjPSeqsetthysOutputSequence set returned.
AjPSeqinseqinModifySequence input definitions
AjBool RETURNajTrue on success.

From EMBOSS 1.0.0


Function ajSeqsetallRead

Parse a USA Uniform Sequence Address into format, access, file and entry

Prototype

AjBool ajSeqsetallRead (
      AjPList thys,
      AjPSeqin seqin
);

TypeNameRead/WriteDescription
AjPListthysOutputList of sequence sets returned.
AjPSeqinseqinModifySequence input definitions
AjBool RETURNajTrue on success.

From EMBOSS 2.8.0


Function ajSeqsetFromList

Builds a sequence set from a list of sequences

Prototype

ajint ajSeqsetFromList (
      AjPSeqset thys,
      const AjPList list
);

TypeNameRead/WriteDescription
AjPSeqsetthysOutputSequence set
const AjPListlistInputList of sequence objects
ajint RETURNNumber of sequences in the set.

From EMBOSS 2.1.0


Function ajSeqsetFromPair

Builds a sequence set from a pair of sequences

Prototype

ajint ajSeqsetFromPair (
      AjPSeqset thys,
      const AjPSeq seqa,
      const AjPSeq seqb
);

TypeNameRead/WriteDescription
AjPSeqsetthysOutputSequence set
const AjPSeqseqaInputSequence 1
const AjPSeqseqbInputSequence 2
ajint RETURNNumber of sequences in the set.

From EMBOSS 2.1.0


Function ajSeqsetApp

Adds a sequence to a sequence set

Prototype

ajint ajSeqsetApp (
      AjPSeqset thys,
      const AjPSeq seq
);

TypeNameRead/WriteDescription
AjPSeqsetthysOutputSequence set
const AjPSeqseqInputSequence
ajint RETURNNumber of sequences in the set.

From EMBOSS 2.1.0


Function ajSeqPrintInFormat

Reports the internal data structures

Prototype

void ajSeqPrintInFormat (
      AjPFile outf,
      AjBool full
);

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

From EMBOSS 1.0.0


Function ajSeqPrintbookInFormat

Reports the internal data structures as a Docbook table

Prototype

void ajSeqPrintbookInFormat (
      AjPFile outf
);

TypeNameRead/WriteDescription
AjPFileoutfModifyOutput file
void RETURN

From EMBOSS 6.2.0


Function ajSeqPrinthtmlInFormat

Reports the internal data structures as an HTML table

Prototype

void ajSeqPrinthtmlInFormat (
      AjPFile outf
);

TypeNameRead/WriteDescription
AjPFileoutfModifyOutput file
void RETURN

From EMBOSS 6.2.0


Function ajSeqPrintwikiInFormat

Reports the internal data structures as a wiki table

Prototype

void ajSeqPrintwikiInFormat (
      AjPFile outf
);

TypeNameRead/WriteDescription
AjPFileoutfModifyOutput file
void RETURN

From EMBOSS 6.2.0


Function ajSeqFormatTest

tests whether a named format is known

Prototype

AjBool ajSeqFormatTest (
      const AjPStr format
);

TypeNameRead/WriteDescription
const AjPStrformatInputFormat
AjBool RETURNajTrue if formats was accepted

From EMBOSS 2.7.0


Function ajSeqUsaGetBase

Extracts the base part from a USA, suitable for use in fetching other sequences from the same source

Prototype

AjBool ajSeqUsaGetBase (
      const AjPStr usa,
      AjPStr* Pbaseusa
);

TypeNameRead/WriteDescription
const AjPStrusaInputOriginal USA
AjPStr*PbaseusaModifyBase part of USA
AjBool RETURNTrue on success

From EMBOSS 6.1.0


Section: Sequence Query Operators

These functions use the contents of a sequence query object but do not make any changes.

Functions:
ajSeqParseFastaParse an NCBI format fasta line. Return id acc sv and description
ajSeqParseNcbiParse an NCBI format fasta line. Return id acc and description.
ajSeqParseFastqParse a fastq id line. Return id acc sv and description
ajSeqGetFromUsaRangeReturns a sequence given a USA
ajSeqGetFromUsaReturns a sequence given a USA
ajSeqsetGetFromUsaReturn a seqset given a usa
ajSeqReadExitCleans up sequence reading internal memory


Function ajSeqParseFasta

Parse an NCBI format fasta line. Return id acc sv and description

Prototype

AjBool ajSeqParseFasta (
      const AjPStr instr,
      AjPStr* id,
      AjPStr* acc,
      AjPStr* sv,
      AjPStr* desc
);

TypeNameRead/WriteDescription
const AjPStrinstrInputfasta line.
AjPStr*idOutputid.
AjPStr*accOutputaccession number.
AjPStr*svOutputsequence version number.
AjPStr*descOutputdescription.
AjBool RETURNajTrue if fasta format

From EMBOSS 2.0.0


Function ajSeqParseNcbi

Parse an NCBI format fasta line. Return id acc and description.

Prototype

AjBool ajSeqParseNcbi (
      const AjPStr instr,
      AjPStr* id,
      AjPStr* acc,
      AjPStr* sv,
      AjPStr* gi,
      AjPStr* db,
      AjPStr* desc
);

TypeNameRead/WriteDescription
const AjPStrinstrInputfasta line.
AjPStr*idOutputid.
AjPStr*accOutputaccession number.
AjPStr*svOutputsequence version number.
AjPStr*giOutputGI version number.
AjPStr*dbOutputNCBI database name
AjPStr*descOutputdescription.
AjBool RETURNajTrue if ncbi format

From EMBOSS 1.0.0


Function ajSeqParseFastq

Parse a fastq id line. Return id acc sv and description

Prototype

AjBool ajSeqParseFastq (
      const AjPStr instr,
      AjPStr* id,
      AjPStr* desc
);

TypeNameRead/WriteDescription
const AjPStrinstrInputfastq line.
AjPStr*idOutputid.
AjPStr*descOutputdescription.
AjBool RETURNajTrue if fastq format

From EMBOSS 6.1.0


Function ajSeqGetFromUsaRange

Returns a sequence given a USA

Prototype

AjBool ajSeqGetFromUsaRange (
      const AjPStr thys,
      AjBool protein,
      ajint ibegin,
      ajint iend,
      AjPSeq seq
);

TypeNameRead/WriteDescription
const AjPStrthysInputUSA
AjBoolproteinInputTrue if protein
ajintibeginInputsequence start position
ajintiendInputsequence end position
AjPSeqseqModifysequence
AjBool RETURNajTrue on success

From EMBOSS 6.4.0


Function ajSeqGetFromUsa

Returns a sequence given a USA

Prototype

AjBool ajSeqGetFromUsa (
      const AjPStr thys,
      AjBool protein,
      AjPSeq seq
);

TypeNameRead/WriteDescription
const AjPStrthysInputUSA
AjBoolproteinInputTrue if protein
AjPSeqseqModifysequence
AjBool RETURNajTrue on success

From EMBOSS 1.8.0


Function ajSeqsetGetFromUsa

Return a seqset given a usa

Prototype

AjBool ajSeqsetGetFromUsa (
      const AjPStr thys,
      AjPSeqset* seq
);

TypeNameRead/WriteDescription
const AjPStrthysInputusa
AjPSeqset*seqOutputseqset
AjBool RETURNajTrue on success

From EMBOSS 2.7.0


Function ajSeqReadExit

Cleans up sequence reading internal memory

Prototype

void ajSeqReadExit (
      void
);

TypeNameRead/WriteDescription
void RETURN

From EMBOSS 4.0.0


Section: Internals

Functions to return internal values

Functions:
ajSeqinTypeGetFieldsReturns the listof known field names for ajSeqinRead
ajSeqinTypeGetQlinksReturns the listof known query link operators for ajSeqRead
ajSeqinTraceDebug calls to trace the data in a sequence input object.
ajSeqaccessGetDbreturns the table in which sequence database access details are registered
ajSeqaccessMethodGetQlinksTests for a named method for sequence reading and returns the known query link operators
ajSeqaccessMethodGetScopeTests for a named method for sequence reading and returns the scope (entry, query or all).
ajSeqaccessMethodTestTests for a named method for sequence reading.
ajSeqinformatTermTests whether a data input format termis known
ajSeqinformatTestTests whether a named sequence data input format is known


Function ajSeqinTypeGetFields

Returns the listof known field names for ajSeqinRead

Prototype

const char* ajSeqinTypeGetFields (
      void
);

TypeNameRead/WriteDescription
const char* RETURNList of field names

From EMBOSS 6.4.0


Function ajSeqinTypeGetQlinks

Returns the listof known query link operators for ajSeqRead

Prototype

const char* ajSeqinTypeGetQlinks (
      void
);

TypeNameRead/WriteDescription
const char* RETURNList of field names

From EMBOSS 6.4.0


Function ajSeqinTrace

Debug calls to trace the data in a sequence input object.

Prototype

void ajSeqinTrace (
      const AjPSeqin thys
);

TypeNameRead/WriteDescription
const AjPSeqinthysInputSequence input object.
void RETURN

From EMBOSS 1.0.0


Function ajSeqaccessGetDb

returns the table in which sequence database access details are registered

Prototype

AjPTable ajSeqaccessGetDb (
      void
);

TypeNameRead/WriteDescription
AjPTable RETURNAccess functions hash table

From EMBOSS 6.4.0


Function ajSeqaccessMethodGetQlinks

Tests for a named method for sequence reading and returns the known query link operators

Prototype

const char* ajSeqaccessMethodGetQlinks (
      const AjPStr method
);

TypeNameRead/WriteDescription
const AjPStrmethodInputMethod required.
const char* RETURNKnown link operators

From EMBOSS 6.4.0


Function ajSeqaccessMethodGetScope

Tests for a named method for sequence reading and returns the scope (entry, query or all).

Prototype

ajuint ajSeqaccessMethodGetScope (
      const AjPStr method
);

TypeNameRead/WriteDescription
const AjPStrmethodInputMethod required.
ajuint RETURNScope flags

From EMBOSS 6.4.0


Function ajSeqaccessMethodTest

Tests for a named method for sequence reading.

Prototype

AjBool ajSeqaccessMethodTest (
      const AjPStr method
);

TypeNameRead/WriteDescription
const AjPStrmethodInputMethod required.
AjBool RETURNajTrue on success.

From EMBOSS 6.4.0


Function ajSeqinformatTerm

Tests whether a data input format termis known

Prototype

AjBool ajSeqinformatTerm (
      const AjPStr term
);

TypeNameRead/WriteDescription
const AjPStrtermInputFormat term EDAM ID
AjBool RETURNajTrue if term was accepted

From EMBOSS 6.4.0


Function ajSeqinformatTest

Tests whether a named sequence data input format is known

Prototype

AjBool ajSeqinformatTest (
      const AjPStr format
);

TypeNameRead/WriteDescription
const AjPStrformatInputFormat
AjBool RETURNajTrue if formats was accepted

From EMBOSS 6.4.0