libuproc  1.2.0
substmat.h
Go to the documentation of this file.
1 /* Copyright 2014 Peter Meinicke, Robin Martinjak
2  *
3  * This file is part of libuproc.
4  *
5  * libuproc is free software: you can redistribute it and/or modify it under
6  * the terms of the GNU Lesser General Public License as published by the Free
7  * Software Foundation, either version 3 of the License, or (at your option)
8  * any later version.
9  *
10  * libuproc is distributed in the hope that it will be useful, but WITHOUT ANY
11  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12  * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
13  * more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with libuproc. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
29 #ifndef UPROC_SUBSTMAT_H
30 #define UPROC_SUBSTMAT_H
31 
32 #include <stdio.h>
33 #include <stdarg.h>
34 #include "uproc/common.h"
35 #include "uproc/io.h"
36 #include "uproc/alphabet.h"
37 
53 typedef struct uproc_substmat_s uproc_substmat;
54 
60 
63 
76 double uproc_substmat_get(const uproc_substmat *mat, unsigned pos,
78 
90 void uproc_substmat_set(uproc_substmat *mat, unsigned pos, uproc_amino x,
91  uproc_amino y, double dist);
92 
105  uproc_suffix s2, double *dist);
106 
114  const char *pathfmt, ...);
115 
122  const char *pathfmt, va_list ap);
129 #endif
Module: Amino acid translation alphabets.
void uproc_substmat_destroy(uproc_substmat *mat)
Destroy substmat object.
Module: General IO.
int uproc_amino
Type to represent one amino acid.
Definition: common.h:52
uproc_substmat * uproc_substmat_load(enum uproc_io_type iotype, const char *pathfmt,...)
Load substmat from file.
Array of matrices of amino acid distances.
uproc_substmat * uproc_substmat_create(void)
Create substmat object.
double uproc_substmat_get(const uproc_substmat *mat, unsigned pos, uproc_amino x, uproc_amino y)
Get distance of two amino acids.
void uproc_substmat_align_suffixes(const uproc_substmat *mat, uproc_suffix s1, uproc_suffix s2, double *dist)
Look up all distances between amino acids in a suffix.
uint_least64_t uproc_suffix
Type for suffixes.
Definition: common.h:84
void uproc_substmat_set(uproc_substmat *mat, unsigned pos, uproc_amino x, uproc_amino y, double dist)
Set distance of two amino acids.
uproc_substmat * uproc_substmat_loadv(enum uproc_io_type iotype, const char *pathfmt, va_list ap)
Load substmat from file.
Module: Common definitions.
uproc_io_type
Underlying stream type.
Definition: io.h:59