SW#
All Files Functions Variables Typedefs Macros
Macros | Functions
post_proc.h File Reference

Postprocessing utilities header. More...

#include "alignment.h"
#include "chain.h"
#include "db_alignment.h"
#include "scorer.h"
Include dependency graph for post_proc.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define SW_OUT_PAIR   0
 Pairwise alignment pair output format. More...
 
#define SW_OUT_PLOT   1
 Pairwise alignment plotting output format. More...
 
#define SW_OUT_STAT   2
 Pairwise alignment stat output format. More...
 
#define SW_OUT_STAT_PAIR   3
 Pairwise alignment stat-pair output format. More...
 
#define SW_OUT_DUMP   4
 Pairwise alignment binary output format. More...
 
#define SW_OUT_DB_BLASTM0   0
 Database alignment blast m1-like output format. More...
 
#define SW_OUT_DB_BLASTM8   1
 Database alignment blast m8-like output format. More...
 
#define SW_OUT_DB_BLASTM9   2
 Database alignment blast m9-like output format. More...
 
#define SW_OUT_DB_LIGHT   3
 Database alignment light output format. More...
 

Functions

int checkAlignment (Alignment *alignment)
 Checks if the alignment is correct. More...
 
AlignmentreadAlignment (char *path)
 Reads the alignment object from the binary file. More...
 
void outputAlignment (Alignment *alignment, char *path, int type)
 Pairwise alignment output function. More...
 
void outputScore (int score, Chain *query, Chain *target, Scorer *scorer, char *path)
 Score only output function. More...
 
void outputDatabase (DbAlignment **dbAlignments, int dbAlignmentsLen, char *path, int type)
 Database alignment output function. More...
 
void outputShotgunDatabase (DbAlignment ***dbAlignments, int *dbAlignmentsLens, int dbAlignmentsLen, char *path, int type)
 Shotgun database alignment output function. More...
 
void dumpFastaChains (Chain **chains, int chainsLen, char *path)
 Database serialization function. More...
 
void deleteFastaChains (Chain **chains, int chainsLen)
 Chain array delete utility. More...
 
void deleteDatabase (DbAlignment **dbAlignments, int dbAlignmentsLen)
 Database delete utility. More...
 
void deleteShotgunDatabase (DbAlignment ***dbAlignments, int *dbAlignmentsLens, int dbAlignmentsLen)
 Shotgun database delete utility. More...
 

Detailed Description

Postprocessing utilities header.

Macro Definition Documentation

#define SW_OUT_DB_BLASTM0   0

Database alignment blast m1-like output format.

Blast m1 output example: http://www.compbio.ox.ac.uk/analysis_tools/BLAST/BLAST_blastall/blastall_examples.shtml#m_0

#define SW_OUT_DB_BLASTM8   1

Database alignment blast m8-like output format.

Blast m8 output example: http://www.compbio.ox.ac.uk/analysis_tools/BLAST/BLAST_blastall/blastall_examples.shtml#m_8

#define SW_OUT_DB_BLASTM9   2

Database alignment blast m9-like output format.

Blast m9 output example: http://www.compbio.ox.ac.uk/analysis_tools/BLAST/BLAST_blastall/blastall_examples.shtml#m_9

#define SW_OUT_DB_LIGHT   3

Database alignment light output format.

Format outputs only the scores and the names of the output alignments.

#define SW_OUT_DUMP   4

Pairwise alignment binary output format.

This output can be read with the readAlignment().

#define SW_OUT_PAIR   0

Pairwise alignment pair output format.

Format is equal to the emboss pair output without the header. Emboss output example: http://emboss.sourceforge.net/docs/themes/alnformats/align.pair

#define SW_OUT_PLOT   1

Pairwise alignment plotting output format.

This output format is used as the input file for plotting with gnuplot.

#define SW_OUT_STAT   2

Pairwise alignment stat output format.

Format is equal to the emboss pair output header. Emboss output example: http://emboss.sourceforge.net/docs/themes/alnformats/align.pair

#define SW_OUT_STAT_PAIR   3

Pairwise alignment stat-pair output format.

Format is equal to the emboss pair output. Emboss output example: http://emboss.sourceforge.net/docs/themes/alnformats/align.pair

Function Documentation

int checkAlignment ( Alignment alignment)

Checks if the alignment is correct.

Parameters
alignmentalignment object
Returns
1 if the alignment is correct, 0 otherwise
void deleteDatabase ( DbAlignment **  dbAlignments,
int  dbAlignmentsLen 
)

Database delete utility.

Function calls dbAlignmentDelete() function on every dbAlignment object in dbAlignments array and then deletes the array.

Parameters
dbAlignmentsdatabase alignments array
dbAlignmentsLendatabase alignments array length
void deleteFastaChains ( Chain **  chains,
int  chainsLen 
)

Chain array delete utility.

Function calls chainDelete() function on every chain and then deletes the array.

Parameters
chainschain array object
chainsLenchain array length
void deleteShotgunDatabase ( DbAlignment ***  dbAlignments,
int *  dbAlignmentsLens,
int  dbAlignmentsLen 
)

Shotgun database delete utility.

Function calls dbAlignmentDelete() function on every dbAlignment object in dbAlignments, deletes dbAlignments structure and then deletes dbAlignmentsLens array.

Parameters
dbAlignmentsdatabase alignments array of arrays
dbAlignmentsLensdatabase alignments arrays lengths
dbAlignmentsLendatabase alignments array of arrays length
void dumpFastaChains ( Chain **  chains,
int  chainsLen,
char *  path 
)

Database serialization function.

Function creates a file named path.swsharp which represents the serialized version of the chain database which was read from the given path. Since reading of the serialized version of the database is much faster than reading the original one, this function is used for caching the databases for future usage.

Parameters
chainsdatabase chains
chainsLendatabase length
pathoriginal chain database file path
void outputAlignment ( Alignment alignment,
char *  path,
int  type 
)

Pairwise alignment output function.

Parameters
alignmentalignment object
pathoutput file path, if NULL output goes to standard output
typeoutput format type, can be SW_OUT_PAIR, SW_OUT_PLOT, SW_OUT_STAT, SW_OUT_STAT_PAIR or SW_OUT_DUMP
void outputDatabase ( DbAlignment **  dbAlignments,
int  dbAlignmentsLen,
char *  path,
int  type 
)

Database alignment output function.

Parameters
dbAlignmentsdatabase alignments array
dbAlignmentsLendatabase alignments array length
pathoutput file path, if NULL output goes to standard output
typeoutput format type, can be SW_OUT_DB_BLASTM0 , SW_OUT_DB_BLASTM8, SW_OUT_DB_BLASTM9 or SW_OUT_DB_LIGHT
void outputScore ( int  score,
Chain query,
Chain target,
Scorer scorer,
char *  path 
)

Score only output function.

Parameters
scorealignment score
queryquery chain
targettarget chain
scorerscorer object used for alignment
pathoutput file path, if NULL output goes to standard output
void outputShotgunDatabase ( DbAlignment ***  dbAlignments,
int *  dbAlignmentsLens,
int  dbAlignmentsLen,
char *  path,
int  type 
)

Shotgun database alignment output function.

Parameters
dbAlignmentsdatabase alignments array of arrays
dbAlignmentsLensdatabase alignments arrays lengths
dbAlignmentsLendatabase alignments array of arrays length
pathoutput file path, if NULL output goes to standard output
typeoutput format type, can be SW_OUT_DB_BLASTM0 , SW_OUT_DB_BLASTM8, SW_OUT_DB_BLASTM9 or SW_OUT_DB_LIGHT
Alignment* readAlignment ( char *  path)

Reads the alignment object from the binary file.

The binary file must previously be created with the outputAlignment() function with the SW_OUT_DUMP type.

Parameters
pathinput binary file path
Returns
alignment object