Permalink
Browse files

This commit was manufactured by cvs2svn to create tag

'bioperl-ext-release-1-5-0-rc1'.

svn path=/bioperl-ext/tags/bioperl-ext-release-1-5-0-rc1/; revision=661
  • Loading branch information...
1 parent 8695d5b commit 8c861791408fea9471cfb27ad56e12cddbe72245 nobody committed Sep 26, 2005
View
@@ -3514,14 +3514,6 @@ end2(obj)
OUTPUT:
RETVAL
-int
-score(obj)
- dpAlign_AlignOutput * obj
- CODE:
- RETVAL = obj->score;
- OUTPUT:
- RETVAL
-
void
DESTROY(obj)
dpAlign_AlignOutput * obj
@@ -3,7 +3,7 @@ use ExtUtils::MakeMaker;
# the contents of the Makefile that is written.
WriteMakefile(
'NAME' => 'Bio::Ext::Align',
- 'VERSION' => '1.5.1',
+ 'VERSION' => '0.1',
'LIBS' => ['-lm'], # e.g., '-lm'
'DEFINE' => '-DPOSIX -DNOERROR', # e.g., '-DHAVE_SOMETHING'
'INC' => '-I./libs', # e.g., '-I/usr/include/other'
@@ -29,7 +29,6 @@ typedef struct _dpAlign_alnoutput {
char * aln2; /* aligned subsequence of sequence 2 with space '-' inserted */
int start2; /* start point of aligned subsequence 2 */
int end2; /* end point of aligned subsequence 2 */
- int score; /* score of this alignment */
} dpAlign_AlignOutput;
typedef struct _dpAlign_SequenceProfile {
@@ -651,7 +651,6 @@ traceback(sw_AlignStruct * as)
if (ao == NULL)
dpAlign_fatal("Can't allocate memory for AlignOutput!\n");
- ao->score = as->score;
/* insert gaps to sequence 1 */
k = 0;
for (i = 0; i <= aln1_len; ++i) {
View
@@ -1,49 +0,0 @@
-
-package Bio::Ext::HMM;
-
-use vars qw($AUTOLOAD @ISA @EXPORT_OK $dl_debug);
-use Exporter;
-use Carp;
-use strict;
-
-use DynaLoader;
-
-
-@ISA = qw(Exporter DynaLoader);
-# Items to export into callers namespace by default. Note: do not export
-# names by default without a very good reason. Use EXPORT_OK instead.
-# Do not simply export all your public functions/methods/constants.
-
-sub AUTOLOAD {
- # This AUTOLOAD is used to 'autoload' constants from the constant()
- # XS function. If a constant is not found then control is passed
- # to the AUTOLOAD in AutoLoader.
-
- my $constname;
- ($constname = $AUTOLOAD) =~ s/.*:://;
- my $val = constant($constname, @_ ? $_[0] : 0);
- if ($! != 0) {
- if ($! =~ /Invalid/) {
- $AutoLoader::AUTOLOAD = $AUTOLOAD;
- goto &AutoLoader::AUTOLOAD;
- }
- else {
- croak "Your vendor has not defined Test macro $constname";
- }
- }
- eval "sub $AUTOLOAD { $val }";
- goto &$AUTOLOAD;
-}
-
-BEGIN {
- $dl_debug = 40;
-}
-
-bootstrap Bio::Ext::HMM; # hopefully has the correct things...
-
-# Preloaded methods go here.
-
-# Autoload methods go after __END__, and are processed by the autosplit program.
-
-1;
-__END__
View
@@ -1,207 +0,0 @@
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-#include "EXTERN.h"
-#include "perl.h"
-#include "XSUB.h"
-#ifdef __cplusplus
-}
-#endif
-
-#include "hmm.h"
-
-MODULE = Bio::Ext::HMM PACKAGE = Bio::Ext::HMM
-
-void
-HMM_statistical_training(class, hmm, obs, hs)
- char * class
- HMM * hmm
- SV * obs
- SV * hs
- PPCODE:
- AV * obs_av = (AV *) SvRV(obs);
- AV * hs_av = (AV *) SvRV(hs);
- int i;
- int avlen = av_len(obs_av);
- char ** obs_ar = (char **) malloc(avlen*sizeof(char *));
- char ** hs_ar = (char **) malloc(avlen*sizeof(char *));
- int * obs_len = (int *) malloc(avlen*sizeof(int));
- if (obs_ar == NULL || hs_ar == NULL)
- croak("Can't allocate memory for observation and/or state arrays!\n");
- if (obs_len == NULL)
- croak("Can't allocate memory for observation length array!\n");
- for (i = 0; i < avlen; ++i) {
- obs_ar[i] = (char *) SvPV(*av_fetch(obs_av, i, 0), PL_na);
- obs_len[i] = strlen(obs_ar[i]);
- obs_ar[i] = (char *) malloc((obs_len[i]+1)*sizeof(char));
- if (obs_ar[i] == NULL)
- croak("Can't allocate memory for observation array!\n");
- strcpy(obs_ar[i], (char *) SvPV(*av_fetch(obs_av, i, 0), PL_na));
- hs_ar[i] = (char *) malloc((obs_len[i]+1)*sizeof(char));
- if (hs_ar[i] == NULL)
- croak("Can't allocate memory for state array!\n");
- strcpy(hs_ar[i], (char *) SvPV(*av_fetch(hs_av, i, 0), PL_na));
- omap(hmm, obs_ar[i], obs_len[i]);
- smap(hmm, hs_ar[i], obs_len[i]);
- }
- state_est(hmm, obs_ar, hs_ar, obs_len, avlen);
- for (i = 0; i < avlen; ++i) {
- free(obs_ar[i]);
- free(hs_ar[i]);
- }
- free(obs_ar);
- free(hs_ar);
- free(obs_len);
-
-double
-HMM_likelihood(class, hmm, seq)
- char * class
- HMM * hmm
- char * seq
- CODE:
- int T = strlen(seq);
- char obs[T+1];
- strcpy(obs, seq);
- omap(hmm, obs, T);
- RETVAL = Palpha(hmm, obs, T);
- OUTPUT:
- RETVAL
-
-void
-HMM_baum_welch_training(class, hmm, obs)
- char * class
- HMM * hmm
- SV * obs
- PPCODE:
- AV * obs_av = (AV *) SvRV(obs);
- int i;
- int avlen = av_len(obs_av);
- char ** obs_ar = (char **) malloc(avlen*sizeof(char *));
- int * obs_len = (int *) malloc(avlen*sizeof(int));
- if (obs_ar == NULL)
- croak("Can't allocate memory for observation arrays!\n");
- if (obs_len == NULL)
- croak("Can't allocate memory for observation length array!\n");
- for (i = 0; i < avlen; ++i) {
- obs_ar[i] = (char *) SvPV(*av_fetch(obs_av, i, 0), PL_na);
- obs_len[i] = strlen(obs_ar[i]);
- obs_ar[i] = (char *) malloc((obs_len[i]+1)*sizeof(char));
- if (obs_ar[i] == NULL)
- croak("Can't allocate memory for observation array!\n");
- strcpy(obs_ar[i], (char *) SvPV(*av_fetch(obs_av, i, 0), PL_na));
- omap(hmm, obs_ar[i], obs_len[i]);
- }
- baum_welch(hmm, obs_ar, obs_len, avlen);
- for (i = 0; i < avlen; ++i)
- free(obs_ar[i]);
- free(obs_ar);
-
-SV *
-HMM_viterbi(class, hmm, seq)
- char * class
- HMM * hmm
- char * seq
- PPCODE:
- SV * sv;
- int T = strlen(seq);
- char * hss = (char *) malloc(T*sizeof(char));
- char obs[T+1];
- if (hss == NULL)
- croak("Can't allocate memory for hidden state sequence!\n");
- strcpy(obs, seq);
- omap(hmm, obs, T);
- viterbi(hmm, hss, obs, T);
- sv = newSVpv(hss, strlen(hss));
- free(hss);
- PUSHs(sv_2mortal(sv));
-
-
-MODULE = Bio::Ext::HMM PACKAGE = Bio::Ext::HMM::HMM
-
-HMM *
-new(class, symbols, states)
- char * class
- char * symbols
- char * states
- PPCODE:
- HMM * out;
- out = HMM_new(symbols, states);
- ST(0) = sv_newmortal();
- sv_setref_pv(ST(0), class, (void *) out);
- XSRETURN(1);
-
-double
-get_init_entry(class, hmm, state)
- char * class
- HMM * hmm
- char * state
- CODE:
- RETVAL = HMM_get_init_entry(hmm, state);
- OUTPUT:
- RETVAL
-
-void
-set_init_entry(class, hmm, state, val)
- char * class
- HMM * hmm
- char * state
- double val
- CODE:
- HMM_set_init_entry(hmm, state, val);
-
-double
-get_a_entry(class, hmm, state1, state2)
- char * class
- HMM * hmm
- char * state1
- char * state2
- CODE:
- RETVAL = HMM_get_a_entry(hmm, state1, state2);
- OUTPUT:
- RETVAL
-
-void
-set_a_entry(class, hmm, state1, state2, val)
- char * class
- HMM * hmm
- char * state1
- char * state2
- double val
- CODE:
- HMM_set_a_entry(hmm, state1, state2, val);
-
-double
-get_e_entry(class, hmm, state, symbol)
- char * class
- HMM * hmm
- char * state
- char * symbol
- CODE:
- RETVAL = HMM_get_e_entry(hmm, state, symbol);
- OUTPUT:
- RETVAL
-
-void
-set_e_entry(class, hmm, state, symbol, val)
- char * class
- HMM * hmm
- char * state
- char * symbol
- double val
- CODE:
- HMM_set_e_entry(hmm, state, symbol, val);
-
-void
-DESTROY(obj)
- HMM * obj
- PPCODE:
- int i;
- free(obj->init);
- for (i = 0; i < obj->N; ++i)
- free(obj->a_mat[i]);
- free(obj->a_mat);
- for (i = 0; i < obj->N; ++i)
- free(obj->e_mat[i]);
- free(obj->e_mat);
-
View
@@ -1,13 +0,0 @@
-use ExtUtils::MakeMaker;
-# See lib/ExtUtils/MakeMaker.pm for details of how to influence
-# the contents of the Makefile that is written.
-WriteMakefile(
- 'NAME' => 'Bio::Ext::HMM',
- 'VERSION' => '0.1',
- 'LIBS' => ['-lm'], # e.g., '-lm'
- 'DEFINE' => '', # e.g., '-DHAVE_SOMETHING'
- 'INC' => '', # e.g., '-I/usr/include/other'
- 'OBJECT' => 'HMM.o hmmlib.o',
- 'clean' => { 'FILES' => '*.o' }
-);
-
View
@@ -1,36 +0,0 @@
-#ifndef _HMM_H_
-#define _HMM_H_
-
-typedef struct HMM
-{
- int M;
- int N;
- char * symbols;
- unsigned char omap[256];
- char * states;
- unsigned char smap[256];
- double * init;
- double ** a_mat;
- double ** e_mat;
-} HMM;
-
-#define UPPER_TOL 0.000001
-#define LOWER_TOL 1e-100
-
-HMM * init_HMM(char *, char *, double *, double **, double **);
-HMM * HMM_new(char *, char *);
-double HMM_get_init_entry(HMM *, char *);
-void HMM_set_init_entry(HMM *, char *, double);
-double HMM_get_a_entry(HMM *, char *, char *);
-void HMM_set_a_entry(HMM *, char *, char *, double);
-double HMM_get_e_entry(HMM *, char *, char *);
-void HMM_set_e_entry(HMM *, char *, char *, double);
-void omap(HMM *, char *, int);
-void smap(HMM *, char *, int);
-double Palpha(HMM *, char *, int);
-double Pbeta(HMM *, char *, int);
-void viterbi(HMM *, char *, char *, int);
-void state_est(HMM *, char **, char **, int *, int);
-void baum_welch(HMM *, char **, int *, int);
-
-#endif
Oops, something went wrong.

0 comments on commit 8c86179

Please sign in to comment.