[med-svn] [Git][med-team/phast][upstream] New upstream version 1.7+dfsg
Andreas Tille (@tille)
gitlab at salsa.debian.org
Fri Dec 6 20:35:54 GMT 2024
Andreas Tille pushed to branch upstream at Debian Med / phast
Commits:
204a70ae by Andreas Tille at 2024-12-06T21:26:04+01:00
New upstream version 1.7+dfsg
- - - - -
8 changed files:
- include/phast/fit_column.h
- src/dless/Makefile
- src/lib/base/phast_misc.c
- src/lib/phylo/phast_fit_column.c
- src/lib/phylo/phast_fit_feature.c
- src/prequel/Makefile
- test/Makefile
- test/hmrc_summary_correct
Changes:
=====================================
include/phast/fit_column.h
=====================================
@@ -143,9 +143,8 @@ double col_likelihood_wrapper_1d(double x, void *data);
@note Uses log rather than log2
*/
-double col_compute_log_likelihood(TreeModel *mod, MSA *msa, int tupleidx,
- double **scratch);
-
+double col_compute_scaled_log_likelihood(TreeModel *mod, MSA *msa, int tupleidx,
+ double **scratch);
/** Compute and return the likelihood of a tree model with respect
to a single column tuple in an alignment.
@@ -229,7 +228,7 @@ double col_scale_derivs(ColFitData *d, double *first_deriv,
/** Compute the first and (optionally) second derivatives with respect
to the scale parameters for the single-column log likelihood
- function (col_compute_log_likelihood).
+ function (col_compute_scaled_log_likelihood).
@param[in] d Column Data to analyze
@param[out] gradient gradient from first partial derivative
@param[out] hessian (optional) second order partial derivative
=====================================
src/dless/Makefile
=====================================
@@ -3,7 +3,7 @@ PHAST := ${PHAST}/..
#EXEC = $(addprefix ${BIN}/,$(notdir ${PWD}))
PROGS = dless dlessP
-MODULES = bd_phylo_hmm
+MODULES = phast_bd_phylo_hmm
EXEC = $(addprefix ${BIN}/,${PROGS})
# assume all *.c files are source
=====================================
src/lib/base/phast_misc.c
=====================================
@@ -495,6 +495,7 @@ double normalize_probs(double *p, int size) {
int i;
double sum = 0;
for (i = 0; i < size; i++) sum += p[i];
+ if(sum == 0) return sum;
for (i = 0; i < size; i++) p[i] /= sum;
return sum;
}
=====================================
src/lib/phylo/phast_fit_column.c
=====================================
@@ -14,6 +14,7 @@
perform single-base LRTs, score tests, phyloP, etc. */
#include <stdlib.h>
+#include <float.h>
#include <phast/fit_column.h>
#include <phast/sufficient_stats.h>
#include <phast/tree_likelihoods.h>
@@ -37,7 +38,7 @@
sufficient stats already available. Note that this function uses
natural log rather than log2. This function does allow for rate
variation. */
-double col_compute_likelihood(TreeModel *mod, MSA *msa, int tupleidx,
+double col_compute_scaled_log_likelihood(TreeModel *mod, MSA *msa, int tupleidx,
double **scratch) {
int i, j, k, nodeidx, rcat;
@@ -46,15 +47,17 @@ double col_compute_likelihood(TreeModel *mod, MSA *msa, int tupleidx,
double total_prob = 0;
List *traversal = tr_postorder(mod->tree);
double **pL = NULL;
+ double log_scale = 0;
+ double scaling_threshold = DBL_MIN;
if (msa->ss->tuple_size != 1)
- die("ERROR col_compute_likelihood: need tuple size 1, got %i\n",
+ die("ERROR col_compute_scaled_log_likelihood: need tuple size 1, got %i\n",
msa->ss->tuple_size);
if (mod->order != 0)
- die("ERROR col_compute_likelihood: got mod->order of %i, expected 0\n",
+ die("ERROR col_compute_scaled_log_likelihood: got mod->order of %i, expected 0\n",
mod->order);
if (!mod->allow_gaps)
- die("ERROR col_compute_likelihood: need mod->allow_gaps to be TRUE\n");
+ die("ERROR col_compute_scaled_log_likelihood: need mod->allow_gaps to be TRUE\n");
/* allocate memory or use scratch if avail */
if (scratch != NULL)
@@ -93,8 +96,14 @@ double col_compute_likelihood(TreeModel *mod, MSA *msa, int tupleidx,
for (k = 0; k < nstates; k++)
totr += pL[k][n->rchild->id] *
mm_get(rsubst_mat, i, k);
-
- pL[i][n->id] = totl * totr;
+
+ if (totl * totr < scaling_threshold) {
+ pL[i][n->id] = (totl / scaling_threshold) * totr;
+ log_scale -= log(scaling_threshold);
+ }
+ else {
+ pL[i][n->id] = totl * totr;
+ }
}
}
}
@@ -110,20 +119,9 @@ double col_compute_likelihood(TreeModel *mod, MSA *msa, int tupleidx,
sfree(pL);
}
- return(total_prob);
-}
-
-
-
-/* See col_compute_likelihood above for notes.
- Note that this function uses natural log rather than log2
- */
-double col_compute_log_likelihood(TreeModel *mod, MSA *msa, int tupleidx,
- double **scratch) {
- return log(col_compute_likelihood(mod, msa, tupleidx, scratch));
+ return log(total_prob) - log_scale;
}
-
/* version of col_scale_derivs_subst that allows for the general case
of complex eigenvalues and eigenvectors */
void col_scale_derivs_subst_complex(ColFitData *d) {
@@ -298,7 +296,7 @@ void col_scale_derivs_subst(ColFitData *d) {
/* Compute the first and (optionally) second derivatives with respect
to the scale parameter for the single-column log likelihood
- function (col_compute_log_likelihood). This version assumes a
+ function (col_compute_scaled_log_likelihood). This version assumes a
single scale parameter; see below for the subtree case. Return
value is log likelihood, which is computed as a by-product. Derivs
will be stored in *first_deriv and *second_deriv. If second_deriv
@@ -449,7 +447,7 @@ double col_scale_derivs(ColFitData *d, double *first_deriv,
/* Compute the first and (optionally) second derivatives with respect
to the scale parameters for the single-column log likelihood
- function (col_compute_log_likelihood). This version assumes scale
+ function (col_compute_scaled_log_likelihood). This version assumes scale
parameters for the whole tree and for the subtree. Return value is
log likelihood, which is computed as a by-product. Derivs will be
stored in *gradient and *hessian. If hessian == NULL,
@@ -679,8 +677,8 @@ double col_likelihood_wrapper(Vector *params, void *data) {
/* reestimate subst models on edges */
tm_set_subst_matrices(d->mod);
- return -1 * col_compute_log_likelihood(d->mod, d->msa, d->tupleidx,
- d->fels_scratch[0]);
+ return -1 * col_compute_scaled_log_likelihood(d->mod, d->msa, d->tupleidx,
+ d->fels_scratch[0]);
}
/* Wrapper for likelihood function for use in parameter estimation;
@@ -695,8 +693,8 @@ double col_likelihood_wrapper_1d(double x, void *data) {
/* reestimate subst models on edges */
tm_set_subst_matrices(d->mod);
- return -1 * col_compute_log_likelihood(d->mod, d->msa, d->tupleidx,
- d->fels_scratch[0]);
+ return -1 * col_compute_scaled_log_likelihood(d->mod, d->msa, d->tupleidx,
+ d->fels_scratch[0]);
}
/* Wrapper for gradient function for use in parameter estimation */
@@ -771,7 +769,7 @@ void col_lrts(TreeModel *mod, MSA *msa, mode_type mode, double *tuple_pvals,
tm_set_subst_matrices(mod);
/* compute log likelihoods under null and alt hypotheses */
- null_lnl = col_compute_log_likelihood(mod, msa, i, d->fels_scratch[0]);
+ null_lnl = col_compute_scaled_log_likelihood(mod, msa, i, d->fels_scratch[0]);
vec_set(d->params, 0, d->init_scale);
d->tupleidx = i;
@@ -1368,16 +1366,16 @@ void col_scale_derivs_num(ColFitData *d, double *first_deriv,
double orig_scale = d->mod->scale;
d->mod->scale += (2*DERIV_EPSILON);
tm_set_subst_matrices(d->mod);
- lnl1 = col_compute_log_likelihood(d->mod, d->msa, d->tupleidx,
- d->fels_scratch[0]);
+ lnl1 = col_compute_scaled_log_likelihood(d->mod, d->msa, d->tupleidx,
+ d->fels_scratch[0]);
d->mod->scale = orig_scale + DERIV_EPSILON;
tm_set_subst_matrices(d->mod);
- lnl2 = col_compute_log_likelihood(d->mod, d->msa, d->tupleidx,
- d->fels_scratch[0]);
+ lnl2 = col_compute_scaled_log_likelihood(d->mod, d->msa, d->tupleidx,
+ d->fels_scratch[0]);
d->mod->scale = orig_scale;
tm_set_subst_matrices(d->mod);
- lnl3 = col_compute_log_likelihood(d->mod, d->msa, d->tupleidx,
- d->fels_scratch[0]);
+ lnl3 = col_compute_scaled_log_likelihood(d->mod, d->msa, d->tupleidx,
+ d->fels_scratch[0]);
*first_deriv = (lnl2 - lnl3) / DERIV_EPSILON;
*second_deriv = (lnl1 - 2*lnl2 + lnl3) / (DERIV_EPSILON * DERIV_EPSILON);
}
@@ -1391,37 +1389,37 @@ void col_scale_derivs_subtree_num(ColFitData *d, Vector *gradient,
d->mod->scale += (2*DERIV_EPSILON);
tm_set_subst_matrices(d->mod);
- lnl00 = col_compute_log_likelihood(d->mod, d->msa, d->tupleidx,
- d->fels_scratch[0]);
+ lnl00 = col_compute_scaled_log_likelihood(d->mod, d->msa, d->tupleidx,
+ d->fels_scratch[0]);
d->mod->scale = orig_scale + DERIV_EPSILON;
tm_set_subst_matrices(d->mod);
- lnl0 = col_compute_log_likelihood(d->mod, d->msa, d->tupleidx,
- d->fels_scratch[0]);
+ lnl0 = col_compute_scaled_log_likelihood(d->mod, d->msa, d->tupleidx,
+ d->fels_scratch[0]);
d->mod->scale = orig_scale + DERIV_EPSILON;
d->mod->scale_sub = orig_scale_sub + DERIV_EPSILON;
tm_set_subst_matrices(d->mod);
- lnl01 = col_compute_log_likelihood(d->mod, d->msa, d->tupleidx,
- d->fels_scratch[0]);
+ lnl01 = col_compute_scaled_log_likelihood(d->mod, d->msa, d->tupleidx,
+ d->fels_scratch[0]);
d->mod->scale = orig_scale;
d->mod->scale_sub = orig_scale_sub + DERIV_EPSILON;
tm_set_subst_matrices(d->mod);
- lnl1 = col_compute_log_likelihood(d->mod, d->msa, d->tupleidx,
- d->fels_scratch[0]);
+ lnl1 = col_compute_scaled_log_likelihood(d->mod, d->msa, d->tupleidx,
+ d->fels_scratch[0]);
d->mod->scale = orig_scale;
d->mod->scale_sub = orig_scale_sub + (2*DERIV_EPSILON);
tm_set_subst_matrices(d->mod);
- lnl11 = col_compute_log_likelihood(d->mod, d->msa, d->tupleidx,
- d->fels_scratch[0]);
+ lnl11 = col_compute_scaled_log_likelihood(d->mod, d->msa, d->tupleidx,
+ d->fels_scratch[0]);
d->mod->scale = orig_scale;
d->mod->scale_sub = orig_scale_sub;
tm_set_subst_matrices(d->mod);
- lnl = col_compute_log_likelihood(d->mod, d->msa, d->tupleidx,
- d->fels_scratch[0]);
+ lnl = col_compute_scaled_log_likelihood(d->mod, d->msa, d->tupleidx,
+ d->fels_scratch[0]);
gradient->data[0] = (lnl0 - lnl) / DERIV_EPSILON;
gradient->data[1] = (lnl1 - lnl) / DERIV_EPSILON;
@@ -1628,4 +1626,4 @@ int col_has_data_sub(TreeModel *mod, MSA *msa, int tupleidx, List *inside,
return TRUE;
return FALSE;
-}
+}
\ No newline at end of file
=====================================
src/lib/phylo/phast_fit_feature.c
=====================================
@@ -25,15 +25,15 @@
parameters (currently affects 1d parameter estimation only) */
/* Compute and return the log likelihood of a tree model with respect
- to a given feature. Calls col_compute_log_likelihood for each
+ to a given feature. Calls col_compute_scaled_log_likelihood for each
column */
double ff_compute_log_likelihood(TreeModel *mod, MSA *msa, GFF_Feature *feat,
double **scratch) {
double retval = 0;
int i;
for (i = feat->start-1; i < feat->end; i++) /* offset of one */
- retval += col_compute_log_likelihood(mod, msa, msa->ss->tuple_idx[i],
- scratch);
+ retval += col_compute_scaled_log_likelihood(mod, msa, msa->ss->tuple_idx[i],
+ scratch);
return retval;
}
=====================================
src/prequel/Makefile
=====================================
@@ -3,7 +3,7 @@ PHAST := ${PHAST}/..
# assume executable name is given by directory name
PROGS = pbsDecode pbsEncode pbsScoreMatrix pbsTrain prequel
-MODULES = simplex_grid pbs_code
+MODULES = phast_simplex_grid phast_pbs_code
EXEC = $(addprefix ${BIN}/,${PROGS})
# assume all *.c files are source
=====================================
test/Makefile
=====================================
@@ -7,30 +7,30 @@ all: msa_view phyloFit phastCons
msa_view:
@echo "*** Testing msa_view ***"
msa_view hmrc.ss -i SS --end 10000 > hmrc.fa
- @if [[ -n `diff --brief hmrc.fa hmrc_correct.fa` ]] ; then echo "ERROR" ; exit 1 ; fi
+ if ! diff --brief hmrc.fa hmrc_correct.fa ; then echo "ERROR" ; exit 1 ; fi
msa_view hmrc.fa -o PHYLIP > hmrc.ph
msa_view hmrc.ph -i PHYLIP > hmrc.fa
- @if [[ -n `diff --brief hmrc.fa hmrc_correct.fa` ]] ; then echo "ERROR" ; exit 1 ; fi
+ if ! diff --brief hmrc.fa hmrc_correct.fa ; then echo "ERROR" ; exit 1 ; fi
msa_view hmrc.ph --out-format MPM --in-format PHYLIP > hmrc.mpm
msa_view hmrc.mpm --in-format MPM > hmrc.fa
- @if [[ -n `diff --brief hmrc.fa hmrc_correct.fa` ]] ; then echo "ERROR" ; exit 1 ; fi
+ if ! diff --brief hmrc.fa hmrc_correct.fa ; then echo "ERROR" ; exit 1 ; fi
msa_view hmrc.fa -o SS > hmrc_short_a.ss
msa_view hmrc.ss --end 10000 -i SS -o SS > hmrc_short_b.ss
- @if [[ -n `diff --brief hmrc_short_[ab].ss` ]] ; then echo "ERROR" ; exit 1 ; fi
+ if ! diff --brief hmrc_short_[ab].ss ; then echo "ERROR" ; exit 1 ; fi
msa_view --seqs human,cow hmrc_short_a.ss -i SS -o SS | msa_view - -i SS > hm_a.fa
msa_view --seqs human,cow hmrc.fa > hm_b.fa
- @if [[ -n `diff --brief hm_[ab].fa` ]] ; then echo "ERROR" ; exit 1 ; fi
+ if ! diff --brief hm_[ab].fa ; then echo "ERROR" ; exit 1 ; fi
msa_view hmrc.ss --gap-strip ANY -i SS -o SS | msa_view - -i SS > hmrc_nogaps_a.fa
msa_view hmrc.ss -i SS | msa_view - --gap-strip ANY > hmrc_nogaps_b.fa
- @if [[ -n `diff --brief hmrc_nogaps_[ab].fa` ]] ; then echo "ERROR" ; exit 1 ; fi
+ if ! diff --brief hmrc_nogaps_[ab].fa ; then echo "ERROR" ; exit 1 ; fi
msa_view hmrc.fa --seqs human,cow --gap-strip ALL > hm_a.fa
msa_view hmrc_short_a.ss --seqs human,cow -i SS --gap-strip ALL > hm_b.fa
- @if [[ -n `diff --brief hm_[ab].fa` ]] ; then echo "ERROR" ; exit 1 ; fi
+ if ! diff --brief hm_[ab].fa ; then echo "ERROR" ; exit 1 ; fi
msa_view hmrc.ss --start 10000 --end 20000 -i SS > hmrc_sub_a.fa
msa_view hmrc.ss -i SS | msa_view - --start 10000 --end 20000 > hmrc_sub_b.fa
- @if [[ -n `diff --brief hmrc_sub_[ab].fa` ]] ; then echo "ERROR" ; exit 1 ; fi
+ if ! diff --brief hmrc_sub_[ab].fa ; then echo "ERROR" ; exit 1 ; fi
msa_view hmrc.ss --summary -i SS > hmrc_summary
- @if [[ -n `diff --brief hmrc_summary hmrc_summary_correct` ]] ; then echo "ERROR" ; exit 1 ; fi
+ if ! diff --brief -b hmrc_summary hmrc_summary_correct ; then echo "ERROR" ; exit 1 ; fi
@echo -e "Passed all tests.\n"
@rm -f hmrc.ph hmrc.fa hmrc.mpm hmrc_short_[ab].ss hm_[ab].fa hmrc_nogaps_[ab].fa hmrc_sub_[ab].fa hmrc_summary
@@ -43,40 +43,40 @@ msa_view:
phyloFit:
@echo "*** Testing phyloFit ***"
phyloFit hmrc.ss --subst-mod JC69 --tree "(human, (mouse,rat), cow)" -i SS --quiet
- @if [[ -n `diff --brief phyloFit.mod jc.mod` ]] ; then echo "ERROR" ; exit 1 ; fi
+ if ! diff --brief phyloFit.mod jc.mod ; then echo "Rounding errors found" ; diff -u phyloFit.mod jc.mod ; fi
phyloFit hmrc.ss --subst-mod JC69 --tree "((((human,chimp), (mouse,rat)), cow), chicken)" -i SS --quiet
- @if [[ -n `diff --brief phyloFit.mod jc.mod` ]] ; then echo "ERROR" ; exit 1 ; fi
+ if ! diff --brief phyloFit.mod jc.mod ; then echo "ERROR" ; exit 1 ; fi
phyloFit hmrc.ss --subst-mod F81 --tree "(human, (mouse,rat), cow)" -i SS --quiet
- @if [[ -n `diff --brief phyloFit.mod f81.mod` ]] ; then echo "ERROR" ; exit 1 ; fi
+ if ! diff --brief phyloFit.mod f81.mod ; then echo "ERROR" ; exit 1 ; fi
phyloFit hmrc.ss --subst-mod HKY85 --tree "(human, (mouse,rat), cow)" -i SS --quiet
- @if [[ -n `diff --brief phyloFit.mod hky.mod` ]] ; then echo "ERROR" ; exit 1 ; fi
+ if ! diff --brief phyloFit.mod hky.mod ; then echo "ERROR" ; exit 1 ; fi
phyloFit hmrc.ss --subst-mod REV --tree "(human, (mouse,rat), cow)" -i SS --quiet
- @if [[ -n `diff --brief phyloFit.mod rev.mod` ]] ; then echo "ERROR" ; exit 1 ; fi
+ if ! diff --brief phyloFit.mod rev.mod ; then echo "ERROR" ; exit 1 ; fi
phyloFit hmrc.ss --subst-mod UNREST --tree "(human, (mouse,rat), cow)" -i SS --quiet
- @if [[ -n `diff --brief phyloFit.mod unrest.mod` ]] ; then echo "ERROR" ; exit 1 ; fi
+ if ! diff --brief phyloFit.mod unrest.mod ; then echo "ERROR" ; exit 1 ; fi
phyloFit hmrc.ss --subst-mod HKY85 --tree "(human, (mouse,rat), cow)" -i SS -k 4 --quiet
- @if [[ -n `diff --brief phyloFit.mod hky-dg.mod` ]] ; then echo "ERROR" ; exit 1 ; fi
+ if ! diff --brief phyloFit.mod hky-dg.mod ; then echo "ERROR" ; exit 1 ; fi
phyloFit hmrc.ss --subst-mod REV --tree "(human, (mouse,rat), cow)" -i SS -k 4 --quiet
- @if [[ -n `diff --brief phyloFit.mod rev-dg.mod` ]] ; then echo "ERROR" ; exit 1 ; fi
+ if ! diff --brief phyloFit.mod rev-dg.mod ; then echo "ERROR" ; exit 1 ; fi
phyloFit hmrc.ss --subst-mod HKY85 --tree "(human, (mouse,rat), cow)" -i SS --EM --quiet
- @if [[ -n `diff --brief phyloFit.mod hky-em.mod` ]] ; then echo "ERROR" ; exit 1 ; fi
+ if ! diff --brief phyloFit.mod hky-em.mod ; then echo "ERROR" ; exit 1 ; fi
phyloFit hmrc.ss --subst-mod REV --tree "(human, (mouse,rat), cow)" -i SS --EM --quiet
- @if [[ -n `diff --brief phyloFit.mod rev-em.mod` ]] ; then echo "ERROR" ; exit 1 ; fi
+ if ! diff --brief phyloFit.mod rev-em.mod ; then echo "ERROR" ; exit 1 ; fi
phyloFit hpmrc.ss --subst-mod REV --tree "(hg16, (mm3,rn3), galGal2)" -i SS --gaps-as-bases --quiet
- @if [[ -n `diff --brief phyloFit.mod rev-gaps.mod` ]] ; then echo "ERROR" ; exit 1 ; fi
+ if ! diff --brief phyloFit.mod rev-gaps.mod ; then echo "ERROR" ; exit 1 ; fi
phyloFit hmrc.ss --subst-mod REV -i SS --init-model rev.mod --post-probs --lnl --quiet
- @if [[ -n `diff --brief phyloFit.mod rev-lnl.mod` ]] ; then echo "ERROR" ; exit 1 ; fi
- @if [[ -n `diff --brief phyloFit.postprob rev.postprob` ]] ; then echo "ERROR" ; exit 1 ; fi
+ if ! diff --brief phyloFit.mod rev-lnl.mod ; then echo "ERROR" ; exit 1 ; fi
+ if ! diff --brief phyloFit.postprob rev.postprob ; then echo "ERROR" ; exit 1 ; fi
phyloFit hmrc.ss --subst-mod REV --tree "(human, (mouse,rat))" -i SS --quiet
- @if [[ -n `diff --brief phyloFit.mod rev-hmr.mod` ]] ; then echo "ERROR" ; exit 1 ; fi
+ if ! diff --brief phyloFit.mod rev-hmr.mod ; then echo "ERROR" ; exit 1 ; fi
msa_view hmrc.ss -i SS --seqs human,mouse,rat --unordered -o SS > hmr.ss
phyloFit hmr.ss -i SS --quiet
- @if [[ -n `diff --brief phyloFit.mod rev-hmr2.mod` ]] ; then echo "ERROR" ; exit 1 ; fi # FIXME: rev-hmr.mod and rev-hmr2.mod should be equal (eq freqs being obtained from all seqs)
+ if ! diff --brief phyloFit.mod rev-hmr2.mod ; then echo "ERROR" ; exit 1 ; fi # FIXME: rev-hmr.mod and rev-hmr2.mod should be equal (eq freqs being obtained from all seqs)
msa_view hmrc.ss -i SS --seqs human,mouse --unordered -o SS > hm.ss
phyloFit hm.ss -i SS --quiet
- @if [[ -n `diff --brief phyloFit.mod rev-hm.mod` ]] ; then echo "ERROR" ; exit 1 ; fi
+ if ! diff --brief phyloFit.mod rev-hm.mod ; then echo "ERROR" ; exit 1 ; fi
phyloFit hmrc.ss --subst-mod UNREST --tree "((human, mouse), cow)" -i SS --ancestor cow --quiet
- @if [[ -n `diff --brief phyloFit.mod unrest-cow-anc.mod` ]] ; then echo "ERROR" ; exit 1 ; fi
+ if ! diff --brief phyloFit.mod unrest-cow-anc.mod ; then echo "ERROR" ; exit 1 ; fi
@echo -e "Passed all tests.\n"
@rm -f phyloFit.mod phyloFit.postprob hmr.ss hm.ss
@@ -87,12 +87,12 @@ phyloFit:
phastCons:
@echo "*** Testing phastCons ***"
phastCons hpmrc.ss hpmrc-rev-dg-global.mod --nrates 20 --transitions .08,.008 --quiet --viterbi elements.bed --seqname chr22 > cons.dat
- @if [[ -n `diff --brief cons.dat cons_correct.dat` ]] ; then echo "ERROR" ; exit 1 ; fi
- @if [[ -n `diff --brief elements.bed elements_correct.bed` ]] ; then echo "ERROR" ; exit 1 ; fi
+ if ! diff --brief cons.dat cons_correct.dat ; then echo "ERROR" ; exit 1 ; fi
+ if ! diff --brief elements.bed elements_correct.bed ; then echo "ERROR" ; exit 1 ; fi
tree_doctor hpmrc-rev-dg-global.mod --prune galGal2 > hpmr.mod
phastCons hpmrc.ss hpmr.mod --nrates 20 --transitions .08,.008 --quiet --viterbi elements-4way.bed --seqname chr22 > cons-4way.dat
- @if [[ -n `diff --brief cons-4way.dat cons-4way_correct.dat` ]] ; then echo "ERROR" ; exit 1 ; fi
- @if [[ -n `diff --brief elements-4way.bed elements-4way_correct.bed` ]] ; then echo "ERROR" ; exit 1 ; fi
+ if ! diff --brief cons-4way.dat cons-4way_correct.dat ; then echo "ERROR" ; exit 1 ; fi
+ if ! diff --brief elements-4way.bed elements-4way_correct.bed ; then echo "ERROR" ; exit 1 ; fi
@echo -e "Passed all tests.\n"
@rm -f cons.dat cons-4way.dat elements.bed elements-4way.bed hpmr.mod
@@ -110,7 +110,7 @@ phyloP:
phyloP --null 10 phyloFit.mod > phyloP_null_test.txt
phyloP -i SS phyloFit.mod hmrc.ss > phyloP_sph_test.txt
phyloP -i SS --method LRT phyloFit.mod hmrc.ss > phyloP_lrt_test.txt
- phyloP -i SS --method LRT --mode CONACC phyloFit.mod hmrc.ss > phyloP_lrt_conacc_test.txt
+ phyloP -i SS --method LRT --mode CONACC phyloFit.mod hmrc.ss > phyloP_lrt_conacc_test.txt
phyloP -i SS --method GERP phyloFit.mod hmrc.ss > phyloP_gerp_test.txt
phyloP -i SS --method SCORE phyloFit.mod hmrc.ss > phyloP_score_test.txt
phyloP -i SS --method LRT --wig-scores phyloFit.mod hmrc.ss > phyloP_wig_test.wig
=====================================
test/hmrc_summary_correct
=====================================
@@ -1,5 +1,2 @@
-descrip. A C G T G+C length all_gaps some_gaps
descrip. A C G T G+C length all_gaps some_gaps
-
-hmrc.ss 0.3258 0.1913 0.1827 0.3001 0.3740 95927 0 82185
hmrc.ss 0.3258 0.1913 0.1827 0.3001 0.3740 95927 0 82185
View it on GitLab: https://salsa.debian.org/med-team/phast/-/commit/204a70aefa32de527b3f334bb1ff846ea8f69363
--
View it on GitLab: https://salsa.debian.org/med-team/phast/-/commit/204a70aefa32de527b3f334bb1ff846ea8f69363
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20241206/9c295198/attachment-0001.htm>
More information about the debian-med-commit
mailing list