Previous changeset 0:ff1768533a07 (2011-06-07) Next changeset 2:bb1847435ec1 (2011-07-22) |
Commit message:
Uploaded |
added:
clustalomega/clustal-omega-1.0.2/AUTHORS clustalomega/clustal-omega-1.0.2/COPYING clustalomega/clustal-omega-1.0.2/ChangeLog clustalomega/clustal-omega-1.0.2/Doxyfile clustalomega/clustal-omega-1.0.2/Doxyfile.in clustalomega/clustal-omega-1.0.2/INSTALL clustalomega/clustal-omega-1.0.2/Makefile.am clustalomega/clustal-omega-1.0.2/Makefile.in clustalomega/clustal-omega-1.0.2/NEWS clustalomega/clustal-omega-1.0.2/README clustalomega/clustal-omega-1.0.2/TODO clustalomega/clustal-omega-1.0.2/aclocal.m4 clustalomega/clustal-omega-1.0.2/clustalo.pc.in clustalomega/clustal-omega-1.0.2/config.guess clustalomega/clustal-omega-1.0.2/config.sub clustalomega/clustal-omega-1.0.2/configure clustalomega/clustal-omega-1.0.2/configure.ac clustalomega/clustal-omega-1.0.2/depcomp clustalomega/clustal-omega-1.0.2/install-sh clustalomega/clustal-omega-1.0.2/ltmain.sh clustalomega/clustal-omega-1.0.2/m4/ax_openmp.m4 clustalomega/clustal-omega-1.0.2/m4/ax_prefix_config_h.m4 clustalomega/clustal-omega-1.0.2/m4/libtool.m4 clustalomega/clustal-omega-1.0.2/m4/ltoptions.m4 clustalomega/clustal-omega-1.0.2/m4/ltsugar.m4 clustalomega/clustal-omega-1.0.2/m4/ltversion.m4 clustalomega/clustal-omega-1.0.2/m4/lt~obsolete.m4 clustalomega/clustal-omega-1.0.2/missing clustalomega/clustal-omega-1.0.2/src/Makefile.am clustalomega/clustal-omega-1.0.2/src/Makefile.in clustalomega/clustal-omega-1.0.2/src/clustal-omega-config.h clustalomega/clustal-omega-1.0.2/src/clustal-omega.c clustalomega/clustal-omega-1.0.2/src/clustal-omega.h clustalomega/clustal-omega-1.0.2/src/clustal/Makefile.am clustalomega/clustal-omega-1.0.2/src/clustal/Makefile.in clustalomega/clustal-omega-1.0.2/src/clustal/hhalign_wrapper.c clustalomega/clustal-omega-1.0.2/src/clustal/hhalign_wrapper.h clustalomega/clustal-omega-1.0.2/src/clustal/ktuple_pair.c clustalomega/clustal-omega-1.0.2/src/clustal/ktuple_pair.h clustalomega/clustal-omega-1.0.2/src/clustal/list.c clustalomega/clustal-omega-1.0.2/src/clustal/list.h clustalomega/clustal-omega-1.0.2/src/clustal/log.c clustalomega/clustal-omega-1.0.2/src/clustal/log.h clustalomega/clustal-omega-1.0.2/src/clustal/mbed.c clustalomega/clustal-omega-1.0.2/src/clustal/mbed.h clustalomega/clustal-omega-1.0.2/src/clustal/muscle_tree.c clustalomega/clustal-omega-1.0.2/src/clustal/muscle_tree.h clustalomega/clustal-omega-1.0.2/src/clustal/muscle_upgma.c clustalomega/clustal-omega-1.0.2/src/clustal/muscle_upgma.h clustalomega/clustal-omega-1.0.2/src/clustal/pair_dist.c clustalomega/clustal-omega-1.0.2/src/clustal/pair_dist.h clustalomega/clustal-omega-1.0.2/src/clustal/progress.c clustalomega/clustal-omega-1.0.2/src/clustal/progress.h clustalomega/clustal-omega-1.0.2/src/clustal/queue.h clustalomega/clustal-omega-1.0.2/src/clustal/seq.c clustalomega/clustal-omega-1.0.2/src/clustal/seq.h clustalomega/clustal-omega-1.0.2/src/clustal/symmatrix.c clustalomega/clustal-omega-1.0.2/src/clustal/symmatrix.h clustalomega/clustal-omega-1.0.2/src/clustal/tree.c clustalomega/clustal-omega-1.0.2/src/clustal/tree.h clustalomega/clustal-omega-1.0.2/src/clustal/util.c clustalomega/clustal-omega-1.0.2/src/clustal/util.h clustalomega/clustal-omega-1.0.2/src/clustal/weights.c clustalomega/clustal-omega-1.0.2/src/clustal/weights.h clustalomega/clustal-omega-1.0.2/src/clustalo-api-test.c clustalomega/clustal-omega-1.0.2/src/config.h.in clustalomega/clustal-omega-1.0.2/src/hhalign/Makefile.am clustalomega/clustal-omega-1.0.2/src/hhalign/Makefile.in clustalomega/clustal-omega-1.0.2/src/hhalign/general.h clustalomega/clustal-omega-1.0.2/src/hhalign/hash-C.h clustalomega/clustal-omega-1.0.2/src/hhalign/hash.h clustalomega/clustal-omega-1.0.2/src/hhalign/hhalign.cpp clustalomega/clustal-omega-1.0.2/src/hhalign/hhalign.h clustalomega/clustal-omega-1.0.2/src/hhalign/hhalignment-C.h clustalomega/clustal-omega-1.0.2/src/hhalign/hhalignment.h clustalomega/clustal-omega-1.0.2/src/hhalign/hhdecl-C.h clustalomega/clustal-omega-1.0.2/src/hhalign/hhfullalignment-C.h clustalomega/clustal-omega-1.0.2/src/hhalign/hhfullalignment.h clustalomega/clustal-omega-1.0.2/src/hhalign/hhfunc-C.h clustalomega/clustal-omega-1.0.2/src/hhalign/hhfunc.h clustalomega/clustal-omega-1.0.2/src/hhalign/hhhalfalignment-C.h clustalomega/clustal-omega-1.0.2/src/hhalign/hhhalfalignment.h clustalomega/clustal-omega-1.0.2/src/hhalign/hhhit-C.h clustalomega/clustal-omega-1.0.2/src/hhalign/hhhit.h clustalomega/clustal-omega-1.0.2/src/hhalign/hhhitlist-C.h clustalomega/clustal-omega-1.0.2/src/hhalign/hhhitlist.h clustalomega/clustal-omega-1.0.2/src/hhalign/hhhmm-C.h clustalomega/clustal-omega-1.0.2/src/hhalign/hhhmm.h clustalomega/clustal-omega-1.0.2/src/hhalign/hhmatrices-C.h clustalomega/clustal-omega-1.0.2/src/hhalign/hhutil-C.h clustalomega/clustal-omega-1.0.2/src/hhalign/list-C.h clustalomega/clustal-omega-1.0.2/src/hhalign/list.h clustalomega/clustal-omega-1.0.2/src/hhalign/util-C.h clustalomega/clustal-omega-1.0.2/src/kmpp/KMeans.cpp clustalomega/clustal-omega-1.0.2/src/kmpp/KMeans.h clustalomega/clustal-omega-1.0.2/src/kmpp/KmTree.cpp clustalomega/clustal-omega-1.0.2/src/kmpp/KmTree.h clustalomega/clustal-omega-1.0.2/src/kmpp/KmUtils.cpp clustalomega/clustal-omega-1.0.2/src/kmpp/KmUtils.h clustalomega/clustal-omega-1.0.2/src/kmpp/Makefile.am clustalomega/clustal-omega-1.0.2/src/kmpp/Makefile.in clustalomega/clustal-omega-1.0.2/src/main.cpp clustalomega/clustal-omega-1.0.2/src/mymain.c clustalomega/clustal-omega-1.0.2/src/mymain.h clustalomega/clustal-omega-1.0.2/src/squid/00README clustalomega/clustal-omega-1.0.2/src/squid/COPYRIGHT clustalomega/clustal-omega-1.0.2/src/squid/LICENSE clustalomega/clustal-omega-1.0.2/src/squid/Makefile.am clustalomega/clustal-omega-1.0.2/src/squid/Makefile.in clustalomega/clustal-omega-1.0.2/src/squid/a2m.c clustalomega/clustal-omega-1.0.2/src/squid/aligneval.c clustalomega/clustal-omega-1.0.2/src/squid/alignio.c clustalomega/clustal-omega-1.0.2/src/squid/clustal.c clustalomega/clustal-omega-1.0.2/src/squid/clustalo.README clustalomega/clustal-omega-1.0.2/src/squid/cluster.c clustalomega/clustal-omega-1.0.2/src/squid/dayhoff.c clustalomega/clustal-omega-1.0.2/src/squid/eps.c clustalomega/clustal-omega-1.0.2/src/squid/file.c clustalomega/clustal-omega-1.0.2/src/squid/getopt.c clustalomega/clustal-omega-1.0.2/src/squid/gki.c clustalomega/clustal-omega-1.0.2/src/squid/gki.h clustalomega/clustal-omega-1.0.2/src/squid/gsi.c clustalomega/clustal-omega-1.0.2/src/squid/gsi.h clustalomega/clustal-omega-1.0.2/src/squid/gsi64.c clustalomega/clustal-omega-1.0.2/src/squid/gsi64.h clustalomega/clustal-omega-1.0.2/src/squid/hsregex.c clustalomega/clustal-omega-1.0.2/src/squid/iupac.c clustalomega/clustal-omega-1.0.2/src/squid/msa.c clustalomega/clustal-omega-1.0.2/src/squid/msa.h clustalomega/clustal-omega-1.0.2/src/squid/msf.c clustalomega/clustal-omega-1.0.2/src/squid/phylip.c clustalomega/clustal-omega-1.0.2/src/squid/revcomp.c clustalomega/clustal-omega-1.0.2/src/squid/rk.c clustalomega/clustal-omega-1.0.2/src/squid/rk.h clustalomega/clustal-omega-1.0.2/src/squid/selex.c clustalomega/clustal-omega-1.0.2/src/squid/seqencode.c clustalomega/clustal-omega-1.0.2/src/squid/shuffle.c clustalomega/clustal-omega-1.0.2/src/squid/sqerror.c clustalomega/clustal-omega-1.0.2/src/squid/sqfuncs.h clustalomega/clustal-omega-1.0.2/src/squid/sqio.c clustalomega/clustal-omega-1.0.2/src/squid/squid-1.9g.tar.gz clustalomega/clustal-omega-1.0.2/src/squid/squid.h clustalomega/clustal-omega-1.0.2/src/squid/squidcore.c clustalomega/clustal-omega-1.0.2/src/squid/sre_ctype.c clustalomega/clustal-omega-1.0.2/src/squid/sre_math.c clustalomega/clustal-omega-1.0.2/src/squid/sre_random.c clustalomega/clustal-omega-1.0.2/src/squid/sre_random.h clustalomega/clustal-omega-1.0.2/src/squid/sre_string.c clustalomega/clustal-omega-1.0.2/src/squid/ssi.c clustalomega/clustal-omega-1.0.2/src/squid/ssi.h clustalomega/clustal-omega-1.0.2/src/squid/stack.c clustalomega/clustal-omega-1.0.2/src/squid/stockholm.c clustalomega/clustal-omega-1.0.2/src/squid/stockholm.h clustalomega/clustal-omega-1.0.2/src/squid/stopwatch.c clustalomega/clustal-omega-1.0.2/src/squid/stopwatch.h clustalomega/clustal-omega-1.0.2/src/squid/translate.c clustalomega/clustal-omega-1.0.2/src/squid/types.c clustalomega/clustal-omega-1.0.2/src/squid/vectorops.c clustalomega/clustal-omega-1.0.2/src/squid/vectorops.h clustalomega/clustal-omega-1.0.2/src/squid/version.h clustalomega/clustal-omega-1.0.2/src/squid/weight.c |
removed:
clustalomega/clustal-omega-0.2.0/AUTHORS clustalomega/clustal-omega-0.2.0/COPYING clustalomega/clustal-omega-0.2.0/ChangeLog clustalomega/clustal-omega-0.2.0/Doxyfile clustalomega/clustal-omega-0.2.0/Doxyfile.in clustalomega/clustal-omega-0.2.0/INSTALL clustalomega/clustal-omega-0.2.0/Makefile.am clustalomega/clustal-omega-0.2.0/Makefile.in clustalomega/clustal-omega-0.2.0/NEWS clustalomega/clustal-omega-0.2.0/README clustalomega/clustal-omega-0.2.0/TODO clustalomega/clustal-omega-0.2.0/aclocal.m4 clustalomega/clustal-omega-0.2.0/clustalo.pc.in clustalomega/clustal-omega-0.2.0/config.guess clustalomega/clustal-omega-0.2.0/config.sub clustalomega/clustal-omega-0.2.0/configure clustalomega/clustal-omega-0.2.0/configure.ac clustalomega/clustal-omega-0.2.0/depcomp clustalomega/clustal-omega-0.2.0/install-sh clustalomega/clustal-omega-0.2.0/ltmain.sh clustalomega/clustal-omega-0.2.0/m4/ax_openmp.m4 clustalomega/clustal-omega-0.2.0/m4/ax_prefix_config_h.m4 clustalomega/clustal-omega-0.2.0/m4/libtool.m4 clustalomega/clustal-omega-0.2.0/m4/ltoptions.m4 clustalomega/clustal-omega-0.2.0/m4/ltsugar.m4 clustalomega/clustal-omega-0.2.0/m4/ltversion.m4 clustalomega/clustal-omega-0.2.0/m4/lt~obsolete.m4 clustalomega/clustal-omega-0.2.0/missing clustalomega/clustal-omega-0.2.0/src/Makefile.am clustalomega/clustal-omega-0.2.0/src/Makefile.in clustalomega/clustal-omega-0.2.0/src/clustal-omega-config.h clustalomega/clustal-omega-0.2.0/src/clustal-omega.c clustalomega/clustal-omega-0.2.0/src/clustal-omega.h clustalomega/clustal-omega-0.2.0/src/clustal/Makefile.am clustalomega/clustal-omega-0.2.0/src/clustal/Makefile.in clustalomega/clustal-omega-0.2.0/src/clustal/hhalign_wrapper.c clustalomega/clustal-omega-0.2.0/src/clustal/hhalign_wrapper.h clustalomega/clustal-omega-0.2.0/src/clustal/ktuple_pair.c clustalomega/clustal-omega-0.2.0/src/clustal/ktuple_pair.h clustalomega/clustal-omega-0.2.0/src/clustal/list.c clustalomega/clustal-omega-0.2.0/src/clustal/list.h clustalomega/clustal-omega-0.2.0/src/clustal/log.c clustalomega/clustal-omega-0.2.0/src/clustal/log.h clustalomega/clustal-omega-0.2.0/src/clustal/mbed.c clustalomega/clustal-omega-0.2.0/src/clustal/mbed.h clustalomega/clustal-omega-0.2.0/src/clustal/muscle_tree.c clustalomega/clustal-omega-0.2.0/src/clustal/muscle_tree.h clustalomega/clustal-omega-0.2.0/src/clustal/muscle_upgma.c clustalomega/clustal-omega-0.2.0/src/clustal/muscle_upgma.h clustalomega/clustal-omega-0.2.0/src/clustal/pair_dist.c clustalomega/clustal-omega-0.2.0/src/clustal/pair_dist.h clustalomega/clustal-omega-0.2.0/src/clustal/progress.c clustalomega/clustal-omega-0.2.0/src/clustal/progress.h clustalomega/clustal-omega-0.2.0/src/clustal/queue.h clustalomega/clustal-omega-0.2.0/src/clustal/seq.c clustalomega/clustal-omega-0.2.0/src/clustal/seq.h clustalomega/clustal-omega-0.2.0/src/clustal/symmatrix.c clustalomega/clustal-omega-0.2.0/src/clustal/symmatrix.h clustalomega/clustal-omega-0.2.0/src/clustal/tree.c clustalomega/clustal-omega-0.2.0/src/clustal/tree.h clustalomega/clustal-omega-0.2.0/src/clustal/util.c clustalomega/clustal-omega-0.2.0/src/clustal/util.h clustalomega/clustal-omega-0.2.0/src/clustal/weights.c clustalomega/clustal-omega-0.2.0/src/clustal/weights.h clustalomega/clustal-omega-0.2.0/src/clustalo-api-test.c clustalomega/clustal-omega-0.2.0/src/config.h.in clustalomega/clustal-omega-0.2.0/src/hhalign/Makefile.am clustalomega/clustal-omega-0.2.0/src/hhalign/Makefile.in clustalomega/clustal-omega-0.2.0/src/hhalign/general.h clustalomega/clustal-omega-0.2.0/src/hhalign/hash-C.h clustalomega/clustal-omega-0.2.0/src/hhalign/hash.h clustalomega/clustal-omega-0.2.0/src/hhalign/hhalign.cpp clustalomega/clustal-omega-0.2.0/src/hhalign/hhalign.h clustalomega/clustal-omega-0.2.0/src/hhalign/hhalignment-C.h clustalomega/clustal-omega-0.2.0/src/hhalign/hhalignment.h clustalomega/clustal-omega-0.2.0/src/hhalign/hhdecl-C.h clustalomega/clustal-omega-0.2.0/src/hhalign/hhfullalignment-C.h clustalomega/clustal-omega-0.2.0/src/hhalign/hhfullalignment.h clustalomega/clustal-omega-0.2.0/src/hhalign/hhfunc-C.h clustalomega/clustal-omega-0.2.0/src/hhalign/hhfunc.h clustalomega/clustal-omega-0.2.0/src/hhalign/hhhalfalignment-C.h clustalomega/clustal-omega-0.2.0/src/hhalign/hhhalfalignment.h clustalomega/clustal-omega-0.2.0/src/hhalign/hhhit-C.h clustalomega/clustal-omega-0.2.0/src/hhalign/hhhit.h clustalomega/clustal-omega-0.2.0/src/hhalign/hhhitlist-C.h clustalomega/clustal-omega-0.2.0/src/hhalign/hhhitlist.h clustalomega/clustal-omega-0.2.0/src/hhalign/hhhmm-C.h clustalomega/clustal-omega-0.2.0/src/hhalign/hhhmm.h clustalomega/clustal-omega-0.2.0/src/hhalign/hhmatrices-C.h clustalomega/clustal-omega-0.2.0/src/hhalign/hhutil-C.h clustalomega/clustal-omega-0.2.0/src/hhalign/list-C.h clustalomega/clustal-omega-0.2.0/src/hhalign/list.h clustalomega/clustal-omega-0.2.0/src/hhalign/util-C.h clustalomega/clustal-omega-0.2.0/src/kmpp/KMeans.cpp clustalomega/clustal-omega-0.2.0/src/kmpp/KMeans.h clustalomega/clustal-omega-0.2.0/src/kmpp/KmTree.cpp clustalomega/clustal-omega-0.2.0/src/kmpp/KmTree.h clustalomega/clustal-omega-0.2.0/src/kmpp/KmUtils.cpp clustalomega/clustal-omega-0.2.0/src/kmpp/KmUtils.h clustalomega/clustal-omega-0.2.0/src/kmpp/Makefile.am clustalomega/clustal-omega-0.2.0/src/kmpp/Makefile.in clustalomega/clustal-omega-0.2.0/src/main.cpp clustalomega/clustal-omega-0.2.0/src/mymain.c clustalomega/clustal-omega-0.2.0/src/mymain.h clustalomega/clustal-omega-0.2.0/src/squid/00README clustalomega/clustal-omega-0.2.0/src/squid/COPYRIGHT clustalomega/clustal-omega-0.2.0/src/squid/LICENSE clustalomega/clustal-omega-0.2.0/src/squid/Makefile.am clustalomega/clustal-omega-0.2.0/src/squid/Makefile.in clustalomega/clustal-omega-0.2.0/src/squid/a2m.c clustalomega/clustal-omega-0.2.0/src/squid/aligneval.c clustalomega/clustal-omega-0.2.0/src/squid/alignio.c clustalomega/clustal-omega-0.2.0/src/squid/clustal.c clustalomega/clustal-omega-0.2.0/src/squid/clustalo.README clustalomega/clustal-omega-0.2.0/src/squid/cluster.c clustalomega/clustal-omega-0.2.0/src/squid/dayhoff.c clustalomega/clustal-omega-0.2.0/src/squid/eps.c clustalomega/clustal-omega-0.2.0/src/squid/file.c clustalomega/clustal-omega-0.2.0/src/squid/getopt.c clustalomega/clustal-omega-0.2.0/src/squid/gki.c clustalomega/clustal-omega-0.2.0/src/squid/gki.h clustalomega/clustal-omega-0.2.0/src/squid/gsi.c clustalomega/clustal-omega-0.2.0/src/squid/gsi.h clustalomega/clustal-omega-0.2.0/src/squid/gsi64.c clustalomega/clustal-omega-0.2.0/src/squid/gsi64.h clustalomega/clustal-omega-0.2.0/src/squid/hsregex.c clustalomega/clustal-omega-0.2.0/src/squid/iupac.c clustalomega/clustal-omega-0.2.0/src/squid/msa.c clustalomega/clustal-omega-0.2.0/src/squid/msa.h clustalomega/clustal-omega-0.2.0/src/squid/msf.c clustalomega/clustal-omega-0.2.0/src/squid/phylip.c clustalomega/clustal-omega-0.2.0/src/squid/revcomp.c clustalomega/clustal-omega-0.2.0/src/squid/rk.c clustalomega/clustal-omega-0.2.0/src/squid/rk.h clustalomega/clustal-omega-0.2.0/src/squid/selex.c clustalomega/clustal-omega-0.2.0/src/squid/seqencode.c clustalomega/clustal-omega-0.2.0/src/squid/shuffle.c clustalomega/clustal-omega-0.2.0/src/squid/sqerror.c clustalomega/clustal-omega-0.2.0/src/squid/sqfuncs.h clustalomega/clustal-omega-0.2.0/src/squid/sqio.c clustalomega/clustal-omega-0.2.0/src/squid/squid-1.9g.tar.gz clustalomega/clustal-omega-0.2.0/src/squid/squid.h clustalomega/clustal-omega-0.2.0/src/squid/squidcore.c clustalomega/clustal-omega-0.2.0/src/squid/sre_ctype.c clustalomega/clustal-omega-0.2.0/src/squid/sre_math.c clustalomega/clustal-omega-0.2.0/src/squid/sre_random.c clustalomega/clustal-omega-0.2.0/src/squid/sre_random.h clustalomega/clustal-omega-0.2.0/src/squid/sre_string.c clustalomega/clustal-omega-0.2.0/src/squid/ssi.c clustalomega/clustal-omega-0.2.0/src/squid/ssi.h clustalomega/clustal-omega-0.2.0/src/squid/stack.c clustalomega/clustal-omega-0.2.0/src/squid/stockholm.c clustalomega/clustal-omega-0.2.0/src/squid/stockholm.h clustalomega/clustal-omega-0.2.0/src/squid/stopwatch.c clustalomega/clustal-omega-0.2.0/src/squid/stopwatch.h clustalomega/clustal-omega-0.2.0/src/squid/translate.c clustalomega/clustal-omega-0.2.0/src/squid/types.c clustalomega/clustal-omega-0.2.0/src/squid/vectorops.c clustalomega/clustal-omega-0.2.0/src/squid/vectorops.h clustalomega/clustal-omega-0.2.0/src/squid/version.h clustalomega/clustal-omega-0.2.0/src/squid/weight.c |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/AUTHORS --- a/clustalomega/clustal-omega-0.2.0/AUTHORS Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,20 +0,0 @@ -* Clustal Omega: -Fabian Sievers UCD Dublin, Ireland -Andreas Wilm UCD Dublin, Ireland -David Dineen UCD Dublin, Ireland -Johannes Söding Gene Center Munich, Germany -Michael Remmert Gene Center Munich, Germany - -* Clustal 2 -Mark Larkin UCD Dublin, Ireland - -* Clustal 1.X -Toby Gibson EMBL Heidelberg, Germany -Des Higgins UCC Cork, Ireland -Julie Thompson IGBMC Strasbourg, France - -* Contributors: -Chenna Ramu EMBL Heidelberg, Germany -Nigel Brown EMBL Heidelberg, Germany - - |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/COPYING --- a/clustalomega/clustal-omega-0.2.0/COPYING Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
b'@@ -1,339 +0,0 @@\n- GNU GENERAL PUBLIC LICENSE\n- Version 2, June 1991\n-\n- Copyright (C) 1989, 1991 Free Software Foundation, Inc.,\n- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n- Everyone is permitted to copy and distribute verbatim copies\n- of this license document, but changing it is not allowed.\n-\n- Preamble\n-\n- The licenses for most software are designed to take away your\n-freedom to share and change it. By contrast, the GNU General Public\n-License is intended to guarantee your freedom to share and change free\n-software--to make sure the software is free for all its users. This\n-General Public License applies to most of the Free Software\n-Foundation\'s software and to any other program whose authors commit to\n-using it. (Some other Free Software Foundation software is covered by\n-the GNU Lesser General Public License instead.) You can apply it to\n-your programs, too.\n-\n- When we speak of free software, we are referring to freedom, not\n-price. Our General Public Licenses are designed to make sure that you\n-have the freedom to distribute copies of free software (and charge for\n-this service if you wish), that you receive source code or can get it\n-if you want it, that you can change the software or use pieces of it\n-in new free programs; and that you know you can do these things.\n-\n- To protect your rights, we need to make restrictions that forbid\n-anyone to deny you these rights or to ask you to surrender the rights.\n-These restrictions translate to certain responsibilities for you if you\n-distribute copies of the software, or if you modify it.\n-\n- For example, if you distribute copies of such a program, whether\n-gratis or for a fee, you must give the recipients all the rights that\n-you have. You must make sure that they, too, receive or can get the\n-source code. And you must show them these terms so they know their\n-rights.\n-\n- We protect your rights with two steps: (1) copyright the software, and\n-(2) offer you this license which gives you legal permission to copy,\n-distribute and/or modify the software.\n-\n- Also, for each author\'s protection and ours, we want to make certain\n-that everyone understands that there is no warranty for this free\n-software. If the software is modified by someone else and passed on, we\n-want its recipients to know that what they have is not the original, so\n-that any problems introduced by others will not reflect on the original\n-authors\' reputations.\n-\n- Finally, any free program is threatened constantly by software\n-patents. We wish to avoid the danger that redistributors of a free\n-program will individually obtain patent licenses, in effect making the\n-program proprietary. To prevent this, we have made it clear that any\n-patent must be licensed for everyone\'s free use or not licensed at all.\n-\n- The precise terms and conditions for copying, distribution and\n-modification follow.\n-\n- GNU GENERAL PUBLIC LICENSE\n- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\n-\n- 0. This License applies to any program or other work which contains\n-a notice placed by the copyright holder saying it may be distributed\n-under the terms of this General Public License. The "Program", below,\n-refers to any such program or work, and a "work based on the Program"\n-means either the Program or any derivative work under copyright law:\n-that is to say, a work containing the Program or a portion of it,\n-either verbatim or with modifications and/or translated into another\n-language. (Hereinafter, translation is included without limitation in\n-the term "modification".) Each licensee is addressed as "you".\n-\n-Activities other than copying, distribution and modification are not\n-covered by this License; they are outside its scope. The act of\n-running the Program is not restricted, and the output from the Program\n-is covered only if its contents constitute a work based on the\n-Program (i'..b'PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED\n-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS\n-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE\n-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,\n-REPAIR OR CORRECTION.\n-\n- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\n-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR\n-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,\n-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING\n-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED\n-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY\n-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER\n-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE\n-POSSIBILITY OF SUCH DAMAGES.\n-\n- END OF TERMS AND CONDITIONS\n-\n- How to Apply These Terms to Your New Programs\n-\n- If you develop a new program, and you want it to be of the greatest\n-possible use to the public, the best way to achieve this is to make it\n-free software which everyone can redistribute and change under these terms.\n-\n- To do so, attach the following notices to the program. It is safest\n-to attach them to the start of each source file to most effectively\n-convey the exclusion of warranty; and each file should have at least\n-the "copyright" line and a pointer to where the full notice is found.\n-\n- <one line to give the program\'s name and a brief idea of what it does.>\n- Copyright (C) <year> <name of author>\n-\n- This program is free software; you can redistribute it and/or modify\n- it under the terms of the GNU General Public License as published by\n- the Free Software Foundation; either version 2 of the License, or\n- (at your option) any later version.\n-\n- This program is distributed in the hope that it will be useful,\n- but WITHOUT ANY WARRANTY; without even the implied warranty of\n- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n- GNU General Public License for more details.\n-\n- You should have received a copy of the GNU General Public License along\n- with this program; if not, write to the Free Software Foundation, Inc.,\n- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\n-\n-Also add information on how to contact you by electronic and paper mail.\n-\n-If the program is interactive, make it output a short notice like this\n-when it starts in an interactive mode:\n-\n- Gnomovision version 69, Copyright (C) year name of author\n- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w\'.\n- This is free software, and you are welcome to redistribute it\n- under certain conditions; type `show c\' for details.\n-\n-The hypothetical commands `show w\' and `show c\' should show the appropriate\n-parts of the General Public License. Of course, the commands you use may\n-be called something other than `show w\' and `show c\'; they could even be\n-mouse-clicks or menu items--whatever suits your program.\n-\n-You should also get your employer (if you work as a programmer) or your\n-school, if any, to sign a "copyright disclaimer" for the program, if\n-necessary. Here is a sample; alter the names:\n-\n- Yoyodyne, Inc., hereby disclaims all copyright interest in the program\n- `Gnomovision\' (which makes passes at compilers) written by James Hacker.\n-\n- <signature of Ty Coon>, 1 April 1989\n- Ty Coon, President of Vice\n-\n-This General Public License does not permit incorporating your program into\n-proprietary programs. If your program is a subroutine library, you may\n-consider it more useful to permit linking proprietary applications with the\n-library. If this is what you want to do, use the GNU Lesser General\n-Public License instead of this License.\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/ChangeLog --- a/clustalomega/clustal-omega-0.2.0/ChangeLog Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,15 +0,0 @@ -2010-06-17 Release 0.0.1 (Dubliniensis) - - First "release" as program has been able for a while to perform - all basic tasks without problems. - - Non-standard features already built-in include: - HMM-iteration (using HMMER for building an HMM) and guide-tree - iteration. On top of that HMM input works fine and - background-frequencies are added to the HHalign process. - - Known issues: RNA/DNA alignment is considered buggy. Aligned - sequences have to be dealigned for HHalign to work properly. - - The HMMER version message can be ignored if no HMM-iteration - was used. |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/Doxyfile --- a/clustalomega/clustal-omega-0.2.0/Doxyfile Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,1510 +0,0 @@\n-# Doxyfile 1.5.8\n-\n-# This file describes the settings to be used by the documentation system\n-# doxygen (www.doxygen.org) for a project\n-#\n-# All text after a hash (#) is considered a comment and will be ignored\n-# The format is:\n-# TAG = value [value, ...]\n-# For lists items can also be appended using:\n-# TAG += value [value, ...]\n-# Values that contain spaces should be placed between quotes (" ")\n-\n-#---------------------------------------------------------------------------\n-# Project related configuration options\n-#---------------------------------------------------------------------------\n-\n-# This tag specifies the encoding used for all characters in the config file \n-# that follow. The default is UTF-8 which is also the encoding used for all \n-# text before the first occurrence of this tag. Doxygen uses libiconv (or the \n-# iconv built into libc) for the transcoding. See \n-# http://www.gnu.org/software/libiconv for the list of possible encodings.\n-\n-DOXYFILE_ENCODING = UTF-8\n-\n-# The PROJECT_NAME tag is a single word (or a sequence of words surrounded \n-# by quotes) that should identify the project.\n-\n-PROJECT_NAME = "Clustal Omega"\n-\n-# The PROJECT_NUMBER tag can be used to enter a project or revision number. \n-# This could be handy for archiving the generated documentation or \n-# if some version control system is used.\n-\n-PROJECT_NUMBER = 0.2.0\n-\n-# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) \n-# base path where the generated documentation will be put. \n-# If a relative path is entered, it will be relative to the location \n-# where doxygen was started. If left blank the current directory will be used.\n-\n-OUTPUT_DIRECTORY = ./doc/doxygen/\n-\n-# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create \n-# 4096 sub-directories (in 2 levels) under the output directory of each output \n-# format and will distribute the generated files over these directories. \n-# Enabling this option can be useful when feeding doxygen a huge amount of \n-# source files, where putting all generated files in the same directory would \n-# otherwise cause performance problems for the file system.\n-\n-CREATE_SUBDIRS = NO\n-\n-# The OUTPUT_LANGUAGE tag is used to specify the language in which all \n-# documentation generated by doxygen is written. Doxygen will use this \n-# information to generate all constant output in the proper language. \n-# The default language is English, other supported languages are: \n-# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, \n-# Croatian, Czech, Danish, Dutch, Farsi, Finnish, French, German, Greek, \n-# Hungarian, Italian, Japanese, Japanese-en (Japanese with English messages), \n-# Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, Polish, \n-# Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, Slovene, \n-# Spanish, Swedish, and Ukrainian.\n-\n-OUTPUT_LANGUAGE = English\n-\n-# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will \n-# include brief member descriptions after the members that are listed in \n-# the file and class documentation (similar to JavaDoc). \n-# Set to NO to disable this.\n-\n-BRIEF_MEMBER_DESC = YES\n-\n-# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend \n-# the brief description of a member or function before the detailed description. \n-# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the \n-# brief descriptions will be completely suppressed.\n-\n-REPEAT_BRIEF = YES\n-\n-# This tag implements a quasi-intelligent brief description abbreviator \n-# that is used to form the text in various listings. Each string \n-# in this list, if found as the leading text of the brief description, will be \n-# stripped from the text and the result after processing the whole list, is \n-# used as the annotated text. Otherwise, the brief description is used as-is. \n-# If left blank, the following values'..b'ss method. Note that enabling this option will significantly increase \n-# the time of a run. So in most cases it will be better to enable caller \n-# graphs for selected functions only using the \\callergraph command.\n-\n-CALLER_GRAPH = NO\n-\n-# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen \n-# will graphical hierarchy of all classes instead of a textual one.\n-\n-GRAPHICAL_HIERARCHY = YES\n-\n-# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES \n-# then doxygen will show the dependencies a directory has on other directories \n-# in a graphical way. The dependency relations are determined by the #include \n-# relations between the files in the directories.\n-\n-DIRECTORY_GRAPH = YES\n-\n-# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images \n-# generated by dot. Possible values are png, jpg, or gif \n-# If left blank png will be used.\n-\n-DOT_IMAGE_FORMAT = png\n-\n-# The tag DOT_PATH can be used to specify the path where the dot tool can be \n-# found. If left blank, it is assumed the dot tool can be found in the path.\n-\n-DOT_PATH = \n-\n-# The DOTFILE_DIRS tag can be used to specify one or more directories that \n-# contain dot files that are included in the documentation (see the \n-# \\dotfile command).\n-\n-DOTFILE_DIRS = \n-\n-# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of \n-# nodes that will be shown in the graph. If the number of nodes in a graph \n-# becomes larger than this value, doxygen will truncate the graph, which is \n-# visualized by representing a node as a red box. Note that doxygen if the \n-# number of direct children of the root node in a graph is already larger than \n-# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note \n-# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.\n-\n-DOT_GRAPH_MAX_NODES = 50\n-\n-# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the \n-# graphs generated by dot. A depth value of 3 means that only nodes reachable \n-# from the root by following a path via at most 3 edges will be shown. Nodes \n-# that lay further from the root node will be omitted. Note that setting this \n-# option to 1 or 2 may greatly reduce the computation time needed for large \n-# code bases. Also note that the size of a graph can be further restricted by \n-# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.\n-\n-MAX_DOT_GRAPH_DEPTH = 0\n-\n-# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent \n-# background. This is disabled by default, because dot on Windows does not \n-# seem to support this out of the box. Warning: Depending on the platform used, \n-# enabling this option may lead to badly anti-aliased labels on the edges of \n-# a graph (i.e. they become hard to read).\n-\n-DOT_TRANSPARENT = NO\n-\n-# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output \n-# files in one run (i.e. multiple -o and -T options on the command line). This \n-# makes dot run faster, but since only newer versions of dot (>1.8.10) \n-# support this, this feature is disabled by default.\n-\n-DOT_MULTI_TARGETS = NO\n-\n-# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will \n-# generate a legend page explaining the meaning of the various boxes and \n-# arrows in the dot generated graphs.\n-\n-GENERATE_LEGEND = YES\n-\n-# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will \n-# remove the intermediate dot files that are used to generate \n-# the various graphs.\n-\n-DOT_CLEANUP = YES\n-\n-#---------------------------------------------------------------------------\n-# Options related to the search engine\n-#---------------------------------------------------------------------------\n-\n-# The SEARCHENGINE tag specifies whether or not a search engine should be \n-# used. If set to NO the values of all tags below this one will be ignored.\n-\n-SEARCHENGINE = NO\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/Doxyfile.in --- a/clustalomega/clustal-omega-0.2.0/Doxyfile.in Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,1510 +0,0 @@\n-# Doxyfile 1.5.8\n-\n-# This file describes the settings to be used by the documentation system\n-# doxygen (www.doxygen.org) for a project\n-#\n-# All text after a hash (#) is considered a comment and will be ignored\n-# The format is:\n-# TAG = value [value, ...]\n-# For lists items can also be appended using:\n-# TAG += value [value, ...]\n-# Values that contain spaces should be placed between quotes (" ")\n-\n-#---------------------------------------------------------------------------\n-# Project related configuration options\n-#---------------------------------------------------------------------------\n-\n-# This tag specifies the encoding used for all characters in the config file \n-# that follow. The default is UTF-8 which is also the encoding used for all \n-# text before the first occurrence of this tag. Doxygen uses libiconv (or the \n-# iconv built into libc) for the transcoding. See \n-# http://www.gnu.org/software/libiconv for the list of possible encodings.\n-\n-DOXYFILE_ENCODING = UTF-8\n-\n-# The PROJECT_NAME tag is a single word (or a sequence of words surrounded \n-# by quotes) that should identify the project.\n-\n-PROJECT_NAME = "@PACKAGE_NAME@"\n-\n-# The PROJECT_NUMBER tag can be used to enter a project or revision number. \n-# This could be handy for archiving the generated documentation or \n-# if some version control system is used.\n-\n-PROJECT_NUMBER = @PACKAGE_VERSION@\n-\n-# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) \n-# base path where the generated documentation will be put. \n-# If a relative path is entered, it will be relative to the location \n-# where doxygen was started. If left blank the current directory will be used.\n-\n-OUTPUT_DIRECTORY = ./doc/doxygen/\n-\n-# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create \n-# 4096 sub-directories (in 2 levels) under the output directory of each output \n-# format and will distribute the generated files over these directories. \n-# Enabling this option can be useful when feeding doxygen a huge amount of \n-# source files, where putting all generated files in the same directory would \n-# otherwise cause performance problems for the file system.\n-\n-CREATE_SUBDIRS = NO\n-\n-# The OUTPUT_LANGUAGE tag is used to specify the language in which all \n-# documentation generated by doxygen is written. Doxygen will use this \n-# information to generate all constant output in the proper language. \n-# The default language is English, other supported languages are: \n-# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, \n-# Croatian, Czech, Danish, Dutch, Farsi, Finnish, French, German, Greek, \n-# Hungarian, Italian, Japanese, Japanese-en (Japanese with English messages), \n-# Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, Polish, \n-# Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, Slovene, \n-# Spanish, Swedish, and Ukrainian.\n-\n-OUTPUT_LANGUAGE = English\n-\n-# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will \n-# include brief member descriptions after the members that are listed in \n-# the file and class documentation (similar to JavaDoc). \n-# Set to NO to disable this.\n-\n-BRIEF_MEMBER_DESC = YES\n-\n-# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend \n-# the brief description of a member or function before the detailed description. \n-# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the \n-# brief descriptions will be completely suppressed.\n-\n-REPEAT_BRIEF = YES\n-\n-# This tag implements a quasi-intelligent brief description abbreviator \n-# that is used to form the text in various listings. Each string \n-# in this list, if found as the leading text of the brief description, will be \n-# stripped from the text and the result after processing the whole list, is \n-# used as the annotated text. Otherwise, the brief description is used as-is. \n-# If left blank, the fol'..b'ss method. Note that enabling this option will significantly increase \n-# the time of a run. So in most cases it will be better to enable caller \n-# graphs for selected functions only using the \\callergraph command.\n-\n-CALLER_GRAPH = NO\n-\n-# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen \n-# will graphical hierarchy of all classes instead of a textual one.\n-\n-GRAPHICAL_HIERARCHY = YES\n-\n-# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES \n-# then doxygen will show the dependencies a directory has on other directories \n-# in a graphical way. The dependency relations are determined by the #include \n-# relations between the files in the directories.\n-\n-DIRECTORY_GRAPH = YES\n-\n-# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images \n-# generated by dot. Possible values are png, jpg, or gif \n-# If left blank png will be used.\n-\n-DOT_IMAGE_FORMAT = png\n-\n-# The tag DOT_PATH can be used to specify the path where the dot tool can be \n-# found. If left blank, it is assumed the dot tool can be found in the path.\n-\n-DOT_PATH = \n-\n-# The DOTFILE_DIRS tag can be used to specify one or more directories that \n-# contain dot files that are included in the documentation (see the \n-# \\dotfile command).\n-\n-DOTFILE_DIRS = \n-\n-# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of \n-# nodes that will be shown in the graph. If the number of nodes in a graph \n-# becomes larger than this value, doxygen will truncate the graph, which is \n-# visualized by representing a node as a red box. Note that doxygen if the \n-# number of direct children of the root node in a graph is already larger than \n-# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note \n-# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.\n-\n-DOT_GRAPH_MAX_NODES = 50\n-\n-# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the \n-# graphs generated by dot. A depth value of 3 means that only nodes reachable \n-# from the root by following a path via at most 3 edges will be shown. Nodes \n-# that lay further from the root node will be omitted. Note that setting this \n-# option to 1 or 2 may greatly reduce the computation time needed for large \n-# code bases. Also note that the size of a graph can be further restricted by \n-# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.\n-\n-MAX_DOT_GRAPH_DEPTH = 0\n-\n-# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent \n-# background. This is disabled by default, because dot on Windows does not \n-# seem to support this out of the box. Warning: Depending on the platform used, \n-# enabling this option may lead to badly anti-aliased labels on the edges of \n-# a graph (i.e. they become hard to read).\n-\n-DOT_TRANSPARENT = NO\n-\n-# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output \n-# files in one run (i.e. multiple -o and -T options on the command line). This \n-# makes dot run faster, but since only newer versions of dot (>1.8.10) \n-# support this, this feature is disabled by default.\n-\n-DOT_MULTI_TARGETS = NO\n-\n-# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will \n-# generate a legend page explaining the meaning of the various boxes and \n-# arrows in the dot generated graphs.\n-\n-GENERATE_LEGEND = YES\n-\n-# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will \n-# remove the intermediate dot files that are used to generate \n-# the various graphs.\n-\n-DOT_CLEANUP = YES\n-\n-#---------------------------------------------------------------------------\n-# Options related to the search engine\n-#---------------------------------------------------------------------------\n-\n-# The SEARCHENGINE tag specifies whether or not a search engine should be \n-# used. If set to NO the values of all tags below this one will be ignored.\n-\n-SEARCHENGINE = NO\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/INSTALL --- a/clustalomega/clustal-omega-0.2.0/INSTALL Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
b"@@ -1,398 +0,0 @@\n-The impatient can try:\n-\n-$ ./configure\n-$ make\n-$ make install\n-\n-\n-Clustal-Omega needs argtable2 (http://argtable.sourceforge.net/). If\n-argtable2 is installed in a non-standard directory you might have to\n-point configure to its installation directory. For example, if you are\n-on a Mac and have argtable installed via MacPorts then you should use\n-the following command line:\n-\n-$ ./configure CFLAGS='-I/opt/local/include' LDFLAGS='-L/opt/local/lib'\n-\n-\n-ClustalO will automatically support multi-threading if your compiler\n-supports OpenMP. For some reason automake's OpenMP detection for\n-Apple's gcc is broken. However, you can use gcc installed via MacPorts\n-by adding\n-\n-CC=/opt/local/bin/gcc-mp-4.5\n-\n-to the configure call (you will to change the exact string to match\n-your gcc version)\n-\n-\n-See below for generic installation instructions:\n-\n-----------------------------------------------------------------------\n-\n-\n-\n-Installation Instructions\n-*************************\n-\n-Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,\n-2006, 2007, 2008, 2009 Free Software Foundation, Inc.\n-\n- Copying and distribution of this file, with or without modification,\n-are permitted in any medium without royalty provided the copyright\n-notice and this notice are preserved. This file is offered as-is,\n-without warranty of any kind.\n-\n-Basic Installation\n-==================\n-\n- Briefly, the shell commands `./configure; make; make install' should\n-configure, build, and install this package. The following\n-more-detailed instructions are generic; see the `README' file for\n-instructions specific to this package. Some packages provide this\n-`INSTALL' file but do not implement all of the features documented\n-below. The lack of an optional feature in a given package is not\n-necessarily a bug. More recommendations for GNU packages can be found\n-in *note Makefile Conventions: (standards)Makefile Conventions.\n-\n- The `configure' shell script attempts to guess correct values for\n-various system-dependent variables used during compilation. It uses\n-those values to create a `Makefile' in each directory of the package.\n-It may also create one or more `.h' files containing system-dependent\n-definitions. Finally, it creates a shell script `config.status' that\n-you can run in the future to recreate the current configuration, and a\n-file `config.log' containing compiler output (useful mainly for\n-debugging `configure').\n-\n- It can also use an optional file (typically called `config.cache'\n-and enabled with `--cache-file=config.cache' or simply `-C') that saves\n-the results of its tests to speed up reconfiguring. Caching is\n-disabled by default to prevent problems with accidental use of stale\n-cache files.\n-\n- If you need to do unusual things to compile the package, please try\n-to figure out how `configure' could check whether to do them, and mail\n-diffs or instructions to the address given in the `README' so they can\n-be considered for the next release. If you are using the cache, and at\n-some point `config.cache' contains results you don't want to keep, you\n-may remove or edit it.\n-\n- The file `configure.ac' (or `configure.in') is used to create\n-`configure' by a program called `autoconf'. You need `configure.ac' if\n-you want to change it or regenerate `configure' using a newer version\n-of `autoconf'.\n-\n- The simplest way to compile this package is:\n-\n- 1. `cd' to the directory containing the package's source code and type\n- `./configure' to configure the package for your system.\n-\n- Running `configure' might take a while. While running, it prints\n- some messages telling which features it is checking for.\n-\n- 2. Type `make' to compile the package.\n-\n- 3. Optionally, type `make check' to run any self-tests that come with\n- the package, generally using the just-built uninstalled binaries.\n-\n- 4. Type `make install' to install the programs and any data files and\n- documentation. W"..b'ermine by the type of machine the package\n-will run on. Usually, assuming the package is built to be run on the\n-_same_ architectures, `configure\' can figure that out, but if it prints\n-a message saying it cannot guess the machine type, give it the\n-`--build=TYPE\' option. TYPE can either be a short name for the system\n-type, such as `sun4\', or a canonical name which has the form:\n-\n- CPU-COMPANY-SYSTEM\n-\n-where SYSTEM can have one of these forms:\n-\n- OS\n- KERNEL-OS\n-\n- See the file `config.sub\' for the possible values of each field. If\n-`config.sub\' isn\'t included in this package, then this package doesn\'t\n-need to know the machine type.\n-\n- If you are _building_ compiler tools for cross-compiling, you should\n-use the option `--target=TYPE\' to select the type of system they will\n-produce code for.\n-\n- If you want to _use_ a cross compiler, that generates code for a\n-platform different from the build platform, you should specify the\n-"host" platform (i.e., that on which the generated programs will\n-eventually be run) with `--host=TYPE\'.\n-\n-Sharing Defaults\n-================\n-\n- If you want to set default values for `configure\' scripts to share,\n-you can create a site shell script called `config.site\' that gives\n-default values for variables like `CC\', `cache_file\', and `prefix\'.\n-`configure\' looks for `PREFIX/share/config.site\' if it exists, then\n-`PREFIX/etc/config.site\' if it exists. Or, you can set the\n-`CONFIG_SITE\' environment variable to the location of the site script.\n-A warning: not all `configure\' scripts look for a site script.\n-\n-Defining Variables\n-==================\n-\n- Variables not defined in a site shell script can be set in the\n-environment passed to `configure\'. However, some packages may run\n-configure again during the build, and the customized values of these\n-variables may be lost. In order to avoid this problem, you should set\n-them in the `configure\' command line, using `VAR=value\'. For example:\n-\n- ./configure CC=/usr/local2/bin/gcc\n-\n-causes the specified `gcc\' to be used as the C compiler (unless it is\n-overridden in the site shell script).\n-\n-Unfortunately, this technique does not work for `CONFIG_SHELL\' due to\n-an Autoconf bug. Until the bug is fixed you can use this workaround:\n-\n- CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash\n-\n-`configure\' Invocation\n-======================\n-\n- `configure\' recognizes the following options to control how it\n-operates.\n-\n-`--help\'\n-`-h\'\n- Print a summary of all of the options to `configure\', and exit.\n-\n-`--help=short\'\n-`--help=recursive\'\n- Print a summary of the options unique to this package\'s\n- `configure\', and exit. The `short\' variant lists options used\n- only in the top level, while the `recursive\' variant lists options\n- also present in any nested packages.\n-\n-`--version\'\n-`-V\'\n- Print the version of Autoconf used to generate the `configure\'\n- script, and exit.\n-\n-`--cache-file=FILE\'\n- Enable the cache: use and save the results of the tests in FILE,\n- traditionally `config.cache\'. FILE defaults to `/dev/null\' to\n- disable caching.\n-\n-`--config-cache\'\n-`-C\'\n- Alias for `--cache-file=config.cache\'.\n-\n-`--quiet\'\n-`--silent\'\n-`-q\'\n- Do not print messages saying which checks are being made. To\n- suppress all normal output, redirect it to `/dev/null\' (any error\n- messages will still be shown).\n-\n-`--srcdir=DIR\'\n- Look for the package\'s source code in directory DIR. Usually\n- `configure\' can determine that directory automatically.\n-\n-`--prefix=DIR\'\n- Use DIR as the installation prefix. *note Installation Names::\n- for more details, including other options available for fine-tuning\n- the installation locations.\n-\n-`--no-create\'\n-`-n\'\n- Run the configure checks, but stop before creating any output\n- files.\n-\n-`configure\' also accepts some other, not widely useful, options. Run\n-`configure --help\' for more details.\n-\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/Makefile.am --- a/clustalomega/clustal-omega-0.2.0/Makefile.am Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,25 +0,0 @@ -# Some useful automake documentation: -# http://www.openismus.com/documents/linux/automake/automake.shtml -# http://www.bioinf.uni-freiburg.de/~mmann/HowTo/automake.html - -# we do not use GNU-style files: NEWS README AUTHORS ChangeLog -#AUTOMAKE_OPTIONS = foreign - -ACLOCAL_AMFLAGS=-I m4 -SUBDIRS = src -# SUBDIRS = src tests - -dist_doc_DATA = README - -EXTRA_DIST = Doxyfile - -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = clustalo.pc - - -bug-tests: all - cd bug-tests && $(SHELL) bug-tests.sh; - -#dist-hook: -# svnversion . > $(distdir)/src/svnversion.h 2>/dev/null - |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/Makefile.in --- a/clustalomega/clustal-omega-0.2.0/Makefile.in Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,804 +0,0 @@\n-# Makefile.in generated by automake 1.11.1 from Makefile.am.\n-# @configure_input@\n-\n-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,\n-# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,\n-# Inc.\n-# This Makefile.in is free software; the Free Software Foundation\n-# gives unlimited permission to copy and/or distribute it,\n-# with or without modifications, as long as this notice is preserved.\n-\n-# This program is distributed in the hope that it will be useful,\n-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without\n-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A\n-# PARTICULAR PURPOSE.\n-\n-@SET_MAKE@\n-\n-# Some useful automake documentation:\n-# http://www.openismus.com/documents/linux/automake/automake.shtml\n-# http://www.bioinf.uni-freiburg.de/~mmann/HowTo/automake.html\n-\n-# we do not use GNU-style files: NEWS README AUTHORS ChangeLog\n-#AUTOMAKE_OPTIONS = foreign\n-\n-VPATH = @srcdir@\n-pkgdatadir = $(datadir)/@PACKAGE@\n-pkgincludedir = $(includedir)/@PACKAGE@\n-pkglibdir = $(libdir)/@PACKAGE@\n-pkglibexecdir = $(libexecdir)/@PACKAGE@\n-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd\n-install_sh_DATA = $(install_sh) -c -m 644\n-install_sh_PROGRAM = $(install_sh) -c\n-install_sh_SCRIPT = $(install_sh) -c\n-INSTALL_HEADER = $(INSTALL_DATA)\n-transform = $(program_transform_name)\n-NORMAL_INSTALL = :\n-PRE_INSTALL = :\n-POST_INSTALL = :\n-NORMAL_UNINSTALL = :\n-PRE_UNINSTALL = :\n-POST_UNINSTALL = :\n-build_triplet = @build@\n-host_triplet = @host@\n-subdir = .\n-DIST_COMMON = README $(am__configure_deps) $(dist_doc_DATA) \\\n-\t$(srcdir)/Doxyfile.in $(srcdir)/Makefile.am \\\n-\t$(srcdir)/Makefile.in $(srcdir)/clustalo.pc.in \\\n-\t$(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \\\n-\tTODO config.guess config.sub depcomp install-sh ltmain.sh \\\n-\tmissing\n-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4\n-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_prefix_config_h.m4 \\\n-\t$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \\\n-\t$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \\\n-\t$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/ax_openmp.m4 \\\n-\t$(top_srcdir)/configure.ac\n-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \\\n-\t$(ACLOCAL_M4)\n-am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \\\n- configure.lineno config.status.lineno\n-mkinstalldirs = $(install_sh) -d\n-CONFIG_HEADER = $(top_builddir)/src/config.h\n-CONFIG_CLEAN_FILES = clustalo.pc Doxyfile\n-CONFIG_CLEAN_VPATH_FILES =\n-SOURCES =\n-DIST_SOURCES =\n-RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \\\n-\thtml-recursive info-recursive install-data-recursive \\\n-\tinstall-dvi-recursive install-exec-recursive \\\n-\tinstall-html-recursive install-info-recursive \\\n-\tinstall-pdf-recursive install-ps-recursive install-recursive \\\n-\tinstallcheck-recursive installdirs-recursive pdf-recursive \\\n-\tps-recursive uninstall-recursive\n-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed \'s|.|.|g\'`;\n-am__vpath_adj = case $$p in \\\n- $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \\\n- *) f=$$p;; \\\n- esac;\n-am__strip_dir = f=`echo $$p | sed -e \'s|^.*/||\'`;\n-am__install_max = 40\n-am__nobase_strip_setup = \\\n- srcdirstrip=`echo "$(srcdir)" | sed \'s/[].[^$$\\\\*|]/\\\\\\\\&/g\'`\n-am__nobase_strip = \\\n- for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"\n-am__nobase_list = $(am__nobase_strip_setup); \\\n- for p in $$list; do echo "$$p $$p"; done | \\\n- sed "s| $$srcdirstrip/| |;"\' / .*\\//!s/ .*/ ./; s,\\( .*\\)/[^/]*$$,\\1,\' | \\\n- $(AWK) \'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \\\n- if (++n[$$2] == $(am__install_max)) \\\n- { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \\\n- END { for (dir in files) print dir, files[dir] }\'\n-am__base_list = \\\n- sed \'$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\\n/ /g\' | \\\n- sed \'$$!N;$$!N;$$!N;$$!N;s/\\n/ /g\'\n-am__installdirs = "$(DESTDIR)$(docdir)" "$(DESTDIR)$(pkgconfigdir)"\n-DATA = '..b' distcleancheck can only run from a VPATH build" ; \\\n-\t exit 1 ; \\\n-\tfi\n-\t@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \\\n-\t || { echo "ERROR: files left in build directory after distclean:" ; \\\n-\t $(distcleancheck_listfiles) ; \\\n-\t exit 1; } >&2\n-check-am: all-am\n-check: check-recursive\n-all-am: Makefile $(DATA)\n-installdirs: installdirs-recursive\n-installdirs-am:\n-\tfor dir in "$(DESTDIR)$(docdir)" "$(DESTDIR)$(pkgconfigdir)"; do \\\n-\t test -z "$$dir" || $(MKDIR_P) "$$dir"; \\\n-\tdone\n-install: install-recursive\n-install-exec: install-exec-recursive\n-install-data: install-data-recursive\n-uninstall: uninstall-recursive\n-\n-install-am: all-am\n-\t@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am\n-\n-installcheck: installcheck-recursive\n-install-strip:\n-\t$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \\\n-\t install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \\\n-\t `test -z \'$(STRIP)\' || \\\n-\t echo "INSTALL_PROGRAM_ENV=STRIPPROG=\'$(STRIP)\'"` install\n-mostlyclean-generic:\n-\n-clean-generic:\n-\n-distclean-generic:\n-\t-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)\n-\t-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)\n-\n-maintainer-clean-generic:\n-\t@echo "This command is intended for maintainers to use"\n-\t@echo "it deletes files that may require special tools to rebuild."\n-clean: clean-recursive\n-\n-clean-am: clean-generic clean-libtool mostlyclean-am\n-\n-distclean: distclean-recursive\n-\t-rm -f $(am__CONFIG_DISTCLEAN_FILES)\n-\t-rm -f Makefile\n-distclean-am: clean-am distclean-generic distclean-libtool \\\n-\tdistclean-tags\n-\n-dvi: dvi-recursive\n-\n-dvi-am:\n-\n-html: html-recursive\n-\n-html-am:\n-\n-info: info-recursive\n-\n-info-am:\n-\n-install-data-am: install-dist_docDATA install-pkgconfigDATA\n-\n-install-dvi: install-dvi-recursive\n-\n-install-dvi-am:\n-\n-install-exec-am:\n-\n-install-html: install-html-recursive\n-\n-install-html-am:\n-\n-install-info: install-info-recursive\n-\n-install-info-am:\n-\n-install-man:\n-\n-install-pdf: install-pdf-recursive\n-\n-install-pdf-am:\n-\n-install-ps: install-ps-recursive\n-\n-install-ps-am:\n-\n-installcheck-am:\n-\n-maintainer-clean: maintainer-clean-recursive\n-\t-rm -f $(am__CONFIG_DISTCLEAN_FILES)\n-\t-rm -rf $(top_srcdir)/autom4te.cache\n-\t-rm -f Makefile\n-maintainer-clean-am: distclean-am maintainer-clean-generic\n-\n-mostlyclean: mostlyclean-recursive\n-\n-mostlyclean-am: mostlyclean-generic mostlyclean-libtool\n-\n-pdf: pdf-recursive\n-\n-pdf-am:\n-\n-ps: ps-recursive\n-\n-ps-am:\n-\n-uninstall-am: uninstall-dist_docDATA uninstall-pkgconfigDATA\n-\n-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \\\n-\tinstall-am install-strip tags-recursive\n-\n-.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \\\n-\tall all-am am--refresh check check-am clean clean-generic \\\n-\tclean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \\\n-\tdist-gzip dist-lzma dist-shar dist-tarZ dist-xz dist-zip \\\n-\tdistcheck distclean distclean-generic distclean-libtool \\\n-\tdistclean-tags distcleancheck distdir distuninstallcheck dvi \\\n-\tdvi-am html html-am info info-am install install-am \\\n-\tinstall-data install-data-am install-dist_docDATA install-dvi \\\n-\tinstall-dvi-am install-exec install-exec-am install-html \\\n-\tinstall-html-am install-info install-info-am install-man \\\n-\tinstall-pdf install-pdf-am install-pkgconfigDATA install-ps \\\n-\tinstall-ps-am install-strip installcheck installcheck-am \\\n-\tinstalldirs installdirs-am maintainer-clean \\\n-\tmaintainer-clean-generic mostlyclean mostlyclean-generic \\\n-\tmostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \\\n-\tuninstall uninstall-am uninstall-dist_docDATA \\\n-\tuninstall-pkgconfigDATA\n-\n-\n-bug-tests: all\n-\tcd bug-tests && $(SHELL) bug-tests.sh;\n-\n-#dist-hook:\n-#\tsvnversion . > $(distdir)/src/svnversion.h 2>/dev/null\n-\n-# Tell versions [3.59,3.63) of GNU make to not export all variables.\n-# Otherwise a system limit (for SysV at least) may be exceeded.\n-.NOEXPORT:\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/README --- a/clustalomega/clustal-omega-0.2.0/README Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,594 +0,0 @@\n-\r\n-\r\n-CLUSTAL-OMEGA is a general purpose multiple sequence alignment program\r\n-for proteins.\r\n-\r\n-\r\n-\r\n-INTRODUCTION\r\n-\r\n-Clustal-Omega is a general purpose multiple sequence alignment (MSA)\r\n-program for proteins. It produces high quality MSAs and is capable of\r\n-handling data-sets of hundreds of thousands of sequences in reasonable\r\n-time.\r\n-\r\n-In default mode, users give a file of sequences to be aligned and\r\n-these are clustered to produce a guide tree and this is used to guide\r\n-a "progressive alignment" of the sequences. There are also facilities\r\n-for aligning existing alignments to each other, aligning a sequence to\r\n-an alignment and for using a hidden Markov model (HMM) to help guide\r\n-an alignment of new sequences that are homologous to the sequences\r\n-used to make the HMM. This latter procedure is referred to as\r\n-"external profile alignment" or EPA.\r\n-\r\n-Clustal-Omega uses HMMs for the alignment engine, based on the HHalign\r\n-package from Johannes Soeding [1]. Guide trees are optionally made\r\n-using mBed [2] which can cluster very large numbers of sequences in\r\n-O(N*log(N)) time. Multiple alignment then proceeds by aligning larger\r\n-and larger alignments using HHalign, following the clustering given by\r\n-the guide tree.\r\n-\r\n-In its current form Clustal-Omega can only align protein sequences but\r\n-not DNA/RNA sequences. It is envisioned that DNA/RNA will become\r\n-available in a future version.\r\n-\r\n-\r\n-\r\n-SEQUENCE INPUT:\r\n-\r\n--i, --in, --infile={<file>,-} \r\n-\tMultiple sequence input file (- for stdin)\r\n-\r\n---hmm-in=<file> \r\n-\tHMM input files\r\n-\r\n---dealign \r\n-\tDealign input sequences\r\n-\r\n---profile1, --p1=<file> \r\n-\tPre-aligned multiple sequence file (aligned columns will be kept fixed)\r\n-\r\n---profile2, --p2=<file> \r\n-\tPre-aligned multiple sequence file (aligned columns will be kept fixed)\r\n-\r\n-\r\n-For sequence and profile input Clustal-Omega uses the Squid library\r\n-from Sean Eddy [3].\r\n-\r\n-\r\n-Clustal-Omega accepts 3 types of sequence input: (i) a sequence file\r\n-with un-aligned or aligned sequences, (ii) profiles (a multiple\r\n-alignment in a file) of aligned sequences, (iii) a HMM. Valid\r\n-combinations of the above are:\r\n-\r\n-(a) one file with un-aligned or aligned sequences (i); the sequences\r\n- will be aligned, and the alignment will be written out. For this\r\n- mode use the -i flag. If the sequences are aligned (all sequences\r\n- have the same length and at least one sequence has at least one\r\n- gap), then the alignment is turned into a HMM, the sequences are\r\n- de-aligned and the now un-aligned sequences are aligned using the\r\n- HMM as an External Profile for External Profile Alignment (EPA).\r\n- If no EPA is desired use the --dealign flag.\r\n-\r\n- Use the above option to make a multiple alignment from a set of\r\n- sequences. A sequence file must contain more than one sequence (at\r\n- least two sequences).\r\n-\r\n-(b) two profiles (ii)+(ii); the columns in each profile will be kept\r\n- fixed and the alignment of the two profiles will be written\r\n- out. Use the --p1 and --p2 flags for this mode.\r\n-\r\n- Use this option to align two alignments (profiles) together.\r\n-\r\n-(c) one file with un/aligned sequences (i) and one profile (ii); the\r\n- profile is converted into a HMM and the un-aligned sequences will\r\n- be multiply aligned (using the HMM background information) to form\r\n- a profile; this constructed profile is aligned with the input\r\n- profile; the columns in each profile (the original one and the one\r\n- created from the un-aligned sequences) will be kept fixed and the\r\n- alignment of the two profiles will be written out. Use the -i flag\r\n- in conjunction with the --p1 flag for this mode. \r\n- The un/aligned sequences file (i) must contain at least two\r\n- sequences. If a single sequence has to be aligned with a profile\r\n- the profile-profile option (b) has to be used.\r\n-\r\n- Use the above option to '..b'and current progress of the MSA stage.\r\n-If the file globin.a2m already exists Clustal-Omega aborts before\r\n-reading the file globin.fa. Note that in verbose mode an output file\r\n-has to be specified, because progress/debugging information, which is\r\n-printed to screen, would interfere with the alignment being printed to\r\n-screen.\r\n-\r\n-\r\n-./clustalo -i PF00042_full.fa --dealign --mbed --outfmt=vie -o PF00042_full.vie --force \r\n-\r\n-Clustal-Omega reads the file PF00042_full.fa. This file contains\r\n-several thousand aligned sequences. --dealign tells Clustal-Omega to\r\n-erase all alignment information and re-align the sequences from\r\n-scratch. As there are several thousand sequences calculating a full\r\n-distance matrix may be slow. It may therefore be desirable to use the\r\n---mbed option. Clustal-Omega now will calculate pairwise distances to\r\n-a small number of reference sequences only. This will give a\r\n-significant speed-up. The speed-up is greater for larger families\r\n-(more sequences). The alignment is then written out in Vienna format\r\n-(fasta format all on one line, no line breaks per sequence) to file\r\n-PF00042_full.vie.\r\n-\r\n-\r\n-./clustalo --p1=globin.sto --p2=PF00042_full.vie -o globin+pf00042.fa\r\n-\r\n-Clustal-Omega reads files globin.sto and PF00042_full.vie of aligned\r\n-sequences (profiles). Both profiles are then aligned. The relative\r\n-positions of residues in both profiles are not changed during this\r\n-alignment, however, columns of gaps may be inserted into the profiles,\r\n-respectively. The final alignment is written to file globin+pf00042.fa\r\n-in fasta format.\r\n-\r\n-\r\n-./clustalo -i globin.fa --p1=PF00042_full.vie -o pf00042+globin.fa\r\n-\r\n-Clustal-Omega reads file globin.fa of un-aligned sequences and the\r\n-profile (of aligned sequences) in file PF00042_full.vie. A HMM is\r\n-created from the profile. This HMM is used to guide the alignment of\r\n-the un-aligned sequences in globin.fa. The profile that was generated\r\n-during this alignment of un-aligned globin.fa sequences is then\r\n-aligned to the input profile PF00042_full.vie. The relative positions\r\n-of residues in profile PF00042_full.vie is not changed during this\r\n-alignment, however, columns of gaps may be inserted into the\r\n-profile. The final alignment is output to file pf00042+globin.fa in\r\n-fasta format. The alignment in this example may be slightly different\r\n-from the alignment in the previous example, because no HMM guidance\r\n-was used generate the profile globin.sto. In this example HMM guidance\r\n-was used to align the sequences in globin.fa; the hope being that this\r\n-intermediate alignment will have profited from the bigger profile.\r\n-\r\n-\r\n-\r\n-LITERATURE:\r\n-\r\n-[1] Johannes Soding (2005) Protein homology detection by HMM-HMM\r\n- comparison. Bioinformatics 21 (7): 951\xe2\x80\x93960.\r\n-\r\n-[2] Blackshields G, Sievers F, Shi W, Wilm A, Higgins DG. Sequence\r\n- embedding for fast construction of guide trees for multiple\r\n- sequence alignment. Algorithms Mol Biol. 2010 May 14;5:21.\r\n-\r\n-[3] http://www.genetics.wustl.edu/eddy/software/#squid\r\n-\r\n-[4] Wilbur and Lipman, 1983; PMID 6572363\r\n-\r\n-[5] Thompson JD, Higgins DG, Gibson TJ. (1994). CLUSTAL W: improving\r\n- the sensitivity of progressive multiple sequence alignment through\r\n- sequence weighting, position-specific gap penalties and weight\r\n- matrix choice. Nucleic Acids Res., 22, 4673-4680.\r\n-\r\n-[6] Larkin MA, Blackshields G, Brown NP, Chenna R, McGettigan PA,\r\n- McWilliam H, Valentin F, Wallace IM, Wilm A, Lopez R, Thompson JD,\r\n- Gibson TJ, Higgins DG. (2007). Clustal W and Clustal X version\r\n- 2.0. Bioinformatics, 23, 2947-2948.\r\n-\r\n-[7] Kimura M (1980). "A simple method for estimating evolutionary\r\n- rates of base substitutions through comparative studies of\r\n- nucleotide sequences". Journal of Molecular Evolution 16: 111\xe2\x80\x93120.\r\n-\r\n-[8] Edgar, R.C. (2004) MUSCLE: multiple sequence alignment with high\r\n- accuracy and high throughput.Nucleic Acids Res. 32(5):1792-1797.\r\n-\r\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/TODO --- a/clustalomega/clustal-omega-0.2.0/TODO Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,45 +0,0 @@ -IMPORTANT ---------- - -- consensus output (sto,aln) and compatibilety with bioperl/biopython - -- Split Homfam refs in two. Use one part as background HMM, the other parts - for benchmarking - -- Implement meta flags: - accurate: --iterations 3 - default: --mbed --iterations 1 - fast: --mbed - and for more than 10k sequences: --mbed --mbed-iter - -- SSE instructions for hhalign (little use in ClustalO frontend; DD) - / - Patch new code which already contains SSE instructions - - also fix automake/configure then - -- Multi-HMMs; also for Pfam+iteration (FS) - -- Show degradation of alignment quality when using x reference sequences - added to y random/false sequences - (Lio Pachter) - -- Seed pre-alignment with M-Coffee, MSAProbs, ... - -- GUI/API: - Will have to catch/override exits from source. - find . -name \*.c -or -name \*.cpp -or -name \*.h | xargs grep 'exit(' - Also best to allow for user override of - void Fatal(char *msg, ...); - void Error(char *msg, ...); - void Warn(char *msg, ...); - void Info(int level, char *msg, ...); - - -- Soeding: DNA/RNA alignment incl. reading of nucleotide HMMs - -- Automatic HMM-selection/search/download for input - -- Structure input: Psipred predictions are apparently part of their - hhms and should therefore be ready to use (part automatic - HMM-selection) |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/aclocal.m4 --- a/clustalomega/clustal-omega-0.2.0/aclocal.m4 Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b"@@ -1,997 +0,0 @@\n-# generated automatically by aclocal 1.11.1 -*- Autoconf -*-\n-\n-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,\n-# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.\n-# This file is free software; the Free Software Foundation\n-# gives unlimited permission to copy and/or distribute it,\n-# with or without modifications, as long as this notice is preserved.\n-\n-# This program is distributed in the hope that it will be useful,\n-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without\n-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A\n-# PARTICULAR PURPOSE.\n-\n-m4_ifndef([AC_AUTOCONF_VERSION],\n- [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl\n-m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.65],,\n-[m4_warning([this file was generated for autoconf 2.65.\n-You have another version of autoconf. It may work, but is not guaranteed to.\n-If you have problems, you may need to regenerate the build system entirely.\n-To do so, use the procedure documented by the package, typically `autoreconf'.])])\n-\n-# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.\n-#\n-# This file is free software; the Free Software Foundation\n-# gives unlimited permission to copy and/or distribute it,\n-# with or without modifications, as long as this notice is preserved.\n-\n-# AM_AUTOMAKE_VERSION(VERSION)\n-# ----------------------------\n-# Automake X.Y traces this macro to ensure aclocal.m4 has been\n-# generated from the m4 files accompanying Automake X.Y.\n-# (This private macro should not be called outside this file.)\n-AC_DEFUN([AM_AUTOMAKE_VERSION],\n-[am__api_version='1.11'\n-dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to\n-dnl require some minimum version. Point them to the right macro.\n-m4_if([$1], [1.11.1], [],\n- [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl\n-])\n-\n-# _AM_AUTOCONF_VERSION(VERSION)\n-# -----------------------------\n-# aclocal traces this macro to find the Autoconf version.\n-# This is a private macro too. Using m4_define simplifies\n-# the logic in aclocal, which can simply ignore this definition.\n-m4_define([_AM_AUTOCONF_VERSION], [])\n-\n-# AM_SET_CURRENT_AUTOMAKE_VERSION\n-# -------------------------------\n-# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.\n-# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.\n-AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],\n-[AM_AUTOMAKE_VERSION([1.11.1])dnl\n-m4_ifndef([AC_AUTOCONF_VERSION],\n- [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl\n-_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])\n-\n-# AM_AUX_DIR_EXPAND -*- Autoconf -*-\n-\n-# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.\n-#\n-# This file is free software; the Free Software Foundation\n-# gives unlimited permission to copy and/or distribute it,\n-# with or without modifications, as long as this notice is preserved.\n-\n-# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets\n-# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to\n-# `$srcdir', `$srcdir/..', or `$srcdir/../..'.\n-#\n-# Of course, Automake must honor this variable whenever it calls a\n-# tool from the auxiliary directory. The problem is that $srcdir (and\n-# therefore $ac_aux_dir as well) can be either absolute or relative,\n-# depending on how configure is run. This is pretty annoying, since\n-# it makes $ac_aux_dir quite unusable in subdirectories: in the top\n-# source directory, any form will work fine, but in subdirectories a\n-# relative path needs to be adjusted first.\n-#\n-# $ac_aux_dir/missing\n-# fails when called from a subdirectory if $ac_aux_dir is relative\n-# $top_srcdir/$ac_aux_dir/missing\n-# fails if $ac_aux_dir is absolute,\n-# fails when called from a subdirectory in a VPATH build with\n-# a relative $ac_aux_dir\n-#\n-# The reason of the latter failure is that $top_srcdir and $ac_aux_dir\n-# are both prefixed by $srcdir. In "..b' Free Software Foundation, Inc.\n-#\n-# This file is free software; the Free Software Foundation\n-# gives unlimited permission to copy and/or distribute it,\n-# with or without modifications, as long as this notice is preserved.\n-\n-# serial 2\n-\n-# _AM_SUBST_NOTMAKE(VARIABLE)\n-# ---------------------------\n-# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.\n-# This macro is traced by Automake.\n-AC_DEFUN([_AM_SUBST_NOTMAKE])\n-\n-# AM_SUBST_NOTMAKE(VARIABLE)\n-# ---------------------------\n-# Public sister of _AM_SUBST_NOTMAKE.\n-AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])\n-\n-# Check how to create a tarball. -*- Autoconf -*-\n-\n-# Copyright (C) 2004, 2005 Free Software Foundation, Inc.\n-#\n-# This file is free software; the Free Software Foundation\n-# gives unlimited permission to copy and/or distribute it,\n-# with or without modifications, as long as this notice is preserved.\n-\n-# serial 2\n-\n-# _AM_PROG_TAR(FORMAT)\n-# --------------------\n-# Check how to create a tarball in format FORMAT.\n-# FORMAT should be one of `v7\', `ustar\', or `pax\'.\n-#\n-# Substitute a variable $(am__tar) that is a command\n-# writing to stdout a FORMAT-tarball containing the directory\n-# $tardir.\n-# tardir=directory && $(am__tar) > result.tar\n-#\n-# Substitute a variable $(am__untar) that extract such\n-# a tarball read from stdin.\n-# $(am__untar) < result.tar\n-AC_DEFUN([_AM_PROG_TAR],\n-[# Always define AMTAR for backward compatibility.\n-AM_MISSING_PROG([AMTAR], [tar])\n-m4_if([$1], [v7],\n- [am__tar=\'${AMTAR} chof - "$$tardir"\'; am__untar=\'${AMTAR} xf -\'],\n- [m4_case([$1], [ustar],, [pax],,\n- [m4_fatal([Unknown tar format])])\n-AC_MSG_CHECKING([how to create a $1 tar archive])\n-# Loop over all known methods to create a tar archive until one works.\n-_am_tools=\'gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none\'\n-_am_tools=${am_cv_prog_tar_$1-$_am_tools}\n-# Do not fold the above two line into one, because Tru64 sh and\n-# Solaris sh will not grok spaces in the rhs of `-\'.\n-for _am_tool in $_am_tools\n-do\n- case $_am_tool in\n- gnutar)\n- for _am_tar in tar gnutar gtar;\n- do\n- AM_RUN_LOG([$_am_tar --version]) && break\n- done\n- am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "\'"$$tardir"\'\n- am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "\'"$tardir"\'\n- am__untar="$_am_tar -xf -"\n- ;;\n- plaintar)\n- # Must skip GNU tar: if it does not support --format= it doesn\'t create\n- # ustar tarball either.\n- (tar --version) >/dev/null 2>&1 && continue\n- am__tar=\'tar chf - "$$tardir"\'\n- am__tar_=\'tar chf - "$tardir"\'\n- am__untar=\'tar xf -\'\n- ;;\n- pax)\n- am__tar=\'pax -L -x $1 -w "$$tardir"\'\n- am__tar_=\'pax -L -x $1 -w "$tardir"\'\n- am__untar=\'pax -r\'\n- ;;\n- cpio)\n- am__tar=\'find "$$tardir" -print | cpio -o -H $1 -L\'\n- am__tar_=\'find "$tardir" -print | cpio -o -H $1 -L\'\n- am__untar=\'cpio -i -H $1 -d\'\n- ;;\n- none)\n- am__tar=false\n- am__tar_=false\n- am__untar=false\n- ;;\n- esac\n-\n- # If the value was cached, stop now. We just wanted to have am__tar\n- # and am__untar set.\n- test -n "${am_cv_prog_tar_$1}" && break\n-\n- # tar/untar a dummy directory, and stop if the command works\n- rm -rf conftest.dir\n- mkdir conftest.dir\n- echo GrepMe > conftest.dir/file\n- AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])\n- rm -rf conftest.dir\n- if test -s conftest.tar; then\n- AM_RUN_LOG([$am__untar <conftest.tar])\n- grep GrepMe conftest.dir/file >/dev/null 2>&1 && break\n- fi\n-done\n-rm -rf conftest.dir\n-\n-AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])\n-AC_MSG_RESULT([$am_cv_prog_tar_$1])])\n-AC_SUBST([am__tar])\n-AC_SUBST([am__untar])\n-]) # _AM_PROG_TAR\n-\n-m4_include([m4/ax_prefix_config_h.m4])\n-m4_include([m4/libtool.m4])\n-m4_include([m4/ltoptions.m4])\n-m4_include([m4/ltsugar.m4])\n-m4_include([m4/ltversion.m4])\n-m4_include([m4/lt~obsolete.m4])\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/clustalo.pc.in --- a/clustalomega/clustal-omega-0.2.0/clustalo.pc.in Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,12 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: clustal-omega -Description: @PACKAGE_NAME@ library. -Version: @PACKAGE_VERSION@ -Requires: -Libs: -L${libdir} -lclustalo -Cflags: -I${includedir}/clustalo/ - |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/config.guess --- a/clustalomega/clustal-omega-0.2.0/config.guess Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,1533 +0,0 @@\n-#! /bin/sh\n-# Attempt to guess a canonical system name.\n-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,\n-# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009\n-# Free Software Foundation, Inc.\n-\n-timestamp=\'2009-06-10\'\n-\n-# This file is free software; you can redistribute it and/or modify it\n-# under the terms of the GNU General Public License as published by\n-# the Free Software Foundation; either version 2 of the License, or\n-# (at your option) any later version.\n-#\n-# This program is distributed in the hope that it will be useful, but\n-# WITHOUT ANY WARRANTY; without even the implied warranty of\n-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n-# General Public License for more details.\n-#\n-# You should have received a copy of the GNU General Public License\n-# along with this program; if not, write to the Free Software\n-# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA\n-# 02110-1301, USA.\n-#\n-# As a special exception to the GNU General Public License, if you\n-# distribute this file as part of a program that contains a\n-# configuration script generated by Autoconf, you may include it under\n-# the same distribution terms that you use for the rest of that program.\n-\n-\n-# Originally written by Per Bothner <per@bothner.com>.\n-# Please send patches to <config-patches@gnu.org>. Submit a context\n-# diff and a properly formatted ChangeLog entry.\n-#\n-# This script attempts to guess a canonical system name similar to\n-# config.sub. If it succeeds, it prints the system name on stdout, and\n-# exits with 0. Otherwise, it exits with 1.\n-#\n-# The plan is that this can be called by configure scripts if you\n-# don\'t specify an explicit build system type.\n-\n-me=`echo "$0" | sed -e \'s,.*/,,\'`\n-\n-usage="\\\n-Usage: $0 [OPTION]\n-\n-Output the configuration name of the system \\`$me\' is run on.\n-\n-Operation modes:\n- -h, --help print this help, then exit\n- -t, --time-stamp print date of last modification, then exit\n- -v, --version print version number, then exit\n-\n-Report bugs and patches to <config-patches@gnu.org>."\n-\n-version="\\\n-GNU config.guess ($timestamp)\n-\n-Originally written by Per Bothner.\n-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,\n-2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.\n-\n-This is free software; see the source for copying conditions. There is NO\n-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."\n-\n-help="\n-Try \\`$me --help\' for more information."\n-\n-# Parse command line\n-while test $# -gt 0 ; do\n- case $1 in\n- --time-stamp | --time* | -t )\n- echo "$timestamp" ; exit ;;\n- --version | -v )\n- echo "$version" ; exit ;;\n- --help | --h* | -h )\n- echo "$usage"; exit ;;\n- -- ) # Stop option processing\n- shift; break ;;\n- - )\t# Use stdin as input.\n- break ;;\n- -* )\n- echo "$me: invalid option $1$help" >&2\n- exit 1 ;;\n- * )\n- break ;;\n- esac\n-done\n-\n-if test $# != 0; then\n- echo "$me: too many arguments$help" >&2\n- exit 1\n-fi\n-\n-trap \'exit 1\' 1 2 15\n-\n-# CC_FOR_BUILD -- compiler used by this script. Note that the use of a\n-# compiler to aid in system detection is discouraged as it requires\n-# temporary files to be created and, as you can see below, it is a\n-# headache to deal with in a portable fashion.\n-\n-# Historically, `CC_FOR_BUILD\' used to be named `HOST_CC\'. We still\n-# use `HOST_CC\' if defined, but it is deprecated.\n-\n-# Portable tmp directory creation inspired by the Autoconf team.\n-\n-set_cc_for_build=\'\n-trap "exitcode=\\$?; (rm -f \\$tmpfiles 2>/dev/null; rmdir \\$tmp 2>/dev/null) && exit \\$exitcode" 0 ;\n-trap "rm -f \\$tmpfiles 2>/dev/null; rmdir \\$tmp 2>/dev/null; exit 1" 1 2 13 15 ;\n-: ${TMPDIR=/tmp} ;\n- { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||\n- { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 07'..b'\'s/.*NeXT Mach \\([0-9]*\\).*/\\1/p\') 2>/dev/null`;\n- if (version < 4)\n- printf ("%s-next-nextstep%d\\n", __ARCHITECTURE__, version);\n- else\n- printf ("%s-next-openstep%d\\n", __ARCHITECTURE__, version);\n- exit (0);\n-#endif\n-\n-#if defined (MULTIMAX) || defined (n16)\n-#if defined (UMAXV)\n- printf ("ns32k-encore-sysv\\n"); exit (0);\n-#else\n-#if defined (CMU)\n- printf ("ns32k-encore-mach\\n"); exit (0);\n-#else\n- printf ("ns32k-encore-bsd\\n"); exit (0);\n-#endif\n-#endif\n-#endif\n-\n-#if defined (__386BSD__)\n- printf ("i386-pc-bsd\\n"); exit (0);\n-#endif\n-\n-#if defined (sequent)\n-#if defined (i386)\n- printf ("i386-sequent-dynix\\n"); exit (0);\n-#endif\n-#if defined (ns32000)\n- printf ("ns32k-sequent-dynix\\n"); exit (0);\n-#endif\n-#endif\n-\n-#if defined (_SEQUENT_)\n- struct utsname un;\n-\n- uname(&un);\n-\n- if (strncmp(un.version, "V2", 2) == 0) {\n-\tprintf ("i386-sequent-ptx2\\n"); exit (0);\n- }\n- if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */\n-\tprintf ("i386-sequent-ptx1\\n"); exit (0);\n- }\n- printf ("i386-sequent-ptx\\n"); exit (0);\n-\n-#endif\n-\n-#if defined (vax)\n-# if !defined (ultrix)\n-# include <sys/param.h>\n-# if defined (BSD)\n-# if BSD == 43\n- printf ("vax-dec-bsd4.3\\n"); exit (0);\n-# else\n-# if BSD == 199006\n- printf ("vax-dec-bsd4.3reno\\n"); exit (0);\n-# else\n- printf ("vax-dec-bsd\\n"); exit (0);\n-# endif\n-# endif\n-# else\n- printf ("vax-dec-bsd\\n"); exit (0);\n-# endif\n-# else\n- printf ("vax-dec-ultrix\\n"); exit (0);\n-# endif\n-#endif\n-\n-#if defined (alliant) && defined (i860)\n- printf ("i860-alliant-bsd\\n"); exit (0);\n-#endif\n-\n- exit (1);\n-}\n-EOF\n-\n-$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&\n-\t{ echo "$SYSTEM_NAME"; exit; }\n-\n-# Apollos put the system type in the environment.\n-\n-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }\n-\n-# Convex versions that predate uname can use getsysinfo(1)\n-\n-if [ -x /usr/convex/getsysinfo ]\n-then\n- case `getsysinfo -f cpu_type` in\n- c1*)\n-\techo c1-convex-bsd\n-\texit ;;\n- c2*)\n-\tif getsysinfo -f scalar_acc\n-\tthen echo c32-convex-bsd\n-\telse echo c2-convex-bsd\n-\tfi\n-\texit ;;\n- c34*)\n-\techo c34-convex-bsd\n-\texit ;;\n- c38*)\n-\techo c38-convex-bsd\n-\texit ;;\n- c4*)\n-\techo c4-convex-bsd\n-\texit ;;\n- esac\n-fi\n-\n-cat >&2 <<EOF\n-$0: unable to guess system type\n-\n-This script, last modified $timestamp, has failed to recognize\n-the operating system you are using. It is advised that you\n-download the most up to date version of the config scripts from\n-\n- http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD\n-and\n- http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD\n-\n-If the version you run ($0) is already up to date, please\n-send the following data and any information you think might be\n-pertinent to <config-patches@gnu.org> in order to provide the needed\n-information to handle your system.\n-\n-config.guess timestamp = $timestamp\n-\n-uname -m = `(uname -m) 2>/dev/null || echo unknown`\n-uname -r = `(uname -r) 2>/dev/null || echo unknown`\n-uname -s = `(uname -s) 2>/dev/null || echo unknown`\n-uname -v = `(uname -v) 2>/dev/null || echo unknown`\n-\n-/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`\n-/bin/uname -X = `(/bin/uname -X) 2>/dev/null`\n-\n-hostinfo = `(hostinfo) 2>/dev/null`\n-/bin/universe = `(/bin/universe) 2>/dev/null`\n-/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`\n-/bin/arch = `(/bin/arch) 2>/dev/null`\n-/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`\n-/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`\n-\n-UNAME_MACHINE = ${UNAME_MACHINE}\n-UNAME_RELEASE = ${UNAME_RELEASE}\n-UNAME_SYSTEM = ${UNAME_SYSTEM}\n-UNAME_VERSION = ${UNAME_VERSION}\n-EOF\n-\n-exit 1\n-\n-# Local variables:\n-# eval: (add-hook \'write-file-hooks \'time-stamp)\n-# time-stamp-start: "timestamp=\'"\n-# time-stamp-format: "%:y-%02m-%02d"\n-# time-stamp-end: "\'"\n-# End:\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/config.sub --- a/clustalomega/clustal-omega-0.2.0/config.sub Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,1693 +0,0 @@\n-#! /bin/sh\n-# Configuration validation subroutine script.\n-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,\n-# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009\n-# Free Software Foundation, Inc.\n-\n-timestamp=\'2009-06-11\'\n-\n-# This file is (in principle) common to ALL GNU software.\n-# The presence of a machine in this file suggests that SOME GNU software\n-# can handle that machine. It does not imply ALL GNU software can.\n-#\n-# This file is free software; you can redistribute it and/or modify\n-# it under the terms of the GNU General Public License as published by\n-# the Free Software Foundation; either version 2 of the License, or\n-# (at your option) any later version.\n-#\n-# This program is distributed in the hope that it will be useful,\n-# but WITHOUT ANY WARRANTY; without even the implied warranty of\n-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n-# GNU General Public License for more details.\n-#\n-# You should have received a copy of the GNU General Public License\n-# along with this program; if not, write to the Free Software\n-# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA\n-# 02110-1301, USA.\n-#\n-# As a special exception to the GNU General Public License, if you\n-# distribute this file as part of a program that contains a\n-# configuration script generated by Autoconf, you may include it under\n-# the same distribution terms that you use for the rest of that program.\n-\n-\n-# Please send patches to <config-patches@gnu.org>. Submit a context\n-# diff and a properly formatted ChangeLog entry.\n-#\n-# Configuration subroutine to validate and canonicalize a configuration type.\n-# Supply the specified configuration type as an argument.\n-# If it is invalid, we print an error message on stderr and exit with code 1.\n-# Otherwise, we print the canonical config type on stdout and succeed.\n-\n-# This file is supposed to be the same for all GNU packages\n-# and recognize all the CPU types, system types and aliases\n-# that are meaningful with *any* GNU software.\n-# Each package is responsible for reporting which valid configurations\n-# it does not support. The user should be able to distinguish\n-# a failure to support a valid configuration from a meaningless\n-# configuration.\n-\n-# The goal of this file is to map all the various variations of a given\n-# machine specification into a single specification in the form:\n-#\tCPU_TYPE-MANUFACTURER-OPERATING_SYSTEM\n-# or in some cases, the newer four-part form:\n-#\tCPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM\n-# It is wrong to echo any other type of specification.\n-\n-me=`echo "$0" | sed -e \'s,.*/,,\'`\n-\n-usage="\\\n-Usage: $0 [OPTION] CPU-MFR-OPSYS\n- $0 [OPTION] ALIAS\n-\n-Canonicalize a configuration name.\n-\n-Operation modes:\n- -h, --help print this help, then exit\n- -t, --time-stamp print date of last modification, then exit\n- -v, --version print version number, then exit\n-\n-Report bugs and patches to <config-patches@gnu.org>."\n-\n-version="\\\n-GNU config.sub ($timestamp)\n-\n-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,\n-2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.\n-\n-This is free software; see the source for copying conditions. There is NO\n-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."\n-\n-help="\n-Try \\`$me --help\' for more information."\n-\n-# Parse command line\n-while test $# -gt 0 ; do\n- case $1 in\n- --time-stamp | --time* | -t )\n- echo "$timestamp" ; exit ;;\n- --version | -v )\n- echo "$version" ; exit ;;\n- --help | --h* | -h )\n- echo "$usage"; exit ;;\n- -- ) # Stop option processing\n- shift; break ;;\n- - )\t# Use stdin as input.\n- break ;;\n- -* )\n- echo "$me: invalid option $1$help"\n- exit 1 ;;\n-\n- *local*)\n- # First pass through any local machine types.\n- echo $1\n- exit ;;\n-\n- * )\n- break ;;\n- esac\n-done\n-\n-case $# in\n-'..b'of $os.\n-\t\tos=`echo $os | sed \'s/[^-]*-//\'`\n-\t\techo Invalid configuration \\`$1\\\': system \\`$os\\\' not recognized 1>&2\n-\t\texit 1\n-\t\t;;\n-esac\n-else\n-\n-# Here we handle the default operating systems that come with various machines.\n-# The value should be what the vendor currently ships out the door with their\n-# machine or put another way, the most popular os provided with the machine.\n-\n-# Note that if you\'re going to try to match "-MANUFACTURER" here (say,\n-# "-sun"), then you have to tell the case statement up towards the top\n-# that MANUFACTURER isn\'t an operating system. Otherwise, code above\n-# will signal an error saying that MANUFACTURER isn\'t an operating\n-# system, and we\'ll never get to this point.\n-\n-case $basic_machine in\n- score-*)\n-\t\tos=-elf\n-\t\t;;\n- spu-*)\n-\t\tos=-elf\n-\t\t;;\n-\t*-acorn)\n-\t\tos=-riscix1.2\n-\t\t;;\n-\tarm*-rebel)\n-\t\tos=-linux\n-\t\t;;\n-\tarm*-semi)\n-\t\tos=-aout\n-\t\t;;\n- c4x-* | tic4x-*)\n- \tos=-coff\n-\t\t;;\n-\t# This must come before the *-dec entry.\n-\tpdp10-*)\n-\t\tos=-tops20\n-\t\t;;\n-\tpdp11-*)\n-\t\tos=-none\n-\t\t;;\n-\t*-dec | vax-*)\n-\t\tos=-ultrix4.2\n-\t\t;;\n-\tm68*-apollo)\n-\t\tos=-domain\n-\t\t;;\n-\ti386-sun)\n-\t\tos=-sunos4.0.2\n-\t\t;;\n-\tm68000-sun)\n-\t\tos=-sunos3\n-\t\t# This also exists in the configure program, but was not the\n-\t\t# default.\n-\t\t# os=-sunos4\n-\t\t;;\n-\tm68*-cisco)\n-\t\tos=-aout\n-\t\t;;\n- mep-*)\n-\t\tos=-elf\n-\t\t;;\n-\tmips*-cisco)\n-\t\tos=-elf\n-\t\t;;\n-\tmips*-*)\n-\t\tos=-elf\n-\t\t;;\n-\tor32-*)\n-\t\tos=-coff\n-\t\t;;\n-\t*-tti)\t# must be before sparc entry or we get the wrong os.\n-\t\tos=-sysv3\n-\t\t;;\n-\tsparc-* | *-sun)\n-\t\tos=-sunos4.1.1\n-\t\t;;\n-\t*-be)\n-\t\tos=-beos\n-\t\t;;\n-\t*-haiku)\n-\t\tos=-haiku\n-\t\t;;\n-\t*-ibm)\n-\t\tos=-aix\n-\t\t;;\n- \t*-knuth)\n-\t\tos=-mmixware\n-\t\t;;\n-\t*-wec)\n-\t\tos=-proelf\n-\t\t;;\n-\t*-winbond)\n-\t\tos=-proelf\n-\t\t;;\n-\t*-oki)\n-\t\tos=-proelf\n-\t\t;;\n-\t*-hp)\n-\t\tos=-hpux\n-\t\t;;\n-\t*-hitachi)\n-\t\tos=-hiux\n-\t\t;;\n-\ti860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)\n-\t\tos=-sysv\n-\t\t;;\n-\t*-cbm)\n-\t\tos=-amigaos\n-\t\t;;\n-\t*-dg)\n-\t\tos=-dgux\n-\t\t;;\n-\t*-dolphin)\n-\t\tos=-sysv3\n-\t\t;;\n-\tm68k-ccur)\n-\t\tos=-rtu\n-\t\t;;\n-\tm88k-omron*)\n-\t\tos=-luna\n-\t\t;;\n-\t*-next )\n-\t\tos=-nextstep\n-\t\t;;\n-\t*-sequent)\n-\t\tos=-ptx\n-\t\t;;\n-\t*-crds)\n-\t\tos=-unos\n-\t\t;;\n-\t*-ns)\n-\t\tos=-genix\n-\t\t;;\n-\ti370-*)\n-\t\tos=-mvs\n-\t\t;;\n-\t*-next)\n-\t\tos=-nextstep3\n-\t\t;;\n-\t*-gould)\n-\t\tos=-sysv\n-\t\t;;\n-\t*-highlevel)\n-\t\tos=-bsd\n-\t\t;;\n-\t*-encore)\n-\t\tos=-bsd\n-\t\t;;\n-\t*-sgi)\n-\t\tos=-irix\n-\t\t;;\n-\t*-siemens)\n-\t\tos=-sysv4\n-\t\t;;\n-\t*-masscomp)\n-\t\tos=-rtu\n-\t\t;;\n-\tf30[01]-fujitsu | f700-fujitsu)\n-\t\tos=-uxpv\n-\t\t;;\n-\t*-rom68k)\n-\t\tos=-coff\n-\t\t;;\n-\t*-*bug)\n-\t\tos=-coff\n-\t\t;;\n-\t*-apple)\n-\t\tos=-macos\n-\t\t;;\n-\t*-atari*)\n-\t\tos=-mint\n-\t\t;;\n-\t*)\n-\t\tos=-none\n-\t\t;;\n-esac\n-fi\n-\n-# Here we handle the case where we know the os, and the CPU type, but not the\n-# manufacturer. We pick the logical manufacturer.\n-vendor=unknown\n-case $basic_machine in\n-\t*-unknown)\n-\t\tcase $os in\n-\t\t\t-riscix*)\n-\t\t\t\tvendor=acorn\n-\t\t\t\t;;\n-\t\t\t-sunos*)\n-\t\t\t\tvendor=sun\n-\t\t\t\t;;\n-\t\t\t-cnk*|-aix*)\n-\t\t\t\tvendor=ibm\n-\t\t\t\t;;\n-\t\t\t-beos*)\n-\t\t\t\tvendor=be\n-\t\t\t\t;;\n-\t\t\t-hpux*)\n-\t\t\t\tvendor=hp\n-\t\t\t\t;;\n-\t\t\t-mpeix*)\n-\t\t\t\tvendor=hp\n-\t\t\t\t;;\n-\t\t\t-hiux*)\n-\t\t\t\tvendor=hitachi\n-\t\t\t\t;;\n-\t\t\t-unos*)\n-\t\t\t\tvendor=crds\n-\t\t\t\t;;\n-\t\t\t-dgux*)\n-\t\t\t\tvendor=dg\n-\t\t\t\t;;\n-\t\t\t-luna*)\n-\t\t\t\tvendor=omron\n-\t\t\t\t;;\n-\t\t\t-genix*)\n-\t\t\t\tvendor=ns\n-\t\t\t\t;;\n-\t\t\t-mvs* | -opened*)\n-\t\t\t\tvendor=ibm\n-\t\t\t\t;;\n-\t\t\t-os400*)\n-\t\t\t\tvendor=ibm\n-\t\t\t\t;;\n-\t\t\t-ptx*)\n-\t\t\t\tvendor=sequent\n-\t\t\t\t;;\n-\t\t\t-tpf*)\n-\t\t\t\tvendor=ibm\n-\t\t\t\t;;\n-\t\t\t-vxsim* | -vxworks* | -windiss*)\n-\t\t\t\tvendor=wrs\n-\t\t\t\t;;\n-\t\t\t-aux*)\n-\t\t\t\tvendor=apple\n-\t\t\t\t;;\n-\t\t\t-hms*)\n-\t\t\t\tvendor=hitachi\n-\t\t\t\t;;\n-\t\t\t-mpw* | -macos*)\n-\t\t\t\tvendor=apple\n-\t\t\t\t;;\n-\t\t\t-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)\n-\t\t\t\tvendor=atari\n-\t\t\t\t;;\n-\t\t\t-vos*)\n-\t\t\t\tvendor=stratus\n-\t\t\t\t;;\n-\t\tesac\n-\t\tbasic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`\n-\t\t;;\n-esac\n-\n-echo $basic_machine$os\n-exit\n-\n-# Local variables:\n-# eval: (add-hook \'write-file-hooks \'time-stamp)\n-# time-stamp-start: "timestamp=\'"\n-# time-stamp-format: "%:y-%02m-%02d"\n-# time-stamp-end: "\'"\n-# End:\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/configure --- a/clustalomega/clustal-omega-0.2.0/configure Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,19827 +0,0 @@\n-#! /bin/sh\n-# Guess values for system-dependent variables and create Makefiles.\n-# Generated by GNU Autoconf 2.65 for Clustal Omega 0.2.0.\n-#\n-# Report bugs to <clustalw@ucd.ie>.\n-#\n-#\n-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,\n-# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,\n-# Inc.\n-#\n-#\n-# This configure script is free software; the Free Software Foundation\n-# gives unlimited permission to copy, distribute and modify it.\n-## -------------------- ##\n-## M4sh Initialization. ##\n-## -------------------- ##\n-\n-# Be more Bourne compatible\n-DUALCASE=1; export DUALCASE # for MKS sh\n-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :\n- emulate sh\n- NULLCMD=:\n- # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which\n- # is contrary to our usage. Disable this feature.\n- alias -g \'${1+"$@"}\'=\'"$@"\'\n- setopt NO_GLOB_SUBST\n-else\n- case `(set -o) 2>/dev/null` in #(\n- *posix*) :\n- set -o posix ;; #(\n- *) :\n- ;;\n-esac\n-fi\n-\n-\n-as_nl=\'\n-\'\n-export as_nl\n-# Printing a long string crashes Solaris 7 /usr/bin/printf.\n-as_echo=\'\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'\n-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo\n-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo\n-# Prefer a ksh shell builtin over an external printf program on Solaris,\n-# but without wasting forks for bash or zsh.\n-if test -z "$BASH_VERSION$ZSH_VERSION" \\\n- && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then\n- as_echo=\'print -r --\'\n- as_echo_n=\'print -rn --\'\n-elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then\n- as_echo=\'printf %s\\n\'\n- as_echo_n=\'printf %s\'\n-else\n- if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then\n- as_echo_body=\'eval /usr/ucb/echo -n "$1$as_nl"\'\n- as_echo_n=\'/usr/ucb/echo -n\'\n- else\n- as_echo_body=\'eval expr "X$1" : "X\\\\(.*\\\\)"\'\n- as_echo_n_body=\'eval\n- arg=$1;\n- case $arg in #(\n- *"$as_nl"*)\n-\texpr "X$arg" : "X\\\\(.*\\\\)$as_nl";\n-\targ=`expr "X$arg" : ".*$as_nl\\\\(.*\\\\)"`;;\n- esac;\n- expr "X$arg" : "X\\\\(.*\\\\)" | tr -d "$as_nl"\n- \'\n- export as_echo_n_body\n- as_echo_n=\'sh -c $as_echo_n_body as_echo\'\n- fi\n- export as_echo_body\n- as_echo=\'sh -c $as_echo_body as_echo\'\n-fi\n-\n-# The user is always right.\n-if test "${PATH_SEPARATOR+set}" != set; then\n- PATH_SEPARATOR=:\n- (PATH=\'/bin;/bin\'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {\n- (PATH=\'/bin:/bin\'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||\n- PATH_SEPARATOR=\';\'\n- }\n-fi\n-\n-\n-# IFS\n-# We need space, tab and new line, in precisely that order. Quoting is\n-# there to prevent editors from complaining about space-tab.\n-# (If _AS_PATH_WALK were called with IFS unset, it would disable word\n-# splitting by setting IFS to empty value.)\n-IFS=" ""\t$as_nl"\n-\n-# Find who we are. Look in the path if we contain no directory separator.\n-case $0 in #((\n- *[\\\\/]* ) as_myself=$0 ;;\n- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR\n-for as_dir in $PATH\n-do\n- IFS=$as_save_IFS\n- test -z "$as_dir" && as_dir=.\n- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break\n- done\n-IFS=$as_save_IFS\n-\n- ;;\n-esac\n-# We did not find ourselves, most probably we were run as `sh COMMAND\'\n-# in which case we are not to be found in the path.\n-if test "x$as_myself" = x; then\n- as_myself=$0\n-fi\n-if test ! -f "$as_myself"; then\n- $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2\n- exit 1\n-fi\n-\n-# Unset variables that we do not need and which cause bugs (e.g. in\n-# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"\n-# suppresses any "Segmentation fault" message there. \'((\' could\n-# trigger a bug in pdksh 5.2.14.\n-for as_var in BASH_ENV ENV MAIL MAILPATH\n-do eval test x\\${$as_var+set} = xset \\\n- && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :\n-done\n-PS1=\'$'..b'# Set to "yes" if using DIR/libNAME\\${shared_ext} during linking hardcodes\n-# DIR into the resulting binary.\n-hardcode_direct=$hardcode_direct_CXX\n-\n-# Set to "yes" if using DIR/libNAME\\${shared_ext} during linking hardcodes\n-# DIR into the resulting binary and the resulting library dependency is\n-# "absolute",i.e impossible to change by setting \\${shlibpath_var} if the\n-# library is relocated.\n-hardcode_direct_absolute=$hardcode_direct_absolute_CXX\n-\n-# Set to "yes" if using the -LDIR flag during linking hardcodes DIR\n-# into the resulting binary.\n-hardcode_minus_L=$hardcode_minus_L_CXX\n-\n-# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR\n-# into the resulting binary.\n-hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX\n-\n-# Set to "yes" if building a shared library automatically hardcodes DIR\n-# into the library and all subsequent libraries and executables linked\n-# against it.\n-hardcode_automatic=$hardcode_automatic_CXX\n-\n-# Set to yes if linker adds runtime paths of dependent libraries\n-# to runtime path list.\n-inherit_rpath=$inherit_rpath_CXX\n-\n-# Whether libtool must link a program against all its dependency libraries.\n-link_all_deplibs=$link_all_deplibs_CXX\n-\n-# Fix the shell variable \\$srcfile for the compiler.\n-fix_srcfile_path=$lt_fix_srcfile_path_CXX\n-\n-# Set to "yes" if exported symbols are required.\n-always_export_symbols=$always_export_symbols_CXX\n-\n-# The commands to list exported symbols.\n-export_symbols_cmds=$lt_export_symbols_cmds_CXX\n-\n-# Symbols that should not be listed in the preloaded symbols.\n-exclude_expsyms=$lt_exclude_expsyms_CXX\n-\n-# Symbols that must always be exported.\n-include_expsyms=$lt_include_expsyms_CXX\n-\n-# Commands necessary for linking programs (against libraries) with templates.\n-prelink_cmds=$lt_prelink_cmds_CXX\n-\n-# Specify filename containing input files.\n-file_list_spec=$lt_file_list_spec_CXX\n-\n-# How to hardcode a shared library path into an executable.\n-hardcode_action=$hardcode_action_CXX\n-\n-# The directories searched by this compiler when creating a shared library.\n-compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX\n-\n-# Dependencies to place before and after the objects being linked to\n-# create a shared library.\n-predep_objects=$lt_predep_objects_CXX\n-postdep_objects=$lt_postdep_objects_CXX\n-predeps=$lt_predeps_CXX\n-postdeps=$lt_postdeps_CXX\n-\n-# The library search path used internally by the compiler when linking\n-# a shared library.\n-compiler_lib_search_path=$lt_compiler_lib_search_path_CXX\n-\n-# ### END LIBTOOL TAG CONFIG: CXX\n-_LT_EOF\n-\n- ;;\n-\n- esac\n-done # for ac_tag\n-\n-\n-as_fn_exit 0\n-_ACEOF\n-ac_clean_files=$ac_clean_files_save\n-\n-test $ac_write_fail = 0 ||\n- as_fn_error "write failure creating $CONFIG_STATUS" "$LINENO" 5\n-\n-\n-# configure is writing to config.log, and then calls config.status.\n-# config.status does its own redirection, appending to config.log.\n-# Unfortunately, on DOS this fails, as config.log is still kept open\n-# by configure, so config.status won\'t be able to write to it; its\n-# output is simply discarded. So we exec the FD to /dev/null,\n-# effectively closing config.log, so it can be properly (re)opened and\n-# appended to by config.status. When coming back to configure, we\n-# need to make the FD available again.\n-if test "$no_create" != yes; then\n- ac_cs_success=:\n- ac_config_status_args=\n- test "$silent" = yes &&\n- ac_config_status_args="$ac_config_status_args --quiet"\n- exec 5>/dev/null\n- $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false\n- exec 5>>config.log\n- # Use ||, not &&, to avoid exiting from the if with $? = 1, which\n- # would make configure fail if this is the last instruction.\n- $ac_cs_success || as_fn_exit $?\n-fi\n-if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then\n- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5\n-$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}\n-fi\n-\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/configure.ac --- a/clustalomega/clustal-omega-0.2.0/configure.ac Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,492 +0,0 @@\n-# configure.ac for Clustal Omega\n-#\n-# RCS $Id: configure.ac 238 2011-04-19 18:42:55Z fabian $\n-\n-\n-# release\n-#\n-#AC_INIT([Clustal Omega], [0.1.1], [clustalw@ucd.ie])\n-#PACKAGE_CODENAME="OppidumLeonis"\n-AC_INIT([Clustal Omega], [0.2.0], [clustalw@ucd.ie])\n-PACKAGE_CODENAME="IbiMeVidebunt"\n-\n-# The AC_INIT macro can take any source file as an argument. It just\n-# checks that the file is there, which should, in turn, mean that the\n-# source directory is there. AC_INIT generates the following m4\n-# macros, output variables and preprocessor symbols:\n-AC_SUBST(PACKAGE_NAME)\n-AC_SUBST(PACKAGE_TARNAME)\n-AC_SUBST(PACKAGE_VERSION)\n-AC_SUBST(PACKAGE_STRING)\n-AC_SUBST(PACKAGE_BUGREPORT)\n-AC_SUBST(PACKAGE_CODENAME)\n-\n-AC_MSG_NOTICE([\n-\n- Welcome to $PACKAGE_NAME - version $PACKAGE_VERSION ($PACKAGE_CODENAME)\n- \n- +NMMMMMMMMMS= \n- MMMMM? :MMMMM8 \n- IMMMMS MMMMM, \n- ~MMMMN ,MMMMM \n- =MMMMM MMMMM \n- ?MMMMM +MMMMM \n- MMMMMS MMMMM \n- MMMMM MMMMM: \n- MMMMM MMMMM+ \n- MMMMM MMMMM~ \n- MMMMM MMMMM \n- MMMMMZ MMMMM \n- MMMMM ,MMMMZ \n- MMMM8 MMMM+ \n- MMMMS MMMM, \n- MMMMO MMMM \n- ,N SMMM MMM8 +8 \n- ,M7 M+ M+ :M8 \n- ,MMMMMMMMMMMMI MMMMMMMMMMMM8 \n- ,MMMMMMMMMMMM8 MMMMMMMMMMMM8 \n- ,MMMMMMMMMMMMN MMMMMMMMMMMM8 \n- \n- ])\n-#\n-# Created with http://www.glassgiant.com/ascii/ and Wikipedia\'s Omega\n-# Replaced all dollars with S\'s.\n-#\n-# \n-# ,MMMMMMMMMD: MMMMM \n-# NMMMMMMMMMMMMMM+ SMMMM \n-# DMMMMMMMMMMMMMMMMMM, +MMMM \n-# MMMMMMMMM8ZSO8MMMMMMMM +MMMM \n-# MMMMM7 SMMMM +MMMM \n-# MMMO MM? +MMMM \n-# ?MMI NMIIMMMM \n-# MMM MMMMMMM \n-# MM \n-# MN \n-# MD \n-# MM \n-# MM? ,~+ISON \n-# =MMI MMSOMMMM \n-# MMMZ MMS +MMMM \n-# MMMM8: :NMMM +MMMM \n-# MMMMMMMMMDOODMMMMMMMMM +MMMM \n-# MMMMMMMMMMMMMMMMMMMM +MMMM \n-# OMMMMMMMMMMMMMMZ SMMMM \n-# MMMMMMMMMM+ MMMMM \n-# \n-\n-\n-# AC_MSG_NOTICE([Configuring for your system...])\n-\n-AC_PREREQ(2.6) # 2.60 needed for AC_USE_SYSTEM_EXTENSIONS\n-# consider 2.64 which allows to define a URL as well\n-\n-# The AM_INIT_AUTOMAKE line adds several standard checks. \n-# This macro is always needed for automake\n-# Obsolete: It takes the program name and version number as arguments.\n-AM_INIT_AUTOMAKE\n-\n-# config header: provides a way for people to customise the\n-# configuration for their platform, via #defines. config.h.in can be\n-# generated automatically with the autoheader tool. However, you need\n-# a stamp-h file in your project to ensure that automake regenerates\n-# config.h from config.h.in. Type \'touch stamp-h\' to add this file to\n-# your project.\n-#\n-AM_CONFIG_HEADER(src/config.h) \n-\n-# the following allows to install a copy config.'..b'seem to support OpenMP]))\n-# AC_SUBST(OPENMP_CFLAGS)\n-# AC_SUBST(OPENMP_CXXFLAGS)\n-#fi\n-\n-# --- squid\n-#\n-#\n-# Extra checks for squid; see their configure, config.log, squidconf.h\n-# etc. For example, I\'m not sure about USE_HOST_BYTESWAP_FUNCTIONS,\n-# SIZEOF_UNSIGNED_LONG, HAVE_STRTOUL and HAVE_STRTOULL\n-#\n-# Might not just have to set compiler flags but create use squidconf.h.in\n-#\n-# The following hopefully takes about byte ordering (big-endian...).\n-# My hope is that it will set WORDS_BIGENDIAN and\n-# USE_HOST_BYTESWAP_FUNCTIONS (as used by squid) if necessary:\n-#\n-AC_C_BIGENDIAN(AC_MSG_WARN([$PACKAGE_NAME hasn\'t been tested on Big-Endian machines...expecting trouble!]))\n-AC_CHECK_FUNCS([ntohs ntohl ntons ntonl])\n-#\n-AC_CHECK_SIZEOF(unsigned short)\n-AC_CHECK_SIZEOF(unsigned int)\n-AC_CHECK_SIZEOF(unsigned long)\n-AC_CHECK_SIZEOF(unsigned long long)\n-#\n-AC_CHECK_FUNCS([stroul strtoull])\n-AC_CHECK_FUNCS([ftello fseeko])\n-AC_CHECK_FUNCS([ftello64 fseeko64])\n-AC_CHECK_FUNCS([ftell64 fseek64])\n-#\n-AC_TYPE_OFF_T\n-AC_CHECK_SIZEOF(fpos_t)\n-#\n-# struct stat64 and stat64 test:\n-# version 1:\n-#AC_CHECK_TYPE(struct stat64,\n-# [AC_CHECK_FUNC([stat64],\n-# AC_DEFINE([HAVE_STAT64], [1], [Define if you have the stat64 function]))])\n-# version 2:\n-#AC_MSG_CHECKING(for struct stat64)\n-#AC_CACHE_VAL(sc_cv_type_stat64,\n-#[AC_TRY_COMPILE([#include <sys/stat.h>],[struct stat64 s;],\n-#[sc_cv_type_stat64=yes],\n-#[sc_cv_type_stat64=no])])\n-#if test $sc_cv_type_stat64 = yes; then\n-# AC_MSG_RESULT($sc_cv_type_stat64)\n-# AC_CHECK_FUNC([stat64], AC_DEFINE([HAVE_STAT64], [1], [Define if you have the stat64 function]))\n-# #AC_DEFINE(HAVE_STAT64, [1], [Define if you have the stat64 function])\n-#fi\n-#\n-#\n-# Above fails on myosin because storage size of struct 64 is unknown:\n-# ssi.c:480: error: storage size of \xe2\x80\x98s1\xe2\x80\x99 isn\xe2\x80\x99t known \n-#\n-# On my MacBook OS X 10.6 I get:\n-# ssi.c:481: warning: \xe2\x80\x98stat64\xe2\x80\x99 is deprecated (declared at /usr/include/sys/stat.h:465)\n-#\n-# So forget about it: we won\'t use stat64 or define HAVE_STAT64 and\n-# consequently do no tests here\n-#\n-\n-\n-\n-# Add support for the Dmalloc package. If the user runs configure with\n-# --with-dmalloc, then define WITH_DMALLOC and add -ldmalloc to LIBS.\n-AM_WITH_DMALLOC\n-\n-\n-# Check if svnversion is installed\n-#AC_PATH_PROG([SVNVERSION_BIN], [svnversionFIXME], [no])\n-## checking if we build in a subversion WC\n-#wc_found="no";\n-#if test "$SVNVERSION_BIN" != "no"; then\n-# SVNVERSION=`$SVNVERSION_BIN -n $srcdir`\n-# if test $SVNVERSION != "exported";\n-# then\n-# AC_MSG_NOTICE($SVNVERSION);\n-# fi\n-#fi\n-\n-\n-# --- debugging\n-# \n-# \n-#\n-AC_MSG_CHECKING([whether to build with debug information])\n-AC_ARG_ENABLE([debug],\n- [AS_HELP_STRING([--enable-debug],\n- [Enable debugging (default=no)])],\n- [debugit="$enableval"],\n- [debugit=no])\n-AC_MSG_RESULT([$debugit])\n-\n-if test x"$debugit" = x"yes"; then\n- # User variables CFLAGS/CXXFLAGS are used last during compilation and\n- # can therefore overwrite system settings.\n- #\n- # if debugging was requested, add debugging info at the end of\n- # C[XX]FLAGS, which makes sure previous optimisation flags are\n- # overwritten (normally C[XX]FLAGS should not be modified as they\n- # are user variables):\n- # switch off assert etc\n- # AC_DEFINE([DEBUG],[],[Debug Mode])\n- CFLAGS="${CFLAGS} -g -ansi -Wall -O0"\n- CXXFLAGS="${CXXFLAGS} -g -ansi -Wall -O0"\n-else\n- # switch off assert etc\n- AC_DEFINE([NDEBUG],[],[No-debug Mode])\n- # if no debugging is requested, we make optimisation explicit\n- AM_CXXFLAGS="${AM_CXXFLAGS} -O3"\n- AM_CFLAGS="${AM_CFLAGS} -O3"\n-fi\n-\n-\n-\n-AC_SUBST([AM_CXXFLAGS])\n-AC_SUBST([AM_CFLAGS])\n-AC_SUBST([AM_LDFLAGS])\n-\n-\n-AC_CONFIG_FILES(Makefile\n- src/Makefile\n- clustalo.pc\n- Doxyfile\n- src/clustal/Makefile\n- src/hhalign/Makefile\n- src/kmpp/Makefile\n- src/squid/Makefile)\n-AC_OUTPUT\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/depcomp --- a/clustalomega/clustal-omega-0.2.0/depcomp Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,630 +0,0 @@\n-#! /bin/sh\n-# depcomp - compile a program generating dependencies as side-effects\n-\n-scriptversion=2009-04-28.21; # UTC\n-\n-# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free\n-# Software Foundation, Inc.\n-\n-# This program is free software; you can redistribute it and/or modify\n-# it under the terms of the GNU General Public License as published by\n-# the Free Software Foundation; either version 2, or (at your option)\n-# any later version.\n-\n-# This program is distributed in the hope that it will be useful,\n-# but WITHOUT ANY WARRANTY; without even the implied warranty of\n-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n-# GNU General Public License for more details.\n-\n-# You should have received a copy of the GNU General Public License\n-# along with this program. If not, see <http://www.gnu.org/licenses/>.\n-\n-# As a special exception to the GNU General Public License, if you\n-# distribute this file as part of a program that contains a\n-# configuration script generated by Autoconf, you may include it under\n-# the same distribution terms that you use for the rest of that program.\n-\n-# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.\n-\n-case $1 in\n- \'\')\n- echo "$0: No command. Try \\`$0 --help\' for more information." 1>&2\n- exit 1;\n- ;;\n- -h | --h*)\n- cat <<\\EOF\n-Usage: depcomp [--help] [--version] PROGRAM [ARGS]\n-\n-Run PROGRAMS ARGS to compile a file, generating dependencies\n-as side-effects.\n-\n-Environment variables:\n- depmode Dependency tracking mode.\n- source Source file read by `PROGRAMS ARGS\'.\n- object Object file output by `PROGRAMS ARGS\'.\n- DEPDIR directory where to store dependencies.\n- depfile Dependency file to output.\n- tmpdepfile Temporary file to use when outputing dependencies.\n- libtool Whether libtool is used (yes/no).\n-\n-Report bugs to <bug-automake@gnu.org>.\n-EOF\n- exit $?\n- ;;\n- -v | --v*)\n- echo "depcomp $scriptversion"\n- exit $?\n- ;;\n-esac\n-\n-if test -z "$depmode" || test -z "$source" || test -z "$object"; then\n- echo "depcomp: Variables source, object and depmode must be set" 1>&2\n- exit 1\n-fi\n-\n-# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.\n-depfile=${depfile-`echo "$object" |\n- sed \'s|[^\\\\/]*$|\'${DEPDIR-.deps}\'/&|;s|\\.\\([^.]*\\)$|.P\\1|;s|Pobj$|Po|\'`}\n-tmpdepfile=${tmpdepfile-`echo "$depfile" | sed \'s/\\.\\([^.]*\\)$/.T\\1/\'`}\n-\n-rm -f "$tmpdepfile"\n-\n-# Some modes work just like other modes, but use different flags. We\n-# parameterize here, but still list the modes in the big case below,\n-# to make depend.m4 easier to write. Note that we *cannot* use a case\n-# here, because this file can only contain one case statement.\n-if test "$depmode" = hp; then\n- # HP compiler uses -M and no extra arg.\n- gccflag=-M\n- depmode=gcc\n-fi\n-\n-if test "$depmode" = dashXmstdout; then\n- # This is just like dashmstdout with a different argument.\n- dashmflag=-xM\n- depmode=dashmstdout\n-fi\n-\n-cygpath_u="cygpath -u -f -"\n-if test "$depmode" = msvcmsys; then\n- # This is just like msvisualcpp but w/o cygpath translation.\n- # Just convert the backslash-escaped backslashes to single forward\n- # slashes to satisfy depend.m4\n- cygpath_u="sed s,\\\\\\\\\\\\\\\\,/,g"\n- depmode=msvisualcpp\n-fi\n-\n-case "$depmode" in\n-gcc3)\n-## gcc 3 implements dependency tracking that does exactly what\n-## we want. Yay! Note: for some reason libtool 1.4 doesn\'t like\n-## it if -MD -MP comes after the -MF stuff. Hmm.\n-## Unfortunately, FreeBSD c89 acceptance of flags depends upon\n-## the command line argument order; so add the flags where they\n-## appear in depend2.am. Note that the slowdown incurred here\n-## affects only configure: in makefiles, %FASTDEP% shortcuts this.\n- for arg\n- do\n- case $arg in\n- -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;\n- *) set fnord "$@" "$arg" ;;\n- esac\n- shift # fnord\n- shift # $arg\n- done\n- "$@"\n- stat=$?\n- i'..b'around.\n- sed -e \'s/^\\\\$//\' -e \'/^$/d\' -e \'/:$/d\' | sed -e \'s/$/ :/\' >> "$depfile"\n- rm -f "$tmpdepfile"\n- ;;\n-\n-dashXmstdout)\n- # This case only exists to satisfy depend.m4. It is never actually\n- # run, as this mode is specially recognized in the preamble.\n- exit 1\n- ;;\n-\n-makedepend)\n- "$@" || exit $?\n- # Remove any Libtool call\n- if test "$libtool" = yes; then\n- while test "X$1" != \'X--mode=compile\'; do\n- shift\n- done\n- shift\n- fi\n- # X makedepend\n- shift\n- cleared=no eat=no\n- for arg\n- do\n- case $cleared in\n- no)\n- set ""; shift\n- cleared=yes ;;\n- esac\n- if test $eat = yes; then\n- eat=no\n- continue\n- fi\n- case "$arg" in\n- -D*|-I*)\n- set fnord "$@" "$arg"; shift ;;\n- # Strip any option that makedepend may not understand. Remove\n- # the object too, otherwise makedepend will parse it as a source file.\n- -arch)\n- eat=yes ;;\n- -*|$object)\n- ;;\n- *)\n- set fnord "$@" "$arg"; shift ;;\n- esac\n- done\n- obj_suffix=`echo "$object" | sed \'s/^.*\\././\'`\n- touch "$tmpdepfile"\n- ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"\n- rm -f "$depfile"\n- cat < "$tmpdepfile" > "$depfile"\n- sed \'1,2d\' "$tmpdepfile" | tr \' \' \'\n-\' | \\\n-## Some versions of the HPUX 10.20 sed can\'t process this invocation\n-## correctly. Breaking it into two sed invocations is a workaround.\n- sed -e \'s/^\\\\$//\' -e \'/^$/d\' -e \'/:$/d\' | sed -e \'s/$/ :/\' >> "$depfile"\n- rm -f "$tmpdepfile" "$tmpdepfile".bak\n- ;;\n-\n-cpp)\n- # Important note: in order to support this mode, a compiler *must*\n- # always write the preprocessed file to stdout.\n- "$@" || exit $?\n-\n- # Remove the call to Libtool.\n- if test "$libtool" = yes; then\n- while test "X$1" != \'X--mode=compile\'; do\n- shift\n- done\n- shift\n- fi\n-\n- # Remove `-o $object\'.\n- IFS=" "\n- for arg\n- do\n- case $arg in\n- -o)\n- shift\n- ;;\n- $object)\n- shift\n- ;;\n- *)\n- set fnord "$@" "$arg"\n- shift # fnord\n- shift # $arg\n- ;;\n- esac\n- done\n-\n- "$@" -E |\n- sed -n -e \'/^# [0-9][0-9]* "\\([^"]*\\)".*/ s:: \\1 \\\\:p\' \\\n- -e \'/^#line [0-9][0-9]* "\\([^"]*\\)".*/ s:: \\1 \\\\:p\' |\n- sed \'$ s: \\\\$::\' > "$tmpdepfile"\n- rm -f "$depfile"\n- echo "$object : \\\\" > "$depfile"\n- cat < "$tmpdepfile" >> "$depfile"\n- sed < "$tmpdepfile" \'/^$/d;s/^ //;s/ \\\\$//;s/$/ :/\' >> "$depfile"\n- rm -f "$tmpdepfile"\n- ;;\n-\n-msvisualcpp)\n- # Important note: in order to support this mode, a compiler *must*\n- # always write the preprocessed file to stdout.\n- "$@" || exit $?\n-\n- # Remove the call to Libtool.\n- if test "$libtool" = yes; then\n- while test "X$1" != \'X--mode=compile\'; do\n- shift\n- done\n- shift\n- fi\n-\n- IFS=" "\n- for arg\n- do\n- case "$arg" in\n- -o)\n- shift\n- ;;\n- $object)\n- shift\n- ;;\n- "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")\n-\tset fnord "$@"\n-\tshift\n-\tshift\n-\t;;\n- *)\n-\tset fnord "$@" "$arg"\n-\tshift\n-\tshift\n-\t;;\n- esac\n- done\n- "$@" -E 2>/dev/null |\n- sed -n \'/^#line [0-9][0-9]* "\\([^"]*\\)"/ s::\\1:p\' | $cygpath_u | sort -u > "$tmpdepfile"\n- rm -f "$depfile"\n- echo "$object : \\\\" > "$depfile"\n- sed < "$tmpdepfile" -n -e \'s% %\\\\ %g\' -e \'/^\\(.*\\)$/ s::\t\\1 \\\\:p\' >> "$depfile"\n- echo "\t" >> "$depfile"\n- sed < "$tmpdepfile" -n -e \'s% %\\\\ %g\' -e \'/^\\(.*\\)$/ s::\\1\\::p\' >> "$depfile"\n- rm -f "$tmpdepfile"\n- ;;\n-\n-msvcmsys)\n- # This case exists only to let depend.m4 do its work. It works by\n- # looking at the text of this script. This case will never be run,\n- # since it is checked for above.\n- exit 1\n- ;;\n-\n-none)\n- exec "$@"\n- ;;\n-\n-*)\n- echo "Unknown depmode $depmode" 1>&2\n- exit 1\n- ;;\n-esac\n-\n-exit 0\n-\n-# Local Variables:\n-# mode: shell-script\n-# sh-indentation: 2\n-# eval: (add-hook \'write-file-hooks \'time-stamp)\n-# time-stamp-start: "scriptversion="\n-# time-stamp-format: "%:y-%02m-%02d.%02H"\n-# time-stamp-time-zone: "UTC"\n-# time-stamp-end: "; # UTC"\n-# End:\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/install-sh --- a/clustalomega/clustal-omega-0.2.0/install-sh Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,520 +0,0 @@\n-#!/bin/sh\n-# install - install a program, script, or datafile\n-\n-scriptversion=2009-04-28.21; # UTC\n-\n-# This originates from X11R5 (mit/util/scripts/install.sh), which was\n-# later released in X11R6 (xc/config/util/install.sh) with the\n-# following copyright and license.\n-#\n-# Copyright (C) 1994 X Consortium\n-#\n-# Permission is hereby granted, free of charge, to any person obtaining a copy\n-# of this software and associated documentation files (the "Software"), to\n-# deal in the Software without restriction, including without limitation the\n-# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n-# sell copies of the Software, and to permit persons to whom the Software is\n-# furnished to do so, subject to the following conditions:\n-#\n-# The above copyright notice and this permission notice shall be included in\n-# all copies or substantial portions of the Software.\n-#\n-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n-# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\n-# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-\n-# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n-#\n-# Except as contained in this notice, the name of the X Consortium shall not\n-# be used in advertising or otherwise to promote the sale, use or other deal-\n-# ings in this Software without prior written authorization from the X Consor-\n-# tium.\n-#\n-#\n-# FSF changes to this file are in the public domain.\n-#\n-# Calling this script install-sh is preferred over install.sh, to prevent\n-# `make\' implicit rules from creating a file called install from it\n-# when there is no Makefile.\n-#\n-# This script is compatible with the BSD install script, but was written\n-# from scratch.\n-\n-nl=\'\n-\'\n-IFS=" ""\t$nl"\n-\n-# set DOITPROG to echo to test this script\n-\n-# Don\'t use :- since 4.3BSD and earlier shells don\'t like it.\n-doit=${DOITPROG-}\n-if test -z "$doit"; then\n- doit_exec=exec\n-else\n- doit_exec=$doit\n-fi\n-\n-# Put in absolute file names if you don\'t have them in your path;\n-# or use environment vars.\n-\n-chgrpprog=${CHGRPPROG-chgrp}\n-chmodprog=${CHMODPROG-chmod}\n-chownprog=${CHOWNPROG-chown}\n-cmpprog=${CMPPROG-cmp}\n-cpprog=${CPPROG-cp}\n-mkdirprog=${MKDIRPROG-mkdir}\n-mvprog=${MVPROG-mv}\n-rmprog=${RMPROG-rm}\n-stripprog=${STRIPPROG-strip}\n-\n-posix_glob=\'?\'\n-initialize_posix_glob=\'\n- test "$posix_glob" != "?" || {\n- if (set -f) 2>/dev/null; then\n- posix_glob=\n- else\n- posix_glob=:\n- fi\n- }\n-\'\n-\n-posix_mkdir=\n-\n-# Desired mode of installed file.\n-mode=0755\n-\n-chgrpcmd=\n-chmodcmd=$chmodprog\n-chowncmd=\n-mvcmd=$mvprog\n-rmcmd="$rmprog -f"\n-stripcmd=\n-\n-src=\n-dst=\n-dir_arg=\n-dst_arg=\n-\n-copy_on_change=false\n-no_target_directory=\n-\n-usage="\\\n-Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE\n- or: $0 [OPTION]... SRCFILES... DIRECTORY\n- or: $0 [OPTION]... -t DIRECTORY SRCFILES...\n- or: $0 [OPTION]... -d DIRECTORIES...\n-\n-In the 1st form, copy SRCFILE to DSTFILE.\n-In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.\n-In the 4th, create DIRECTORIES.\n-\n-Options:\n- --help display this help and exit.\n- --version display version info and exit.\n-\n- -c (ignored)\n- -C install only if different (preserve the last data modification time)\n- -d create directories instead of installing files.\n- -g GROUP $chgrpprog installed files to GROUP.\n- -m MODE $chmodprog installed files to MODE.\n- -o USER $chownprog installed files to USER.\n- -s $stripprog installed files.\n- -t DIRECTORY install into DIRECTORY.\n- -T report an error if DSTFILE is a directory.\n-\n-Environment variables override the default commands:\n- CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG\n- RMPROG STRIPPROG\n'..b'\n-\t/*) prefix=\'/\';;\n-\t-*) prefix=\'./\';;\n-\t*) prefix=\'\';;\n- esac\n-\n- eval "$initialize_posix_glob"\n-\n- oIFS=$IFS\n- IFS=/\n- $posix_glob set -f\n- set fnord $dstdir\n- shift\n- $posix_glob set +f\n- IFS=$oIFS\n-\n- prefixes=\n-\n- for d\n- do\n-\ttest -z "$d" && continue\n-\n-\tprefix=$prefix$d\n-\tif test -d "$prefix"; then\n-\t prefixes=\n-\telse\n-\t if $posix_mkdir; then\n-\t (umask=$mkdir_umask &&\n-\t $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break\n-\t # Don\'t fail if two instances are running concurrently.\n-\t test -d "$prefix" || exit 1\n-\t else\n-\t case $prefix in\n-\t *\\\'*) qprefix=`echo "$prefix" | sed "s/\'/\'\\\\\\\\\\\\\\\\\'\'/g"`;;\n-\t *) qprefix=$prefix;;\n-\t esac\n-\t prefixes="$prefixes \'$qprefix\'"\n-\t fi\n-\tfi\n-\tprefix=$prefix/\n- done\n-\n- if test -n "$prefixes"; then\n-\t# Don\'t fail if two instances are running concurrently.\n-\t(umask $mkdir_umask &&\n-\t eval "\\$doit_exec \\$mkdirprog $prefixes") ||\n-\t test -d "$dstdir" || exit 1\n-\tobsolete_mkdir_used=true\n- fi\n- fi\n- fi\n-\n- if test -n "$dir_arg"; then\n- { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&\n- { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&\n- { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||\n- test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1\n- else\n-\n- # Make a couple of temp file names in the proper directory.\n- dsttmp=$dstdir/_inst.$$_\n- rmtmp=$dstdir/_rm.$$_\n-\n- # Trap to clean up those temp files at exit.\n- trap \'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret\' 0\n-\n- # Copy the file name to the temp name.\n- (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&\n-\n- # and set any options; do chmod last to preserve setuid bits.\n- #\n- # If any of these fail, we abort the whole thing. If we want to\n- # ignore errors from any of these, just make sure not to ignore\n- # errors from the above "$doit $cpprog $src $dsttmp" command.\n- #\n- { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&\n- { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&\n- { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&\n- { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&\n-\n- # If -C, don\'t bother to copy if it wouldn\'t change the file.\n- if $copy_on_change &&\n- old=`LC_ALL=C ls -dlL "$dst"\t2>/dev/null` &&\n- new=`LC_ALL=C ls -dlL "$dsttmp"\t2>/dev/null` &&\n-\n- eval "$initialize_posix_glob" &&\n- $posix_glob set -f &&\n- set X $old && old=:$2:$4:$5:$6 &&\n- set X $new && new=:$2:$4:$5:$6 &&\n- $posix_glob set +f &&\n-\n- test "$old" = "$new" &&\n- $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1\n- then\n- rm -f "$dsttmp"\n- else\n- # Rename the file to the real destination.\n- $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||\n-\n- # The rename failed, perhaps because mv can\'t rename something else\n- # to itself, or perhaps because mv is so ancient that it does not\n- # support -f.\n- {\n-\t# Now remove or move aside any old file at destination location.\n-\t# We try this two ways since rm can\'t unlink itself on some\n-\t# systems and the destination file might be busy for other\n-\t# reasons. In this case, the final cleanup might fail but the new\n-\t# file should still install successfully.\n-\t{\n-\t test ! -f "$dst" ||\n-\t $doit $rmcmd -f "$dst" 2>/dev/null ||\n-\t { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&\n-\t { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }\n-\t } ||\n-\t { echo "$0: cannot unlink or rename $dst" >&2\n-\t (exit 1); exit 1\n-\t }\n-\t} &&\n-\n-\t# Now rename the file to the real destination.\n-\t$doit $mvcmd "$dsttmp" "$dst"\n- }\n- fi || exit 1\n-\n- trap \'\' 0\n- fi\n-done\n-\n-# Local variables:\n-# eval: (add-hook \'write-file-hooks \'time-stamp)\n-# time-stamp-start: "scriptversion="\n-# time-stamp-format: "%:y-%02m-%02d.%02H"\n-# time-stamp-time-zone: "UTC"\n-# time-stamp-end: "; # UTC"\n-# End:\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/ltmain.sh --- a/clustalomega/clustal-omega-0.2.0/ltmain.sh Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,8413 +0,0 @@\n-# Generated from ltmain.m4sh.\n-\n-# ltmain.sh (GNU libtool) 2.2.6b\n-# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996\n-\n-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 Free Software Foundation, Inc.\n-# This is free software; see the source for copying conditions. There is NO\n-# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n-\n-# GNU Libtool is free software; you can redistribute it and/or modify\n-# it under the terms of the GNU General Public License as published by\n-# the Free Software Foundation; either version 2 of the License, or\n-# (at your option) any later version.\n-#\n-# As a special exception to the GNU General Public License,\n-# if you distribute this file as part of a program or library that\n-# is built using GNU Libtool, you may include this file under the\n-# same distribution terms that you use for the rest of that program.\n-#\n-# GNU Libtool is distributed in the hope that it will be useful, but\n-# WITHOUT ANY WARRANTY; without even the implied warranty of\n-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n-# General Public License for more details.\n-#\n-# You should have received a copy of the GNU General Public License\n-# along with GNU Libtool; see the file COPYING. If not, a copy\n-# can be downloaded from http://www.gnu.org/licenses/gpl.html,\n-# or obtained by writing to the Free Software Foundation, Inc.,\n-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\n-\n-# Usage: $progname [OPTION]... [MODE-ARG]...\n-#\n-# Provide generalized library-building support services.\n-#\n-# --config show all configuration variables\n-# --debug enable verbose shell tracing\n-# -n, --dry-run display commands without modifying any files\n-# --features display basic configuration information and exit\n-# --mode=MODE use operation mode MODE\n-# --preserve-dup-deps don\'t remove duplicate dependency libraries\n-# --quiet, --silent don\'t print informational messages\n-# --tag=TAG use configuration variables from tag TAG\n-# -v, --verbose print informational messages (default)\n-# --version print version information\n-# -h, --help print short or long help message\n-#\n-# MODE must be one of the following:\n-#\n-# clean remove files from the build directory\n-# compile compile a source file into a libtool object\n-# execute automatically set library path, then run a program\n-# finish complete the installation of libtool libraries\n-# install install libraries or executables\n-# link create a library or an executable\n-# uninstall remove libraries from an installed directory\n-#\n-# MODE-ARGS vary depending on the MODE.\n-# Try `$progname --help --mode=MODE\' for a more detailed description of MODE.\n-#\n-# When reporting a bug, please describe a test case to reproduce it and\n-# include the following information:\n-#\n-# host-triplet:\t$host\n-# shell:\t\t$SHELL\n-# compiler:\t\t$LTCC\n-# compiler flags:\t\t$LTCFLAGS\n-# linker:\t\t$LD (gnu? $with_gnu_ld)\n-# $progname:\t\t(GNU libtool) 2.2.6b Debian-2.2.6b-2ubuntu1\n-# automake:\t\t$automake_version\n-# autoconf:\t\t$autoconf_version\n-#\n-# Report bugs to <bug-libtool@gnu.org>.\n-\n-PROGRAM=ltmain.sh\n-PACKAGE=libtool\n-VERSION="2.2.6b Debian-2.2.6b-2ubuntu1"\n-TIMESTAMP=""\n-package_revision=1.3017\n-\n-# Be Bourne compatible\n-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then\n- emulate sh\n- NULLCMD=:\n- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which\n- # is contrary to our usage. Disable this feature.\n- alias -g \'${1+"$@"}\'=\'"$@"\'\n- setopt NO_GLOB_SUBST\n-else\n- case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac\n-fi\n-BIN_SH=xpg4; export BIN_SH # for Tru64\n-DUALCASE=1; ex'..b'mmand in the postuninstall commands.\n-\t func_execute_cmds "$postuninstall_cmds" \'test "$rmforce" = yes || exit_status=1\'\n-\t fi\n-\n-\t if test -n "$old_library"; then\n-\t # Do each command in the old_postuninstall commands.\n-\t func_execute_cmds "$old_postuninstall_cmds" \'test "$rmforce" = yes || exit_status=1\'\n-\t fi\n-\t # FIXME: should reinstall the best remaining shared library.\n-\t ;;\n-\t esac\n-\tfi\n-\t;;\n-\n- *.lo)\n-\t# Possibly a libtool object, so verify it.\n-\tif func_lalib_p "$file"; then\n-\n-\t # Read the .lo file\n-\t func_source $dir/$name\n-\n-\t # Add PIC object to the list of files to remove.\n-\t if test -n "$pic_object" &&\n-\t test "$pic_object" != none; then\n-\t rmfiles="$rmfiles $dir/$pic_object"\n-\t fi\n-\n-\t # Add non-PIC object to the list of files to remove.\n-\t if test -n "$non_pic_object" &&\n-\t test "$non_pic_object" != none; then\n-\t rmfiles="$rmfiles $dir/$non_pic_object"\n-\t fi\n-\tfi\n-\t;;\n-\n- *)\n-\tif test "$mode" = clean ; then\n-\t noexename=$name\n-\t case $file in\n-\t *.exe)\n-\t func_stripname \'\' \'.exe\' "$file"\n-\t file=$func_stripname_result\n-\t func_stripname \'\' \'.exe\' "$name"\n-\t noexename=$func_stripname_result\n-\t # $file with .exe has already been added to rmfiles,\n-\t # add $file without .exe\n-\t rmfiles="$rmfiles $file"\n-\t ;;\n-\t esac\n-\t # Do a test to see if this is a libtool program.\n-\t if func_ltwrapper_p "$file"; then\n-\t if func_ltwrapper_executable_p "$file"; then\n-\t func_ltwrapper_scriptname "$file"\n-\t relink_command=\n-\t func_source $func_ltwrapper_scriptname_result\n-\t rmfiles="$rmfiles $func_ltwrapper_scriptname_result"\n-\t else\n-\t relink_command=\n-\t func_source $dir/$noexename\n-\t fi\n-\n-\t # note $name still contains .exe if it was in $file originally\n-\t # as does the version of $file that was added into $rmfiles\n-\t rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"\n-\t if test "$fast_install" = yes && test -n "$relink_command"; then\n-\t rmfiles="$rmfiles $objdir/lt-$name"\n-\t fi\n-\t if test "X$noexename" != "X$name" ; then\n-\t rmfiles="$rmfiles $objdir/lt-${noexename}.c"\n-\t fi\n-\t fi\n-\tfi\n-\t;;\n- esac\n- func_show_eval "$RM $rmfiles" \'exit_status=1\'\n- done\n- objdir="$origobjdir"\n-\n- # Try to remove the ${objdir}s in the directories where we deleted files\n- for dir in $rmdirs; do\n- if test -d "$dir"; then\n-\tfunc_show_eval "rmdir $dir >/dev/null 2>&1"\n- fi\n- done\n-\n- exit $exit_status\n-}\n-\n-{ test "$mode" = uninstall || test "$mode" = clean; } &&\n- func_mode_uninstall ${1+"$@"}\n-\n-test -z "$mode" && {\n- help="$generic_help"\n- func_fatal_help "you must specify a MODE"\n-}\n-\n-test -z "$exec_cmd" && \\\n- func_fatal_help "invalid operation mode \\`$mode\'"\n-\n-if test -n "$exec_cmd"; then\n- eval exec "$exec_cmd"\n- exit $EXIT_FAILURE\n-fi\n-\n-exit $exit_status\n-\n-\n-# The TAGs below are defined such that we never get into a situation\n-# in which we disable both kinds of libraries. Given conflicting\n-# choices, we go for a static library, that is the most portable,\n-# since we can\'t tell whether shared libraries were disabled because\n-# the user asked for that or because the platform doesn\'t support\n-# them. This is particularly important on AIX, because we don\'t\n-# support having both static and shared libraries enabled at the same\n-# time on that platform, so we default to a shared-only configuration.\n-# If a disable-shared tag is given, we\'ll fallback to a static-only\n-# configuration. But we\'ll never go from static-only to shared-only.\n-\n-# ### BEGIN LIBTOOL TAG CONFIG: disable-shared\n-build_libtool_libs=no\n-build_old_libs=yes\n-# ### END LIBTOOL TAG CONFIG: disable-shared\n-\n-# ### BEGIN LIBTOOL TAG CONFIG: disable-static\n-build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`\n-# ### END LIBTOOL TAG CONFIG: disable-static\n-\n-# Local Variables:\n-# mode:shell-script\n-# sh-indentation:2\n-# End:\n-# vi:sw=2\n-\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/m4/ax_openmp.m4 --- a/clustalomega/clustal-omega-0.2.0/m4/ax_openmp.m4 Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,99 +0,0 @@ -# =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_openmp.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_OPENMP([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) -# -# DESCRIPTION -# -# This macro tries to find out how to compile programs that use OpenMP a -# standard API and set of compiler directives for parallel programming -# (see http://www-unix.mcs/) -# -# On success, it sets the OPENMP_CFLAGS/OPENMP_CXXFLAGS/OPENMP_F77FLAGS -# output variable to the flag (e.g. -omp) used both to compile *and* link -# OpenMP programs in the current language. -# -# NOTE: You are assumed to not only compile your program with these flags, -# but also link it with them as well. -# -# If you want to compile everything with OpenMP, you should set: -# -# CFLAGS="$CFLAGS $OPENMP_CFLAGS" -# #OR# CXXFLAGS="$CXXFLAGS $OPENMP_CXXFLAGS" -# #OR# FFLAGS="$FFLAGS $OPENMP_FFLAGS" -# -# (depending on the selected language). -# -# The user can override the default choice by setting the corresponding -# environment variable (e.g. OPENMP_CFLAGS). -# -# ACTION-IF-FOUND is a list of shell commands to run if an OpenMP flag is -# found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it is -# not found. If ACTION-IF-FOUND is not specified, the default action will -# define HAVE_OPENMP. -# -# LICENSE -# -# Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu> -# -# This program is free software: you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the -# Free Software Foundation, either version 3 of the License, or (at your -# option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -# Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see <http://www.gnu.org/licenses/>. -# -# As a special exception, the respective Autoconf Macro's copyright owner -# gives unlimited permission to copy, distribute and modify the configure -# scripts that are the output of Autoconf when processing the Macro. You -# need not follow the terms of the GNU General Public License when using -# or distributing such scripts, even though portions of the text of the -# Macro appear in them. The GNU General Public License (GPL) does govern -# all other use of the material that constitutes the Autoconf Macro. -# -# This special exception to the GPL applies to versions of the Autoconf -# Macro released by the Autoconf Archive. When you make and distribute a -# modified version of the Autoconf Macro, you may extend this special -# exception to the GPL to apply to your modified version as well. - -#serial 8 - -AC_DEFUN([AX_OPENMP], [ -AC_PREREQ(2.59) dnl for _AC_LANG_PREFIX - -AC_CACHE_CHECK([for OpenMP flag of _AC_LANG compiler], ax_cv_[]_AC_LANG_ABBREV[]_openmp, [save[]_AC_LANG_PREFIX[]FLAGS=$[]_AC_LANG_PREFIX[]FLAGS -ax_cv_[]_AC_LANG_ABBREV[]_openmp=unknown -# Flags to try: -fopenmp (gcc), -openmp (icc), -mp (SGI & PGI), -# -xopenmp (Sun), -omp (Tru64), -qsmp=omp (AIX), none -ax_openmp_flags="-fopenmp -openmp -mp -xopenmp -omp -qsmp=omp none" -if test "x$OPENMP_[]_AC_LANG_PREFIX[]FLAGS" != x; then - ax_openmp_flags="$OPENMP_[]_AC_LANG_PREFIX[]FLAGS $ax_openmp_flags" -fi -for ax_openmp_flag in $ax_openmp_flags; do - case $ax_openmp_flag in - none) []_AC_LANG_PREFIX[]FLAGS=$save[]_AC_LANG_PREFIX[] ;; - *) []_AC_LANG_PREFIX[]FLAGS="$save[]_AC_LANG_PREFIX[]FLAGS $ax_openmp_flag" ;; - esac - AC_TRY_LINK_FUNC(omp_set_num_threads, - [ax_cv_[]_AC_LANG_ABBREV[]_openmp=$ax_openmp_flag; break]) -done -[]_AC_LANG_PREFIX[]FLAGS=$save[]_AC_LANG_PREFIX[]FLAGS -]) -if test "x$ax_cv_[]_AC_LANG_ABBREV[]_openmp" = "xunknown"; then - m4_default([$2],:) -else - if test "x$ax_cv_[]_AC_LANG_ABBREV[]_openmp" != "xnone"; then - OPENMP_[]_AC_LANG_PREFIX[]FLAGS=$ax_cv_[]_AC_LANG_ABBREV[]_openmp - fi - m4_default([$1], [AC_DEFINE(HAVE_OPENMP,1,[Define if OpenMP is enabled])]) -fi -])dnl AX_OPENMP |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/m4/ax_prefix_config_h.m4 --- a/clustalomega/clustal-omega-0.2.0/m4/ax_prefix_config_h.m4 Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,209 +0,0 @@\n-# ===========================================================================\n-# http://www.gnu.org/software/autoconf-archive/ax_prefix_config_h.html\n-# ===========================================================================\n-#\n-# SYNOPSIS\n-#\n-# AX_PREFIX_CONFIG_H [(OUTPUT-HEADER [,PREFIX [,ORIG-HEADER]])]\n-#\n-# DESCRIPTION\n-#\n-# This is a new variant from ac_prefix_config_ this one will use a\n-# lowercase-prefix if the config-define was starting with a\n-# lowercase-char, e.g. "#define const", "#define restrict", or "#define\n-# off_t", (and this one can live in another directory, e.g.\n-# testpkg/config.h therefore I decided to move the output-header to be the\n-# first arg)\n-#\n-# takes the usual config.h generated header file; looks for each of the\n-# generated "#define SOMEDEF" lines, and prefixes the defined name (ie.\n-# makes it "#define PREFIX_SOMEDEF". The result is written to the output\n-# config.header file. The PREFIX is converted to uppercase for the\n-# conversions.\n-#\n-# Defaults:\n-#\n-# OUTPUT-HEADER = $PACKAGE-config.h\n-# PREFIX = $PACKAGE\n-# ORIG-HEADER, from AM_CONFIG_HEADER(config.h)\n-#\n-# Your configure.ac script should contain both macros in this order, and\n-# unlike the earlier variations of this prefix-macro it is okay to place\n-# the AX_PREFIX_CONFIG_H call before the AC_OUTPUT invokation.\n-#\n-# Example:\n-#\n-# AC_INIT(config.h.in) # config.h.in as created by "autoheader"\n-# AM_INIT_AUTOMAKE(testpkg, 0.1.1) # makes #undef VERSION and PACKAGE\n-# AM_CONFIG_HEADER(config.h) # prep config.h from config.h.in\n-# AX_PREFIX_CONFIG_H(mylib/_config.h) # prep mylib/_config.h from it..\n-# AC_MEMORY_H # makes "#undef NEED_MEMORY_H"\n-# AC_C_CONST_H # makes "#undef const"\n-# AC_OUTPUT(Makefile) # creates the "config.h" now\n-# # and also mylib/_config.h\n-#\n-# if the argument to AX_PREFIX_CONFIG_H would have been omitted then the\n-# default outputfile would have been called simply "testpkg-config.h", but\n-# even under the name "mylib/_config.h" it contains prefix-defines like\n-#\n-# #ifndef TESTPKG_VERSION\n-# #define TESTPKG_VERSION "0.1.1"\n-# #endif\n-# #ifndef TESTPKG_NEED_MEMORY_H\n-# #define TESTPKG_NEED_MEMORY_H 1\n-# #endif\n-# #ifndef _testpkg_const\n-# #define _testpkg_const _const\n-# #endif\n-#\n-# and this "mylib/_config.h" can be installed along with other\n-# header-files, which is most convenient when creating a shared library\n-# (that has some headers) where some functionality is dependent on the\n-# OS-features detected at compile-time. No need to invent some\n-# "mylib-confdefs.h.in" manually. :-)\n-#\n-# Note that some AC_DEFINEs that end up in the config.h file are actually\n-# self-referential - e.g. AC_C_INLINE, AC_C_CONST, and the AC_TYPE_OFF_T\n-# say that they "will define inline|const|off_t if the system does not do\n-# it by itself". You might want to clean up about these - consider an\n-# extra mylib/conf.h that reads something like:\n-#\n-# #include <mylib/_config.h>\n-# #ifndef _testpkg_const\n-# #define _testpkg_const const\n-# #endif\n-#\n-# and then start using _testpkg_const in the header files. That is also a\n-# good thing to differentiate whether some library-user has starting to\n-# take up with a different compiler, so perhaps it could read something\n-# like this:\n-#\n-# #ifdef _MSC_VER\n-# #include <mylib/_msvc.h>\n-# #else\n-# #include <mylib/_config.h>\n-# #endif\n-# #ifndef _testpkg_const\n-# #define _testpkg_const const\n-# #endif\n-#\n-# LICENSE\n-#\n-# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>\n-# Copyright (c) 2008 Marten Svantesson\n-# Copyright (c) 2008 Gerald Point <Gerald.Point@labri.fr>\n-#\n-# This program is free software; you can redistribute it and/or modify it\n-'..b' need not follow the terms of the GNU General Public License when using\n-# or distributing such scripts, even though portions of the text of the\n-# Macro appear in them. The GNU General Public License (GPL) does govern\n-# all other use of the material that constitutes the Autoconf Macro.\n-#\n-# This special exception to the GPL applies to versions of the Autoconf\n-# Macro released by the Autoconf Archive. When you make and distribute a\n-# modified version of the Autoconf Macro, you may extend this special\n-# exception to the GPL to apply to your modified version as well.\n-\n-#serial 11\n-\n-AC_DEFUN([AX_PREFIX_CONFIG_H],[dnl\n-AC_PREREQ([2.62])\n-AC_BEFORE([AC_CONFIG_HEADERS],[$0])dnl\n-AC_CONFIG_COMMANDS([ifelse($1,,$PACKAGE-config.h,$1)],[dnl\n-AS_VAR_PUSHDEF([_OUT],[ac_prefix_conf_OUT])dnl\n-AS_VAR_PUSHDEF([_DEF],[ac_prefix_conf_DEF])dnl\n-AS_VAR_PUSHDEF([_PKG],[ac_prefix_conf_PKG])dnl\n-AS_VAR_PUSHDEF([_LOW],[ac_prefix_conf_LOW])dnl\n-AS_VAR_PUSHDEF([_UPP],[ac_prefix_conf_UPP])dnl\n-AS_VAR_PUSHDEF([_INP],[ac_prefix_conf_INP])dnl\n-m4_pushdef([_script],[conftest.prefix])dnl\n-m4_pushdef([_symbol],[m4_cr_Letters[]m4_cr_digits[]_])dnl\n-_OUT=`echo ifelse($1, , $PACKAGE-config.h, $1)`\n-_DEF=`echo _$_OUT | sed -e "y:m4_cr_letters:m4_cr_LETTERS[]:" -e "s/@<:@^m4_cr_Letters@:>@/_/g"`\n-_PKG=`echo ifelse($2, , $PACKAGE, $2)`\n-_LOW=`echo _$_PKG | sed -e "y:m4_cr_LETTERS-:m4_cr_letters[]_:"`\n-_UPP=`echo $_PKG | sed -e "y:m4_cr_letters-:m4_cr_LETTERS[]_:" -e "/^@<:@m4_cr_digits@:>@/s/^/_/"`\n-_INP=`echo "ifelse($3,,,$3)" | sed -e \'s/ *//\'`\n-if test ".$_INP" = "."; then\n- for ac_file in : $CONFIG_HEADERS; do test "_$ac_file" = _: && continue\n- case "$ac_file" in\n- *.h) _INP=$ac_file ;;\n- *)\n- esac\n- test ".$_INP" != "." && break\n- done\n-fi\n-if test ".$_INP" = "."; then\n- case "$_OUT" in\n- */*) _INP=`basename "$_OUT"`\n- ;;\n- *-*) _INP=`echo "$_OUT" | sed -e "s/@<:@_symbol@:>@*-//"`\n- ;;\n- *) _INP=config.h\n- ;;\n- esac\n-fi\n-if test -z "$_PKG" ; then\n- AC_MSG_ERROR([no prefix for _PREFIX_PKG_CONFIG_H])\n-else\n- if test ! -f "$_INP" ; then if test -f "$srcdir/$_INP" ; then\n- _INP="$srcdir/$_INP"\n- fi fi\n- AC_MSG_NOTICE(creating $_OUT - prefix $_UPP for $_INP defines)\n- if test -f $_INP ; then\n- AS_ECHO(["s/^@%:@undef *\\\\(@<:@m4_cr_LETTERS[]_@:>@\\\\)/@%:@undef $_UPP""_\\\\1/"]) > _script\n- AS_ECHO(["s/^@%:@undef *\\\\(@<:@m4_cr_letters@:>@\\\\)/@%:@undef $_LOW""_\\\\1/"]) >> _script\n- AS_ECHO(["s/^@%:@def[]ine *\\\\(@<:@m4_cr_LETTERS[]_@:>@@<:@_symbol@:>@*\\\\)\\\\(.*\\\\)/@%:@ifndef $_UPP""_\\\\1\\\\"]) >> _script\n- AS_ECHO(["@%:@def[]ine $_UPP""_\\\\1\\\\2\\\\"]) >> _script\n- AS_ECHO(["@%:@endif/"]) >> _script\n- AS_ECHO(["s/^@%:@def[]ine *\\\\(@<:@m4_cr_letters@:>@@<:@_symbol@:>@*\\\\)\\\\(.*\\\\)/@%:@ifndef $_LOW""_\\\\1\\\\"]) >> _script\n- AS_ECHO(["@%:@define $_LOW""_\\\\1\\\\2\\\\"]) >> _script\n- AS_ECHO(["@%:@endif/"]) >> _script\n- # now executing _script on _DEF input to create _OUT output file\n- echo "@%:@ifndef $_DEF" >$tmp/pconfig.h\n- echo "@%:@def[]ine $_DEF 1" >>$tmp/pconfig.h\n- echo \' \' >>$tmp/pconfig.h\n- echo /\'*\' $_OUT. Generated automatically at end of configure. \'*\'/ >>$tmp/pconfig.h\n-\n- sed -f _script $_INP >>$tmp/pconfig.h\n- echo \' \' >>$tmp/pconfig.h\n- echo \'/* once:\' $_DEF \'*/\' >>$tmp/pconfig.h\n- echo "@%:@endif" >>$tmp/pconfig.h\n- if cmp -s $_OUT $tmp/pconfig.h 2>/dev/null; then\n- AC_MSG_NOTICE([$_OUT is unchanged])\n- else\n- ac_dir=`AS_DIRNAME(["$_OUT"])`\n- AS_MKDIR_P(["$ac_dir"])\n- rm -f "$_OUT"\n- mv $tmp/pconfig.h "$_OUT"\n- fi\n- cp _script _configs.sed\n- else\n- AC_MSG_ERROR([input file $_INP does not exist - skip generating $_OUT])\n- fi\n- rm -f conftest.*\n-fi\n-m4_popdef([_symbol])dnl\n-m4_popdef([_script])dnl\n-AS_VAR_POPDEF([_INP])dnl\n-AS_VAR_POPDEF([_UPP])dnl\n-AS_VAR_POPDEF([_LOW])dnl\n-AS_VAR_POPDEF([_PKG])dnl\n-AS_VAR_POPDEF([_DEF])dnl\n-AS_VAR_POPDEF([_OUT])dnl\n-],[PACKAGE="$PACKAGE"])])\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/m4/libtool.m4 --- a/clustalomega/clustal-omega-0.2.0/m4/libtool.m4 Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,7377 +0,0 @@\n-# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-\n-#\n-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,\n-# 2006, 2007, 2008 Free Software Foundation, Inc.\n-# Written by Gordon Matzigkeit, 1996\n-#\n-# This file is free software; the Free Software Foundation gives\n-# unlimited permission to copy and/or distribute it, with or without\n-# modifications, as long as this notice is preserved.\n-\n-m4_define([_LT_COPYING], [dnl\n-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,\n-# 2006, 2007, 2008 Free Software Foundation, Inc.\n-# Written by Gordon Matzigkeit, 1996\n-#\n-# This file is part of GNU Libtool.\n-#\n-# GNU Libtool is free software; you can redistribute it and/or\n-# modify it under the terms of the GNU General Public License as\n-# published by the Free Software Foundation; either version 2 of\n-# the License, or (at your option) any later version.\n-#\n-# As a special exception to the GNU General Public License,\n-# if you distribute this file as part of a program or library that\n-# is built using GNU Libtool, you may include this file under the\n-# same distribution terms that you use for the rest of that program.\n-#\n-# GNU Libtool is distributed in the hope that it will be useful,\n-# but WITHOUT ANY WARRANTY; without even the implied warranty of\n-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n-# GNU General Public License for more details.\n-#\n-# You should have received a copy of the GNU General Public License\n-# along with GNU Libtool; see the file COPYING. If not, a copy\n-# can be downloaded from http://www.gnu.org/licenses/gpl.html, or\n-# obtained by writing to the Free Software Foundation, Inc.,\n-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\n-])\n-\n-# serial 56 LT_INIT\n-\n-\n-# LT_PREREQ(VERSION)\n-# ------------------\n-# Complain and exit if this libtool version is less that VERSION.\n-m4_defun([LT_PREREQ],\n-[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,\n- [m4_default([$3],\n-\t\t [m4_fatal([Libtool version $1 or higher is required],\n-\t\t 63)])],\n- [$2])])\n-\n-\n-# _LT_CHECK_BUILDDIR\n-# ------------------\n-# Complain if the absolute build directory name contains unusual characters\n-m4_defun([_LT_CHECK_BUILDDIR],\n-[case `pwd` in\n- *\\ * | *\\\t*)\n- AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;\n-esac\n-])\n-\n-\n-# LT_INIT([OPTIONS])\n-# ------------------\n-AC_DEFUN([LT_INIT],\n-[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT\n-AC_BEFORE([$0], [LT_LANG])dnl\n-AC_BEFORE([$0], [LT_OUTPUT])dnl\n-AC_BEFORE([$0], [LTDL_INIT])dnl\n-m4_require([_LT_CHECK_BUILDDIR])dnl\n-\n-dnl Autoconf doesn\'t catch unexpanded LT_ macros by default:\n-m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl\n-m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl\n-dnl aclocal doesn\'t pull ltoptions.m4, ltsugar.m4, or ltversion.m4\n-dnl unless we require an AC_DEFUNed macro:\n-AC_REQUIRE([LTOPTIONS_VERSION])dnl\n-AC_REQUIRE([LTSUGAR_VERSION])dnl\n-AC_REQUIRE([LTVERSION_VERSION])dnl\n-AC_REQUIRE([LTOBSOLETE_VERSION])dnl\n-m4_require([_LT_PROG_LTMAIN])dnl\n-\n-dnl Parse OPTIONS\n-_LT_SET_OPTIONS([$0], [$1])\n-\n-# This can be used to rebuild libtool when needed\n-LIBTOOL_DEPS="$ltmain"\n-\n-# Always use our own libtool.\n-LIBTOOL=\'$(SHELL) $(top_builddir)/libtool\'\n-AC_SUBST(LIBTOOL)dnl\n-\n-_LT_SETUP\n-\n-# Only expand once:\n-m4_define([LT_INIT])\n-])# LT_INIT\n-\n-# Old names:\n-AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])\n-AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])\n-dnl aclocal-1.4 backwards compatibility:\n-dnl AC_DEFUN([AC_PROG_LIBTOOL], [])\n-dnl AC_DEFUN([AM_PROG_LIBTOOL], [])\n-\n-\n-# _LT_CC_BASENAME(CC)\n-# -------------------\n-# Calculate cc_basename. Skip known compiler wrappers and cross-prefix.\n-m4_defun([_LT_CC_BASENAME],\n-[for cc_temp in $1""; do\n- case $cc_temp in\n- compile | *[[\\\\/]]compile | ccache | *[[\\\\/]]ccache ) ;;\n- distcc | *[[\\\\/]]distcc | purify | *[[\\\\/'..b'me_result"\n-# Implementation must be kept synchronized with func_dirname\n-# and func_basename. For efficiency, we do not delegate to\n-# those functions but instead duplicate the functionality here.\n-func_dirname_and_basename ()\n-{\n- case ${1} in\n- */*) func_dirname_result="${1%/*}${2}" ;;\n- * ) func_dirname_result="${3}" ;;\n- esac\n- func_basename_result="${1##*/}"\n-}\n-\n-# func_stripname prefix suffix name\n-# strip PREFIX and SUFFIX off of NAME.\n-# PREFIX and SUFFIX must not contain globbing or regex special\n-# characters, hashes, percent signs, but SUFFIX may contain a leading\n-# dot (in which case that matches only a dot).\n-func_stripname ()\n-{\n- # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\n- # positional parameters, so assign one to ordinary parameter first.\n- func_stripname_result=${3}\n- func_stripname_result=${func_stripname_result#"${1}"}\n- func_stripname_result=${func_stripname_result%"${2}"}\n-}\n-\n-# func_opt_split\n-func_opt_split ()\n-{\n- func_opt_split_opt=${1%%=*}\n- func_opt_split_arg=${1#*=}\n-}\n-\n-# func_lo2o object\n-func_lo2o ()\n-{\n- case ${1} in\n- *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\n- *) func_lo2o_result=${1} ;;\n- esac\n-}\n-\n-# func_xform libobj-or-source\n-func_xform ()\n-{\n- func_xform_result=${1%.*}.lo\n-}\n-\n-# func_arith arithmetic-term...\n-func_arith ()\n-{\n- func_arith_result=$(( $[*] ))\n-}\n-\n-# func_len string\n-# STRING may not start with a hyphen.\n-func_len ()\n-{\n- func_len_result=${#1}\n-}\n-\n-_LT_EOF\n- ;;\n- *) # Bourne compatible functions.\n- cat << \\_LT_EOF >> "$cfgfile"\n-\n-# func_dirname file append nondir_replacement\n-# Compute the dirname of FILE. If nonempty, add APPEND to the result,\n-# otherwise set result to NONDIR_REPLACEMENT.\n-func_dirname ()\n-{\n- # Extract subdirectory from the argument.\n- func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`\n- if test "X$func_dirname_result" = "X${1}"; then\n- func_dirname_result="${3}"\n- else\n- func_dirname_result="$func_dirname_result${2}"\n- fi\n-}\n-\n-# func_basename file\n-func_basename ()\n-{\n- func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`\n-}\n-\n-dnl func_dirname_and_basename\n-dnl A portable version of this function is already defined in general.m4sh\n-dnl so there is no need for it here.\n-\n-# func_stripname prefix suffix name\n-# strip PREFIX and SUFFIX off of NAME.\n-# PREFIX and SUFFIX must not contain globbing or regex special\n-# characters, hashes, percent signs, but SUFFIX may contain a leading\n-# dot (in which case that matches only a dot).\n-# func_strip_suffix prefix name\n-func_stripname ()\n-{\n- case ${2} in\n- .*) func_stripname_result=`$ECHO "X${3}" \\\n- | $Xsed -e "s%^${1}%%" -e "s%\\\\\\\\${2}\\$%%"`;;\n- *) func_stripname_result=`$ECHO "X${3}" \\\n- | $Xsed -e "s%^${1}%%" -e "s%${2}\\$%%"`;;\n- esac\n-}\n-\n-# sed scripts:\n-my_sed_long_opt=\'1s/^\\(-[[^=]]*\\)=.*/\\1/;q\'\n-my_sed_long_arg=\'1s/^-[[^=]]*=//\'\n-\n-# func_opt_split\n-func_opt_split ()\n-{\n- func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"`\n- func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"`\n-}\n-\n-# func_lo2o object\n-func_lo2o ()\n-{\n- func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"`\n-}\n-\n-# func_xform libobj-or-source\n-func_xform ()\n-{\n- func_xform_result=`$ECHO "X${1}" | $Xsed -e \'s/\\.[[^.]]*$/.lo/\'`\n-}\n-\n-# func_arith arithmetic-term...\n-func_arith ()\n-{\n- func_arith_result=`expr "$[@]"`\n-}\n-\n-# func_len string\n-# STRING may not start with a hyphen.\n-func_len ()\n-{\n- func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len`\n-}\n-\n-_LT_EOF\n-esac\n-\n-case $lt_shell_append in\n- yes)\n- cat << \\_LT_EOF >> "$cfgfile"\n-\n-# func_append var value\n-# Append VALUE to the end of shell variable VAR.\n-func_append ()\n-{\n- eval "$[1]+=\\$[2]"\n-}\n-_LT_EOF\n- ;;\n- *)\n- cat << \\_LT_EOF >> "$cfgfile"\n-\n-# func_append var value\n-# Append VALUE to the end of shell variable VAR.\n-func_append ()\n-{\n- eval "$[1]=\\$$[1]\\$[2]"\n-}\n-\n-_LT_EOF\n- ;;\n- esac\n-])\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/m4/ltoptions.m4 --- a/clustalomega/clustal-omega-0.2.0/m4/ltoptions.m4 Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b"@@ -1,368 +0,0 @@\n-# Helper functions for option handling. -*- Autoconf -*-\n-#\n-# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.\n-# Written by Gary V. Vaughan, 2004\n-#\n-# This file is free software; the Free Software Foundation gives\n-# unlimited permission to copy and/or distribute it, with or without\n-# modifications, as long as this notice is preserved.\n-\n-# serial 6 ltoptions.m4\n-\n-# This is to help aclocal find these macros, as it can't see m4_define.\n-AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])\n-\n-\n-# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)\n-# ------------------------------------------\n-m4_define([_LT_MANGLE_OPTION],\n-[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])\n-\n-\n-# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)\n-# ---------------------------------------\n-# Set option OPTION-NAME for macro MACRO-NAME, and if there is a\n-# matching handler defined, dispatch to it. Other OPTION-NAMEs are\n-# saved as a flag.\n-m4_define([_LT_SET_OPTION],\n-[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl\n-m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),\n- _LT_MANGLE_DEFUN([$1], [$2]),\n- [m4_warning([Unknown $1 option `$2'])])[]dnl\n-])\n-\n-\n-# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])\n-# ------------------------------------------------------------\n-# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.\n-m4_define([_LT_IF_OPTION],\n-[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])\n-\n-\n-# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)\n-# -------------------------------------------------------\n-# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME\n-# are set.\n-m4_define([_LT_UNLESS_OPTIONS],\n-[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),\n-\t [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),\n-\t\t [m4_define([$0_found])])])[]dnl\n-m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3\n-])[]dnl\n-])\n-\n-\n-# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)\n-# ----------------------------------------\n-# OPTION-LIST is a space-separated list of Libtool options associated\n-# with MACRO-NAME. If any OPTION has a matching handler declared with\n-# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about\n-# the unknown option and exit.\n-m4_defun([_LT_SET_OPTIONS],\n-[# Set options\n-m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),\n- [_LT_SET_OPTION([$1], _LT_Option)])\n-\n-m4_if([$1],[LT_INIT],[\n- dnl\n- dnl Simply set some default values (i.e off) if boolean options were not\n- dnl specified:\n- _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no\n- ])\n- _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no\n- ])\n- dnl\n- dnl If no reference was made to various pairs of opposing options, then\n- dnl we run the default mode handler for the pair. For example, if neither\n- dnl `shared' nor `disable-shared' was passed, we enable building of shared\n- dnl archives by default:\n- _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])\n- _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])\n- _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])\n- _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],\n- \t\t [_LT_ENABLE_FAST_INSTALL])\n- ])\n-])# _LT_SET_OPTIONS\n-\n-\n-## --------------------------------- ##\n-## Macros to handle LT_INIT options. ##\n-## --------------------------------- ##\n-\n-# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)\n-# -----------------------------------------\n-m4_define([_LT_MANGLE_DEFUN],\n-[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])\n-\n-\n-# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)\n-# -----------------------------------------------\n-m4_define([LT_OPTION_DEFINE],\n-[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl\n-])# LT_OPTION_DEFINE\n-\n-\n-# dlopen\n-# ------\n-LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes\n-])\n-\n-AU_DEFUN([AC_LIBTOOL_DLOPEN],\n-[_LT_SET_OPTION([LT_INIT], [dlopen])\n-AC_DIAGNOSE("..b'TIC],\n-[_LT_SET_OPTION([LT_INIT], [disable-static])\n-])\n-\n-AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])\n-AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])\n-\n-dnl aclocal-1.4 backwards compatibility:\n-dnl AC_DEFUN([AM_ENABLE_STATIC], [])\n-dnl AC_DEFUN([AM_DISABLE_STATIC], [])\n-\n-\n-\n-# _LT_ENABLE_FAST_INSTALL([DEFAULT])\n-# ----------------------------------\n-# implement the --enable-fast-install flag, and support the `fast-install\'\n-# and `disable-fast-install\' LT_INIT options.\n-# DEFAULT is either `yes\' or `no\'. If omitted, it defaults to `yes\'.\n-m4_define([_LT_ENABLE_FAST_INSTALL],\n-[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl\n-AC_ARG_ENABLE([fast-install],\n- [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],\n- [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],\n- [p=${PACKAGE-default}\n- case $enableval in\n- yes) enable_fast_install=yes ;;\n- no) enable_fast_install=no ;;\n- *)\n- enable_fast_install=no\n- # Look at the argument we got. We use all the common list separators.\n- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"\n- for pkg in $enableval; do\n-\tIFS="$lt_save_ifs"\n-\tif test "X$pkg" = "X$p"; then\n-\t enable_fast_install=yes\n-\tfi\n- done\n- IFS="$lt_save_ifs"\n- ;;\n- esac],\n- [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)\n-\n-_LT_DECL([fast_install], [enable_fast_install], [0],\n-\t [Whether or not to optimize for fast installation])dnl\n-])# _LT_ENABLE_FAST_INSTALL\n-\n-LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])\n-LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])\n-\n-# Old names:\n-AU_DEFUN([AC_ENABLE_FAST_INSTALL],\n-[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])\n-AC_DIAGNOSE([obsolete],\n-[$0: Remove this warning and the call to _LT_SET_OPTION when you put\n-the `fast-install\' option into LT_INIT\'s first parameter.])\n-])\n-\n-AU_DEFUN([AC_DISABLE_FAST_INSTALL],\n-[_LT_SET_OPTION([LT_INIT], [disable-fast-install])\n-AC_DIAGNOSE([obsolete],\n-[$0: Remove this warning and the call to _LT_SET_OPTION when you put\n-the `disable-fast-install\' option into LT_INIT\'s first parameter.])\n-])\n-\n-dnl aclocal-1.4 backwards compatibility:\n-dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])\n-dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])\n-\n-\n-# _LT_WITH_PIC([MODE])\n-# --------------------\n-# implement the --with-pic flag, and support the `pic-only\' and `no-pic\'\n-# LT_INIT options.\n-# MODE is either `yes\' or `no\'. If omitted, it defaults to `both\'.\n-m4_define([_LT_WITH_PIC],\n-[AC_ARG_WITH([pic],\n- [AS_HELP_STRING([--with-pic],\n-\t[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],\n- [pic_mode="$withval"],\n- [pic_mode=default])\n-\n-test -z "$pic_mode" && pic_mode=m4_default([$1], [default])\n-\n-_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl\n-])# _LT_WITH_PIC\n-\n-LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])\n-LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])\n-\n-# Old name:\n-AU_DEFUN([AC_LIBTOOL_PICMODE],\n-[_LT_SET_OPTION([LT_INIT], [pic-only])\n-AC_DIAGNOSE([obsolete],\n-[$0: Remove this warning and the call to _LT_SET_OPTION when you\n-put the `pic-only\' option into LT_INIT\'s first parameter.])\n-])\n-\n-dnl aclocal-1.4 backwards compatibility:\n-dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])\n-\n-## ----------------- ##\n-## LTDL_INIT Options ##\n-## ----------------- ##\n-\n-m4_define([_LTDL_MODE], [])\n-LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],\n-\t\t [m4_define([_LTDL_MODE], [nonrecursive])])\n-LT_OPTION_DEFINE([LTDL_INIT], [recursive],\n-\t\t [m4_define([_LTDL_MODE], [recursive])])\n-LT_OPTION_DEFINE([LTDL_INIT], [subproject],\n-\t\t [m4_define([_LTDL_MODE], [subproject])])\n-\n-m4_define([_LTDL_TYPE], [])\n-LT_OPTION_DEFINE([LTDL_INIT], [installable],\n-\t\t [m4_define([_LTDL_TYPE], [installable])])\n-LT_OPTION_DEFINE([LTDL_INIT], [convenience],\n-\t\t [m4_define([_LTDL_TYPE], [convenience])])\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/m4/ltsugar.m4 --- a/clustalomega/clustal-omega-0.2.0/m4/ltsugar.m4 Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,123 +0,0 @@ -# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- -# -# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. -# Written by Gary V. Vaughan, 2004 -# -# This file is free software; the Free Software Foundation gives -# unlimited permission to copy and/or distribute it, with or without -# modifications, as long as this notice is preserved. - -# serial 6 ltsugar.m4 - -# This is to help aclocal find these macros, as it can't see m4_define. -AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) - - -# lt_join(SEP, ARG1, [ARG2...]) -# ----------------------------- -# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their -# associated separator. -# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier -# versions in m4sugar had bugs. -m4_define([lt_join], -[m4_if([$#], [1], [], - [$#], [2], [[$2]], - [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) -m4_define([_lt_join], -[m4_if([$#$2], [2], [], - [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) - - -# lt_car(LIST) -# lt_cdr(LIST) -# ------------ -# Manipulate m4 lists. -# These macros are necessary as long as will still need to support -# Autoconf-2.59 which quotes differently. -m4_define([lt_car], [[$1]]) -m4_define([lt_cdr], -[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], - [$#], 1, [], - [m4_dquote(m4_shift($@))])]) -m4_define([lt_unquote], $1) - - -# lt_append(MACRO-NAME, STRING, [SEPARATOR]) -# ------------------------------------------ -# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. -# Note that neither SEPARATOR nor STRING are expanded; they are appended -# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). -# No SEPARATOR is output if MACRO-NAME was previously undefined (different -# than defined and empty). -# -# This macro is needed until we can rely on Autoconf 2.62, since earlier -# versions of m4sugar mistakenly expanded SEPARATOR but not STRING. -m4_define([lt_append], -[m4_define([$1], - m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) - - - -# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) -# ---------------------------------------------------------- -# Produce a SEP delimited list of all paired combinations of elements of -# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list -# has the form PREFIXmINFIXSUFFIXn. -# Needed until we can rely on m4_combine added in Autoconf 2.62. -m4_define([lt_combine], -[m4_if(m4_eval([$# > 3]), [1], - [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl -[[m4_foreach([_Lt_prefix], [$2], - [m4_foreach([_Lt_suffix], - ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, - [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) - - -# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) -# ----------------------------------------------------------------------- -# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited -# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. -m4_define([lt_if_append_uniq], -[m4_ifdef([$1], - [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], - [lt_append([$1], [$2], [$3])$4], - [$5])], - [lt_append([$1], [$2], [$3])$4])]) - - -# lt_dict_add(DICT, KEY, VALUE) -# ----------------------------- -m4_define([lt_dict_add], -[m4_define([$1($2)], [$3])]) - - -# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) -# -------------------------------------------- -m4_define([lt_dict_add_subkey], -[m4_define([$1($2:$3)], [$4])]) - - -# lt_dict_fetch(DICT, KEY, [SUBKEY]) -# ---------------------------------- -m4_define([lt_dict_fetch], -[m4_ifval([$3], - m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), - m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) - - -# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) -# ----------------------------------------------------------------- -m4_define([lt_if_dict_fetch], -[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], - [$5], - [$6])]) - - -# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) -# -------------------------------------------------------------- -m4_define([lt_dict_filter], -[m4_if([$5], [], [], - [lt_join(m4_quote(m4_default([$4], [[, ]])), - lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), - [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl -]) |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/m4/ltversion.m4 --- a/clustalomega/clustal-omega-0.2.0/m4/ltversion.m4 Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,23 +0,0 @@ -# ltversion.m4 -- version numbers -*- Autoconf -*- -# -# Copyright (C) 2004 Free Software Foundation, Inc. -# Written by Scott James Remnant, 2004 -# -# This file is free software; the Free Software Foundation gives -# unlimited permission to copy and/or distribute it, with or without -# modifications, as long as this notice is preserved. - -# Generated from ltversion.in. - -# serial 3017 ltversion.m4 -# This file is part of GNU Libtool - -m4_define([LT_PACKAGE_VERSION], [2.2.6b]) -m4_define([LT_PACKAGE_REVISION], [1.3017]) - -AC_DEFUN([LTVERSION_VERSION], -[macro_version='2.2.6b' -macro_revision='1.3017' -_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) -_LT_DECL(, macro_revision, 0) -]) |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/m4/lt~obsolete.m4 --- a/clustalomega/clustal-omega-0.2.0/m4/lt~obsolete.m4 Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,92 +0,0 @@ -# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- -# -# Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc. -# Written by Scott James Remnant, 2004. -# -# This file is free software; the Free Software Foundation gives -# unlimited permission to copy and/or distribute it, with or without -# modifications, as long as this notice is preserved. - -# serial 4 lt~obsolete.m4 - -# These exist entirely to fool aclocal when bootstrapping libtool. -# -# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) -# which have later been changed to m4_define as they aren't part of the -# exported API, or moved to Autoconf or Automake where they belong. -# -# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN -# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us -# using a macro with the same name in our local m4/libtool.m4 it'll -# pull the old libtool.m4 in (it doesn't see our shiny new m4_define -# and doesn't know about Autoconf macros at all.) -# -# So we provide this file, which has a silly filename so it's always -# included after everything else. This provides aclocal with the -# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything -# because those macros already exist, or will be overwritten later. -# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. -# -# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. -# Yes, that means every name once taken will need to remain here until -# we give up compatibility with versions before 1.7, at which point -# we need to keep only those names which we still refer to. - -# This is to help aclocal find these macros, as it can't see m4_define. -AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) - -m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) -m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) -m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) -m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) -m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) -m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) -m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) -m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) -m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) -m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) -m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) -m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) -m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) -m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) -m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) -m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) -m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) -m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) -m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) -m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) -m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) -m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) -m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) -m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) -m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) -m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) -m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) -m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) -m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) -m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) -m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) -m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) -m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) -m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) -m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) -m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) -m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) -m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) -m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) -m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) -m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) -m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) -m4_ifndef([AC_LIBTOOL_RC], [AC_DEFUN([AC_LIBTOOL_RC])]) -m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) -m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) -m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) -m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) -m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) -m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) -m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) -m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) -m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) -m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) -m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) -m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/missing --- a/clustalomega/clustal-omega-0.2.0/missing Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,376 +0,0 @@\n-#! /bin/sh\n-# Common stub for a few missing GNU programs while installing.\n-\n-scriptversion=2009-04-28.21; # UTC\n-\n-# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,\n-# 2008, 2009 Free Software Foundation, Inc.\n-# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.\n-\n-# This program is free software; you can redistribute it and/or modify\n-# it under the terms of the GNU General Public License as published by\n-# the Free Software Foundation; either version 2, or (at your option)\n-# any later version.\n-\n-# This program is distributed in the hope that it will be useful,\n-# but WITHOUT ANY WARRANTY; without even the implied warranty of\n-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n-# GNU General Public License for more details.\n-\n-# You should have received a copy of the GNU General Public License\n-# along with this program. If not, see <http://www.gnu.org/licenses/>.\n-\n-# As a special exception to the GNU General Public License, if you\n-# distribute this file as part of a program that contains a\n-# configuration script generated by Autoconf, you may include it under\n-# the same distribution terms that you use for the rest of that program.\n-\n-if test $# -eq 0; then\n- echo 1>&2 "Try \\`$0 --help\' for more information"\n- exit 1\n-fi\n-\n-run=:\n-sed_output=\'s/.* --output[ =]\\([^ ]*\\).*/\\1/p\'\n-sed_minuso=\'s/.* -o \\([^ ]*\\).*/\\1/p\'\n-\n-# In the cases where this matters, `missing\' is being run in the\n-# srcdir already.\n-if test -f configure.ac; then\n- configure_ac=configure.ac\n-else\n- configure_ac=configure.in\n-fi\n-\n-msg="missing on your system"\n-\n-case $1 in\n---run)\n- # Try to run requested program, and just exit if it succeeds.\n- run=\n- shift\n- "$@" && exit 0\n- # Exit code 63 means version mismatch. This often happens\n- # when the user try to use an ancient version of a tool on\n- # a file that requires a minimum version. In this case we\n- # we should proceed has if the program had been absent, or\n- # if --run hadn\'t been passed.\n- if test $? = 63; then\n- run=:\n- msg="probably too old"\n- fi\n- ;;\n-\n- -h|--h|--he|--hel|--help)\n- echo "\\\n-$0 [OPTION]... PROGRAM [ARGUMENT]...\n-\n-Handle \\`PROGRAM [ARGUMENT]...\' for when PROGRAM is missing, or return an\n-error status if there is no known handling for PROGRAM.\n-\n-Options:\n- -h, --help display this help and exit\n- -v, --version output version information and exit\n- --run try to run the given command, and emulate it if it fails\n-\n-Supported PROGRAM values:\n- aclocal touch file \\`aclocal.m4\'\n- autoconf touch file \\`configure\'\n- autoheader touch file \\`config.h.in\'\n- autom4te touch the output file, or create a stub one\n- automake touch all \\`Makefile.in\' files\n- bison create \\`y.tab.[ch]\', if possible, from existing .[ch]\n- flex create \\`lex.yy.c\', if possible, from existing .c\n- help2man touch the output file\n- lex create \\`lex.yy.c\', if possible, from existing .c\n- makeinfo touch the output file\n- tar try tar, gnutar, gtar, then tar without non-portable flags\n- yacc create \\`y.tab.[ch]\', if possible, from existing .[ch]\n-\n-Version suffixes to PROGRAM as well as the prefixes \\`gnu-\', \\`gnu\', and\n-\\`g\' are ignored when checking the name.\n-\n-Send bug reports to <bug-automake@gnu.org>."\n- exit $?\n- ;;\n-\n- -v|--v|--ve|--ver|--vers|--versi|--versio|--version)\n- echo "missing $scriptversion (GNU Automake)"\n- exit $?\n- ;;\n-\n- -*)\n- echo 1>&2 "$0: Unknown \\`$1\' option"\n- echo 1>&2 "Try \\`$0 --help\' for more information"\n- exit 1\n- ;;\n-\n-esac\n-\n-# normalize program name to check for.\n-program=`echo "$1" | sed \'\n- s/^gnu-//; t\n- s/^gnu//; t\n- s/^g//; t\'`\n-\n-# Now exit if we have it, but it failed. Also exit now if we\n-# don\'t have it and --version was passed (most likely to detect\n-# the program). This is about non-GNU programs, so use $1 not\n-# $program.\n-case $1 in\n- lex*|yacc*'..b' if test ! -f y.tab.c; then\n-\techo \'main() { return 0; }\' >y.tab.c\n- fi\n- ;;\n-\n- lex*|flex*)\n- echo 1>&2 "\\\n-WARNING: \\`$1\' is $msg. You should only need it if\n- you modified a \\`.l\' file. You may need the \\`Flex\' package\n- in order for those modifications to take effect. You can get\n- \\`Flex\' from any GNU archive site."\n- rm -f lex.yy.c\n- if test $# -ne 1; then\n- eval LASTARG="\\${$#}"\n-\tcase $LASTARG in\n-\t*.l)\n-\t SRCFILE=`echo "$LASTARG" | sed \'s/l$/c/\'`\n-\t if test -f "$SRCFILE"; then\n-\t cp "$SRCFILE" lex.yy.c\n-\t fi\n-\t ;;\n-\tesac\n- fi\n- if test ! -f lex.yy.c; then\n-\techo \'main() { return 0; }\' >lex.yy.c\n- fi\n- ;;\n-\n- help2man*)\n- echo 1>&2 "\\\n-WARNING: \\`$1\' is $msg. You should only need it if\n-\t you modified a dependency of a manual page. You may need the\n-\t \\`Help2man\' package in order for those modifications to take\n-\t effect. You can get \\`Help2man\' from any GNU archive site."\n-\n- file=`echo "$*" | sed -n "$sed_output"`\n- test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`\n- if test -f "$file"; then\n-\ttouch $file\n- else\n-\ttest -z "$file" || exec >$file\n-\techo ".ab help2man is required to generate this page"\n-\texit $?\n- fi\n- ;;\n-\n- makeinfo*)\n- echo 1>&2 "\\\n-WARNING: \\`$1\' is $msg. You should only need it if\n- you modified a \\`.texi\' or \\`.texinfo\' file, or any other file\n- indirectly affecting the aspect of the manual. The spurious\n- call might also be the consequence of using a buggy \\`make\' (AIX,\n- DU, IRIX). You might want to install the \\`Texinfo\' package or\n- the \\`GNU make\' package. Grab either from any GNU archive site."\n- # The file to touch is that specified with -o ...\n- file=`echo "$*" | sed -n "$sed_output"`\n- test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`\n- if test -z "$file"; then\n- # ... or it is the one specified with @setfilename ...\n- infile=`echo "$*" | sed \'s/.* \\([^ ]*\\) *$/\\1/\'`\n- file=`sed -n \'\n-\t/^@setfilename/{\n-\t s/.* \\([^ ]*\\) *$/\\1/\n-\t p\n-\t q\n-\t}\' $infile`\n- # ... or it is derived from the source name (dir/f.texi becomes f.info)\n- test -z "$file" && file=`echo "$infile" | sed \'s,.*/,,;s,.[^.]*$,,\'`.info\n- fi\n- # If the file does not exist, the user really needs makeinfo;\n- # let\'s fail without touching anything.\n- test -f $file || exit 1\n- touch $file\n- ;;\n-\n- tar*)\n- shift\n-\n- # We have already tried tar in the generic part.\n- # Look for gnutar/gtar before invocation to avoid ugly error\n- # messages.\n- if (gnutar --version > /dev/null 2>&1); then\n- gnutar "$@" && exit 0\n- fi\n- if (gtar --version > /dev/null 2>&1); then\n- gtar "$@" && exit 0\n- fi\n- firstarg="$1"\n- if shift; then\n-\tcase $firstarg in\n-\t*o*)\n-\t firstarg=`echo "$firstarg" | sed s/o//`\n-\t tar "$firstarg" "$@" && exit 0\n-\t ;;\n-\tesac\n-\tcase $firstarg in\n-\t*h*)\n-\t firstarg=`echo "$firstarg" | sed s/h//`\n-\t tar "$firstarg" "$@" && exit 0\n-\t ;;\n-\tesac\n- fi\n-\n- echo 1>&2 "\\\n-WARNING: I can\'t seem to be able to run \\`tar\' with the given arguments.\n- You may want to install GNU tar or Free paxutils, or check the\n- command line arguments."\n- exit 1\n- ;;\n-\n- *)\n- echo 1>&2 "\\\n-WARNING: \\`$1\' is needed, and is $msg.\n- You might have modified some files without having the\n- proper tools for further handling them. Check the \\`README\' file,\n- it often tells you about the needed prerequisites for installing\n- this package. You may also peek at any GNU archive site, in case\n- some other package would contain this missing \\`$1\' program."\n- exit 1\n- ;;\n-esac\n-\n-exit 0\n-\n-# Local variables:\n-# eval: (add-hook \'write-file-hooks \'time-stamp)\n-# time-stamp-start: "scriptversion="\n-# time-stamp-format: "%:y-%02m-%02d.%02H"\n-# time-stamp-time-zone: "UTC"\n-# time-stamp-end: "; # UTC"\n-# End:\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/Makefile.am --- a/clustalomega/clustal-omega-0.2.0/src/Makefile.am Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,31 +0,0 @@ -EXTRA_DIST = clustalo-api-test.c - -SUBDIRS = hhalign squid kmpp clustal - -AM_LDFLAGS = @AM_LDFLAGS@ -AM_CXXFLAGS = @AM_CXXFLAGS@ @OPENMP_CXXFLAGS@ -AM_CFLAGS = @AM_CFLAGS@ @OPENMP_CFLAGS@ - - -# the following is the clustalo convenience library which wraps all -# the other noinst libraries - -lib_LTLIBRARIES = libclustalo.la - -libclustalo_la_SOURCES = clustal-omega.c -libclustalo_la_LIBADD = clustal/libclustal.la \ - hhalign/libhhalign.la \ - squid/libsquid.la \ - kmpp/libkmpp.la -libclustalo_la_LDFLAGS = -static -library_includedir=$(includedir)/clustalo/ -library_include_HEADERS = clustal-omega-config.h clustal-omega.h - - - -bin_PROGRAMS = clustalo - -clustalo_SOURCES = main.cpp \ - mymain.c mymain.h - -clustalo_LDADD = libclustalo.la |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/Makefile.in --- a/clustalomega/clustal-omega-0.2.0/src/Makefile.in Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,832 +0,0 @@\n-# Makefile.in generated by automake 1.11.1 from Makefile.am.\n-# @configure_input@\n-\n-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,\n-# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,\n-# Inc.\n-# This Makefile.in is free software; the Free Software Foundation\n-# gives unlimited permission to copy and/or distribute it,\n-# with or without modifications, as long as this notice is preserved.\n-\n-# This program is distributed in the hope that it will be useful,\n-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without\n-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A\n-# PARTICULAR PURPOSE.\n-\n-@SET_MAKE@\n-\n-\n-\n-VPATH = @srcdir@\n-pkgdatadir = $(datadir)/@PACKAGE@\n-pkgincludedir = $(includedir)/@PACKAGE@\n-pkglibdir = $(libdir)/@PACKAGE@\n-pkglibexecdir = $(libexecdir)/@PACKAGE@\n-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd\n-install_sh_DATA = $(install_sh) -c -m 644\n-install_sh_PROGRAM = $(install_sh) -c\n-install_sh_SCRIPT = $(install_sh) -c\n-INSTALL_HEADER = $(INSTALL_DATA)\n-transform = $(program_transform_name)\n-NORMAL_INSTALL = :\n-PRE_INSTALL = :\n-POST_INSTALL = :\n-NORMAL_UNINSTALL = :\n-PRE_UNINSTALL = :\n-POST_UNINSTALL = :\n-build_triplet = @build@\n-host_triplet = @host@\n-bin_PROGRAMS = clustalo$(EXEEXT)\n-subdir = src\n-DIST_COMMON = $(library_include_HEADERS) $(srcdir)/Makefile.am \\\n-\t$(srcdir)/Makefile.in $(srcdir)/config.h.in\n-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4\n-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_prefix_config_h.m4 \\\n-\t$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \\\n-\t$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \\\n-\t$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/ax_openmp.m4 \\\n-\t$(top_srcdir)/configure.ac\n-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \\\n-\t$(ACLOCAL_M4)\n-mkinstalldirs = $(install_sh) -d\n-CONFIG_HEADER = config.h\n-CONFIG_CLEAN_FILES =\n-CONFIG_CLEAN_VPATH_FILES =\n-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed \'s|.|.|g\'`;\n-am__vpath_adj = case $$p in \\\n- $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \\\n- *) f=$$p;; \\\n- esac;\n-am__strip_dir = f=`echo $$p | sed -e \'s|^.*/||\'`;\n-am__install_max = 40\n-am__nobase_strip_setup = \\\n- srcdirstrip=`echo "$(srcdir)" | sed \'s/[].[^$$\\\\*|]/\\\\\\\\&/g\'`\n-am__nobase_strip = \\\n- for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"\n-am__nobase_list = $(am__nobase_strip_setup); \\\n- for p in $$list; do echo "$$p $$p"; done | \\\n- sed "s| $$srcdirstrip/| |;"\' / .*\\//!s/ .*/ ./; s,\\( .*\\)/[^/]*$$,\\1,\' | \\\n- $(AWK) \'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \\\n- if (++n[$$2] == $(am__install_max)) \\\n- { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \\\n- END { for (dir in files) print dir, files[dir] }\'\n-am__base_list = \\\n- sed \'$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\\n/ /g\' | \\\n- sed \'$$!N;$$!N;$$!N;$$!N;s/\\n/ /g\'\n-am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \\\n-\t"$(DESTDIR)$(library_includedir)"\n-LTLIBRARIES = $(lib_LTLIBRARIES)\n-libclustalo_la_DEPENDENCIES = clustal/libclustal.la \\\n-\thhalign/libhhalign.la squid/libsquid.la kmpp/libkmpp.la\n-am_libclustalo_la_OBJECTS = clustal-omega.lo\n-libclustalo_la_OBJECTS = $(am_libclustalo_la_OBJECTS)\n-libclustalo_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \\\n-\t$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \\\n-\t$(libclustalo_la_LDFLAGS) $(LDFLAGS) -o $@\n-PROGRAMS = $(bin_PROGRAMS)\n-am_clustalo_OBJECTS = main.$(OBJEXT) mymain.$(OBJEXT)\n-clustalo_OBJECTS = $(am_clustalo_OBJECTS)\n-clustalo_DEPENDENCIES = libclustalo.la\n-DEFAULT_INCLUDES = -I.@am__isrc@\n-depcomp = $(SHELL) $(top_srcdir)/depcomp\n-am__depfiles_maybe = depfiles\n-am__mv = mv -f\n-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \\\n-\t$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)\n-LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \\\n-\t--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \\\n-\t'..b'dir" \\\n-\t distdir="$$new_distdir" \\\n-\t\tam__remove_distdir=: \\\n-\t\tam__skip_length_check=: \\\n-\t\tam__skip_mode_fix=: \\\n-\t distdir) \\\n-\t || exit 1; \\\n-\t fi; \\\n-\tdone\n-check-am: all-am\n-check: check-recursive\n-all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(HEADERS) config.h\n-install-binPROGRAMS: install-libLTLIBRARIES\n-\n-installdirs: installdirs-recursive\n-installdirs-am:\n-\tfor dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(library_includedir)"; do \\\n-\t test -z "$$dir" || $(MKDIR_P) "$$dir"; \\\n-\tdone\n-install: install-recursive\n-install-exec: install-exec-recursive\n-install-data: install-data-recursive\n-uninstall: uninstall-recursive\n-\n-install-am: all-am\n-\t@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am\n-\n-installcheck: installcheck-recursive\n-install-strip:\n-\t$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \\\n-\t install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \\\n-\t `test -z \'$(STRIP)\' || \\\n-\t echo "INSTALL_PROGRAM_ENV=STRIPPROG=\'$(STRIP)\'"` install\n-mostlyclean-generic:\n-\n-clean-generic:\n-\n-distclean-generic:\n-\t-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)\n-\t-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)\n-\n-maintainer-clean-generic:\n-\t@echo "This command is intended for maintainers to use"\n-\t@echo "it deletes files that may require special tools to rebuild."\n-clean: clean-recursive\n-\n-clean-am: clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \\\n-\tclean-libtool mostlyclean-am\n-\n-distclean: distclean-recursive\n-\t-rm -rf ./$(DEPDIR)\n-\t-rm -f Makefile\n-distclean-am: clean-am distclean-compile distclean-generic \\\n-\tdistclean-hdr distclean-tags\n-\n-dvi: dvi-recursive\n-\n-dvi-am:\n-\n-html: html-recursive\n-\n-html-am:\n-\n-info: info-recursive\n-\n-info-am:\n-\n-install-data-am: install-library_includeHEADERS\n-\n-install-dvi: install-dvi-recursive\n-\n-install-dvi-am:\n-\n-install-exec-am: install-binPROGRAMS install-libLTLIBRARIES\n-\n-install-html: install-html-recursive\n-\n-install-html-am:\n-\n-install-info: install-info-recursive\n-\n-install-info-am:\n-\n-install-man:\n-\n-install-pdf: install-pdf-recursive\n-\n-install-pdf-am:\n-\n-install-ps: install-ps-recursive\n-\n-install-ps-am:\n-\n-installcheck-am:\n-\n-maintainer-clean: maintainer-clean-recursive\n-\t-rm -rf ./$(DEPDIR)\n-\t-rm -f Makefile\n-maintainer-clean-am: distclean-am maintainer-clean-generic\n-\n-mostlyclean: mostlyclean-recursive\n-\n-mostlyclean-am: mostlyclean-compile mostlyclean-generic \\\n-\tmostlyclean-libtool\n-\n-pdf: pdf-recursive\n-\n-pdf-am:\n-\n-ps: ps-recursive\n-\n-ps-am:\n-\n-uninstall-am: uninstall-binPROGRAMS uninstall-libLTLIBRARIES \\\n-\tuninstall-library_includeHEADERS\n-\n-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \\\n-\tctags-recursive install-am install-strip tags-recursive\n-\n-.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \\\n-\tall all-am check check-am clean clean-binPROGRAMS \\\n-\tclean-generic clean-libLTLIBRARIES clean-libtool ctags \\\n-\tctags-recursive distclean distclean-compile distclean-generic \\\n-\tdistclean-hdr distclean-libtool distclean-tags distdir dvi \\\n-\tdvi-am html html-am info info-am install install-am \\\n-\tinstall-binPROGRAMS install-data install-data-am install-dvi \\\n-\tinstall-dvi-am install-exec install-exec-am install-html \\\n-\tinstall-html-am install-info install-info-am \\\n-\tinstall-libLTLIBRARIES install-library_includeHEADERS \\\n-\tinstall-man install-pdf install-pdf-am install-ps \\\n-\tinstall-ps-am install-strip installcheck installcheck-am \\\n-\tinstalldirs installdirs-am maintainer-clean \\\n-\tmaintainer-clean-generic mostlyclean mostlyclean-compile \\\n-\tmostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \\\n-\ttags tags-recursive uninstall uninstall-am \\\n-\tuninstall-binPROGRAMS uninstall-libLTLIBRARIES \\\n-\tuninstall-library_includeHEADERS\n-\n-\n-# Tell versions [3.59,3.63) of GNU make to not export all variables.\n-# Otherwise a system limit (for SysV at least) may be exceeded.\n-.NOEXPORT:\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/clustal-omega-config.h --- a/clustalomega/clustal-omega-0.2.0/src/clustal-omega-config.h Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
b"@@ -1,353 +0,0 @@\n-#ifndef _SRC_CLUSTAL_OMEGA_CONFIG_H\n-#define _SRC_CLUSTAL_OMEGA_CONFIG_H 1\n- \n-/* src/clustal-omega-config.h. Generated automatically at end of configure. */\n-/* src/config.h. Generated from config.h.in by configure. */\n-/* src/config.h.in. Generated from configure.ac by autoheader. */\n-\n-/* Define if building universal (internal helper macro) */\n-/* #undef AC_APPLE_UNIVERSAL_BUILD */\n-\n-/* Let all files know they are being used inside Clustal Omega */\n-#ifndef CLUSTAL_OMEGA_CLUSTALO\n-#define CLUSTAL_OMEGA_CLUSTALO 1\n-#endif\n-\n-/* This is a CYGWIN system */\n-/* #undef CYGWIN */\n-\n-/* This is a Darwin system */\n-/* #undef DARWIN */\n-\n-/* Define to 1 if you have the <argtable2.h> header file. */\n-#ifndef CLUSTAL_OMEGA_HAVE_ARGTABLE2_H\n-#define CLUSTAL_OMEGA_HAVE_ARGTABLE2_H 1\n-#endif\n-\n-/* Define to 1 if you have the <assert.h> header file. */\n-#ifndef CLUSTAL_OMEGA_HAVE_ASSERT_H\n-#define CLUSTAL_OMEGA_HAVE_ASSERT_H 1\n-#endif\n-\n-/* Define to 1 if you have the <ctype.h> header file. */\n-#ifndef CLUSTAL_OMEGA_HAVE_CTYPE_H\n-#define CLUSTAL_OMEGA_HAVE_CTYPE_H 1\n-#endif\n-\n-/* Define to 1 if you have the <dlfcn.h> header file. */\n-#ifndef CLUSTAL_OMEGA_HAVE_DLFCN_H\n-#define CLUSTAL_OMEGA_HAVE_DLFCN_H 1\n-#endif\n-\n-/* Define to 1 if you have the <float.h> header file. */\n-#ifndef CLUSTAL_OMEGA_HAVE_FLOAT_H\n-#define CLUSTAL_OMEGA_HAVE_FLOAT_H 1\n-#endif\n-\n-/* Define to 1 if you have the `fseek64' function. */\n-/* #undef HAVE_FSEEK64 */\n-\n-/* Define to 1 if you have the `fseeko' function. */\n-#ifndef CLUSTAL_OMEGA_HAVE_FSEEKO\n-#define CLUSTAL_OMEGA_HAVE_FSEEKO 1\n-#endif\n-\n-/* Define to 1 if you have the `fseeko64' function. */\n-#ifndef CLUSTAL_OMEGA_HAVE_FSEEKO64\n-#define CLUSTAL_OMEGA_HAVE_FSEEKO64 1\n-#endif\n-\n-/* Define to 1 if you have the `ftell64' function. */\n-/* #undef HAVE_FTELL64 */\n-\n-/* Define to 1 if you have the `ftello' function. */\n-#ifndef CLUSTAL_OMEGA_HAVE_FTELLO\n-#define CLUSTAL_OMEGA_HAVE_FTELLO 1\n-#endif\n-\n-/* Define to 1 if you have the `ftello64' function. */\n-#ifndef CLUSTAL_OMEGA_HAVE_FTELLO64\n-#define CLUSTAL_OMEGA_HAVE_FTELLO64 1\n-#endif\n-\n-/* Define to 1 if you have the <inttypes.h> header file. */\n-#ifndef CLUSTAL_OMEGA_HAVE_INTTYPES_H\n-#define CLUSTAL_OMEGA_HAVE_INTTYPES_H 1\n-#endif\n-\n-/* Define to 1 if you have the `argtable2' library (-largtable2). */\n-#ifndef CLUSTAL_OMEGA_HAVE_LIBARGTABLE2\n-#define CLUSTAL_OMEGA_HAVE_LIBARGTABLE2 1\n-#endif\n-\n-/* Define to 1 if you have the `m' library (-lm). */\n-#ifndef CLUSTAL_OMEGA_HAVE_LIBM\n-#define CLUSTAL_OMEGA_HAVE_LIBM 1\n-#endif\n-\n-/* Define to 1 if you have the <limits.h> header file. */\n-#ifndef CLUSTAL_OMEGA_HAVE_LIMITS_H\n-#define CLUSTAL_OMEGA_HAVE_LIMITS_H 1\n-#endif\n-\n-/* Has log2() */\n-#ifndef CLUSTAL_OMEGA_HAVE_LOG2\n-#define CLUSTAL_OMEGA_HAVE_LOG2 1\n-#endif\n-\n-/* Define to 1 if you have the <math.h> header file. */\n-#ifndef CLUSTAL_OMEGA_HAVE_MATH_H\n-#define CLUSTAL_OMEGA_HAVE_MATH_H 1\n-#endif\n-\n-/* Define to 1 if you have the <memory.h> header file. */\n-#ifndef CLUSTAL_OMEGA_HAVE_MEMORY_H\n-#define CLUSTAL_OMEGA_HAVE_MEMORY_H 1\n-#endif\n-\n-/* Define to 1 if you have the `ntohl' function. */\n-#ifndef CLUSTAL_OMEGA_HAVE_NTOHL\n-#define CLUSTAL_OMEGA_HAVE_NTOHL 1\n-#endif\n-\n-/* Define to 1 if you have the `ntohs' function. */\n-#ifndef CLUSTAL_OMEGA_HAVE_NTOHS\n-#define CLUSTAL_OMEGA_HAVE_NTOHS 1\n-#endif\n-\n-/* Define to 1 if you have the `ntonl' function. */\n-/* #undef HAVE_NTONL */\n-\n-/* Define to 1 if you have the `ntons' function. */\n-/* #undef HAVE_NTONS */\n-\n-/* Defined if OpenMP should and can be used */\n-#ifndef CLUSTAL_OMEGA_HAVE_OPENMP\n-#define CLUSTAL_OMEGA_HAVE_OPENMP 1\n-#endif\n-\n-/* Define to 1 if you have the <stdarg.h> header file. */\n-#ifndef CLUSTAL_OMEGA_HAVE_STDARG_H\n-#define CLUSTAL_OMEGA_HAVE_STDARG_H 1\n-#endif\n-\n-/* Define to 1 if you have the <stdint.h> header file. */\n-#ifndef CLUSTAL_OMEGA_HAVE_STDINT_H\n-#define CLUSTAL_OMEGA_HAVE_STDINT_H 1\n-#endif\n-\n-/* Define to 1 if you have the <stdio.h> header file. */\n-#ifndef C"..b'-/* Define to the address where bug reports for this package should be sent. */\n-#ifndef CLUSTAL_OMEGA_PACKAGE_BUGREPORT\n-#define CLUSTAL_OMEGA_PACKAGE_BUGREPORT "clustalw@ucd.ie"\n-#endif\n-\n-/* The package code name */\n-#ifndef CLUSTAL_OMEGA_PACKAGE_CODENAME\n-#define CLUSTAL_OMEGA_PACKAGE_CODENAME "IbiMeVidebunt"\n-#endif\n-\n-/* Define to the full name of this package. */\n-#ifndef CLUSTAL_OMEGA_PACKAGE_NAME\n-#define CLUSTAL_OMEGA_PACKAGE_NAME "Clustal Omega"\n-#endif\n-\n-/* Define to the full name and version of this package. */\n-#ifndef CLUSTAL_OMEGA_PACKAGE_STRING\n-#define CLUSTAL_OMEGA_PACKAGE_STRING "Clustal Omega 0.2.0"\n-#endif\n-\n-/* Define to the one symbol short name of this package. */\n-#ifndef CLUSTAL_OMEGA_PACKAGE_TARNAME\n-#define CLUSTAL_OMEGA_PACKAGE_TARNAME "clustal-omega"\n-#endif\n-\n-/* Define to the home page for this package. */\n-#ifndef CLUSTAL_OMEGA_PACKAGE_URL\n-#define CLUSTAL_OMEGA_PACKAGE_URL ""\n-#endif\n-\n-/* Define to the version of this package. */\n-#ifndef CLUSTAL_OMEGA_PACKAGE_VERSION\n-#define CLUSTAL_OMEGA_PACKAGE_VERSION "0.2.0"\n-#endif\n-\n-/* The size of `fpos_t\', as computed by sizeof. */\n-#ifndef CLUSTAL_OMEGA_SIZEOF_FPOS_T\n-#define CLUSTAL_OMEGA_SIZEOF_FPOS_T 16\n-#endif\n-\n-/* The size of `unsigned int\', as computed by sizeof. */\n-#ifndef CLUSTAL_OMEGA_SIZEOF_UNSIGNED_INT\n-#define CLUSTAL_OMEGA_SIZEOF_UNSIGNED_INT 4\n-#endif\n-\n-/* The size of `unsigned long\', as computed by sizeof. */\n-#ifndef CLUSTAL_OMEGA_SIZEOF_UNSIGNED_LONG\n-#define CLUSTAL_OMEGA_SIZEOF_UNSIGNED_LONG 8\n-#endif\n-\n-/* The size of `unsigned long long\', as computed by sizeof. */\n-#ifndef CLUSTAL_OMEGA_SIZEOF_UNSIGNED_LONG_LONG\n-#define CLUSTAL_OMEGA_SIZEOF_UNSIGNED_LONG_LONG 8\n-#endif\n-\n-/* The size of `unsigned short\', as computed by sizeof. */\n-#ifndef CLUSTAL_OMEGA_SIZEOF_UNSIGNED_SHORT\n-#define CLUSTAL_OMEGA_SIZEOF_UNSIGNED_SHORT 2\n-#endif\n-\n-/* This is a Solaris system */\n-/* #undef SOLARIS */\n-\n-/* This is a BSD system */\n-/* #undef SOMEBSD */\n-\n-/* Define to 1 if you have the ANSI C header files. */\n-#ifndef CLUSTAL_OMEGA_STDC_HEADERS\n-#define CLUSTAL_OMEGA_STDC_HEADERS 1\n-#endif\n-\n-/* Enable extensions on AIX 3, Interix. */\n-#ifndef _ALL_SOURCE\n-# define _ALL_SOURCE 1\n-#endif\n-/* Enable GNU extensions on systems that have them. */\n-#ifndef _GNU_SOURCE\n-# define _GNU_SOURCE 1\n-#endif\n-/* Enable threading extensions on Solaris. */\n-#ifndef _POSIX_PTHREAD_SEMANTICS\n-# define _POSIX_PTHREAD_SEMANTICS 1\n-#endif\n-/* Enable extensions on HP NonStop. */\n-#ifndef _TANDEM_SOURCE\n-# define _TANDEM_SOURCE 1\n-#endif\n-/* Enable general extensions on Solaris. */\n-#ifndef __EXTENSIONS__\n-# define __EXTENSIONS__ 1\n-#endif\n-\n-\n-/* Version number of package */\n-#ifndef CLUSTAL_OMEGA_VERSION\n-#define CLUSTAL_OMEGA_VERSION "0.2.0"\n-#endif\n-\n-/* Define if using the dmalloc debugging malloc package */\n-/* #undef WITH_DMALLOC */\n-\n-/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most\n- significant byte first (like Motorola and SPARC, unlike Intel). */\n-#if defined AC_APPLE_UNIVERSAL_BUILD\n-# if defined __BIG_ENDIAN__\n-# define WORDS_BIGENDIAN 1\n-# endif\n-#else\n-# ifndef WORDS_BIGENDIAN\n-/* # undef WORDS_BIGENDIAN */\n-# endif\n-#endif\n-\n-/* Define to 1 if on MINIX. */\n-/* #undef _MINIX */\n-\n-/* Define to 2 if the system does not provide POSIX.1 features except with\n- this defined. */\n-/* #undef _POSIX_1_SOURCE */\n-\n-/* Define to 1 if you need to in order for `stat\' and other things to work. */\n-/* #undef _POSIX_SOURCE */\n-\n-/* Define to empty if `const\' does not conform to ANSI C. */\n-/* #undef const */\n-\n-/* Define to `__inline__\' or `__inline\' if that\'s what the C compiler\n- calls it, or to nothing if \'inline\' is not supported under any name. */\n-#ifndef __cplusplus\n-/* #undef inline */\n-#endif\n-\n-/* Define to `long int\' if <sys/types.h> does not define. */\n-/* #undef off_t */\n-\n-/* Define to `unsigned int\' if <sys/types.h> does not define. */\n-/* #undef size_t */\n- \n-/* once: _SRC_CLUSTAL_OMEGA_CONFIG_H */\n-#endif\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/clustal-omega.c --- a/clustalomega/clustal-omega-0.2.0/src/clustal-omega.c Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,1395 +0,0 @@\n-/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n-\n-/*********************************************************************\n- * Clustal Omega - Multiple sequence alignment\n- *\n- * Copyright (C) 2010 University College Dublin\n- *\n- * Clustal-Omega is free software; you can redistribute it and/or\n- * modify it under the terms of the GNU General Public License as\n- * published by the Free Software Foundation; either version 2 of the\n- * License, or (at your option) any later version.\n- *\n- * This file is part of Clustal-Omega.\n- *\n- ********************************************************************/\n-\n-/*\n- * RCS $Id: clustal-omega.c 241 2011-05-04 14:37:17Z fabian $\n- */\n-\n-#ifdef HAVE_CONFIG_H\n-#include "config.h"\n-#endif\n-\n-#include <assert.h>\n-\n-#include "clustal-omega.h"\n-#include "hhalign/general.h"\n-\n-/* The following comment block contains the frontpage/mainpage of the doxygen\n- * documentation. Please add some more info. FIXME add more\n- */\n-\n-/**\n- *\n- * @mainpage Clustal-Omega Documentation\n- *\n- * @section intro_sec Introduction\n- *\n- * For more information see http://www.clustal.org/\n- *\n- * @section api_section API\n- *\n- * @subsection example_prog_subsection An Example Program\n- *\n- * To use libclustalo you will have to include the clustal-omega.h header and\n- * link against libclustalo. For linking against libclustalo you will have to\n- * use a C++ compiler, no matter if your program was written in C or C++.\n- *\n- * First compile (no linking) your source (for an example see section "\\ref\n- * example_src_subsubsec"):\n- *\n- * @code\n- * $ gcc -c -ansi -Wall clustalo-api-test.c\n- * @endcode\n- *\n- * Then link against libclustalo (we recommend the use of pkg-config as\n- * explained in \\ref pkgconfig_subsubsec). Assuming Clustal Omega was installed\n- * in system-wide default directory (e.g. /usr) just type:\n- *\n- * @code\n- * $ g++ -ansi -Wall -o clustalo-api-test clustalo-api-test.o -lclustalo\n- * @endcode\n- *\n- * Voila! Now you have your own alignment program which can be run with\n- *\n- * @code\n- * $ ./clustalo-api-test <your-sequence-input>\n- * @endcode\n- * \n- * It\'s best to use the same compiler that you used for compiling libclustal.\n- * If libclustal was compiled with OpenMP support, you will have to use OpenMP\n- * flags for you program as well.\n- *\n- *\n- * @subsubsection pkgconfig_subsubsec Using pkg-config / Figuring out compiler flags\n- *\n- * Clustal Omega comes with support for <a\n- * href="http://pkg-config.freedesktop.org">pkg-config</a>, which means you\n- * can run\n- *\n- * @code\n- * $ pkg-config --cflags --libs clustalo\n- * @endcode\n- *\n- * to figure out cflags and library flags needed to compile and link against\n- * libclustalo. This is especially handy if Clustal Omega was installed to a\n- * non-standard directory.\n- * \n- * You might have to change PKG_CONFIG_PATH. For example, if you used the prefix $HOME/local/ for\n- * installation then you will first need to set PKG_CONFIG_PATH:\n- *\n- * @code\n- * $ export PKG_CONFIG_PATH=$HOME/local/lib/pkgconfig\n- * $ pkg-config --cflags --libs clustalo\n- * @endcode\n- * \n- * \n- * To compile your source use:\n- * \n- * @code\n- * $ export PKG_CONFIG_PATH=$HOME/local/lib/pkgconfig\n- * $ gcc -c -ansi -Wall clustalo-api-test.c $(pkg-config --cflags clustalo)\n- * $ g++ -ansi -Wall -o clustalo-api-test clustalo-api-test.o $(pkg-config --libs clustalo)\n- * @endcode\n- *\n- *\n- * @subsubsection example_src_subsubsec Example Source Code\n- *\n- * @include "clustalo-api-test.c"\n- *\n- *\n- */\n-\n-\n-\n-\n-/* FIXME: doc */\n-/* the following are temporary flags while the code is still under construction;\n- had problems internalising hhmake, so as temporary crutch \n- write alignment to file and get external hmmer/hhmake via system call \n- to read alignment and convert into HMM\n- All this will go, once hhmake is properly internalised */\n-#define INDIRECT_HMM 0 /* temp flag: (1) write aln to file, use system(hmmer/hhmake), (0) i'..b' &rHMMLocal, 1, -1, rHhalignPara);\n- Log(&rLog, LOG_VERBOSE,\n- "Alignment score for alignmnent in hmm-iteration no %d = %f (last score = %f)",\n- iIterationCounter+1, dAlnScore, dLastAlnScore);\n- \n- \n- FreeHMMstruct(&rHMMLocal);\n-\n-#if 0\n- /* FIXME: need a better score for automatic iteration */\n- if (prOpts->bIterationsAuto) {\n- /* automatic iteration: break if score improvement was not\n- * big enough\n- */\n- double dScoreImprovement = (dAlnScore-dLastAlnScore)/dLastAlnScore;\n- if (dScoreImprovement < ITERATION_SCORE_IMPROVEMENT_THRESHOLD) {\n- Log(&rLog, LOG_INFO,\n- "Stopping after %d guide-tree iterations. No further alignment score improvement achieved.",\n- iIterationCounter+1);\n- /* use previous alignment */\n- FreeMSeq(&prMSeq);\n- Log(&rLog, LOG_FORCED_DEBUG, "FIXME: %s", "CopyMSeq breaks things in this context");\n- CopyMSeq(&prMSeq, prMSeqCopy);\n- /* FIXME: prOpts->pcDistmatOutfile and pcGuidetreeOutfile\n- * might have been updated, but then discarded here?\n- */\n- break;\n- } else {\n- Log(&rLog, LOG_INFO,\n- "Got a %d%% better score in iteration step %d",\n- (int)dScoreImprovement*100, iIterationCounter+1);\n- FreeMSeq(&prMSeqCopy);\n- }\n- }\n- dLastAlnScore = dAlnScore;\n-#endif\n-\n- }\n- /* end of iterations */\n-\n-\n-\n- /* Last step: if a profile was also provided then align now-aligned mseq\n- * with this profile\n- *\n- * Don\'t use the backgrounds HMMs anymore and don\'t iterate.\n- * (which was done before).\n- *\n- */\n- if (NULL != prMSeqProfile) {\n- if (AlignProfiles(prMSeq, prMSeqProfile, rHhalignPara)) {\n- Log(&rLog, LOG_ERROR, "An error occured during the profile/profile alignment");\n- return -1;\n- }\n- }\n-\n- \n- if (NULL != piOrderLR) {\n- CKFREE(piOrderLR);\n- }\n- if (NULL != pdSeqWeights) {\n- CKFREE(pdSeqWeights);\n- }\n- if (0 < prOpts->iHMMInputFiles) {\n- for (i=0; i<prOpts->iHMMInputFiles; i++) {\n- FreeHMMstruct(&prHMMs[i]);\n- }\n- CKFREE(prHMMs);\n- }\n-\n- return 0;\n-}\n-/* end of Align() */\n-\n-\n-\n-\n-/**\n- * @brief Align two profiles, ie two sets of prealigned sequences. Already\n- * aligned columns won\'t be changed.\n- *\n- * @param[out] prMSeqProfile1\n- * First profile/aligned set of sequences. Merged alignment will be found in\n- * here.\n- * @param[in] prMSeqProfile2\n- * First profile/aligned set of sequences\n- *\n- * @return 0 on success, -1 on failure\n- *\n- */\n-int\n-AlignProfiles(mseq_t *prMSeqProfile1, \n- mseq_t *prMSeqProfile2, hhalign_para rHhalignPara) {\n- \n- double dAlnScore;\n-\n- /* number of seqs in first half of joined profile */\n- int iProfProfSeparator = prMSeqProfile1->nseqs;\n-\n- assert(TRUE == prMSeqProfile1->aligned);\n- assert(TRUE == prMSeqProfile2->aligned);\n-\n- Log(&rLog, LOG_INFO, "Performing profile/profile alignment");\n-\n- /* Combine the available mseqs into prMSeq\n- * which will be aligned afterwards.\n- */\n- JoinMSeqs(&prMSeqProfile1, prMSeqProfile2);\n-\n- \n- /* set alignment flag explicitly to FALSE */\n- prMSeqProfile1->aligned = FALSE;\n- \n- dAlnScore = HHalignWrapper(prMSeqProfile1,\n- NULL, /* no order */\n- NULL, /* no weights */\n- 3, /* nodes: root+2profiles */\n- NULL, 0 /* no bg-hmms */,\n- iProfProfSeparator, rHhalignPara);\n- \n- Log(&rLog, LOG_VERBOSE, "Alignment score is = %f", dAlnScore);\n-\n- return 0;\n-}\n-/* end of AlignProfiles() */\n-\n-\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/clustal-omega.h --- a/clustalomega/clustal-omega-0.2.0/src/clustal-omega.h Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,167 +0,0 @@ -/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ - -/********************************************************************* - * Clustal Omega - Multiple sequence alignment - * - * Copyright (C) 2010 University College Dublin - * - * Clustal-Omega is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This file is part of Clustal-Omega. - * - ********************************************************************/ - -/* - * RCS $Id: clustal-omega.h 212 2011-03-10 15:09:46Z andreas $ - */ - -#ifndef CLUSTALO_H -#define CLUSTALO_H - - - -#ifdef HAVE_OPENMP -#include <omp.h> -#endif - -#include "clustal-omega-config.h" - -/* the following needs to be kept in sync with library_include_HEADERS of all - * subdir Makefile.am's - */ - -/* hhalign */ -#include "hhalign/general.h" -#include "hhalign/hhfunc.h" - - -/* clustal */ -#include "clustal/log.h" -#include "clustal/util.h" -#include "clustal/symmatrix.h" -#include "clustal/tree.h" -#include "clustal/seq.h" -#include "clustal/mbed.h" -#include "clustal/weights.h" -#include "clustal/pair_dist.h" -#include "clustal/hhalign_wrapper.h" - - - -#define CLUSTERING_UNKNOWN 0 -#define CLUSTERING_UPGMA 1 - -/* weights will be computed if 1. but are not really used for now and they - * might slow things down. also, mbed's screws up branch lengths which will - * have a negative effect on weights -*/ -#define USE_WEIGHTS 0 - -extern int iNumberOfThreads; - - -/** user/commandline options - * - * changes here will have to be reflected in ParseCommandLine() - * and during setup of the default opts - * - */ -typedef struct { - /* auto: Clustal (know what) is good for you - */ - bool bAutoOptions; - - /* Distance matrix - */ - /** distance matrix input file */ - char *pcDistmatInfile; - /** distance matrix output file */ - char *pcDistmatOutfile; - - /* Clustering / guide-tree - */ - /** clustering type (from cmdline arg) */ - int iClusteringType; - /** pairwise distance method */ - int iPairDistType; - /** use mbed-like clustering */ - bool bUseMbed; - /** use mbed-like clustering also during iteration */ - bool bUseMbedForIteration; - /** guidetree output file */ - char *pcGuidetreeOutfile; - /** guidetree input file */ - char *pcGuidetreeInfile; - - /* HMMs - */ - /** HMM input files. index range: 0..iHMMInputFiles */ - char **ppcHMMInput; - /** number of provided HMM input files. not really a user - option but need for ppcHMMInput */ - int iHMMInputFiles; - - /* Iteration - */ - /** number of iterations */ - int iNumIterations; - /** determine number of iterations automatically */ - bool bIterationsAuto; - /** maximum number of hmm iterations */ - int iMaxHMMIterations; - /** max number of guidetree iterations */ - int iMaxGuidetreeIterations; - - /** max MAC RAM (maximum amount of RAM set aside for MAC algorithm) */ - int iMacRam; /* FS, r240 -> */ - - /* changes here will have to be reflected in FreeAlnOpts(), - * SetDefaultAlnOpts(), AlnOptsLogicCheck() etc - */ -} opts_t; - - - - - -extern void -PrintLongVersion(char *pcStr, int iSize); - -extern void -SetDefaultAlnOpts(opts_t *opts); - -extern void -FreeAlnOpts(opts_t *aln_opts); - -extern void -AlnOptsLogicCheck(opts_t *opts); - -extern void -PrintAlnOpts(FILE *prFile, opts_t *opts); - -extern void -InitClustalOmega(int iNumThreadsToUse); - -extern void -SequentialAlignmentOrder(int **piOrderLR_p, int iNumSeq); - -extern int -AlignmentOrder(int **piOrderLR_p, double **pdSeqWeights_p, mseq_t *prMSeq, - int iPairDistType, char *pcDistmatInfile, char *pcDistmatOutfile, - int iClusteringType, char *pcGuidetreeInfile, char *pcGuidetreeOutfile, - bool bUseMBed); - -extern int -Align(mseq_t *prMSeq, - mseq_t *prMSeqProfile, - opts_t *prOpts, - hhalign_para rHhalignPara); - -extern int -AlignProfiles(mseq_t *prMSeqProfile1, - mseq_t *prMSeqProfile2, hhalign_para rHhalignPara); - -#endif |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/clustal/Makefile.am --- a/clustalomega/clustal-omega-0.2.0/src/clustal/Makefile.am Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,38 +0,0 @@ -AM_CFLAGS = @OPENMP_CFLAGS@ @AM_CFLAGS@ -AM_LDFLAGS = @AM_LDFLAGS@ - -noinst_LTLIBRARIES = libclustal.la - -libclustal_la_SOURCES = \ - hhalign_wrapper.c hhalign_wrapper.h \ - ktuple_pair.c ktuple_pair.h \ - list.c list.h \ - log.c log.h \ - muscle_upgma.c muscle_upgma.h \ - muscle_tree.c muscle_tree.h \ - mbed.c mbed.h \ - pair_dist.h pair_dist.c \ - progress.c progress.h \ - queue.h \ - seq.c seq.h \ - symmatrix.c symmatrix.h \ - tree.c tree.h \ - util.c util.h \ - weights.c weights.h - -library_includedir=$(includedir)/clustalo/clustal - -library_include_HEADERS = \ - hhalign_wrapper.h \ - ktuple_pair.h \ - log.h \ - mbed.h \ - muscle_tree.h \ - pair_dist.h \ - progress.h \ - seq.h \ - symmatrix.h \ - tree.h \ - util.h \ - weights.h - |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/clustal/Makefile.in --- a/clustalomega/clustal-omega-0.2.0/src/clustal/Makefile.in Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,573 +0,0 @@\n-# Makefile.in generated by automake 1.11.1 from Makefile.am.\n-# @configure_input@\n-\n-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,\n-# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,\n-# Inc.\n-# This Makefile.in is free software; the Free Software Foundation\n-# gives unlimited permission to copy and/or distribute it,\n-# with or without modifications, as long as this notice is preserved.\n-\n-# This program is distributed in the hope that it will be useful,\n-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without\n-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A\n-# PARTICULAR PURPOSE.\n-\n-@SET_MAKE@\n-\n-\n-VPATH = @srcdir@\n-pkgdatadir = $(datadir)/@PACKAGE@\n-pkgincludedir = $(includedir)/@PACKAGE@\n-pkglibdir = $(libdir)/@PACKAGE@\n-pkglibexecdir = $(libexecdir)/@PACKAGE@\n-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd\n-install_sh_DATA = $(install_sh) -c -m 644\n-install_sh_PROGRAM = $(install_sh) -c\n-install_sh_SCRIPT = $(install_sh) -c\n-INSTALL_HEADER = $(INSTALL_DATA)\n-transform = $(program_transform_name)\n-NORMAL_INSTALL = :\n-PRE_INSTALL = :\n-POST_INSTALL = :\n-NORMAL_UNINSTALL = :\n-PRE_UNINSTALL = :\n-POST_UNINSTALL = :\n-build_triplet = @build@\n-host_triplet = @host@\n-subdir = src/clustal\n-DIST_COMMON = $(library_include_HEADERS) $(srcdir)/Makefile.am \\\n-\t$(srcdir)/Makefile.in\n-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4\n-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_prefix_config_h.m4 \\\n-\t$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \\\n-\t$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \\\n-\t$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/ax_openmp.m4 \\\n-\t$(top_srcdir)/configure.ac\n-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \\\n-\t$(ACLOCAL_M4)\n-mkinstalldirs = $(install_sh) -d\n-CONFIG_HEADER = $(top_builddir)/src/config.h\n-CONFIG_CLEAN_FILES =\n-CONFIG_CLEAN_VPATH_FILES =\n-LTLIBRARIES = $(noinst_LTLIBRARIES)\n-libclustal_la_LIBADD =\n-am_libclustal_la_OBJECTS = hhalign_wrapper.lo ktuple_pair.lo list.lo \\\n-\tlog.lo muscle_upgma.lo muscle_tree.lo mbed.lo pair_dist.lo \\\n-\tprogress.lo seq.lo symmatrix.lo tree.lo util.lo weights.lo\n-libclustal_la_OBJECTS = $(am_libclustal_la_OBJECTS)\n-DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src\n-depcomp = $(SHELL) $(top_srcdir)/depcomp\n-am__depfiles_maybe = depfiles\n-am__mv = mv -f\n-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \\\n-\t$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)\n-LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \\\n-\t--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \\\n-\t$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)\n-CCLD = $(CC)\n-LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \\\n-\t--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \\\n-\t$(LDFLAGS) -o $@\n-SOURCES = $(libclustal_la_SOURCES)\n-DIST_SOURCES = $(libclustal_la_SOURCES)\n-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed \'s|.|.|g\'`;\n-am__vpath_adj = case $$p in \\\n- $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \\\n- *) f=$$p;; \\\n- esac;\n-am__strip_dir = f=`echo $$p | sed -e \'s|^.*/||\'`;\n-am__install_max = 40\n-am__nobase_strip_setup = \\\n- srcdirstrip=`echo "$(srcdir)" | sed \'s/[].[^$$\\\\*|]/\\\\\\\\&/g\'`\n-am__nobase_strip = \\\n- for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"\n-am__nobase_list = $(am__nobase_strip_setup); \\\n- for p in $$list; do echo "$$p $$p"; done | \\\n- sed "s| $$srcdirstrip/| |;"\' / .*\\//!s/ .*/ ./; s,\\( .*\\)/[^/]*$$,\\1,\' | \\\n- $(AWK) \'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \\\n- if (++n[$$2] == $(am__install_max)) \\\n- { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \\\n- END { for (dir in files) print dir, files[dir] }\'\n-am__base_list = \\\n- sed \'$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\\n/ /g\' | \\\n- sed \'$$!N;$$!N;$$!N;$$!N;s/\\n/ /g\'\n-am__installdirs = "$(DESTDIR)$(library_includedir)"\n-HEADERS = $(library_include_HEADERS)\n-ETAGS ='..b'lddir)/|;t"`; \\\n-\tcase $$dist_files in \\\n-\t */*) $(MKDIR_P) `echo "$$dist_files" | \\\n-\t\t\t sed \'/\\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,\' | \\\n-\t\t\t sort -u` ;; \\\n-\tesac; \\\n-\tfor file in $$dist_files; do \\\n-\t if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \\\n-\t if test -d $$d/$$file; then \\\n-\t dir=`echo "/$$file" | sed -e \'s,/[^/]*$$,,\'`; \\\n-\t if test -d "$(distdir)/$$file"; then \\\n-\t find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \\;; \\\n-\t fi; \\\n-\t if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \\\n-\t cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \\\n-\t find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \\;; \\\n-\t fi; \\\n-\t cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \\\n-\t else \\\n-\t test -f "$(distdir)/$$file" \\\n-\t || cp -p $$d/$$file "$(distdir)/$$file" \\\n-\t || exit 1; \\\n-\t fi; \\\n-\tdone\n-check-am: all-am\n-check: check-am\n-all-am: Makefile $(LTLIBRARIES) $(HEADERS)\n-installdirs:\n-\tfor dir in "$(DESTDIR)$(library_includedir)"; do \\\n-\t test -z "$$dir" || $(MKDIR_P) "$$dir"; \\\n-\tdone\n-install: install-am\n-install-exec: install-exec-am\n-install-data: install-data-am\n-uninstall: uninstall-am\n-\n-install-am: all-am\n-\t@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am\n-\n-installcheck: installcheck-am\n-install-strip:\n-\t$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \\\n-\t install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \\\n-\t `test -z \'$(STRIP)\' || \\\n-\t echo "INSTALL_PROGRAM_ENV=STRIPPROG=\'$(STRIP)\'"` install\n-mostlyclean-generic:\n-\n-clean-generic:\n-\n-distclean-generic:\n-\t-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)\n-\t-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)\n-\n-maintainer-clean-generic:\n-\t@echo "This command is intended for maintainers to use"\n-\t@echo "it deletes files that may require special tools to rebuild."\n-clean: clean-am\n-\n-clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \\\n-\tmostlyclean-am\n-\n-distclean: distclean-am\n-\t-rm -rf ./$(DEPDIR)\n-\t-rm -f Makefile\n-distclean-am: clean-am distclean-compile distclean-generic \\\n-\tdistclean-tags\n-\n-dvi: dvi-am\n-\n-dvi-am:\n-\n-html: html-am\n-\n-html-am:\n-\n-info: info-am\n-\n-info-am:\n-\n-install-data-am: install-library_includeHEADERS\n-\n-install-dvi: install-dvi-am\n-\n-install-dvi-am:\n-\n-install-exec-am:\n-\n-install-html: install-html-am\n-\n-install-html-am:\n-\n-install-info: install-info-am\n-\n-install-info-am:\n-\n-install-man:\n-\n-install-pdf: install-pdf-am\n-\n-install-pdf-am:\n-\n-install-ps: install-ps-am\n-\n-install-ps-am:\n-\n-installcheck-am:\n-\n-maintainer-clean: maintainer-clean-am\n-\t-rm -rf ./$(DEPDIR)\n-\t-rm -f Makefile\n-maintainer-clean-am: distclean-am maintainer-clean-generic\n-\n-mostlyclean: mostlyclean-am\n-\n-mostlyclean-am: mostlyclean-compile mostlyclean-generic \\\n-\tmostlyclean-libtool\n-\n-pdf: pdf-am\n-\n-pdf-am:\n-\n-ps: ps-am\n-\n-ps-am:\n-\n-uninstall-am: uninstall-library_includeHEADERS\n-\n-.MAKE: install-am install-strip\n-\n-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \\\n-\tclean-libtool clean-noinstLTLIBRARIES ctags distclean \\\n-\tdistclean-compile distclean-generic distclean-libtool \\\n-\tdistclean-tags distdir dvi dvi-am html html-am info info-am \\\n-\tinstall install-am install-data install-data-am install-dvi \\\n-\tinstall-dvi-am install-exec install-exec-am install-html \\\n-\tinstall-html-am install-info install-info-am \\\n-\tinstall-library_includeHEADERS install-man install-pdf \\\n-\tinstall-pdf-am install-ps install-ps-am install-strip \\\n-\tinstallcheck installcheck-am installdirs maintainer-clean \\\n-\tmaintainer-clean-generic mostlyclean mostlyclean-compile \\\n-\tmostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \\\n-\ttags uninstall uninstall-am uninstall-library_includeHEADERS\n-\n-\n-# Tell versions [3.59,3.63) of GNU make to not export all variables.\n-# Otherwise a system limit (for SysV at least) may be exceeded.\n-.NOEXPORT:\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/clustal/hhalign_wrapper.c --- a/clustalomega/clustal-omega-0.2.0/src/clustal/hhalign_wrapper.c Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,1003 +0,0 @@\n-/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n-\n-/*********************************************************************\n- * Clustal Omega - Multiple sequence alignment\n- *\n- * Copyright (C) 2010 University College Dublin\n- *\n- * Clustal-Omega is free software; you can redistribute it and/or\n- * modify it under the terms of the GNU General Public License as\n- * published by the Free Software Foundation; either version 2 of the\n- * License, or (at your option) any later version.\n- *\n- * This file is part of Clustal-Omega.\n- *\n- ********************************************************************/\n-\n-/*\n- * RCS $Id: hhalign_wrapper.c 241 2011-05-04 14:37:17Z fabian $\n- */\n-\n-#ifdef HAVE_CONFIG_H\n-#include "config.h"\n-#endif\n-\n-#include <stdlib.h>\n-#include <string.h>\n-#include <assert.h>\n-#include <ctype.h>\n-\n-#include "seq.h"\n-#include "tree.h"\n-#include "progress.h"\n-#include "hhalign/general.h"\n-#include "hhalign/hhfunc.h"\n-#include "hhalign/hhalign.h"\n-\n-/* up to this level (from leaf) will background HMM info be applied */\n-#define APPLY_BG_HMM_UP_TO_TREE_DEPTH 10\n-\n-#define TIMING 0\n-\n-#define TRACE 0\n-\n-/**\n- * @brief get rid of unknown residues\n- *\n- * @note HHalignWrapper can be entered in 2 different ways: (i) all\n- * sequences are un-aligned (ii) there are 2 (aligned) profiles. in\n- * the un-aligned case (i) the sequences come straight from Squid,\n- * that is, they have been sanitised, all non-alphabetic residues \n- * have been rendered as X\'s. In profile mode (ii) one profile may \n- * have been produced internally. In that case residues may have \n- * been translated back into their \'native\' form, that is, they may\n- * contain un-sanitised residues. These will cause trouble during\n- * alignment\n- * FS, r213->214\n- */\n-void\n-SanitiseUnknown(mseq_t *mseq)\n-{\n-\n- int iS; /* iterator for sequence */\n- int iR; /* iterator for residue */\n- int iLen; /* length of sequence */\n- char *pcRes = NULL;\n-\n-\n- for (iS = 0; iS < mseq->nseqs; iS++){\n-\n- for (pcRes = mseq->seq[iS]; \'\\0\' != *pcRes; pcRes++){\n-\n- if (isgap(*pcRes)){\n- continue;\n- }\n-\n- if (mseq->seqtype==SEQTYPE_PROTEIN) {\n- if (NULL == strchr(AMINO_ALPHABET, toupper(*pcRes))) {\n- *pcRes = AMINOACID_ANY;\n- }\n- } else if (mseq->seqtype==SEQTYPE_DNA) {\n- if (NULL == strchr(DNA_ALPHABET, toupper(*pcRes))) {\n- *pcRes = NUCLEOTIDE_ANY;\n- }\n- } else if (mseq->seqtype==SEQTYPE_RNA) {\n- if (NULL == strchr(RNA_ALPHABET, toupper(*pcRes))) {\n- *pcRes = NUCLEOTIDE_ANY;\n- }\n- }\n-\n- } /* !EO String */\n-\n- } /* 0 <= iS < mseq->nseqs */\n-\n- return;\n-\n-} /*** end: SanitiseUnknown() ***/\n-\n-/**\n- * @brief translate unknown residues back to ambiguity codes;\n- * hhalign translates ambiguity codes (B,Z) into unknown residue (X).\n- * we still have the original (un-aligned) residue information,\n- * by iterating along the original and aligned sequences we can\n- * reconstruct where codes have been changed and restore them\n- * to their original value\n- *\n- * @param[in,out] mseq\n- * sequence/profile data, mseq->seq [in,out] is changed to conform\n- * with mseq->orig_seq [in]\n- *\n- */\n-void\n-TranslateUnknown2Ambiguity(mseq_t *mseq)\n-{\n-\n- int iS; /* iterator for sequence */\n- int iR, iRo; /* iterator for residue (original) */\n- int iChange, iCase, iAmbi; /* counts how many replacements */\n- static int siOffset = \'a\' - \'A\';\n-\n- for (iS = 0; iS < mseq->nseqs; iS++){\n-\n- iR = iRo = 0;\n- iChange = iCase = iAmbi = 0;\n-\n- while((\'\\0\' != mseq->seq[iS][iR]) &&\n- (\'\\0\' != mseq->orig_seq[iS][iRo])) {\n-\n- /* skip gaps in aligned sequences */\n- while(isgap(mseq->seq[iS][iR])) {\n- iR++;\n- } /* was gap i'..b' pcConsens2, pcReprsnt2,\n- rHhalignPara, \n- iAux_FS++, /* DEBUG ARGUMENT */\n- zcAux, zcError);\n- }\n- else {\n- hhalign(ppcProfile2, piLeafCount[iR], pdWeightsR,\n- ppcProfile1, piLeafCount[iL], pdWeightsL,\n- &dScore, prHMM,\n- pcConsens2, pcReprsnt2,\n- pcConsens1, pcReprsnt1,\n- rHhalignPara, \n- iAux_FS++, /* DEBUG ARGUMENT */\n- zcAux, zcError);\n- }\n-\n- }\n- /* free left/right node lists,\n- * after alignment left/right profiles no longer needed\n- */\n- if (NULL != ppcCopy1){\n- int i;\n- for (i = 0; i < piLeafCount[iL]; i++){\n- CKFREE(ppcCopy1[i]);\n- }\n- CKFREE(ppcCopy1);\n- CKFREE(pcReprsnt1);\n- CKFREE(pcConsens1);\n- }\n- if (NULL != ppcCopy2){\n- int i;\n- for (i = 0; i < piLeafCount[iR]; i++){\n- CKFREE(ppcCopy2[i]);\n- }\n- CKFREE(ppcCopy2);\n- CKFREE(pcReprsnt2);\n- CKFREE(pcConsens2);\n- }\n- ppiLeafList[iL] = CKFREE(ppiLeafList[iL]);\n- ppiLeafList[iR] = CKFREE(ppiLeafList[iR]);\n- piLeafCount[iL] = piLeafCount[iR] = 0;\n-\n- } /* was a merge node */\n-\n- if (rLog.iLogLevelEnabled <= LOG_DEBUG){\n- int i, j;\n- FILE *fp = LogGetFP(&rLog, LOG_DEBUG);\n- for (i = 0; i < iNodeCount; i++){\n- if (0 == piLeafCount[i]){\n- continue;\n- }\n- fprintf(fp, "node %3d, #leaves=%d:\\t", i, piLeafCount[i]);\n- for (j = 0; ppiLeafList && (j < piLeafCount[i]); j++){\n- fprintf(fp, "%d,", ppiLeafList[i][j]);\n- }\n- fprintf(fp, "\\n");\n- }\n- }\n-\n-\n- } /* 0 <= iN < iNodeCount */\n- ProgressDone(prProgress);\n-\n-\n- /* check length and set length info\n- */\n- iAlnLen = strlen(prMSeq->seq[0]);\n- for (i=0; i<prMSeq->nseqs; i++) {\n-#if 0\n- Log(&rLog, LOG_FORCED_DEBUG, "seq no %d: name %s; len %d; %s",\n- i, prMSeq->sqinfo[i].name, strlen(prMSeq->seq[i]), prMSeq->seq[i]);\n-#endif\n- \n-#ifndef NDEBUG\n- assert(iAlnLen == strlen(prMSeq->seq[i]));\n-#endif\n- prMSeq->sqinfo[i].len = iAlnLen;\n- }\n- prMSeq->aligned = TRUE;\n-\n-\n- if (rLog.iLogLevelEnabled <= LOG_DEBUG){\n- if (0 != prHMM->L){\n- int i;\n- Log(&rLog, LOG_DEBUG, "Alignment scores with HMM:");\n- for (i = 0; /*pdScores[i] > 0.0*/i < prMSeq->nseqs; i++){\n- Log(&rLog, LOG_DEBUG, "%2d:\\t%f\\n", i, pdScores[i]);\n- }\n- }\n- }\n-\n-\n- /** translate back ambiguity residues\n- * hhalign translates ambiguity codes (B,Z) into unknown residues (X).\n- * as we still have the original input we can substitute them back\n- */\n- TranslateUnknown2Ambiguity(prMSeq);\n- ReAttachLeadingGaps(prMSeq, iProfProfSeparator);\n-\n- if (NULL == prHMMList){\n- CKFREE(prHMM);\n- }\n- CKFREE(ppcProfile2);\n- CKFREE(ppcProfile1);\n- CKFREE(ppiLeafList[piOrderLR[DIFF_NODE*(iNodeCount-1)+PRNT_NODE]]);\n- CKFREE(ppiLeafList);\n- CKFREE(piLeafCount);\n- CKFREE(pdScores);\n- FreeProgress(&prProgress);\n- CKFREE(pdWeightsL);\n- CKFREE(pdWeightsR);\n-\n-#if TIMING\n- StopwatchStop(stopwatch);\n- StopwatchDisplay(stdout, "Total time for HHalignWrapper():" , stopwatch);\n- StopwatchFree(stopwatch);\n-#endif\n-\n- return dScore; /* FIXME alternative: return averaged pdScores */\n-\n-}\n-/*** end: HHalignWrapper() ***/\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/clustal/hhalign_wrapper.h --- a/clustalomega/clustal-omega-0.2.0/src/clustal/hhalign_wrapper.h Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,24 +0,0 @@ -/********************************************************************* - * Clustal Omega - Multiple sequence alignment - * - * Copyright (C) 2010 University College Dublin - * - * Clustal-Omega is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This file is part of Clustal-Omega. - * - ********************************************************************/ - -/* - * RCS $Id: hhalign_wrapper.h 241 2011-05-04 14:37:17Z fabian $ - */ - - -extern double -HHalignWrapper(mseq_t *mseq, int *piOrderLR, - double *pdSeqWeights, int iNodeCount, - hmm_light *prHMMList, int iHMMCount, - int iProfProfSeparator, hhalign_para rHhalignPara); |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/clustal/ktuple_pair.c --- a/clustalomega/clustal-omega-0.2.0/src/clustal/ktuple_pair.c Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,842 +0,0 @@\n-/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n-\n-/*********************************************************************\n- * Clustal Omega - Multiple sequence alignment\n- *\n- * Copyright (C) 2010 University College Dublin\n- *\n- * Clustal-Omega is free software; you can redistribute it and/or\n- * modify it under the terms of the GNU General Public License as\n- * published by the Free Software Foundation; either version 2 of the\n- * License, or (at your option) any later version.\n- *\n- * This file is part of Clustal-Omega.\n- *\n- ********************************************************************/\n-\n-/*\n- * RCS $Id: ktuple_pair.c 230 2011-04-09 15:37:50Z andreas $\n- *\n- *\n- * K-Tuple code for pairwise alignment (Wilbur and Lipman, 1983; PMID\n- * 6572363). Most code taken from showpair.c (Clustal 1.83)\n- * DD: some functions now have lots of parameters as static variables\n- * were removed to make code OpenMP-friendly\n- *\n- */\n-\n-#ifdef HAVE_CONFIG_H\n-#include "config.h"\n-#endif\n-\n-\n-#include <stdio.h>\n-#include <string.h>\n-#include <ctype.h>\n-#include <stdlib.h>\n-#include <math.h>\n-#include <assert.h>\n-\n-#ifdef HAVE_OPENMP\n-#include <omp.h>\n-#endif\n-\n-#include "squid/squid.h"\n-#include "util.h"\n-#include "symmatrix.h"\n-#include "ktuple_pair.h"\n-#include "log.h"\n-#include "progress.h"\n-\n-#define END_MARK -3 /* see interface.c in 1.83 */\n-#define NUMRES 32 /* max size of comparison matrix */\n-\n-/* see notes below */\n-#undef SORT_LAST_ELEMENT_AS_WELL\n-\n-/* gap_pos1 = NUMRES-2; /@ code for gaps inserted by clustalw @/ */\n-static const int GAP_POS2 = NUMRES-1; /* code for gaps already in alignment */\n-static bool DNAFLAG = FALSE;\n-\n-static const char *AMINO_ACID_CODES = "ABCDEFGHIKLMNPQRSTUVWXYZ-";\n-static const char *NUCLEIC_ACID_CODES = "ACGTUN-";\n-/* As far as I understand the gap symbol should not be necessary here,\n- * because we use isgap for testing later anyway. But changing this,\n- * will affect max_res_code and max_nuc as well. So I leave it for now\n- * as it is. AW\n- */\n-\n-static bool percent = TRUE;\n-\n-static void make_ptrs(int *tptr, int *pl, const int naseq, const int l, const int ktup, const int max_res_code, char **seq_array);\n-static void put_frag(const int fs, const int v1, const int v2, const int flen, const int curr_frag, int *next, int *maxsf, int **accum);\n-static bool frag_rel_pos(int a1, int b1, int a2, int b2, int ktup);\n-static void des_quick_sort(int *array1, int *array2, const int array_size);\n-static void pair_align(int seq_no, int l1, int l2, int max_res_code, ktuple_param_t *aln_param,\n- char **seq_array, int *maxsf, int **accum, int max_aln_length,\n- int *zza, int *zzb, int *zzc, int *zzd);\n-static void encode(char *seq, char *naseq, int l, const char *res_codes);\n-static int res_index(const char *lookup, char c);\n-\n-\n-typedef struct {\n- int i1;\n- int i2;\n-} two_ints_t;\n-\n-\n-\n-/* default ktuple pairwise alignment parameters\n- *\n- */\n-/* protein\n- */\n-/* designated initializer */\n-const ktuple_param_t default_protein_param = {\n- .ktup = 1,\n- .wind_gap = 3,\n- .signif = 5,\n- .window = 5,\n-};\n-/* dna\n- */\n-/* designated initializer */\n-const ktuple_param_t default_dna_param = {\n- .ktup = 2,\n- .wind_gap = 5,\n- .signif = 4,\n- .window = 4,\n-};\n-\n-\n-/**\n- * note: naseq should be unit-offset\n- */\n-static void\n-encode(char *seq, char *naseq, int l, const char *res_codes)\n-{\n- /* code seq as ints .. use GAP_POS2 for gap */\n- register int i;\n- bool seq_contains_unknown_char = FALSE;\n- /*LOG_DEBUG("seq=%s naseq=%p l=%d", &(seq[1]), naseq, l); */\n-\n-\n- for (i=1; i<=l; i++) {\n- char res = toupper(seq[i]);\n- if (isgap(res)) {\n- naseq[i] = GAP_POS2; /* gap in input */\n- } else {\n- naseq[i] = res_index(res_codes, res);\n- }\n-\n- /*LOG_DEBUG("Character \'%c\' at pos %d", res, i);*/\n- if (-1 == naseq[i]) {\n- seq_contains_unknown_char = TRUE;\n- '..b'max_res_code+1), aln_param.ktup)+1 ? \n- max_aln_length : pow((max_res_code+1), aln_param.ktup)+1;\n-\n- /*\n- *\n- * conversion to old style clustal done (in no time) */\n-\n-\n- accum = (int **) CKCALLOC(5, sizeof (int *));\n- for (i=0;i<5;i++) {\n- accum[i] = (int *) CKCALLOC((2*max_aln_length+1), sizeof(int));\n- }\n- zza = (int *) CKCALLOC( (max_aln_length+1), sizeof(int));\n- zzb = (int *) CKCALLOC( (max_aln_length+1), sizeof(int));\n- zzc = (int *) CKCALLOC( (max_aln_length+1), sizeof(int));\n- zzd = (int *) CKCALLOC( (max_aln_length+1), sizeof(int));\n-\n- /* estimation of total number of steps (if istart and jstart are\n- * both 0) (now handled in the calling routine)\n- */\n- /* uTotalStepNo = iend*jend - iend*iend/2 + iend/2;\n- uStepNo = 0; */\n- /*LOG_DEBUG("istart=%d iend=%d jstart=%d jend=%d", istart, iend, jstart, jend);*/\n-\n- for (i=istart+1; i<=iend; ++i) {\n- /* by definition a sequence compared to itself should give\n- a score of 0. AW */\n- SymMatrixSetValue(tmat, i-1, i-1, 0.0);\n- make_ptrs(zza, zzc, i, seqlen_array[i], aln_param.ktup, max_res_code, seq_array);\n-\n-#ifdef HAVE_OPENMP\n- #pragma omp critical(ktuple)\n-#endif\n- {\n- ProgressLog(prProgress, *ulStepNo, ulTotalStepNo, FALSE);\n- }\n-\n- for (j=MAX(i+1, jstart+1); j<=jend; ++j) {\n- (*ulStepNo)++;\n- private_step_no++;\n- /*LOG_DEBUG("comparing pair %d:%d", i, j);*/\n-\n- make_ptrs(zzb, zzd, j, seqlen_array[j], aln_param.ktup, max_res_code, seq_array);\n- pair_align(i, seqlen_array[i], seqlen_array[j], max_res_code, &aln_param,\n- seq_array, &maxsf, accum, max_aln_length, zza, zzb, zzc, zzd);\n-\n- if (!maxsf) {\n- calc_score=0.0;\n- } else {\n- calc_score=(double)accum[0][maxsf];\n- if (percent) {\n- dsr=(seqlen_array[i]<seqlen_array[j]) ?\n- seqlen_array[i] : seqlen_array[j];\n- calc_score = (calc_score/(double)dsr) * 100.0;\n- }\n- }\n-\n- /* printf("%d %d %d\\n", i-1, j-1, (100.0 - calc_score)/100.0); */\n- SymMatrixSetValue(tmat, i-1, j-1, (100.0 - calc_score)/100.0);\n-\n- /* the function allows you not to compute the full matrix.\n- * here we explicitely make the resulting matrix a\n- * rectangle, i.e. we always set full rows. in other\n- * words, if we don\'t complete the full matrix then we\n- * don\'t have a full symmetry. so only use the defined\n- * symmetric part. AW\n- */\n- /*LOG_DEBUG("setting %d : %d = %f", j, i, tmat[i][j]);*/\n- /* not needed anymore since we use symmatrix_t\n- if (j<=iend) {\n- tmat[j][i] = tmat[i][j];\n- }\n- */\n-#ifdef HAVE_OPENMP\n- #pragma omp critical(ktuple)\n-#endif\n- {\n- Log(&rLog, LOG_DEBUG, "K-tuple distance for sequence pair %d:%d = %lg",\n- i, j, SymMatrixGetValue(tmat, i-1, j-1));\n- }\n- }\n- }\n- /*\n- Log(&rLog, LOG_FORCED_DEBUG, "uTotalStepNo=%d for istart=%d iend=%d jstart=%d jend=%d", uStepNo, istart, iend, jstart, jend);\n- Log(&rLog, LOG_FORCED_DEBUG, "Fabian = %d", iend*jend - iend*iend/2 + iend/2);\n- */\n-\n-/* printf("\\n\\n%d\\t%d\\t%d\\t%d\\n\\n", omp_get_thread_num(), uStepNo, istart, iend); */\n-\n- for (i=0;i<5;i++) {\n- CKFREE(accum[i]);\n- }\n- CKFREE(accum);\n-\n-#ifdef HAVE_OPENMP\n- #pragma omp critical(ktuple)\n-#if 0\n- {\n- printf("steps: %d\\n", private_step_no);\n- }\n-#endif\n-#endif\n-\n- CKFREE(zza);\n- CKFREE(zzb);\n- CKFREE(zzc);\n- CKFREE(zzd);\n-\n- free(seqlen_array);\n-\n- for (i=1; i<=mseq->nseqs; i++) {\n- CKFREE(seq_array[i]);\n- }\n- CKFREE(seq_array);\n-}\n-/* end of KTuplePairDist */\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/clustal/ktuple_pair.h --- a/clustalomega/clustal-omega-0.2.0/src/clustal/ktuple_pair.h Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,47 +0,0 @@ -/********************************************************************* - * Clustal Omega - Multiple sequence alignment - * - * Copyright (C) 2010 University College Dublin - * - * Clustal-Omega is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This file is part of Clustal-Omega. - * - ********************************************************************/ - -/* - * RCS $Id: ktuple_pair.h 193 2011-02-07 15:45:21Z andreas $ - */ - -/* K-Tuple code for pairwise alignment (Wilbur and Lipman (1983) - * Most code taken from showpair (Clustal 1.83) - */ - - -#ifndef CLUSTALO_KTUPLE_PAIR_H -#define CLUSTALO_KTUPLE_PAIR_H - -#include "seq.h" -#include "symmatrix.h" -#include "progress.h" - -typedef struct { - int ktup; - int window; - int wind_gap; - int signif; -} ktuple_param_t; - - -extern void -KTuplePairDist(symmatrix_t *tmat, mseq_t *mseq, - int istart, int iend, - int jstart, int jend, - ktuple_param_t *aln_param, - progress_t *prProgress, - unsigned long int *ulStepNo, unsigned long int ulTotalStepNo); - -#endif |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/clustal/list.c --- a/clustalomega/clustal-omega-0.2.0/src/clustal/list.c Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,389 +0,0 @@\n-/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n-\n-/*********************************************************************\n- * Clustal Omega - Multiple sequence alignment\n- *\n- * Copyright (C) 2010 University College Dublin\n- *\n- * Clustal-Omega is free software; you can redistribute it and/or\n- * modify it under the terms of the GNU General Public License as\n- * published by the Free Software Foundation; either version 2 of the\n- * License, or (at your option) any later version.\n- *\n- * This file is part of Clustal-Omega.\n- *\n- ********************************************************************/\n-\n-/*\n- * RCS $Id: list.c 156 2010-11-18 10:52:40Z andreas $\n- *\n- * Single linked list and FIFO/Queue\n- *\n- * Based on Kyle Loudon\'s Mastering Algorithms with C\n- * http://oreilly.com/catalog/9781565924536\n- *\n- * Allows generic data types by using void* pointers, which works fine\n- * as long as your data is just pointers.\n- *\n- */\n-\n-\n-#ifdef HAVE_CONFIG_H\n-#include "config.h"\n-#endif\n-\n-#include <assert.h>\n-#include <string.h> /* for memset */\n-\n-#include "list.h"\n-\n-#ifdef LIST_TEST\n-#include <stdio.h>\n-#include "queue.h"\n-#include "time.h"\n-#endif\n-\n-/**\n- * @brief Initialise data members of a list\n- *\n- * @param[in] prList\n- * List to initialise\n- * @param[in] destroy\n- * A function to be called with pointer to data when destroying the\n- * list. NULL if in doubt, free in most other cases.\n- * Note: doxygen will always fail to parse this...\n- */\n-void\n-ListInit(list_t *prList, void (*destroy)(void *data)) {\n- prList->size = 0;\n- prList->destroy = destroy;\n- prList->head = NULL;\n- prList->tail = NULL;\n- \n- return;\n-}\n-/* end of ListInit() */\n-\n-\n-\n-/**\n- * @brief Calls user defined function to free data in list and resets\n- * the list to NULL. Call even if your destroy function is NULL.\n- *\n- * @param[in] prList\n- * The list to destroy\n- *\n- */\n-void\n-ListDestroy(list_t *prList) {\n- void *pvData;\n-\n- while (LIST_SIZE(prList) > 0) {\n- if (0 == ListRemoveNext(prList, NULL, (void **)&pvData)\n- &&\n- NULL != prList->destroy) {\n- prList->destroy(pvData);\n- }\n- }\n- /* precaution */\n- memset(prList, 0, sizeof(list_t));\n- \n- return;\n-}\n-/* end of ListDestroy() */\n-\n-\n-\n-/**\n- *\n- * @brief Insert data next to given element\n- *\n- * @param[in] prList\n- * List into which to insert\n- * @param[in] prElement\n- * Current position/element. Element after which to insert. If NULL\n- * head is used.\n- * @param[in] pvData\n- * Pointer to data to store\n- *\n- * @return Non-zero on failure\n- */\n-int\n-ListInsertNext(list_t *prList, list_elem_t *prElement, const void *pvData)\n-{\n- list_elem_t *prNewElement;\n-\n- if (NULL == (prNewElement = (list_elem_t *) malloc(sizeof(list_elem_t))))\n- return -1;\n-\n- prNewElement->data = (void *)pvData;\n- \n- if (NULL == prElement) {\n- /* insertion at head */\n- if (LIST_SIZE(prList) == 0)\n- prList->tail = prNewElement;\n- prNewElement->next = prList->head;\n- prList->head = prNewElement;\n- \n- } else {\n- /* insert somewhere other than at head */\n- if (NULL == prElement->next)\n- prList->tail = prNewElement;\n- prNewElement->next = prElement->next;\n- prElement->next = prNewElement;\n- }\n-\n- prList->size++;\n-\n- return 0;\n-}\n-/* end of ListInsertNext() */\n-\n-\n-\n-/**\n- * @brief Remove next element from current element/position.\n- *\n- * @param[in] prList\n- * List from which an element is to be removed.\n- * @param[in] prElement\n- * Current element/position. Next item will be removed. If NULL head\n- * is used.\n- * @param[out] pvData_p\n- * Will be pointed to removed elements data.\n- *\n- * @return Non-zero on failure\n- */\n-int\n-ListRemoveNext(list_t *prList, list_elem_t *prElement, void **pvData_p)\n-{\n- list_elem_t *prOldElement;\n-\n- if (0 == LIST_SIZE(prList))\n- return -1;\n-\n- '..b'ram[in] prList\n- * List from which an element is to be removed.\n- * @param[in] prElement\n- * Current element/position. Next item will be removed. If NULL head\n- * is used.\n- * @param[out] iData_p\n- * Will be pointed to removed elements data.\n- *\n- * @return Non-zero on failure\n- *\n- */\n-int\n-IntListRemoveNext(list_t *prList, list_elem_t *prElement, int *iData_p)\n-{\n- int *piData;\n- int res;\n- res = ListRemoveNext(prList, prElement, (void **)&piData);\n- *iData_p = *piData;\n- prList->destroy(piData);\n- return res;\n-}\n-/* end of IntListRemoveNext */\n-\n-\n-\n-\n-#ifdef LIST_TEST\n-/* gcc list.c -o list_test -ansi -Wall -DLIST_TEST */\n- \n-int main(int argc, char **argv)\n-{\n-\n- int i;\n- list_t *mylist;\n- int_list_t *myintlist;\n- queue_t *myqueue;\n- int_queue_t *myintqueue;\n- int res;\n-\n- int iSeed = (int)time(NULL);\n- srand((unsigned int)iSeed);\n- \n- printf("%s", "list test! also delete #include!\\n");\n- \n-\n- mylist = malloc(sizeof(list_t));\n- ListInit(mylist, NULL);\n-\n- printf("LIST test\\n");\n-\n- for (i=0; i<argc; i++) {\n- res = LIST_APPEND(mylist, argv[i]);\n- printf("LIST Result for appending \'%s\' was %d\\n", argv[i], res);\n- }\n-\n- while (LIST_SIZE(mylist)) {\n- char *argv_ptr;\n- if (ListRemoveNext(mylist, NULL, (void **)&argv_ptr))\n- perror("ListRemoveNext() failed");\n- printf("LIST Popped %s\\n", argv_ptr);\n- }\n- printf("LIST %s", "No more elements to pop");\n- \n- /* could become list_free */\n- ListDestroy(mylist);\n- free(mylist);\n-\n- \n-\n-\n- myintlist = malloc(sizeof(list_t));\n- INT_LIST_INIT(myintlist);\n-\n- printf("\\n");\n- printf("%s", "INT_LIST test");\n-\n- for (i=0; i<argc; i++) {\n- int data = 666-i;\n- res = INT_LIST_APPEND(myintlist, data);\n- printf("INT_LIST Result for appending \'%d\' was %d\\n", data, res);\n- }\n-\n- while (INT_LIST_SIZE(myintlist)) {\n- int data;\n- if (IntListRemoveNext(myintlist, NULL, &data))\n- perror("ListRemoveNext() failed\\n");\n- printf("INT_LIST Popped %d\\n", data);\n- }\n- printf("INT_LIST %s\\n", "No more elements to pop");\n- \n- /* could become list_free */\n- INT_LIST_DESTROY(myintlist);\n- free(myintlist);\n-\n-\n-\n-\n- \n- myqueue = malloc(sizeof(queue_t));\n- QUEUE_INIT(myqueue, NULL);\n-\n- printf("\\n");\n- printf("%s", "QUEUE test\\n");\n-\n- for (i=0; i<argc; i++) {\n- res = QUEUE_PUSH(myqueue, argv[i]);\n- printf("QUEUE Result for pushing \'%s\' was %d\\n", argv[i], res);\n- }\n-\n- while (! QUEUE_EMPTY(myqueue)) {\n- char *argv_ptr;\n- if (QUEUE_POP(myqueue, (void **)&argv_ptr))\n- perror("QUEUE_POP() failed\\n");\n- printf("QUEUE Popped %s\\n", argv_ptr);\n- }\n- printf("QUEUE %s\\n", "QUEUE No more elements to pop");\n- \n- /* could become list_free */\n- QUEUE_DESTROY(myqueue);\n- free(myqueue);\n-\n-\n-\n-\n- myintqueue = malloc(sizeof(queue_t));\n- INT_QUEUE_INIT(myintqueue);\n-\n- printf("\\n");\n- printf("%s\\n", "INT_QUEUE test");\n-\n- for (i=0; i<argc; i++) {\n- res = INT_QUEUE_PUSH(myintqueue, i);\n- printf("INT_QUEUE Result for appending \'%d\' was %d\\n", i, res);\n- }\n-\n- while (! INT_QUEUE_EMPTY(myintqueue)) {\n- int data;\n- int rand_data;\n- if (INT_QUEUE_POP(myintqueue, &data))\n- perror("INT_QUEUE_POP() failed\\n");\n- printf("INT_QUEUE Popped %d\\n", data);\n-\n- rand_data = (int)( 10.0 * rand() / ( RAND_MAX+1.0));\n- if (! (rand_data%3)) {\n- res = INT_QUEUE_PUSH(myintqueue, rand_data);\n- printf("INT_QUEUE Result for pushing random number \'%d\' was %d\\n", rand_data, res); \n- }\n- }\n- printf("INT_QUEUE %s\\n", "INT_QUEUE No more elements to pop");\n- \n- /* could become list_free */\n- INT_QUEUE_DESTROY(myintqueue);\n- free(myintqueue);\n- \n-\n- exit(0);\n-}\n-\n-#endif\n-\n-\n-\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/clustal/list.h --- a/clustalomega/clustal-omega-0.2.0/src/clustal/list.h Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,105 +0,0 @@ -/********************************************************************* - * Clustal Omega - Multiple sequence alignment - * - * Copyright (C) 2010 University College Dublin - * - * Clustal-Omega is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This file is part of Clustal-Omega. - * - ********************************************************************/ - -/* - * RCS $Id: list.h 193 2011-02-07 15:45:21Z andreas $ - * - * Generic single linked list storing pointers to data - * - */ - -#ifndef CLUSTALO_LIST_H -#define CLUSTALO_LIST_H - -#include <stdlib.h> - -typedef struct list_elem_s { - void *data; - struct list_elem_s *next; -} list_elem_t; - -typedef struct { - /* size of list */ - int size; - /* user defined function for freeing data */ - void (*destroy)(void *data); - list_elem_t *head; - list_elem_t *tail; -} list_t; - -void ListInit(list_t *prList, void (*destroy)(void *data)); - -void ListDestroy(list_t *prList); - -int ListInsertNext(list_t *prList, list_elem_t *prElement, const void *data); - -#define LIST_APPEND(prList, data) ListInsertNext((prList), LIST_TAIL(prList), (data)) - -#define LIST_PREPEND(prList, data) ListInsertNext((prList), CLUSTALO_LIST_HEAD(prList), (data)) - -int ListRemoveNext(list_t *prList, list_elem_t *prElement, void **data); - -#define LIST_SIZE(prList) ((prList)->size) - -#define CLUSTALO_LIST_HEAD(prList) ((prList)->head) - -#define LIST_TAIL(prList) ((prList)->tail) - -#define LIST_IS_HEAD(prList, prElement) ((prElement) == (prList)->head ? 1 : 0) - -#define LIST_IS_TAIL(prElement) ((prElement)->next == NULL ? 1 : 0) - -#define LIST_DATA(prElement) ((prElement)->data) - -#define LIST_NEXT(prElement) ((prElement)->next) - - - - - -/* special int list: stores ints by copying them (instead of storing - * pointers as generic list) - * - */ - -typedef list_t int_list_t; - -#define INT_LIST_INIT(prList) ListInit((prList), free) - -#define INT_LIST_DESTROY(prList) ListDestroy((prList)); - -int IntListInsertNext(list_t *prList, list_elem_t *prElement, const int data); - -#define INT_LIST_APPEND(prList, data) IntListInsertNext((prList), LIST_TAIL(prList), (data)) - -#define INT_LIST_PREPEND(prList, data) IntListInsertNext((prList), CLUSTALO_LIST_HEAD(prList), (data)) - -int IntListRemoveNext(list_t *prList, list_elem_t *prElement, int *data); - -#define INT_LIST_SIZE(prList) LIST_SIZE(prList) - -#define INT_CLUSTALO_LIST_HEAD(prList) CLUSTALO_LIST_HEAD_INT((prList)) - -#define INT_LIST_TAIL(prList) LIST_TAIL_INT((prList) ) - -#define INT_LIST_IS_HEAD(prList, prElement) LIST_IS_HEAD(prList, prElement) - -#define INT_LIST_IS_TAIL(prElement) LIST_IS_TAIL((prElement)) - -#define INT_LIST_DATA(prElement) LIST_DATA((prElement)) - -#define INT_LIST_NEXT(prElement) LIST_NEXT((prElement)) - - -#endif |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/clustal/log.c --- a/clustalomega/clustal-omega-0.2.0/src/clustal/log.c Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,379 +0,0 @@ -/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ - -/********************************************************************* - * Clustal Omega - Multiple sequence alignment - * - * Copyright (C) 2010 University College Dublin - * - * Clustal-Omega is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This file is part of Clustal-Omega. - * - ********************************************************************/ - -/* - * RCS $Id$ - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - - -#include <stdio.h> -#include <stdlib.h> -#include <stdarg.h> -#include <assert.h> - -#include "log.h" - -/* a default standard logger */ -log_t rLog; - - - -void -LogVfprintf(FILE *prFP, char *pcFmt, va_list rVArgList); -void -LogWarn(FILE *prFP, char *pcFmt, va_list rVArgList); -void -LogError(FILE *prFP, char *pcFmt, va_list rVArgList); -void -LogCritical(FILE *prFP, char *pcFmt, va_list rVArgList); -void -LogFatal(FILE *prFP, char *pcFmt, va_list rVArgList); -void -LogForcedDebug(FILE *prFP, char *pcFmt, va_list rVArgList); - - - - -/** - * @brief Plain, default print function - * - * Newline character is automatically appended to message. - * - */ -void -LogVfprintf(FILE *prFP, char *pcFmt, va_list rVArgList) -{ - /* print prefix */ - vfprintf(prFP, pcFmt, rVArgList); - fprintf(prFP,"\n"); - -#ifndef NDEBUG - fflush(prFP); -#endif -} -/* end of LogVfprintf() */ - - - -/** - * @brief - * - */ -void -LogWarn(FILE *prFP, char *pcFmt, va_list rVArgList) -{ - fprintf(prFP, "WARNING: "); - LogVfprintf(prFP, pcFmt, rVArgList); -} -/* end of LogWarn() */ - - - -/** - * @brief - * - */ -void -LogError(FILE *prFP, char *pcFmt, va_list rVArgList) -{ - fprintf(prFP, "ERROR: "); - LogVfprintf(prFP, pcFmt, rVArgList); -} -/* end of LogError() */ - - - -/** - * @brief - * - */ -void -LogCritical(FILE *prFP, char *pcFmt, va_list rVArgList) -{ - fprintf(prFP, "CRITICAL ERROR: "); - LogVfprintf(prFP, pcFmt, rVArgList); -} -/* end of LogCritical() */ - - - -/** - * @brief Will also exit! - */ -void -LogFatal(FILE *prFP, char *pcFmt, va_list rVArgList) -{ - fprintf(prFP, "FATAL: "); - LogVfprintf(prFP, pcFmt, rVArgList); - - exit(EXIT_FAILURE); -} -/* end of LogFatal() */ - - - -/** - * @brief - * - */ -void -LogForcedDebug(FILE *prFP, char *pcFmt, va_list rVArgList) -{ - fprintf(prFP, "FORCED DEBUG: "); - LogVfprintf(prFP, pcFmt, rVArgList); -} -/* end of LogForcedDebug() */ - - - -/** - * - * @brief Sets up default function pointers - * - */ -void -LogDefaultSetup(log_t *log) -{ - log->iLogLevelEnabled = LOG_WARN; - - log->prFP[LOG_DEBUG] = stdout; - log->prFP[LOG_INFO] = stdout; - log->prFP[LOG_WARN] = stderr; - log->prFP[LOG_ERROR] = stderr; - log->prFP[LOG_CRITICAL] = stderr; - log->prFP[LOG_FATAL] = stderr; - log->prFP[LOG_FORCED_DEBUG] = stderr; - - log->prFunc[LOG_DEBUG] = &LogVfprintf; - log->prFunc[LOG_INFO] = &LogVfprintf; - log->prFunc[LOG_WARN] = &LogWarn; - log->prFunc[LOG_ERROR] = &LogError; - log->prFunc[LOG_CRITICAL] = &LogCritical; - log->prFunc[LOG_FATAL] = &LogFatal; - log->prFunc[LOG_FORCED_DEBUG] = &LogForcedDebug; -} -/* end of LogDefaultSetup() */ - - - -/** - * @brief Log to certain level - * - * See also comp.lang.c FAQ list · Question 15.12 - * http://c-faq.com/varargs/handoff.html How can I write a function which - * takes a variable number of arguments and passes them to some other function - * (which takes a variable number of arguments)? - * - */ -void -Log(log_t *prLog, int iLevel, char *pcFmt, ...) -{ - va_list rVArgList; - void (*prFunc) (FILE *prFP, char *pcFormat, va_list rVArgList); - FILE *prFP; - - assert(iLevel>=0 && iLevel<=LOG_NUM_LEVELS); - - /* fprintf(stderr, "DEBUG: iLevel=%d and iLogLevelEnabled=%d\n", iLevel, prLog->iLogLevelEnabled); */ - - /* return if below current loglevel */ - if (iLevel < prLog->iLogLevelEnabled) { - return; - } - - prFunc = prLog->prFunc[iLevel]; - prFP = prLog->prFP[iLevel]; - - /* return if muted */ - if (NULL == prFunc) { - return; - } - - va_start(rVArgList, pcFmt); - prFunc(prFP, pcFmt, rVArgList); - va_end(rVArgList); -} -/* end of Log() */ - - - -/** - * - * @brief Change file pointer for certain level - * - */ -void -LogSetFP(log_t *prLog, int iLevel, FILE *prFP) -{ - assert(iLevel>=0 && iLevel<=LOG_NUM_LEVELS); - - prLog->prFP[iLevel] = prFP; -} -/* end of LogSetFP() */ - - - -/** - * - * @brief Return file pointer for certain level - * - */ -FILE * -LogGetFP(log_t *prLog, int iLevel) -{ - assert(iLevel>=0 && iLevel<=LOG_NUM_LEVELS); - - return prLog->prFP[iLevel]; -} -/* end of LogGetFP() */ - - - - - -/** - * - * @brief Change file pointer for all levels - * - */ -void -LogSetFPForAll(log_t *prLog, FILE *prFP) -{ - int iAux; - - for (iAux=0; iAux<LOG_NUM_LEVELS; iAux++) { - prLog->prFP[iAux] = prFP; - } -} -/* end of LogSetFP() */ - - - -/** - * - * @brief Mute certain level (i.e set the corresponding function to NULL) - * - */ -void -LogMute(log_t *prLog, int iLevel) -{ - assert(iLevel>=0 && iLevel<=LOG_NUM_LEVELS); - - prLog->prFunc[iLevel] = NULL; -} -/* end of LogMute() */ - - -/** - * - * @brief Mute all channels - * - */ -void -LogMuteAll(log_t *prLog) -{ - int iAux; - - for (iAux=0; iAux<LOG_NUM_LEVELS; iAux++) { - LogMute(prLog, iAux); - } -} -/* end of LogMuteAll() */ - - - -/** - * @brief - * - */ -void -LogFuncOverwrite(log_t *prLog, int iLevel, - void (*Func) (FILE *prFP, char *pcFormat, va_list rVArgList)) -{ - assert(iLevel>=0 && iLevel<=LOG_NUM_LEVELS); - - prLog->prFunc[iLevel] = Func; - -} -/* end of LogFuncOverwrite() */ - - - -#ifdef LOG_TEST - - -#define TEXT "Lorem ipsum dolor sit amet" - -void -PrintSomeTextToAll(log_t *prLog) { - int iAux; - for (iAux=0; iAux<LOG_NUM_LEVELS; iAux++) { - Log(prLog, iAux, TEXT); - } -} - - -int -main(int argc, char**argv) { - log_t prLog; - log_t pr2ndLog; - FILE *prFP; - char *pcTmpFileName = "schmock.txt"; - - prFP = fopen(pcTmpFileName, "w"); - - - LogDefaultSetup(&prLog); - LogDefaultSetup(&pr2ndLog); - - printf("Printing to log:\n"); - PrintSomeTextToAll(&prLog); - printf("---\n"); - - printf("Printing to pr2ndLog:\n"); - PrintSomeTextToAll(&prLog); - printf("---\n"); - - - - printf("Changing second log's FP to write to '%s'\n", pcTmpFileName); - LogSetFPForAll(&pr2ndLog, prFP); - - printf("Printing to pr2ndLog:\n"); - PrintSomeTextToAll(&pr2ndLog); - printf("---\n"); - - - printf("Changing Info() to new function (Fatal()) in log:\n"); - LogFuncOverwrite(&prLog, LOG_INFO, &LogFatal); - - printf("Printing to log:\n"); - PrintSomeTextToAll(&prLog); - printf("---\n"); - - - - fclose(prFP); - - return 0; -} - - -#endif |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/clustal/log.h --- a/clustalomega/clustal-omega-0.2.0/src/clustal/log.h Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,81 +0,0 @@ -/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ - -/********************************************************************* - * Clustal Omega - Multiple sequence alignment - * - * Copyright (C) 2010 University College Dublin - * - * Clustal-Omega is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This file is part of Clustal-Omega. - * - ********************************************************************/ - -/* - * RCS $Id$ - */ - - -#include <stdio.h> -#include <stdarg.h> - -#ifndef LOG_H -#define LOG_H - - -#define LOG_DEBUG 0 -#define LOG_VERBOSE 1 -#define LOG_INFO 2 -#define LOG_WARN 3 -#define LOG_FORCED_DEBUG 4 -#define LOG_ERROR 5 -#define LOG_CRITICAL 6 -#define LOG_FATAL 7 - -#define LOG_NUM_LEVELS 8 - - -typedef struct { - /* the higher the level, the more priority it has. numbers must be - * sequential - */ - - /* array of function pointers */ - void (*prFunc[LOG_NUM_LEVELS]) (FILE *prFP, char *pcFormat, va_list rVArgList); - FILE *prFP[LOG_NUM_LEVELS]; - char *prPrefix[LOG_NUM_LEVELS]; - - /* everything above this level will be printed */ - int iLogLevelEnabled; -} log_t; - - - -/* a standard logger */ -extern log_t rLog; - - - -void -LogDefaultSetup(log_t *log); -void -Log(log_t *prLog, int iLevel, char *pcFmt, ...); -void -LogSetFP(log_t *log, int level, FILE *fp); -void -LogSetFPForAll(log_t *log, FILE *fp); -FILE * -LogGetFP(log_t *prLog, int iLevel); -void -LogMute(log_t *log, int level); -void -LogMuteAll(log_t *log); -void -LogFuncOverwrite(log_t *prLog, int iLevel, - void (*Func) (FILE *prFP, char *pcFormat, va_list rVArgList)); - - -#endif |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/clustal/mbed.c --- a/clustalomega/clustal-omega-0.2.0/src/clustal/mbed.c Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,1553 +0,0 @@\n-/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n-\n-/*********************************************************************\n- * Clustal Omega - Multiple sequence alignment\n- *\n- * Copyright (C) 2010 University College Dublin\n- *\n- * Clustal-Omega is free software; you can redistribute it and/or\n- * modify it under the terms of the GNU General Public License as\n- * published by the Free Software Foundation; either version 2 of the\n- * License, or (at your option) any later version.\n- *\n- * This file is part of Clustal-Omega.\n- *\n- ********************************************************************/\n-\n-/*\n- * RCS $Id: mbed.c 242 2011-05-27 14:04:21Z andreas $\n- *\n- *\n- * Reimplementation from scratch of mBed:\n- * Blackshields et al. (2010); PMID 20470396\n- *\n- *\n- */\n-\n-#ifdef HAVE_CONFIG_H\n-#include "config.h"\n-#endif\n-\n-#include <assert.h>\n-#include <float.h>\n-\n-#include "mbed.h"\n-#include "pair_dist.h"\n-#include "symmatrix.h"\n-#include "ktuple_pair.h"\n-#include "tree.h"\n-#include "util.h"\n-#include "progress.h"\n-#include "queue.h"\n-\n-#include "log.h"\n-#include "kmpp/KMeans.h"\n-#include "mbed.h"\n-\n-#define TIMING 0\n-#if TIMING\n-#include "squid/stopwatch.h"\n-#endif\n-\n-\n-/* If FULL_WITHIN_CLUSTER_DISTANCES is not 0, distances within each\n- * bisecting kmeans subcluster are not estimated using the vectors,\n- * but calculated normally (using ktuple or kimura). Surprisingly this\n- * results in 3% loss on a Homfam p24-h2010-08-09 subset (100-5000\n- * seqs in test, at least 5 ref seqs; MAX_SEQ 100 vs 10000; NUM_SEEDS\n- * log2 instead of log2^2). And of course it slows things down.\n- */\n-#define FULL_WITHIN_CLUSTER_DISTANCES 1\n-\n-\n-/* Cluster size limits. Maximum is a soft limit, which might be\n- * exceeded if a K-Means split was unsuccesful, where unsuccesful\n- * might also mean that the minimum required number seqs. was not\n- * reached */\n-#if FULL_WITHIN_CLUSTER_DISTANCES\n-static const int MAX_ALLOWED_SEQ_PER_PRECLUSTER = 100;\n-static const int MIN_REQUIRED_SEQ_PER_PRECLUSTER = 1;\n-#else\n-static const int MAX_ALLOWED_SEQ_PER_PRECLUSTER = 10000;\n-static const int MIN_REQUIRED_SEQ_PER_PRECLUSTER = 100;\n-#endif\n-\n-/* How many restarts per bisecting kmeans split. 10 give 0.5% increase\n- * in quality on original HOMFAM over just 1. It also increases kmeans\n- * time by a factor of ~3, but overall time is insignificant\n- * compared to pairdist/progressive alignment part.\n- */\n-static const int RESTARTS_PER_SPLIT = 10;\n-\n-\n-/* Use standard kmeans (lloyds) or kmeans++. Both are almost\n- * indistinguishable here, although kmeans++ is slightly ahead the\n- * fewer seeds you pick (and it should be better in theory)\n- */\n-#define USE_KMEANS_LLOYDS 0\n-\n-\n-#ifndef HAVE_LOG2\n-#define log2(x) (log(x) / 0.69314718055994530942)\n-#endif\n-#define NUMBER_OF_SEEDS(n) pow(log2(((double)n)), 2)\n-\n-\n-/* Seed selection method: SAMPLE_SEEDS_BY_LENGTH is the original mBed\n- * approach: Sample iSeeds sequence with constant stride from length-sorted X.\n- * It might be better to pick the seeds randomly, because length sorting might\n- * be more prone to including outliers (e.g. very long and very short seqs).\n- * However, we could never observer such a thing. So just stick to the\n- * original version as this also removes the random element.\n- */\n-enum SEED_SELECTION_TYPE {\n- SELECT_SEEDS_RANDOMLY,\n- SELECT_SEEDS_BY_LENGTH\n-};\n-#define SEED_SELECTION SELECT_SEEDS_BY_LENGTH\n-\n-\n-/* Tests on BAliBase (RV11,12,20,30,40,50; 10 runs each) show there is\n- * no difference between mbed-trees created from cosine or euclidean\n- * distances (simple version, just using disparities).\n- */\n-#define USE_EUCLIDEAN_DISTANCE 1\n-\n-\n-/* print some mbed pre-cluster usage to screen */\n-#define PRINT_CLUSTER_DISTRIBUTION 0\n-\n-\n-#define TRACE 0\n-\n-\n-typedef struct {\n- /* Number of final clusters\n- */\n- int iNClusters;\n-\n- /* Coordinates (columns) for each cluster (rows)\n- * valid indices: [0...iNClusters][0...dim-1'..b' iClusterIndex, prKMeansResult->iNClusters);\n- SymMatrixPrint(prWithinClusterDistances, ppcLabels, NULL);\n-#endif\n-\n- \n- GuideTreeUpgma(&prSubClusterTree, ppcLabels,\n- prWithinClusterDistances, NULL);\n-\n- CKFREE(ppcLabels); /* don\'t free members, they just point */\n-#if 0\n- Log(&rLog, LOG_FORCED_DEBUG, "Cluster %d guide-tree:", iClusterIndex);\n- LogTree(prSubClusterTree);\n-#endif\n-\n- \n- /* The guide tree id\'s (that point to the sequences) now start\n- * from 0, i.e. the association with the prMSeq numbering is\n- * broken and fixed in the following\n- */\n- for (iNodeIndex = 0; iNodeIndex < (int)GetNodeCount(prSubClusterTree); iNodeIndex++) {\n- if (IsLeaf(iNodeIndex, prSubClusterTree)) {\n- int iLeafId = GetLeafId(iNodeIndex, prSubClusterTree);\n- int iRealId = prKMeansResult->ppiObjIndicesPerCluster[iClusterIndex][iLeafId];\n-#if 0\n- Log(&rLog, LOG_FORCED_DEBUG, "Correcting leaf node %d which has (wrong) id %d and name %s to id %d (prMSeq name %s)",\n- iNodeIndex, iLeafId,\n- GetLeafName(iNodeIndex, prSubClusterTree),\n- iRealId, prMSeq->sqinfo[iRealId].name);\n-#endif\n- SetLeafId(prSubClusterTree, iNodeIndex, iRealId);\n- }\n- }\n-\n-\n- /* Append the newly created tree (prSubClusterTree) to the\n- * corresponding node index of prMbedTree_p.\n- */\n-#if TRACE\n- Log(&rLog, LOG_FORCED_DEBUG, "Will join trees at leaf node %d = %s",\n- piClusterToTreeNode[iClusterIndex],\n- GetLeafName(piClusterToTreeNode[iClusterIndex], *prMbedTree_p));\n-#endif\n-\n- AppendTree(*prMbedTree_p,\n- piClusterToTreeNode[iClusterIndex],\n- prSubClusterTree);\n- /* Note: piClusterToTreeNode is still valid, because\n- * AppendTrees() guarantees that no other than the node to\n- * append to changes. */\n-\n-#if 0\n- Log(&rLog, LOG_FORCED_DEBUG, "%s", "prMbedTree_p after cluster %d has appended:", iClusterIndex);\n- LogTree(*prMbedTree_p);\n-\n- if (0) {\n- char fname[] = "mbed-joined-tree.dnd";\n- FILE *pfOut;\n- if (NULL == (pfOut = fopen(fname, "w"))) {\n- Log(&rLog, LOG_FATAL, "Couldn\'t open %s for writing", fname);\n- }\n- MuscleTreeToFile(pfOut, *prMbedTree_p);\n- Log(&rLog, LOG_FORCED_DEBUG, "Joined tree written to %s", fname);\n- fclose(pfOut);\n- Log(&rLog, LOG_FATAL, "DEBUG EXIT");\n- }\n-#endif\n-\n- /* cleanup\n- */\n- FreeMuscleTree(prSubClusterTree);\n- FreeSymMatrix(&prWithinClusterDistances);\n-#if FULL_WITHIN_CLUSTER_DISTANCES\n- FreeMSeq(&prSubClusterMSeq);\n-#endif\n- } /* end for each cluster */\n- ProgressDone(prSubClusterDistanceProgress);\n- FreeProgress(&prSubClusterDistanceProgress);\n-\n- \n- if (NULL != pcGuidetreeOut) {\n- if (NULL == (pfOut = fopen(pcGuidetreeOut, "w"))) {\n- Log(&rLog, LOG_ERROR, "Couldn\'t open %s for writing", pcGuidetreeOut);\n- } else {\n- MuscleTreeToFile(pfOut, *prMbedTree_p);\n- Log(&rLog, LOG_INFO, "Guide tree written to %s", pcGuidetreeOut);\n- (void) fclose(pfOut);\n- }\n- }\n-\n- \n- /* cleanup\n- *\n- */\n-#if MBED_TIMING\n- StopwatchStop(stopwatch);\n- StopwatchDisplay(stdout, "mBed time (without pairwise distance computation): ", stopwatch);\n- StopwatchFree(stopwatch);\n-#endif\n-\n- FreeKMeansResult(&prKMeansResult);\n- FreeSymMatrix(&prPreClusterDistmat);\n- for (iI=0; iI<prMSeq->nseqs; iI++) {\n- CKFREE(ppdSeqVec[iI]);\n- }\n- CKFREE(ppdSeqVec);\n- CKFREE(piClusterToTreeNode);\n-\n-#ifndef NDEBUG\n- TreeValidate(*prMbedTree_p);\n-#endif\n- \n- return 0;\n-}\n-/*** end: Mbed() ***/\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/clustal/mbed.h --- a/clustalomega/clustal-omega-0.2.0/src/clustal/mbed.h Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,30 +0,0 @@ -/********************************************************************* - * Clustal Omega - Multiple sequence alignment - * - * Copyright (C) 2010 University College Dublin - * - * Clustal-Omega is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This file is part of Clustal-Omega. - * - ********************************************************************/ - -/* - * RCS $Id: mbed.h 193 2011-02-07 15:45:21Z andreas $ - */ - -#ifndef CLUSTALO_MBED_H -#define CLUSTALO_MBED_H - -#include "muscle_tree.h" -#include "seq.h" - - -extern int -Mbed(tree_t **tree, mseq_t *prMSeq, - const int iPairDistType, const char *pcGuidetreeOutfile); - -#endif |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/clustal/muscle_tree.c --- a/clustalomega/clustal-omega-0.2.0/src/clustal/muscle_tree.c Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,2017 +0,0 @@\n-/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n-\n-/* This a mix of tree functions and data-structures from\n- * Bob Edgar\'s Muscle (version 3.7) ported to pure C, topped up with\n- * some of our own stuff.\n- *\n- * Used files: phy.cpp, tree.h, phytofile.cpp and phyfromclust.cpp\n- *\n- * Muscle\'s code is public domain and so is this code here.\n-\n- * From http://www.drive5.com/muscle/license.htm:\n- * """\n- * MUSCLE is public domain software\n- *\n- * The MUSCLE software, including object and source code and\n- * documentation, is hereby donated to the public domain.\n- *\n- * Disclaimer of warranty\n- * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,\n- * EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION IMPLIED\n- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n- * """\n- *\n- */\n-\n-/*\n- * RCS $Id: muscle_tree.c 230 2011-04-09 15:37:50Z andreas $\n- */\n-\n-#include <stdlib.h>\n-#include <stdio.h>\n-#include <string.h>\n-#include <limits.h>\n-#include <assert.h>\n-#include <ctype.h>\n-\n-#include "util.h"\n-#include "log.h"\n-#include "muscle_tree.h"\n-\n-\n-static const double VERY_NEGATIVE_DOUBLE = -9e29;\n-/*const double dInsane = VERY_NEGATIVE_DOUBLE;*/\n-static const double dInsane = -9e29;\n-static const unsigned uInsane = 8888888;\n-\n-typedef enum \n-{\n- NTT_Unknown,\n-\n- /* Returned from Tree::GetToken: */\n- NTT_Lparen,\n- NTT_Rparen,\n- NTT_Colon,\n- NTT_Comma,\n- NTT_Semicolon,\n- NTT_String,\n- \n- /* Following are never returned from Tree::GetToken: */\n- NTT_SingleQuotedString,\n- NTT_DoubleQuotedString,\n- NTT_Comment\n-} NEWICK_TOKEN_TYPE;\n-\n-\n-static void\n-InitCache(uint uCacheCount, tree_t *tree);\n-static void\n-TreeZero(tree_t *tree);\n-static uint\n-GetNeighborCount(unsigned uNodeIndex, tree_t *tree);\n-static bool\n-IsEdge(unsigned uNodeIndex1, unsigned uNodeIndex2, tree_t *tree);\n-static bool\n-HasEdgeLength(uint uNodeIndex1, uint uNodeIndex2, tree_t *tree);\n-static void\n-TreeToFileNodeRooted(tree_t *tree, uint m_uRootNodeIndex, FILE *fp);\n-static void\n-ValidateNode(uint uNodeIndex, tree_t *tree);\n-static void\n-AssertAreNeighbors(unsigned uNodeIndex1, unsigned uNodeIndex2, tree_t *tree);\n-static void\n-ExpandCache(tree_t *tree);\n-static void\n-TreeCreateRooted(tree_t *tree);\n-static bool\n-GetGroupFromFile(FILE *fp, uint uNodeIndex, double *ptrdEdgeLength, tree_t *tree);\n-static NEWICK_TOKEN_TYPE\n-GetToken(FILE *fp, char szToken[], uint uBytes);\n-/* stuff from textfile.cpp */\n-static void\n-FileSkipWhite(FILE *fp);\n-static bool\n-FileSkipWhiteX(FILE *fp);\n-static void\n-SetLeafName(uint uNodeIndex, const char *ptrName, tree_t *tree);\n-uint\n-AppendBranch(tree_t *tree, uint uExistingLeafIndex);\n-static void\n-SetEdgeLength(uint uNodeIndex1, uint uNodeIndex2,\n- double dLength, tree_t *tree);\n-static uint\n-UnrootFromFile(tree_t *tree);\n-uint\n-GetNeighbor(uint uNodeIndex, uint uNeighborSubscript, tree_t *tree);\n-static void\n-InitNode(tree_t *prTree, uint uNodeIndex);\n-\n-\n-/**\n- * @param[in] uNodeIndex\n- * node to examine\n- * @param[in] tree\n- * tree to examine\n- * @return id of left node\n- * @note called GetRight in Muscle3.7\n- */\n-uint\n-GetLeft(uint uNodeIndex, tree_t *tree) \n-{\n- assert(NULL != tree);\n- assert(tree->m_bRooted && uNodeIndex < tree->m_uNodeCount);\n- return tree->m_uNeighbor2[uNodeIndex];\n-}\n-/*** end: GetLeft ***/\n-\n-\n-\n-/**\n- * @param[in] uNodeIndex\n- * node to examine\n- * @param[in] tree\n- * tree to examine\n- * @return id of right node\n- * @note called GetRight in Muscle3.7\n- */\n-uint\n-GetRight(uint uNodeIndex, tree_t *tree)\n-{\n- assert(NULL != tree);\n- assert(tree->m_bRooted && uNodeIndex < tree->m_uNodeCount);\n- return tree->m_uNeighbor3[uNodeIndex];\n-}\n-/*** end: GetRight ***/\n-\n-\n-\n-/**\n- * @param[in] uNodeIndex\n- * node to examine\n- * @param[in] tree\n- * tree to examine\n- * @return leaf id of current node\n- */\n-uint\n-GetLeafId(uint uNodeIndex, tree_t *tree)\n-{\n- assert(NU'..b'e edge length info to parent\n- */\n- prDstTree->m_bHasEdgeLength1[uNewDstNodeIndex] =\n- prSrcTree->m_bHasEdgeLength1[uSrcTreeNodeIndex];\n- prDstTree->m_dEdgeLength1[uNewDstNodeIndex] =\n- prSrcTree->m_dEdgeLength1[uSrcTreeNodeIndex];\n-\n- /* update sequence/object id\n- */\n- prDstTree->m_Ids[uNewDstNodeIndex] =\n- prSrcTree->m_Ids[uSrcTreeNodeIndex]; \n-\n- /* we used a new node so increase their count */\n- prDstTree->m_uNodeCount += 1;\n- \n-#if TRACE\n- Log(&rLog, LOG_FORCED_DEBUG, "Updated dst node %d with a src leaf node: parent=%d (%f)",\n- uNewDstNodeIndex,\n- prDstTree->m_uNeighbor1[uNewDstNodeIndex], prDstTree->m_dEdgeLength1[uNewDstNodeIndex]);\n-#endif\n- \n- } else {\n- /* src node is not root neither leaf, means we have an\n- * internal node. Update all neighbour info\n- * \n- */\n-\n- /* initialise/zero node values to default values\n- */\n- InitNode(prDstTree, uNewDstNodeIndex);\n- \n- /* update neigbours\n- */\n- /* parent: special case if parent was src tree root */\n- if (IsRoot(prSrcTree->m_uNeighbor1[uSrcTreeNodeIndex], prSrcTree)) {\n- prDstTree->m_uNeighbor1[uNewDstNodeIndex] =\n- uDstTreeReplaceNodeIndex;\n- } else {\n- prDstTree->m_uNeighbor1[uNewDstNodeIndex] =\n- prSrcTree->m_uNeighbor1[uSrcTreeNodeIndex] + uOrgDstTreeNodeCount;\n- }\n- /* left */\n- prDstTree->m_uNeighbor2[uNewDstNodeIndex] =\n- prSrcTree->m_uNeighbor2[uSrcTreeNodeIndex] + uOrgDstTreeNodeCount;\n- /* right */\n- prDstTree->m_uNeighbor3[uNewDstNodeIndex] =\n- prSrcTree->m_uNeighbor3[uSrcTreeNodeIndex] + uOrgDstTreeNodeCount;\n-\n- /* update edge length info\n- */\n- /* parent */\n- prDstTree->m_bHasEdgeLength1[uNewDstNodeIndex] =\n- prSrcTree->m_bHasEdgeLength1[uSrcTreeNodeIndex];\n- prDstTree->m_dEdgeLength1[uNewDstNodeIndex] =\n- prSrcTree->m_dEdgeLength1[uSrcTreeNodeIndex];\n- /* left */\n- prDstTree->m_bHasEdgeLength2[uNewDstNodeIndex] =\n- prSrcTree->m_bHasEdgeLength2[uSrcTreeNodeIndex];\n- prDstTree->m_dEdgeLength2[uNewDstNodeIndex] =\n- prSrcTree->m_dEdgeLength2[uSrcTreeNodeIndex];\n- /* right */\n- prDstTree->m_bHasEdgeLength3[uNewDstNodeIndex] =\n- prSrcTree->m_bHasEdgeLength3[uSrcTreeNodeIndex];\n- prDstTree->m_dEdgeLength3[uNewDstNodeIndex] =\n- prSrcTree->m_dEdgeLength3[uSrcTreeNodeIndex];\n-\n- /* we used a new node so increase their count */\n- prDstTree->m_uNodeCount += 1;\n- \n-#if TRACE\n- Log(&rLog, LOG_FORCED_DEBUG, "Updated dst node %d with an internal src node: parent=%d (%f) left=%d (%f) right=%d (%f)",\n- uNewDstNodeIndex,\n- prDstTree->m_uNeighbor1[uNewDstNodeIndex], prDstTree->m_dEdgeLength1[uNewDstNodeIndex],\n- prDstTree->m_uNeighbor2[uNewDstNodeIndex], prDstTree->m_dEdgeLength2[uNewDstNodeIndex],\n- prDstTree->m_uNeighbor3[uNewDstNodeIndex], prDstTree->m_dEdgeLength3[uNewDstNodeIndex]);\n-#endif\n- }\n-\n- }\n- /* end for each src tree node */\n-\n- \n- /*\n- * m_uRootNodeIndex stays the same.\n- *\n- * No need to touch m_uCacheCount.\n- *\n- */ \n-#if USE_HEIGHT\n- Log(&rLog, LOG_FATAL, "Internal error: Height usage not implemented in %s", __FUNCTION__);\n-#endif \n-\n- \n-#ifndef NDEBUG\n- TreeValidate(prDstTree);\n-#endif\n- \n- return;\n-}\n-/*** end: AppendTree() ***/\n-\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/clustal/muscle_tree.h --- a/clustalomega/clustal-omega-0.2.0/src/clustal/muscle_tree.h Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,173 +0,0 @@ -/* This a mix of tree functions and data-structures from - * Bob Edgar's Muscle (version 3.7) ported to pure C. - * - * Used files: phy.cpp, tree.h, phytofile.cpp and phyfromclust.cpp - * - * Muscle's code is public domain and so is this code here. - - * From http://www.drive5.com/muscle/license.htm: - * """ - * MUSCLE is public domain software - * - * The MUSCLE software, including object and source code and - * documentation, is hereby donated to the public domain. - * - * Disclaimer of warranty - * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * """ - * - */ - -/* - * RCS $Id: muscle_tree.h 230 2011-04-09 15:37:50Z andreas $ - */ - - -#ifndef CLUSTALO_MUSCLE_CLUSTALO_TREE_H -#define CLUSTALO_MUSCLE_CLUSTALO_TREE_H - -#include <stdio.h> -#include "util.h" - -#ifndef uint -/* limit use of uint (see coding_style_guideline.txt) */ -typedef unsigned int uint; -#endif - -static const uint NULL_NEIGHBOR = UINT_MAX; - -/** - * @brief guide-tree structure - * - * @note We kept the original variable names here, to make it easy to - * search through Muscle's source code. - * From phy.cpp: - * Node has 0 to 3 neighbors: - * 0 neighbors: singleton root - * 1 neighbor: leaf, neighbor is parent - * 2 neigbors: non-singleton root - * 3 neighbors: internal node (other than root) - * - * Minimal rooted tree is single node. - * Minimal unrooted tree is single edge. - * Leaf node always has nulls in neighbors 2 and 3, neighbor 1 is parent. - * When tree is rooted, neighbor 1=parent, 2=left, 3=right. - * - */ -typedef struct { - uint m_uNodeCount;/**< number of nodes */ - uint m_uCacheCount;/**< reserved memory */ - - uint *m_uNeighbor1;/**< parent node */ - uint *m_uNeighbor2;/**< left node */ - uint *m_uNeighbor3;/**< right node */ - - /* do we have edge lengths info stored (m_dEdgeLength[123]) */ - bool *m_bHasEdgeLength1; - bool *m_bHasEdgeLength2; - bool *m_bHasEdgeLength3; - - double *m_dEdgeLength1; - double *m_dEdgeLength2; - double *m_dEdgeLength3; - -#if USE_HEIGHT - /* unused in our version of the code. we might need it at some - * stage so keep it in here, but disable via USE_HEIGHT throughout - * the code */ - double *m_dHeight; - bool *m_bHasHeight; -#endif - - /** - * leaf labels. - * index range: 0 -- (m_uNodeCount+1)/2 - */ - char **m_ptrName; - - /** - * node id. - * index range: 0 -- m_uNodeCount - */ - uint *m_Ids; - - bool m_bRooted; /**< tree is rooted */ - uint m_uRootNodeIndex; -} tree_t; - - -extern void -MuscleTreeCreate(tree_t *tree, uint uLeafCount, uint uRoot, const uint *Left, - const uint *Right, const float *LeftLength, const float* RightLength, - const uint *LeafIds, char **LeafNames); - -extern void -MuscleTreeToFile(FILE *fp, tree_t *tree); - -extern int -MuscleTreeFromFile(tree_t *tree, char *ftree); - -extern void -FreeMuscleTree(tree_t *tree); - -extern void -LogTree(tree_t *tree, FILE *fp); - -extern bool -IsRooted(tree_t *tree); - -extern uint -GetNodeCount(tree_t *tree); - -extern uint -GetLeafCount(tree_t *tree); - -extern uint -FirstDepthFirstNode(tree_t *tree); - -extern uint -NextDepthFirstNode(uint nodeindex, tree_t *tree); - -extern bool -IsLeaf(uint nodeindex, tree_t *tree); - -extern void -SetLeafId(tree_t *tree, uint uNodeIndex, uint uId); - -extern uint -GetLeafId(uint nodeindex, tree_t *tree); - -extern char * -GetLeafName(unsigned uNodeIndex, tree_t *tree); - -extern uint -GetLeft(uint nodeindex, tree_t *tree); - -extern uint -GetRight(uint nodeindex, tree_t *tree); - -extern uint -GetRootNodeIndex(tree_t *tree); - -extern bool -IsRoot(uint uNodeIndex, tree_t *tree); - -extern uint -GetParent(unsigned uNodeIndex, tree_t *tree); - -extern double -GetEdgeLength(uint uNodeIndex1, uint uNodeIndex2, tree_t *tree); - -extern uint -LeafIndexToNodeIndex(uint uLeafIndex, tree_t *prTree); - -extern void -AppendTree(tree_t *prDstTree, - uint uDstTreeNodeIndex, tree_t *prSrcTree); - -extern void -TreeValidate(tree_t *tree); - -#endif |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/clustal/muscle_upgma.c --- a/clustalomega/clustal-omega-0.2.0/src/clustal/muscle_upgma.c Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,502 +0,0 @@\n-/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n-\n-/* This the fast UPGMA algorithm (O(N^2)) as implemented in Bob Edgar\'s\n- * Muscle (UPGMA2.cpp; version 3.7) ported to pure C.\n- *\n- * Muscle\'s code is public domain and so is this code here.\n- *\n- * From http://www.drive5.com/muscle/license.htm:\n- * """\n- * MUSCLE is public domain software\n- *\n- * The MUSCLE software, including object and source code and\n- * documentation, is hereby donated to the public domain.\n- *\n- * Disclaimer of warranty\n- * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,\n- * EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION IMPLIED\n- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n- * """\n- *\n- */\n-\n-/*\n- * RCS $Id: muscle_upgma.c 230 2011-04-09 15:37:50Z andreas $\n- *\n- *\n- * Notes:\n- * ------\n- * LINKAGE become linkage_t here\n- *\n- * Replaced the the following member functions for DistCalc DC:\n- * DC.GetId = sequence id as int\n- * DC.GetName = sequence name\n- * DC.GetCount = matrix dim\n- * DC.DistRange = vector / matrix row for object i with index j<i\n- *\n- * Log() has been replaced with Clustal\'s Info(), Quiet() with Log(&rLog, LOG_FATAL)\n- *\n- * Made TriangleSubscript() and g_ulTriangleSize ulong to prevent overflow for many sequences\n- */\n-\n-#ifndef ulint\n-/* limit use of unsigned vars (see coding_style_guideline.txt) */\n-typedef unsigned long int ulong;\n-#endif\n-\n-\n-\n-#include <stdlib.h>\n-#include <stdio.h>\n-#include <assert.h>\n-\n-#include "util.h"\n-#include "log.h"\n-#include "symmatrix.h"\n-\n-#include "muscle_tree.h"\n-#include "muscle_upgma.h"\n-\n-/* from distcalc.h */\n-typedef float dist_t;\n-static const dist_t BIG_DIST = (dist_t) 1e29;\n-/* from muscle.h */\n-static const unsigned uInsane = 8888888;\n-\n-\n-\n-\n-/*static inline*/\n-ulong TriangleSubscript(uint uIndex1, uint uIndex2);\n-\n-\n-\n-\n-#define TRACE 0\n-\n-#ifndef MIN\n-#define MIN(x, y) ((x) < (y) ? (x) : (y))\n-#endif\n-#ifndef MIN\n-#define MAX(x, y) ((x) > (y) ? (x) : (y))\n-#endif\n-#define AVG(x, y) (((x) + (y))/2)\n-\n-static uint g_uLeafCount;\n-static ulong g_ulTriangleSize;\n-static uint g_uInternalNodeCount;\n-static uint g_uInternalNodeIndex;\n-\n-/* Triangular distance matrix is g_Dist, which is allocated\n- * as a one-dimensional vector of length g_ulTriangleSize.\n- * TriangleSubscript(i,j) maps row,column=i,j to the subscript\n- * into this vector.\n- * Row / column coordinates are a bit messy.\n- * Initially they are leaf indexes 0..N-1.\n- * But each time we create a new node (=new cluster, new subtree),\n- * we re-use one of the two rows that become available (the children\n- * of the new node). This saves memory.\n- * We keep track of this through the g_uNodeIndex vector.\n- */\n-static dist_t *g_Dist;\n-\n-/* Distance to nearest neighbor in row i of distance matrix.\n- * Subscript is distance matrix row.\n- */\n-static dist_t *g_MinDist;\n-\n-/* Nearest neighbor to row i of distance matrix.\n- * Subscript is distance matrix row.\n- */\n-static uint *g_uNearestNeighbor;\n-\n-/* Node index of row i in distance matrix.\n- * Node indexes are 0..N-1 for leaves, N..2N-2 for internal nodes.\n- * Subscript is distance matrix row.\n- */\n-static uint *g_uNodeIndex;\n-\n-/* The following vectors are defined on internal nodes,\n- * subscripts are internal node index 0..N-2.\n- * For g_uLeft/Right, value is the node index 0 .. 2N-2\n- * because a child can be internal or leaf.\n- */\n-static uint *g_uLeft;\n-static uint *g_uRight;\n-static dist_t *g_Height;\n-static dist_t *g_LeftLength;\n-static dist_t *g_RightLength;\n-\n-\n-/*** CalcDistRange\n- *\n- * Imitation of DistCalc.DistRange\n- *\n- * Sets values of row (vector / matrix row) to distances for object i with index j<i\n- *\n- * row must be preallocated\n- */\n-void CalcDistRange(symmatrix_t *distmat, uint i, dist_t *row)\n-{\n- uint j;\n- for (j = 0; j < i; ++j) {\n- row[j] = SymMatrixGetValue(distmat, i, j);\n- }\n-}\n-/* end of CalcDistRange */\n-\n-\n-\n-/*static inline*/\n-ulong\n-'..b'eak;\n-/* couldn\'t be arsed to figure out proper usage of g_dSUEFF */\n-#if 0\n- case LINKAGE_BIASED:\n- dtNewDist = g_dSUEFF*AVG(dL, dR) + (1 - g_dSUEFF)*MIN(dL, dR);\n- break;\n-#endif\n- default:\n- Log(&rLog, LOG_FATAL, "UPGMA2: Invalid LINKAGE_%u", linkage);\n- }\n-\n- /* Nasty special case.\n- * If nearest neighbor of j is Lmin or Rmin, then make the new\n- * node (which overwrites the row currently occupied by Lmin)\n- * the nearest neighbor. This situation can occur when there are\n- * equal distances in the matrix. If we don\'t make this fix,\n- * the nearest neighbor pointer for j would become invalid.\n- * (We don\'t need to test for == Lmin, because in that case\n- * the net change needed is zero due to the change in row\n- * numbering).\n- */\n- if (g_uNearestNeighbor[j] == Rmin)\n- g_uNearestNeighbor[j] = Lmin;\n-\n-#if TRACE\n- Info("New dist to %u = (%u/%.3g + %u/%.3g)/2 = %.3g\\n",\n- j, Lmin, dL, Rmin, dR, dtNewDist);\n-#endif\n- g_Dist[vL] = dtNewDist;\n- if (dtNewDist < dtNewMinDist) {\n- dtNewMinDist = dtNewDist;\n- uNewNearestNeighbor = j;\n- }\n- }\n-\n- assert(g_uInternalNodeIndex < g_uLeafCount - 1 || BIG_DIST != dtNewMinDist);\n- assert(g_uInternalNodeIndex < g_uLeafCount - 1 || uInsane != uNewNearestNeighbor);\n-\n- const ulong v = TriangleSubscript(Lmin, Rmin);\n- const dist_t dLR = g_Dist[v];\n- const dist_t dHeightNew = dLR/2;\n- const uint uLeft = g_uNodeIndex[Lmin];\n- const uint uRight = g_uNodeIndex[Rmin];\n- const dist_t HeightLeft =\n- uLeft < g_uLeafCount ? 0 : g_Height[uLeft - g_uLeafCount];\n- const dist_t HeightRight =\n- uRight < g_uLeafCount ? 0 : g_Height[uRight - g_uLeafCount];\n-\n- g_uLeft[g_uInternalNodeIndex] = uLeft;\n- g_uRight[g_uInternalNodeIndex] = uRight;\n- g_LeftLength[g_uInternalNodeIndex] = dHeightNew - HeightLeft;\n- g_RightLength[g_uInternalNodeIndex] = dHeightNew - HeightRight;\n- g_Height[g_uInternalNodeIndex] = dHeightNew;\n-\n- /* Row for left child overwritten by row for new node */\n- g_uNodeIndex[Lmin] = g_uLeafCount + g_uInternalNodeIndex;\n- g_uNearestNeighbor[Lmin] = uNewNearestNeighbor;\n- g_MinDist[Lmin] = dtNewMinDist;\n-\n- /* Delete row for right child */\n- g_uNodeIndex[Rmin] = uInsane;\n-\n-#if TRACE\n- Info("\\nInternalNodeIndex=%u Lmin=%u Rmin=%u\\n",\n- g_uInternalNodeIndex, Lmin, Rmin);\n- ListState();\n-#endif\n- }\n-\n- uint uRoot = g_uLeafCount - 2;\n-\n-#if TRACE\n- Log(&rLog, LOG_FORCED_DEBUG, "uRoot=%d g_uLeafCount=%d g_uInternalNodeCount=%d", uRoot, g_uLeafCount, g_uInternalNodeCount);\n- for (i=0; i<g_uInternalNodeCount; i++) {\n- Log(&rLog, LOG_FORCED_DEBUG, "internal node=%d: g_uLeft=%d g_uRight=%d g_LeftLength=%f g_RightLength=%f g_Height=%f",\n- i, g_uLeft[i], g_uRight[i],\n- g_LeftLength[i], g_RightLength[i],\n- g_Height[i]);\n- }\n- for (i=0; i<g_uLeafCount; i++) {\n- Log(&rLog, LOG_FORCED_DEBUG, "leaf node=%d: Ids=%d names=%s",\n- i, Ids[i], names[i]);\n- }\n-#endif\n- \n- MuscleTreeCreate(tree, g_uLeafCount, uRoot,\n- g_uLeft, g_uRight,\n- g_LeftLength, g_RightLength,\n- Ids, names);\n-#if TRACE\n- tree.LogMe();\n-#endif\n-\n- free(g_Dist);\n-\n- free(g_uNodeIndex);\n- free(g_uNearestNeighbor);\n- free(g_MinDist);\n- free(g_Height);\n-\n- free(g_uLeft);\n- free(g_uRight);\n- free(g_LeftLength);\n- free(g_RightLength);\n-\n- /* NOTE: Muscle\'s "Names" variable is here the argument "names" */\n- free(Ids);\n-}\n-/*** end of UPGMA2 ***/\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/clustal/muscle_upgma.h --- a/clustalomega/clustal-omega-0.2.0/src/clustal/muscle_upgma.h Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,43 +0,0 @@ -/* This the fast UPGMA algorithm (O(N^2)) as implemented in Bob Edgar's - * Muscle (UPGMA2.cpp; version 3.7) ported to pure C. - * - * Muscle's code is public domain and so is this code here. - * - * From http://www.drive5.com/muscle/license.htm: - * """ - * MUSCLE is public domain software - * - * The MUSCLE software, including object and source code and - * documentation, is hereby donated to the public domain. - * - * Disclaimer of warranty - * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * """ - * - */ - -/* - * RCS $Id: muscle_upgma.h 193 2011-02-07 15:45:21Z andreas $ - */ - -#ifndef CLUSTALO_UPGMA_H -#define CLUSTALO_UPGMA_H - -#include "symmatrix.h" -#include "muscle_tree.h" - -enum linkage_e { - LINKAGE_MIN, - LINKAGE_AVG, - LINKAGE_MAX, - LINKAGE_NEIGHBORJOINING, - LINKAGE_BIASED -}; -typedef enum linkage_e linkage_t; - -void MuscleUpgma2(tree_t *tree, symmatrix_t *distmat, - linkage_t linkage, char **names); - -#endif |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/clustal/pair_dist.c --- a/clustalomega/clustal-omega-0.2.0/src/clustal/pair_dist.c Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,425 +0,0 @@\n-/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n-\n-/*********************************************************************\n- * Clustal Omega - Multiple sequence alignment\n- *\n- * Copyright (C) 2010 University College Dublin\n- *\n- * Clustal-Omega is free software; you can redistribute it and/or\n- * modify it under the terms of the GNU General Public License as\n- * published by the Free Software Foundation; either version 2 of the\n- * License, or (at your option) any later version.\n- *\n- * This file is part of Clustal-Omega.\n- *\n- ********************************************************************/\n-\n-/*\n- * RCS $Id: pair_dist.c 242 2011-05-27 14:04:21Z andreas $\n- */\n-\n-#ifdef HAVE_CONFIG_H\n-#include "config.h"\n-#endif\n-\n-#include <stdlib.h>\n-#include <ctype.h>\n-#include <assert.h>\n-#include <time.h>\n-\n-/* only neededfor iNumberOfThreads */\n-#include "clustal-omega.h"\n-\n-#include "ktuple_pair.h"\n-#include "pair_dist.h"\n-#include "progress.h"\n-#include "util.h"\n-\n-\n-/* Up to rev 173 we had a USE_SYM_KTUPLE switch implemented here. When active\n- * ktuple distances were computed twice for each pair and averaged. Idea was\n- * to avoid assymmetries in the pairwise scores (score(a, b) is often not the\n- * same as score(b, a)). Results on BAliBASE indicate that this is overkill:\n- *\n- * r92_default core columns: avg-sp=0.800656 avg-tc=0.47711 (of total 218)\n- * r93-mod--norm-ktuple/ core columns: avg-sp=0.800656 avg-tc=0.47711 (of total 218)\n- * r93-mod--sym-ktuple/ core columns: avg-sp=0.801083 avg-tc=0.476544 (of total 217)\n- * r93-mod--rand-ktuple-1 core columns: avg-sp=0.799289 avg-tc=0.468028 (of total 218)\n- * r93-mod--rand-ktuple-2 core columns: avg-sp=0.801654 avg-tc=0.47659 (of total 217)\n- * r93-mod--rand-ktuple-3 core columns: avg-sp=0.800234 avg-tc=0.474908 (of total 218)\n- * r93-mod--rand-ktuple-4 core columns: avg-sp=0.800573 avg-tc=0.476514 (of total 218)\n- * r93-mod--rand-ktuple-5 core columns: avg-sp=0.799679 avg-tc=0.468716 (of total 218)\n- *\n- */\n-\n-static double\n-KimuraCorrection(double frac_id);\n-\n-static int\n-SquidIdPairDist(symmatrix_t *tmat, mseq_t *mseq,\n- int istart, int iend,\n- int jstart, int jend,\n- bool use_KimuraCorrection, progress_t *prProgress,\n- unsigned long int *ulStepNo, unsigned long int ulTotalStepNo);\n-\n-/* Taken from Muscle\'s msadistkimura.cpp */\n-static int DAYHOFF_PAMS[]={\n- 195, /* 75.0% observed d; 195 PAMs estimated = 195% estimated d */\n- 196, /* 75.1% observed d; 196 PAMs estimated */\n- 197, 198, 199, 200, 200, 201, 202, 203,\n- 204, 205, 206, 207, 208, 209, 209, 210, 211, 212,\n- 213, 214, 215, 216, 217, 218, 219, 220, 221, 222,\n- 223, 224, 226, 227, 228, 229, 230, 231, 232, 233,\n- 234, 236, 237, 238, 239, 240, 241, 243, 244, 245,\n- 246, 248, 249, 250, /* 250 PAMs = 80.3% observed d */\n- 252, 253, 254, 255, 257, 258,\n- 260, 261, 262, 264, 265, 267, 268, 270, 271, 273,\n- 274, 276, 277, 279, 281, 282, 284, 285, 287, 289,\n- 291, 292, 294, 296, 298, 299, 301, 303, 305, 307,\n- 309, 311, 313, 315, 317, 319, 321, 323, 325, 328,\n- 330, 332, 335, 337, 339, 342, 344, 347, 349, 352,\n- 354, 357, 360, 362, 365, 368, 371, 374, 377, 380,\n- 383, 386, 389, 393, 396, 399, 403, 407, 410, 414,\n- 418, 422, 426, 430, 434, 438, 442, 447, 451, 456,\n- 461, 466, 471, 476, 482, 487, 493, 498, 504, 511,\n- 517, 524, 531, 538, 545, 553, 560, 569, 577, 586,\n- 595, 605, 615, 626, 637, 649, 661, 675, 688, 703,\n-'..b'iend;\n- for(iChunk = 0; iChunk <= iNumberOfThreads; iChunk++)\n- {\n- iChunkEnd = iChunkStart;\n- if(iChunk == iNumberOfThreads - 1)\n- iChunkStart = 0;\n- else\n- iChunkStart = iend - ((double)(iend - istart) * sqrt(((double)iChunk + 1.0)/(double)iNumberOfThreads));\n- iChunkStarts[iChunk] = iChunkStart;\n- iChunkEnds[iChunk] = iChunkEnd;\n- }\n-\n- if (PAIRDIST_KTUPLE == pairdist_type) {\n-\n- Log(&rLog, LOG_INFO, "Calculating pairwise ktuple-distances...");\n-\n- NewProgress(&prProgress, LogGetFP(&rLog, LOG_INFO),\n- "Ktuple-distance calculation progress", bPrintCR);\n-#ifdef HAVE_OPENMP\n- #pragma omp parallel for private(iChunk) schedule(dynamic)\n-#endif\n- for(iChunk = 0; iChunk < iNumberOfThreads; iChunk++)\n- {\n- KTuplePairDist((*distmat), mseq, iChunkStarts[iChunk], \n- iChunkEnds[iChunk], jstart, jend, NULL, prProgress, \n- &ulStepNo, ulTotalStepNo);\n- }\n-\n-#if 0\n- printf("total ops %d\\n", ulStepNo);\n-#endif\n- /* old format:\n- KTuplePairDist((*distmat), mseq,\n- istart, iend,\n- jstart, jend, NULL); */\n-\n- } else if (PAIRDIST_SQUIDID == pairdist_type) {\n- Log(&rLog, LOG_INFO, "Calculating pairwise aligned identity distances...");\n-\n- NewProgress(&prProgress, LogGetFP(&rLog, LOG_INFO),\n- "Pairwise identity calculation progress", bPrintCR);\n-#ifdef HAVE_OPENMP\n- #pragma omp parallel for private(iChunk) schedule(dynamic)\n-#endif\n- for(iChunk = 0; iChunk < iNumberOfThreads; iChunk++)\n- {\n- iSquidSuccess = SquidIdPairDist((*distmat), mseq,\n- iChunkStarts[iChunk], iChunkEnds[iChunk],\n- jstart, jend, FALSE, prProgress,\n- &ulStepNo, ulTotalStepNo);\n- }\n- if(iSquidSuccess != 0)\n- return -1;\n-\n- } else if (PAIRDIST_SQUIDID_KIMURA == pairdist_type) {\n- Log(&rLog, LOG_INFO, "Calculating Kimura-corrected pairwise aligned identity distances...");\n- NewProgress(&prProgress, LogGetFP(&rLog, LOG_INFO),\n- "Pairwise identity calculation progress", bPrintCR);\n-#ifdef HAVE_OPENMP\n- #pragma omp parallel for private(iChunk) schedule(dynamic)\n-#endif\n- for(iChunk = 0; iChunk < iNumberOfThreads; iChunk++)\n- {\n- iSquidSuccess = SquidIdPairDist((*distmat), mseq,\n- iChunkStarts[iChunk], iChunkEnds[iChunk],\n- jstart, jend, TRUE, prProgress,\n- &ulStepNo, ulTotalStepNo);\n- }\n- if(iSquidSuccess != 0)\n- return -1;\n- } else {\n- Log(&rLog, LOG_FATAL, "INTERNAL ERROR: don\'t know about pairdist_type %d",\n- pairdist_type);\n- }\n- }\n-#endif /* random/proper distance calculation */\n-\n-\n- /* optional printing of matrix to file\n- */\n- if (NULL != fdist_out) {\n- /* need a copy of sequence names for printing */\n- char **names;\n- names = (char **)CKMALLOC(mseq->nseqs * sizeof(char*));\n- for (uSeqIndex=0; uSeqIndex<mseq->nseqs; uSeqIndex++) {\n- names[uSeqIndex] = mseq->sqinfo[uSeqIndex].name;\n- }\n-\n- SymMatrixPrint((*distmat), names, fdist_out);\n-\n- Log(&rLog, LOG_INFO, "Pairwise distance matrix written to %s",\n- fdist_out);\n- CKFREE(names);\n- }\n-\n-#if 0\n-#include "distance-distrib.h" \n-#endif\n-\n- if (NULL != prProgress) {\n- ProgressDone(prProgress);\n- FreeProgress(&prProgress);\n- }\n-\n- return 0;\n-}\n-/*** end: PairDistances() ***/\n-\n-\n-\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/clustal/pair_dist.h --- a/clustalomega/clustal-omega-0.2.0/src/clustal/pair_dist.h Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,42 +0,0 @@ -/********************************************************************* - * Clustal Omega - Multiple sequence alignment - * - * Copyright (C) 2010 University College Dublin - * - * Clustal-Omega is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This file is part of Clustal-Omega. - * - ********************************************************************/ - -/* - * RCS $Id: pair_dist.h 193 2011-02-07 15:45:21Z andreas $ - */ - - -#ifndef CLUSTALO_PAIR_DIST_H -#define CLUSTALO_PAIR_DIST_H - -#define PAIRDIST_UNKNOWN 0 -/* k-tuple distances: Wilbur and Lipman (1983) */ -#define PAIRDIST_KTUPLE 1 -/* fractional identity between aligned sequences. denominator is - * minimum seq len (see squid:aligneval.c) */ -#define PAIRDIST_SQUIDID 2 -/* SQUIDID + Kimura correction */ -#define PAIRDIST_SQUIDID_KIMURA 3 - -#include "seq.h" -#include "symmatrix.h" - -extern int -PairDistances(symmatrix_t **distmat, mseq_t *mseq, const int pairdist_type, - const int istart, const int iend, - const int jstart, const int jend, - char *fdist_in, char *fdist_out); - -#endif - |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/clustal/progress.c --- a/clustalomega/clustal-omega-0.2.0/src/clustal/progress.c Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,177 +0,0 @@ -/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ - -/********************************************************************* - * Clustal Omega - Multiple sequence alignment - * - * Copyright (C) 2010 University College Dublin - * - * Clustal-Omega is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This file is part of Clustal-Omega. - * - ********************************************************************/ - -/* - * RCS $Id: progress.c 230 2011-04-09 15:37:50Z andreas $ - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <stdlib.h> -#include <stdio.h> -#include <assert.h> - -#include "util.h" -#include "log.h" -#include "progress.h" - -#define LOGLEVEL_THRESHOLD LOG_INFO - -/** - * @brief Allocates a new progress structure and initialises its members. - * Free with FreeProgress() - * - * @note Starts the internal stopwatch immediatly! - * - * @see FreeProgress() - * - * @param[out] pprProgress - * Pointer pointer to progress structure. Progress structure will be - * allocated here. - * @param[in] prFile - * Where to log messages to - * @param[in] pcPrefix - * What prefix to use for messages - * @param[in] bPrintCR - * If TRUE carriage return instead of newline will be printed between log messages - */ -void -NewProgress(progress_t **pprProgress, FILE *prFile, - char *pcPrefix, bool bPrintCR) -{ - assert(NULL!=pprProgress); - assert(NULL!=prFile); - assert(NULL!=pcPrefix); - - (*pprProgress) = (progress_t *) CKMALLOC(1*sizeof(progress_t)); - (*pprProgress)->prFile = prFile; - (*pprProgress)->bPrintCR = bPrintCR; - (*pprProgress)->pcPrefix = CkStrdup(pcPrefix); - strcpy((*pprProgress)->pcLastLogMsg, "\0"); - (*pprProgress)->prStopwatch = StopwatchCreate(); - StopwatchZero((*pprProgress)->prStopwatch); - StopwatchStart((*pprProgress)->prStopwatch); - - return; -} -/*** end: NewProgress() ***/ - - - -/** - * @brief Frees progress structure and its members - * - * @param[out] pprProgress - * Pointer pointer to progress structure - * - * @see NewProgress() - * - */ -void -FreeProgress(progress_t **pprProgress) -{ - (*pprProgress)->prFile = NULL; - CKFREE((*pprProgress)->pcPrefix); - StopwatchFree((*pprProgress)->prStopwatch); - - CKFREE(*pprProgress); - return; -} -/*** end: FreeProgress() ***/ - - - - -/** - * @brief Prints a progress update (and a carriage return) - * - * @param[in] prProgress - * Pointer to the progress structure - * @param[in] iStep - * Current step number - * @param[in] iTotalSteps - * Total step number - * @param[in] bForceOutput - * If percentage hasn't changed output is normally supressed - * normally. Output can be forced with this flag. - * - */ -void -ProgressLog(progress_t *prProgress, - unsigned long int iStep, unsigned long int iTotalSteps, - bool bForceOutput) -{ - char pcLogMsg[1024]; - assert(0!=iTotalSteps); - - if (rLog.iLogLevelEnabled>LOGLEVEL_THRESHOLD) { - return; - } - - (void) snprintf(pcLogMsg, sizeof(pcLogMsg), "%s: %lu %%", - prProgress->pcPrefix, (unsigned long int)(iStep/(float)iTotalSteps*100.0)); - - if (! bForceOutput) { - /* Skip logging, if we've just logged the same message */ - if (STR_EQ(pcLogMsg, prProgress->pcLastLogMsg)) { - return; - } - } - - strncpy(prProgress->pcLastLogMsg, pcLogMsg, - sizeof(prProgress->pcLastLogMsg)); - - fprintf(prProgress->prFile, "%s (%lu out of %lu)", pcLogMsg, iStep, iTotalSteps); - if (prProgress->bPrintCR) { - fprintf(prProgress->prFile, "\r"); - } else { - fprintf(prProgress->prFile, "\n"); - - } - (void) fflush(prProgress->prFile); - - return; -} -/*** end: ProgressLog() ***/ - - -/** - * @brief Finishes progress output by printing the elapsed time - * - * @param[in] prProgress - * Pointer to the progress structure - * - */ -void -ProgressDone(progress_t *prProgress) -{ - char pcBuf[1024]; - - if (rLog.iLogLevelEnabled>LOGLEVEL_THRESHOLD) { - return; - } - - (void) snprintf(pcBuf, sizeof(pcBuf), "%s done. CPU time: ", - prProgress->pcPrefix); - StopwatchStop(prProgress->prStopwatch); - StopwatchDisplay(prProgress->prFile, pcBuf, prProgress->prStopwatch); - (void) fflush(prProgress->prFile); - - return; -} -/*** end: ProgressDone() ***/ |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/clustal/progress.h --- a/clustalomega/clustal-omega-0.2.0/src/clustal/progress.h Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,50 +0,0 @@ -/********************************************************************* - * Clustal Omega - Multiple sequence alignment - * - * Copyright (C) 2010 University College Dublin - * - * Clustal-Omega is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This file is part of Clustal-Omega. - * - ********************************************************************/ - -/* - * RCS $Id: progress.h 193 2011-02-07 15:45:21Z andreas $ - */ - - -#ifndef CLUSTALO_PROGRESS_H -#define CLUSTALO_PROGRESS_H - -#include "squid/stopwatch.h" - -typedef struct { - /* where to write to */ - FILE *prFile; - /* prefix printed before each step */ - char *pcPrefix; - bool bPrintCR; - char pcLastLogMsg[1024]; - Stopwatch_t *prStopwatch; -} progress_t; - - -extern void -NewProgress(progress_t **pprProgress, FILE *prFile, char *pcPrefix, bool bPrintCR); - -extern void -FreeProgress(progress_t **pprProgress); - -extern void -ProgressLog(progress_t *prProgress, - unsigned long int iStep, unsigned long int iTotalSteps, - bool bForceOutput); - -extern void -ProgressDone(progress_t *pprProgress); - -#endif |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/clustal/queue.h --- a/clustalomega/clustal-omega-0.2.0/src/clustal/queue.h Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,75 +0,0 @@ -/********************************************************************* - * Clustal Omega - Multiple sequence alignment - * - * Copyright (C) 2010 University College Dublin - * - * Clustal-Omega is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This file is part of Clustal-Omega. - * - ********************************************************************/ - -/* - * RCS $Id: queue.h 193 2011-02-07 15:45:21Z andreas $ - * - * Functions/Macros for FIFOs/Queues - * - */ - -#ifndef CLUSTALO_QUEUE_H -#define CLUSTALO_QUEUE_H - -#include "list.h" - - - -/* FIFO/Queue as list_t, storing data pointers - * - */ - -typedef list_t queue_t; - -/* setup queue */ -#define QUEUE_INIT(prQueue, destroy_func) ListInit((prQueue), (destroy_func)) - -/* free all elements from queue */ -#define QUEUE_DESTROY(prQueue) ListDestroy((prQueue)) - -/* enqueue */ -#define QUEUE_PUSH(prQueue, data) LIST_APPEND((prQueue), (data)) - -/* dequeue */ -#define QUEUE_POP(prQueue, data) ListRemoveNext((prQueue), NULL, (data)) - -/* is queue empty ? */ -#define QUEUE_EMPTY(prQueue) (0==LIST_SIZE((prQueue))) - - - -/* Special int FIF/Queue, storing ints by copying them instead of - * keeping pointers only - */ - -typedef queue_t int_queue_t; - -/* setup queue */ -#define INT_QUEUE_INIT(prQueue) INT_LIST_INIT((prQueue)) - -/* free all elements from queue */ -#define INT_QUEUE_DESTROY(prQueue) INT_LIST_DESTROY((prQueue)) - -/* enqueue */ -#define INT_QUEUE_PUSH(prQueue, data) INT_LIST_APPEND((prQueue), (data)) - -/* dequeue */ -#define INT_QUEUE_POP(prQueue, data) IntListRemoveNext((prQueue), NULL, (data)) - -/* is queue empty ? */ -#define INT_QUEUE_EMPTY(prQueue) (0==INT_LIST_SIZE((prQueue))) - - - -#endif |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/clustal/seq.c --- a/clustalomega/clustal-omega-0.2.0/src/clustal/seq.c Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,1185 +0,0 @@\n-/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n-\n-/*********************************************************************\n- * Clustal Omega - Multiple sequence alignment\n- *\n- * Copyright (C) 2010 University College Dublin\n- *\n- * Clustal-Omega is free software; you can redistribute it and/or\n- * modify it under the terms of the GNU General Public License as\n- * published by the Free Software Foundation; either version 2 of the\n- * License, or (at your option) any later version.\n- *\n- * This file is part of Clustal-Omega.\n- *\n- ********************************************************************/\n-\n-/*\n- * RCS $Id: seq.c 241 2011-05-04 14:37:17Z fabian $\n- *\n- *\n- * Module for sequence/alignment IO and misc.\n- *\n- * This depends heavily on Sean Eddy\'s squid library, which is obsoleted by\n- * HMMER3\'s Easel. However, easel doesn\'t support that many non-aligned input\n- * formats.\n- *\n- */\n-\n-#ifdef HAVE_CONFIG_H\n-#include "config.h"\n-#endif\n-\n-#include <assert.h>\n-#include "squid/squid.h"\n-#include <ctype.h>\n-\n-#include "util.h"\n-#include "log.h"\n-#include "seq.h"\n-\n-\n-#define ALLOW_ONLY_PROTEIN 1\n-\n-\n-\n-\n-/**\n- * @brief Stripped down version of squid\'s alistat\n- *\n- *\n- * @param[in] prMSeq\n- * The alignment to analyse\n- * @param[in] bSampling\n- * For many sequences: samples from pool\n- * @param[in] bReportAll\n- * Report identities for all sequence pairs\n- *\n- * Don\'t have to worry about sequence case because our version of PairwiseIdentity is case insensitive\n- */\n-void\n-AliStat(mseq_t *prMSeq, bool bSampling, bool bReportAll) {\n-\n- /*\n- * bSampling = squid\'s do_fast\n- * bReportAll = squid\'s allreport\n- */\n- float **ppdIdentMx; /* identity matrix (squid: imx) */\n- const int iNumSample = 1000; /* sample size (squid: nsample) */\n- int iAux;\n-\n- MSA *msa; /* squid\'s alignment structure */\n- int small, large;\t\n- int bestj, worstj;\n- float sum;\n- float worst_worst, worst_best, best_best;\n- float avgid;\n- int i, j;\n- int nres; /* number of residues */\n-\n- if (bSampling && bReportAll) {\n- Log(&rLog, LOG_WARN,\n- "Cannot report all and sample at the same time. Skipping %s()", __FUNCTION__);\n- return;\n- }\n- if (FALSE == prMSeq->aligned) {\n- Log(&rLog, LOG_WARN,\n- "Sequences are not aligned. Skipping %s()", __FUNCTION__);\n- return;\n- }\n-\n- /* silence gcc warnings about uninitialized variables\n- */\n- worst_worst = worst_best = best_best = 0.0;\n- bestj = worstj = -1;\n-\n-\n- /** mseq to squid msa\n- *\n- * FIXME code overlap with WriteAlignment. Make it a function and take\n- * code there (contains more comments) as template\n- *\n- */\n- msa = MSAAlloc(prMSeq->nseqs, \n- /* derive alignment length from first seq */\n- strlen(prMSeq->seq[0]));\n- for (i=0; i<prMSeq->nseqs; i++) {\n- int key; /* MSA struct internal index for sequence */\n- char *this_name = prMSeq->sqinfo[i].name; /* prMSeq sequence name */\n- char *this_seq = prMSeq->seq[i]; /* prMSeq sequence */\n- SQINFO *this_sqinfo = &prMSeq->sqinfo[i]; /* prMSeq sequence name */\n-\n- key = GKIStoreKey(msa->index, this_name);\n- msa->sqname[key] = sre_strdup(this_name, strlen(this_name));\n- /* setting msa->sqlen[idx] and msa->aseq[idx] */\n- msa->sqlen[key] = sre_strcat(&(msa->aseq[key]), msa->sqlen[key],\n- this_seq, strlen(this_seq));\n- if (this_sqinfo->flags & SQINFO_DESC) {\n- MSASetSeqDescription(msa, key, this_sqinfo->desc);\n- } \n- msa->nseq++;\n- } \n- \n-\n-\n- nres = 0;\n- small = large = -1;\n- for (i = 0; i < msa->nseq; i++) {\n- int rlen;\t\t/* raw sequence length */\n- rlen = DealignedLength(msa->aseq[i]);\n- nres += rlen;\n- if (small == -1 || rlen < small) small = rlen;\n- '..b'meLength, bGapFound);\n-#endif\n- if (TRUE == bSameLength && TRUE == bGapFound) {\n- return TRUE;\n- } else {\n- return FALSE;\n- } \n-\n-}\n-/*** end: SeqsAreAligned() ***/\n-\n-\n-\n-/**\n- * @brief Creates a new sequence entry and appends it to an existing mseq\n- * structure.\n- *\n- * @param[out] prMSeqDest_p\n- * Already existing and initialised mseq structure\n- * @param[in] pcSeqName\n- * sequence name of the sequence to add\n- * @param[in] pcSeqRes\n- * the actual sequence (residues) to add\n- * \n- * @note Don\'t forget to update the align and type flag if necessary!\n- *\n- * FIXME allow adding of more features\n- *\n- */ \n-void\n-AddSeq(mseq_t **prMSeqDest_p, char *pcSeqName, char *pcSeqRes)\n-{\n- int iSeqIdx = 0;\n- SQINFO sqinfo;\n-\n- assert(NULL != prMSeqDest_p);\n- assert(NULL != pcSeqName);\n- assert(NULL != pcSeqRes);\n-\n- iSeqIdx = (*prMSeqDest_p)->nseqs;\n-\n- (*prMSeqDest_p)->seq = (char **)\n- CKREALLOC((*prMSeqDest_p)->seq, (iSeqIdx+1) * sizeof(char *));\n- (*prMSeqDest_p)->orig_seq = (char **)\n- CKREALLOC((*prMSeqDest_p)->orig_seq, (iSeqIdx+1) * sizeof(char *));\n- (*prMSeqDest_p)->sqinfo = (SQINFO *)\n- CKREALLOC((*prMSeqDest_p)->sqinfo, (iSeqIdx+1) * sizeof(SQINFO));\n-\n-\n- (*prMSeqDest_p)->seq[iSeqIdx] = CkStrdup(pcSeqRes);\n- (*prMSeqDest_p)->orig_seq[iSeqIdx] = CkStrdup(pcSeqRes);\n-\n- /* should probably get ri of SqInfo altogether in the long run and just\n- transfer the intersting members into our own struct\n- */\n- sqinfo.flags = 0; /* init */\n-\n- sqinfo.len = strlen(pcSeqRes);\n- sqinfo.flags |= SQINFO_LEN;\n-\n- /* name is an array of SQINFO_NAMELEN length */\n- strncpy(sqinfo.name, pcSeqName, SQINFO_NAMELEN-1);\n- sqinfo.name[SQINFO_NAMELEN-1] = \'\\0\';\n- sqinfo.flags |= SQINFO_NAME;\n- \n- SeqinfoCopy(&(*prMSeqDest_p)->sqinfo[iSeqIdx],\n- & sqinfo);\n-\n- (*prMSeqDest_p)->nseqs++;\n-\n- return; \n-}\n-/* end of AddSeq() */\n-\n-\n-\n-\n-/**\n- * @brief Appends an mseq structure to an already existing one.\n- * filename will be left untouched.\n- *\n- * @param[in] prMSeqDest_p\n- * MSeq structure to which to append to\n- * @param[out] prMSeqToAdd\n- * MSeq structure which is to append\n- *\n- * \n- */ \n-void\n-JoinMSeqs(mseq_t **prMSeqDest_p, mseq_t *prMSeqToAdd)\n-{\n- int iSrcSeqIndex;\n- int iNewNSeq;\n- \n- assert(NULL != prMSeqDest_p && NULL != (*prMSeqDest_p));\n- assert(NULL != prMSeqToAdd);\n- \n- if (0 == prMSeqToAdd->nseqs) {\n- Log(&rLog, LOG_WARN, "Was asked to add 0 sequences");\n- return;\n- }\n- \n- /* warn on seqtype mismatch and keep original seqtype */\n- if ((*prMSeqDest_p)->seqtype != prMSeqToAdd->seqtype) {\n- Log(&rLog, LOG_WARN, "Joining sequences of different type");\n- }\n- \n- /* leave filename as it is */\n-\n- /*\n- * copy new seq/s, orig_seq/s, sqinfo/s\n- */\n- iNewNSeq = (*prMSeqDest_p)->nseqs + prMSeqToAdd->nseqs;\n- \n- (*prMSeqDest_p)->seq = (char **)\n- CKREALLOC((*prMSeqDest_p)->seq, iNewNSeq * sizeof(char *));\n- \n- (*prMSeqDest_p)->orig_seq = (char **)\n- CKREALLOC((*prMSeqDest_p)->orig_seq, iNewNSeq * sizeof(char *));\n- \n- (*prMSeqDest_p)->sqinfo = (SQINFO *)\n- CKREALLOC((*prMSeqDest_p)->sqinfo, iNewNSeq * sizeof(SQINFO));\n- \n- \n- for (iSrcSeqIndex=0; iSrcSeqIndex < prMSeqToAdd->nseqs; iSrcSeqIndex++) {\n- int iDstSeqIndex = (*prMSeqDest_p)->nseqs++;\n- \n- (*prMSeqDest_p)->seq[iDstSeqIndex] =\n- CkStrdup(prMSeqToAdd->seq[iSrcSeqIndex]);\n- \n- (*prMSeqDest_p)->orig_seq[iDstSeqIndex] =\n- CkStrdup(prMSeqToAdd->orig_seq[iSrcSeqIndex]);\n- \n- SeqinfoCopy(&(*prMSeqDest_p)->sqinfo[iDstSeqIndex],\n- & prMSeqToAdd->sqinfo[iSrcSeqIndex]);\n- }\n-\n- (*prMSeqDest_p)->nseqs = iNewNSeq;\n- \n- (*prMSeqDest_p)->aligned = SeqsAreAligned(*prMSeqDest_p);\n- \n- return; \n-}\n-/*** end: JoinMSeqs() ***/\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/clustal/seq.h --- a/clustalomega/clustal-omega-0.2.0/src/clustal/seq.h Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,164 +0,0 @@ -/********************************************************************* - * Clustal Omega - Multiple sequence alignment - * - * Copyright (C) 2010 University College Dublin - * - * Clustal-Omega is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This file is part of Clustal-Omega. - * - ********************************************************************/ - -/* - * RCS $Id: seq.h 234 2011-04-13 05:26:16Z andreas $ - */ - -#ifndef CLUSTALO_SEQ_H -#define CLUSTALO_SEQ_H - -#include "squid/squid.h" - -#include "util.h" - - -/** - * int-encoded sequence types. - * these are in sync with squid's seqtypes and only used for - * convenience here - */ -#define SEQTYPE_UNKNOWN kOtherSeq -#define SEQTYPE_DNA kDNA -#define SEQTYPE_RNA kRNA -#define SEQTYPE_PROTEIN kAmino - -/* Alphabets are defined in squid.h: AMINO_ALPHABET, DNA_ALPHABET, - * RNA_ALPHABET (all uppercase) - */ -#define AMINOACID_ANY 'X' -#define NUCLEOTIDE_ANY 'N' - -/** - * @brief structure for storing multiple sequences - * - */ -typedef struct { - int nseqs; /**< number of sequences */ - int seqtype; /**< sequence type */ - char *filename; /**< input file / source of sequences */ - bool aligned; /**< true if all seqs are same length **/ - - /** (working) sequence residues as char pointer. - * range for first index: 0--nseq-1. - * changes during alignment. - */ - char **seq; - - /** original sequence residues as char pointer. - * range for first index: 0--nseq-1. - * only set during input - */ - char **orig_seq; - - /** - * @brief Squid's sequence info structure. - * Index range: 0--nseq-1. - * - * extra data are available: - * int flags; - * - * name: - * char name[SQINFO_NAMELEN]; - * - * database identifier: - * char id[SQINFO_NAMELEN]; - * - * database accession no: - * char acc[SQINFO_NAMELEN]; - * - * description: - * char desc[SQINFO_DESCLEN]; - * - * length of this seq, incl gaps in our case!: - * int len; - * - * start position on source seq (valid range: 1..len): - * int start; - * - * end position on source seq (valid range: 1..len): - * int stop; - * - * original length of source seq: - * int olen; - * - * kRNA, kDNA, kAmino, or kOther: - * int type; - * - * secondary structure string (index range: 0..len-1): - * char *ss; - * - * percent side chain surface access (index range: 0..len-1): - * char *sa; - * - * @see squid.h - * @see LogSqInfo() - * - */ - SQINFO *sqinfo; -} mseq_t; - -extern void -AliStat(mseq_t *prMSeq, bool bSampling, bool bReportAll); - -extern void -AddSeq(mseq_t **prMSeqDest_p, char *pcSeqName, char *pcSeqRes); - -extern void -SeqSwap(mseq_t *mseq, int i, int j); - -extern void -DealignMSeq(mseq_t *mseq); - -extern const char * -SeqTypeToStr(int seqtype); - -extern int -ReadSequences(mseq_t *prMSeq_p, char *pcSeqFile, int iSeqType, - int iMaxNumSeq, int iMaxSeqLen); - -extern void -NewMSeq(mseq_t **mseq); - -extern void -FreeMSeq(mseq_t **mseq); - -extern void -CopyMSeq(mseq_t **prMSeqDest_p, mseq_t *prMSeqSrc); - -extern void -LogSqInfo(SQINFO *sqinfo); - -extern int -FindSeqName(char *seqname, mseq_t *mseq); - -extern int -WriteAlignment(mseq_t *mseq, const char *aln_outfile, int msafile_format); - -extern void -DealignSeq(char *seq); - -extern void -ShuffleMSeq(mseq_t *prMSeq); - -extern void -SortMSeqByLength(mseq_t *prMSeq, const char cOrder); - -void -JoinMSeqs(mseq_t **prMSeqDest_p, mseq_t *prMSeqToAdd); - -bool -SeqsAreAligned(mseq_t *prMSeq); - -#endif |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/clustal/symmatrix.c --- a/clustalomega/clustal-omega-0.2.0/src/clustal/symmatrix.c Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,496 +0,0 @@\n-/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n-\n-/*********************************************************************\n- * Clustal Omega - Multiple sequence alignment\n- *\n- * Copyright (C) 2010 University College Dublin\n- *\n- * Clustal-Omega is free software; you can redistribute it and/or\n- * modify it under the terms of the GNU General Public License as\n- * published by the Free Software Foundation; either version 2 of the\n- * License, or (at your option) any later version.\n- *\n- * This file is part of Clustal-Omega.\n- *\n- ********************************************************************/\n-\n-/*\n- * RCS $Id: symmatrix.c 230 2011-04-09 15:37:50Z andreas $\n- *\n- *\n- * Functions for symmetric (square) matrices including diagonal.\n- * supports the notion of non-square sub-matrices of a symmetric\n- * matrix, i.e. where |rows|<|cols|.\n- *\n- * FIXME Allocating one big chunk of memory is probably\n- * much faster and also easier to maintain.\n- */\n-\n-#ifdef HAVE_CONFIG_H\n-#include "config.h"\n-#endif\n-\n-#include <stdlib.h>\n-#include <stdio.h>\n-#include <ctype.h>\n-#include <string.h>\n-#include <assert.h>\n-#include "symmatrix.h"\n-\n-\n-#if 0\n-#define DEBUG\n-#endif\n-\n-#define MAX_BUF_SIZE 65536\n-\n-/**\n- * @brief Allocates symmat and its members and initialises them. Data\n- * will be calloced, i.e. initialised with zeros.\n- *\n- * @param[out] symmat\n- * newly allocated and initialised symmatrix instance\n- * @param[in] nrows\n- * number of rows\n- * @param[in]\n- * ncols number of columns\n- *\n- * @return: non-zero on error\n- *\n- * @see FreeSymMatrix()\n- *\n- * @note: symmat data will be of fake shape nrows x ncols\n- *\n- */\n-int\n-NewSymMatrix(symmatrix_t **symmat, int nrows, int ncols)\n-{\n- int i; /* aux */\n- \n- assert(nrows>0 && ncols>0 && ncols>=nrows);\n- assert(ncols>0 && ncols>=nrows);\n-\n- (*symmat) = (symmatrix_t *) malloc(1*sizeof(symmatrix_t));\n- if (NULL == (*symmat)) {\n- fprintf(stderr, "Couldn\'t allocate memory (%s|%s)\\n",\n- __FILE__, __FUNCTION__);\n- return -1;\n- }\n- \n- (*symmat)->data = (double **) malloc(nrows * sizeof(double *));\n- if (NULL == (*symmat)->data) {\n- fprintf(stderr, "Couldn\'t allocate memory (%s|%s)\\n",\n- __FILE__, __FUNCTION__);\n- free(*symmat);\n- *symmat = NULL;\n- return -1;\n- }\n- for (i=0; i<nrows; i++) {\n- (*symmat)->data[i] = (double *) calloc((ncols-i), sizeof(double));\n- if (NULL == (*symmat)->data[i]) {\n- fprintf(stderr, "Couldn\'t allocate memory (%s|%s)\\n",\n- __FILE__, __FUNCTION__); \n- while (0!=--i) {\n- free((*symmat)->data[i]);\n- } \n- free((*symmat)->data);\n- free(*symmat);\n- *symmat = NULL;\n- return -1;\n- }\n-#ifdef TRACE\n- fprintf(stderr, "DEBUG(%s|%s():%d) initialising symmat with the number of the beast\\n",\n- __FILE__, __FUNCTION__, __LINE__);\n- {\n- int j;\n- for (j=0; j<ncols-i; j++) {\n- (*symmat)->data[i][j] = -666.0;\n- }\n-\n- }\n-#endif\n- }\n- \n- (*symmat)->nrows = nrows;\n- (*symmat)->ncols = ncols;\n-\n- return 0;\n-}\n-/*** end: new_symmatrix ***/\n-\n-\n-/**\n- * @brief Sets symmat data of given index to given value\n- *\n- * @param[in] symmat\n- * symmatrix_t whose data is to be set\n- * @param[in] i\n- * first index \n- * @param[in] j\n- * second index \n- * @param[in] value\n- * value used to set data point\n- *\n- * @see SymMatrixGetValue()\n- *\n- * @note This is a convenience function that checks index order.\n- *\n- */\n-void\n-SymMatrixSetValue(symmatrix_t *symmat, const int i, const int j, const double value)\n-{\n- assert(NULL != symmat);\n-\n- if (i<=j) {\n- assert(i < symmat->nrows && j < symmat->ncols);\n- symmat->data[i][j-i] = value;\n- } else {\n- assert(j < symmat->nrows && i < symmat->nc'..b's for reading\\n", pcFileIn);\n- free(buf);\n- return -1;\n- }\n- \n- /* get number of sequences from first line and allocate memory for\n- * distance matrix\n- *\n- */\n- if (NULL == fgets(buf, MAX_BUF_SIZE, prFilePointer) ) {\n- fprintf(stderr, "Couldn\'t read first line from %s\\n", pcFileIn);\n- iRetCode = -1;\n- goto closefile_and_freebuf;\n- }\n- if (strlen(buf)==MAX_BUF_SIZE-1) {\n- fprintf(stderr, "%s\\n", "Looks like I couldn\'t read complete line. Wrong format (or too small MAX_BUF_SIZE)");\n- iRetCode = -1;\n- goto closefile_and_freebuf;\n- }\n- if (sscanf(buf, "%d", &iTotalNSeq)!=1) {\n- fprintf(stderr, "ERROR: couldn\'t parse number of sequences from first line of %s\\n", pcFileIn); \n- iRetCode = -1;\n- goto closefile_and_freebuf;\n- }\n-\n-#if TRACE\n- Log(&rLog, LOG_FORCED_DEBUG, "iTotalNSeq parsed from %s is %d\\n", pcFileIn, iTotalNSeq);\n-#endif\n- \n- if (NewSymMatrix(prSymMat_p, iTotalNSeq, iTotalNSeq)) {\n- fprintf(stderr, "FATAL %s", "Memory allocation for distance matrix failed");\n- iRetCode = -1;\n- goto closefile_and_freebuf;\n- }\n-\n-\n- /* parse file line by line\n- *\n- */\n- while (NULL != fgets(buf, MAX_BUF_SIZE, prFilePointer)) {\n- char *szToken;\n- int is_newseq;\n-\n- if (MAX_BUF_SIZE-1 == strlen(buf)) {\n- fprintf(stderr, "%s\\n", "Looks like I couldn\'t read complete line. Wrong format (or too small MAX_BUF_SIZE)");\n- iRetCode = -1;\n- goto closefile_and_freebuf;\n- }\n-\n-#ifdef DEBUG\n- Log(&rLog, LOG_FORCED_DEBUG, "Got line: %s\\n", buf);\n-#endif\n-\n- /* new sequence label at beginning of line?\n- */\n- if (isblank(buf[0])) {\n- is_newseq = 0;\n- } else {\n- is_newseq = 1;\n- }\n-\n- /* tokenise line and treat new sequence specially\n- */\n- szToken = strtok(buf, " \\t");\n- if (is_newseq==1) {\n- iNParsedSeq++;\n- iNParsedDists=0;\n-\n- /* if format is lower dimensional matrix then first\n- * sequence has no distances but might have newline\n- * character at it\'s end.\n- */\n- while (isspace(szToken[strlen(szToken)-1])) {\n- szToken[strlen(szToken)-1]=\'\\0\';\n- }\n- /* FIXME save label? */\n- szToken = strtok(NULL, " \\t");\n- }\n- /* from here on it\'s only parsing of distances */\n- while (szToken != NULL) {\n- double dist;\n- iNParsedDists++;\n-\n- /* only parse what\'s needed */\n- if (iNParsedDists!=iNParsedSeq) {\n- /* parse and store distance\n- */\n- if (sscanf(szToken, "%lf", &dist)!=1) {\n- fprintf(stderr, "Couldn\'t parse float from entry \'%s\'\\n", szToken);\n- iRetCode = -1;\n- goto closefile_and_freebuf;\n- }\n-#if TRACE\n- Log(&rLog, LOG_FORCED_DEBUG, "Parsed distance %d for seq %d = %f\\n", iNParsedDists-1, iNParsedSeq-1, dist);\n-#endif\n- SymMatrixSetValue(*prSymMat_p, iNParsedSeq-1, iNParsedDists-1, dist);\n- SymMatrixSetValue(*prSymMat_p, iNParsedDists-1, iNParsedSeq-1, dist);\n- }\n- szToken = strtok(NULL, " \\t");\n- } \n- }\n-\n- if (iTotalNSeq!=iNParsedSeq) {\n- fprintf(stderr, "expected %d seqs, but only parsed %d\\n", iTotalNSeq, iNParsedSeq);\n- iRetCode = -1;\n- goto closefile_and_freebuf;\n- }\n-#if TRACE\n- for (i=0; i<iNParsedSeq; i++) {\n- int j;\n- for (j=0; j<iNParsedSeq; j++) {\n- Log(&rLog, LOG_FORCED_DEBUG, "prSymMat_p[%d][%d]=%f\\n", i, j, (*prSymMat_p)[i][j]);\n- }\n- }\n-#endif\n-\n-closefile_and_freebuf:\n- fclose(prFilePointer);\n- free(buf);\n- \n- return iRetCode;\n-}\n-/*** end: SymMatrixRead ***/\n-\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/clustal/symmatrix.h --- a/clustalomega/clustal-omega-0.2.0/src/clustal/symmatrix.h Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,80 +0,0 @@ -/********************************************************************* - * Clustal Omega - Multiple sequence alignment - * - * Copyright (C) 2010 University College Dublin - * - * Clustal-Omega is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This file is part of Clustal-Omega. - * - ********************************************************************/ - -/* - * RCS $Id: symmatrix.h 216 2011-03-19 10:11:53Z andreas $ - */ - -/** - * Functions for symmetric (square) matrices including diagonal. - * - * Supports the notion of non-square sub-matrices of a symmetric - * matrix, i.e. where |rows|<|cols| and the corresponding full matrix - * would be |cols|x|cols| - * - * Instead of making this one big chunk of memory we keep pointers to - * pointers, so that we can easily realloc (the project where this file - * originated from needed this for growing a "seed" matrix). - * - * FIXME Allocating one big chunk of memory is probably - * much faster and also easier to maintain. - * - * - */ - -#ifndef CLUSTALO_SYMMATRIX_H -#define CLUSTALO_SYMMATRIX_H - - -/** - * @brief symmetric matrix structure - */ -typedef struct { - int nrows; /**< number of rows */ - int ncols; /**< number of columns */ - /** - * stored data - * - * @note indices range: [i][j-i] i<=j. use getvalue() and - * setvalue() instead of accessing directly - * - * @see SymMatrixGetValue(), SymMatrixSetValue() - */ - double **data; -} symmatrix_t; - - - -extern int -NewSymMatrix(symmatrix_t **symmat, const int nrows, const int ncols); - -extern void -SymMatrixSetValue(symmatrix_t *symmat, const int i, const int j, const double value); - -extern double -SymMatrixGetValue(symmatrix_t *symmat, const int i, const int j); - -extern void -SymMatrixGetValueP(double **value, symmatrix_t *symmat, const int i, const int j); - -extern void -FreeSymMatrix(symmatrix_t **symmat); - -extern void -SymMatrixPrint(symmatrix_t *symmat, char **labels, const char *path); - -extern int -SymMatrixRead(char *pcFileIn, symmatrix_t **prSymMat_p); - -#endif |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/clustal/tree.c --- a/clustalomega/clustal-omega-0.2.0/src/clustal/tree.c Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,234 +0,0 @@ -/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ - -/********************************************************************* - * Clustal Omega - Multiple sequence alignment - * - * Copyright (C) 2010 University College Dublin - * - * Clustal-Omega is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This file is part of Clustal-Omega. - * - ********************************************************************/ - -/* - * RCS $Id: tree.c 230 2011-04-09 15:37:50Z andreas $ - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include <stdlib.h> -#include <string.h> -#include <assert.h> - -#include "util.h" -#include "log.h" -#include "muscle_upgma.h" -#include "tree.h" - -/** - * - * @brief Creates a UPGMA guide tree. This is a frontend function to - * the ported Muscle UPGMA code (). - * - * @param[out] tree - * created upgma tree. will be allocated here. use FreeMuscleTree() - * to free - * @param[in] labels - * pointer to nseq sequence names - * @param[in] distmat - * distance matrix - * @param[in] ftree - * optional: if non-NULL, tree will be written to this files - * - * @see FreeMuscleTree() - * @see MuscleUpgma2() - * - */ -void -GuideTreeUpgma(tree_t **tree, char **labels, - symmatrix_t *distmat, char *ftree) -{ - linkage_t linkage = LINKAGE_AVG; - FILE *fp = NULL; - - if (NULL != ftree) { - if (NULL == (fp=fopen(ftree, "w"))) { - Log(&rLog, LOG_ERROR, "Couldn't open tree-file '%s' for writing. Skipping", ftree); - } - /* fp NULL is handled later */ - } - - (*tree) = (tree_t *) CKMALLOC(1 * sizeof(tree_t)); - MuscleUpgma2((*tree), distmat, linkage, labels); - - if (rLog.iLogLevelEnabled <= LOG_DEBUG) { - Log(&rLog, LOG_DEBUG, "tree logging..."); - LogTree((*tree), LogGetFP(&rLog, LOG_DEBUG)); - } - - if (NULL != fp) { - MuscleTreeToFile(fp, (*tree)); - Log(&rLog, LOG_INFO, "Guide tree written to %s", ftree); - fclose(fp); - } -} -/*** end: guidetree_upgma ***/ - - - -/** - * - * @brief - * - * @param[out] tree - * created upgma tree. will be allocated here. use FreeMuscleTree() - * to free - * @param[in] mseq - * @param[in] ftree - * - * @return non-zero on error - * - */ -int -GuideTreeFromFile(tree_t **tree, mseq_t *mseq, char *ftree) -{ - int iNodeCount; - int iNodeIndex; - - (*tree) = (tree_t *) CKMALLOC(1 * sizeof(tree_t)); - if (MuscleTreeFromFile((*tree), ftree)!=0) { - Log(&rLog, LOG_ERROR, "%s", "MuscleTreeFromFile failed"); - return -1; - } - - /* Make sure tree is rooted */ - if (!IsRooted((*tree))) { - Log(&rLog, LOG_ERROR, "User tree must be rooted"); - return -1; - } - - if ((int)GetLeafCount((*tree)) != mseq->nseqs) { - Log(&rLog, LOG_ERROR, "User tree does not match input sequences"); - return -1; - } - - /* compare tree labels and sequence names and set leaf-ids */ - iNodeCount = GetNodeCount((*tree)); - for (iNodeIndex = 0; iNodeIndex < iNodeCount; ++iNodeIndex) { - char *LeafName; - int iSeqIndex; - - if (!IsLeaf(iNodeIndex, (*tree))) - continue; - LeafName = GetLeafName(iNodeIndex, (*tree)); - - if ((iSeqIndex=FindSeqName(LeafName, mseq))==-1) { - Log(&rLog, LOG_ERROR, "Label '%s' in tree could not be found in sequence names", LeafName); - return -1; - } - - SetLeafId((*tree), iNodeIndex, iSeqIndex); - } - - if (rLog.iLogLevelEnabled <= LOG_DEBUG) { - Log(&rLog, LOG_DEBUG, "tree logging..."); - LogTree((*tree), LogGetFP(&rLog, LOG_DEBUG)); - } - - return 0; -} -/*** end: GuideTreeFromFile() ***/ - - - -/** - * - * @brief Depth first traversal of tree, i.e. leaf nodes (sequences) - * will be visited first. Order can be used to guide progressive - * alignment order. - * - * @param[out] piOrderLR_p - * order in which left/right nodes (profiles) are to be aligned. - * allocated here; caller must free. - * @param[in] tree - * The tree to traverse; has to be rooted - * @param[in] mseq - * corresponding multiple sequence structure - * - */ -void -TraverseTree(int **piOrderLR_p, - tree_t *tree, mseq_t *mseq) -{ - int tree_nodeindex = 0; - int order_index = 0; - - assert(NULL!=tree); - assert(NULL!=mseq); - assert(IsRooted(tree)); - - /* allocate memory for node/profile alignment order; - * for every node allocate DIFF_NODE (3) int (1 left, 1 right, 1 parent) - */ - *piOrderLR_p = (int *)CKCALLOC(DIFF_NODE * GetNodeCount(tree), sizeof(int)); - - /* Log(&rLog, LOG_FORCED_DEBUG, "print tree->m_iNodeCount=%d", tree->m_iNodeCount); */ - - - tree_nodeindex = FirstDepthFirstNode(tree); - /*LOG_DEBUG("Starting with treenodeindex = %d", tree_nodeindex);*/ - - order_index = 0; - - do { - if (IsLeaf(tree_nodeindex, tree)) { - int leafid = GetLeafId(tree_nodeindex, tree); - if (leafid >= mseq->nseqs) - Log(&rLog, LOG_FATAL, "Sequence index out of range during tree traversal (leafid=%d nseqs=%d)", - leafid, mseq->nseqs); - - /* this is a leaf node, - * indicate this by registering same leafid for left/right - */ - - (*piOrderLR_p)[DIFF_NODE*order_index+LEFT_NODE] = leafid; - (*piOrderLR_p)[DIFF_NODE*order_index+RGHT_NODE] = leafid; - (*piOrderLR_p)[DIFF_NODE*order_index+PRNT_NODE] = tree_nodeindex; - - Log(&rLog, LOG_DEBUG, "Tree traversal: Visited leaf-node %d (leaf-id %d = Seq '%s')", - tree_nodeindex, leafid, mseq->sqinfo[leafid].name); - - } else { - int merge_nodeindex; - int left; - int right; - - merge_nodeindex = tree_nodeindex; - left = GetLeft(tree_nodeindex, tree); - right = GetRight(tree_nodeindex, tree); - - /* this is not a leaf node but a merge node, - * register left node (even) and right node (odd) - */ - (*piOrderLR_p)[DIFF_NODE*order_index+LEFT_NODE] = left; - (*piOrderLR_p)[DIFF_NODE*order_index+RGHT_NODE] = right; - (*piOrderLR_p)[DIFF_NODE*order_index+PRNT_NODE] = merge_nodeindex; - - Log(&rLog, LOG_DEBUG, "Tree traversal: Visited non-leaf node %d with siblings %d (L) and %d (R)", - merge_nodeindex, left, right); - } - tree_nodeindex = NextDepthFirstNode(tree_nodeindex, tree); - - order_index++; - - } while (NULL_NEIGHBOR != tree_nodeindex); - - return; -} -/*** end: TraverseTree ***/ |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/clustal/tree.h --- a/clustalomega/clustal-omega-0.2.0/src/clustal/tree.h Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,40 +0,0 @@ -/********************************************************************* - * Clustal Omega - Multiple sequence alignment - * - * Copyright (C) 2010 University College Dublin - * - * Clustal-Omega is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This file is part of Clustal-Omega. - * - ********************************************************************/ - -/* - * RCS $Id: tree.h 193 2011-02-07 15:45:21Z andreas $ - */ - -#ifndef CLUSTALO_TREE_H -#define CLUSTALO_TREE_H - -#include "symmatrix.h" -#include "muscle_tree.h" -#include "seq.h" - -enum {LEFT_NODE = 0, RGHT_NODE, PRNT_NODE, DIFF_NODE}; - -extern void -GuideTreeUpgma(tree_t **tree, - char **labels, symmatrix_t *tmat, char *ftree); - -extern int -GuideTreeFromFile(tree_t **tree, - mseq_t *mseq, char *ftree); - -extern void -TraverseTree(int **piOrderLR_p, - tree_t *tree, mseq_t *mseq); - -#endif |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/clustal/util.c --- a/clustalomega/clustal-omega-0.2.0/src/clustal/util.c Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,505 +0,0 @@\n-/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n-\n-/*********************************************************************\n- * Clustal Omega - Multiple sequence alignment\n- *\n- * Copyright (C) 2010 University College Dublin\n- *\n- * Clustal-Omega is free software; you can redistribute it and/or\n- * modify it under the terms of the GNU General Public License as\n- * published by the Free Software Foundation; either version 2 of the\n- * License, or (at your option) any later version.\n- *\n- * This file is part of Clustal-Omega.\n- *\n- ********************************************************************/\n-\n-/*\n- * RCS $Id: util.c 235 2011-04-13 14:13:19Z andreas $\n- */\n-\n-#ifdef HAVE_CONFIG_H\n-#include "config.h"\n-#endif\n-\n-#include <stdio.h>\n-#include <stdlib.h>\n-#include <string.h>\n-#include <assert.h>\n-#include <time.h>\n-\n-#include "log.h"\n-#include "util.h"\n-\n-\n-\n-\n-/* struct for QSortAndTrackIndex and SortAndTrackIndexCmp[Asc|Desc] */\n-typedef struct {\n- int piIndex;\n- int piValue;\n-} sortwithindex_t;\n-\n-\n-\n-\n-/**\n- * @brief Copy of squid\'s FileExists(). Copied here to make squid independent.\n- */\n-int\n-CheckIfFileExists(char *pcFilename)\n-{\n- FILE *prFile;\n- if ((prFile = fopen(pcFilename, "r"))) { \n- fclose(prFile);\n- return TRUE; \n- }\n- return FALSE;\n-}\n-/* end of CheckIfFileExists */\n-\n-\n-/**\n- * @brief Allocates memory (malloc)\n- *\n- * @param[in] bytes\n- * bytes to allocated\n- * @param[in] function\n- * calling function name\n- * @param[in] line\n- * calling function line\n- *\n- * @return void pointer to the newly allocated memory\n- *\n- * @note use provided macro CKMALLOC() which automatically adds\n- * function name and line number\n- *\n- */\n-void *\n-CkMalloc(size_t bytes, const char *function, const int line)\n-{\n- void *ret;\n- \n- if(NULL == (ret = malloc(bytes * sizeof(char)))) {\n- Log(&rLog, LOG_FATAL, "Out of memory (requested from %s:%d)\\n", function, line);\n- }\n-\n- return ret; \n-}\n-/*** end: ckmalloc ***/\n-\n-\n-\n-/**\n- * @brief Allocates memory (calloc). Memory will be\n- * set to zero.\n- *\n- * @param[in] count\n- * Allocate space for count objects\n- * @param[in] size\n- * Objects are of this size\n- * @param[in] function\n- * calling function name\n- * @param[in] line\n- * calling function line\n- *\n- * @return void pointer to the newly allocated and zeroed memory (calloc).\n- *\n- * @note use provided macro CKCALLOC() which automatically adds\n- * function name and line number\n- *\n- *\n- */\n-void *\n-CkCalloc(size_t count, size_t size, const char *function, const int line)\n-{\n- void *ret;\n- \n- if(NULL == (ret = calloc(count, size))) {\n- Log(&rLog, LOG_FATAL, "Out of memory (requested from %s:%d)\\n",\n- function, line);\n- exit(EXIT_FAILURE);\n- }\n- \n- return ret; \n-}\n-/*** end: CkCalloc ***/\n-\n-\n-/**\n-* @brief Reallocates memory\n- *\n- * @param[in] ptr\n- * Pointer to memory to be reallocated\n- * @param[in] bytes\n- * bytes to allocated\n- * @param[in] function\n- * calling function name\n- * @param[in] line\n- * calling function line\n- *\n- * @return void pointer to the newly allocated memory\n- *\n- * @note use provided macro CKREALLOC() which automatically adds\n- * function name and line number \n- *\n- */\n-void *\n-CkRealloc(void *ptr, size_t bytes, const char *function, const int line)\n-{\n- void *ret=NULL;\n-\n- if(NULL == (ret = realloc(ptr, bytes))) {\n- Log(&rLog, LOG_FATAL, "FATAL: Out of memory (requested from %s:%d)\\n",\n- function, line);\n- }\n-\n- return ret; \n-}\n-/*** end: ckrealloc ***/\n-\n-\n-\n-/**\n- *\n- * @brief Frees memory\n- *\n- * @param[in] ptr\n- * Pointer to memory to be freed\n- * @param[in] function\n- * calling function name\n- * @param[in] line\n- * calling function line\n- *\n- * @return void pointer to the now zeroed memory\n- *\n- * @note use provided macro CKFREE()\n- *\n- */\n-void *\n-CkFree(void *ptr, const char *function, const int line)\n-{\n- if (ptr '..b'n the int value of the 2nd sortwithindex_t and the\n- * 1st. Used for descending sort order in QSortWithIndexes()\n- *\n- * @see SortAndTrackIndexCmpDesc() and QSortAndTrackIndex()\n- */\n-int\n-SortAndTrackIndexCmpDesc(const void *a, const void *b)\n-{\n- const sortwithindex_t *a_t = (const sortwithindex_t *)a;\n- const sortwithindex_t *b_t = (const sortwithindex_t *)b;\n- \n- const int ia = (const int) a_t->piValue;\n- const int ib = (const int) b_t->piValue;\n- return ib - ia;\n-}\n-/*** end: SortAndTrackIndexCmpDesc ***/\n-\n-\n-\n-\n-/**\n- * @brief Sort a given int array in ascending or descending order,\n- * while keeping track of the element order.\n- *\n- * @param[out] piSortedIndices\n- * Will contain the indices of the sorted elements. Has to be preallocated.\n- * @param[out] piArrayToSort\n- * Array with values to sort. Will only be overwritten if\n- * bOverwriteArrayToSort it true.\n- * @param[in] iArrayLen\n- * Number of elements in piArrayToSort.\n- * @param[in] cOrder\n- * Sort order. \'a\' for ascending, \'d\' for descending.\n- * @param[in] bOverwriteArrayToSort\n- * If false do not overwrite the array to sort.\n- *\n- */ \n-void\n-QSortAndTrackIndex(int *piSortedIndices, int *piArrayToSort,\n- const int iArrayLen, const char cOrder,\n- const bool bOverwriteArrayToSort)\n-{\n- int iCtr; /**< aux */\n- \n- sortwithindex_t *prSort;\n-\n- \n- assert(NULL!=piSortedIndices);\n- assert(iArrayLen>0);\n- assert(NULL!=piArrayToSort);\n- assert(\'a\'==cOrder || \'d\'==cOrder);\n-\n- prSort = (sortwithindex_t *) CKMALLOC(iArrayLen * sizeof(sortwithindex_t));\n- \n- for (iCtr=0; iCtr<iArrayLen; iCtr++) {\n- prSort[iCtr].piIndex = iCtr;\n- prSort[iCtr].piValue = piArrayToSort[iCtr];\n-#if 0\n- LOG_DEBUG("b4 sort: prSort idx %d = val %d",\n- prSort[iCtr].piIndex, prSort[iCtr].piValue);\n-#endif\n- }\n-\n- if (\'a\'==cOrder) {\n- qsort(prSort, iArrayLen, sizeof(sortwithindex_t), SortAndTrackIndexCmpAsc);\n- } else if (\'d\'==cOrder) {\n- qsort(prSort, iArrayLen, sizeof(sortwithindex_t), SortAndTrackIndexCmpDesc);\n- } else {\n- Log(&rLog, LOG_FATAL, "Internal error: unknown order %c", cOrder);\n- }\n-\n- for (iCtr=0; iCtr<iArrayLen; iCtr++) {\n- piSortedIndices[iCtr] = prSort[iCtr].piIndex;\n- \n- if (bOverwriteArrayToSort) {\n- piArrayToSort[iCtr] = prSort[iCtr].piValue;\n- }\n-#if 0\n- LOG_DEBUG("after sort: prSort idx %d = val %d",\n- prSort[iCtr].piIndex, prSort[iCtr].piValue);\n-#endif\n- }\n- free(prSort);\n- \n- return; \n-}\n-/*** end: QSortWithIndexes() ***/\n-\n-\n-\n-\n-/**\n- * @brief Test if file is writable. File may or may not exist.\n- *\n- * @param[in] pcFileName\n- * Filename to check\n- *\n- * @return True if file is writable at the time of calling\n- *\n- */ \n-bool\n-FileIsWritable(char *pcFileName)\n-{\n- bool bFileAlreadyExisted;\n- FILE *prFilePointer;\n- bool bIsWritable;\n- \n- if (0 != CheckIfFileExists(pcFileName)) {\n- bFileAlreadyExisted = TRUE;\n- } else {\n- bFileAlreadyExisted = FALSE;\n- }\n-\n- if (NULL == (prFilePointer=fopen(pcFileName, "a"))) {\n- bIsWritable = FALSE;\n- } else {\n- bIsWritable = TRUE;\n- if (0 != fclose(prFilePointer)) {\n- Log(&rLog, LOG_ERROR, "Couldn\'t close temporily created file %s. Expect trouble...");\n- }\n- }\n- \n-#if 0\n- LOG_DEBUG("%s existed?=%d writable=%d", pcFileName,\n- (TRUE==bFileAlreadyExisted? 1 : 0),\n- (TRUE==bIsWritable? 1:0));\n-#endif\n- \n- /* delete if file didn\'t exist before and was created here\n- * temporarily\n- */\n- if (FALSE==bFileAlreadyExisted && TRUE==bIsWritable) {\n- if (0 != remove(pcFileName)) {\n- Log(&rLog, LOG_ERROR, "Removing of temporarily created file %s failed. Expect trouble...");\n- }\n- }\n- return bIsWritable; \n-}\n-/*** end: FileIsWritable() ***/\n-\n-\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/clustal/util.h --- a/clustalomega/clustal-omega-0.2.0/src/clustal/util.h Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,76 +0,0 @@ -/********************************************************************* - * Clustal Omega - Multiple sequence alignment - * - * Copyright (C) 2010 University College Dublin - * - * Clustal-Omega is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This file is part of Clustal-Omega. - * - ********************************************************************/ - -/* - * RCS $Id: util.h 230 2011-04-09 15:37:50Z andreas $ - */ - -#include <limits.h> -#include <string.h> -#include <strings.h> -#include <stdarg.h> -#include <stdbool.h> - -#ifndef CLUSTALO_UTIL_H -#define CLUSTALO_UTIL_H - - -#define CKMALLOC(b) CkMalloc((b), __FUNCTION__, __LINE__) -#define CKCALLOC(c, s) CkCalloc((c), (s), __FUNCTION__, __LINE__) -#define CKREALLOC(p, b) CkRealloc((p), (b), __FUNCTION__, __LINE__) -#define CKFREE(b) ((b)=CkFree((b), __FUNCTION__, __LINE__)) - -#ifndef MAX -#define MAX(a,b) ((a)>(b)?(a):(b)) -#endif -#ifndef MIN -#define MIN(a,b) ((a)<(b)?(a):(b)) -#endif - -/* STR_EQ: strings are equal, case sensitive */ -#define STR_EQ(a,b) (strcmp((a),(b)) == 0) -/* STR_NC_EQ: strings are equal, ignoring case */ -#define STR_NC_EQ(a,b) (strcasecmp((a),(b)) == 0) - - -/* type boolean and false and true defined in stdbool.h */ -#ifndef TRUE -#define TRUE true -#endif -#ifndef FALSE -#define FALSE false -#endif - -/* clashes with hhalign -#define FAIL -1 -#define OK 0 -*/ - - - -/* don't use the following directly; use macros provided above instead - */ -void *CkMalloc(size_t size, const char *function, const int line); -void *CkCalloc(size_t count, size_t size, const char *function, const int line); -void *CkRealloc(void *ptr, size_t bytes, const char *function, const int line); -void *CkFree(void *ptr, const char *function, const int line); -char *CkStrdup(const char *s); -void PermutationArray(int **array, const int len); -void RandomUniqueIntArray(int *array, const int array_len, const int max_value); -int IntCmp(const void *a, const void *b); -bool FileIsWritable(char *pcFileName); -void QSortAndTrackIndex(int *piSortedIndices, int *piArrayToSort, - const int uArrayLen, const char cOrder, const bool bOverwriteArrayToSort); - -#endif |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/clustal/weights.c --- a/clustalomega/clustal-omega-0.2.0/src/clustal/weights.c Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,337 +0,0 @@\n-/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n-\n-/* Module for deriving sequence weights from a tree. Largely based on\n- * Bob Edgar\'s Muscle (mainly clwwt.cpp; version 3.7). Ported to pure\n- * C. Most functions where apparently based on Clustal 1.8 anyway.\n- *\n- * Muscle\'s code is public domain and so is this code here.\n- *\n- * From http://www.drive5.com/muscle/license.htm:\n- * """\n- * MUSCLE is public domain software\n- *\n- * The MUSCLE software, including object and source code and\n- * documentation, is hereby donated to the public domain.\n- *\n- * Disclaimer of warranty\n- * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,\n- * EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION IMPLIED\n- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n- * """\n- *\n- */\n- \n-/*\n- * RCS $Id: weights.c 231 2011-04-09 17:13:06Z andreas $\n- */\n-\n-/*\n- * Documentation from Muscle\n- *\n- * """\n- * Compute weights by the CLUSTALW method.\n- * Thompson, Higgins and Gibson (1994), CABIOS (10) 19-29;\n- * see also CLUSTALW paper.\n- * \n- * Weights are computed from the edge lengths of a rooted tree.\n- * \n- * Define the strength of an edge to be its length divided by the number\n- * of leaves under that edge. The weight of a sequence is then the sum\n- * of edge strengths on the path from the root to the leaf.\n- * \n- * Example.\n- * \n- * 0.2\n- * -----A 0.1\n- * -x ------- B 0.7\n- * --------y ----------- C\n- * 0.3 ----------z\n- * 0.4 -------------- D\n- * 0.8\n- * \n- * Edge Length Leaves Strength\n- * ---- ----- ------ --------\n- * xy 0.3 3 0.1\n- * xA 0.2 1 0.2\n- * yz 0.4 2 0.2\n- * yB 0.1 1 0.1\n- * zC 0.7 1 0.7\n- * zD 0.8 1 0.8\n- * \n- * Leaf Path Strengths Weight\n- * ---- ---- --------- ------\n- * A xA 0.2 0.2\n- * B xy-yB 0.1 + 0.1 0.2\n- * C xy-yz-zC 0.1 + 0.2 + 0.7 1.0\n- * D xy-yz-zD 0.1 + 0.2 + 0.8 1.1\n- * """\n- *\n- */\n-\n-#ifdef HAVE_CONFIG_H\n-#include "config.h"\n-#endif\n-\n-#include <assert.h>\n-#include "log.h"\n-#include "muscle_tree.h"\n-#include "weights.h"\n-\n-\n-/* \n- #undef DEBUG \n-*/\n-\n-\n-/**\n- * @brief FIXME\n- *\n- * @param[out] puLeavesUnderNode\n- * FIXME\n- * @param[in] prTree\n- * FIXME\n- * @param[in] uNodeIndex\n- * FIXME\n- *\n- * @return The return value\n- *\n- * @note see Muscle3.7:clwwt.cpp\n- * \n- */ \n-uint\n-CountLeaves(uint *puLeavesUnderNode, tree_t *prTree, uint uNodeIndex)\n-{\n- uint uLeft;\n- uint uRight;\n- uint uRightCount;\n- uint uLeftCount;\n- uint uCount;\n-\n-\n- if (IsLeaf(uNodeIndex, prTree)) {\n-\t\tpuLeavesUnderNode[uNodeIndex] = 1;\n-\t\treturn 1;\n- }\n-\n- uLeft = GetLeft(uNodeIndex, prTree);\n- uRight = GetRight(uNodeIndex, prTree);\n- uRightCount = CountLeaves(puLeavesUnderNode, prTree, uRight);\n- uLeftCount = CountLeaves(puLeavesUnderNode, prTree, uLeft);\n- uCount = uRightCount + uLeftCount;\n-\n- puLeavesUnderNode[uNodeIndex] = uCount;\n- \n- return uCount; \n-}\n-/*** end: CountLeaves() ***/\n-\n-\n-\n-\n-/**\n- * @brief Normalise values in a double array to values between 0 and 1.\n- *\n- * @param[out] p\n- * double array with n elements\n- * @param[in] n\n- * number of elements in p\n- *\n- * @note From Muscle3.7: intmath.cpp:Normalize()\n- * \n- */ \n-void\n-Normalise(double *p, uint n) {\n- unsigned i;\n- double dSum = 0.0;\n- for (i = 0; i < n; ++i) {\n- '..b'1 == uLeafCount) {\n-\t\t(*pdWeights_p)[0] = 1.0;\n-\t\treturn 0;\n- } else if (2 == uLeafCount) {\n-\t\t(*pdWeights_p)[0] = 0.5;\n-\t\t(*pdWeights_p)[1] = 0.5;\n-\t\treturn 0;\n- }\n- \n- if (!IsRooted(prTree)) {\n- Log(&rLog, LOG_ERROR, "Tree must be rooted to get weights");\n- CKFREE(pdWeights_p);\n- return -1;\n- }\n-\n-\n-#ifdef TRACE\n- Log(&rLog, LOG_FORCED_DEBUG, "%s", "Weights follow");\n- fprintf(stderr, "Node Leaves Length Strength\\n");\n- fprintf(stderr, "---- ------ -------- --------\\n");\n- /* 1234 123456 12345678 12345678 */\n-#endif\n- \n- uRootNodeIndex = GetRootNodeIndex(prTree);\n- puLeavesUnderNode = (uint *) CKCALLOC(uNodeCount, sizeof(uint));\n-\n- uLeavesUnderRoot = CountLeaves(puLeavesUnderNode, prTree, uRootNodeIndex);\n-\tif (uLeavesUnderRoot != uLeafCount) {\n-\t\tLog(&rLog, LOG_FATAL, "Internal error, root count %u %u",\n- uLeavesUnderRoot, uLeafCount);\n- }\n-#if 0\n- for (uNodeIndex=0; uNodeIndex<uNodeCount; uNodeIndex++) {\n- Log(&rLog, LOG_FORCED_DEBUG, "LeavesUnderNode[%d]=%d", uNodeIndex, puLeavesUnderNode[uNodeIndex]);\n- }\n-#endif\n-\n- pdStrengths = (double *) CKMALLOC(uNodeCount * sizeof(double));\n- \n- for (uNodeIndex=0; uNodeIndex < uNodeCount; uNodeIndex++) {\n- uint uParent;\n- double dLength;\n- uint uLeaves;\n- double dStrength;\n- \n- if (IsRoot(uNodeIndex, prTree)) {\n- pdStrengths[uNodeIndex] = 0.0;\n- continue;\n- }\n- \n- uParent = GetParent(uNodeIndex, prTree);\n- dLength = GetEdgeLength(uNodeIndex, uParent, prTree);\n- uLeaves = puLeavesUnderNode[uNodeIndex];\n- dStrength = dLength / (double) uLeaves;\n- pdStrengths[uNodeIndex] = dStrength;\n- \n-#ifdef TRACE\n- fprintf(stderr, "%4u %6u %8g %8g\\n", uNodeIndex, uLeaves, dLength, dStrength);\n-#endif \n- }\n-\n-\n-\n-\n- \n- if (bLogWeights){\n- fprintf(stderr, "\\n");\n- fprintf(stderr, " Seq Path..Weight\\n");\n- fprintf(stderr, "-------------------- ------------\\n");\n- }\n-\tfor (i=0; i<uLeafCount; i++) {\n-\t\tdouble dWeight = 0.0;\n-\t\tunsigned uLeafNodeIndex;\n-\t\tunsigned uNode;\n-\n- uLeafNodeIndex = LeafIndexToNodeIndex(i, prTree);\n- uNode = uLeafNodeIndex;\n-\n- if (bLogWeights){\n- fprintf(stderr, "%20.20s %4u ", GetLeafName(uLeafNodeIndex, prTree), uLeafNodeIndex);\n- }\n-\t\tif (! IsLeaf(uLeafNodeIndex, prTree)) {\n-\t\t\tLog(&rLog, LOG_FATAL, \n- "Internal error: non-leaf-node %d", uLeafNodeIndex);\n- }\n- \n- /*LOG_DEBUG("dWeight = %f", dWeight);*/\n-\t\twhile (! IsRoot(uNode, prTree)) {\n-\t\t\tdWeight += pdStrengths[uNode];\n- /*LOG_DEBUG("dWeight +== %f", pdStrengths[uNode]);*/\n-\t\t\tuNode = GetParent(uNode, prTree);\n- if (bLogWeights){\n- fprintf(stderr, "->%u(%g)", uNode, pdStrengths[uNode]);\n- }\n- }\n- /* AW: no idea what this is, but it\'s done like this in Muscle */\n-\t\tif (dWeight < 0.0001) {\n-#ifdef TRACE\n-\t\t\tfprintf(stderr, "zero->one");\n-#endif\n-\t\t\tdWeight = 1.0;\n- }\n-\n- /* @note: the only difference to the muscle code is here: we\n- * use the input index for storing weights, instead of the\n- * tree leaf index\n- */\n- (*pdWeights_p)[GetLeafId(uLeafNodeIndex, prTree)] = dWeight;\n- if (bLogWeights){\n- fprintf(stderr, " = %g\\n", dWeight);\n- }\n- }\n-\n-#if 0\n- for (i=0; i<uLeafCount; i++) {\n- Log(&rLog, LOG_FORCED_DEBUG, "Weights before normalisation: pdWeights_p[%d]=%f", i, (*pdWeights_p)[i]);\n- /*LOG_DEBUG("Should be %d", GetLeafId(LeafIndexToNodeIndex(i, prTree), prTree));*/\n- }\n-#endif\n-\n-\tNormalise((*pdWeights_p), uLeafCount);\n- \n-\n- CKFREE(puLeavesUnderNode);\n- CKFREE(pdStrengths);\n- \n- return 0;\n-}\n-/*** end: CalcWeights() ***/\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/clustal/weights.h --- a/clustalomega/clustal-omega-0.2.0/src/clustal/weights.h Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,26 +0,0 @@ -/********************************************************************* - * Clustal Omega - Multiple sequence alignment - * - * Copyright (C) 2010 University College Dublin - * - * Clustal-Omega is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This file is part of Clustal-Omega. - * - ********************************************************************/ - -/* - * RCS $Id: weights.h 193 2011-02-07 15:45:21Z andreas $ - */ - -#ifndef CLUSTALO_WEIGHTS_H -#define CLUSTALO_WEIGHTS_H - -extern int -CalcClustalWeights(double **pdWeights_p, tree_t *prTree); - - -#endif |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/clustalo-api-test.c --- a/clustalomega/clustal-omega-0.2.0/src/clustalo-api-test.c Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,102 +0,0 @@ -/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ - -/********************************************************************* - * Clustal Omega - Multiple sequence alignment - * - * Copyright (C) 2010 University College Dublin - * - * Clustal-Omega is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This file is part of Clustal-Omega. - * - ********************************************************************/ - -/* - * RCS $Id: clustalo-api-test.c 213 2011-03-11 16:10:15Z andreas $ - */ - - -#include <stdio.h> - -/* Include clustal-omega's header. That's all you need - * - * If you developing in C++, use the following instead: - * extern "C" { - * #include "clustal-omega.h" - * } - */ -#include "clustal-omega.h" - - -int -main(int argc, char **argv) -{ - /* the multiple sequence structure */ - mseq_t *prMSeq = NULL; - /* for openmp: number of threads to use */ - int iThreads = 1; - /* alignment options to use */ - opts_t rAlnOpts; - /* an input file */ - char *pcSeqInfile; - int iAux; - - /* use LOGLEVEL_QUIET to make Clustal shut up */ - iVerbosityLevel = LOGLEVEL_INFO; - - SetDefaultAlnOpts(&rAlnOpts); - - InitClustalOmega(iThreads); - - /* Get sequence input file name from command line - */ - if (argc!=2) { - Fatal("Need sequence file as argument"); - } - pcSeqInfile = argv[1]; - - /* Read sequence file - */ - NewMSeq(&prMSeq); - if (ReadSequences(prMSeq, pcSeqInfile, - SEQTYPE_UNKNOWN, - INT_MAX, INT_MAX)) { - Fatal("Reading sequence file '%s' failed", pcSeqInfile); - } - - /* Dump some info about the sequences - */ - for (iAux=0; iAux<prMSeq->nseqs; iAux++) { - Info(LOGLEVEL_INFO, - "Sequence no %d has the following name: %s", - iAux, prMSeq->sqinfo[iAux].name); - Info(LOGLEVEL_INFO, - "Sequence no %d has the following residues: %s", - iAux, prMSeq->seq[iAux]); - /* more info can be found in prMSeq->sqinfo[iAux] */ - } - - - /* Align the sequences without a profile (NULL) - */ - if (Align(prMSeq, NULL, & rAlnOpts)) { - Fatal("A fatal error happended during the alignment process"); - } - - - /* Output of final alignment to stdout (NULL) as aligned fasta/a2m - */ - if (WriteAlignment(prMSeq, NULL, MSAFILE_A2M)) { - Fatal("Could not save alignment"); - } - - FreeMSeq(&prMSeq); - - Info(LOGLEVEL_INFO, "Successfull program exit"); - - return EXIT_SUCCESS; -} -/*** end of main() ***/ |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/config.h.in --- a/clustalomega/clustal-omega-0.2.0/src/config.h.in Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,247 +0,0 @@ -/* src/config.h.in. Generated from configure.ac by autoheader. */ - -/* Define if building universal (internal helper macro) */ -#undef AC_APPLE_UNIVERSAL_BUILD - -/* Let all files know they are being used inside Clustal Omega */ -#undef CLUSTALO - -/* This is a CYGWIN system */ -#undef CYGWIN - -/* This is a Darwin system */ -#undef DARWIN - -/* Define to 1 if you have the <argtable2.h> header file. */ -#undef HAVE_ARGTABLE2_H - -/* Define to 1 if you have the <assert.h> header file. */ -#undef HAVE_ASSERT_H - -/* Define to 1 if you have the <ctype.h> header file. */ -#undef HAVE_CTYPE_H - -/* Define to 1 if you have the <dlfcn.h> header file. */ -#undef HAVE_DLFCN_H - -/* Define to 1 if you have the <float.h> header file. */ -#undef HAVE_FLOAT_H - -/* Define to 1 if you have the `fseek64' function. */ -#undef HAVE_FSEEK64 - -/* Define to 1 if you have the `fseeko' function. */ -#undef HAVE_FSEEKO - -/* Define to 1 if you have the `fseeko64' function. */ -#undef HAVE_FSEEKO64 - -/* Define to 1 if you have the `ftell64' function. */ -#undef HAVE_FTELL64 - -/* Define to 1 if you have the `ftello' function. */ -#undef HAVE_FTELLO - -/* Define to 1 if you have the `ftello64' function. */ -#undef HAVE_FTELLO64 - -/* Define to 1 if you have the <inttypes.h> header file. */ -#undef HAVE_INTTYPES_H - -/* Define to 1 if you have the `argtable2' library (-largtable2). */ -#undef HAVE_LIBARGTABLE2 - -/* Define to 1 if you have the `m' library (-lm). */ -#undef HAVE_LIBM - -/* Define to 1 if you have the <limits.h> header file. */ -#undef HAVE_LIMITS_H - -/* Has log2() */ -#undef HAVE_LOG2 - -/* Define to 1 if you have the <math.h> header file. */ -#undef HAVE_MATH_H - -/* Define to 1 if you have the <memory.h> header file. */ -#undef HAVE_MEMORY_H - -/* Define to 1 if you have the `ntohl' function. */ -#undef HAVE_NTOHL - -/* Define to 1 if you have the `ntohs' function. */ -#undef HAVE_NTOHS - -/* Define to 1 if you have the `ntonl' function. */ -#undef HAVE_NTONL - -/* Define to 1 if you have the `ntons' function. */ -#undef HAVE_NTONS - -/* Defined if OpenMP should and can be used */ -#undef HAVE_OPENMP - -/* Define to 1 if you have the <stdarg.h> header file. */ -#undef HAVE_STDARG_H - -/* Define to 1 if you have the <stdint.h> header file. */ -#undef HAVE_STDINT_H - -/* Define to 1 if you have the <stdio.h> header file. */ -#undef HAVE_STDIO_H - -/* Define to 1 if you have the <stdlib.h> header file. */ -#undef HAVE_STDLIB_H - -/* Define to 1 if you have the <strings.h> header file. */ -#undef HAVE_STRINGS_H - -/* Define to 1 if you have the <string.h> header file. */ -#undef HAVE_STRING_H - -/* Define to 1 if you have the `stroul' function. */ -#undef HAVE_STROUL - -/* Define to 1 if you have the `strtoull' function. */ -#undef HAVE_STRTOULL - -/* Define to 1 if you have the <sys/stat.h> header file. */ -#undef HAVE_SYS_STAT_H - -/* Define to 1 if you have the <sys/types.h> header file. */ -#undef HAVE_SYS_TYPES_H - -/* Define to 1 if you have the <time.h> header file. */ -#undef HAVE_TIME_H - -/* Define to 1 if you have the <unistd.h> header file. */ -#undef HAVE_UNISTD_H - -/* This is a LINUX system */ -#undef LINUX - -/* Define to the sub-directory in which libtool stores uninstalled libraries. - */ -#undef LT_OBJDIR - -/* This is a MinGW system */ -#undef MINGW - -/* No-debug Mode */ -#undef NDEBUG - -/* Some strange OS */ -#undef OTHEROS - -/* Name of package */ -#undef PACKAGE - -/* Define to the address where bug reports for this package should be sent. */ -#undef PACKAGE_BUGREPORT - -/* The package code name */ -#undef PACKAGE_CODENAME - -/* Define to the full name of this package. */ -#undef PACKAGE_NAME - -/* Define to the full name and version of this package. */ -#undef PACKAGE_STRING - -/* Define to the one symbol short name of this package. */ -#undef PACKAGE_TARNAME - -/* Define to the home page for this package. */ -#undef PACKAGE_URL - -/* Define to the version of this package. */ -#undef PACKAGE_VERSION - -/* The size of `fpos_t', as computed by sizeof. */ -#undef SIZEOF_FPOS_T - -/* The size of `unsigned int', as computed by sizeof. */ -#undef SIZEOF_UNSIGNED_INT - -/* The size of `unsigned long', as computed by sizeof. */ -#undef SIZEOF_UNSIGNED_LONG - -/* The size of `unsigned long long', as computed by sizeof. */ -#undef SIZEOF_UNSIGNED_LONG_LONG - -/* The size of `unsigned short', as computed by sizeof. */ -#undef SIZEOF_UNSIGNED_SHORT - -/* This is a Solaris system */ -#undef SOLARIS - -/* This is a BSD system */ -#undef SOMEBSD - -/* Define to 1 if you have the ANSI C header files. */ -#undef STDC_HEADERS - -/* Enable extensions on AIX 3, Interix. */ -#ifndef _ALL_SOURCE -# undef _ALL_SOURCE -#endif -/* Enable GNU extensions on systems that have them. */ -#ifndef _GNU_SOURCE -# undef _GNU_SOURCE -#endif -/* Enable threading extensions on Solaris. */ -#ifndef _POSIX_PTHREAD_SEMANTICS -# undef _POSIX_PTHREAD_SEMANTICS -#endif -/* Enable extensions on HP NonStop. */ -#ifndef _TANDEM_SOURCE -# undef _TANDEM_SOURCE -#endif -/* Enable general extensions on Solaris. */ -#ifndef __EXTENSIONS__ -# undef __EXTENSIONS__ -#endif - - -/* Version number of package */ -#undef VERSION - -/* Define if using the dmalloc debugging malloc package */ -#undef WITH_DMALLOC - -/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most - significant byte first (like Motorola and SPARC, unlike Intel). */ -#if defined AC_APPLE_UNIVERSAL_BUILD -# if defined __BIG_ENDIAN__ -# define WORDS_BIGENDIAN 1 -# endif -#else -# ifndef WORDS_BIGENDIAN -# undef WORDS_BIGENDIAN -# endif -#endif - -/* Define to 1 if on MINIX. */ -#undef _MINIX - -/* Define to 2 if the system does not provide POSIX.1 features except with - this defined. */ -#undef _POSIX_1_SOURCE - -/* Define to 1 if you need to in order for `stat' and other things to work. */ -#undef _POSIX_SOURCE - -/* Define to empty if `const' does not conform to ANSI C. */ -#undef const - -/* Define to `__inline__' or `__inline' if that's what the C compiler - calls it, or to nothing if 'inline' is not supported under any name. */ -#ifndef __cplusplus -#undef inline -#endif - -/* Define to `long int' if <sys/types.h> does not define. */ -#undef off_t - -/* Define to `unsigned int' if <sys/types.h> does not define. */ -#undef size_t |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/hhalign/Makefile.am --- a/clustalomega/clustal-omega-0.2.0/src/hhalign/Makefile.am Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,26 +0,0 @@ -# Some useful automake documentation: -# http://www.openismus.com/documents/linux/automake/automake.shtml -# http://www.bioinf.uni-freiburg.de/~mmann/HowTo/automake.html - -#SUBDIRS = -#EXTRA_DIST = -# LDADD = foofiles/libfoo.a - -AM_CXXFLAGS = -fno-strict-aliasing -DCLUSTALO -DCLUSTALO_NOFILE -DDEFAULT_FILTER=90 @OPENMP_CXXFLAGS@ @AM_CXXFLAGS@ - -noinst_LTLIBRARIES = libhhalign.la - -libhhalign_la_SOURCES = hhalign.cpp hhalign.h \ - hash-C.h hash.h hhdecl-C.h hhfunc-C.h hhfunc.h \ - hhmatrices-C.h hhutil-C.h \ - hhalignment-C.h hhalignment.h \ - hhfullalignment-C.h hhfullalignment.h \ - hhhalfalignment-C.h hhhalfalignment.h \ - hhhit-C.h hhhit.h hhhitlist-C.h hhhitlist.h \ - hhhmm-C.h hhhmm.h \ - util-C.h list-C.h list.h \ - general.h - -library_includedir=$(includedir)/clustalo/hhalign - -library_include_HEADERS = general.h hhfunc.h |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/hhalign/Makefile.in --- a/clustalomega/clustal-omega-0.2.0/src/hhalign/Makefile.in Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,556 +0,0 @@\n-# Makefile.in generated by automake 1.11.1 from Makefile.am.\n-# @configure_input@\n-\n-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,\n-# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,\n-# Inc.\n-# This Makefile.in is free software; the Free Software Foundation\n-# gives unlimited permission to copy and/or distribute it,\n-# with or without modifications, as long as this notice is preserved.\n-\n-# This program is distributed in the hope that it will be useful,\n-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without\n-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A\n-# PARTICULAR PURPOSE.\n-\n-@SET_MAKE@\n-\n-# Some useful automake documentation:\n-# http://www.openismus.com/documents/linux/automake/automake.shtml\n-# http://www.bioinf.uni-freiburg.de/~mmann/HowTo/automake.html\n-\n-#SUBDIRS = \n-#EXTRA_DIST =\n-# LDADD = foofiles/libfoo.a\n-\n-\n-VPATH = @srcdir@\n-pkgdatadir = $(datadir)/@PACKAGE@\n-pkgincludedir = $(includedir)/@PACKAGE@\n-pkglibdir = $(libdir)/@PACKAGE@\n-pkglibexecdir = $(libexecdir)/@PACKAGE@\n-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd\n-install_sh_DATA = $(install_sh) -c -m 644\n-install_sh_PROGRAM = $(install_sh) -c\n-install_sh_SCRIPT = $(install_sh) -c\n-INSTALL_HEADER = $(INSTALL_DATA)\n-transform = $(program_transform_name)\n-NORMAL_INSTALL = :\n-PRE_INSTALL = :\n-POST_INSTALL = :\n-NORMAL_UNINSTALL = :\n-PRE_UNINSTALL = :\n-POST_UNINSTALL = :\n-build_triplet = @build@\n-host_triplet = @host@\n-subdir = src/hhalign\n-DIST_COMMON = $(library_include_HEADERS) $(srcdir)/Makefile.am \\\n-\t$(srcdir)/Makefile.in\n-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4\n-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_prefix_config_h.m4 \\\n-\t$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \\\n-\t$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \\\n-\t$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/ax_openmp.m4 \\\n-\t$(top_srcdir)/configure.ac\n-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \\\n-\t$(ACLOCAL_M4)\n-mkinstalldirs = $(install_sh) -d\n-CONFIG_HEADER = $(top_builddir)/src/config.h\n-CONFIG_CLEAN_FILES =\n-CONFIG_CLEAN_VPATH_FILES =\n-LTLIBRARIES = $(noinst_LTLIBRARIES)\n-libhhalign_la_LIBADD =\n-am_libhhalign_la_OBJECTS = hhalign.lo\n-libhhalign_la_OBJECTS = $(am_libhhalign_la_OBJECTS)\n-DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src\n-depcomp = $(SHELL) $(top_srcdir)/depcomp\n-am__depfiles_maybe = depfiles\n-am__mv = mv -f\n-CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \\\n-\t$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)\n-LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \\\n-\t--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \\\n-\t$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)\n-CXXLD = $(CXX)\n-CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \\\n-\t--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \\\n-\t$(LDFLAGS) -o $@\n-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \\\n-\t$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)\n-LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \\\n-\t--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \\\n-\t$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)\n-CCLD = $(CC)\n-LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \\\n-\t--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \\\n-\t$(LDFLAGS) -o $@\n-SOURCES = $(libhhalign_la_SOURCES)\n-DIST_SOURCES = $(libhhalign_la_SOURCES)\n-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed \'s|.|.|g\'`;\n-am__vpath_adj = case $$p in \\\n- $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \\\n- *) f=$$p;; \\\n- esac;\n-am__strip_dir = f=`echo $$p | sed -e \'s|^.*/||\'`;\n-am__install_max = 40\n-am__nobase_strip_setup = \\\n- srcdirstrip=`echo "$(srcdir)" | sed \'s/[].[^$$\\\\*|]/\\\\\\\\&/g\'`\n-am__nobase_strip = \\\n- for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"\n-am__nobase_list = $(am__nobase_strip_setup); \\\n- for p in $$lis'..b'lddir)/|;t"`; \\\n-\tcase $$dist_files in \\\n-\t */*) $(MKDIR_P) `echo "$$dist_files" | \\\n-\t\t\t sed \'/\\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,\' | \\\n-\t\t\t sort -u` ;; \\\n-\tesac; \\\n-\tfor file in $$dist_files; do \\\n-\t if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \\\n-\t if test -d $$d/$$file; then \\\n-\t dir=`echo "/$$file" | sed -e \'s,/[^/]*$$,,\'`; \\\n-\t if test -d "$(distdir)/$$file"; then \\\n-\t find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \\;; \\\n-\t fi; \\\n-\t if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \\\n-\t cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \\\n-\t find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \\;; \\\n-\t fi; \\\n-\t cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \\\n-\t else \\\n-\t test -f "$(distdir)/$$file" \\\n-\t || cp -p $$d/$$file "$(distdir)/$$file" \\\n-\t || exit 1; \\\n-\t fi; \\\n-\tdone\n-check-am: all-am\n-check: check-am\n-all-am: Makefile $(LTLIBRARIES) $(HEADERS)\n-installdirs:\n-\tfor dir in "$(DESTDIR)$(library_includedir)"; do \\\n-\t test -z "$$dir" || $(MKDIR_P) "$$dir"; \\\n-\tdone\n-install: install-am\n-install-exec: install-exec-am\n-install-data: install-data-am\n-uninstall: uninstall-am\n-\n-install-am: all-am\n-\t@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am\n-\n-installcheck: installcheck-am\n-install-strip:\n-\t$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \\\n-\t install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \\\n-\t `test -z \'$(STRIP)\' || \\\n-\t echo "INSTALL_PROGRAM_ENV=STRIPPROG=\'$(STRIP)\'"` install\n-mostlyclean-generic:\n-\n-clean-generic:\n-\n-distclean-generic:\n-\t-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)\n-\t-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)\n-\n-maintainer-clean-generic:\n-\t@echo "This command is intended for maintainers to use"\n-\t@echo "it deletes files that may require special tools to rebuild."\n-clean: clean-am\n-\n-clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \\\n-\tmostlyclean-am\n-\n-distclean: distclean-am\n-\t-rm -rf ./$(DEPDIR)\n-\t-rm -f Makefile\n-distclean-am: clean-am distclean-compile distclean-generic \\\n-\tdistclean-tags\n-\n-dvi: dvi-am\n-\n-dvi-am:\n-\n-html: html-am\n-\n-html-am:\n-\n-info: info-am\n-\n-info-am:\n-\n-install-data-am: install-library_includeHEADERS\n-\n-install-dvi: install-dvi-am\n-\n-install-dvi-am:\n-\n-install-exec-am:\n-\n-install-html: install-html-am\n-\n-install-html-am:\n-\n-install-info: install-info-am\n-\n-install-info-am:\n-\n-install-man:\n-\n-install-pdf: install-pdf-am\n-\n-install-pdf-am:\n-\n-install-ps: install-ps-am\n-\n-install-ps-am:\n-\n-installcheck-am:\n-\n-maintainer-clean: maintainer-clean-am\n-\t-rm -rf ./$(DEPDIR)\n-\t-rm -f Makefile\n-maintainer-clean-am: distclean-am maintainer-clean-generic\n-\n-mostlyclean: mostlyclean-am\n-\n-mostlyclean-am: mostlyclean-compile mostlyclean-generic \\\n-\tmostlyclean-libtool\n-\n-pdf: pdf-am\n-\n-pdf-am:\n-\n-ps: ps-am\n-\n-ps-am:\n-\n-uninstall-am: uninstall-library_includeHEADERS\n-\n-.MAKE: install-am install-strip\n-\n-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \\\n-\tclean-libtool clean-noinstLTLIBRARIES ctags distclean \\\n-\tdistclean-compile distclean-generic distclean-libtool \\\n-\tdistclean-tags distdir dvi dvi-am html html-am info info-am \\\n-\tinstall install-am install-data install-data-am install-dvi \\\n-\tinstall-dvi-am install-exec install-exec-am install-html \\\n-\tinstall-html-am install-info install-info-am \\\n-\tinstall-library_includeHEADERS install-man install-pdf \\\n-\tinstall-pdf-am install-ps install-ps-am install-strip \\\n-\tinstallcheck installcheck-am installdirs maintainer-clean \\\n-\tmaintainer-clean-generic mostlyclean mostlyclean-compile \\\n-\tmostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \\\n-\ttags uninstall uninstall-am uninstall-library_includeHEADERS\n-\n-\n-# Tell versions [3.59,3.63) of GNU make to not export all variables.\n-# Otherwise a system limit (for SysV at least) may be exceeded.\n-.NOEXPORT:\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/hhalign/general.h --- a/clustalomega/clustal-omega-0.2.0/src/hhalign/general.h Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,99 +0,0 @@ -/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ - -/********************************************************************* - * Clustal Omega - Multiple sequence alignment - * - * Copyright (C) 2010 University College Dublin - * - * Clustal-Omega is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This file is part of Clustal-Omega. - * - ********************************************************************/ - -/* - * RCS $Id: general.h 241 2011-05-04 14:37:17Z fabian $ - */ - - -#ifndef GENERAL_H -#define GENERAL_H - - -#include "../clustal/log.h" - -/* -***** Omega definitions************************************ - FS, 2010-02-19 -*/ -enum {NO = 0, YES}; -enum {BASE10 = 10}; -enum {AMINOACIDS = 20, STATE_TRANSITIONS = 7}; -enum {MAXWORD = 100, MAXLEN = 10000}; -enum {OVER_ALLOCATE = 2}; -enum {FAILURE = -1, OK}; -enum {F_OFFSET = 1}; -enum {INTERN_ALN_2_HMM = 0, READ_ALN_2_HMM, READ_HMM_2_HMM, INTERN_HMM_2_HMM}; -#define UNITY 1.00 - -/*#define MIN(a,b) ((a)<(b)?(a):(b))*/ - - -/* parameters passed from Clustal-Omega to hhalign; FS, r240 -> */ -typedef struct { - - int iMacRamMB; /* dedicated amount of RAM for Maximum Accuracy (in MB) */ - -} hhalign_para; - -typedef struct { - /***public***/ - int n_display; - char **sname; - char **seq; - int ncons; - int nfirst; - int nss_dssp; - int nsa_dssp; - int nss_pred; - int nss_conf; - int L; - int N_in; - int N_filtered; - float *Neff_M; - float *Neff_I; - float *Neff_D; - float Neff_HMM; - char *longname; - char name[511]; - char file[511]; - char fam[511]; - char sfam[511]; - char fold[511]; - char cl[511]; - float lamda; - float mu; - /***private***/ - float **f; - float **g; - float **p; - float **tr; - float **linTr; - char trans_lin; - char *ss_dssp; - char *sa_dssp; - char *ss_pred; - char *ss_conf; - char *Xcons; - float pav[20]; - float pnul[20]; - int *l; - -} hmm_light; - - -#endif - |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/hhalign/hash-C.h --- a/clustalomega/clustal-omega-0.2.0/src/hhalign/hash-C.h Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,594 +0,0 @@\n-/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n-\n-/*********************************************************************\n- * Clustal Omega - Multiple sequence alignment\n- *\n- * Copyright (C) 2010 University College Dublin\n- *\n- * Clustal-Omega is free software; you can redistribute it and/or\n- * modify it under the terms of the GNU General Public License as\n- * published by the Free Software Foundation; either version 2 of the\n- * License, or (at your option) any later version.\n- *\n- * This file is part of Clustal-Omega.\n- *\n- ********************************************************************/\n-\n-/*\n- * RCS $Id: hash-C.h 143 2010-10-14 13:11:14Z andreas $\n- */\n-\n-// hash.C\n-// Class for Hash data structure \n-// * works in the same way as a hash in Perl\n-// * keys are strings of type char*\n-// * data elements are of type Typ \n-// * objects have to be declared with maximal size, e.g. Hash hash1(10000) (num_slots should not be a power of 2)\n-// * works also if maximal size is exceeded, but gets slower by a factor ~num_keys/num_slots \n-\n-/*\n- * RCS $Id: hash-C.h 143 2010-10-14 13:11:14Z andreas $\n- */\n-\n-#ifndef HASH\n-#define HASH\n-\n-#ifndef MAIN\n-#include <iostream> // cin, cout, cerr\n-#include <cstdio> // printf\n-#include <stdlib.h> // exit\n-#include <string> // strcmp, strstr\n-#include <math.h> // sqrt, pow\n-#include <limits.h> // INT_MIN\n-#include <float.h> // FLT_MIN\n-#include <ctype.h> // islower, isdigit etc\n-#include <time.h> // clock\n-#include <errno.h> // perror()\n-using std::cout;\n-using std::cerr;\n-using std::endl;\n-using std::ios;\n-using std::ifstream;\n-using std::ofstream;\n-#endif\n-\n-#ifndef JLIST\n-#define JLIST\n-#include "list.h" // List<Typ>\n-#include "list-C.h" ////////////////////////////////// DEBUG\n-#endif\n-\n-#include "hash.h"\n-\n-\n-\n-//////////////////////////////////////////////////////////////////////////////\n-////////////////////// Methods of class Hash /////////////////////////////////\n-//////////////////////////////////////////////////////////////////////////////\n-\n-//////////////////////////////////////////////////////////////////////////////\n-// Private Methods\n-\n-\n-//////////////////////////////////////////////////////////////////////////////\n-// Constructor and Destructor of Hash\n-//////////////////////////////////////////////////////////////////////////////\n-// Constructor of class Hash\n-//////////////////////////////////////////////////////////////////////////////\n-template<class Typ> \n-Hash<Typ>::Hash()\n-{\n- num_keys=0; max_len=0; prev=curr=num_slots = 0; slot=NULL;\n-}\n-\n-template<class Typ> \n-Hash<Typ>::Hash(int nslots)\n-{\n- num_keys=0; max_len=0; prev=curr=num_slots = nslots;\n- slot = new Slot<Typ>*[num_slots]; //Create array of num_slots slots\n- for (int i=0; i<num_slots; i++) slot[i]=NULL; //set pointers to NULL\n- fail = static_cast<Typ>(0);\n-}\n-\n-template<class Typ> \n-Hash<Typ>::Hash(int nslots, Typ f)\n-{\n- num_keys=0; max_len=0; prev=curr=num_slots = nslots;\n- slot = new Slot<Typ>*[num_slots]; //Create array of num_slots slots\n- for (int i=0; i<num_slots; i++) slot[i]=NULL; //set pointers to NULL\n- fail=f;\n-}\n-\n-\n-////////////////////////////////////////////////////////////////////////////////////////////\n-// Destructor of class Hash\n-////////////////////////////////////////////////////////////////////////////////////////////\n-template<class Typ> \n-Hash<Typ>::~Hash()\n-{\n- RemoveAll();\n- delete[] slot; slot = NULL;\n-}\n-\n-\n-////////////////////////////////////////////////////////////////////////////////////////////\n-// Hash function\n-////////////////////////////////////////////////////////////////////////////////////////////\n-template<class Typ> \n-inline unsigned int Hash<Typ>::HashValue(char* key) //returns the hash value for key \n- {\n- // Calculate a hash value by the division method: \n- // Transform '..b'/////////////////////////////////////////////////////////\n-// Methods that return usefull information about the data stored in Hash:\n-\n-\n-////////////////////////////////////////////////////////////////////////////////////////////\n-// Returns 1 if the hash contains key, 0 otherwise \n-////////////////////////////////////////////////////////////////////////////////////////////\n-template<class Typ> \n-int Hash<Typ>::Contains(char* key)\n-{\n- Slot<Typ>* pslot;\n- int i = HashValue(key);\n-\n- pslot = slot[i];\n- if (!pslot) return 0;\n- pslot->Reset();\n- do{\n- if(!strcmp(pslot->ReadNext().key,key)) return 1;\n- } while(!pslot->End());\n- return 0;\n-}\n-\n-/////////////////////////////////////////////////////////////////////////////////////////////\n-//print out list of keys and data\n-/////////////////////////////////////////////////////////////////////////////////////////////\n-template<class Typ> \n-void Hash<Typ>::Print()\n-{\n- char key[MaxLen()+1];\n-\n- cout<<"\\nPrint hash:\\n";\n- Reset();\n- while(!End()) \n- cout<<key<<"->"<<ReadNext(key)<<"\\n";\n-}\n-\n-/////////////////////////////////////////////////////////////////////////////////////////////\n-//Print out hash with internal representation as array \n-/////////////////////////////////////////////////////////////////////////////////////////////\n-template<class Typ> \n-void Hash<Typ>::DebugPrint()\n-{\n- Pair<Typ>* pairp;\n- Slot<Typ>* pslot;\n-\n- cout<<"\\n";\n- cout<<"Debug-print hash:";\n- for(int i=0; i<num_slots; i++)\n- {\n- pslot = slot[i];\n- if (pslot) \n-\t{\n-\t cout<<"\\nhash value "<<i;\n-\t pslot->Reset();\n-\t while(!pslot->End())\n-\t {\n-\t pairp = pslot->ReadNextAddress(); \n-\t cout<<" "<<pairp->key<<"->"<<pairp->data;\n-\t }\n-\t}\n- }\n- cout<<"\\n\\n";\n- return;\n-}\n-\n-\n-\n-#endif /* HASH */\n-\n-\n-\n-////////////////////////////////////////////////////////////////////////////////\n-// Main program: test class Hash\n-////////////////////////////////////////////////////////////////////////////////\n-// int main()\n-// {\n-// Hash<int> ihash(5);\n-// char* key=new char[128];\n-// int data;\n-\n-// ihash.Fail(1000);\n-// ihash.Add("So many monsters",36);\n-// ihash.Add("So many chickens",25);\n-\n-// // cerr<<"Address of ihash(\\"So many monsters\\") is "<<ihash("So many monsters")<<"\\n";\n-// // cerr<<"Address of ihash(\\"So many monsters\\") is "<<ihash("So many monsters")<<"\\n";\n-// // *ihash("So many monsters")=2;\n-// // (*ihash("So many monsters"))++;\n-// // (*ihash("So many monsters"))++;\n-// cout<<"Size of hash="<<ihash.Size()<<"\\n";\n-// ihash.DebugPrint();\n-// ihash.Print();\n- \n-// strcpy(key,"Some more monsters");\n-// ihash.Add(key,3);\n-// strcpy(key,"Even more monsters");\n-// ihash.Add(key,7);\n-// cout<<"Size of hash="<<ihash.Size()<<"\\n";\n-// cout<<"Maximum key length = "<<ihash.MaxLen()<<"\\n";\n-// ihash.Print();\n- \n-// cout<<"ihash.Remove(\\"Even more monsters\\") returns "<<ihash.Remove("Even more monsters")<<"\\n";\n-// ihash.Print();\n-\n-\n-// cout<<"ihash.Remove(\\"More monsters\\") returns "<<ihash.Remove("More monsters")<<"\\n";\n-// ihash.Add("So many chickens",999);\n-// ihash.Add("So many monster",1);\n-// ihash.Print();\n-\n-// cout<<"So many chickens:"<<ihash.Show("So many chickens")<<"\\n";\n-// cout<<"Size of hash="<<ihash.Size()<<"\\n";\n-\n-\n-\n-// ihash.Reset();\n-// while (!ihash.End())\n-// {\n-// data = ihash.ReadNext(key);\n-// cout<<" "<<key<<"->"<<data<<endl;\n-// data = ihash.ReadCurrent(key);\n-// cout<<" "<<key<<"->"<<data<<endl;\n-// }\n-// cout<<"Removing all keys..."<<endl;\n-// cout<<"Size of hash="<<ihash.Size()<<"\\n";\n-// ihash.Reset();\n-// while (ihash.Size())\n-// {\n-// data = ihash.RemoveCurrent(key);\n-// cout<<" "<<key<<"->"<<data<<"\\n";\n-// cout<<"Size of hash="<<ihash.Size()<<"\\n";\n-// }\n-\n-// ihash.ReadCurrent(key);\n-\n-// ihash.Print();\n-// return 0;\n-// }\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/hhalign/hash.h --- a/clustalomega/clustal-omega-0.2.0/src/hhalign/hash.h Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,199 +0,0 @@ -/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ - -/********************************************************************* - * Clustal Omega - Multiple sequence alignment - * - * Copyright (C) 2010 University College Dublin - * - * Clustal-Omega is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This file is part of Clustal-Omega. - * - ********************************************************************/ - -/* - * RCS $Id: hash.h 143 2010-10-14 13:11:14Z andreas $ - */ - -// Class for Hash data structure -// * works in the same way as a hash in Perl -// * keys are strings of type char* -// * data elements are of type Typ -// * objects have to be declared with maximal size, e.g. Hash hash1(10000) (num_slots should not be a power of 2) -// * works also if maximal size is exceeded, but gets slower by a factor ~num_keys/num_slots -// -// Applications -// * fast storage and retrieval of data by a key -// * fast check if a string occurs in a list of strings (data field not used) -// -// Time complexity: (L is the length of the key string) -// * Show(key), Add(key), Remove(key): O(L) for calculating hash value & compare keys in slot list -// * ReadNext, ReadCurrent, RemoveCurrent: O(L) for copying key into returned string -// * Contains: O(L) for calculating hash value -// * Size, MaxLen, Reset: O(1) -// * RemoveAll(), Hash() and ~Hash(): O(num_slots) -// -// Memory complexity: ~3*num_keys*(datasize+12bytes) + num_slots*4bytes + total added length of keys (including \0) -// -// Implementation: -// Hash is an array of pointers to lists of size num_slots. The lists, called slots, contain key/data pairs. -// When a key/data pair is added (e.g. with Add()) the array index i for the key (0<=i<num_slots) -// is calculated with the HashValue() function. -// When data is to be retrieved for key (e.g. with Show()) the hash value for key is calculated and -// the corresponding list (=slot) is searched for the occurence of the key. -// Array elements of hash values that have no keys associated yet contain the null pointer -// for faster rejection of undefined keys. -// - -//////////////////////////////////////////////////////////////////////////////////////////// -// Declaration of Pair, consisting of a key string and a data element of type Typ -//////////////////////////////////////////////////////////////////////////////////////////// - -template<class Typ> -class Pair -{ -public: - char* key; //hash key - Typ data; //data for key - Pair() {} - Pair(char* k, Typ& d) {key = new char[strlen(k)+1]; strcpy(key,k); data=d;} - Pair(int& l, char* k, Typ& d) {key = new char[l+1]; strcpy(key,k); data=d;} -}; - - -//////////////////////////////////////////////////////////////////////////////////////////// -// Declaration of Slot, a list of key/data pairs -//////////////////////////////////////////////////////////////////////////////////////////// - -template<class Typ> -class Slot : public List< Pair<Typ> > -{ -public: - //Destructor of Slot deletes whole list TOGETHER WITH THE KEY STRINGS - ~Slot() {this->Reset(); while (!this->End()) delete[] this->Pop().key; } - - // Push key/data pair onto slot list and return address of data element - // Attention: l must be at least length of key - inline Typ* Push(int& l, char* key, Typ& data) - { - Pair<Typ> pair(l,key,data); //create a pair with key/data - return &(List<Pair<Typ> >::Push(pair)->data); - } -}; - - -//////////////////////////////////////////////////////////////////////////////////////////// -// Declaration of Hash, an array of slots, i.e. pointers to lists of key/data -//////////////////////////////////////////////////////////////////////////////////////////// - -template<class Typ> -class Hash -{ -private: - int num_slots; //number of slots in slot[]. num_slots is set with the constructor - int curr; //index of current slot - int prev; //index of slot from previous ReadNext() - int num_keys; //total number of keys in hash - int max_len; //length of longest key in hash - int key_len; //length of key in argument - Typ fail; - - Slot<Typ>** slot; //each slot[i] (i<num_slots) points to a list of key/data pairs for this slot - - inline unsigned int HashValue(char* key); //returns the hash value for key - -public: - Hash(); - Hash(int nslots); - Hash(int nslots, Typ n); - ~Hash(); - - // Set Fail element to be returned when the current key or supplied key are not defined - inline void Null(Typ f) {fail=f;} - inline void Fail(Typ f) {fail=f;} - - // Set 'fail' element to be returned when the current key or supplied key are not defined (default: 0) - void New(int nslots, Typ n=static_cast<Typ>(0)); - - // Update maximum key length and caculate key_len; - inline void KeyLen() {if(key_len>max_len) max_len=key_len; return;} - - -//////////////////////////////////////////////////////////////////////////////////////////// -// Methods that work with a key supplied as an argument - - // Return data element for key. Returns 'fail' if key does not exist - Typ Show(char* key); - inline Typ operator[](char* key) {return Show(key);} - - // Add/replace key/data pair to hash and return address of data element for key - Typ* Add(char* key, Typ data); - - // Add key to hash and return address of data element. If key exists leave data element unchanged, else set it to 'fail'. - Typ* Add(char* key); - inline Typ* operator()(char* key) {return Add(key);} - - // Remove key from hash and return data element for key ('fail' if key does not exist) - Typ Remove(char* key); - - // Remove all keys from hash - void RemoveAll(); - - -/////////////////////////////////////////////////////////////////////////////////////////// -// Methods that work with an internal "current key": -// It is set to the first key by Reset() and moves to the next key with ReadNext or RemoveCurrent -// Note:the methods above (e.g. Store, Show, [], Add, (), etc. DO NOT CHANGE the current key - - // Return data of next key. Return 'fail' data and empty key if at end - Typ ReadNext(); - - // Write next key into variable key and return data. Return 'fail' data and empty key if at end - // Attention: 'key' must have memory of at least char[MaxLen()+1] allocated! - Typ ReadNext(char* key); - - // Return data of current key - Typ ReadCurrent(); - - // Write key last read into variable key and return data - // Attention: 'key' must have memory of at least char[MaxLen()+1] allocated! - Typ ReadCurrent(char* key); - - // Remove current key, return data and advance to next key - Typ RemoveCurrent(); - - // Remove current key, return data, copy current key into key, and advance to next key - // (After Reset() remove first element) - // Attention: 'key' must have memory of at least char[MaxLen()+1] allocated! - Typ RemoveCurrent(char* key); - - // Reset readout of keys to beginning of hash - void Reset(); - - // Returns 1 if the current key has arrived at the end, 0 otherwise - int End() {return (curr>=num_slots);} - - - -/////////////////////////////////////////////////////////////////////////////////////////// -// Methods that return usefull information about the data stored in Hash: - - // Returns 1 if the hash contains key, 0 otherwise - int Contains(char* key); - - // Return number of slots - int Size() {return num_keys;} - - // Return length of longest key INCLUDING DELETED KEYS (excluding \0) - int MaxLen() {return max_len;} - - //print out list of keys and data - void Print(); - - //Print out hash with internal representation as array - void DebugPrint(); -}; - |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/hhalign/hhalign.cpp --- a/clustalomega/clustal-omega-0.2.0/src/hhalign/hhalign.cpp Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,1345 +0,0 @@\n-/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n-\n-/*********************************************************************\n- * Clustal Omega - Multiple sequence alignment\n- *\n- * Copyright (C) 2010 University College Dublin\n- *\n- * Clustal-Omega is free software; you can redistribute it and/or\n- * modify it under the terms of the GNU General Public License as\n- * published by the Free Software Foundation; either version 2 of the\n- * License, or (at your option) any later version.\n- *\n- * This file is part of Clustal-Omega.\n- *\n- ********************************************************************/\n-\n-/*\n- * RCS $Id: hhalign.cpp 241 2011-05-04 14:37:17Z fabian $\n- */\n-\n-/* hhalign.C: \n- * Align a multiple alignment to an alignment or HMM \n- * Print out aligned input sequences in a3m format\n- * Compile: g++ hhalign.C -o hhalign -I/usr/include/ -L/usr/lib -lpng -lz -O3 -fno-strict-aliasing \n- * Compile with efence: g++ hhalign.C -o hhalign -I/usr/include/ -lefence -L/usr/lib -lpng -lz -O -g \n- * \n- * Error codes: 0: ok 1: file format error 2: file access error \n- * 3: memory error 4: internal numeric error \n- * 5: command line error\n- */\n-#undef PNG /* include options for making png files? \n-\t\t\t(will need the png library) */\n-#define MAIN\n-#include <iostream> // cin, cout, cerr\n-#include <fstream> // ofstream, ifstream \n-#include <string.h> // strcmp, strstr\n-#include <stdio.h> // printf\n-#include <stdlib.h> // exit\n-#include <math.h> // sqrt, pow\n-#include <limits.h> // INT_MIN\n-#include <float.h> // FLT_MIN\n-#include <time.h> // clock\n-#include <ctype.h> // islower, isdigit etc\n-\n-using std::cout;\n-using std::cerr;\n-using std::endl;\n-using std::ios;\n-using std::ifstream;\n-using std::ofstream;\n-\n-int iAux_GLOBAL;\n-\n-#include "general.h"\n-#include "util-C.h" /* imax, fmax, iround, iceil, ifloor, strint, strscn, \n-\t\t\t strcut, substr, uprstr, uprchr, Basename etc. */\n-#include "list-C.h" // list data structure\n-#include "hash-C.h" // hash data structure\n-\n-#include "hhdecl-C.h" // Constants, global variables, struct Parameters\n-#include "hhutil-C.h" /* MatchChr, InsertChr, aa2i, i2aa, log2, \n-\t\t\t fast_log2, WriteToScreen, */\n-#include "hhmatrices-C.h" // BLOSUM50, GONNET, HSDM\n-#include "hhhmm.h" // class HMM\n-#include "hhhit.h" // class Hit\n-#include "hhalignment.h" // class Alignment\n-#include "hhhalfalignment.h" // class HalfAlignment\n-#include "hhfullalignment.h" // class FullAlignment\n-#include "hhhitlist.h" // class Hit\n-#include "hhhmm-C.h" // class HMM\n-#include "hhalignment-C.h" // class Alignment\n-#include "hhhit-C.h" // class Hit\n-#include "hhhalfalignment-C.h" // class HalfAlignment\n-#include "hhfullalignment-C.h" // class FullAlignment\n-#include "hhhitlist-C.h" // class HitList \n-#include "hhfunc-C.h" // some functions common to hh programs\n-\n-#ifdef PNG\n-#include "pngwriter.h" //PNGWriter (http://pngwriter.sourceforge.net/)\n-#include "pngwriter.cc" //PNGWriter (http://pngwriter.sourceforge.net/)\n-#endif\t \n-\n-////////////////////////////////////////////////////////////////////////\n-// Global variables \n-////////////////////////////////////////////////////////////////////////\n-HMM *q; // Create query HMM with maximum of MAXRES match states\n-HMM *t; /* Create template HMM with maximum of MAXRES \n-\t\t\t match states */\n-Alignment *qali; /* (query alignment might be needed outside of hhfunc.C \n-\t\t\t for -a option) */\n-Hit hit; // Ceate new hit object pointed at by hit\n-HitList hitlist; /* list of hits with one Hit object for each \n-\t\t\t pairwise comparison done */\n-char aliindices[256]; /* hash containing indices of all alignments \n-\t\t\t which to show in dot plot */\n-char* dmapfile=NULL; /* where to write the coordinates for the HTML map file \n-\t\t\t (to click the '..b'%s...\\n",par.alnfile);\n-\t if (v>=2 && *par.psifile) printf("Merging template to query alignment and appending template alignment in PSI format to %s...\\n",par.psifile);\n-\t}\n-\n- // Read query alignment into Qali\n- Alignment Qali; // output A3M generated by merging A3M alignments for significant hits to the query alignment\n- char qa3mfile[NAMELEN];\n- RemoveExtension(qa3mfile,par.infile); // directory??\n- strcat(qa3mfile,".a3m");\n- FILE* qa3mf=fopen(qa3mfile,"r");\n- if (!qa3mf) OpenFileError(qa3mfile);\n- Qali.Read(qa3mf,qa3mfile);\n- fclose(qa3mf);\n- \n- // Align query with template in master-slave mode \n- Qali.MergeMasterSlave(hit,par.tfile); /*FS, NOFILE2 (commented out) */\n- \n- // Write output A3M alignment?\n- if (*par.alnfile) {\n-\tQali.WriteToFile(par.alnfile,"a3m");\n- }\n-\n- if (*par.psifile) \n-\t{\n-\t /* Convert ASCII to int (0-20),throw out all insert states, \n-\t record their number in I[k][i] */\n-\t Qali.Compress("merged A3M file");\n-\t \n-\t // Write output PSI-BLAST-formatted alignment?\n-\t Qali.WriteToFile(par.psifile,"psi");\n-\t}\n- } /* if (*par.alnfile || *par.psifile || *par.hhmfile) */\n-#endif /* NOFILE2 */\n- //////////////////////////////////////////////////////////////////////////\n-\n-\n-\n-\n-// double log2Pvalue;\n-// if (par.ssm && (par.ssm1 || par.ssm2))\n-// {\n-// log2Pvalue=hit.logPval/0.693147181+0.45*(4.0*par.ssw/0.15-hit.score_ss);\n-// if (v>=2) \n-// \tprintf("Aligned %s with %s:\\nApproximate P-value INCLUDING SS SCORE = %7.2g\\n",q.name,t.name,pow(2.0,log2Pvalue));\n-// } else {\n-// if (v>=2) \n-// \tprintf("Aligned %s with %s:\\nApproximate P-value (without SS score) = %7.2g\\n",q.name,t.name,hit.Pval);\n-// }\n-\n- if (v>=2)\n- {\n- if (par.hitrank==0)\n- printf("Aligned %s with %s: Score = %-7.2f P-value = %-7.2g\\n",\n- q.name,t.name,hit.score,hit.Pval);\n- else\n- printf("Aligned %s with %s (rank %i): Score = %-7.2f P-value = %-7.2g\\n",\n- q.name,t.name,par.hitrank,hit.score,hit.Pval);\n- }\n- \n-\n- // Delete memory for dynamic programming matrix\n- hit.DeleteBacktraceMatrix(q.L+2);\n- if (par.forward>=1 || Nstochali) \n- hit.DeleteForwardMatrix(q.L+2);\n- if (par.forward==2) \n- hit.DeleteBackwardMatrix(q.L+2);\n- /* if (Pstruc) { \n- for (int i=0; i<q.L+2; i++) delete[](Pstruc[i]); delete[](Pstruc);}\n- */\n-\n- // Delete content of hits in hitlist\n- hitlist.Reset();\n- while (!hitlist.End()) \n- hitlist.ReadNext().Delete(); // Delete content of hit object\n-\n- if (strucfile && par.wstruc>0) \n- {\n- for (int i=0; i<q.L+2; i++){\n-\tdelete[] Pstruc[i]; Pstruc[i] = NULL;\n- }\n- delete[] Pstruc; Pstruc = NULL;\n- for (int i=0; i<q.L+2; i++){\n-\tdelete[] Sstruc[i]; Sstruc[i] = NULL;\n- }\n- delete[] Sstruc; Sstruc = NULL;\n- delete[] strucfile; strucfile = NULL;\n- }\n-\n- if (pngfile){\n- delete[] pngfile; pngfile = NULL;\n- }\n- if (alitabfile){\n- delete[] alitabfile; alitabfile = NULL;\n- }\n- if (tcfile){\n- delete[] tcfile; tcfile = NULL;\n- }\n- if (par.exclstr){\n- delete[] par.exclstr; par.exclstr = NULL;\n- }\n-\n-#ifndef CLUSTALO_NOFILE\n- // Print \'Done!\'\n- FILE* outf=NULL;\n- if (!strcmp(par.outfile,"stdout")) printf("Done!\\n");\n- else\n- {\n- if (*par.outfile)\n-\t{\n-\t outf=fopen(par.outfile,"a"); //open for append\n-\t fprintf(outf,"Done!\\n");\n-\t fclose(outf);\n-\t}\n- if (v>=2) printf("Done\\n");\n- }\n-#endif\n-\n- //qali.ClobberGlobal();\n- hit.ClobberGlobal();\n- if (iFirstCnt > 0){\n- q.ClobberGlobal();\n- }\n- if (iSecndCnt > 0){\n- t.ClobberGlobal();\n- }\n- hitlist.ClobberGlobal();\n-\n- return 0;\n-\n-} /* this is the end of hhalign() //end main */\n-\n-//////////////////////////////////////////////////////////////////////////////\n-// END OF MAIN\n-//////////////////////////////////////////////////////////////////////////////\n-\n-/*\n- * EOF hhalign.C\n- */\n-\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/hhalign/hhalign.h --- a/clustalomega/clustal-omega-0.2.0/src/hhalign/hhalign.h Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,30 +0,0 @@ -/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ - -/********************************************************************* - * Clustal Omega - Multiple sequence alignment - * - * Copyright (C) 2010 University College Dublin - * - * Clustal-Omega is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This file is part of Clustal-Omega. - * - ********************************************************************/ - -/* - * RCS $Id: hhalign.h 241 2011-05-04 14:37:17Z fabian $ - */ - - -extern int -hhalign(char **ppcFirstProf, int iFirstCnt, double *pdWeightsL, - char **ppcSecndProf, int iSecndCnt, double *pdWeightsR, - double *dScore_p, hmm_light *prHMM, - char *pcPrealigned1, char *pcRepresent1, - char *pcPrealigned2, char *pcRepresent2, - hhalign_para rHhalignPara, - int iFlag, - char zcAux[], char zcError[]); |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/hhalign/hhalignment-C.h --- a/clustalomega/clustal-omega-0.2.0/src/hhalign/hhalignment-C.h Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,3028 +0,0 @@\n-/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n-\n-/*********************************************************************\n- * Clustal Omega - Multiple sequence alignment\n- *\n- * Copyright (C) 2010 University College Dublin\n- *\n- * Clustal-Omega is free software; you can redistribute it and/or\n- * modify it under the terms of the GNU General Public License as\n- * published by the Free Software Foundation; either version 2 of the\n- * License, or (at your option) any later version.\n- *\n- * This file is part of Clustal-Omega.\n- *\n- ********************************************************************/\n-\n-/*\n- * RCS $Id: hhalignment-C.h 236 2011-04-14 11:30:04Z fabian $\n- */\n-\n-\n-/*\n- * Changelog: Michael Remmert made changes to hhalign stand-alone code\n- * FS implemented some of the changes on 2010-10-28 -> MR1\n- *\n- * Note: MR seems to have changed all [aijk]++ to ++[aijk],\n- * FS did not do that on 2010-10-28\n- */\n-\n-// hhalignment.C\n-\n-//////////////////////////////////////////////////////////////////////////////\n-//// Class Alignment\n-//////////////////////////////////////////////////////////////////////////////\n-\n-// hhalignment.C\n-\n-#ifndef MAIN\n-#define MAIN\n-#include <iostream> // cin, cout, cerr\n-#include <fstream> // ofstream, ifstream\n-#include <stdio.h> // printf\n-using std::cout;\n-using std::cerr;\n-using std::endl;\n-using std::ios;\n-using std::ifstream;\n-using std::ofstream;\n-#include <stdlib.h> // exit\n-#include <string> // strcmp, strstr\n-#include <math.h> // sqrt, pow\n-#include <limits.h> // INT_MIN\n-#include <float.h> // FLT_MIN\n-#include <time.h> // clock\n-#include <ctype.h> // islower, isdigit etc\n-#include "util-C.h" // imax, fmax, iround, iceil, ifloor, strint, strscn, strcut, substr, uprstr, uprchr, Basename etc.\n-#include "list.h" // list data structure\n-#include "hash.h" // hash data structure\n-#include "hhdecl-C.h"\n-#include "hhutil-C.h" // imax, fmax, iround, iceil, ifloor, strint, strscn, strcut, substr, uprstr, uprchr, Basename etc.\n-#include "hhhmm.h"\n-#endif\n-\n-\n-enum {KEEP_NOT = 0, KEEP_CONDITIONALLY, KEEP_ALWAYS};\n-\n-//////////////////////////////////////////////////////////////////////////////\n-// Class Alignment\n-//////////////////////////////////////////////////////////////////////////////\n-\n-\n-//////////////////////////////////////////////////////////////////////////////\n-// Object constructor\n-//////////////////////////////////////////////////////////////////////////////\n-Alignment::Alignment(int maxseq, int maxres)\n-{\n-\n- //printf(">>>>>>>>%s:%s:%d: maxseq=%d, maxres=%d\\n", __FUNCTION__, __FILE__, __LINE__, maxseq, maxres); /* (FS) */\n- longname = new(char[DESCLEN]);\n- sname = new(char*[maxseq+2]); /* MR1 */\n- seq = new(char*[maxseq+2]); /* MR1 */\n- l = new(int[maxres]);\n- X = new(char*[maxseq+2]); /* MR1 */\n- I = new(short unsigned int*[maxseq+2]); /* MR1 */\n- keep = new(char[maxseq+2]); /* MR1 */\n- display = new(char[maxseq+2]); /* MR1 */\n- wg = new(float[maxseq+2]); /* MR1 */\n- nseqs = new(int[maxres+2]); /* MR1 */\n- N_in=L=0;\n- nres=NULL; // number of residues per sequence k\n- first=NULL; // first residue in sequence k\n- last=NULL; // last residue in sequence k\n- ksort=NULL; // sequence indices sorted by descending nres[k]\n- name[0]=\'\\0\'; // no name defined yet\n- longname[0]=\'\\0\'; // no name defined yet\n- fam[0]=\'\\0\'; // no name defined yet\n- file[0]=\'\\0\'; // no name defined yet\n- readCommentLine = \'0\'; /* MR1 */\n-}\n-\n-//////////////////////////////////////////////////////////////////////////////\n-// Object destructor\n-//////////////////////////////////////////////////////////////////////////////\n-Alignment::~Alignment()\n-{\n- delete[] longname; longname = NULL;\n- for(int k=0; k<N_in; k++)\n- {\n- delete[] sname[k]; sname[k] = NULL;\n- delete[] seq[k]; seq[k] = NULL;\n- delete[] X[k]; X[k] = NULL;\n- delete[] I[k]; I[k] = NULL;\n- }\n- delete[] sname; sname = NULL;\n- delete[] seq; seq = NULL;\n-'..b'[k] = KEEP_CONDITIONALLY;\n- display[k] = KEEP_CONDITIONALLY;\n- sname[k] = new(char[GOOD_MEASURE]);\n- strcpy(sname[k], "unknown_sname");\n- } /* (0 <= k < iCnt) */\n- /* FIXME: Soeding always makes 1st sequence permanent */\n- /*keep[0] = KEEP_ALWAYS;\n- display[k] = KEEP_ALWAYS;*/\n-#if 1\n- /* Believe that the first and last positions are\n- most important in stability of this algorithm.\n- Must make sure that at least 2 sequences with\n- residues in these positions are kept.\n- Think any sequence will do, but better to keep\n- the one with the longest \'contig\'\n- */\n- int iSeq; /* sequence iterator */\n- int iHeadLen = 0, iHeadID = -1; /* length & ID of longest head contig */\n- int iTailLen = 0, iTailID = -1; /* length & ID of longest head contig */\n- int iCont = -1;\n- char *pcFind = NULL;\n-\n-#if 0\n- printf("%s:%s:%d: NEW PROFILE (%d seq) ================\\n",\n- __FUNCTION__, __FILE__, __LINE__, iCnt);\n-#endif\n- for (iSeq = 0; iSeq < iCnt; iSeq++){\n-#if 0\n- printf("%s:%s:%d: consider seq %d ------------------\\n",\n- __FUNCTION__, __FILE__, __LINE__, iSeq);\n-#endif\n- pcFind = strchr(&seq[iSeq][1], \'-\');\n- if (NULL == pcFind){\n- /* no gap at all in this sequences, spans entire profile */\n- iHeadID = iTailID = iSeq;\n- iHeadLen = iTailLen = iLen;\n- break;\n- }\n- iCont = (int)(pcFind - &seq[iSeq][1]);\n- if (iCont > iHeadLen){\n- iHeadLen = iCont;\n- iHeadID = iSeq;\n- }\n- pcFind = strrchr(seq[iSeq], \'-\');\n- iCont = iLen - (int)(pcFind - seq[iSeq]);\n- if (iCont > iTailLen){\n- iTailLen = iCont;\n- iTailID = iSeq;\n- }\n-\n-#if 0\n- printf("%s:%s:%d: seq %3d: len = %d(%d) %s\\n",\n- __FUNCTION__, __FILE__, __LINE__, iSeq, iCont, iLen, seq[iSeq]);\n-#endif\n- } /* 0 <= iSeq < iCnt */\n-#if 0\n- printf("%s:%s:%d: seq %d is winner with head contig of %d, seq %d tail contig of %d\\n"\n- , __FUNCTION__, __FILE__, __LINE__, iHeadID, iHeadLen, iTailID, iTailLen);\n-#endif\n- if ( (-1 == iHeadID) || (-1 == iTailID) ){\n- printf("%s:%s:%d: profile has no leading and/or trailing residues (h=%d:t=%d:#=%d)\\n",\n- __FUNCTION__, __FILE__, __LINE__, iHeadID, iTailID, iCnt);\n- }\n- else{\n- keep[iHeadID] = KEEP_ALWAYS;\n- keep[iTailID] = KEEP_ALWAYS;\n- }\n-#endif\n- /* @= */\n- return;\n-\n-} /* this is the end of Transfer() */\n-#endif\n-\n-#ifdef CLUSTALO\n-/* @* Alignment::ClobberGlobal (eg: qali)\n- *\n- * Note: originally hhalign() was stand-alone code,\n- * there are a couple of GLOBAL (!) variables,\n- * which would have been destroyed on exit.\n- * However, now there is no \'exit\' from hhalign(),\n- * and on re-entry the global variable must be clean again.\n- */\n-void \n-Alignment::ClobberGlobal(void){\n-\n- /* @<essentials@>\n- these are essential to re-set (as some of them are used as flags) */\n- for(int k=0; k<N_in; k++)\n- {\n- delete[] sname[k]; sname[k] = NULL;\n- delete[] seq[k]; seq[k] = NULL;\n- delete[] X[k]; X[k] = NULL;\n- delete[] I[k]; I[k] = NULL;\n- }\n- delete[] nres; nres = NULL;\n- delete[] first; first = NULL;\n- delete[] last; last = NULL;\n- delete[] ksort; ksort = NULL;\n- N_in = N_filtered = n_display = 0;\n- L = 0;\n- kss_dssp = ksa_dssp = kss_pred = kss_conf = kfirst = -1;\n-\n- /* @<re-set but keep memory@>\n- do not free the memory but re-set content */\n- longname[0] = \'\\0\'; //delete[] longname; longname = NULL;\n- keep[0] = \'\\0\'; //delete[] keep; keep = NULL;\n- display[0] = \'\\0\'; //delete[] display; display = NULL;\n- wg[0] = 0; //delete[] wg; wg = NULL;\n- nseqs[0] = 0; //delete[] nseqs; nseqs = NULL;\n- name[0]=\'\\0\';\n- fam[0]=\'\\0\';\n- file[0]=\'\\0\';\n- //delete[] sname; sname = NULL;\n- //delete[] seq; seq = NULL;\n- //delete[] X; X = NULL;\n- //delete[] I; I = NULL;\n- //delete[] l; l = NULL;\n-\n- /* @= */\n- return;\n-}\n-#endif\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/hhalign/hhalignment.h --- a/clustalomega/clustal-omega-0.2.0/src/hhalign/hhalignment.h Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,129 +0,0 @@ -/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ - -/********************************************************************* - * Clustal Omega - Multiple sequence alignment - * - * Copyright (C) 2010 University College Dublin - * - * Clustal-Omega is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This file is part of Clustal-Omega. - * - ********************************************************************/ - -/* - * RCS $Id: hhalignment.h 154 2010-11-09 18:29:05Z fabian $ - */ - -// hhalignment.h - -class Alignment -{ -public: - int L; // number of match states of alignment - int N_in; // total number of sequences in alignment - int N_filtered; /* number of sequences after sequence identity - filtering */ - int N_ss; // number of >ss_ or >sa sequences - - int kss_dssp; /* index of sequence with secondary structure - by dssp -1:no >ss_dssp line found */ - int ksa_dssp; /* index of sequence with solvent accessibility - by dssp -1:no >sa_dssp line found */ - int kss_pred; /* index of sequence with predicted secondary - structure -1:no >ss_pred line found */ - int kss_conf; /* index of sequence with confidence values of - prediction -1:no >ss_conf line found */ - int kfirst; // index of first real sequence - - char* longname; /* Full name of first sequence of original alignment - (NAME field) */ - char name[NAMELEN]; // HMM name = first word in longname in lower case - char fam[NAMELEN]; // family ID (derived from name) (FAM field) - char file[NAMELEN]; /* Rootname (w/o path, with extension) of alignment - file that is used to construct the HMM */ - - int n_display; /* number of sequences to be displayed - (INCLUDING >ss_pred, >ss_conf, >ss_dssp sequences) */ - char** sname; // names of display sequences (first seq=0, first char=0) - char** seq; // residues of display sequences (first char=1) - int* l; // l[i] = position of i'th match state in alignment - - char* keep; /* keep[k]=1 if sequence is included in amino acid - frequencies; 0 otherwise (first=0) */ - - double *pdExWeight; /* external sequence weight as given by tree FIXME (FS) */ - - Alignment(int maxseq=MAXSEQ, int maxres=/*MAXRES*/par.maxResLen); - ~Alignment(); - - // Read alignment into X (uncompressed) in ASCII characters - void Read(FILE* inf, char infile[NAMELEN], char* line=NULL); -#ifdef CLUSTALO - void Transfer(char **ppcProf, int iCnt); - void ClobberGlobal(); -#endif - - /* Convert ASCII to numbers between 0 and 20, throw out all insert states, - record their number in I[k][i] and store sequences to be displayed - in sname[k] and seq[k] */ - void Compress(const char infile[NAMELEN]); - - // Apply sequence identity filter - inline int FilterForDisplay(int max_seqid, int coverage=0, int qid=0, float qsc=0, int N=0); - inline int Filter(int max_seqid, int coverage=0, int qid=0, float qsc=0, int N=0); - int Filter2(char keep[], int coverage, int qid, float qsc, int seqid1, int seqid2, int Ndiff); - - bool FilterNeff(); /* MR1 */ - float filter_by_qsc(float qsc, char* dummy); /* MR1 */ - - // Filter alignment for min score per column with core query profile, defined by min_coverage_core and min_seqid_core - int HomologyFilter(int coverage_core, float qsc_core, float coresc); - - // Calculate AA frequencies q.p[i][a] and transition probabilities q.tr[i][a] from alignment - void FrequenciesAndTransitions(HMM& q, char* in=NULL); - - // Calculate freqs q.f[i][a] and transitions q.tr[i][a] (a=MM,MI,MD) with pos-specific subalignments - void Amino_acid_frequencies_and_transitions_from_M_state(HMM& q, char* in); - - // Calculate transitions q.tr[i][a] (a=DM,DD) with pos-specific subalignments - void Transitions_from_D_state(HMM& q, char* in); - - // Calculate transitions q.tr[i][a] (a=DM,DD) with pos-specific subalignments - void Transitions_from_I_state(HMM& q, char* in); - - // Write alignment without insert states to alignment file - void WriteWithoutInsertsToFile(char* alnfile); - - // Write alignment to alignment file - void WriteToFile(char* alnfile, const char format[]=NULL); - - // Read a3m slave alignment of hit from ta3mfile and merge into (query) master alignment - void MergeMasterSlave(Hit& hit, char ta3mfile[]); - - // Read a3m alignment of hit from ta3mfile and merge-combine with query alignment - void Merge(Hit& hit, char ta3mfile[]); - - // Add a sequence to Qali - void AddSequence(char Xk[], int Ik[]=NULL); - - // Determine matrix of position-specific weights w[k][i] for multiple alignment - void GetPositionSpecificWeights(float* w[]); - - char readCommentLine; // Set to 1, if a comment line with '#' is read /* MR1 */ - -private: - char** X; // X[k][i] contains column i of sequence k in alignment (first seq=0, first char=1) (0-3: ARND ..., 20:X, 21:GAP) - short unsigned int** I; // I[k][i] contains the number of inserts AFTER match state i (first=0) - char* display; // display[k]=1 if sequence will be displayed in output alignments; 0 otherwise (first=0) - float* wg; // w[k] = global weight of sequence k - int* nseqs; // number of sequences in subalignment i (only for DEBUGGING) - int* nres; // number of residues in sequence k - int* first; // first residue in sequence k - int* last; // last residue in sequence k - int* ksort; // index for sorting sequences: X[ksort[k]] - int FilterWithCoreHMM(char in[], float coresc, HMM& qcore); -}; |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/hhalign/hhdecl-C.h --- a/clustalomega/clustal-omega-0.2.0/src/hhalign/hhdecl-C.h Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,243 +0,0 @@\n-/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n-\n-/*********************************************************************\n- * Clustal Omega - Multiple sequence alignment\n- *\n- * Copyright (C) 2010 University College Dublin\n- *\n- * Clustal-Omega is free software; you can redistribute it and/or\n- * modify it under the terms of the GNU General Public License as\n- * published by the Free Software Foundation; either version 2 of the\n- * License, or (at your option) any later version.\n- *\n- * This file is part of Clustal-Omega.\n- *\n- ********************************************************************/\n-\n-/*\n- * RCS $Id: hhdecl-C.h 227 2011-03-28 17:03:09Z fabian $\n- */\n-\n-/////////////////////////////////////////////////////////////////////////////////////\n-//// Constants\n-/////////////////////////////////////////////////////////////////////////////////////\n-\n-const char VERSION_AND_DATE[]="version 1.5.1.3 (November 2008)";\n-const char REFERENCE[]="Soding, J. Protein homology detection by HMM-HMM comparison. Bioinformatics 2005, 21, 951-960.\\n";\n-const char COPYRIGHT[]="(C) Johannes Soeding (see LICENSE file)\\n";\n-const int MAXSEQ=65535; //max number of sequences in input alignment (must be <~30000 on cluster nodes)\n-#if 0\n-const int MAXCOL=32765; //max number of residues in input files; must be <= LINELEN and >= MAXRES\n-const int MAXRES=15002; //max number of columns in HMM; must be <= LINELEN\n-#else\n-const int MAXCOL=2/*131072*/; //max number of residues in input files; must be <= LINELEN and >= MAXRES\n-const int MAXRES=1/*65536*/; //max number of columns in HMM; must be <= LINELEN\n-#endif\n-const int LINELEN=262144; //max length of line read in from input files; must be >= MAXCOL \n-const int MAXSEQDIS=3; //10238;//max number of sequences stored in \'hit\' objects and displayed in output alignment \n-const int IDLEN=255; //max length of scop hierarchy id and pdb-id\n-const int DESCLEN=32765;//max length of sequence description (longname)\n-const int NAMELEN=511; //max length of file names etc.\n-const int MAXOPT=127; //Maximum number of options to be read in from .hhconfig or command line\n-const int NAA=20; //number of amino acids (0-19)\n-const int NTRANS=10; //number of transitions recorded in HMM (M2M,M2I,M2D,I2M,I2I,D2M,D2D,M2M_GAPOPEN,GAPOPEN,GAPEXTD)\n-const int NCOLMIN=10; //min number of cols in subalignment for calculating pos-specific weights w[k][i]\n-const int ANY=20; //number representing an X (any amino acid) internally\n-const int GAP=21; //number representing a gap internally \n-const int ENDGAP=22; //Important to distinguish because end gaps do not contribute to tansition counts \n-const int HMMSCALE=1000;//Scaling number for log2-values in HMMs\n-const int NFAMMAX=5119; //Size of hash for counting number of HMMs in each family\n-const int MAXPROF=32766;//Maximum number of HMM scores for fitting EVD\n-const float MAXENDGAPFRAC=0.1; //For weighting: include only columns into subalignment i that have a max fraction of seqs with endgap\n-const float SMIN= 20.; //Minimum score of hit needed to search for another repeat of same profile: p=exp(-(4-mu)/lamda)=0.01\n-const float LAMDA=0.388; //lamda in score EVD used for -local mode in length correction: S = S-log(Lq*Lt)/LAMDA) \n-const float LAMDA_GLOB=0.42; //lamda in score EVD used for -global mode\n-const float PMAX=1E-2; //Maximum single-repeat p-value that can contribute to whole-protein p-value\n-const float MINEVALEXCL=0.5; //above this E-value from first ML fit hits are not used for final ML fit of EVD\n-const int SELFEXCL=3; // exclude self-alignments with j-i<SELFEXCL\n-const float PLTY_GAPOPEN=6.0f; // for -qsc option (filter for min similarity to query): 6 bits to open gap\n-const float PLTY_GAPEXTD=1.0f; // for -qsc option (filter for min similarity to query): 1 bit to extend gap\n-const int MINCOLS_REALIGN=6; // hits with MAC alignments with fewer matched columns will be deleted in hhsearch hitl'..b"\n- char ssgap; // 1: add secondary structure-dependent gap penalties 0:off\n- float ssgapd; // secondary structure-dependent gap-opening penalty (per residue)\n- float ssgape; // secondary structure-dependent gap-extension penalty (per residue)\n- char ssgapi; // max. number of inside-integer(ii); gap-open-penalty= -ii*ssgapd\n-\t\t \n- char ssm; // SS comparison mode: 0:no ss scoring 1:ss scoring AFTER alignment 2:ss score in column score\n- float ssw; // SS weight as compared to column score\n- float ssa; // SS state evolution matrix M1 = (1-ssa)*I + ssa*M0\n-\t\t \n- char loc; // 0: local alignment (wrt. query), 1: global alignement \n- char forward; // 0:Viterbi algorithm 1:Forward algorithm 2: MAC\n- char realign; // realign database hits to be displayed with MAC algorithm\n- char altali; // find up to this many possibly overlapping alignments\n- int columnscore; // 0: no aa comp corr 1: 1/2(qav+tav) 2: template av freqs 3: query av freqs 4:...\n- float corr; // Weight of correlations between scores with |i-j|<=4\n- float shift; // Score offset for match-match states\n- float mact; // Score threshold (negative offset) in MAC alignment\n-\t\t \n- char calibrate; // calibration of query HMM? 0:no, 1:yes (write lamda,mu into query profile)\n- char calm; // derive P-values from: 0:query calibration 1:template calibration 2:both\n- int opt; // for optimization: compare only every opt'th negative; 0: mode off\n- int readdefaultsfile ; // read defaults file ./.hhdefaults or HOME/.hhdefaults?\n- int min_overlap; // all cells of dyn. programming matrix with L_T-j+i or L_Q-i+j < min_overlap will be ignored\n- int hitrank; // rank of hit to be printed as a3m alignment\n- char notags; // neutralize His-tags, FLAG tags, C-myc tags?\n- unsigned int maxdbstrlen; // maximum length of database string to be printed in 'Command' line of hhr file\n-\t\t \n- char trans; // 0: normal pairwise scoring; 1:transitive scoring \n- float Emax_trans; // max E-value for intermediate HMMs in transitive scoring (i.e. l is intermediate HMM if E_lq, E_lk <Emax_trans)\n- float wtrans; // Ztot[k] = Zq[k] + wtrans * (Zforward[k]+Zreverse[k])\n-\n-\n- // SCRAP THE FOLLOWING VARIABLES?\n-\n- float wstruc; // weight of structure scores\n- char repmode; // 1:repeat identification: multiple hits not treated as independent 0: repeat mode off\n-\n- int idummy;\n- int jdummy;\n- float fdummy; \n-};\n-\n-/////////////////////////////////////////////////////////////////////////////////////\n-//// Global variable declarations\n-/////////////////////////////////////////////////////////////////////////////////////\n-\n-char v=1; // 1: show only warnings 2:verbose mode \n-Parameters par;\n-char program_name[NAMELEN]; //name of program executed (e.g. hhmake of hhsearch)\n-\n-// substitution matrix flavours\n-float P[21][21]; // P[a][b] = combined probability for a aligned to b\n-float R[21][21]; // R[a][b]=P[a][b]/p[b]=P(a|b); precalculated for pseudocounts\n-float Sim[21][21]; // Similarity matrix Sim[a][b]: how similar are a and b?\n-float S[21][21]; // Substitution score matrix S[a][b] = log2(Pab/pa/pb)\n-float pb[21]; // pb[a] = background amino acid probabilities for chosen substitution matrix\n-float qav[21]; // qav[a] = background amino acid probabilities for query HMM (needed for rate matrix rescaling)\n-\n-// secondary structure matrices\n-float S73[NDSSP][NSSPRED][MAXCF]; // P[A][B][cf] = log2 P(A,B,cf)/P(A)/P(B,cf)\n-float S33[NSSPRED][MAXCF][NSSPRED][MAXCF]; // P[B][cf][B'][cf'] = log2 sum_B' P(A,B',cf)/P(A)/P(B,cf) * P_b(B'|B)\n-// float S77[NDSSP][DSSP]; // P[A][B] = log2 P(A,B)/P(A)/P(B)\n-\n" |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/hhalign/hhfullalignment-C.h --- a/clustalomega/clustal-omega-0.2.0/src/hhalign/hhfullalignment-C.h Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,634 +0,0 @@\n-/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n-\n-/*********************************************************************\n- * Clustal Omega - Multiple sequence alignment\n- *\n- * Copyright (C) 2010 University College Dublin\n- *\n- * Clustal-Omega is free software; you can redistribute it and/or\n- * modify it under the terms of the GNU General Public License as\n- * published by the Free Software Foundation; either version 2 of the\n- * License, or (at your option) any later version.\n- *\n- * This file is part of Clustal-Omega.\n- *\n- ********************************************************************/\n-\n-/*\n- * RCS $Id: hhfullalignment-C.h 230 2011-04-09 15:37:50Z andreas $\n- */\n-\n-// hhfullalignment.C\n-\n-#ifndef MAIN\n-#define MAIN\n-#include <iostream> // cin, cout, cerr\n-#include <fstream> // ofstream, ifstream \n-#include <stdio.h> // printf\n-#include <stdlib.h> // exit\n-#include <string> // strcmp, strstr\n-#include <math.h> // sqrt, pow\n-#include <limits.h> // INT_MIN\n-#include <float.h> // FLT_MIN\n-#include <time.h> // clock\n-#include <ctype.h> // islower, isdigit etc\n-using std::ios;\n-using std::ifstream;\n-using std::ofstream;\n-using std::cout;\n-using std::cerr;\n-using std::endl;\n-#include "util-C.h" // imax, fmax, iround, iceil, ifloor, strint, strscn, strcut, substr, uprstr, uprchr, Basename etc.\n-#include "list.h" // list data structure\n-#include "hash.h" // hash data structure\n-#include "hhdecl-C.h" // constants, class \n-#include "hhutil-C.h" // imax, fmax, iround, iceil, ifloor, strint, strscn, strcut, substr, uprstr, uprchr, Basename etc.\n-#include "hhhmm.h" // class HMM\n-#include "hhalignment.h" // class Alignment\n-#include "hhhit.h"\n-#include "hhhalfalignment.h"\n-#endif\n-\n-\n-\n-//////////////////////////////////////////////////////////////////////////////\n-//////////////////////////////////////////////////////////////////////////////\n-// Methods of class FullAlignment\n-//////////////////////////////////////////////////////////////////////////////\n-//////////////////////////////////////////////////////////////////////////////\n- \n-\n-//////////////////////////////////////////////////////////////////////////////\n-// Output Results: use classes HalfAlignment and FullAlignment\n-//\n-// Example:\n-// Each column list contains at least a match state \n-// Insert states between the match states are omitted\n-//\n-// step 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1\n-// i 0 0 1 2 3 4 5 6 7 8 9 9 9 9 10 11 12 13 14\n-// \n-// Q ~ ~ X X X X X X X X X ~ ~ ~ X X X X X\n-// T Y Y Y Y Y Y Y Y ~ Y Y Y Y Y Y Y Y ~ ~\n-//\n-// j 7 8 9 10 11 12 13 14 14 15 16 17 18 19 20 21 22 22 22\n-// state IM IM MM MM MM MM MM MM DG MM MM GD GD GD MM MM MM MI MI\n-//\n-// nsteps=19\n-//\n-\n-\n-//////////////////////////////////////////////////////////////////////////////\n-// Constructor\n-FullAlignment::FullAlignment(int maxseqdis) \n-{\n- qa = new HalfAlignment(maxseqdis);\n- ta = new HalfAlignment(maxseqdis);\n- for (int h=0; h<LINELEN-1; h++) symbol[h]=\' \';\n-}\n-\n-//////////////////////////////////////////////////////////////////////////////\n-// Destructor\n-FullAlignment::~FullAlignment() \n-{\n- delete qa; qa = NULL;\n- delete ta; ta = NULL;\n-}\n-\n-//////////////////////////////////////////////////////////////////////////////\n-// Free memory of arrays s[][], l[][], and m[][] in HalfAlignment\n-void FullAlignment::FreeMemory()\n-{\n- qa->Unset();\n- ta->Unset();\n-}\n-\n-//////////////////////////////////////////////////////////////////////////////\n-/**\n- * @brief Add columns for match (and delete) states. \n- */\n-void \n-FullAlignment::AddColumns(int i, int j, char prev_state, char state, float S)\n-{\n- switch(state)\n- {\n- case MM: //MM pair state (both query and template in Match state)\n- AddGaps(); //fill up gaps until query and template parts have same length\n- symbo'..b'>nss_pred || k==qa->nss_conf) && !par.showpred) continue;\n- if (k==qa->ncons && !par.showcons) continue;\n- fprintf(outf,">%s\\n",qa->sname[k]);\n-#if TELOMER_PRINT\n- /* @<print left cut-off@> */\n- if (iTelomerLeft > 0){\n-\tfor (int iI = 1; iI <= iTelomerLeft; iI++){\n-\t fprintf(outf, "%1c", qa->seq[k][iI]);\n-\t}\n-\t/* this may be unnecessary */\n-\tfor (int iI = iTelomerLeft+1; iI < hit.i1; iI++){\n-\t fprintf(outf, "%1c", qa->seq[k][iI]);\n-\t}\n- }\n- else {\n-\tfor (int iI = iTelomerLeft; iI < 0; iI++){\n-\t fprintf(outf, "%1c", \'-\');\n-\t}\n-\t/* this may be unnecessary */\n-\t/* think about it */\n- }\n- /* @<print consensus@> */\n- for (h = 0; qa->s[k][h] > 0; h++){\n-\tfprintf(outf, "%1c", qa->s[k][h]);\n- }\n- /* @<print out rght cut-off@> */\n- for (int iI = hit.i2+1; iI <= qa->L; iI++){\n-\tfprintf(outf, "%1c", qa->seq[k][iI]);\n- }\n- for (int iI = 0; iI > iTelomerRght; iI--){\n-\tfprintf(outf, "%1c", \'-\');\n- }\n-#else\n- for (h=0,hh=-par.aliwidth; qa->s[k][h]>0; h++,hh++) \n-\t{\n-\t if (!hh) {fprintf(outf,"\\n"); hh-=par.aliwidth;}\n-\t fprintf(outf,"%1c",qa->s[k][h]); \n-\t}\n-#endif\n- fprintf(outf,"\\n");\n- }\n- \n- // Print template sequences\n- for (k=0; k<ta->n; k++)\n- {\n- if (k==ta->nsa_dssp) continue;\n- if (k==ta->nss_dssp && !par.showdssp) continue;\n- if ((k==ta->nss_pred || k==ta->nss_conf) && !par.showpred) continue;\n- if (k==ta->ncons && !par.showcons) continue;\n- fprintf(outf,">%s\\n",ta->sname[k]);\n-#if TELOMER_PRINT\n- /* @<print left cut-off@> */\n- if (iTelomerLeft > 0){\n-\tfor (int iI = 1; iI <= iTelomerLeft; iI++){\n-\t fprintf(outf, "%1c", \'-\');\n-\t}\n-\t/* this may be unnecessary */\n-\tfor (int iI = iTelomerLeft+1; iI < hit.j1; iI++){\n-\t fprintf(outf, "%1c", ta->seq[k][iI]);\n-\t}\n- }\n- else{\n-\tfor (int iI = 1; iI <= -iTelomerLeft; iI++){\n- fprintf(outf, "%1c", ta->seq[k][iI]);\n- }\n-\t/* this may be unnecessary */\n-\t/* think about it */\n- }\n- /* @<print consensus@> */\n- for (h = 0; ta->s[k][h] > 0; h++){\n- fprintf(outf, "%1c", ta->s[k][h]);\n- }\n-\n- /* @<print out rght cut-off@> */\n- for (int iI = hit.j2+1; iI <= ta->L; iI++){\n- fprintf(outf, "%1c", ta->seq[k][iI]);\n- }\n- for (int iI = 0; iI < iTelomerRght; iI++){\n- fprintf(outf, "%1c", \'-\');\n- }\n-\n-#else\n- for (h=0,hh=-par.aliwidth; ta->s[k][h]>0; h++,hh++) \n-\t{\n-\t if (!hh) {fprintf(outf,"\\n"); hh-=par.aliwidth;}\n-\t fprintf(outf,"%1c",ta->s[k][h]); \n-\t}\n-#endif \n- fprintf(outf,"\\n");\n- }\n- fprintf(outf,"\\n");\n-\n-} /* this is the end of PrintA2M() */\n-\n-////////////////////////////////////////////////////////////////////////////\n-/**\n- * @brief Print out full alignment in A2M format\n- */\n-void \n-FullAlignment::PrintFASTA(FILE* outf, Hit& hit)\n-{\n- // Transform sequences to uppercase and \'.\' to \'-\'\n- qa->ToFASTA();\n- ta->ToFASTA();\n- PrintA2M(outf,hit);\n-}\n-\n-//////////////////////////////////////////////////////////////////////////////\n-/**\n- * @brief Print out full alignment in A2M format\n- */\n-void \n-FullAlignment::PrintA3M(FILE* outf, Hit& hit)\n-{\n- // Remove all \'.\' from sequences\n- qa->RemoveChars(\'.\');\n- ta->RemoveChars(\'.\');\n- PrintA2M(outf,hit);\n-}\n-\n-\n-/* \n- * @* OverWriteSeqs()\n- */\n-void \n-FullAlignment::OverWriteSeqs(char **ppcFirstProf, char **ppcSecndProf){\n-\n- int iS, iR;\n- char cRes;\n-\n- for (iS = 0; iS < qa->n; iS++){\n- for (iR = 0; iR < qa->pos; iR++){\n- cRes = qa->s[iS][iR];\n- ppcFirstProf[iS][iR] = (\'.\' == cRes) ? \'-\' : cRes;\n- \n- } /* 0 <= iR < qa.L */\n- ppcFirstProf[iS][iR] = \'\\0\';\n- } /* 0 <= iS < qa.n */\n- \n- for (iS = 0; iS < ta->n; iS++){\n- for (iR = 0; iR < ta->pos; iR++){\n- cRes = ta->s[iS][iR];\n- ppcSecndProf[iS][iR] = (\'.\' == cRes) ? \'-\' : cRes;\n- \n- } /* 0 <= iR < ta.L */\n- ppcSecndProf[iS][iR] = \'\\0\';\n- } /* 0 <= iS < ta.n */\n- \n-} /* this is the end of OverWriteSeqs() */\n-\n-\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/hhalign/hhfullalignment.h --- a/clustalomega/clustal-omega-0.2.0/src/hhalign/hhfullalignment.h Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,49 +0,0 @@ -/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ - -/********************************************************************* - * Clustal Omega - Multiple sequence alignment - * - * Copyright (C) 2010 University College Dublin - * - * Clustal-Omega is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This file is part of Clustal-Omega. - * - ********************************************************************/ - -/* - * RCS $Id: hhfullalignment.h 143 2010-10-14 13:11:14Z andreas $ - */ - -////////////////////////////////////////////////////////////////////////////// -// Class for output alignment of query against template sequences -////////////////////////////////////////////////////////////////////////////// - -class FullAlignment -{ -public: - FullAlignment(int maxseqdis=MAXSEQDIS); - ~FullAlignment(); - void FreeMemory(); - void Build(HMM& q, Hit& hit); - void PrintHeader(FILE* outf, HMM& q, Hit& hit); - void PrintHHR(FILE* outf, Hit& hit); - void PrintA2M(FILE* outf, Hit& hit); - void PrintFASTA(FILE* outf, Hit& hit); - void PrintA3M(FILE* outf, Hit& hit); - void OverWriteSeqs(char **ppcFirstProf, char **ppcSecndProf); - int identities; // number of identical residues in query and template sequence - float score_sim; // substitution matrix similarity score between query and template - -private: - HalfAlignment* qa; //query and template parts of the alignment - HalfAlignment* ta; //query and template parts of the alignment - char symbol[LINELEN]; //symbol[h] = symbol (= - . + |) indicating match score for col h of alignment - void ClearSymbols() {for (int h=0; h<LINELEN-1; h++) symbol[h]=' ';} - void AddColumns(int i, int j, char prev_state, char state, float S); - void AddGaps(); - int ScoreChr(float S) {return (S<-1.5?'=':(S<-0.5?'-':(S<0.5?'.':(S<1.5?'+':'|'))));} -}; |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/hhalign/hhfunc-C.h --- a/clustalomega/clustal-omega-0.2.0/src/hhalign/hhfunc-C.h Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,1216 +0,0 @@\n-/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n-\n-/*********************************************************************\n- * Clustal Omega - Multiple sequence alignment\n- *\n- * Copyright (C) 2010 University College Dublin\n- *\n- * Clustal-Omega is free software; you can redistribute it and/or\n- * modify it under the terms of the GNU General Public License as\n- * published by the Free Software Foundation; either version 2 of the\n- * License, or (at your option) any later version.\n- *\n- * This file is part of Clustal-Omega.\n- *\n- ********************************************************************/\n-\n-/*\n- * RCS $Id: hhfunc-C.h 199 2011-02-21 18:24:49Z fabian $\n- */\n-\n-/*\n- * Changelog: Michael Remmert made changes to hhalign stand-alone code \n- * FS implemented some of the changes on 2010-11-11 -> MR1\n- *\n- * did not incorporate SS prediction PSIpred (yet); functions are: \n- * CalculateSS(3), \n- */\n-\n-\n-// hhfunc.C\n-\n-\n-/**\n- * AddBackgroundFrequencies()\n- *\n- * @brief add background frequencies (derived from HMM) to \n- * sequence/profile\n- *\n- * @param[in,out] ppfFreq,\n- * [in] residue frequencies of sequence/profile, \n- * [out] overlayed with HMM background frequencies\n- * @param[in,out] ppfPseudoF,\n- * [in] residue frequencies+pseudocounts of sequence/profile, \n- * [out] overlayed with HMM background frequencies+pseudocounts\n- * @param[in] iSeqLen,\n- * length of sequence/profile (not aligned to HMM)\n- * @pram[in] prHMM, \n- * background HMM\n- * @param[in] ppcSeq,\n- * sequences/profile to be \'softened\'\n- * @param[in] pcPrealigned,\n- * sequence aligned to HMM, this is not quite a consensus,\n- * it is identical to 1st sequence but over-writes gap information, \n- * if other sequences in profile have (non-gap) residues\n- * @param[in] iPreCnt\n- * number of sequences pre-aligned (pcPrealigned is \'consensus\' of these sequences) \n- * @param[in] pcRepresent\n- * sequence representative of HMM, aligned to pcSeq0\n- */\n-void \n-AddBackgroundFrequencies(float **ppfFreq, float **ppfPseudoF, float **ppfPseudoTr, \n- int iSeqLen, hmm_light *prHMM,\n- char **ppcSeq, char *pcPrealigned, int iPreCnt, char *pcRepresent)\n-{\n-\n- char *pcS = pcPrealigned; /* current residue in pre-aligned sequence */\n- char *pcH = pcRepresent; /* current residue in pre-aligned HMM */\n- int iS = 0; /* position in un-aligned sequence (corresponds to pcS) */\n- int iH = 0; /* position in un-aligned HMM (corresponds to pcH) */\n- int iA; /* residue iterator */\n- int iT; /* transition state iterator */\n- float fFWeight = 0.50 / sqrt((float)(iPreCnt)); /* weight of backgroud frequencies */ /* FIXME: tune value, 0.50 default */\n- //float fFWeight = 0.75;\n- float fFThgiew = UNITY - fFWeight; /* weight of \'true\' frequencies */\n- float fGWeight = 0.50 / sqrt((float)(iPreCnt)); /* weight of backgroud transitions */ /* FIXME: tune value, 0.50 default */\n- //float fGWeight = 0.50 /*/ (float)(iPreCnt)*/; /* weight of backgroud transitions */ /* FIXME: tune value, 0.50 default */\n- float fGThgiew = UNITY - fGWeight; /* weight of \'true\' transitions */\n- float fAux; \n- /* zf1SeqTrans[] are the (phenomenological) transition probabilities (+ pseudo-counts)\n- for a single sequence. It is almost certain (0.99) to stay in a match state, and very \n- unlikely (0.05) to go from match to insertion/deletion */\n- float zf1SeqTrans[] = {0.98, 0.01, 0.01, 0.25, 0.75, 0.25, 0.75};\n- float zf1SeqInit[] = {0.98, 0.01, 0.01, 0.99, 0.01, 0.99, 0.01};\n- float zf1SeqDel[] = {0.24, 0.01, 0.75, 0.01, 0.01, 0.01, 0.01};\n- float zf1SeqRevrt[] = {0.98, 0.01, 0.01, 0.01, 0.01, 0.99, 0.01};\n-\n- if ( (NULL == pcPrealigned) || (NULL == pcRepresent) ){\n- /*printf("%s/%s:%d: WARNING HMM=NULL -- didn\'t think I would get here (carry on, no danger)\\n",\n- __FUNCTION__, __FILE__, __LINE__);*/\n- return;\n- }\n-\n- if (NULL == prHMM-'..b' *\n- */\n-extern "C" int\n-readHMMWrapper(hmm_light *rHMM_p, \n- char *pcHMM_input)\n-{\n- par.maxResLen = 15002;\n- HMM rTemp(1000,par.maxResLen); /* temporary template */\n- Alignment rTempAli; /* temporary alignment */\n- /* AW changed init from {0} to 0 because it failed to compile with\n- * gcc 4.3.3 with the following error:\n- * error: braces around initializer for non-aggregate type \n- */\n- /* FS taken out initialiser alltogether */ \n-\n- /* 0th arg of RnP is the type of RnP, ie, \n- enum {INTERN_ALN_2_HMM = 0, READ_ALN_2_HMM, READ_HMM_2_HMM};*/\n- /* 1st arg of ReadAndPrepare() is ppcSeqs, 2nd is #seq */\n- /* FIXME: at this stage the 3rd arg, rHMM_p, only acts as a dummy.\n- this is rather silly, as it is the actual struct that will \n- carry the HMM info at the end. \n- If we write it already in ReadAndPrepare() then we could \n- dispense with all this friend-class nonsense */\n- if (OK != ReadAndPrepare(READ_HMM_2_HMM, \n- NULL, 0, rHMM_p, NULL, NULL, NULL, \n- pcHMM_input, rTemp, &rTempAli)) {\n- return FAILURE;\n- }\n-\n- /* an important piece of information I want to get out of here \n- is the consenssus sequence. there are however certain \n- Pfam HMMs that don\'t trigger consensus calculation.\n- at the moment I (FS) don\'t understand why this is \n- (or rather why this is not). The proper place to do this \n- should be inside ReadAndPrepare():ReadHMMer(), but \n- I have not quite penetrated the logic there. \n- Therefore I try to catch this condition at this point (here) \n- and rectify it. \n- */\n- if (-1 == rHMM_p->ncons){\n- int i, iA;\n- rHMM_p->ncons = rHMM_p->nfirst;\n-\n- for (i = 0; i < rHMM_p->L; i++){\n- double dPmax = 0.00;\n- int iAmax = -1;\n- for (iA = 0; iA < AMINOACIDS; iA++){\n- if (rHMM_p->f[i][iA] > dPmax){\n- iAmax = iA;\n- dPmax = rHMM_p->f[i][iA];\n- }\n- } /* (0 <= iA < AMINOACIDS) */\n- rHMM_p->seq[rHMM_p->ncons][i] = i2aa(iAmax);\n- } /* (0 <= i < rHMM_p->L) */\n-\n- } /* ncons not set */\n-\n-\n- rTemp.ClobberGlobal();\n- rTempAli.ClobberGlobal();\n-\n- return OK;\n-\n-} /*** end: readHMMWrapper() ***/\n-\n-\n-\n-\n-\n-\n-/////////////////////////////////////////////////////////////////////////////\n-/**\n- * @brief Do precalculations for q and t to prepare comparison\n- */\n-void \n-PrepareTemplate(HMM& q, HMM& t, int format)\n-{\n- if (format==0) // HHM format\n- {\n- // Add transition pseudocounts to template\n- t.AddTransitionPseudocounts();\n-\n- // Generate an amino acid frequency matrix from t.f[i][a] with max pseudocounts (tau=1) -> t.g[i][a] \n- t.PreparePseudocounts();\n-\n- // Add amino acid pseudocounts to template: t.p[i][a] = (1-tau)*f[i][a] + tau*g[i][a]\n- t.AddAminoAcidPseudocounts();\n- }\n- else // HHMER format\n- {\n- // Don\'t add transition pseudocounts to template\n- // t.AddTransitionPseudocounts(par.gapd, par.gape, par.gapf, par.gapg, par.gaph, par.gapi, 0.0);\n- \n- // Generate an amino acid frequency matrix from f[i][a] with full pseudocount admixture (tau=1) -> g[i][a] \n- t.PreparePseudocounts();\n-\n- // DON\'T ADD amino acid pseudocounts to temlate: pcm=0! t.p[i][a] = t.f[i][a]\n- t.AddAminoAcidPseudocounts(0, par.pca, par.pcb, par.pcc);\n- }\n-\n- // Modify transition probabilities to include SS-dependent penalties\n- if (par.ssgap) t.UseSecStrucDependentGapPenalties();\n-\n- if (par.forward>=1) t.Log2LinTransitionProbs(1.0); \n-\n- // Factor Null model into HMM t\n- // ATTENTION! t.p[i][a] is divided by pnul[a] (for reasons of efficiency) => do not reuse t.p\n- t.IncludeNullModelInHMM(q,t); // Can go BEFORE the loop if not dependent on template\n- \n- return;\n-}\n-\n-\n-/*** end of hhfunc-C.h ***/\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/hhalign/hhfunc.h --- a/clustalomega/clustal-omega-0.2.0/src/hhalign/hhfunc.h Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,25 +0,0 @@ -/********************************************************************* - * Clustal Omega - Multiple sequence alignment - * - * Copyright (C) 2010 University College Dublin - * - * Clustal-Omega is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This file is part of Clustal-Omega. - * - ********************************************************************/ - -/* - * RCS $Id: hhfunc.h 143 2010-10-14 13:11:14Z andreas $ - */ - - -int readHMMWrapper(hmm_light *rHMM_p, - char *pcHMM_input); -void FreeHMMstruct(hmm_light *prHMM); -int AlnToHMM2(hmm_light *rHMM_p, - char **ppcSeq, int iN); -int HHMake_Wrapper(char *tmp_aln, char *hmm_out); |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/hhalign/hhhalfalignment-C.h --- a/clustalomega/clustal-omega-0.2.0/src/hhalign/hhhalfalignment-C.h Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,450 +0,0 @@\n-/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n-\n-/*********************************************************************\n- * Clustal Omega - Multiple sequence alignment\n- *\n- * Copyright (C) 2010 University College Dublin\n- *\n- * Clustal-Omega is free software; you can redistribute it and/or\n- * modify it under the terms of the GNU General Public License as\n- * published by the Free Software Foundation; either version 2 of the\n- * License, or (at your option) any later version.\n- *\n- * This file is part of Clustal-Omega.\n- *\n- ********************************************************************/\n-\n-/*\n- * RCS $Id: hhhalfalignment-C.h 227 2011-03-28 17:03:09Z fabian $\n- */\n-\n-// hhfullalignment.C\n-\n-#ifndef MAIN\n-#define MAIN\n-#include <iostream> // cin, cout, cerr\n-#include <fstream> // ofstream, ifstream \n-#include <stdio.h> // printf\n-#include <stdlib.h> // exit\n-#include <string> // strcmp, strstr\n-#include <math.h> // sqrt, pow\n-#include <limits.h> // INT_MIN\n-#include <float.h> // FLT_MIN\n-#include <time.h> // clock\n-#include <ctype.h> // islower, isdigit etc\n-using std::ios;\n-using std::ifstream;\n-using std::ofstream;\n-using std::cout;\n-using std::cerr;\n-using std::endl;\n-#include "util-C.h" // imax, fmax, iround, iceil, ifloor, strint, strscn, strcut, substr, uprstr, uprchr, Basename etc.\n-#include "list.h" // list data structure\n-#include "hash.h" // hash data structure\n-#include "hhdecl-C.h" // constants, class \n-#include "hhutil-C.h" // imax, fmax, iround, iceil, ifloor, strint, strscn, strcut, substr, uprstr, uprchr, Basename etc.\n-#include "hhhmm.h" // class HMM\n-#include "hhalignment.h" // class Alignment\n-#include "hhhit.h"\n-#endif\n-\n-/////////////////////////////////////////////////////////////////////////////\n-/////////////////////////////////////////////////////////////////////////////\n-// Methods of class HalfAlignment\n-/////////////////////////////////////////////////////////////////////////////\n-/////////////////////////////////////////////////////////////////////////////\n- \n-\n-\n-/////////////////////////////////////////////////////////////////////////////\n-// Constructor\n-HalfAlignment::HalfAlignment(int maxseqdis)\n-{\n- n=0; \n- sname=seq=NULL; \n- nss_dssp = nss_pred = nss_conf = nsa_dssp = ncons= -1;\n- h = new(int[maxseqdis]); //h[k] = next position of sequence k to be written\n- s = new(char*[maxseqdis]); //s[k][h] = character in column h, sequence k of output alignment\n- l = new(int*[maxseqdis]); //counts non-gap residues: l[k][i] = index of last residue AT OR BEFORE match state i in seq k\n- m = new(int*[maxseqdis]); //counts positions: m[k][i] = position of match state i in string seq[k] \n-}\n-\n-/////////////////////////////////////////////////////////////////////////////////////\n-// Destructor\n-HalfAlignment::~HalfAlignment()\n-{\n- Unset();\n- delete[] h; h = NULL;\n- delete[] s; s = NULL;\n- delete[] l; l = NULL;\n- delete[] m; m = NULL;\n-}\n-\n-\n-\n-/////////////////////////////////////////////////////////////////////////////////////\n-/**\n- * @brief Free memory in HalfAlignment arrays s[][], l[][], and m[][]\n- */\n-void \n-HalfAlignment::Unset()\n-{\n- // Free memory for alignment characters and residue counts\n- for (int k=0; k<n; k++) \n- {\n- delete[] s[k]; s[k] = NULL;\n- delete[] l[k]; l[k] = NULL;\n- delete[] m[k]; m[k] = NULL;\n- }\n- n=0; \n- sname=seq=NULL; \n- nss_dssp = nss_pred = nss_conf = nsa_dssp = ncons= -1;\n-}\n-\n-\n-//////////////////////////////////////////////////////////////////////////////\n-/**\n- * @brief Prepare a2m/a3m alignment: \n- * Calculate l[k][i] (residue indices) and m[k][i] (position in seq[k]) \n-*/\n-void \n-HalfAlignment::Set(char* name, char** seq_in, char** sname_in, int n_in, int L_in, int n1, int n2, int n3, int n4, int nc, int L_in2/*<--FS*/)\n-{\n- int i; /* counts match states in seq[k] */\n- int ll; /* counts resi'..b'////////////////////////////////////////////////////////////\n-/**\n- * @brief Transform alignment sequences from A3M to A2M (insert ".")\n- */\n-void \n-HalfAlignment::BuildA2M()\n-{\n- AddInserts(0); \n- FillUpGaps();\n- for (int i=1; i<=L; i++)\n- {\n- AddColumn(i); \n- AddInserts(i); \n- FillUpGaps();\n- }\n- AddChar(\'\\0\');\n-}\n-\n-/////////////////////////////////////////////////////////////////////////////////////\n-/**\n- * @brief Transform alignment sequences from A3M to A2M (insert ".")\n- */\n-void \n-HalfAlignment::BuildA3M()\n-{\n- AddInserts(0); \n- for (int i=1; i<=L; i++)\n- {\n- AddColumn(i); \n- AddInserts(i); \n- }\n- AddChar(\'\\0\');\n-}\n-\n-/////////////////////////////////////////////////////////////////////////////////////\n-/**\n- * @brief Transform alignment sequences from A2M to FASTA ( lowercase to uppercase and \'.\' to \'-\')\n- */\n-void \n-HalfAlignment::ToFASTA()\n-{\n- for (int k=0; k<n; k++)\n- {\n- uprstr(s[k]);\n- strtr(s[k],".","-");\n- }\n-}\n-\n-/////////////////////////////////////////////////////////////////////////////////////\n-/**\n- * @brief Align query (HalfAlignment) to template (i.e. hit) match state structure\n- */\n-void \n-HalfAlignment::AlignToTemplate(Hit& hit)\n-{\n- int i,j;\n- int step; // column of the HMM-HMM alignment (first:nstep, last:1)\n- char state;\n-\n- if(0) { //par.loc==0) { //////////////////////////////////////////// STILL NEEDED??\n- // If in global mode: Add part of alignment before first MM state\n- AddInserts(0); // Fill in insert states before first match state\n- for (i=1; i<hit.i[hit.nsteps]; i++)\n- {\n-\tAddColumnAsInsert(i);\n-\tAddInserts(i);\n-\tif (par.outformat<=2) FillUpGaps();\n- }\n- }\n-\n- // Add endgaps (First state must be an MM state!!)\n- for (j=1; j<hit.j[hit.nsteps]; j++) \n- {\n- AddChar(\'-\');\n- }\n-\n- // Add alignment between first and last MM state\n- for (step=hit.nsteps; step>=1; step--) \n- {\n- state = hit.states[step];\n- i = hit.i[step];\n-\n- switch(state)\n- {\n- case MM: //MM pair state (both query and template in Match state)\n-\tAddColumn(i);\n-\tAddInserts(i);\n-\tbreak;\n- case DG: //D- state\n- case MI: //MI state\n-\tAddColumnAsInsert(i);\n-\tAddInserts(i);\n-\tbreak;\n- case GD: //-D state\n- case IM: //IM state\n-\tAddChar(\'-\');\n-\tbreak;\n- }\n- if (par.outformat<=2) FillUpGaps();\n-\n- }\n-\n- if(0) { //par.loc==0) { //////////////////////////////////////////// STILL NEEDED??\n-\n- // If in global mode: Add part of alignment after last MM state\n- for (i=hit.i[1]+1; i<=L; i++) \n- {\n-\tAddColumnAsInsert(i);\n-\tAddInserts(i);\n-\tif (par.outformat==2) FillUpGaps();\n- }\n- }\n-\n- // Add endgaps \n- for (j=hit.j[1]+1; j<=hit.L; j++) \n- {\n- AddChar(\'-\');\n- }\n-\n- // Add end-of-string character\n- AddChar(\'\\0\');\n-}\n-\n-\n-/////////////////////////////////////////////////////////////////////////////////////\n-/**\n- * @brief Write the a2m/a3m alignment into alnfile \n- */\n-void \n-HalfAlignment::Print(char* alnfile)\n-{\n- int k; //counts sequences\n- int omitted=0; // counts number of sequences with no residues in match states\n- FILE *outf;\n- if (strcmp(alnfile,"stdout"))\n- {\n- if (par.append) outf=fopen(alnfile,"a"); else outf=fopen(alnfile,"w");\n- if (!outf) OpenFileError(alnfile);\n- } \n- else\n- outf = stdout;\n- if (v>=3) cout<<"Writing alignment to "<<alnfile<<"\\n";\n-\n- for (k=0; k<n; k++)\n- {\n- // Print sequence only if it contains at least one residue in a match state\n- if (1) //strpbrk(s[k],"ABCDEFGHIKLMNPQRSTUVWXYZ1234567890")) \n-\t{\n-\t fprintf(outf,">%s\\n",sname[k]);\n-\t fprintf(outf,"%s\\n",s[k]);\n-\t} else {\n-\t omitted++;\n-\t if (v>=3) printf("%-14.14s contains no residue in match state. Omitting sequence\\n",sname[k]);\n-\t}\n- }\n- if (v>=2 && omitted) printf("Omitted %i sequences in %s which contained no residue in match state\\n",omitted,alnfile);\n- fclose(outf);\n-}\n-\n-\n-/** EOF hhhalfalignment-C.h **/\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/hhalign/hhhalfalignment.h --- a/clustalomega/clustal-omega-0.2.0/src/hhalign/hhhalfalignment.h Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,101 +0,0 @@ -/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ - -/********************************************************************* - * Clustal Omega - Multiple sequence alignment - * - * Copyright (C) 2010 University College Dublin - * - * Clustal-Omega is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This file is part of Clustal-Omega. - * - ********************************************************************/ - -/* - * RCS $Id: hhhalfalignment.h 143 2010-10-14 13:11:14Z andreas $ - */ - -///////////////////////////////////////////////////////////////////////////////////// -// Class representing a2m/a3m-formatted alignment corresponding to one HMM -///////////////////////////////////////////////////////////////////////////////////// - - -class HalfAlignment -{ -public: - HalfAlignment(int maxseqdis=MAXSEQDIS); - ~HalfAlignment(); - - // Initialize HalfAlignment; create index arrays s [],l[], m[] - void Set(char* name, char** seq_in, char** sname_in, int n_in, int L_in, int n1, int n2, int n3, int n4, int nc, int L_in2/*<--FS*/); - - // Free memory in HalfAlignment arrays s[][], l[][], and m[][] - void Unset(); - - // Align query (HalfAlignment) to template (i.e. hit) match state structure - void AlignToTemplate(Hit& hit); - - // Write the a2m/a3m query alignment into alnfile - void Print(char* outfile); - - // Fill in insert states following match state i - void AddInserts(int i); - - // Fill up alignment with gaps '.' to generate flush end (all h[k] equal) - void FillUpGaps(); - - // Fill in insert states following match state i and fill up gaps with '.' - void AddInsertsAndFillUpGaps(int i); - - // Add gap column '.' or character column - void AddChar(char c); - - // Add match state column i as is - void AddColumn(int i); - - // Add match state column i as insert state - void AddColumnAsInsert(int i); - - // Build alignment in FASTA format - void BuildFASTA(); - - // Build alignment in A2M format - void BuildA2M(); - - // Build alignment in A3M format - void BuildA3M(); - - // Transform alignment sequences from A2M to FASTA ( lowercase to uppercase and '.' to '-') - void ToFASTA(); - - // Remove all characters c from template sequences - void RemoveChars(char c); - -private: - friend class FullAlignment; - - int n; //number of sequences in half-alignment - char** seq; //sequences (in ASCII) in alignment - char** sname; //names of sequences in alignment - int nss_dssp; //index of sequence with dssp sec structure states - int nsa_dssp; //index of sequence with dssp solvent accessiblity states - int nss_pred; //index of sequence with predicted sec structure states - int nss_conf; //index of sequence with prediction confidence values - int ncons; //index of consensus sequence - - int pos; //After FillUpGaps() all h[k] have value pos - int L; //number of match states in corresponding profile - int* h; //h[k] = next position of sequence k to be written - char** s; //s[k][h] = column h, sequence k of output alignment - int** l; //counts non-gap residues: l[k][i] = index of last residue AT OR BEFORE match state i in seq k - int** m; //counts positions: m[k][i] = position of match state i in string seq[k] -/* int h[MAXSEQ]; //h[k] = next position of sequence k to be written */ -/* char* s[MAXSEQ]; //s[k][h] = column h, sequence k of output alignment */ -/* int* l[MAXSEQ]; //counts non-gap residues: l[k][i] = index of last residue AT OR BEFORE match state i in seq k */ -/* int* m[MAXSEQ]; //counts positions: m[k][i] = position of match state i in string seq[k] */ -}; - - |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/hhalign/hhhit-C.h --- a/clustalomega/clustal-omega-0.2.0/src/hhalign/hhhit-C.h Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,2204 +0,0 @@\n-/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n-\n-/*********************************************************************\n- * Clustal Omega - Multiple sequence alignment\n- *\n- * Copyright (C) 2010 University College Dublin\n- *\n- * Clustal-Omega is free software; you can redistribute it and/or\n- * modify it under the terms of the GNU General Public License as\n- * published by the Free Software Foundation; either version 2 of the\n- * License, or (at your option) any later version.\n- *\n- * This file is part of Clustal-Omega.\n- *\n- ********************************************************************/\n-\n-/*\n- * RCS $Id: hhhit-C.h 237 2011-04-14 15:01:48Z fabian $\n- */\n-\n-// hhhit.C\n-\n-#ifndef MAIN\n-#define MAIN\n-#include <iostream> // cin, cout, cerr\n-#include <fstream> // ofstream, ifstream \n-#include <stdio.h> // printf\n-using std::cout;\n-using std::cerr;\n-using std::endl;\n-using std::ios;\n-using std::ifstream;\n-using std::ofstream;\n-#include <stdlib.h> // exit\n-#include <string> // strcmp, strstr\n-#include <math.h> // sqrt, pow\n-#include <limits.h> // INT_MIN\n-#include <float.h> // FLT_MIN\n-#include <time.h> // clock\n-#include <ctype.h> // islower, isdigit etc\n-#include "util-C.h" // imax, fmax, iround, iceil, ifloor, strint, strscn, strcut, substr, uprstr, uprchr, Basename etc.\n-#include "list.h" // list data structure\n-#include "hash.h" // hash data structure\n-#include "hhdecl-C.h" // constants, class \n-#include "hhutil-C.h" // imax, fmax, iround, iceil, ifloor, strint, strscn, strcut, substr, uprstr, uprchr, Basename etc.\n-#include "hhhmm.h" // class HMM\n-#include "hhalignment.h" // class Alignment\n-#include "hhhitlist.h" // class HitList\n-#endif\n-\n-#define CALCULATE_MAX6(max, var1, var2, var3, var4, var5, var6, varb) \\\n-if (var1>var2) { max=var1; varb=STOP;} \\\n-else { max=var2; varb=MM;}; \\\n-if (var3>max) { max=var3; varb=GD;}; \\\n-if (var4>max) { max=var4; varb=IM;}; \\\n-if (var5>max) { max=var5; varb=DG;}; \\\n-if (var6>max) { max=var6; varb=MI;}; \n-\n-#define CALCULATE_SUM6(sum, var1, var2, var3, var4, var5, var6, varb) \\\n-if (var1>var2) { sum=var1; varb=STOP;} \\\n-else { sum=var2; varb=MM;}; \\\n-if (var3>sum) { sum=var3; varb=GD;}; \\\n-if (var4>sum) { sum=var4; varb=IM;}; \\\n-if (var5>sum) { sum=var5; varb=DG;}; \\\n-if (var6>sum) { sum=var6; varb=MI;}; \\\n-sum = var1 + var2 + var3 + var4 + var5 + var6;\n-\n-#define CALCULATE_MAX4(max, var1, var2, var3, var4, varb) \\\n-if (var1>var2) { max=var1; varb=STOP;} \\\n-else { max=var2; varb=MM;}; \\\n-if (var3>max) { max=var3; varb=MI;}; \\\n-if (var4>max) { max=var4; varb=IM;}; \n-\n-// Generate random number in [0,1[\n-#define frand() ((float) rand()/(RAND_MAX+1.0))\n-\n-\n-// Function declarations\n-inline float Score(float* qi, float* tj);\n-inline float ProbFwd(float* qi, float* tj);\n-inline float max2(const float& xMM, const float& xX, char& b); \n-inline int pickprob2(const double& xMM, const double& xX, const int& state); \n-inline int pickprob3_GD(const double& xMM, const double& xDG, const double& xGD); \n-inline int pickprob3_IM(const double& xMM, const double& xMI, const double& xIM); \n-inline int pickprob6(const double& x0, const double& xMM, const double& xGD, const double& xIM, const double& xDG, const double& xMI); \n-inline int pickmax2(const double& xMM, const double& xX, const int& state); \n-inline int pickmax3_GD(const double& xMM, const double& xDG, const double& xGD); \n-inline int pickmax3_IM(const double& xMM, const double& xMI, const double& xIM); \n-inline int pickmax6(const double& x0, const double& xMM, const double& xGD, const double& xIM, const double& xDG, const double& xMI); \n-inline double Pvalue(double x, double a[]);\n-inline double Pvalue(float x, float lamda, float mu);\n-inline double logPvalue(float x, float lamda, float mu);\n-inline double logPvalue(float x, double a[]);\n-inline double Probab(Hit& hit);\n-\n-////////////////////'..b'k[j]*Weff_M;\n-// \t Q.tr_lin[i][D2M]+= t.tr_lin[j][D2M]*wk[j]*Weff_D;\n-// \t Q.tr_lin[i][D2D]+= t.tr_lin[j][D2D]*wk[j]*Weff_D;\n-// \t Q.tr_lin[i][I2I]+= t.tr_lin[j][I2I]*wk[j]*Weff_I;\n-// \t Q.tr_lin[i][M2M]+= t.tr_lin[j][I2M]*wk[j]*Weff_I;\n-// \t break;\n-// \t }\n-// \t break;\n-\t \n-// \tcase IM: // if gap in query \n-// \t Weff_M = Weff(t.Neff_M[j]-1.0);\n-// \t switch(states[step-1])\n-// \t {\n-// \t case IM: // IM->IM\n-// \t Q.tr_lin[i][I2I]+= t.tr_lin[j][M2M]*wk[j]*Weff_M;\n-// \t Q.tr_lin[i][I2M]+= t.tr_lin[j][M2D]*wk[j]*Weff_M;\n-// \t Q.tr_lin[i][I2I]+= t.tr_lin[j][M2I]*wk[j]*Weff_M;\n-// \t break;\n-// \t case MM: // IM->MM\n-// \t Weff_D = Weff(t.Neff_D[j]-1.0);\n-// \t Weff_I = Weff(t.Neff_I[j]-1.0);\n-// \t Q.tr_lin[i][I2M]+= t.tr_lin[j][M2M]*wk[j]*Weff_M;\n-// \t Q.tr_lin[i][I2M]+= t.tr_lin[j][M2D]*wk[j]*Weff_M;\n-// \t Q.tr_lin[i][I2I]+= t.tr_lin[j][M2I]*wk[j]*Weff_M;\n-// \t Q.tr_lin[i][I2M]+= t.tr_lin[j][D2M]*wk[j]*Weff_D;\n-// \t Q.tr_lin[i][D2D]+= t.tr_lin[j][D2D]*wk[j]*Weff_D;\n-// \t Q.tr_lin[i][I2M]+= t.tr_lin[j][I2M]*wk[j]*Weff_I;\n-// \t Q.tr_lin[i][I2I]+= t.tr_lin[j][I2I]*wk[j]*Weff_I;\n-// \t break;\n-// \t }\n-// \t break;\n-\t \n-// \tcase GD: \n-// \t Weff_M = Weff(t.Neff_M[j]-1.0);\n-// \t switch(states[step-1])\n-// \t {\n-// \t case GD: // GD->GD\n-// \t Weff_I = Weff(t.Neff_I[j]-1.0);\n-// \t Q.tr_lin[i][I2I]+= t.tr_lin[j][M2M]*wk[j]*Weff_M;\n-// \t Q.tr_lin[i][I2M]+= t.tr_lin[j][M2D]*wk[j]*Weff_M;\n-// \t Q.tr_lin[i][I2I]+= t.tr_lin[j][M2I]*wk[j]*Weff_M;\n-// \t Q.tr_lin[i][I2I]+= t.tr_lin[j][I2M]*wk[j]*Weff_I;\n-// \t Q.tr_lin[i][I2I]+= t.tr_lin[j][I2I]*wk[j]*Weff_I;\n-// \t break;\n-// \t case MM: // GD->MM\n-// \t Weff_D = Weff(t.Neff_D[j]-1.0);\n-// \t Weff_I = Weff(t.Neff_I[j]-1.0);\n-// \t Q.tr_lin[i][I2M]+= t.tr_lin[j][M2M]*wk[j]*Weff_M;\n-// \t Q.tr_lin[i][I2M]+= t.tr_lin[j][M2D]*wk[j]*Weff_M;\n-// \t Q.tr_lin[i][I2I]+= t.tr_lin[j][M2I]*wk[j]*Weff_M;\n-// \t Q.tr_lin[i][D2D]+= t.tr_lin[j][D2D]*wk[j]*Weff_D;\n-// \t Q.tr_lin[i][I2M]+= t.tr_lin[j][I2M]*wk[j]*Weff_I;\n-// \t Q.tr_lin[i][I2I]+= t.tr_lin[j][I2I]*wk[j]*Weff_I;\n-// \t break;\n-// \t }\n-// \t break;\n-\n-// \t}\n-// }\n-// i = this->i[step];\n-// j = this->j[step];\n-// Weff_M = Weff(t.Neff_M[j]-1.0);\n-// for (a=0; a<20; a++) Q.f[i][a] += t.f[j][a]*wk[j]*Weff_M;\n-// }\n-\n-\n-#ifdef CLUSTALO\n-/* @* Hit::ClobberGlobal (eg, hit)\n- *\n- */\n-void \n-Hit::ClobberGlobal(void){\n-\n- if (i){\n- //delete[] i; \n- i = NULL;\n- }\n- if (j){\n- //delete[] j; \n- j = NULL;\n- }\n- if (states){\n- //delete[] states; \n- states = NULL;\n- }\n- if (S){\n- //delete[] S; \n- S = NULL;\n- }\n- if (S_ss){\n- //delete[] S_ss; \n- S_ss = NULL;\n- }\n- if (P_posterior){\n- //delete[] P_posterior; \n- P_posterior = NULL;\n- }\n- if (Xcons){\n- //delete[] Xcons; \n- Xcons = NULL;\n- }\n- // delete[] l; l = NULL;\n- i = j = NULL;\n- states = NULL;\n- S = S_ss = P_posterior = NULL;\n- Xcons = NULL;\n- if (irep==1) // if irep>1 then longname etc point to the same memory locations as the first repeat. \n- { // but these have already been deleted.\n-\t// \tprintf("Delete name = %s\\n",name);//////////////////////////\n-\t//delete[] longname; \n-\tlongname = NULL;\n-\t//delete[] name; \n-\tname = NULL;\n-\t//delete[] file; \n-\tfile = NULL;\n-\t//delete[] dbfile; \n-\tdbfile = NULL;\n-\t/*for (int k=0; k<n_display; k++) \n-\t {\n-\t delete[] sname[k]; sname[k] = NULL;\n-\t delete[] seq[k]; seq[k] = NULL;\n-\t }*/\n-\t//delete[] sname; \n-\tsname = NULL;\n-\t//delete[] seq; \n-\tseq = NULL;\n- }\n-\n- score = score_sort = score_aass = 0.0;\n- Pval = Pvalt = Eval = Probab = 0;\n- Pforward = sum_of_probs = 0.00;\n- L = irep = nrep = n_display = nsteps = 0;\n- i1 = i2 = j1 = j2 = matched_cols = min_overlap = 0;\n-}\n-#endif\n-\n-\n-/*\n- * EOF hhhit-C.h\n- */\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/hhalign/hhhit.h --- a/clustalomega/clustal-omega-0.2.0/src/hhalign/hhhit.h Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,192 +0,0 @@\n-/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n-\n-/*********************************************************************\n- * Clustal Omega - Multiple sequence alignment\n- *\n- * Copyright (C) 2010 University College Dublin\n- *\n- * Clustal-Omega is free software; you can redistribute it and/or\n- * modify it under the terms of the GNU General Public License as\n- * published by the Free Software Foundation; either version 2 of the\n- * License, or (at your option) any later version.\n- *\n- * This file is part of Clustal-Omega.\n- *\n- ********************************************************************/\n-\n-/*\n- * RCS $Id: hhhit.h 143 2010-10-14 13:11:14Z andreas $\n- */\n-\n-// hhhit.h\n-\n-//////////////////////////////////////////////////////////////////////////////\n-/* Describes an alignment of two profiles. \n- Used as list element in Hits : List<Hit> */\n-//////////////////////////////////////////////////////////////////////////////\n-class Hit\n-{\n- public: \n- char* longname; // Name of HMM\n- char* name; // One-word name of HMM\n- char* file; // Basename (with path, without extension) of alignment file that was used to construct the HMM\n- // (path from db-file is prepended to FILE record in HMM file!)\n- char fam[IDLEN]; // family ID (derived from name) (FAM field)\n- char sfam[IDLEN]; // superfamily ID (derived from name) \n- char fold[IDLEN]; // fold ID (derived from name)\n- char cl[IDLEN]; // class ID (derived from name)\n- int index; // index of HMM in order of reading in (first=0)\n- char* dbfile; // full database file name from which HMM was read\n- long ftellpos; // start position of HMM in database file\n-\n- float score; // Score of alignment (i.e. of Viterbi path)\n- float score_sort; // score to sort hits in output list (negative means first/best!)\n- float score_aass; // first: just hit.score, then hit.logPval-SSSCORE2NATLOG*hit.score_ss;(negative means best!)\n- float score_ss; // Part of score due to secondary structure\n- float Pval; // P-value for whole protein based on score distribution of query\n- float Pvalt; // P-value for whole protein based on score distribution of template\n- float logPval; // natural logarithm of Pval\n- float logPvalt; // natural logarithm of Pvalt\n- float Eval; // E-value for whole protein\n- float Probab; // probability in % for a positive (depends only on score)\n- float weight; // weight of hit for P-value calculation (= 1/#HMMs-in-family/#families-in-superfamily)\n- double Pforward; // scaled total forward probability : Pforward * Product_{i=1}^{Lq+1}(scale[i])\n- \n-/* float score_comp; // compositional similarity score */\n-/* float logPcomp; // natural logarithm of Pvalue for compositional similarity score */\n-/* float Prep; // P-value for single-repeat hit */\n-/* float Erep; // E-value for single-repeat hit */\n-/* float logPrep; // natural logarithm of P-value for single-repeat hit */\n- float E1val; // E-value for whole protein from transitive scoring\n- float logP1val; // natural logarithm of P1val, the transitive P-value\n-\n- int L; // Number of match states in template\n- int irep; // Index of single-repeat hit (1: highest scoring repeat hit)\n- int nrep; // Number of single-repeat hits with one template\n- \n- int n_display; // number of sequences stored for display of alignment \n- char** sname; // names of stored sequences \n- char** seq; // residues of stored sequences (first at pos 1)\n- int nss_dssp; // index of dssp secondary structure sequence in seq[]\n- int nsa_dssp; // index of of dssp solvent accessibility in seq[]\n- int nss_pred; // index of dssp secondary structure sequence in seq[]\n- int'..b' int min_overlap; // Minimum overlap between query and template\n- float sum_of_probs; // sum of probabilities for Maximum ACcuracy alignment (if dssp states defined, only aligned pairs with defined dssp state contribute to sum)\n- float Neff_HMM; // Diversity of underlying alignment\n-\n- // Constructor (only set pointers to NULL)\n- Hit();\n- ~Hit(){};\n- \n- // Free all allocated memory (to delete list of hits)\n- void Delete();\n-\n- // Allocate/delete memory for dynamic programming matrix\n- void AllocateBacktraceMatrix(int Nq, int Nt);\n- void DeleteBacktraceMatrix(int Nq);\n- void AllocateForwardMatrix(int Nq, int Nt);\n- void DeleteForwardMatrix(int Nq);\n- void AllocateBackwardMatrix(int Nq, int Nt);\n- void DeleteBackwardMatrix(int Nq);\n- \n- // Compare an HMM with overlapping subalignments\n- void Viterbi(HMM& q, HMM& t, float** Sstruc=NULL);\n-\n- // Compare two HMMs with each other in lin space\n- void Forward(HMM& q, HMM& t, float** Pstruc=NULL);\n-\n- // Compare two HMMs with each other in lin space\n- void Backward(HMM& q, HMM& t);\n-\n- // Find maximum accuracy alignment (after running Forward and Backward algorithms)\n- void MACAlignment(HMM& q, HMM& t);\n-\n- // Trace back alignment of two profiles based on matrices bXX[][]\n- void Backtrace(HMM& q, HMM& t);\n-\n- // Trace back alignment of two profiles based on matrices bXX[][]\n- void StochasticBacktrace(HMM& q, HMM& t, char maximize=0);\n-\n- // Trace back MAC alignment of two profiles based on matrix bMM[][]\n- void BacktraceMAC(HMM& q, HMM& t);\n-\n- // Calculate secondary structure score between columns i and j of two HMMs (query and template)\n- inline float ScoreSS(HMM& q, HMM& t, int i, int j, int ssm);\n-\n- // Calculate secondary structure score between columns i and j of two HMMs (query and template)\n- inline float ScoreSS(HMM& q, HMM& t, int i, int j);\n-\n- // Calculate total score (including secondary structure score and compositional bias correction\n- inline float ScoreTot(HMM& q, HMM& t, int i, int j);\n-\n- // Calculate score (excluding secondary structure score and compositional bias correction\n- inline float ScoreAA(HMM& q, HMM& t, int i, int j);\n-\n- // Comparison (used to sort list of hits)\n- int operator<(const Hit& hit2) {return score_sort<hit2.score_sort;}\n-\n- // Merge HMM with next aligned HMM \n- void MergeHMM(HMM& Q, HMM& t, float wk[]);\n-\n-#ifdef CLUSTALO\n- void ClobberGlobal(void);\n-#endif \n-\n-\n- double** B_MM; // Backward matrices\n- \n-private:\n- char state; // 0: Start/STOP state 1: MM state 2: GD state (-D) 3: IM state 4: DG state (D-) 5 MI state\n- char** bMM; // (backtracing) bMM[i][j] = STOP:start of alignment MM:prev was MM GD:prev was GD etc\n- char** bGD; // (backtracing) bMM[i][j] = STOP:start of alignment MM:prev was MM SAME:prev was GD\n- char** bDG; // (backtracing)\n- char** bIM; // (backtracing)\n- char** bMI; // (backtracing)\n- char** cell_off; // cell_off[i][j]=1 means this cell will get score -infinity\n-\n- double** F_MM; // Forward matrices \n- double** F_GD; // F_XY[i][j] * Prod_1^i(scale[i]) \n- double** F_DG; // = Sum_x1..xl{ P(HMMs aligned up to Xi||Yj co-emmitted x1..xl ) / (Prod_k=1^l f(x_k)) } \n- double** F_IM; // end gaps are not penalized!\n- double** F_MI; // \n- double* scale; // \n-\n- double** B_GD; // B_XY[i][j] * Prod_i+1^(L+1) (scale[i])\n- double** B_DG; // = Sum_x2..xl{ P(HMMs aligned from Xi||Yj to end co-emmitted x2..xl ) / (Prod_k=2^l f(x_k)) } \n- double** B_IM; // end gaps are not penalized!\n- double** B_MI; // \n-\n- void InitializeBacktrace(HMM& q, HMM& t);\n- void InitializeForAlignment(HMM& q, HMM& t);\n-};\n-\n-\n-double Pvalue(double x, double a[]);\n-double Pvalue(float x, float lamda, float mu);\n-double logPvalue(float x, float lamda, float mu);\n-double logPvalue(float x, double a[]);\n-double Probab(Hit& hit);\n-\n-\n-\n-\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/hhalign/hhhitlist-C.h --- a/clustalomega/clustal-omega-0.2.0/src/hhalign/hhhitlist-C.h Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,3198 +0,0 @@\n-/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n-\n-/*********************************************************************\n- * Clustal Omega - Multiple sequence alignment\n- *\n- * Copyright (C) 2010 University College Dublin\n- *\n- * Clustal-Omega is free software; you can redistribute it and/or\n- * modify it under the terms of the GNU General Public License as\n- * published by the Free Software Foundation; either version 2 of the\n- * License, or (at your option) any later version.\n- *\n- * This file is part of Clustal-Omega.\n- *\n- ********************************************************************/\n-\n-/*\n- * RCS $Id: hhhitlist-C.h 199 2011-02-21 18:24:49Z fabian $\n- */\n-\n-// hhhitlist.C\n-\n-#ifndef MAIN\n-#define MAIN\n-#include <iostream> // cin, cout, cerr\n-#include <fstream> // ofstream, ifstream \n-#include <stdio.h> // printf\n-#include <stdlib.h> // exit\n-#include <string> // strcmp, strstr\n-#include <math.h> // sqrt, pow\n-#include <limits.h> // INT_MIN\n-#include <float.h> // FLT_MIN\n-#include <time.h> // clock\n-#include <ctype.h> // islower, isdigit etc\n-using std::ios;\n-using std::ifstream;\n-using std::ofstream;\n-using std::cout;\n-using std::cerr;\n-using std::endl;\n-#include "util-C.h" // imax, fmax, iround, iceil, ifloor, strint, strscn, strcut, substr, uprstr, uprchr, Basename etc.\n-#include "list.h" // list data structure\n-#include "hash.h" // hash data structure\n-#include "hhdecl-C.h" // constants, class \n-#include "hhutil-C.h" // imax, fmax, iround, iceil, ifloor, strint, strscn, strcut, substr, uprstr, uprchr, Basename etc.\n-#include "hhhmm.h" // class HMM\n-#include "hhalignment.h" // class Alignment\n-#include "hhhit.h"\n-#include "hhhalfalignment.h"\n-#include "hhfullalignment.h"\n-#endif\n-\n-\n-//////////////////////////////////////////////////////////////////////////////\n-//////////////////////////////////////////////////////////////////////////////\n-//// Methods of class HitList\n-//////////////////////////////////////////////////////////////////////////////\n-//////////////////////////////////////////////////////////////////////////////\n-\n-\n-\n-//////////////////////////////////////////////////////////////////////////////\n-/**\n- * @brief Print summary listing of hits\n- */\n-void \n-HitList::PrintHitList(HMM& q, char* outfile)\n-{\n- Hit hit;\n- int nhits=0;\n- char str[NAMELEN]="";\n-\n- FILE* outf=NULL;\n- if (strcmp(outfile,"stdout"))\n- {\n- outf=fopen(outfile,"w");\n- if (!outf) OpenFileError(outfile);\n- }\n- else\n- outf = stdout;\n-\n-\n- fprintf(outf,"Query %s\\n",q.longname); \n-// fprintf(outf,"Family %s\\n",q.fam); \n- fprintf(outf,"Match_columns %i\\n",q.L);\n- fprintf(outf,"No_of_seqs %i out of %i\\n",q.N_filtered,q.N_in);\n- fprintf(outf,"Neff %-4.1f\\n",q.Neff_HMM);\n- fprintf(outf,"Searched_HMMs %i\\n",N_searched);\n- \n- // Print date stamp\n- time_t* tp=new(time_t);\n- *tp=time(NULL);\n- fprintf(outf,"Date %s",ctime(tp));\n- delete (tp); (tp) = NULL;\n- \n- // Print command line\n- fprintf(outf,"Command "); \n- for (int i=0; i<par.argc; i++) \n- if (strlen(par.argv[i])<=par.maxdbstrlen)\n- fprintf(outf,"%s ",par.argv[i]);\n- else\n- fprintf(outf,"<%i characters> ",(int)strlen(par.argv[i]));\n- fprintf(outf,"\\n\\n"); \n- \n-#ifdef WINDOWS \n- if (par.trans) \n- fprintf(outf," No Hit Prob E-trans E-value Score SS Cols Query HMM Template HMM\\n");\n- else \n- fprintf(outf," No Hit Prob E-value P-value Score SS Cols Query HMM Template HMM\\n");\n-#else\n- if (par.trans) \n- fprintf(outf," No Hit Prob E-trans E-value Score SS Cols Query HMM Template HMM\\n");\n- else \n- fprintf(outf," No Hit Prob E-value P-value Score SS Cols Query HMM Template HMM\\n");\n-#endif\n-\n- Reset();\n- while (!End()) // print hit lis'..b'[l])+anorm) == anorm) {\n-\t flag=0;\n-\t break;\n-\t}\n-\tif ((double)(fabs(w[nm])+anorm) == anorm) break;\n- }\n- if (flag) {\n-\t// Cancellation of rv1[l], if l > 1.\n-\tc=0.0;\n-\ts=1.0;\n-\tfor (i=l;i<=k;i++) {\n-\t f=s*rv1[i];\n-\t rv1[i]=c*rv1[i];\n-\t if ((double)(fabs(f)+anorm) == anorm) break;\n-\t g=w[i];\n-\t h=pythag(f,g);\n-\t w[i]=h;\n-\t h=1.0/h;\n-\t c=g*h;\n-\t s = -f*h;\n-\t for (j=0;j<m;j++) {\n-\t y=A[nm][j];\n-\t z=A[i][j];\n-\t A[nm][j]=y*c+z*s;\n-\t A[i][j]=z*c-y*s;\n-\t }\n-\t}\n- }\n- z=w[k];\n- // Convergence.\n- if (l == k) {\n-\t// Singular value is made nonnegative.\n-\tif (z < 0.0) {\n-\t w[k] = -z;\n-\t for (j=0;j<n;j++) V[k][j] = -V[k][j];\n-\t}\n-\tbreak;\n- }\n- if (its == 30) {printf("Error in SVD: no convergence in 30 iterations\\n"); exit(7);}\n- // Shift from bottom 2-by-2 minor.\n- x=w[l];\n- nm=k-1;\n- y=w[nm];\n- g=rv1[nm];\n- h=rv1[k];\n- f=((y-z)*(y+z)+(g-h)*(g+h))/(2.0*h*y);\n- g=pythag(f,1.0);\n- f=((x-z)*(x+z)+h*((y/(f+SIGN(g,f)))-h))/x;\n- // Next QR transformation:\n- c=s=1.0;\n- for (j=l;j<=nm;j++) {\n-\ti=j+1;\n-\tg=rv1[i];\n-\ty=w[i];\n-\th=s*g;\n-\tg=c*g;\n-\tz=pythag(f,h);\n-\trv1[j]=z;\n-\tc=f/z;\n-\ts=h/z;\n-\tf=x*c+g*s;\n-\tg = g*c-x*s;\n-\th=y*s;\n-\ty *= c;\n-\tfor (jj=0;jj<n;jj++) {\n-\t x=V[j][jj];\n-\t z=V[i][jj];\n-\t V[j][jj]=x*c+z*s;\n-\t V[i][jj]=z*c-x*s;\n-\t}\n-\tz=pythag(f,h);\n-\t// Rotation can be arbitrary if z = 0.\n-\tw[j]=z;\n-\tif (z) {\n-\t z=1.0/z;\n-\t c=f*z;\n-\t s=h*z;\n-\t}\n-\tf=c*g+s*y;\n-\tx=c*y-s*g;\n-\t\n-\tfor (jj=0;jj<m;jj++) {\n-\t y=A[j][jj];\n-\t z=A[i][jj];\n-\t A[j][jj]=y*c+z*s;\n-\t A[i][jj]=z*c-y*s;\n-\t}\n- }\n- rv1[l]=0.0;\n- rv1[k]=f;\n- w[k]=x;\n- }\n- }\n- TransposeMatrix(V,n);\n- TransposeMatrix(A,n);\n- delete[](rv1); (rv1) = NULL;\n-}\n-\n-/**\n- * @brief Computes (a2 + b2 )^1/2 without destructive underflow or overflow.\n- */\n-double \n-pythag(double a, double b)\n-{\n- double absa,absb;\n- absa=fabs(a);\n- absb=fabs(b);\n- if (absa > absb) \n- return absa*sqrt(1.0+SQR(absb/absa));\n- else \n- return (absb == 0.0 ? 0.0 : absb*sqrt(1.0+SQR(absa/absb)));\n-}\n-\n-\n-/* @* HitList::ClobberGlobal(void)\n- */\n-void \n-HitList::ClobberGlobal(void){\n-\n-\n- /* @<variables local to HitList::ClobberGlobal@> */\n- class List<Hit>::ListEl<Hit> *pvIter = head;\n-\n- /* NOTE: no free/delete-ing of data to be done here \n- hitlist only holds a shallow copy of hit; \n- hit is being cleared off properly.\n- just reset everything to 0/0.0/NULL.\n- The only important thing to do at this stage \n- is to attach head and tail and set size = 0\n- (FS, 2010-02-18)\n-\n- NOTE: I only ever saw 1 (one) in-between element, \n- but there may ctually be a real linked list \n- of more than 1 element (FS, 2010-02-18)\n- */\n-\n- // printf("POINTER:\\t%p\\t=HEAD\\n", head);\n- while (pvIter->next != tail){\n-\n- // printf("POINTER:\\t%p->\\t%p\\n", pvIter, pvIter->next);\n- pvIter = pvIter->next;\n-\n-#if 1\n- pvIter->data.longname = pvIter->data.name = \n- pvIter->data.file = pvIter->data.dbfile = NULL;\n- pvIter->data.sname = NULL;\n- pvIter->data.seq = NULL;\n- pvIter->data.self = 0;\n- pvIter->data.i = pvIter->data.j = NULL;\n- pvIter->data.states = NULL;\n- pvIter->data.S = pvIter->data.S_ss = pvIter->data.P_posterior = NULL;\n- pvIter->data.Xcons = NULL;\n- pvIter->data.sum_of_probs = 0.0;\n- pvIter->data.Neff_HMM = 0.0;\n- pvIter->data.score_ss = pvIter->data.Pval = pvIter->data.logPval = \n- pvIter->data.Eval = pvIter->data.Probab = pvIter->data.Pforward = 0.0;\n- pvIter->data.nss_conf = pvIter->data.nfirst = \n- pvIter->data.i1 = pvIter->data.i2 = pvIter->data.j1 = pvIter->data.j2 = \n- pvIter->data.matched_cols = pvIter->data.ssm1 = pvIter->data.ssm2 = 0;\n-#endif\n- }\n- // printf("POINTER:\\t\\t\\t%p=TAIL\\n", tail);\n-\n-\n- head->next = tail;\n- tail->prev = head;\n- size = 0;\n-\n- /* @= */\n- return;\n-\n-} /* this is the end of HitList::ClobberGlobal() */\n-\n-\n-/*\n- * EOF hhhitlist-C.h\n- */\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/hhalign/hhhitlist.h --- a/clustalomega/clustal-omega-0.2.0/src/hhalign/hhhitlist.h Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,140 +0,0 @@ -/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ - -/********************************************************************* - * Clustal Omega - Multiple sequence alignment - * - * Copyright (C) 2010 University College Dublin - * - * Clustal-Omega is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This file is part of Clustal-Omega. - * - ********************************************************************/ - -/* - * RCS $Id: hhhitlist.h 143 2010-10-14 13:11:14Z andreas $ - */ - -// hhhitlist.h - -////////////////////////////////////////////////////////////////////////////// -// HitList is a list of hits of type Hit -// which can be operated upon by several anaylsis methods -////////////////////////////////////////////////////////////////////////////// -class HitList : public List<Hit> -{ -private: - double score[MAXPROF]; // HHsearch score of each HMM for ML fit - double weight[MAXPROF]; // weight of each HMM = 1/(size_fam[tfam]*size_sfam[hit.sfam]) for ML fit - int Nprof; // Number of HMMs for ML fit - -public: - int fams; // number of families found found in hitlist - int sfams; // number of superfamilies found in hitlist - int N_searched; // number of sequences searched from HMM database - Hash<float>* blast_logPvals;/* Hash containing names and log(P-values) - read from BLAST file (needed for HHblast) */ - - HitList() {blast_logPvals=NULL;} - ~HitList() {if (blast_logPvals) delete blast_logPvals;} - - // Print summary listing of hits - void PrintHitList(HMM& q, char* outfile); - -#ifdef CLUSTALO - void ClobberGlobal(void); -#endif - - // Print alignments of query sequences against hit sequences - void PrintAlignments( -#ifdef CLUSTALO - char **ppcFirstProf, char **ppcSecndProf, -#endif - HMM& q, char* outfile, char outformat=0); - - // Return a figure of merit for distinction of the score with positive from the scores with negatives - void Optimize(HMM& q, char* buffer); - - // Print score distribution into file score_dist - void PrintScoreFile(HMM& q); - - // Log likelihood for fitting the EVD to the score distribution - double RankOrderFitCorr(double* v); - // Static wrapper-function for calling the nonstatic member function RankOrderFitCorr() - static double RankOrderFitCorr_static(void* pt2hitlist, double* v); - - // Log likelihood for fitting the EVD to the score distribution - double LogLikelihoodCorr(double* v); - // Static wrapper-function for calling the nonstatic member function LogLikelihoodCorr() - static double LogLikelihoodCorr_static(void* pt2hitlist, double* v); - - // Log likelihood for fitting the EVD to the score distribution - double LogLikelihoodEVD(double* v); - // Static wrapper-function for calling the nonstatic member function LogLikelihoodEVD() - static double LogLikelihoodEVD_static(void* pt2hitlist, double* v); - - - // Subroutine to FindMin: new point given by highest point ihigh, fac and replaces ihigh if it is lower - double TryPoint(int ndim, double* p, double* y, double* psum, int ihigh, double fac, double (*Func)(void* pt2hitlist, double* v)); - - // Find minimum with simplex method of Nelder and Mead (1965) - float FindMin(int ndim, double* p, double* y, double tol, int& nfunc, double (*Func)(void* pt2hitlist, double* v)); - - // Do a maximum likelihood fit of the scores with an EV distribution with parameters lamda and mu - void MaxLikelihoodEVD(HMM& q, int nbest); - - // Calculate correlation and score offset for HHblast composite E-values - void CalculateHHblastCorrelation(HMM& q); - - // Calculate HHblast composite E-values - void CalculateHHblastEvalues(HMM& q); - - // Calculate Pvalues as a function of query and template lengths and diversities - void CalculatePvalues(HMM& q); - - // Set P-values, E-values and scores according to q.lamda and q.mu (if calibration from database scan is impossible) - void GetPvalsFromCalibration(HMM& q); - - // HHblast: read PSI-BLAST E-values to determine correlation - void ReadBlastFile(HMM& q); - - // Print first 20 hits of hitlist - void Debug() - { - Hit hit; - int i=0; - Reset(); - printf("TARGET FAMILY LEN COL LOG-PVA S-AASS PROBAB SCORE_SORT\n"); - while (++i<=20 && !End()) - { - hit = ReadNext(); - printf("%-10.10s %-10.10s %3i %3i %s %7.2f %6.2f %6.2f\n",hit.name,hit.fam,hit.L,hit.matched_cols,sprintg(-1.443*hit.logPval,7),-hit.score_aass,hit.Probab,hit.score_sort); - } - } - - // Calculate P-values and Probabilities from transitive scoring over whole database - void TransitiveScoring(); - void TransitiveScoring2(); - void TransitiveScoring3(); - void TransitiveScoring4(); - - // Score2Z transforms the -log(P-value) score into a Z-score for 0 < S - double Score2Z(double S); - - // Z2Score transforms the Z-score into a -log(P-value) value - double Z2Score(double Z); - - // Matrix manipulation - void PrintMatrix(float** V, int N); - void PrintMatrix(double** V, int N); - float NormalizationFactor(double** Csub,float* w, int M); - void Normalize(float* Ztq, char** fold, Hash<int>& excluded); - void InvertMatrix(double** B, double** A, int N); - void TransposeMatrix(double** V, int N); - void SVD(double **A, int n, double w[], double **V); - -}; - |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/hhalign/hhhmm-C.h --- a/clustalomega/clustal-omega-0.2.0/src/hhalign/hhhmm-C.h Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,2637 +0,0 @@\n-/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n-\n-/*********************************************************************\n- * Clustal Omega - Multiple sequence alignment\n- *\n- * Copyright (C) 2010 University College Dublin\n- *\n- * Clustal-Omega is free software; you can redistribute it and/or\n- * modify it under the terms of the GNU General Public License as\n- * published by the Free Software Foundation; either version 2 of the\n- * License, or (at your option) any later version.\n- *\n- * This file is part of Clustal-Omega.\n- *\n- ********************************************************************/\n-\n-/*\n- * RCS $Id: hhhmm-C.h 224 2011-03-23 12:13:33Z fabian $\n- */\n-\n-\n-// hhhmm.C\n-\n-#ifndef MAIN\n-#define MAIN\n-#include <iostream> // cin, cout, cerr\n-#include <fstream> // ofstream, ifstream \n-#include <stdio.h> // printf\n-using std::cout;\n-using std::cerr;\n-using std::endl;\n-using std::ios;\n-using std::ifstream;\n-using std::ofstream;\n-#include <stdlib.h> // exit\n-#include <string> // strcmp, strstr\n-#include <math.h> // sqrt, pow\n-#include <limits.h> // INT_MIN\n-#include <float.h> // FLT_MIN\n-#include <time.h> // clock\n-#include <ctype.h> // islower, isdigit etc\n-#include "util-C.h" // imax, fmax, iround, iceil, ifloor, strint, strscn, strcut, substr, uprstr, uprchr, Basename etc.\n-#include "list.h" // list data structure\n-#include "hash.h" // hash data structure\n-#include "hhdecl-C.h"\n-#include "hhutil-C.h" // imax, fmax, iround, iceil, ifloor, strint, strscn, strcut, substr, uprstr, uprchr, Basename etc.\n-#endif\n-\n-// #ifndef WNLIB\n-// #define WNLIB\n-// #include "wnconj.h" // Will Naylor\'s wnlib for optimization in C \n-// #endif\n-\n-//////////////////////////////////////////////////////////////////////////////\n-//// Class HMM\n-//////////////////////////////////////////////////////////////////////////////\n-\n-//////////////////////////////////////////////////////////////////////////////\n-// Object constructor\n-//////////////////////////////////////////////////////////////////////////////\n-HMM::HMM(int maxseqdis, int maxres)\n-{\n- sname = new char*[maxseqdis]; // names of stored sequences \n- for (int i = 0; i < maxseqdis; i++){ sname[i] = NULL;}\n- seq = new char*[maxseqdis]; // residues of stored sequences (first at pos 1!)\n- for (int i = 0; i < maxseqdis; i++){ seq[i] = NULL;}\n- Neff_M = new float[maxres]; // Neff_M[i] = diversity of subalignment of seqs that have residue in col i\n- Neff_I = new float[maxres]; // Neff_I[i] = diversity of subalignment of seqs that have insert in col i\n- Neff_D = new float[maxres]; // Neff_D[i] = diversity of subalignment of seqs that have delete in col i\n- longname = new char[DESCLEN]; // Full name of first sequence of original alignment (NAME field)\n- ss_dssp = new char[maxres]; // secondary structure determined by dssp 0:- 1:H 2:E 3:C 4:S 5:T 6:G 7:B\n- sa_dssp = new char[maxres]; // solvent accessibility state determined by dssp 0:- 1:A (absolutely buried) 2:B 3:C 4:D 5:E (exposed)\n- ss_pred = new char[maxres]; // predicted secondary structure 0:- 1:H 2:E 3:C\n- ss_conf = new char[maxres]; // confidence value of prediction 0:- 1:0 ... 10:9\n- Xcons = NULL; // create only when needed: consensus sequence in internal representation (A=0 R=1 N=2 D=3 ...)\n- l = new int[maxres]; // l[i] = pos. of j\'th match state in aligment\n- /* FS introduced sentinel, NULL terminates loop in destructor, FS, r221->222 */\n- f = new float*[maxres+1]; f[maxres] = NULL; // f[i][a] = prob of finding amino acid a in column i WITHOUT pseudocounts\n- g = new float*[maxres+1]; g[maxres] = NULL; // f[i][a] = prob of finding amino acid a in column i WITH pseudocounts\n- p = new float*[maxres+1]; p[maxres] = NULL; // p[i][a] = prob of finding amino acid a in column i WITH OPTIMUM pseudocounts\n- tr = new float*[maxre'..b']*x[b];\n- \n-// for (int a=0; a<20; ++a) w[a] = x[a]*z[a]-qav[a];\n-// for (int a=0; a<20; ++a)\n-// {\n-// tmp = w[a]*z[a];\n-// for (int b=0; b<20; ++b) tmp += P[a][b]*x[b]*w[b];\n-// grad[a] = 2.0*tmp;\n-// }\n-// return;\n-// }\n-\n-\n-// /////////////////////////////////////////////////////////////////////////////////////\n-// //// Rescale a substitution matrix to biased aa frequencies in global vector qav[a]\n-// /////////////////////////////////////////////////////////////////////////////////////\n-// void HMM::RescaleMatrix() \n-// {\n-// int a,b;\n-// int code;\n-// double x[21]; // scaling factor\n-// double val_min;\n-// const int len=20;\n-// const int max_iterations=50;\n-\n-// if (v>=2) printf("Adjusting rate matrix to query amino acid composition ...\\n");\n-\n-// // Put amino acid frequencies into global array (needed to call WNLIB\'s conjugate gradient method)\n-// for (a=0; a<20; ++a) qav[a] = pav[a];\n-\n-// // Initialize scaling factors x[a]\n-// for (a=0; a<20; ++a) x[a]=pow(qav[a]/pb[a],0.73); // Initialize \n-\n-// // Call conjugate gradient minimization method from WNLIB\n-// wn_conj_gradient_method(&code,&val_min,x,len,&RescaleMatrixFunc,&RescaleMatrixFuncGrad,max_iterations);\n-\n-\n-// // Calculate z[a] = sum_b Pab*xb\n-// float sum_err=0.0f; \n-// float sum = 0.0f;\n-// for (a=0; a<20; ++a) \n-// {\n-// float za=0.0f; // za = sum_b Pab*xb\n-// for (b=0; b<20; ++b) za+=P[a][b]*x[b];\n-// sum_err += (x[a]*za/qav[a]-1)*(x[a]*za/qav[a]-1);\n-// sum += x[a]*za;\n-// }\n-// if (sum_err>1e-3 & v>=1) fprintf(stderr,"WARNING: adjusting rate matrix by CG resulted in residual error of %5.3f.\\n",sum_err);\n- \n-// // Rescale rate matrix\n-// for (a=0; a<20; ++a) \n-// for (b=0; b<20; ++b) \n-// {\n-// \tP[a][b] *= x[a]*x[b]/sum;\n-// \tR[a][b] = P[a][b]/qav[b];\n-// }\n-\n-// // How well approximated?\n-// if (v>=3) \n-// {\n-// // Calculate z[a] = sum_b Pab*xb\n-// float z[21]; \n-// for (a=0; a<20; ++a) \n-// \tfor (z[a]=0.0, b=0; b<20; ++b) z[a]+=P[a][b];\n-// printf("Adjust A R N D C Q E G H I L K M F P S T W Y V\\nErr? ");\n-// for (a=0; a<20; ++a) printf("%4.0f ",1000*z[a]/qav[a]);\n-// cout<<endl<<"xa ";\n-// for (a=0; a<20; ++a) fprintf(stdout,"%4.2f ",x[a]);\n-// cout<<endl;\n-// }\n-\n-// // Evaluate sequence identity underlying substitution matrix\n-// if (v>=3)\n-// {\n-// float id=0.0f;\n-// float entropy=0.0f; \n-// float entropy_qav=0.0f;\n-// float mut_info=0.0f;\n-// for (a=0; a<20; ++a) id += P[a][a];\n-// for (a=0; a<20; ++a) entropy_qav-=qav[a]*fast_log2(qav[a]);\n-// for (a=0; a<20; ++a) \n-// \t for (b=0; b<20; ++b) \n-// \t {\n-// \t entropy-=P[a][b]*fast_log2(R[a][b]);\n-// \t mut_info += P[a][b]*fast_log2(P[a][b]/qav[a]/qav[b]);\n-// \t }\n-\n-// fprintf(stdout,"Rescaling rate matrix: sequence identity = %2.0f%%; entropy per column = %4.2f bits (out of %4.2f); mutual information = %4.2f bits\\n",100*id,entropy,entropy_qav,mut_info);\n-// }\n-// return;\n-// }\n-\n-\n-/* @* HMM::ClobberGlobal (eg, q,t)\n- */\n-void \n-HMM::ClobberGlobal(void){\n-\n- for (int i = 0; i < n_display; i++){\n- if (sname[i]){\n- delete[] sname[i]; sname[i] = NULL;\n- }\n- if (seq[i]){\n- delete[] seq[i]; seq[i] = NULL;\n- }\n- } \n- Neff_M[0] = Neff_I[0] = Neff_D[0] = 0.0;\n- longname[0] = \'\\0\'; file[0] = \'\\0\';\n- ss_dssp[0] = sa_dssp[0] = ss_pred[0] = ss_conf[0] = \'\\0\';\n- Xcons = NULL;\n- l[0] = 0;\n- L = 0;\n- Neff_HMM = 0;\n- n_display = N_in = N_filtered = 0;\n- nss_dssp = nsa_dssp = nss_pred = nss_conf = nfirst = ncons = -1;\n- lamda = 0.0; mu = 0.0;\n- name[0] = longname[0] = fam[0] = \'\\0\';\n-\n- for (int i = 0; i < NAA; i++){\n- pav[i] = 0;\n- }\n-\n- /* @= */\n- return;\n-\n-} /* this is the end of ClobberGlobal() */\n-\n-\n-/* \n- * EOF hhhmm-C.h\n- */\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/hhalign/hhhmm.h --- a/clustalomega/clustal-omega-0.2.0/src/hhalign/hhhmm.h Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b"@@ -1,204 +0,0 @@\n-/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n-\n-/*********************************************************************\n- * Clustal Omega - Multiple sequence alignment\n- *\n- * Copyright (C) 2010 University College Dublin\n- *\n- * Clustal-Omega is free software; you can redistribute it and/or\n- * modify it under the terms of the GNU General Public License as\n- * published by the Free Software Foundation; either version 2 of the\n- * License, or (at your option) any later version.\n- *\n- * This file is part of Clustal-Omega.\n- *\n- ********************************************************************/\n-\n-/*\n- * RCS $Id: hhhmm.h 165 2010-12-22 16:24:48Z fabian $\n- */\n-\n-// hhhmm.h\n-\n-\n-class HMM\n-{\n- public:\n- HMM(int maxseqdis=MAXSEQDIS, int maxres=/*MAXRES*/par.maxResLen);\n- ~HMM();\n- HMM& operator=(HMM&);\n- \n- int n_display; // number of sequences stored for display of alignment (INCLUDING >ss_ and >cf_ sequences)\n- int n_seqs; // number of sequences read in (INCLUDING >ss_ and >cf_ sequences)\n- char** sname; // names of stored sequences \n- char** seq; // residues of stored sequences (first at pos 1!)\n- int ncons; // index of consensus sequence\n- int nfirst; // index of first sequence (query sequence of HMM)\n- int nss_dssp; // index of seq[] with secondary structure by dssp\n- int nsa_dssp; // index of seq[] with solvent accessibility by dssp\n- int nss_pred; // index of seq[] with predicted secondary structure\n- int nss_conf; // index of seq[] with confidence values for secondary structure prediction\n- \n- int L; // length of HMM = number of match states; set in declaration of HMM object\n- int N_in; // number of sequences in alignment\n- int N_filtered; // number of sequences after filtering\n- float* Neff_M; // Neff_M[i] = diversity of subalignment of seqs that have residue in col i\n- float* Neff_I; // Neff_I[i] = diversity of subalignment of seqs that have insert in col i\n- float* Neff_D; // Neff_D[i] = diversity of subalignment of seqs that have delete in col i\n- float Neff_HMM; // average number of Neff over total length of HMM\n- \n- char* longname; // Full name of first sequence of original alignment (NAME field)\n- char name[NAMELEN]; // HMM name = first word in longname in lower case\n- char file[NAMELEN]; // Basename (with path, without extension) of alignment file that was used to construct the HMM\n- char fam[NAMELEN]; // family ID (derived from name) (FAM field)\n- char sfam[NAMELEN]; // superfamily ID (derived from name) \n- char fold[NAMELEN]; // fold ID (derived from name)\n- char cl[NAMELEN]; // class ID (derived from name)\n-\n- float lamda, mu; // coefficients for aa score distribution of HMM using parameters in 'Parameters par'\n- bool has_pseudocounts; // set to true if HMM contains pseudocounts\n-\n- // Make a flat copy of q \n- void FlatCopyTo(HMM& t);\n-\n- // Read an HMM from a HHsearch .hhm file and return 0 at end of file\n- int Read(FILE* dbf, char* path=NULL);\n-\n- // Read an HMM from a HMMer .hmm file; return 0 at end of file\n- int ReadHMMer(FILE* dbf, char* filestr=NULL);\n-\n- // Read an HMM from a HMMer3 .hmm file; return 0 at end of file \n- int ReadHMMer3(FILE* dbf, char* filestr=NULL);\n-\n- // Add transition pseudocounts to HMM\n- void AddTransitionPseudocounts(float gapd=par.gapd, float gape=par.gape, float gapf=par.gapf, float gapg=par.gapg, float gaph=par.gaph, float gapi=par.gapi, float gapb=par.gapb);\n-\n- // Use secondary structure-dependent gap penalties on top of the HMM transition penalties\n- void UseSecStrucDependentGapPenalties();\n-\n- // Generate an amino acid frequency matrix g[][] with fu"..b' to Null model distribution\n- void NeutralizeTags();\n- \n- // Calculate effective number of sequences using profiles INCLUDING pseudocounts\n- float CalcNeff();\n-\n- // Calculate consensus of HMM (needed to merge HMMs later)\n- void CalculateConsensus();\n-\n- // Store linear transition probabilities\n- void StoreLinearTransitionProbs();\n-\n- // Initialize f[i][a] with query HMM\n- void MergeQueryHMM(HMM& q, float wk[]);\n- \n- // Normalize probabilities in total merged super-HMM \n- void NormalizeHMMandTransitionsLin2Log();\n-\n- // Rescale rate matrices P[a][b], R[a][b] according to HMM av. aa composition in pav[a]\n- void RescaleMatrix();\n-\n-#ifdef CLUSTALO\n- void ClobberGlobal(void);\n- char cQT; /* query or template */\n-#endif\n-\n-private:\n- float** f; // f[i][a] = prob of finding amino acid a in column i WITHOUT pseudocounts\n- float** g; // f[i][a] = prob of finding amino acid a in column i WITH pseudocounts\n- float** p; // p[i][a] = prob of finding amino acid a in column i WITH OPTIMUM pseudocounts\n- float** tr; // log2 of transition probabilities M2M M2I M2D I2M I2I D2M D2D M2M_GAPOPEN GAPOPEN GAPEXTD\n-/* float** tr_lin; // transition probs in log space */\n- char trans_lin; // transition probs are given in log or lin space? (0: p_tr 1: log(p_tr) \n-\n- char* ss_dssp; // secondary structure determined by dssp 0:- 1:H 2:E 3:C 4:S 5:T 6:G 7:B\n- char* sa_dssp; // solvent accessibility state determined by dssp 0:- 1:A (absolutely buried) 2:B 3:C 4:D 5:E (exposed)\n- char* ss_pred; // predicted secondary structure 0:- 1:H 2:E 3:C\n- char* ss_conf; // confidence value of prediction 0:- 1:0 ... 10:9\n- char* Xcons; // consensus sequence in internal representation (A=0 R=1 N=2 D=3 ...)\n- float pav[NAA]; // pav[a] = average freq of amino acids in HMM (including subst matrix pseudocounts)\n- float pnul[NAA]; // null model probabilities used in comparison (only set in template/db HMMs)\n- int* l; // l[i] = pos. of j\'th match state in aligment\n-/* char trans_lin; // transition probs are given in log or lin space? (0: p_tr 1: log(p_tr) */\n-\n- // Utility for Read()\n- int Warning(FILE* dbf, char line[], char name[])\n- {\n- if (v) cerr<<"\\nWARNING: could not read line\\n\\\'"<<line<<"\\\'\\nin HMM "<<name<<" in "<<file<<"\\n";\n- while (fgetline(line,LINELEN,dbf) && !(line[0]==\'/\' && line[1]==\'/\'));\n- if (line) return 2; //return status: skip HMM\n- return 0; //return status: end of database file\n- }\n-\n- friend class Hit;\n- friend class Alignment;\n- friend class HMMshadow;\n-};\n-\n-class HMMshadow {\n-\n- public: \n- float *Neff_M;\n- float *Neff_I;\n- float *Neff_D;\n- float **f;\n- float **g;\n- float **p;\n- float **tr;\n- float pav[20];\n- \n- void copyHMMtoShadow(const HMM &hmm) { \n- Neff_M = hmm.Neff_M;\n- Neff_I = hmm.Neff_I;\n- Neff_D = hmm.Neff_D;\n- f = hmm.f; \n- g = hmm.g; \n- p = hmm.p;\n- tr = hmm.tr;\n- memcpy(pav, hmm.pav, 20*sizeof(float));\n- } \n- \n- void copyShadowToHMM(const HMM &hmm, const hmm_light rShadow) {\n- \n- int i, j;\n- \n- for (i = 0; i < rShadow.L+1; i++){\n- hmm.Neff_M[i] = rShadow.Neff_M[i];\n- hmm.Neff_I[i] = rShadow.Neff_I[i];\n- hmm.Neff_D[i] = rShadow.Neff_D[i];\n- for (j = 0; j < 20; j++){\n- hmm.f[i][j] = rShadow.f[i][j];\n- hmm.g[i][j] = rShadow.g[i][j];\n- hmm.p[i][j] = rShadow.p[i][j];\n- }\n- for (j = 0; j < 7; j++){\n- hmm.tr[i][j] = rShadow.tr[i][j];\n- }\n- memcpy((void *)hmm.pav, rShadow.pav, 20*sizeof(float));\n- }\n- } /* this is the end of copyShadowToHMM() */\n-\n-} /* class HMMshadow */;\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/hhalign/hhmatrices-C.h --- a/clustalomega/clustal-omega-0.2.0/src/hhalign/hhmatrices-C.h Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,474 +0,0 @@\n-/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n-\n-/*********************************************************************\n- * Clustal Omega - Multiple sequence alignment\n- *\n- * Copyright (C) 2010 University College Dublin\n- *\n- * Clustal-Omega is free software; you can redistribute it and/or\n- * modify it under the terms of the GNU General Public License as\n- * published by the Free Software Foundation; either version 2 of the\n- * License, or (at your option) any later version.\n- *\n- * This file is part of Clustal-Omega.\n- *\n- ********************************************************************/\n-\n-/*\n- * RCS $Id: hhmatrices-C.h 199 2011-02-21 18:24:49Z fabian $\n- */\n-\n-// Substitution matrices and their background frequencies\n-\n-// The following background frequencies were calculated by the formula pa = (P[a,b]/(pa*pb))^(-1) * (1,...,1)\n-// For the Blousum50-matrix this becomes pb[a]= SUM_(b=1,20) (2^(BLOSUM50[a,b]/3))^(-1) \n-// A R N D C Q E G H I L K M F P S T W Y V \n-// Gonnet 7.68,5.14,4.02,5.41,1.89,3.27,5.99,7.56,3.69,5.06,10.01,5.97,2.20,3.50,4.54,4.67,7.12,1.25,3.95,7.28\n-// BLOSUM50 8.24,6.24,4.46,4.77,2.03,2.90,6.78,6.69,2.53,6.89,10.7 ,5.04,1.49,4.93,3.97,5.95,6.13,1.34,3.45,6.28\n-\n-const float Gonnet[]={\n-// A R N D C Q E G H I L K M F P S T W Y V \n- 10227, 3430, 2875, 3869, 1625, 2393, 4590, 6500, 2352, 3225, 5819, 4172, 1435, 1579, 3728, 4610, 6264, 418, 1824, 5709, // A\n- 3430, 7780, 2209, 2589, 584, 2369, 3368, 3080, 2173, 1493, 3093, 5701, 763, 859, 1893, 2287, 3487, 444, 1338, 2356, // R \n- 2875, 2209, 3868, 3601, 501, 1541, 2956, 3325, 1951, 1065, 2012, 2879, 532, 688, 1480, 2304, 3204, 219, 1148, 1759, // N\n- 3869, 2589, 3601, 8618, 488, 2172, 6021, 4176, 2184, 1139, 2151, 3616, 595, 670, 2086, 2828, 3843, 204, 1119, 2015, // D\n- 1625, 584, 501, 488, 5034, 355, 566, 900, 516, 741, 1336, 591, 337, 549, 419, 901, 1197, 187, 664, 1373, // C\n- 2393, 2369, 1541, 2172, 355, 1987, 2891, 1959, 1587, 1066, 2260, 2751, 570, 628, 1415, 1595, 2323, 219, 871, 1682, // Q\n- 4590, 3368, 2956, 6021, 566, 2891, 8201, 3758, 2418, 1624, 3140, 4704, 830, 852, 2418, 2923, 4159, 278, 1268, 2809, // E\n- 6500, 3080, 3325, 4176, 900, 1959, 3758,26066, 2016, 1354, 2741, 3496, 741, 797, 2369, 3863, 4169, 375, 1186, 2569, // G\n- 2352, 2173, 1951, 2184, 516, 1587, 2418, 2016, 5409, 1123, 2380, 2524, 600, 1259, 1298, 1642, 2446, 383, 876, 1691, // H\n- 3225, 1493, 1065, 1139, 741, 1066, 1624, 1354, 1123, 6417, 9630, 1858, 1975, 2225, 1260, 1558, 3131, 417, 1697, 7504, // I\n- 5819, 3093, 2012, 2151, 1336, 2260, 3140, 2741, 2380, 9630,25113, 3677, 4187, 5540, 2670, 2876, 5272, 1063, 3945,11005, // L\n- 4172, 5701, 2879, 3616, 591, 2751, 4704, 3496, 2524, 1858, 3677, 7430, 949, 975, 2355, 2847, 4340, 333, 1451, 2932, // K\n- 1435, 763, 532, 595, 337, 570, 830, 741, 600, 1975, 4187, 949, 1300, 1111, 573, 743, 1361, 218, 828, 2310, // M\n- 1579, 859, 688, 670, 549, 628, 852, 797, 1259, 2225, 5540, 975, 1111, 6126, 661, 856, 1498, 1000, 4464, 2602, // F\n- 3728, 1893, 1480, 2086, 419, 1415, 2418, 2369, 1298, 1260, 2670, 2355, 573, 661,11834, 2320, 3300, 179, 876, 2179, // P\n- 4610, 2287, 2304, 2828, 901, 1595, 2923, 3863, 1642, 1558, 2876, 2847, 743, 856, 2320, 3611, 4686, 272, 1188, 2695, // S\n- 6264, 3487, 3204, 3843, 1197, 2323, 4159, 4169, 2446, 3131, 5272, 4340, 1361, 1498, 3300, 4686, 8995, 397, 1812, 5172, // T\n- 418, 444, 219, 204, 187, 219, 278, 375, 383, 417, 1063, 333, 218, 1000, 179, 272, 397, 4101, 1266, 499, // W\n- 1824, 1338, 1148, 1119, 664, 871, 1268, 1186, 876, 1697, 3945, 1451, 828, 4464, 876, 1188, 1812, 1266, 9380, 2227, // Y\n- 5709, 2356, 1759, 2015, 1373, 1682, 2809, 2569, 1691, 7'..b'[a]); // S[a][b] = log2(P(a,b)/P(a)/P(b))\n- \n- // Evaluate sequence identity underlying substitution matrix\n- if (v>=3)\n- {\n- float id=0.0f;\n- float entropy=0.0f; \n- float entropy_pb=0.0f;\n- float mut_info=0.0f;\n- for (a=0; a<20; ++a) id+=P[a][a];\n- for (a=0; a<20; ++a) entropy_pb-=pb[a]*log2(pb[a]);\n- for (a=0; a<20; ++a) \n-\t for (b=0; b<20; ++b) \n-\t {\n-\t entropy-=P[a][b]*log2(R[a][b]);\n-\t mut_info += P[a][b]*S[a][b];\n-\t }\n- \n- printf(": sequence identity = %2.0f%%; entropy per column = %4.2f bits (out of %4.2f); mutual information = %4.2f bits\\n",100*id,entropy,entropy_pb,mut_info);\n- }\n-\n- if (v>=4) //Debugging: probability matrix and dissimilarity matrix \n- {\n- cout<<"Check matrix: before renormalization sum P(a,b)= "<<sumab<<"...\\n";//PRINT\n- cout<<" A R N D C Q E G H I L K M F P S T W Y V\\n";\n- cout<<"p[] ";\n- for (a=0; a<20; a++) printf("%4.1f ",100*pb[a]);\n- cout<<endl<<"\\nSubstitution matrix log2( P(a,b)/p(a)/p(b) ) (in bits):\\n";\n- cout<<" A R N D C Q E G H I L K M F P S T W Y V\\n";\n- for (b=0; b<20; b++)\n-\t{\n-\t cout<<i2aa(b)<<" ";\n-\t for (a=0; a<20; a++) printf("%4.1f ",S[a][b]);\n-\t cout<<endl;\n-\t}\n- cout<<endl<<"\\nOdds matrix P(a,b)/p(a)/p(b):\\n";\n- cout<<" A R N D C Q E G H I L K M F P S T W Y V\\n";\n- for (b=0; b<20; b++)\n-\t{\n-\t cout<<i2aa(b)<<" ";\n-\t for (a=0; a<20; a++) printf("%4.1f ",P[b][a]/pb[a]/pb[b]);\n-\t cout<<endl;\n-\t}\n- cout<<endl<<"\\nMatrix of conditional probabilities P(a|b) = P(a,b)/p(b) (in %):\\n";\n- cout<<" A R N D C Q E G H I L K M F P S T W Y V\\n";\n- for (b=0; b<20; b++)\n-\t{\n-\t cout<<i2aa(b)<<" ";\n-\t for (a=0; a<20; a++) printf("%4.1f ",100*R[b][a]);\n-\t cout<<endl;\n-\t}\n- cout<<endl<<"\\nProbability matrix P(a,b) (in %):\\n";\n- cout<<" A R N D C Q E G H I L K M F P S T W Y V\\n";\n- for (b=0; b<20; b++)\n-\t{\n-\t cout<<i2aa(b)<<" ";\n-\t for (a=0; a<20; a++) printf("%5.0f ",1000000*P[b][a]);\n-\t cout<<endl;\n-\t}\n- cout<<endl<<"Similarity matrix P(a,b)^2/P(a,a,)/P(b,b) (in %):\\n";\n- cout<<" A R N D C Q E G H I L K M F P S T W Y V\\n";\n- for (b=0; b<20; b++)\n-\t{\n-\t cout<<i2aa(b)<<" ";\n-\t for (a=0; a<20; a++) printf("%4.0f ",100*Sim[b][a]);\n-\t cout<<endl;\n-\t}\n- cout<<endl;\n-\n-\n- }\n-}\n- \n-\n-/////////////////////////////////////////////////////////////////////////////////////\n-/**\n- * @brief Set secondary structure substitution matrix\n- */\n-void \n-SetSecStrucSubstitutionMatrix()\n-{\n- int A; //observed ss state (determined dssp)\n- int B,BB; //predicted ss states (by psipred)\n- int cf,ccf; //confidence value of prediction\n- float P73[NDSSP][NSSPRED][MAXCF]; //P73[cf][B][A] = P(A,B,cf)/P(A)/P(B,cf) = P(A|B,cf)/P(A)\n- float sum;\n-\n- // S73[A][B][cf][b] = score for matching observed ss state A in query with state B in template\n- // predicted with confidence cf, when query and template columns are diverged by b units \n- for (cf=0; cf<MAXCF; cf++)\n- for (A=0; A<NDSSP; A++)\n- for (B=0; B<NSSPRED; B++)\n-\t{\n-\t P73[A][B][cf] = 1.-par.ssa + par.ssa*Ppred[cf*NSSPRED*NDSSP + B*NDSSP + A];\n-\t S73[A][B][cf] = log2(P73[A][B][cf]);\n-\t}\n-\n- for (B=0; B<NSSPRED; B++)\n- for (cf=0; cf<MAXCF; cf++)\n- for (BB=0; BB<NSSPRED; BB++)\n-\tfor (ccf=0; ccf<MAXCF; ccf++)\n-\t {\n-\t sum=0;\n-\t for (A=1; A<NDSSP; A++)\n-\t sum += P73[A][B][cf] * P73[A][BB][ccf] * Pobs[A];\n-\t S33[B][cf][BB][ccf] = log2(sum);\n-\t } \n-} /* this is the end of SetSecStrucSubstitutionMatrix() */\n-\n-\n-\n-/*\n- * EOF hhmatrices-C.h\n- */\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/hhalign/hhutil-C.h --- a/clustalomega/clustal-omega-0.2.0/src/hhalign/hhutil-C.h Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b"@@ -1,659 +0,0 @@\n-/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n-\n-/*********************************************************************\n- * Clustal Omega - Multiple sequence alignment\n- *\n- * Copyright (C) 2010 University College Dublin\n- *\n- * Clustal-Omega is free software; you can redistribute it and/or\n- * modify it under the terms of the GNU General Public License as\n- * published by the Free Software Foundation; either version 2 of the\n- * License, or (at your option) any later version.\n- *\n- * This file is part of Clustal-Omega.\n- *\n- ********************************************************************/\n-\n-/*\n- * RCS $Id: hhutil-C.h 229 2011-04-07 17:09:07Z fabian $\n- */\n-\n-//////////////////////////////////////////////////////////////////////////////\n-// Transform a character to lower case and '.' to '-' and vice versa\n-//////////////////////////////////////////////////////////////////////////////\n-\n-\n-inline char \n-MatchChr(char c) {return ((c>='a' && c<='z')? c-'a'+'A' : (c=='.'? '-':c) );}\n-\n-inline char \n-InsertChr(char c) {return ((c>='A' && c<='Z')? c+'a'-'A' : ((c>='0' && c<='9') || c=='-')? '.':c );}\n-\n-inline int \n-WordChr(char c) {return (int)((c>='A' && c<='Z') || (c>='a' && c<='z'));}\n-\n-\n-//////////////////////////////////////////////////////////////////////////////\n-/**\n- * @brief Transforms the one-letter amino acid code into an integer between 0 and 22\n- */\n-inline char \n-aa2i(char c)\n-{\n- //A R N D C Q E G H I L K M F P S T W Y V\n- if (c>='a' && c<='z') c+='A'-'a';\n- switch (c)\n- {\n- case 'A': return 0;\n- case 'R': return 1;\n- case 'N': return 2;\n- case 'D': return 3;\n- case 'C': return 4;\n- case 'Q': return 5;\n- case 'E': return 6;\n- case 'G': return 7;\n- case 'H': return 8;\n- case 'I': return 9;\n- case 'L': return 10;\n- case 'K': return 11;\n- case 'M': return 12;\n- case 'F': return 13;\n- case 'P': return 14;\n- case 'S': return 15;\n- case 'T': return 16;\n- case 'W': return 17;\n- case 'Y': return 18;\n- case 'V': return 19;\n- case 'X': return ANY;\n- case 'J': return ANY;\n- case 'O': return ANY;\n- case 'U': return 4; //Selenocystein -> Cystein\n- case 'B': return 3; //D (or N)\n- case 'Z': return 6; //E (or Q)\n- case '-': return GAP;\n- case '.': return GAP;\n- case '_': return GAP;\n- }\n- if (c>=0 && c<=32) return -1; // white space and control characters\n- return -2;\n-}\n-\n-///////////////////////////////////////////////////////////////////////////////\n-/**\n- * @brief Transforms integers between 0 and 22 into the one-letter amino acid code\n- */\n-inline char \n-i2aa(char c)\n-{\n- //A R N D C Q E G H I L K M F P S T W Y V\n- switch (c)\n- {\n- case 0: return 'A';\n- case 1: return 'R';\n- case 2: return 'N';\n- case 3: return 'D';\n- case 4: return 'C';\n- case 5: return 'Q';\n- case 6: return 'E';\n- case 7: return 'G';\n- case 8: return 'H';\n- case 9: return 'I';\n- case 10: return 'L';\n- case 11: return 'K';\n- case 12: return 'M';\n- case 13: return 'F';\n- case 14: return 'P';\n- case 15: return 'S';\n- case 16: return 'T';\n- case 17: return 'W';\n- case 18: return 'Y';\n- case 19: return 'V';\n- case ANY: return 'X';\n- case GAP: return '-';\n- case ENDGAP: return '-';\n- }\n- return '?';\n-}\n-\n-//////////////////////////////////////////////////////////////////////////////\n-/**\n- * @brief Transforms the dssp/psipred secondary structure code into an integer number\n- */\n-inline char \n-ss2i(char c)\n-{\n- //- H E C S T G B\n- if (c>='a' && c<='z') c+='A'-'a';\n- switch (c)\n- {\n- case '.': return 0;\n- case '-': return 0;\n- case 'X': return 0;\n- case 'H': return 1;\n- case 'E': return 2;\n- case 'C': return 3;\n- case '~': return 3;\n- case 'S': return 4;\n- case 'T': return 5;\n- case 'G': return 6;\n- case 'B': return 7;\n- case 'I': return 3;\n- case "..b'=1.0f; // default values for substitution matrix pseudocounts \n- par.pcbV=1.5f; // significant reduction of pcs by Neff_M starts around Neff_M-1=pcb\n- par.pccV=1.0f; // pcs are reduced prop. to 1/Neff^pcc\n- par.pcwV=0.0f; // wc>0 weighs columns according to their intra-clomun similarity\n-\n- par.gapbV=1.0; // default values for transition pseudocounts\n- par.gapdV=0.15; // gap open penalty pseudocount; 0.25 corresponds to 7.1*gapf bits\n- par.gapeV=1.0; // gap extension penalty pseudocount\n- par.gapfV=0.6; // factor for increasing gap open penalty for deletes\n- par.gapgV=0.6; // factor for increasing gap open penalty for inserts\n- par.gaphV=0.6; // factor for increasing gap extension penalty for deletes\n- par.gapiV=0.6; // factor for increasing gap extension penalty for inserts\n-#endif\n-\n- par.ssm=2; // ss scoring mode: 0:no ss score 1:score after alignment 2:score during alignment\n- par.ssw=0.11f; // weight of ss scoring\n- par.ssa=1.0f; // weight of ss evolution matrix\n- par.shift=-0.01f; // Shift match score up \n- par.mact=0.3001f; // Score threshold for MAC alignment in local mode (set to 0.5001 to track user modification)\n- par.corr=0.1f; // Weight of correlations of scores for |i-j|<=4\n- par.wstruc=1.0f; // Weight of structure scores\n-\n- par.egq=0.0f; // no charge for end gaps as default\n- par.egt=0.0f; // no charge for end gaps as default\n-\n- par.trans=0; // no transitive scoring as default\n- par.Emax_trans=100.0f; // use intermediate HMMs with E-values up to 100 between query and database HMM\n- par.Emax_trans=100.0f; // use intermediate HMMs with E-values up to 100 between query and database HMM\n- par.wtrans=1.0f; // Ztot[k] = Zq[k] + wtrans * (Zforward[k]+Zreverse[k])\n- par.ssgap=0; // 1: add secondary structure-dependent gap penalties 0:off\n- par.ssgapd=1.0f; // secondary structure-dependent gap-opening penalty (per residue)\n- par.ssgape=0.0f; // secondary structure-dependent gap-extension penalty (per residue)\n- par.ssgapi=4; // max. number of inside-integer(ii); gap-open-penalty= -ii*ssgapd\n-\n- par.loc=1; // local vs. global alignment as default\n- par.altali=2; // find up to two (possibly overlapping) subalignments \n- par.forward=0; // 0: Viterbi algorithm; 1: Viterbi+stochastic sampling; 3:Maximum Accuracy (MAC) algorithm\n- par.realign=1; // realign with MAC algorithm\n-\n- par.repmode=0; // repeats score independently of one another\n- par.columnscore=1; // Default column score is 1: null model pnul = 1/2 * (q_av(a)+p_av(a))\n- par.min_overlap=0; // automatic minimum overlap used\n- par.opt=0; // Default = optimization mode off\n- par.readdefaultsfile=0; // Default = do not read a defaults file ./.hhdefaults or HOME/.hhdefaults\n- par.maxdbstrlen=200; // maximum length of database string to be printed in \'Command\' line of hhr file\n- par.mode=0;\n- par.idummy=par.jdummy=0; //\n-\n- par.notags=1; // neutralize His-tags, FLAG-tags, C-myc-tags\n-\n- // Initialize strings\n- strcpy(par.infile,"stdin");\n- strcpy(par.outfile,"");\n- strcpy(par. pairwisealisfile,"");\n- strcpy(par.buffer,"buffer.txt"); \n- strcpy(par.scorefile,""); \n- strcpy(par.wfile,""); \n- strcpy(par.alnfile,""); \n- strcpy(par.hhmfile,""); \n- strcpy(par.psifile,""); \n- par.exclstr=NULL; \n-\n-#if 0 /* read parameter file from home-dir */\n-#include "hhutil-C-help.h"\n-#endif /* read parameter file from home-dir */\n-\n- return;\n-} /** this is the end of SetDefaults() **/\n-\n-/*\n- * EOF hhutil-C.h\n- */\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/hhalign/list-C.h --- a/clustalomega/clustal-omega-0.2.0/src/hhalign/list-C.h Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
b'@@ -1,600 +0,0 @@\n-/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n-\n-/*********************************************************************\n- * Clustal Omega - Multiple sequence alignment\n- *\n- * Copyright (C) 2010 University College Dublin\n- *\n- * Clustal-Omega is free software; you can redistribute it and/or\n- * modify it under the terms of the GNU General Public License as\n- * published by the Free Software Foundation; either version 2 of the\n- * License, or (at your option) any later version.\n- *\n- * This file is part of Clustal-Omega.\n- *\n- ********************************************************************/\n-\n-/*\n- * RCS $Id: list-C.h 143 2010-10-14 13:11:14Z andreas $\n- */\n-\n-// list.C\n-// Class for double-linked list \n-\n-\n-\n-#ifndef JLIST\n-#define JLIST\n-\n-#ifndef MAIN\n-#include <iostream> // cin, cout\n-#include <stdlib.h> // \n-#include <stdio.h> // \n-using std::cout;\n-using std::cerr;\n-#endif\n-\n-#include "list.h"\n-\n-////////////////////////////////////////////////////////////////////////////\n-// Double-linked list implementation with head and tail dummy elements\n-// We set head->prev=head and tail->next=tail.\n-// This makes sure that repeated current=current->next; ends up in tail\n-// and repeated current=current->prev; ends up in head.\n-// head and tail optionally contain a NULL element of Typ defined by method Null(Typ)\n-////////////////////////////////////////////////////////////////////////////\n-\n-\n-\n-////////////////////////////////////////////////////////////////////////////\n-// Constructors and destructor\n-\n-////////////////////////////////////////////////////////////////////////////\n-// Creates empty List with two dummy elements\n-////////////////////////////////////////////////////////////////////////////\n-template <class Typ> \n-List<Typ>::List()\n-{\n- head=new ListEl<Typ>();\n- if (!head) { cerr<<"Could not create new element\\n"; return; }\n- tail=new ListEl<Typ>(head,NULL);\n- if (!tail) { cerr<<"Could not create new element\\n"; return; }\n- tail->next = tail;\n- head->prev = head;\n- head->next = tail;\n- current = head;\n- size=0;\n-}\n-\n-////////////////////////////////////////////////////////////////////////////\n-// Creates List with one element \n-////////////////////////////////////////////////////////////////////////////\n-template <class Typ> \n-List<Typ>::List(Typ d)\n-{\n- head=new ListEl<Typ>();\n- if (!head) { cerr<<"Could not create new element\\n"; return; }\n- tail=new ListEl<Typ>();\n- if (!tail) { cerr<<"Could not create new element\\n"; return; }\n- ListEl<Typ>* el = new ListEl<Typ>(d,head,tail);\n- if (!el) { cerr<<"Could not create new element\\n"; return; }\n- head->prev = head;\n- head->next = el;\n- tail->prev = el;\n- tail->next = tail;\n- current = head;\n- size=1;\n-}\n-\n-////////////////////////////////////////////////////////////////////////////\n-// Destructor deletes List object\n-////////////////////////////////////////////////////////////////////////////\n-template <class Typ> \n-List<Typ>::~List()\n-{\n- ListEl<Typ>* n=head->next;\n- while(head!=n)\n- {\n- delete(head); head = NULL;\n- head=n;\n- n=head->next;\n- }\n- delete(head); head = NULL;\n-}\n-\n-////////////////////////////////////////////////////////////////////////////\n-// Flat copy\n-////////////////////////////////////////////////////////////////////////////\n-template <class Typ> \n-List<Typ>& List<Typ>::operator=(List<Typ>& l)\n-{\n- head = l.head;\n- tail = l.tail;\n- current = l.current;\n- size = l.size;\n-}\n-\n-\n-////////////////////////////////////////////////////////////////////////////\n-// Reverse order of list\n-////////////////////////////////////////////////////////////////////////////\n-template <class Typ> \n-void List<Typ>::Reverse()\n-{\n- ListEl<Typ> *n; // next list element; also for swapping\n- ListEl<Typ> *c; // current element to be sorted in. Everything to the left is already sorted\n- if (Size()<=1) return;\n- for (c=head; c!=tail; c=n)\n- {\n- // Swap prev a'..b'ot < r->data); \n- do l=l->next; while (l->data < pivot);\n- if (l==r || l->prev==r) break;\n- SwapContent(l,r);\n- }\n- SortList(left,r,sz0);\n- SortList(r->next,right,sz-sz0);\n- pivot = tail->data; // to avoid calling the destructor of Typ on some real data element\n- }\n-\n-////////////////////////////////////////////////////////////////////////////\n-// Use QUICKSORT to sort list of POINTERS by comparing the objects the pointers point to\n-////////////////////////////////////////////////////////////////////////////\n-template <class Typ> \n-void List<Typ>::SortPointerList(ListEl<Typ>* left, ListEl<Typ>* right) \n-{\n- if (right==left || right->next==left) return;\n- ListEl<Typ> *l=left->prev, *r=right->next;\n- Typ pivot=left->data;\n-// cout<<"Sorting between "<<left->data<<" and "<<right->data<<". Pivot="<<pivot<<endl;\n- while(1)\n- {\n-// PrintList();\n- do\n-\t{\n-\t r=r->prev;\n-// \t cout<<"r=r->prev. r->data="<<r->data<<endl;\n-\t} while(*pivot < *(r->data)); \n- do\n-\t{\n-\t l=l->next;\n-// \t cout<<"l=l->next l->data="<<l->data<<endl;\n-\t} while (*(l->data) < *pivot);\n- if (l==r || l->prev==r) break;\n- SwapContent(l,r);\n- }\n- SortPointerList(left,r);\n- SortPointerList(r->next,right);\n-}\n-\n-// Use INSERTSORT to sort list in asscending order between two list elements. Use only for presorted lists, otherwise time O(N^2)!\n-template <class Typ> \n-void List<Typ>::ResortList() \n-{\n- ListEl<Typ> *c; // current element to be sorted in. Everything to the left is already sorted\n- ListEl<Typ> *n; // next element to be sorted in\n- ListEl<Typ> *p; // pointer for looping through sorted part of list\n- ListEl<Typ> *pnext; // for swapping\n- if (Size()<=1) return;\n- c=head->next->next;\n- while (c!=tail) \n- {\n- p=c->prev;\n- n=c->next;\n- if (c->data < p->data)\n-\t{\n-\t do {p=p->prev;} while (p!=head && c->data < p->data);\n-\t // Connect c->prev to c->next ...\n-\t c->next->prev=c->prev;\n-\t c->prev->next=c->next;\n-\t // ... and insert c between p and p->next ...\n-\t pnext=p->next;\n-\t p->next=c;\n-\t c->next=pnext;\n-\t pnext->prev=c;\n-\t c->prev=p;\n-\t}\n- c=n;\n- }\n-}\n-\n-\n-#endif /* JLIST */\n-\n-\n-// //Main program: test class List\n-\n-// int main()\n-// {\n-// int p;\n-// List<int>* plist=new List<int>(11);\n-// List<int> list(22);\n-\n-// plist->Push(24);\n-// plist->Push(18);\n-// plist->Push(3);\n-// plist->Enqueue(17);\n-// plist->Enqueue(29);\n-// printf("List 1 with pushed and enqueued elements:\\n");\n-// plist->PrintList();\n-\n-// list.Push(222);\n-// printf("List 1 with list 2 appended:\\n");\n-// plist->Append(&list);\n-// plist->PrintList();\n-\n-// printf("Pushing one element three times into list 2:\\n");\n-// list.Push(333);\n-// list.Push(444);\n-// list.Push(555);\n-// printf("Printing plist and list with three elements:\\n");\n-// list.PrintList();\n-// plist->PrintList();\n- \n-// printf("list.Copy(plist). Printing list 1 and 2:\\n");\n-// list.Copy(plist);\n-// plist->PrintList(); \n-// list.PrintList();\n-\n-// printf("Appending list 1 to itself:\\n");\n-// plist->Append(plist);\n-// plist->PrintList();\n-\n-// cout<<"Popping "<<plist->Pop()<<"\\n";\n-// cout<<"Popping "<<plist->Pop()<<"\\n";\n-// plist->PrintList();\n-\n-// cout<<"Dequeing "<<plist->Dequeue()<<"\\n";\n-// cout<<"Dequeing "<<plist->Dequeue()<<"\\n";\n-// plist->PrintList();\n-\n-// cout<<"Reversing list\\n";\n-// plist->Reverse();\n-// plist->PrintList();\n-\n-// cout<<"Reversing to original list\\n";\n-// plist->Reverse();\n-// plist->PrintList();\n-\n-// for (p=plist->Reset(); p>=5;p--)\n-// {cout<<plist->GetPos()<<": "<<plist->Read(p)<<"\\n";}\n- \n-// cout<<"Deleting "<<plist->Delete()<<"\\n";\n-// cout<<"Deleting "<<plist->Delete()<<"\\n";\n-// plist->PrintList();\n-\n-// plist->Append(plist);\n-// plist->PrintList();\n-// cout<<"List 1 sorted:\\n";\n-// plist->SortList();\n-// plist->PrintList();\n-\n-// }\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/hhalign/list.h --- a/clustalomega/clustal-omega-0.2.0/src/hhalign/list.h Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,193 +0,0 @@ -/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ - -/********************************************************************* - * Clustal Omega - Multiple sequence alignment - * - * Copyright (C) 2010 University College Dublin - * - * Clustal-Omega is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This file is part of Clustal-Omega. - * - ********************************************************************/ - -/* - * RCS $Id: list.h 143 2010-10-14 13:11:14Z andreas $ - */ - -// list.h - - -////////////////////////////////////////////////////////////////////////////// -// Double-linked list implementation with head and tail dummy elements -// We set head->prev=head and tail->next=tail. -// This makes sure that repeated current=current->next; ends up in tail -// and repeated current=current->prev; ends up in head. -// head and tail optionally contain a NULL element of Typ defined by method Null(Typ) -////////////////////////////////////////////////////////////////////////////// - -template<class Typ> -class List -{ -protected: -template<class Typ1> -class ListEl //elements of List; essentially a data structure - { - public: - Typ1 data; //Typ is type of data to be stored in list - ListEl* prev; //points to previous list element - ListEl* next; //points to next list element - ListEl() : prev(0), next(0) {} - ListEl(Typ1 d) : data(d), prev(0), next(0) {} - ListEl(ListEl* p, ListEl* n) : prev(p), next(n) {} - ListEl(Typ1 d, ListEl* p, ListEl* n) : data(d), prev(p), next(n) {} - }; - - ListEl<Typ>* head; //points to dummy element at beginning of list - ListEl<Typ>* tail; //points to dummy element at end of list - ListEl<Typ>* current; //current element position within list - int size; //Number of elements in list - - // Use QUICKSORT to sort list in asscending order between two list elements - void SortList(ListEl<Typ>*, ListEl<Typ>*, int); - // Use QUICKSORT to sort list of pointers by comparing elements they point to - void SortPointerList(ListEl<Typ>*, ListEl<Typ>*); - - // Swap two list elements by making a flat copy (don't need two copies of data) - // Warning: Gets slow if Typ is composite type with many variables (>=5) - void SwapContent(ListEl<Typ>* e1, ListEl<Typ>* e2) - { Typ d; if (e1!=e2) {d=e1->data; e1->data=e2->data; e2->data=d;} } - -public: -////////////////////////////////////////////////////////////////////////////// -// General methods - List(); - List(Typ d); - ~List(); - List<Typ>& operator=(List<Typ>&); - - // Set Null element that will be returned when trying to read from an empty list - void Null(Typ null) {head->data = tail->data = null;} - - -////////////////////////////////////////////////////////////////////////////// -// Methods that act at the end of the list - - // Insert Element after LAST element of list (and return address of data element) - Typ* Push(Typ); - - // Remove and return LAST element of list. Returns head->data if list empty - Typ Pop(); - - // return LAST element of list. Returns null element in head->data if list empty - Typ ReadLast() {return tail->prev->data;} - - -////////////////////////////////////////////////////////////////////////////// -// Methods that act at the beginning of the list - - // Insert element as FIRST element of list (and return address of data element) - Typ* Enqueue(Typ); - - // Remove and return element at BEGINNING of list. Returns head->data if list empty - Typ Dequeue(); - - // return FIRST element of list. Returns null element in head->data if list empty - Typ ReadFirst() {if (size) return head->next->data; else return head->data;} - - -////////////////////////////////////////////////////////////////////////////// -// Methods that work with 'current' position in the list - - // Advances current position by 1 and reads next element; returns head->data if at end of list. - Typ ReadNext(); - - // Reads current element again - Typ ReadCurrent(); - - // Moves current position back by 1 and reads previous element; returns head->data if at beginning of list. - Typ ReadPrevious(); - - // Advances current position by 1 and reads address of next element; returns NULL if at end of list. - Typ* ReadNextAddress(); - - // Reads address of current element again, returns NULL if at end of list - Typ* ReadCurrentAddress(); - - // Sets current position to k and reads k'th element (first=1). Returns head->data if current points to no data element - Typ Read(int); - - // Inserts element AFTER CURRENT element; current element will be set to inserted element - void Insert(Typ); - - // Removes and returns element at CURRENT position. New position is one BEFORE current position. - // Returns head->data if current points to no data element. After Reset() delete first element (not 0'th) - Typ Delete(); - - // Overwrites data at current position with new data - void Overwrite(Typ d) {current->data=d;} - - // Reset current position to 0 (one BEFORE the first) - int Reset() {current = head; return size;} - - // Reset current position to End (one AFTER the last) - int SetToEnd() {current = tail; return size;} - - -////////////////////////////////////////////////////////////////////////////// -// Methods that return information about the list - - // Return number of list elements (size>=0) - int Size() {return size;} - - // return true if end of list, i.e. ReadNext would give tail->data (i.e. current position >= Size) - char End() {return (current==tail || current==tail->prev);} - char End(void* curr) {return ( curr == tail || curr == tail->prev);} - - // return true if start of list, i.e. ReadPrevious would give head->data (i.e. current position <=1) - char Start() {return (current==head || current==head->next);} - - // Get current position within list (0 <= pos <= Size+1) - int GetPos(); - - //print out list (elements assumed int) - void PrintList(); - - // Get largest data element (Null element for empty list) - Typ Largest(); - - // Get smallest data element (Null element for empty list) - Typ Smallest(); - -////////////////////////////////////////////////////////////////////////////// -// Methods that manipulate the list as a whole - - // Reverse list - void Reverse(); - - // Copies list into list object - void Copy(List<Typ>* list); - - // Appends a copy of list to class object - void AppendCopy(List<Typ>* list); - - // Appends list to class object list - void Append(List<Typ>* list); - - // Use QUICKSORT to sort list in ascending order. Use only for UNSORTED lists, otherwise time O(N^2) instead of O(N*log(N)) -/* void SortList() {if (size>1) SortList(head->next, tail->prev);} */ - void SortList() {if (size>1) SortList(head->next, tail->prev, size);} - void QuickSort() {if (size>1) SortList(head->next, tail->prev, size);} - - // Use QUICKSORT to sort list of pointers in ascending order. Use only for UNSORTED lists, otherwwise time O(N^2)! - void SortPointerList() {if (size>1) SortPointerList(head->next, tail->prev);} - void QuickSortPointer() {if (size>1) SortPointerList(head->next, tail->prev);} - - // Use INSERTSORT to sort list in asscending order. Use only for PRESORTED lists, otherwise time O(N^2)! - void ResortList(); -}; - - |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/hhalign/util-C.h --- a/clustalomega/clustal-omega-0.2.0/src/hhalign/util-C.h Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,879 +0,0 @@\n-/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n-\n-/*********************************************************************\n- * Clustal Omega - Multiple sequence alignment\n- *\n- * Copyright (C) 2010 University College Dublin\n- *\n- * Clustal-Omega is free software; you can redistribute it and/or\n- * modify it under the terms of the GNU General Public License as\n- * published by the Free Software Foundation; either version 2 of the\n- * License, or (at your option) any later version.\n- *\n- * This file is part of Clustal-Omega.\n- *\n- ********************************************************************/\n-\n-/*\n- * RCS $Id: util-C.h 155 2010-11-17 12:18:47Z fabian $\n- */\n-\n-// Utility subroutines\n-\n-\n-#ifndef MAIN\n-#include <iostream> // cin, cout, cerr\n-#include <fstream> // ofstream, ifstream \n-#include <cstdio> // printf\n-#include <stdlib.h> // exit\n-#include <time.h> // clock\n-#endif\n-#include <sys/time.h>\n-\n-/////////////////////////////////////////////////////////////////////////////////////\n-// Arithmetics\n-/////////////////////////////////////////////////////////////////////////////////////\n-\n-//// max and min\n-inline double dmax(double x, double y) { return (x>y? x : y);}\n-inline double dmin(double x, double y) { return (x<y? x : y);}\n-inline int imax(int x, int y) { return (x>y? x : y);}\n-inline int imin(int x, int y) { return (x<y? x : y);}\n-inline int iabs(int x) { return (x>=0? x : -x);}\n-\n-// Rounding up, rounding down and rounding to nearest integer\n-inline int iceil(double x) {return int(ceil(x));}\n-inline int ifloor(double x) {return int(floor(x));}\n-inline int iround(double x) {return int(floor(x+0.5));}\n-\n-//// Generalized mean: d=0: sqrt(x*y) d=1: (x+y)/2 d->-inf: min(x,y) d->+inf: max(x,y) \n-inline double fmean(double x, double y, double d) { return pow( (pow(x,d)+pow(y,d))/2 ,1./d);}\n-\n-// log base 2\n-inline float log2(float x) {return (x<=0? (float)(-100000):1.442695041*log(x));}\n-inline float log10(float x) {return (x<=0? (float)(-100000):0.434294481*log(x));}\n-\n-\n-/////////////////////////////////////////////////////////////////////////////////////\n-// fast log base 2\n-/////////////////////////////////////////////////////////////////////////////////////\n-\n-// This function returns log2 with a max abolute deviation of +/- 1.5E-5 (typically 0.8E-5). \n-// It takes 1.42E-8 s whereas log2(x) takes 9.5E-7 s. It is hence 9.4 times faster. \n-// It makes use of the representation of 4-byte floating point numbers:\n-// seee eeee emmm mmmm mmmm mmmm mmmm mmmm\n-// s is the sign, \n-// the following 8 bits, eee eee e, give the exponent + 127 (in hex: 0x7f).\n-// The following 23 bits, m, give the mantisse, the binary digits behind the decimal point.\n-// In summary: x = (-1)^s * 1.mmmmmmmmmmmmmmmmmmmmmm * 2^(eeeeeee-127) \n-// The expression (((*(int *)&x) & 0x7f800000 ) >>23 )-0x7f is the exponent eeeeeeee, i.e. \n-// the largest integer that is smaller than log2(x) (e.g. -1 for 0.9). *(int *)&x is an integer which \n-// contains the bytes as the floating point variable x is represented in memory.\n-// Check: assert( sizeof(f) == sizeof(int) );\n-// Check: assert( sizeof(f) == 4 );\n-inline float fast_log2(float x) \n-{\n- static float lg2[1025]; // lg2[i] = log2[1+x/1024]\n- static float diff[1025]; // diff[i]= (lg2[i+1]-lg2[i])/8096 (for interpolation)\n- static char initialized;\n- if (x<=0) return -100000;\n- if (!initialized) //First fill in the arrays lg2[i] and diff[i]\n- {\n- float prev = 0.0f;\n- lg2[0] = 0.0f;\n- for (int i=1; i<=1024; ++i) \n-\t{\n-\t lg2[i] = log(float(1024+i))*1.442695041-10.0f;\n-\t diff[i-1] = (lg2[i]-prev)*1.2352E-4;\n-\t prev = lg2[i];\n-\t}\n- initialized=1;\n- } \n- int a = (((*((int *)&x)) & 0x7F800000) >>23 )-0x7f;\n- int b = ((*((int *)&x)) & 0x007FE000) >>13;\n- int c = ((*((int *)&x)) & 0x00001FFF);\n- return a + lg2[b] + diff[b]*(float)(c);\n-}\n-\n-/////////////////////////////////////////'..b' char* ptr;\n- char chr;\n-#ifdef WINDOWS\n- ptr=strrchr(filename,92); //return adress for LAST \\ (backslash) in name\n-#else\n- ptr=strrchr(filename,\'/\'); //return adress for LAST / in name\n-#endif\n- if (ptr) {chr=*(++ptr); *ptr=\'\\0\'; strcpy(pathname,filename); *ptr=chr;} else *pathname=\'\\0\';\n- return pathname;\n-}\n-\n-// Swaps two integer elements in array k\n-inline void swapi(int k[], int i, int j)\n-{\n- int temp;\n- temp=k[i]; k[i]=k[j]; k[j]=temp;\n-}\n-\n-// QSort sorting routine. time complexity of O(N ln(N)) on average\n-// Sorts the index array k between elements i=\'left\' and i=\'right\' in such a way that afterwards \n-// v[k[i]] is sorted downwards (up=-1) or upwards (up=+1)\n-void QSortInt(int v[], int k[], int left, int right, int up=+1)\n-{\n- int i; \n- int last; // last element to have been swapped\n- \n- if (left>=right) return; // do nothing if less then 2 elements to sort\n- // Put pivot element in the middle of the sort range to the side (to position \'left\') ...\n- swapi(k,left,(left+right)/2); \n- last=left; \n- // ... and swap all elements i SMALLER than the pivot \n- // with an element that is LARGER than the pivot (element last+1):\n- if (up==1)\n- {\n- for (i=left+1; i<=right; i++)\n-\tif (v[k[i]]<v[k[left]]) swapi(k,++last,i);\n- }\n- else\n- for (i=left+1; i<=right; i++)\n- if (v[k[i]]>v[k[left]]) swapi(k,++last,i);\n-\n- // Put the pivot to the right of the elements which are SMALLER, left to elements which are LARGER\n- swapi(k,left,last);\n-\n- // Sort the elements left from the pivot and right from the pivot\n- QSortInt(v,k,left,last-1,up);\n- QSortInt(v,k,last+1,right,up);\n-}\n-\n-// QSort sorting routine. time complexity of O(N ln(N)) on average\n-// Sorts the index array k between elements i=\'left\' and i=\'right\' in such a way that afterwards \n-// v[k[i]] is sorted downwards (up=-1) or upwards (up=+1)\n-void QSortFloat(float v[], int k[], int left, int right, int up=+1)\n-{\n- int i; \n- int last; // last element to have been swapped\n- void swapi(int k[], int i, int j);\n- \n- if (left>=right) return; // do nothing if less then 2 elements to sort\n- // Put pivot element in the middle of the sort range to the side (to position \'left\') ...\n- swapi(k,left,(left+right)/2); \n- last=left; \n- // ... and swap all elements i SMALLER than the pivot \n- // with an element that is LARGER than the pivot (element last+1):\n- if (up==1)\n- {\n- for (i=left+1; i<=right; i++)\n- if (v[k[i]]<v[k[left]]) swapi(k,++last,i);\n- }\n- else\n- for (i=left+1; i<=right; i++)\n- if (v[k[i]]>v[k[left]]) swapi(k,++last,i);\n-\n- // Put the pivot to the right of the elements which are SMALLER, left to elements which are LARGER\n- swapi(k,left,last);\n-\n- // Sort the elements left from the pivot and right from the pivot\n- QSortFloat(v,k,left,last-1,up);\n- QSortFloat(v,k,last+1,right,up);\n-}\n-\n-/**\n- * @brief comparison function for qsort,\n- * sorts floating point numbers ascendingly\n- *\n- * @param cv1 ponter to 1st entry to be sorted\n- * @param cv2 ponter to 2nd entry to be sorted\n- *\n- * @return 0 if entries are equal,\n- * +/-1 if 1st greater/smaller than 2nd\n- */\n-int CompFltAsc(const void *cv1, const void *cv2){\n-\n- float f1 = *(float *)cv1;\n- float f2 = *(float *)cv2;\n-\n- if (f1 > f2) { return +1; }\n- else if (f1 < f2) { return -1; }\n- else { return 0; }\n-\n-} /* this is the end of CompFltAsc() */\n-\n-//Return random number in the range [0,1]\n-inline float frand() { return rand()/(RAND_MAX+1.0); }\n-\n-\n-/////////////////////////////////////////////////////////////////////////////////////\n-//// Execute system command\n-/////////////////////////////////////////////////////////////////////////////////////\n-void runSystem(std::string cmd, int v = 2)\n-{\n- if (v>2)\n- cout << "Command: " << cmd << "!\\n";\n- int res = system(cmd.c_str());\n- if (res!=0) \n- {\n- cerr << endl << "ERROR when executing: " << cmd << "!\\n";\n- exit(1);\n- }\n- \n-}\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/kmpp/KMeans.cpp --- a/clustalomega/clustal-omega-0.2.0/src/kmpp/KMeans.cpp Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,214 +0,0 @@\n-// See KMeans.h\r\n-//\r\n-// Author: David Arthur (darthur@gmail.com), 2009\r\n-\r\n-// Includes\r\n-\r\n-#ifdef CLUSTALO\r\n-/* previously in KMeans.h */\r\n-#include "KmUtils.h"\r\n-#include <iostream>\r\n-#include <stdio.h>\r\n-\r\n-// Sets preferences for how much logging is done and where it is outputted, when k-means is run.\r\n-void ClearKMeansLogging();\r\n-void AddKMeansLogging(std::ostream *out, bool verbose);\r\n-\r\n-/*\r\n-// Runs k-means++ on the given set of points. Set RunKMeans for info on the parameters.\r\n-*/\r\n-Scalar\r\n-RunKMeansPlusPlus(int n, int k, int d, Scalar *points, int attempts,\r\n- Scalar *centers, int *assignments);\r\n-\r\n-Scalar\r\n-RunKMeans(int n, int k, int d, Scalar *points, int attempts,\r\n- Scalar *centers, int *assignments);\r\n-#else\r\n-#include "KMeans.h"\r\n-#endif\r\n-#include "KmTree.h"\r\n-#include <sstream>\r\n-#include <time.h>\r\n-#include <vector>\r\n-\r\n-#ifdef CLUSTALO\r\n-extern "C" double\r\n-KMeans(int n, int k, int d, Scalar *points, int attempts, int use_lloyds_method,\r\n- double *centers, int *assignments)\r\n-{\r\n- if (use_lloyds_method) {\r\n- /*fprintf(stderr, "FIXME using LLoyd\'s method\\n");*/\r\n- return RunKMeans(n, k, d, points, attempts,\r\n- centers, assignments);\r\n- } else {\r\n- /*fprintf(stderr, "FIXME using KMeansPP method\\n");*/\r\n- return RunKMeansPlusPlus(n, k, d, points, attempts,\r\n- centers, assignments);\r\n- }\r\n-}\r\n-#endif\r\n-\r\n-using namespace std;\r\n-\r\n-// Logging\r\n-static vector<ostream*> gLogOutputs;\r\n-static vector<ostream*> gVerboseLogOutputs;\r\n-#define LOG(verbose, text) { \\\r\n- vector<ostream*> &outputs = (verbose? gVerboseLogOutputs : gLogOutputs); \\\r\n- if (outputs.size() > 0) { \\\r\n- ostringstream string_stream; \\\r\n- string_stream << text; \\\r\n- for (int i = 0; i < (int)outputs.size(); i++) \\\r\n- *(outputs[i]) << string_stream.str(); \\\r\n- } \\\r\n-}\r\n-void AddKMeansLogging(std::ostream *out, bool verbose) {\r\n- if (verbose)\r\n- gVerboseLogOutputs.push_back(out);\r\n- gLogOutputs.push_back(out);\r\n-}\r\n-void ClearKMeansLogging() {\r\n- gLogOutputs.clear();\r\n- gVerboseLogOutputs.clear();\r\n-}\r\n-\r\n-// Returns the number of seconds since the program began execution.\r\n-static double GetSeconds() {\r\n- return double(clock()) / CLOCKS_PER_SEC;\r\n-}\r\n-\r\n-// See KMeans.h\r\n-// Performs one full execution of k-means, logging any relevant information, and tracking meta\r\n-// statistics for the run. If min or max values are negative, they are treated as unset.\r\n-// best_centers and best_assignment can be 0, in which case they are not set.\r\n-static void RunKMeansOnce(const KmTree &tree, int n, int k, int d, Scalar *points, Scalar *centers,\r\n- Scalar *min_cost, Scalar *max_cost, Scalar *total_cost,\r\n- double start_time, double *min_time, double *max_time,\r\n- double *total_time, Scalar *best_centers, int *best_assignment) {\r\n- const Scalar kEpsilon = Scalar(1e-8); // Used to determine when to terminate k-means\r\n-\r\n- // Do iterations of k-means until the cost stabilizes\r\n- Scalar old_cost = 0;\r\n- bool is_done = false;\r\n- for (int iteration = 0; !is_done; iteration++) {\r\n- Scalar new_cost = tree.DoKMeansStep(k, centers, 0);\r\n- is_done = (iteration > 0 && new_cost >= (1 - kEpsilon) * old_cost);\r\n- old_cost = new_cost;\r\n- LOG(true, "Completed iteration #" << (iteration+1) << ", cost=" << new_cost << "..." << endl);\r\n- }\r\n- double this_time = GetSeconds() - start_time;\r\n-\r\n- // Log the clustering we found\r\n- LOG(false, "Completed run: cost=" << old_cost << " (" << this_time <'..b'cost < 0 || old_cost < *min_cost) {\r\n- *min_cost = old_cost;\r\n- if (best_assignment != 0)\r\n- tree.DoKMeansStep(k, centers, best_assignment);\r\n- if (best_centers != 0)\r\n- memcpy(best_centers, centers, sizeof(Scalar)*k*d);\r\n- }\r\n-\r\n- // Update all other aggregate stats\r\n- if (*max_cost < old_cost) *max_cost = old_cost;\r\n- *total_cost += old_cost;\r\n- if (*min_time < 0 || *min_time > this_time)\r\n- *min_time = this_time;\r\n- if (*max_time < this_time) *max_time = this_time;\r\n- *total_time += this_time;\r\n-}\r\n-\r\n-// Outputs all meta-stats for a set of k-means or k-means++ runs.\r\n-void LogMetaStats(Scalar min_cost, Scalar max_cost, Scalar total_cost,\r\n- double min_time, double max_time, double total_time, int num_attempts) {\r\n- LOG(false, "Aggregate info over " << num_attempts << " runs:" << endl);\r\n- LOG(false, " Cost: min=" << min_cost << " average=" << (total_cost / num_attempts)\r\n- << " max=" << max_cost << endl);\r\n- LOG(false, " Time: min=" << min_time << " average=" << (total_time / num_attempts)\r\n- << " max=" << max_time << endl << endl);\r\n-}\r\n-\r\n-// See KMeans.h\r\n-Scalar RunKMeans(int n, int k, int d, Scalar *points, int attempts,\r\n- Scalar *ret_centers, int *ret_assignment) {\r\n- KM_ASSERT(k >= 1);\r\n- \r\n- // Create the tree and log\r\n- LOG(false, "Running k-means..." << endl);\r\n- KmTree tree(n, d, points);\r\n- LOG(false, "Done preprocessing..." << endl);\r\n-\r\n- // Initialization\r\n- Scalar *centers = (Scalar*)malloc(sizeof(Scalar)*k*d);\r\n- int *unused_centers = (int*)malloc(sizeof(int)*n);\r\n- KM_ASSERT(centers != 0 && unused_centers != 0);\r\n- Scalar min_cost = -1, max_cost = -1, total_cost = 0;\r\n- double min_time = -1, max_time = -1, total_time = 0;\r\n- \r\n- // Handle k > n\r\n- if (k > n) {\r\n- memset(centers + n*d, -1, (k-d)*sizeof(Scalar));\r\n- k = n;\r\n- }\r\n-\r\n- // Run all the attempts\r\n- for (int attempt = 0; attempt < attempts; attempt++) {\r\n- double start_time = GetSeconds();\r\n-\r\n- // Choose centers uniformly at random\r\n- for (int i = 0; i < n; i++)\r\n- unused_centers[i] = i;\r\n- int num_unused_centers = n;\r\n- for (int i = 0; i < k; i++) {\r\n- int j = GetRandom(num_unused_centers--);\r\n- memcpy(centers + i*d, points + unused_centers[j]*d, d*sizeof(Scalar));\r\n- unused_centers[j] = unused_centers[num_unused_centers];\r\n- }\r\n- \r\n- // Run k-means\r\n- RunKMeansOnce(tree, n, k, d, points, centers, &min_cost, &max_cost, &total_cost, start_time,\r\n- &min_time, &max_time, &total_time, ret_centers, ret_assignment);\r\n- }\r\n- LogMetaStats(min_cost, max_cost, total_cost, min_time, max_time, total_time, attempts);\r\n-\r\n- // Clean up and return\r\n- free(unused_centers);\r\n- free(centers);\r\n- return min_cost;\r\n-}\r\n-\r\n-// See KMeans.h\r\n-Scalar RunKMeansPlusPlus(int n, int k, int d, Scalar *points, int attempts,\r\n- Scalar *ret_centers, int *ret_assignment) {\r\n- KM_ASSERT(k >= 1);\r\n-\r\n- // Create the tree and log\r\n- LOG(false, "Running k-means++..." << endl);\r\n- KmTree tree(n, d, points);\r\n- LOG(false, "Done preprocessing..." << endl);\r\n-\r\n- // Initialization\r\n- Scalar *centers = (Scalar*)malloc(sizeof(Scalar)*k*d);\r\n- KM_ASSERT(centers != 0);\r\n- Scalar min_cost = -1, max_cost = -1, total_cost = 0;\r\n- double min_time = -1, max_time = -1, total_time = 0;\r\n-\r\n- // Run all the attempts\r\n- for (int attempt = 0; attempt < attempts; attempt++) {\r\n- double start_time = GetSeconds();\r\n-\r\n- // Choose centers using k-means++ seeding\r\n- tree.SeedKMeansPlusPlus(k, centers);\r\n- \r\n- // Run k-means\r\n- RunKMeansOnce(tree, n, k, d, points, centers, &min_cost, &max_cost, &total_cost, start_time,\r\n- &min_time, &max_time, &total_time, ret_centers, ret_assignment);\r\n- }\r\n- LogMetaStats(min_cost, max_cost, total_cost, min_time, max_time, total_time, attempts);\r\n-\r\n- // Clean up and return\r\n- free(centers);\r\n- return min_cost;\r\n-}\r\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/kmpp/KMeans.h --- a/clustalomega/clustal-omega-0.2.0/src/kmpp/KMeans.h Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,56 +0,0 @@ -#ifndef CLUSTALO -// BEWARE: BETA VERSION -// -------------------- -// -// The main set of utilities for runnning k-means and k-means++ on arbitrary data sets. -// -// Author: David Arthur (darthur@gmail.com), 2009 -#endif - -#ifndef KMEANS_H__ -#define KMEANS_H__ - -#ifndef CLUSTALO -// Includes -#include "KmUtils.h" -#include <iostream> - -// Sets preferences for how much logging is done and where it is outputted, when k-means is run. -void ClearKMeansLogging(); -void AddKMeansLogging(std::ostream *out, bool verbose); - -// Runs k-means on the given set of points. -// - n: The number of points in the data set -// - k: The number of clusters to look for -// - d: The number of dimensions that the data set lives in -// - points: An array of size n*d where points[d*i + j] gives coordinate j of point i -// - attempts: The number of times to independently run k-means with different starting centers. -// The best result is always returned (as measured by the cost function). -// - centers: This can either be null or an array of size k*d. In the latter case, it will be -// filled with the locations of all final cluster centers. Specifically -// centers[d*i + j] will give coordinate j of center i. If the cluster is unused, it -// will contain NaN instead. -// - assignments: This can either be null or an array of size n. In the latter case, it will be -// filled with the cluster that each point is assigned to (an integer between 0 -// and k-1 inclusive). -// The final cost of the clustering is also returned. -// The final cost of the clustering is also returned. -Scalar RunKMeans(int n, int k, int d, Scalar *points, int attempts, - Scalar *centers, int *assignments); - -// Runs k-means++ on the given set of points. Set RunKMeans for info on the parameters. -Scalar RunKMeansPlusPlus(int n, int k, int d, Scalar *points, int attempts, - Scalar *centers, int *assignments); - -#else - -/* CLUSTALO PATCH: - * same as above, with one addition: if use_lloyds_method is false, kmpp will be used - * otherwise the 'classical' i.e. Looyd's method will be used - */ -extern double -KMeans(int n, int k, int d, double *points, int attempts, int use_lloyds_method, - double *centers, int *assignments); - -#endif -#endif |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/kmpp/KmTree.cpp --- a/clustalomega/clustal-omega-0.2.0/src/kmpp/KmTree.cpp Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,363 +0,0 @@\n-// See KmTree.cpp\n-//\n-// Author: David Arthur (darthur@gmail.com), 2009\n-\n-// Includes\n-#include "KmTree.h"\n-#include <iostream>\n-#include <stdlib.h>\n-#include <stdio.h>\n-using namespace std;\n-\n-KmTree::KmTree(int n, int d, Scalar *points): n_(n), d_(d), points_(points) {\n- // Initialize memory\n- // DD: need to cast to long otherwise malloc will fail\n- // if we need more than 2 gigabytes or so\n- int node_size = sizeof(Node) + d_ * 3 * sizeof(Scalar);\n- node_data_ = (char*)malloc((2*(long unsigned int)n-1) * node_size);\n- point_indices_ = (int*)malloc(n * sizeof(int));\n- for (int i = 0; i < n; i++)\n- point_indices_[i] = i;\n- KM_ASSERT(node_data_ != 0 && point_indices_ != 0);\n-\n- // Calculate the bounding box for the points\n- Scalar *bound_v1 = PointAllocate(d_);\n- Scalar *bound_v2 = PointAllocate(d_);\n- KM_ASSERT(bound_v1 != 0 && bound_v2 != 0);\n- PointCopy(bound_v1, points, d_);\n- PointCopy(bound_v2, points, d_);\n- for (int i = 1; i < n; i++)\n- for (int j = 0; j < d; j++) {\n- if (bound_v1[j] > points[i*d_ + j]) bound_v1[j] = points[i*d_ + j];\n- if (bound_v2[j] < points[i*d_ + j]) bound_v1[j] = points[i*d_ + j];\n- }\n-\n- // Build the tree\n- char *temp_node_data = node_data_;\n- top_node_ = BuildNodes(points, 0, n-1, &temp_node_data);\n-\n- // Cleanup\n- PointFree(bound_v1);\n- PointFree(bound_v2);\n-}\n-\n-KmTree::~KmTree() {\n- free(point_indices_);\n- free(node_data_);\n-}\n-\n-Scalar KmTree::DoKMeansStep(int k, Scalar *centers, int *assignment) const {\n- // Create an invalid center for comparison purposes\n- Scalar *bad_center = PointAllocate(d_);\n- KM_ASSERT(bad_center != 0);\n- memset(bad_center, 0xff, d_ * sizeof(Scalar));\n-\n- // Allocate data\n- Scalar *sums = (Scalar*)calloc(k * d_, sizeof(Scalar));\n- int *counts = (int*)calloc(k, sizeof(int));\n- int num_candidates = 0;\n- int *candidates = (int*)malloc(k * sizeof(int));\n- KM_ASSERT(sums != 0 && counts != 0 && candidates != 0);\n- for (int i = 0; i < k; i++)\n- if (memcmp(centers + i*d_, bad_center, d_ * sizeof(Scalar)) != 0)\n- candidates[num_candidates++] = i;\n-\n- // Find nodes\n- Scalar result = DoKMeansStepAtNode(top_node_, num_candidates, candidates, centers, sums,\n- counts, assignment);\n-\n- // Set the new centers\n- for (int i = 0; i < k; i++) {\n- if (counts[i] > 0) {\n- PointScale(sums + i*d_, Scalar(1) / counts[i], d_);\n- PointCopy(centers + i*d_, sums + i*d_, d_);\n- } else {\n- memcpy(centers + i*d_, bad_center, d_ * sizeof(Scalar));\n- }\n- }\n-\n- // Cleanup memory\n- PointFree(bad_center);\n- free(candidates);\n- free(counts);\n- free(sums);\n- return result;\n-}\n-\n-// Helper functions for constructor\n-// ================================\n-\n-// Build a kd tree from the given set of points\n-KmTree::Node *KmTree::BuildNodes(Scalar *points, int first_index, int last_index,\n- char **next_node_data) {\n- // Allocate the node\n- Node *node = (Node*)(*next_node_data);\n- (*next_node_data) += sizeof(Node);\n- node->sum = (Scalar*)(*next_node_data);\n- (*next_node_data) += sizeof(Scalar) * d_;\n- node->median = (Scalar*)(*next_node_data);\n- (*next_node_data) += sizeof(Scalar) * d_;\n- node->radius = (Scalar*)(*next_node_data);\n- (*next_node_data) += sizeof(Scalar) * d_;\n-\n- // Fill in basic info\n- node->num_points = (last_index - first_index + 1);\n- node->first_point_index = first_index;\n-\n- // Calculate the bounding box\n- Scalar *first_point = points + point_indices_[first_index] * d_;\n- Scalar *bound_p1 = PointAllocate(d_);\n- Scalar *bound_p2 = PointAllocate(d_);\n- KM_ASSERT(bound_p1 != 0 && bound_p2 != 0);\n- PointCopy(bound_p1, first_point, d_);\n- PointCopy(bound_p2, first_point, d_);\n- for (int i = first_index+1; i <= last_index; i++)\n- for (int j = 0; j < d_; j++) {\n- Scalar c = points[point_indices_[i]*d_ + j];\n- if (bound_p1[j] > c) bound_p1[j] = c;\n- if (bound_p2[j] < c) bound_p2[j] = c;\n- }\n-\n- // C'..b't_index], c = centers[test_index], then:\n-// (x-c).(x-c) < (x-c_0).(x-c_0)\n-// <=> (c-c_0).(c-c_0) < 2(x-c_0).(c-c_0)\n-//\n-// The right-hand side is maximized for a vertex of the box where for each dimension, we choose\n-// the low or high value based on the sign of x-c_0 in that dimension.\n-bool KmTree::ShouldBePruned(Scalar *box_median, Scalar *box_radius, Scalar *centers,\n- int best_index, int test_index) const {\n- if (best_index == test_index)\n- return false;\n- \n- Scalar *best = centers + best_index*d_;\n- Scalar *test = centers + test_index*d_;\n- Scalar lhs = 0, rhs = 0;\n- for (int i = 0; i < d_; i++) {\n- Scalar component = test[i] - best[i];\n- lhs += component * component;\n- if (component > 0)\n- rhs += (box_median[i] + box_radius[i] - best[i]) * component;\n- else\n- rhs += (box_median[i] - box_radius[i] - best[i]) * component;\n- }\n- return (lhs >= 2*rhs);\n-}\n-\n-Scalar KmTree::SeedKMeansPlusPlus(int k, Scalar *centers) const {\n- Scalar *dist_sq = (Scalar*)malloc(n_ * sizeof(Scalar));\n- KM_ASSERT(dist_sq != 0);\n-\n- // Choose an initial center uniformly at random\n- SeedKmppSetClusterIndex(top_node_, 0);\n- int i = GetRandom(n_);\n- memcpy(centers, points_ + point_indices_[i]*d_, d_*sizeof(Scalar));\n- Scalar total_cost = 0;\n- for (int j = 0; j < n_; j++) {\n- dist_sq[j] = PointDistSq(points_ + point_indices_[j]*d_, centers, d_);\n- total_cost += dist_sq[j];\n- }\n-\n- // Repeatedly choose more centers\n- for (int new_cluster = 1; new_cluster < k; new_cluster++) {\n- while (1) {\n- Scalar cutoff = (rand() / Scalar(RAND_MAX)) * total_cost;\n- Scalar cur_cost = 0;\n- for (i = 0; i < n_; i++) {\n- cur_cost += dist_sq[i];\n- if (cur_cost >= cutoff)\n- break;\n- }\n- if (i < n_)\n- break;\n- }\n- memcpy(centers + new_cluster*d_, points_ + point_indices_[i]*d_, d_*sizeof(Scalar));\n- total_cost = SeedKmppUpdateAssignment(top_node_, new_cluster, centers, dist_sq);\n- }\n-\n- // Clean up and return\n- free(dist_sq);\n- return total_cost;\n-}\n-\n-// Helper functions for SeedKMeansPlusPlus\n-// =======================================\n-\n-// Sets kmpp_cluster_index to 0 for all nodes\n-void KmTree::SeedKmppSetClusterIndex(const Node *node, int value) const {\n- node->kmpp_cluster_index = value;\n- if (node->lower_node != 0) {\n- SeedKmppSetClusterIndex(node->lower_node, value);\n- SeedKmppSetClusterIndex(node->upper_node, value);\n- }\n-}\n-\n-Scalar KmTree::SeedKmppUpdateAssignment(const Node *node, int new_cluster, Scalar *centers,\n- Scalar *dist_sq) const {\n- // See if we can assign all points in this node to one cluster\n- if (node->kmpp_cluster_index >= 0) {\n- if (ShouldBePruned(node->median, node->radius, centers, node->kmpp_cluster_index, new_cluster))\n- return GetNodeCost(node, centers + node->kmpp_cluster_index*d_);\n- if (ShouldBePruned(node->median, node->radius, centers, new_cluster,\n- node->kmpp_cluster_index)) {\n- SeedKmppSetClusterIndex(node, new_cluster);\n- for (int i = node->first_point_index; i < node->first_point_index + node->num_points; i++)\n- dist_sq[i] = PointDistSq(points_ + point_indices_[i]*d_, centers + new_cluster*d_, d_);\n- return GetNodeCost(node, centers + new_cluster*d_);\n- }\n- \n- // It may be that the a leaf-node point is equidistant from the new center or old\n- if (node->lower_node == 0)\n- return GetNodeCost(node, centers + node->kmpp_cluster_index*d_);\n- }\n-\n- // Recurse\n- Scalar cost = SeedKmppUpdateAssignment(node->lower_node, new_cluster, centers, dist_sq) +\n- SeedKmppUpdateAssignment(node->upper_node, new_cluster, centers, dist_sq);\n- int i1 = node->lower_node->kmpp_cluster_index, i2 = node->upper_node->kmpp_cluster_index;\n- if (i1 == i2 && i1 != -1)\n- node->kmpp_cluster_index = i1;\n- else\n- node->kmpp_cluster_index = -1;\n- return cost;\n-}\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/kmpp/KmTree.h --- a/clustalomega/clustal-omega-0.2.0/src/kmpp/KmTree.h Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,77 +0,0 @@ -// BEWARE: BETA VERSION -// -------------------- -// -// A k-d tree that vastly speeds up an iteration of k-means (in any number of dimensions). The main -// idea for this data structure is from Kanungo/Mount. This is used internally by Kmeans.cpp, and -// will most likely not need to be used directly. -// -// The stucture works as follows: -// - All data points are placed into a tree where we choose child nodes by partitioning all data -// points along a plane parallel to the axis. -// - We maintain for each node, the bounding box of all data points stored at that node. -// - To do a k-means iteration, we need to assign points to clusters and calculate the sum and -// the number of points assigned to each cluster. For each node in the tree, we can rule out -// some cluster centers as being too far away from every single point in that bounding box. -// Once only one cluster is left, all points in the node can be assigned to that cluster in -// batch. -// -// Author: David Arthur (darthur@gmail.com), 2009 - -#ifndef KM_TREE_H__ -#define KM_TREE_H__ - -// Includes -#include "KmUtils.h" - -// KmTree class definition -class KmTree { - public: - // Constructs a tree out of the given n data points living in R^d. - KmTree(int n, int d, Scalar *points); - ~KmTree(); - - // Given k cluster centers, this runs a full k-means iterations, choosing the next set of - // centers and returning the cost function for this set of centers. If assignment is not null, - // it should be an array of size n that will be filled with the index of the cluster (0 - k-1) - // that each data point is assigned to. The new center values will overwrite the old ones. - Scalar DoKMeansStep(int k, Scalar *centers, int *assignment) const; - - // Choose k initial centers for k-means using the kmeans++ seeding procedure. The resulting - // centers are returned via the centers variable, which should be pre-allocated to size k*d. - // The cost of the initial clustering is returned. - Scalar SeedKMeansPlusPlus(int k, Scalar *centers) const; - - private: - struct Node { - int num_points; // Number of points stored in this node - int first_point_index; // The smallest point index stored in this node - Scalar *median, *radius; // Bounding box center and half side-lengths - Scalar *sum; // Sum of the points stored in this node - Scalar opt_cost; // Min cost for putting all points in this node in 1 cluster - Node *lower_node, *upper_node; // Child nodes - mutable int kmpp_cluster_index; // The cluster these points are assigned to or -1 if variable - }; - - // Helper functions for constructor - Node *BuildNodes(Scalar *points, int first_index, int last_index, char **next_node_data); - Scalar GetNodeCost(const Node *node, Scalar *center) const; - - // Helper functions for DoKMeans step - Scalar DoKMeansStepAtNode(const Node *node, int k, int *candidates, Scalar *centers, - Scalar *sums, int *counts, int *assignment) const; - bool ShouldBePruned(Scalar *box_median, Scalar *box_radius, Scalar *centers, int best_index, - int test_index) const; - - // Helper functions for SeedKMeansPlusPlus - void SeedKmppSetClusterIndex(const Node *node, int index) const; - Scalar SeedKmppUpdateAssignment(const Node *node, int new_cluster, Scalar *centers, - Scalar *dist_sq) const; - - int n_, d_; - Scalar *points_; - Node *top_node_; - char *node_data_; - int *point_indices_; -}; - -#endif |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/kmpp/KmUtils.cpp --- a/clustalomega/clustal-omega-0.2.0/src/kmpp/KmUtils.cpp Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,13 +0,0 @@ -// See KmUtils.h -// -// Author: David Arthur (darthur@gmail.com), 2009 - -#include "KmUtils.h" -#include <iostream> -using namespace std; - -int __KMeansAssertionFailure(const char *file, int line, const char *expression) { - cout << "ASSERTION FAILURE, " << file << " line " << line << ":" << endl; - cout << " " << expression << endl; - exit(-1); -} |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/kmpp/KmUtils.h --- a/clustalomega/clustal-omega-0.2.0/src/kmpp/KmUtils.h Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,85 +0,0 @@ -// BEWARE: BETA VERSION -// -------------------- -// -// Utilities for arbitrary dimensional points in space. All points are treated as simple value -// arrays. This is done for two reasons: -// - Using value arrays instead of a point class makes all point operations very explicit, which -// makes their usage easier to optimize. -// - A value array is about as universal a format as possible, which makes it easier for -// people to use the k-means code in any project. -// Also contains assertion code that can be disabled if desired. -// -// Author: David Arthur (darthur@gmail.com), 2009 - -#ifndef KM_UTILS_H__ -#define KM_UTILS_H__ - -// Includes -#ifndef CLUSTALO -#include <malloc.h> -#endif -#include <memory.h> -#include <stdlib.h> - -// The data-type used for a single coordinate for points -typedef double Scalar; - -// Point utilities -// =============== - -// Point creation and deletion -inline Scalar *PointAllocate(int d) { - return (Scalar*)malloc(d * sizeof(Scalar)); -} - -inline void PointFree(Scalar *p) { - free(p); -} - -inline void PointCopy(Scalar *p1, const Scalar *p2, int d) { - memcpy(p1, p2, d * sizeof(Scalar)); -} - -// Point vector tools -inline void PointAdd(Scalar *p1, const Scalar *p2, int d) { - for (int i = 0; i < d; i++) - p1[i] += p2[i]; -} - -inline void PointScale(Scalar *p, Scalar scale, int d) { - for (int i = 0; i < d; i++) - p[i] *= scale; -} - -inline Scalar PointDistSq(const Scalar *p1, const Scalar *p2, int d) { - Scalar result = 0; - for (int i = 0; i < d; i++) - result += (p1[i] - p2[i]) * (p1[i] - p2[i]); - return result; -} - -// Assertions -// ========== - -// Comment out ENABLE_KMEANS_ASSERTS to turn off ASSERTS for added speed. -#define ENABLE_KMEANS_ASSERTS -#ifdef ENABLE_KMEANS_ASSERTS -int __KMeansAssertionFailure(const char *file, int line, const char *expression); -#define KM_ASSERT(expression) \ - (void)((expression) != 0? 0 : __KMeansAssertionFailure(__FILE__, __LINE__, #expression)) -#else -#define KM_ASSERT(expression) -#endif - -// Miscellaneous utilities -// ======================= - -// Returns a random integer chosen uniformly from the range [0, n-1]. Note that RAND_MAX could be -// less than n. On Visual Studio, it is only 32767. For larger values of RAND_MAX, we need to be -// careful of overflow. -inline int GetRandom(int n) { - int u = rand() * RAND_MAX + rand(); - return ((u % n) + n) % n; -} - -#endif |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/kmpp/Makefile.am --- a/clustalomega/clustal-omega-0.2.0/src/kmpp/Makefile.am Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,18 +0,0 @@ -# Replaces squids own automake files -# -# Some useful automake documentation: -# http://www.openismus.com/documents/linux/automake/automake.shtml -# http://www.bioinf.uni-freiburg.de/~mmann/HowTo/automake.html - -#SUBDIRS = -#EXTRA_DIST = -#LDADD = - -# need DCLUSTALO here to enable Clustal specific squid patches -AM_CXXFLAGS = -DCLUSTALO @AM_CXXFLAGS@ - -noinst_LTLIBRARIES = libkmpp.la - -libkmpp_la_SOURCES = KMeans.cpp KMeans.h \ - KmTree.cpp KmTree.h \ - KmUtils.cpp KmUtils.h |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/kmpp/Makefile.in --- a/clustalomega/clustal-omega-0.2.0/src/kmpp/Makefile.in Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,504 +0,0 @@\n-# Makefile.in generated by automake 1.11.1 from Makefile.am.\n-# @configure_input@\n-\n-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,\n-# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,\n-# Inc.\n-# This Makefile.in is free software; the Free Software Foundation\n-# gives unlimited permission to copy and/or distribute it,\n-# with or without modifications, as long as this notice is preserved.\n-\n-# This program is distributed in the hope that it will be useful,\n-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without\n-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A\n-# PARTICULAR PURPOSE.\n-\n-@SET_MAKE@\n-\n-# Replaces squids own automake files\n-#\n-# Some useful automake documentation:\n-# http://www.openismus.com/documents/linux/automake/automake.shtml\n-# http://www.bioinf.uni-freiburg.de/~mmann/HowTo/automake.html\n-\n-#SUBDIRS =\n-#EXTRA_DIST = \n-#LDADD =\n-\n-VPATH = @srcdir@\n-pkgdatadir = $(datadir)/@PACKAGE@\n-pkgincludedir = $(includedir)/@PACKAGE@\n-pkglibdir = $(libdir)/@PACKAGE@\n-pkglibexecdir = $(libexecdir)/@PACKAGE@\n-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd\n-install_sh_DATA = $(install_sh) -c -m 644\n-install_sh_PROGRAM = $(install_sh) -c\n-install_sh_SCRIPT = $(install_sh) -c\n-INSTALL_HEADER = $(INSTALL_DATA)\n-transform = $(program_transform_name)\n-NORMAL_INSTALL = :\n-PRE_INSTALL = :\n-POST_INSTALL = :\n-NORMAL_UNINSTALL = :\n-PRE_UNINSTALL = :\n-POST_UNINSTALL = :\n-build_triplet = @build@\n-host_triplet = @host@\n-subdir = src/kmpp\n-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in\n-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4\n-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_prefix_config_h.m4 \\\n-\t$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \\\n-\t$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \\\n-\t$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/ax_openmp.m4 \\\n-\t$(top_srcdir)/configure.ac\n-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \\\n-\t$(ACLOCAL_M4)\n-mkinstalldirs = $(install_sh) -d\n-CONFIG_HEADER = $(top_builddir)/src/config.h\n-CONFIG_CLEAN_FILES =\n-CONFIG_CLEAN_VPATH_FILES =\n-LTLIBRARIES = $(noinst_LTLIBRARIES)\n-libkmpp_la_LIBADD =\n-am_libkmpp_la_OBJECTS = KMeans.lo KmTree.lo KmUtils.lo\n-libkmpp_la_OBJECTS = $(am_libkmpp_la_OBJECTS)\n-DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src\n-depcomp = $(SHELL) $(top_srcdir)/depcomp\n-am__depfiles_maybe = depfiles\n-am__mv = mv -f\n-CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \\\n-\t$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)\n-LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \\\n-\t--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \\\n-\t$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)\n-CXXLD = $(CXX)\n-CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \\\n-\t--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \\\n-\t$(LDFLAGS) -o $@\n-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \\\n-\t$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)\n-LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \\\n-\t--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \\\n-\t$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)\n-CCLD = $(CC)\n-LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \\\n-\t--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \\\n-\t$(LDFLAGS) -o $@\n-SOURCES = $(libkmpp_la_SOURCES)\n-DIST_SOURCES = $(libkmpp_la_SOURCES)\n-ETAGS = etags\n-CTAGS = ctags\n-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)\n-ACLOCAL = @ACLOCAL@\n-AMTAR = @AMTAR@\n-AM_CFLAGS = @AM_CFLAGS@\n-\n-# need DCLUSTALO here to enable Clustal specific squid patches\n-AM_CXXFLAGS = -DCLUSTALO @AM_CXXFLAGS@ \n-AM_LDFLAGS = @AM_LDFLAGS@\n-AR = @AR@\n-AUTOCONF = @AUTOCONF@\n-AUTOHEADER = @AUTOHEADER@\n-AUTOMAKE = @AUTOMAKE@\n-AWK = @AWK@\n-CC = @CC@\n-CCDEPMODE = @CCDEPMODE@\n-CFLAGS = @CFLAGS@\n-CPP = @CPP@\n-CPPFLAGS = @CPPFLAGS@\n-CXX = @CXX@\n-CXXCPP = @CXXCPP@\n-CXXDEPMODE '..b'\\&/g\'`; \\\n-\ttopsrcdirstrip=`echo "$(top_srcdir)" | sed \'s/[].[^$$\\\\*]/\\\\\\\\&/g\'`; \\\n-\tlist=\'$(DISTFILES)\'; \\\n-\t dist_files=`for file in $$list; do echo $$file; done | \\\n-\t sed -e "s|^$$srcdirstrip/||;t" \\\n-\t -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \\\n-\tcase $$dist_files in \\\n-\t */*) $(MKDIR_P) `echo "$$dist_files" | \\\n-\t\t\t sed \'/\\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,\' | \\\n-\t\t\t sort -u` ;; \\\n-\tesac; \\\n-\tfor file in $$dist_files; do \\\n-\t if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \\\n-\t if test -d $$d/$$file; then \\\n-\t dir=`echo "/$$file" | sed -e \'s,/[^/]*$$,,\'`; \\\n-\t if test -d "$(distdir)/$$file"; then \\\n-\t find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \\;; \\\n-\t fi; \\\n-\t if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \\\n-\t cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \\\n-\t find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \\;; \\\n-\t fi; \\\n-\t cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \\\n-\t else \\\n-\t test -f "$(distdir)/$$file" \\\n-\t || cp -p $$d/$$file "$(distdir)/$$file" \\\n-\t || exit 1; \\\n-\t fi; \\\n-\tdone\n-check-am: all-am\n-check: check-am\n-all-am: Makefile $(LTLIBRARIES)\n-installdirs:\n-install: install-am\n-install-exec: install-exec-am\n-install-data: install-data-am\n-uninstall: uninstall-am\n-\n-install-am: all-am\n-\t@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am\n-\n-installcheck: installcheck-am\n-install-strip:\n-\t$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \\\n-\t install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \\\n-\t `test -z \'$(STRIP)\' || \\\n-\t echo "INSTALL_PROGRAM_ENV=STRIPPROG=\'$(STRIP)\'"` install\n-mostlyclean-generic:\n-\n-clean-generic:\n-\n-distclean-generic:\n-\t-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)\n-\t-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)\n-\n-maintainer-clean-generic:\n-\t@echo "This command is intended for maintainers to use"\n-\t@echo "it deletes files that may require special tools to rebuild."\n-clean: clean-am\n-\n-clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \\\n-\tmostlyclean-am\n-\n-distclean: distclean-am\n-\t-rm -rf ./$(DEPDIR)\n-\t-rm -f Makefile\n-distclean-am: clean-am distclean-compile distclean-generic \\\n-\tdistclean-tags\n-\n-dvi: dvi-am\n-\n-dvi-am:\n-\n-html: html-am\n-\n-html-am:\n-\n-info: info-am\n-\n-info-am:\n-\n-install-data-am:\n-\n-install-dvi: install-dvi-am\n-\n-install-dvi-am:\n-\n-install-exec-am:\n-\n-install-html: install-html-am\n-\n-install-html-am:\n-\n-install-info: install-info-am\n-\n-install-info-am:\n-\n-install-man:\n-\n-install-pdf: install-pdf-am\n-\n-install-pdf-am:\n-\n-install-ps: install-ps-am\n-\n-install-ps-am:\n-\n-installcheck-am:\n-\n-maintainer-clean: maintainer-clean-am\n-\t-rm -rf ./$(DEPDIR)\n-\t-rm -f Makefile\n-maintainer-clean-am: distclean-am maintainer-clean-generic\n-\n-mostlyclean: mostlyclean-am\n-\n-mostlyclean-am: mostlyclean-compile mostlyclean-generic \\\n-\tmostlyclean-libtool\n-\n-pdf: pdf-am\n-\n-pdf-am:\n-\n-ps: ps-am\n-\n-ps-am:\n-\n-uninstall-am:\n-\n-.MAKE: install-am install-strip\n-\n-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \\\n-\tclean-libtool clean-noinstLTLIBRARIES ctags distclean \\\n-\tdistclean-compile distclean-generic distclean-libtool \\\n-\tdistclean-tags distdir dvi dvi-am html html-am info info-am \\\n-\tinstall install-am install-data install-data-am install-dvi \\\n-\tinstall-dvi-am install-exec install-exec-am install-html \\\n-\tinstall-html-am install-info install-info-am install-man \\\n-\tinstall-pdf install-pdf-am install-ps install-ps-am \\\n-\tinstall-strip installcheck installcheck-am installdirs \\\n-\tmaintainer-clean maintainer-clean-generic mostlyclean \\\n-\tmostlyclean-compile mostlyclean-generic mostlyclean-libtool \\\n-\tpdf pdf-am ps ps-am tags uninstall uninstall-am\n-\n-\n-# Tell versions [3.59,3.63) of GNU make to not export all variables.\n-# Otherwise a system limit (for SysV at least) may be exceeded.\n-.NOEXPORT:\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/main.cpp --- a/clustalomega/clustal-omega-0.2.0/src/main.cpp Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,477 +0,0 @@\n-/*********************************************************************\n- * Clustal Omage - Multiple sequence alignment\n- *\n- * Copyright (C) 2010 University College Dublin\n- *\n- * Clustal-Omega is free software; you can redistribute it and/or\n- * modify it under the terms of the GNU General Public License as\n- * published by the Free Software Foundation; either version 2 of the\n- * License, or (at your option) any later version.\n- *\n- * This file is part of Clustal-Omega.\n- *\n- ********************************************************************/\n-\n-/*\n- * RCS $Id: main.cpp 234 2011-04-13 05:26:16Z andreas $\n- */\n-\n-/*\n- * We are using a mix of C and C++, which means that linking has to be\n- * done with a C++ compiler. By using this "fake" main c++ function,\n- * automake is convinced to use a C++ compiler for linking.\n- *\n- */\n-\n-#ifdef HAVE_CONFIG_H\n- #include "config.h"\n-#endif\n-\n-#include <stdio.h>\n-#include <stdlib.h>\n-#include <string.h>\n-\n-extern "C" {\n-#include "mymain.h"\n-#include "clustal/util.h"\n-#include "squid/squid.h"\n-}\n-\n-\n-/**\n- * @brief Convert an old Clustal command line parameter in the form of\n- * [-/]param[=value] to new parameter if possible\n- *\n- * @param[out] iNewArgC_p\n- * "argc" which will be incremented for each successfully converted option\n- * @param[out] ppcNewArgV_p\n- * "argv" to which each successfully converted options will be added\n- * (caller has to free)\n- * @param[in] pcOldArg\n- * The old parameter and value command line option\n- *\n- */\n-void\n-ConvertOldCmdLineArg(int *iNewArgC_p, char ***ppcNewArgV_p, char *pcOldArg)\n-{\n- char *pcOldParam, *pcOldValue, *pcOldArgCopy;\n- char zcNotImplementedMsg[] = "WARNING: Invalid old command line option";\n- \n- pcOldArgCopy = CkStrdup(pcOldArg); \n- pcOldParam = strtok(pcOldArgCopy, "=");\n- pcOldValue = strtok(NULL, "=");\n-\n-\n- /* go through all options in order of appearance in clustalw2 -help\n- *\n- */\n- \n- /* data\n- *\n- */\n- if (STR_NC_EQ("INFILE", &pcOldParam[1])) {\n- (*ppcNewArgV_p)[(*iNewArgC_p)++] = CkStrdup("-i");\n- if (NULL != pcOldValue)\n- (*ppcNewArgV_p)[(*iNewArgC_p)++] = CkStrdup(pcOldValue);\n-\n- } else if (STR_NC_EQ("PROFILE1", &pcOldParam[1])) {\n- (*ppcNewArgV_p)[(*iNewArgC_p)++] = CkStrdup("--profile1");\n- if (NULL != pcOldValue)\n- (*ppcNewArgV_p)[(*iNewArgC_p)++] = CkStrdup(pcOldValue);\n-\n- } else if (STR_NC_EQ("PROFILE2", &pcOldParam[1])) {\n- (*ppcNewArgV_p)[(*iNewArgC_p)++] = CkStrdup("--profile2");\n- if (NULL != pcOldValue)\n- (*ppcNewArgV_p)[(*iNewArgC_p)++] = CkStrdup(pcOldValue);\n-\n- /* verbs\n- *\n- */\n-\n- /* missing:\n- * OPTIONS\n- */\n- \n- } else if (STR_NC_EQ("HELP", &pcOldParam[1])\n- || STR_NC_EQ("CHECK", &pcOldParam[1])) {\n- (*ppcNewArgV_p)[(*iNewArgC_p)++] = CkStrdup("-h");\n- \n- } else if (STR_NC_EQ("FULLHELP", &pcOldParam[1])) {\n- (*ppcNewArgV_p)[(*iNewArgC_p)++] = CkStrdup("-h");\n- \n- } else if (STR_NC_EQ("ALIGN", &pcOldParam[1])) {\n- char msg[] = "WARNING: The ALIGN option is default in Clustal Omega";\n- fprintf(stderr, "%s\\n", msg);\n-\n- /* missing:\n- * TREE\n- * PIM\n- * BOOTSTRAP\n- * CONVERT\n- */\n- \n- /* parameters\n- *\n- */\n- } else if (STR_NC_EQ("INTERACTIVE", &pcOldParam[1])) {\n- char msg[] = "WARNING: There is no interactive command-line menu in Clustal Omega";\n- fprintf(stderr, "%s\\n", msg);\n- /* trigger help */\n- (*ppcNewArgV_p)[(*iNewArgC_p)++] = CkStrdup("-h");\n- \n- } else if (STR_NC_EQ("QUICKTREE", &pcOldParam[1])) {\n- char msg[] = "WARNING: The QUICKTREE (i.e. k-tuple distance) option is default in Clustal Omega";\n- fprintf(stderr, "%s\\n", msg);\n- \n- } else if (STR_NC_EQ("TYPE", &pcOldParam[1])) {\n- '..b'- (*ppcNewArgV_p)[(*iNewArgC_p)++] = CkStrdup(argv[i]);\n- } else {\n- ConvertOldCmdLineArg(iNewArgC_p, ppcNewArgV_p, argv[i]);\n- /*LOG_DEBUG("old command line arg: %s", argv[i]);*/\n- bOldCmdlineDetected = true;\n- }\n- }\n- \n- if (bOldCmdlineDetected) {\n- bool bOutfileOptSet = FALSE;\n- bool bOutFormatOptSet = FALSE;\n- \n- \n- /* old clustal used to write to a file called in.aln by\n- * default. set if not\n- * explicitely requested otherwisee\n- */\n- for (i=0; i<*iNewArgC_p; i++) {\n- const char *pcOpt = "-o";\n- if (strlen(pcOpt) <= strlen((*ppcNewArgV_p)[i])) {\n- if (0 == strncmp((*ppcNewArgV_p)[i], pcOpt, strlen(pcOpt))) {\n- bOutfileOptSet = TRUE;\n- break;\n- }\n- }\n- }\n- if (FALSE == bOutfileOptSet) {\n-#ifdef TOO_LAZY_TO_IMPLEMENT_JUST_USING_DEFAULT_NAME_INSTEAD\n- char *pcDotPos = NULL;\n- char *pcInfileOpt = NULL;\n-\n- /* get infile arg and find last dot in it. if found replace\n- * everything after with "aln", otherwise just add "aln"\n- */\n- for (i=0; i<*iNewArgC_p; i++) {\n- const char *pcOpt = "-i";\n- if (strlen(pcOpt) <= strlen((*ppcNewArgV_p)[i])) {\n- if (0 == strncmp((*ppcNewArgV_p)[i], pcOpt, strlen(pcOpt))) {\n- if (*iNewArgC_p<= i+1) {\n- fprintf(stderr,\n- "Oups...error while trying to convert old commandline (%s).\\n",\n- "No more arguments left after -i");\n- exit(1);\n- }\n- pcInfileOpt = (*ppcNewArgV_p)[i+1];\n- break;\n- }\n- }\n- }\n- if (NULL == pcInfileOpt) {\n- fprintf(stderr,\n- "Oups...error while trying to convert old commandline (%s)\\n",\n- "No infile opt found");\n- exit(1);\n- }\n-\n- fprintf(stderr, "FIXME: unfinished\\n");\n- exit(1);\n-#endif\n- (*ppcNewArgV_p)[(*iNewArgC_p)++] = CkStrdup("-o");\n- (*ppcNewArgV_p)[(*iNewArgC_p)++] = CkStrdup("clustal.aln");\n- }\n-\n- \n- /* old clustal used the clustal format by default. set if not\n- * explicitely requested otherwisee\n- */\n- for (i=0; i<*iNewArgC_p; i++) {\n- const char *pcOpt = "--outfmt";\n- if (strlen(pcOpt) <= strlen((*ppcNewArgV_p)[i])) {\n- if (0 == strncmp((*ppcNewArgV_p)[i], pcOpt, strlen(pcOpt))) {\n- bOutFormatOptSet = TRUE;\n- break;\n- }\n- }\n- }\n- if (FALSE == bOutFormatOptSet) {\n- (*ppcNewArgV_p)[(*iNewArgC_p)++] = CkStrdup("--outfmt=clustal");\n- }\n-\n- \n- /* old clustal was verbose by default\n- */\n- (*ppcNewArgV_p)[(*iNewArgC_p)++] = CkStrdup("-v");\n- \n- /* old clustal used to overwrite files by default\n- */\n- (*ppcNewArgV_p)[(*iNewArgC_p)++] = CkStrdup("--force");\n- \n- fprintf(stderr,\n- "WARNING: Your old-style command-line options were converted to: ");\n- for (i=0; i<*iNewArgC_p; i++) {\n- fprintf(stderr, " %s", (*ppcNewArgV_p)[i]);\n- }\n- fprintf(stderr, "\\n");\n- }\n-\n-}\n-/* end ConvertOldCmdline */\n-\n-\n-\n-int\n-main(int argc, char **argv)\n-{\n- int new_argc = 0;\n- char **new_argv = NULL;\n- int i; /* aux */\n- \n- ConvertOldCmdline(&new_argc, &new_argv, argc, argv);\n- \n- MyMain(new_argc, new_argv);\n- \n- for (i=0; i<new_argc; i++) {\n- free(new_argv[i]);\n- }\n- free(new_argv);\n- \n- return 0;\n-}\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/mymain.c --- a/clustalomega/clustal-omega-0.2.0/src/mymain.c Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,998 +0,0 @@\n-/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n-\n-/*********************************************************************\n- * Clustal Omega - Multiple sequence alignment\n- *\n- * Copyright (C) 2010 University College Dublin\n- *\n- * Clustal-Omega is free software; you can redistribute it and/or\n- * modify it under the terms of the GNU General Public License as\n- * published by the Free Software Foundation; either version 2 of the\n- * License, or (at your option) any later version.\n- *\n- * This file is part of Clustal-Omega.\n- *\n- ********************************************************************/\n-\n-/*\n- * RCS $Id: mymain.c 242 2011-05-27 14:04:21Z andreas $\n- */\n-\n-#ifdef HAVE_CONFIG_H\n-#include "config.h"\n-#endif\n-\n-#include <stdio.h>\n-#include <string.h>\n-#include <assert.h>\n-#include <unistd.h>\n-#include <argtable2.h>\n-#include <ctype.h>\n-#include <limits.h>\n-#include <libgen.h> /* for basename only */\n-\n-/* clustal */\n-#include "clustal-omega.h"\n-\n-#include "mymain.h"\n-\n-/* hhalign (parameters) */\n-#include "hhalign/general.h"\n-\n-typedef struct {\n-\n- /* Sequence input\n- */\n- /** sequence type (from cmdline arg) */\n- int iSeqType;\n- /** sequence input file. not directly used by Align() */\n- char *pcSeqInfile;\n- /** Dealign sequences on input. Otherwise we use the alignment\n- * info for background-HMM creation */\n- bool bDealignInputSeqs;\n-\n- /* profiles: : pre-aligned sequences, whose alignment will not be changed \n- */\n- /** profile 1: pre-aligned sequence input. not directly used by Align() */\n- char *pcProfile1Infile ;\n- /** profile 2: pre-aligned sequence input. not directly used by Align() */\n- char *pcProfile2Infile; \n- \n- /** Input limitations\n- */\n- /** maximum allowed number of input sequences */\n- int iMaxNumSeq;\n- /** maximum allowed input sequence length */\n- int iMaxSeqLen;\n-\n- /* Alignment output\n- */\n- /** alignment output file */\n- char *pcAlnOutfile;\n- /** alignment output format */\n- int iAlnOutFormat;\n- /** force overwriting of files */\n- bool bForceFileOverwrite;\n-\n- /* multithreading\n- */\n- /** number of threads */\n- int iThreads;\n-\n- /* logging \n- */\n- char *pcLogFile;\n-\n- opts_t aln_opts;\n-\n- /* changes here will have to be reflected in SetDefaultUserOpts(),\n- * FreeUserOpts(), PrintUserOpts() and UserOptsLogicCheck() etc\n- */\n-} cmdline_opts_t;\n-\n-\n-\n-/* log-file used for non-essential logging in prLog */\n-FILE *prLogFile = NULL;\n-\n-\n-\n-/**\n- * @brief Sets default user/commandline options\n- *\n- * @param[out] opts\n- * The option structure to initialise\n- *\n- */\n-void\n-SetDefaultUserOpts(cmdline_opts_t *opts)\n-{\n-\n- assert(NULL != opts);\n-\n- opts->iSeqType = SEQTYPE_UNKNOWN;\n- opts->pcSeqInfile = NULL;\n- opts->bDealignInputSeqs = FALSE; \n- opts->pcProfile1Infile = NULL;\n- opts->pcProfile2Infile = NULL;\n-\t\n- opts->iMaxNumSeq = INT_MAX;\n- opts->iMaxSeqLen = INT_MAX;\n- \n- opts->pcAlnOutfile = NULL;\n- opts->iAlnOutFormat = MSAFILE_A2M;\n- opts->bForceFileOverwrite = FALSE;\n-\n-#ifdef HAVE_OPENMP\n- /* defaults to # of CPUs */\n- opts->iThreads = omp_get_max_threads();\n-#else\n- opts->iThreads = 1;\n-#endif\n- \n- opts->pcLogFile = NULL;\n-\n- SetDefaultAlnOpts(& opts->aln_opts);\n-}\n-/* end of SetDefaultAlnOpts() */\n-\n-\n-\n-\n-/**\n- * @brief FIXME add doc\n- *\n- */\n-void\n-PrintUserOpts(FILE *prFile, cmdline_opts_t *opts) {\n- \n- /* keep in same order as in struct. FIXME could this be derived from argtable?\n- */\n- /* we only allow protein anyway: fprintf(prFile, "seq-type = %s\\n", SeqTypeToStr(opts->iSeqType)); */\n- fprintf(prFile, "option: seq-in = %s\\n", \n- NULL != opts->pcSeqInfile? opts->pcSeqInfile: "(null)");\n- fprintf(prFile, "option: dealign = %d\\n", opts->bDealignInputSeqs);\n- fprintf(prFile, "option: profile1 = %s\\n", \n- '..b'.pcProfile1Infile) {\n- NewMSeq(&prMSeqProfile1);\n- if (ReadSequences(prMSeqProfile1, cmdline_opts.pcProfile1Infile,\n- cmdline_opts.iSeqType,\n- cmdline_opts.iMaxNumSeq, cmdline_opts.iMaxSeqLen)) {\n- Log(&rLog, LOG_FATAL, "Reading sequences from profile file \'%s\' failed",\n- cmdline_opts.pcProfile1Infile);\n- }\n- /* FIXME: commented out. FS, r240 -> r241 \n- * for explanation see below */\n- /*if (1==prMSeqProfile1->nseqs) {\n- Log(&rLog, LOG_FATAL, "\'%s\' contains only one sequence and can therefore not be used as a profile",\n- cmdline_opts.pcProfile1Infile);\n- }*/\n- if (FALSE == prMSeqProfile1->aligned) {\n- Log(&rLog, LOG_FATAL, "Sequences in \'%s\' are not aligned, i.e. this is not a profile",\n- cmdline_opts.pcProfile1Infile);\n- }\n- }\n-\n- \n-\n- /* Read profile2\n- *\n- */\n- if (NULL != cmdline_opts.pcProfile2Infile) {\n- NewMSeq(&prMSeqProfile2);\n- if (ReadSequences(prMSeqProfile2, cmdline_opts.pcProfile2Infile,\n- cmdline_opts.iSeqType,\n- cmdline_opts.iMaxNumSeq, cmdline_opts.iMaxSeqLen)) {\n- Log(&rLog, LOG_FATAL, "Reading sequences from profile file \'%s\' failed",\n- cmdline_opts.pcProfile2Infile);\n- }\n- /* FIXME: there is no (clean) way to align a single sequence to a profile. \n- * if we go down the -i route, it causes a seg-fault in the pair-wise \n- * k-tuple distance calculation. However, single sequences can be \n- * understood as 1-profiles. Therefore we have to allow for 1-profiles.\n- * FS, r240 -> r241 \n- */\n- /*if (1==prMSeqProfile2->nseqs) {\n- Log(&rLog, LOG_FATAL, "\'%s\' contains only one sequence and can therefore not be used as a profile",\n- cmdline_opts.pcProfile2Infile);\n- }*/\n- if (FALSE == prMSeqProfile1->aligned) {\n- Log(&rLog, LOG_FATAL, "Sequences in \'%s\' are not aligned, i.e. this is not a profile",\n- cmdline_opts.pcProfile2Infile);\n- }\n- }\n-\n-\n- /* Depending on the input we got perform\n- *\n- * (i) normal alignment: seq + optional profile\n- * or\n- * (ii) profile profile alignment\n- *\n- */\n- if (NULL != prMSeq) {\n- if (Align(prMSeq, prMSeqProfile1, & cmdline_opts.aln_opts, rHhalignPara)) {\n- Log(&rLog, LOG_FATAL, "An error occured during the alignment");\n- }\n-\n- if (WriteAlignment(prMSeq, cmdline_opts.pcAlnOutfile, \n- cmdline_opts.iAlnOutFormat)) {\n- Log(&rLog, LOG_FATAL, "Could not save alignment to %s", cmdline_opts.pcAlnOutfile);\n- }\n-#if 0\n- {\n- bool bSampling = FALSE; /* better set to TRUE for many sequences */\n- bool bReportAll = TRUE;\n- AliStat(prMSeq, bSampling, bReportAll);\n- }\n-#endif\n- \n-\n- } else if (NULL != prMSeqProfile1 && NULL != prMSeqProfile2) {\n- if (AlignProfiles(prMSeqProfile1, prMSeqProfile2, rHhalignPara)) {\n- Log(&rLog, LOG_FATAL, "An error occured during the alignment");\n- }\n- if (WriteAlignment(prMSeqProfile1, cmdline_opts.pcAlnOutfile, \n- cmdline_opts.iAlnOutFormat)) {\n- Log(&rLog, LOG_FATAL, "Could not save alignment to %s", cmdline_opts.pcAlnOutfile);\n- }\n- }\n-\n-\n- /* cleanup\n- */\n- if (NULL != prMSeq) {\n- FreeMSeq(&prMSeq);\n- }\n- if (NULL != prMSeqProfile1) {\n- FreeMSeq(&prMSeqProfile1);\n- }\n- if (NULL != prMSeqProfile2) {\n- FreeMSeq(&prMSeqProfile2);\n- }\n-\n- FreeUserOpts(&cmdline_opts);\n-\n- Log(&rLog, LOG_DEBUG, "Successful program exit");\n-\n- if (NULL != cmdline_opts.pcLogFile) {\n- fclose(prLogFile);\n- }\n- return EXIT_SUCCESS;\n-}\n-/* end of MyMain() */\n-\n-\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/mymain.h --- a/clustalomega/clustal-omega-0.2.0/src/mymain.h Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,23 +0,0 @@ -/********************************************************************* - * Clustal Omega - Multiple sequence alignment - * - * Copyright (C) 2010 University College Dublin - * - * Clustal-Omega is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of the - * License, or (at your option) any later version. - * - * This file is part of Clustal-Omega. - * - ********************************************************************/ - -/* - * RCS $Id: mymain.h 97 2010-07-12 15:30:26Z andreas $ - */ - - -extern int -MyMain(int argc, char **argv); - - |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/squid/00README --- a/clustalomega/clustal-omega-0.2.0/src/squid/00README Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,39 +0,0 @@ -SQUID - library of functions for biological sequence analysis -Copyright (C) 1992-2002 Washington University School of Medicine - -SQUID is a freely redistributable library of C code functions for -sequence analysis. SQUID also includes a number of small utility -programs. - -To install squid, see the file: - INSTALL -- instructions for installing the programs - -If you have any questions about redistributing squid or using -squid code in your own work, see the files: - COPYRIGHT -- copyright notice, and information on my distribution policy - LICENSE -- version 2 of the GNU Public License (see COPYRIGHT) - -For a web page with more information on squid, see: - http://www.genetics.wustl.edu/eddy/software/#squid - -You can always download the latest stable release of squid from: - ftp://ftp.genetics.wustl.edu/pub/eddy/software/squid.tar.gz - -The development codebase is available by anonymous CVS: - cvs -d :pserver:anonymous@skynet.wustl.edu:/repository/sre login - (password "anonymous") - cvs -d :pserver:anonymous@skynet.wustl.edu:/repository/sre checkout squid - -If you encounter any bugs in this library, or you have any questions -or comments, please e-mail me at the address below. Due to limited -personal time, I may not respond, but I do read all my mail. - - Sean Eddy - eddy@genetics.wustl.edu - - HHMI/Dept. of Genetics - Washington University School of Medicine - 660 South Euclid Box 8232 - Saint Louis Missouri 63110 - USA - |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/squid/COPYRIGHT --- a/clustalomega/clustal-omega-0.2.0/src/squid/COPYRIGHT Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,41 +0,0 @@ -SQUID - a library of functions for biological sequence analysis -Copyright (C) 1992-2002 Washington University School of Medicine -All Rights Reserved - -This suite of programs is free software. You can redistribute it -and/or modify it under the terms of the GNU General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. - -In other words, you are free to modify, copy, or redistribute this -source code and its documentation in any way you like, but you must -distribute all derivative versions as free software under the same -terms that I've provided my code to you (i.e. the GNU General Public -License). This precludes any use of the code in proprietary or -commercial software unless your source code is made freely available. - -If you wish to use SQUID code under a different Open Source license -that's not compatible with the GPL (like the Artistic License, BSD -license, or the Netscape Public License), please contact me -(eddy@genetics.wustl.edu) for permission. - -Incorporation into commercial software under non-GPL terms is -possible, by arranging a license with the Washington University School -of Medicine Center for Technology Management (CTM). For this purpose, -the CTM is authorized to negotiate on behalf of the Howard Hughes -Medical Institute, the other copyright holder on the code. Certain -third party code modules may have to be removed from a non-GPL -distribution. Contact Jack Pincus (jhpincus@cris.com) to arrange -non-GPL licensing terms. - -This software is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this HMMER release, in the file LICENSE; if not, write to -the Free Software Foundation, Inc., 675 Mass. Ave, Cambridge, MA 02139 -USA. - - |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/squid/LICENSE --- a/clustalomega/clustal-omega-0.2.0/src/squid/LICENSE Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
b'@@ -1,339 +0,0 @@\n-\t\t GNU GENERAL PUBLIC LICENSE\n-\t\t Version 2, June 1991\n-\n- Copyright (C) 1989, 1991 Free Software Foundation, Inc.\n- 675 Mass Ave, Cambridge, MA 02139, USA\n- Everyone is permitted to copy and distribute verbatim copies\n- of this license document, but changing it is not allowed.\n-\n-\t\t\t Preamble\n-\n- The licenses for most software are designed to take away your\n-freedom to share and change it. By contrast, the GNU General Public\n-License is intended to guarantee your freedom to share and change free\n-software--to make sure the software is free for all its users. This\n-General Public License applies to most of the Free Software\n-Foundation\'s software and to any other program whose authors commit to\n-using it. (Some other Free Software Foundation software is covered by\n-the GNU Library General Public License instead.) You can apply it to\n-your programs, too.\n-\n- When we speak of free software, we are referring to freedom, not\n-price. Our General Public Licenses are designed to make sure that you\n-have the freedom to distribute copies of free software (and charge for\n-this service if you wish), that you receive source code or can get it\n-if you want it, that you can change the software or use pieces of it\n-in new free programs; and that you know you can do these things.\n-\n- To protect your rights, we need to make restrictions that forbid\n-anyone to deny you these rights or to ask you to surrender the rights.\n-These restrictions translate to certain responsibilities for you if you\n-distribute copies of the software, or if you modify it.\n-\n- For example, if you distribute copies of such a program, whether\n-gratis or for a fee, you must give the recipients all the rights that\n-you have. You must make sure that they, too, receive or can get the\n-source code. And you must show them these terms so they know their\n-rights.\n-\n- We protect your rights with two steps: (1) copyright the software, and\n-(2) offer you this license which gives you legal permission to copy,\n-distribute and/or modify the software.\n-\n- Also, for each author\'s protection and ours, we want to make certain\n-that everyone understands that there is no warranty for this free\n-software. If the software is modified by someone else and passed on, we\n-want its recipients to know that what they have is not the original, so\n-that any problems introduced by others will not reflect on the original\n-authors\' reputations.\n-\n- Finally, any free program is threatened constantly by software\n-patents. We wish to avoid the danger that redistributors of a free\n-program will individually obtain patent licenses, in effect making the\n-program proprietary. To prevent this, we have made it clear that any\n-patent must be licensed for everyone\'s free use or not licensed at all.\n-\n- The precise terms and conditions for copying, distribution and\n-modification follow.\n-\x0c\n-\t\t GNU GENERAL PUBLIC LICENSE\n- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\n-\n- 0. This License applies to any program or other work which contains\n-a notice placed by the copyright holder saying it may be distributed\n-under the terms of this General Public License. The "Program", below,\n-refers to any such program or work, and a "work based on the Program"\n-means either the Program or any derivative work under copyright law:\n-that is to say, a work containing the Program or a portion of it,\n-either verbatim or with modifications and/or translated into another\n-language. (Hereinafter, translation is included without limitation in\n-the term "modification".) Each licensee is addressed as "you".\n-\n-Activities other than copying, distribution and modification are not\n-covered by this License; they are outside its scope. The act of\n-running the Program is not restricted, and the output from the Program\n-is covered only if its contents constitute a work based on the\n-Program (independent of having been made by running the Program).\n-'..b'IGHT HOLDERS AND/OR OTHER PARTIES\n-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED\n-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS\n-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE\n-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,\n-REPAIR OR CORRECTION.\n-\n- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\n-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR\n-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,\n-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING\n-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED\n-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY\n-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER\n-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE\n-POSSIBILITY OF SUCH DAMAGES.\n-\n-\t\t END OF TERMS AND CONDITIONS\n-\x0c\n-\tAppendix: How to Apply These Terms to Your New Programs\n-\n- If you develop a new program, and you want it to be of the greatest\n-possible use to the public, the best way to achieve this is to make it\n-free software which everyone can redistribute and change under these terms.\n-\n- To do so, attach the following notices to the program. It is safest\n-to attach them to the start of each source file to most effectively\n-convey the exclusion of warranty; and each file should have at least\n-the "copyright" line and a pointer to where the full notice is found.\n-\n- <one line to give the program\'s name and a brief idea of what it does.>\n- Copyright (C) 19yy <name of author>\n-\n- This program is free software; you can redistribute it and/or modify\n- it under the terms of the GNU General Public License as published by\n- the Free Software Foundation; either version 2 of the License, or\n- (at your option) any later version.\n-\n- This program is distributed in the hope that it will be useful,\n- but WITHOUT ANY WARRANTY; without even the implied warranty of\n- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n- GNU General Public License for more details.\n-\n- You should have received a copy of the GNU General Public License\n- along with this program; if not, write to the Free Software\n- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\n-\n-Also add information on how to contact you by electronic and paper mail.\n-\n-If the program is interactive, make it output a short notice like this\n-when it starts in an interactive mode:\n-\n- Gnomovision version 69, Copyright (C) 19yy name of author\n- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w\'.\n- This is free software, and you are welcome to redistribute it\n- under certain conditions; type `show c\' for details.\n-\n-The hypothetical commands `show w\' and `show c\' should show the appropriate\n-parts of the General Public License. Of course, the commands you use may\n-be called something other than `show w\' and `show c\'; they could even be\n-mouse-clicks or menu items--whatever suits your program.\n-\n-You should also get your employer (if you work as a programmer) or your\n-school, if any, to sign a "copyright disclaimer" for the program, if\n-necessary. Here is a sample; alter the names:\n-\n- Yoyodyne, Inc., hereby disclaims all copyright interest in the program\n- `Gnomovision\' (which makes passes at compilers) written by James Hacker.\n-\n- <signature of Ty Coon>, 1 April 1989\n- Ty Coon, President of Vice\n-\n-This General Public License does not permit incorporating your program into\n-proprietary programs. If your program is a subroutine library, you may\n-consider it more useful to permit linking proprietary applications with the\n-library. If this is what you want to do, use the GNU Library General\n-Public License instead of this License.\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/squid/Makefile.am --- a/clustalomega/clustal-omega-0.2.0/src/squid/Makefile.am Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,43 +0,0 @@ -# Replaces squids own automake files -# -# Some useful automake documentation: -# http://www.openismus.com/documents/linux/automake/automake.shtml -# http://www.bioinf.uni-freiburg.de/~mmann/HowTo/automake.html - -#SUBDIRS = -EXTRA_DIST = COPYRIGHT LICENSE 00README clustalo.README squid-1.9g.tar.gz -#LDADD = - -# need DCLUSTALO here to enable Clustal specific squid patches -# CLUSTALO is also defined in ../config.h which is included by squid.h -# but some files do not include squid.h -AM_CFLAGS = -DCLUSTALO -DSRE_STRICT_ANSI @AM_CFLAGS@ - -noinst_LTLIBRARIES = libsquid.la - -libsquid_la_SOURCES = a2m.c aligneval.c alignio.c \ - clustal.c cluster.c \ - dayhoff.c \ - eps.c \ - file.c \ - getopt.c gki.c gki.h gsi.c gsi.h gsi64.c gsi64.h \ - hsregex.c \ - iupac.c \ - msa.c msa.h msf.c \ - phylip.c \ - revcomp.c rk.c rk.h \ - selex.c seqencode.c shuffle.c sqerror.c sqfuncs.h sqio.c squid.h squidcore.c \ - sre_ctype.c sre_math.c sre_random.c sre_random.h sre_string.c \ - ssi.c ssi.h stack.c stockholm.c stockholm.h stopwatch.c stopwatch.h \ - translate.c types.c vectorops.c \ - vectorops.h version.h \ - weight.c - -library_includedir=$(includedir)/clustalo/squid - -library_include_HEADERS = gki.h gsi64.h msa.h rk.h \ - squid.h stopwatch.h sqfuncs.h \ - sre_random.h ssi.h stockholm.h \ - vectorops.h version.h - - |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/squid/Makefile.in --- a/clustalomega/clustal-omega-0.2.0/src/squid/Makefile.in Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,606 +0,0 @@\n-# Makefile.in generated by automake 1.11.1 from Makefile.am.\n-# @configure_input@\n-\n-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,\n-# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,\n-# Inc.\n-# This Makefile.in is free software; the Free Software Foundation\n-# gives unlimited permission to copy and/or distribute it,\n-# with or without modifications, as long as this notice is preserved.\n-\n-# This program is distributed in the hope that it will be useful,\n-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without\n-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A\n-# PARTICULAR PURPOSE.\n-\n-@SET_MAKE@\n-\n-# Replaces squids own automake files\n-#\n-# Some useful automake documentation:\n-# http://www.openismus.com/documents/linux/automake/automake.shtml\n-# http://www.bioinf.uni-freiburg.de/~mmann/HowTo/automake.html\n-\n-\n-VPATH = @srcdir@\n-pkgdatadir = $(datadir)/@PACKAGE@\n-pkgincludedir = $(includedir)/@PACKAGE@\n-pkglibdir = $(libdir)/@PACKAGE@\n-pkglibexecdir = $(libexecdir)/@PACKAGE@\n-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd\n-install_sh_DATA = $(install_sh) -c -m 644\n-install_sh_PROGRAM = $(install_sh) -c\n-install_sh_SCRIPT = $(install_sh) -c\n-INSTALL_HEADER = $(INSTALL_DATA)\n-transform = $(program_transform_name)\n-NORMAL_INSTALL = :\n-PRE_INSTALL = :\n-POST_INSTALL = :\n-NORMAL_UNINSTALL = :\n-PRE_UNINSTALL = :\n-POST_UNINSTALL = :\n-build_triplet = @build@\n-host_triplet = @host@\n-subdir = src/squid\n-DIST_COMMON = $(library_include_HEADERS) $(srcdir)/Makefile.am \\\n-\t$(srcdir)/Makefile.in\n-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4\n-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_prefix_config_h.m4 \\\n-\t$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \\\n-\t$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \\\n-\t$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/ax_openmp.m4 \\\n-\t$(top_srcdir)/configure.ac\n-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \\\n-\t$(ACLOCAL_M4)\n-mkinstalldirs = $(install_sh) -d\n-CONFIG_HEADER = $(top_builddir)/src/config.h\n-CONFIG_CLEAN_FILES =\n-CONFIG_CLEAN_VPATH_FILES =\n-LTLIBRARIES = $(noinst_LTLIBRARIES)\n-libsquid_la_LIBADD =\n-am_libsquid_la_OBJECTS = a2m.lo aligneval.lo alignio.lo clustal.lo \\\n-\tcluster.lo dayhoff.lo eps.lo file.lo getopt.lo gki.lo gsi.lo \\\n-\tgsi64.lo hsregex.lo iupac.lo msa.lo msf.lo phylip.lo \\\n-\trevcomp.lo rk.lo selex.lo seqencode.lo shuffle.lo sqerror.lo \\\n-\tsqio.lo squidcore.lo sre_ctype.lo sre_math.lo sre_random.lo \\\n-\tsre_string.lo ssi.lo stack.lo stockholm.lo stopwatch.lo \\\n-\ttranslate.lo types.lo vectorops.lo weight.lo\n-libsquid_la_OBJECTS = $(am_libsquid_la_OBJECTS)\n-DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src\n-depcomp = $(SHELL) $(top_srcdir)/depcomp\n-am__depfiles_maybe = depfiles\n-am__mv = mv -f\n-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \\\n-\t$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)\n-LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \\\n-\t--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \\\n-\t$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)\n-CCLD = $(CC)\n-LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \\\n-\t--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \\\n-\t$(LDFLAGS) -o $@\n-SOURCES = $(libsquid_la_SOURCES)\n-DIST_SOURCES = $(libsquid_la_SOURCES)\n-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed \'s|.|.|g\'`;\n-am__vpath_adj = case $$p in \\\n- $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \\\n- *) f=$$p;; \\\n- esac;\n-am__strip_dir = f=`echo $$p | sed -e \'s|^.*/||\'`;\n-am__install_max = 40\n-am__nobase_strip_setup = \\\n- srcdirstrip=`echo "$(srcdir)" | sed \'s/[].[^$$\\\\*|]/\\\\\\\\&/g\'`\n-am__nobase_strip = \\\n- for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"\n-am__nobase_list = $(am__nobase_strip_setup); \\\n- for p in $$list; do echo "$$p $$p"; done | \\\n- sed "s| $$srcdirstrip/| |;"\' / .*\\//!s/ .*/ ./; s,\\( .*\\)/[^/]*$$,\\1,\' | \\\n- $(AWK) \'BEGIN '..b'lddir)/|;t"`; \\\n-\tcase $$dist_files in \\\n-\t */*) $(MKDIR_P) `echo "$$dist_files" | \\\n-\t\t\t sed \'/\\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,\' | \\\n-\t\t\t sort -u` ;; \\\n-\tesac; \\\n-\tfor file in $$dist_files; do \\\n-\t if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \\\n-\t if test -d $$d/$$file; then \\\n-\t dir=`echo "/$$file" | sed -e \'s,/[^/]*$$,,\'`; \\\n-\t if test -d "$(distdir)/$$file"; then \\\n-\t find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \\;; \\\n-\t fi; \\\n-\t if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \\\n-\t cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \\\n-\t find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \\;; \\\n-\t fi; \\\n-\t cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \\\n-\t else \\\n-\t test -f "$(distdir)/$$file" \\\n-\t || cp -p $$d/$$file "$(distdir)/$$file" \\\n-\t || exit 1; \\\n-\t fi; \\\n-\tdone\n-check-am: all-am\n-check: check-am\n-all-am: Makefile $(LTLIBRARIES) $(HEADERS)\n-installdirs:\n-\tfor dir in "$(DESTDIR)$(library_includedir)"; do \\\n-\t test -z "$$dir" || $(MKDIR_P) "$$dir"; \\\n-\tdone\n-install: install-am\n-install-exec: install-exec-am\n-install-data: install-data-am\n-uninstall: uninstall-am\n-\n-install-am: all-am\n-\t@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am\n-\n-installcheck: installcheck-am\n-install-strip:\n-\t$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \\\n-\t install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \\\n-\t `test -z \'$(STRIP)\' || \\\n-\t echo "INSTALL_PROGRAM_ENV=STRIPPROG=\'$(STRIP)\'"` install\n-mostlyclean-generic:\n-\n-clean-generic:\n-\n-distclean-generic:\n-\t-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)\n-\t-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)\n-\n-maintainer-clean-generic:\n-\t@echo "This command is intended for maintainers to use"\n-\t@echo "it deletes files that may require special tools to rebuild."\n-clean: clean-am\n-\n-clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \\\n-\tmostlyclean-am\n-\n-distclean: distclean-am\n-\t-rm -rf ./$(DEPDIR)\n-\t-rm -f Makefile\n-distclean-am: clean-am distclean-compile distclean-generic \\\n-\tdistclean-tags\n-\n-dvi: dvi-am\n-\n-dvi-am:\n-\n-html: html-am\n-\n-html-am:\n-\n-info: info-am\n-\n-info-am:\n-\n-install-data-am: install-library_includeHEADERS\n-\n-install-dvi: install-dvi-am\n-\n-install-dvi-am:\n-\n-install-exec-am:\n-\n-install-html: install-html-am\n-\n-install-html-am:\n-\n-install-info: install-info-am\n-\n-install-info-am:\n-\n-install-man:\n-\n-install-pdf: install-pdf-am\n-\n-install-pdf-am:\n-\n-install-ps: install-ps-am\n-\n-install-ps-am:\n-\n-installcheck-am:\n-\n-maintainer-clean: maintainer-clean-am\n-\t-rm -rf ./$(DEPDIR)\n-\t-rm -f Makefile\n-maintainer-clean-am: distclean-am maintainer-clean-generic\n-\n-mostlyclean: mostlyclean-am\n-\n-mostlyclean-am: mostlyclean-compile mostlyclean-generic \\\n-\tmostlyclean-libtool\n-\n-pdf: pdf-am\n-\n-pdf-am:\n-\n-ps: ps-am\n-\n-ps-am:\n-\n-uninstall-am: uninstall-library_includeHEADERS\n-\n-.MAKE: install-am install-strip\n-\n-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \\\n-\tclean-libtool clean-noinstLTLIBRARIES ctags distclean \\\n-\tdistclean-compile distclean-generic distclean-libtool \\\n-\tdistclean-tags distdir dvi dvi-am html html-am info info-am \\\n-\tinstall install-am install-data install-data-am install-dvi \\\n-\tinstall-dvi-am install-exec install-exec-am install-html \\\n-\tinstall-html-am install-info install-info-am \\\n-\tinstall-library_includeHEADERS install-man install-pdf \\\n-\tinstall-pdf-am install-ps install-ps-am install-strip \\\n-\tinstallcheck installcheck-am installdirs maintainer-clean \\\n-\tmaintainer-clean-generic mostlyclean mostlyclean-compile \\\n-\tmostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \\\n-\ttags uninstall uninstall-am uninstall-library_includeHEADERS\n-\n-\n-# Tell versions [3.59,3.63) of GNU make to not export all variables.\n-# Otherwise a system limit (for SysV at least) may be exceeded.\n-.NOEXPORT:\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/squid/a2m.c --- a/clustalomega/clustal-omega-0.2.0/src/squid/a2m.c Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,134 +0,0 @@ -/***************************************************************** - * SQUID - a library of functions for biological sequence analysis - * Copyright (C) 1992-2002 Washington University School of Medicine - * - * This source code is freely distributed under the terms of the - * GNU General Public License. See the files COPYRIGHT and LICENSE - * for details. - *****************************************************************/ - -/* a2m.c - * - * reading/writing A2M (aligned FASTA) files. - * - * RCS $Id: a2m.c 242 2011-05-27 14:04:21Z andreas $ (Original squid RCS Id: a2m.c,v 1.1 1999/07/15 22:26:40 eddy Exp) - */ - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include "squid.h" -#include "msa.h" - -/* Function: ReadA2M() - * Date: SRE, Sun Jun 6 17:11:29 1999 [bus from Madison 1999 worm mtg] - * - * Purpose: Parse an alignment read from an open A2M format - * alignment file. A2M is a single alignment format. - * Return the alignment, or NULL if we've already - * read the alignment. - * - * Args: afp - open alignment file - * - * Returns: MSA * - an alignment object. - * Caller responsible for an MSAFree() - */ -MSA * -ReadA2M(MSAFILE *afp) -{ - MSA *msa; - char *buf; - char *name; - char *desc; - char *seq; - int idx; - int len1, len2; - - if (feof(afp->f)) return NULL; - - name = NULL; - msa = MSAAlloc(10, 0); - idx = 0; - while ((buf = MSAFileGetLine(afp)) != NULL) - { - if (*buf == '>') - { - buf++; /* skip the '>' */ - if ((name = sre_strtok(&buf, WHITESPACE, &len1)) == NULL) - Die("Blank name in A2M file %s (line %d)\n", afp->fname, afp->linenumber); - desc = sre_strtok(&buf, "\n", &len2); - - idx = GKIStoreKey(msa->index, name); - if (idx >= msa->nseqalloc) MSAExpand(msa); - - msa->sqname[idx] = sre_strdup(name, len1); - if (desc != NULL) MSASetSeqDescription(msa, idx, desc); - msa->nseq++; - } - else if (name != NULL) - { - if ((seq = sre_strtok(&buf, WHITESPACE, &len1)) == NULL) continue; - msa->sqlen[idx] = sre_strcat(&(msa->aseq[idx]), msa->sqlen[idx], seq, len1); - } - } - if (name == NULL) { MSAFree(msa); return NULL; } - - MSAVerifyParse(msa); - return msa; -} - - -/* Function: WriteA2M() - * Date: SRE, Sun Jun 6 17:40:35 1999 [bus from Madison, 1999 worm mtg] - * - * Purpose: Write an "aligned FASTA" (aka a2m, to UCSC) formatted - * alignment. - * - * Args: fp - open FILE to write to. - * msa - alignment to write - * - * Returns: void - */ -void -#ifdef CLUSTALO -WriteA2M(FILE *fp, MSA *msa, int vienna) -#else -WriteA2M(FILE *fp, MSA *msa) -#endif -{ - int idx; /* sequence index */ - int pos; /* position in sequence */ - char buf[64]; /* buffer for individual lines */ - int cpl = 60; /* char per line; must be < 64 unless buf is bigger */ - - buf[cpl] = '\0'; - for (idx = 0; idx < msa->nseq; idx++) - { -#ifdef CLUSTALO - /* most fasta sequences don't have a description, which - * leads to a trailing white space in the original code - */ - fprintf(fp, ">%s", msa->sqname[idx]); - - if (msa->sqdesc != NULL && msa->sqdesc[idx] != NULL && !vienna) { - fprintf(fp, " %s", msa->sqdesc[idx]); - } - fprintf(fp, "\n"); -#else - fprintf(fp, ">%s %s\n", - msa->sqname[idx], - (msa->sqdesc != NULL && msa->sqdesc[idx] != NULL) ? msa->sqdesc[idx] : ""); -#endif - for (pos = 0; pos < msa->alen; pos+=cpl) - { - strncpy(buf, &(msa->aseq[idx][pos]), cpl); - if (vienna) - fprintf(fp, "%s", buf); - else - fprintf(fp, "%s\n", buf); - } - if (vienna) - fprintf(fp, "\n"); - - } -} |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/squid/aligneval.c --- a/clustalomega/clustal-omega-0.2.0/src/squid/aligneval.c Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,527 +0,0 @@\n-/*****************************************************************\n- * SQUID - a library of functions for biological sequence analysis\n- * Copyright (C) 1992-2002 Washington University School of Medicine\n- * \n- * This source code is freely distributed under the terms of the\n- * GNU General Public License. See the files COPYRIGHT and LICENSE\n- * for details.\n- *****************************************************************/\n-\n-/* aligneval.c\n- * \n- * Comparison of multiple alignments. Three functions are\n- * provided, using subtly different scoring schemes:\n- * CompareMultAlignments() - basic scoring scheme\n- * CompareRefMultAlignments() - only certain "canonical" columns \n- * are scored\n- * \n- * The similarity measure is a fractional alignment identity averaged\n- * over all sequence pairs. The score for all pairs is:\n- * (identically aligned symbols) / (total aligned columns in \n- * known alignment)\n- * \n- * A column c is identically aligned for sequences i, j if:\n- * 1) both i,j have a symbol aligned in column c, and the\n- * same pair of symbols is aligned somewhere in the test\n- * alignment\n- * 2) S[i][c] is aligned to a gap in sequence j, and that symbol\n- * is aligned to a gap in the test alignment\n- * 3) converse of 2)\n- * \n- * \n- * The algorithm is as follows:\n- * 1) For each known/test aligned pair of sequences (k1,k2 and t1,t2)\n- * construct a list for each sequence, in which for every\n- * counted symbol we record the raw index of the symbol in\n- * the other sequence that it aligns to, or -1 if it aligns\n- * to a gap or uncounted symbol.\n- * \n- * 2) Compare the list for k1 to the list for t1 and count an identity \n- * for each correct alignment.\n- * \n- * 3) Repeat 2) for comparing k2 to t2. Note that this means correct sym/sym\n- * alignments count for 2; correct sym/gap alignments count for 1.\n- * \n- * 4) The score is (identities from 2 + identities from 3) / \n- * (totals from 2 + totals from 3).\n- *\n- * Written originally for koala\'s ss2 pairwise alignment package.\n- * \n- * Sean Eddy, Sun Nov 1 12:45:11 1992\n- * SRE, Thu Jul 29 16:47:18 1993: major revision: all functions replaced by new algorithm\n- * CVS $Id: aligneval.c,v 1.7 2002/10/09 14:26:09 eddy Exp)\n- */\n-\n-\n-#include <stdio.h>\n-#include <string.h>\n-#include <ctype.h>\n-#include "squid.h"\n-#include "sre_random.h"\n-\n-static int make_alilist(char *s1, char *s2, int **ret_s1_list, int *ret_listlen);\n-static int make_ref_alilist(int *refcoords, char *k1, char *k2, char *s1, char *s2, \n-\t\t\t int **ret_s1_list, int *ret_listlen);\n-static int compare_lists(int *k1, int *k2, int *t1, int *t2, int len1, int len2, float *ret_sc);\n-\n-\n-/* Function: ComparePairAlignments\n- * \n- * Purpose: Calculate and return a number representing how well two different alignments\n- * of a pair of sequences compare. The number is, roughly speaking,\n- * the fraction of columns which are identically aligned.\n- * \n- * For all columns c in which either known1[c] or known2[c] \n- * is a non-gap, count an identity if those same symbols are\n- * aligned somewhere in calc1/calc2. The score is identities/total\n- * columns examined. (i.e. fully gapped columns don\'t count)\n- * \n- * more explicitly, identities come from:\n- * both known and test aligned pairs have the same symbol in the first sequence aligned to\n- * a gap in the second sequence;\n- * both known and test aligned pairs have the same symbol in the second sequence\n- * aligned to a gap in the first sequence;\n- * the known alignment has symbols aligned at this column, and the test\n- * alignment aligns the same two symbols.\n- * \n- * Args: known1, known2: trusted al'..b'ctual\n- * gappy alignments would have high "identities".\n- * idents/(AVG|MAX)(len1,len2) both have the disadvantage that \n- * alignments of fragments to longer sequences would have\n- * artifactually low "identities".\n- * \n- * Original Case sensitive; also, watch out in nucleic acid alignments; \n- * U/T RNA/DNA alignments will be counted as mismatches!\n- *\n- * Clustal Omega patch: Case insensitive and T and U are treated the same\n- */\n-float\n-PairwiseIdentity(char *s1, char *s2)\n-{\n- int idents;\t\t/* total identical positions */\n- int len1, len2;\t\t/* lengths of seqs */\n- int x;\t\t\t/* position in aligned seqs */\n-\n- idents = len1 = len2 = 0;\n- for (x = 0; s1[x] != \'\\0\' && s2[x] != \'\\0\'; x++) \n- {\n-#ifdef CLUSTALO\n- char c1 = toupper(s1[x]);\n- char c2 = toupper(s2[x]);\n- if (c1==\'U\')\n- c1 = \'T\';\n- if (c2==\'U\')\n- c2 = \'T\';\n- \n- if (!isgap(c1)) {\n- len1++;\n- if (c1 == c2)\n- idents++;\n- }\n- if (!isgap(c2))\n- len2++; \n-#else \n- if (!isgap(s1[x])) {\n-\tlen1++;\n-\tif (s1[x] == s2[x]) idents++; \n- }\n- if (!isgap(s2[x])) len2++;\n-#endif\n- }\n- if (len2 < len1) len1 = len2;\n- return (len1 == 0 ? 0.0 : (float) idents / (float) len1);\n-}\n-\n-\n-\n-/* Function: AlignmentIdentityBySampling()\n- * Date: SRE, Mon Oct 19 14:29:01 1998 [St. Louis]\n- *\n- * Purpose: Estimate and return the average pairwise\n- * fractional identity of an alignment,\n- * using sampling.\n- * \n- * For use when there\'s so many sequences that\n- * an all vs. all rigorous calculation will\n- * take too long.\n- * \n- * Case sensitive!\n- *\n- * Args: aseq - aligned sequences\n- * L - length of alignment\n- * N - number of seqs in alignment\n- * nsample - number of samples \n- *\n- * Returns: average fractional identity, 0..1.\n- */\n-float\n-AlignmentIdentityBySampling(char **aseq, int L, int N, int nsample)\n-{\n- int x, i, j;\t\t\t/* counters */\n- float sum;\n-\n- if (N < 2) return 1.0;\n-\n- sum = 0.;\n- for (x = 0; x < nsample; x++)\n- {\n- i = CHOOSE(N);\n- do { j = CHOOSE(N); } while (j == i); /* make sure j != i */\n- sum += PairwiseIdentity(aseq[i], aseq[j]);\n- }\n- return sum / (float) nsample;\n-}\n-\n-/* Function: MajorityRuleConsensus()\n- * Date: SRE, Tue Mar 7 15:30:30 2000 [St. Louis]\n- *\n- * Purpose: Given a set of aligned sequences, produce a\n- * majority rule consensus sequence. If >50% nonalphabetic\n- * (usually meaning gaps) in the column, ignore the column.\n- *\n- * Args: aseq - aligned sequences, [0..nseq-1][0..alen-1]\n- * nseq - number of sequences\n- * alen - length of alignment \n- *\n- * Returns: ptr to allocated consensus sequence.\n- * Caller is responsible for free\'ing this.\n- */\n-char *\n-MajorityRuleConsensus(char **aseq, int nseq, int alen)\n-{\n- char *cs; /* RETURN: consensus sequence */\n- int count[27];\t\t/* counts for a..z and gaps in a column */\n- int idx,apos;\t\t\t/* counters for seq, column */\n- int spos;\t\t\t/* position in cs */\n- int x;\t\t\t/* counter for characters */\n- int sym;\n- int max, bestx;\n- \n- cs = MallocOrDie(sizeof(char) * (alen+1));\n- \n- for (spos=0,apos=0; apos < alen; apos++)\n- {\n- for (x = 0; x < 27; x++) count[x] = 0;\n-\n- for (idx = 0; idx < nseq; idx++)\n-\t{\n-\t if (isalpha(aseq[idx][apos])) {\n-\t sym = toupper(aseq[idx][apos]);\n-\t count[sym-\'A\']++;\n-\t } else {\n-\t count[26]++;\n-\t }\n-\t}\n-\n- if ((float) count[26] / (float) nseq <= 0.5) {\n-\tmax = bestx = -1;\n-\tfor (x = 0; x < 26; x++) \n-\t if (count[x] > max) { max = count[x]; bestx = x; }\n-\tcs[spos++] = (char) (\'A\' + bestx);\n- }\n- }\n- cs[spos] = \'\\0\';\n- return cs;\n-}\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/squid/alignio.c --- a/clustalomega/clustal-omega-0.2.0/src/squid/alignio.c Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,639 +0,0 @@\n-/*****************************************************************\n- * SQUID - a library of functions for biological sequence analysis\n- * Copyright (C) 1992-2002 Washington University School of Medicine\n- * \n- * This source code is freely distributed under the terms of the\n- * GNU General Public License. See the files COPYRIGHT and LICENSE\n- * for details.\n- *****************************************************************/\n-\n-/* alignio.c\n- * SRE, Mon Jul 12 11:57:37 1993\n- * RCS $Id: alignio.c 217 2011-03-19 10:27:10Z andreas $ (Original squid RCS Id: alignio.c,v 1.11 2002/10/09 14:26:09 eddy Exp)\n- * \n- * Input/output of sequence alignments.\n- */\n-\n-#include <stdio.h>\n-#include <stdlib.h>\n-#include <string.h>\n-#include <ctype.h>\n-#include "squid.h"\n-#include "sre_random.h"\n-\n-/* Function: AllocAlignment()\n- * \n- * Purpose: Allocate space for an alignment, given the number\n- * of sequences and the alignment length in columns.\n- * \n- * Args: nseq - number of sequences\n- * alen - width of alignment\n- * ret_aseq - RETURN: alignment itself\n- * ainfo - RETURN: other info associated with alignment\n- * \n- * Return: (void)\n- * aseq, ainfo free\'d by caller: FreeAlignment(aseq, &ainfo).\n- * note that ainfo itself is alloc\'ed in caller, usually\n- * just by a "AINFO ainfo" definition.\n- */\n-void\n-AllocAlignment(int nseq, int alen, char ***ret_aseq, AINFO *ainfo)\n-{\n- char **aseq;\n- int idx;\n-\n- InitAinfo(ainfo);\n-\n- aseq = (char **) MallocOrDie (sizeof(char *) * nseq);\n- for (idx = 0; idx < nseq; idx++)\n- aseq[idx] = (char *) MallocOrDie (sizeof(char) * (alen+1));\n-\n- ainfo->alen = alen;\n- ainfo->nseq = nseq;\n-\n- ainfo->wgt = (float *) MallocOrDie (sizeof(float) * nseq);\n- FSet(ainfo->wgt, nseq, 1.0);\n-\n- ainfo->sqinfo = (SQINFO *) MallocOrDie (sizeof(SQINFO) * nseq);\n- for (idx = 0; idx < nseq; idx++)\n- ainfo->sqinfo[idx].flags = 0;\n-\n- *ret_aseq = aseq;\n-}\n- \n-\n-/* Function: InitAinfo()\n- * Date: SRE, Tue Jan 19 10:16:02 1999 [St. Louis]\n- *\n- * Purpose: Initialize the fields in ainfo structure to\n- * default (null) values. Does nothing with \n- * fields that are dependent on nseq or alen.\n- *\n- * Args: ainfo - optional info structure for an alignment\n- *\n- * Returns: (void). ainfo is modified.\n- */\n-void\n-InitAinfo(AINFO *ainfo)\n-{\n- ainfo->name = NULL;\n- ainfo->desc = NULL;\n- ainfo->cs = NULL;\n- ainfo->rf = NULL;\n- ainfo->acc = NULL;\n- ainfo->au = NULL;\n- ainfo->flags = 0;\n-\n- ainfo->tc1 = ainfo->tc2 = 0.0;\n- ainfo->nc1 = ainfo->nc2 = 0.0;\n- ainfo->ga1 = ainfo->ga2 = 0.0;\n-}\n-\n-\n-/* Function: FreeAlignment()\n- * \n- * Purpose: Free the space allocated to alignment, names, and optional\n- * information. \n- * \n- * Args: aseqs - sequence alignment\n- * ainfo - associated alignment data.\n- */ \n-void\n-FreeAlignment(char **aseqs, AINFO *ainfo)\n-{\n- int i;\n-\n- for (i = 0; i < ainfo->nseq; i++)\n- {\n- if (ainfo->sqinfo[i].flags & SQINFO_SS) free(ainfo->sqinfo[i].ss);\n- if (ainfo->sqinfo[i].flags & SQINFO_SA) free(ainfo->sqinfo[i].sa);\n- }\n- if (ainfo->cs != NULL) free(ainfo->cs);\n- if (ainfo->rf != NULL) free(ainfo->rf);\n- if (ainfo->name != NULL) free(ainfo->name);\n- if (ainfo->desc != NULL) free(ainfo->desc);\n- if (ainfo->acc != NULL) free(ainfo->acc);\n- if (ainfo->au != NULL) free(ainfo->au);\n-\n- free(ainfo->sqinfo);\n- free(ainfo->wgt);\n- Free2DArray((void **) aseqs, ainfo->nseq);\n-}\n-\n-\n-\n-/* Function: SAMizeAlignment()\n- * Date: SRE, Tue Jun 30 09:49:40 1998 [St. Louis]\n- *\n- * Purpose: Make a "best effort" attempt to convert an alignment\n- * to SAM gap format: - in delete col, . in insert col.\n- * Only works if alignment adheres to SAM\'s upper/lower\n- * case convention, which is true for instance of old\n-'..b', SQINFO *sqinfo, int nseq, float pop, float pex,\n-\t\tchar ***ret_aseqs, AINFO *ainfo)\n-{\n- char **aseqs; /* RETURN: alignment */\n- int alen;\t\t\t/* length of alignment */\n- int *rlen; /* lengths of each raw sequence */\n- int M;\t\t\t/* length of "model" */\n- int **ins; /* insertion counts, 0..nseq-1 by 0..M */\n- int *master_ins; /* max insertion counts, 0..M */\n- int apos, rpos, idx;\n- int statepos;\n- int count;\n- int minlen;\n-\n- /* calculate expected length of model, M\n- */\n- rlen = (int *) MallocOrDie (sizeof(int) * nseq);\n- M = 0;\n- minlen = 9999999;\n- for (idx = 0; idx < nseq; idx++)\n- {\n- rlen[idx] = strlen(rseqs[idx]);\n- M += rlen[idx];\n- minlen = (rlen[idx] < minlen) ? rlen[idx] : minlen;\n- }\n- M = (int) ((float) M / (1.0 + pop * (1.0 + 1.0 / (1.0 - pex))));\n- M /= nseq;\n- if (M > minlen) M = minlen;\n-\n- /* make arrays that count insertions in M+1 possible insert states\n- */\n- ins = (int **) MallocOrDie (sizeof(int *) * nseq);\n- master_ins = (int *) MallocOrDie (sizeof(int) * (M+1));\n- for (idx = 0; idx < nseq; idx++)\n- {\n- ins[idx] = (int *) MallocOrDie (sizeof(int) * (M+1));\n- for (rpos = 0; rpos <= M; rpos++)\n-\tins[idx][rpos] = 0;\n- }\n-\t\t\t\t/* normalize */\n- pop = pop / (pop+pex);\n- pex = 1.0 - pop;\n-\t\t\t\t/* make insertions for individual sequences */\n- for (idx = 0; idx < nseq; idx++)\n- {\n- apos = -1;\n- for (rpos = 0; rpos < rlen[idx]-M; rpos++)\n-\t{\n-\t if (sre_random() < pop || apos == -1)\t/* open insertion */\n-\t apos = CHOOSE(M+1); /* choose 0..M */\n-\t ins[idx][apos]++;\n-\t}\n- }\n-\t\t\t\t/* calculate master_ins, max inserts */\n- alen = M;\n- for (apos = 0; apos <= M; apos++)\n- {\n- master_ins[apos] = 0;\n- for (idx = 0; idx < nseq; idx++)\n-\tif (ins[idx][apos] > master_ins[apos])\n-\t master_ins[apos] = ins[idx][apos];\n- alen += master_ins[apos];\n- }\n-\n-\n- /* Now, construct alignment\n- */\n- aseqs = (char **) MallocOrDie (sizeof (char *) * nseq);\n- for (idx = 0; idx < nseq; idx++)\n- aseqs[idx] = (char *) MallocOrDie (sizeof(char) * (alen+1));\n- for (idx = 0; idx < nseq; idx++)\n- {\n- apos = rpos = 0;\n-\n- for (statepos = 0; statepos <= M; statepos++)\n-\t{\n-\t for (count = 0; count < ins[idx][statepos]; count++)\n-\t aseqs[idx][apos++] = rseqs[idx][rpos++];\n-\t for (; count < master_ins[statepos]; count++)\n-\t aseqs[idx][apos++] = \' \';\n-\n-\t if (statepos != M)\n-\t aseqs[idx][apos++] = rseqs[idx][rpos++];\n-\t}\n- aseqs[idx][alen] = \'\\0\';\n- }\n- ainfo->flags = 0;\n- ainfo->alen = alen; \n- ainfo->nseq = nseq;\n- ainfo->sqinfo = (SQINFO *) MallocOrDie (sizeof(SQINFO) * nseq);\n- for (idx = 0; idx < nseq; idx++)\n- SeqinfoCopy(&(ainfo->sqinfo[idx]), &(sqinfo[idx]));\n-\n- free(rlen);\n- free(master_ins);\n- Free2DArray((void **) ins, nseq);\n- *ret_aseqs = aseqs;\n- return 1;\n-}\n-\n-/* Function: AlignmentHomogenousGapsym()\n- * Date: SRE, Sun Mar 19 19:37:12 2000 [wren, St. Louis]\n- *\n- * Purpose: Sometimes we\'ve got to convert alignments to \n- * a lowest common denominator, and we need\n- * a single specific gap character -- for example,\n- * PSI-BLAST blastpgp -B takes a very simplistic\n- * alignment input format which appears to only\n- * allow \'-\' as a gap symbol.\n- * \n- * Anything matching the isgap() macro is\n- * converted.\n- *\n- * Args: aseq - aligned character strings, [0..nseq-1][0..alen-1]\n- * nseq - number of aligned strings\n- * alen - length of alignment\n- * gapsym - character to use for gaps. \n- *\n- * Returns: void ("never fails")\n- */\n-void\n-AlignmentHomogenousGapsym(char **aseq, int nseq, int alen, char gapsym)\n-{\n- int i, apos;\n-\n- for (i = 0; i < nseq; i++)\n- for (apos = 0; apos < alen; apos++)\n- if (isgap(aseq[i][apos])) aseq[i][apos] = gapsym;\n-}\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/squid/clustal.c --- a/clustalomega/clustal-omega-0.2.0/src/squid/clustal.c Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,329 +0,0 @@\n-/*****************************************************************\n- * SQUID - a library of functions for biological sequence analysis\n- * Copyright (C) 1992-2002 Washington University School of Medicine\n- * \n- * This source code is freely distributed under the terms of the\n- * GNU General Public License. See the files COPYRIGHT and LICENSE\n- * for details.\n- *****************************************************************/\n-\n-/* clustal.c\n- * SRE, Sun Jun 6 17:50:45 1999 [bus from Madison, 1999 worm mtg]\n- * \n- * Import/export of ClustalV/W multiple sequence alignment\n- * formatted files. Derivative of msf.c; MSF is a pretty\n- * generic interleaved format. \n- * \n- * RCS $Id: clustal.c 228 2011-03-29 14:05:27Z dave $ (Original squid RCS Id: clustal.c,v 1.1 1999/07/15 22:26:53 eddy Exp)\n- */\n-\n-#include <stdio.h>\n-#include <stdlib.h>\n-#include <string.h>\n-#include <ctype.h>\n-#include "squid.h"\n-#include "msa.h"\n-\n-#ifdef CLUSTALO\n-/* needed for PACKAGE_VERSION */\n-#include "../config.h"\n-\n-#ifndef min\n-\t#define min( a, b ) ( ((a) < (b)) ? (a) : (b) )\n-#endif\n-\n-/*These are all the positively scoring groups that occur in the Gonnet Pam250\n-matrix. There are strong and weak groups, defined as strong score >0.5 and\n-weak score =<0.5. Strong matching columns to be assigned \':\' and weak matches\n-assigned \'.\' in the clustal output format.\n-amino_strong = res_cat1\n-amino_weak = res_cat2\n-*/\n-\n-char *amino_strong[] = {"STA", "NEQK", "NHQK", "NDEQ", "QHRK", "MILV",\n- "MILF", "HY", "FYW", NULL};\n-\n-char *amino_weak[] = {"CSA", "ATV", "SAG", "STNK", "STPA", "SGND",\n- "SNDEQK", "NDEQHK", "NEQHRK", "FVLIM", "HFY", NULL};\n-\n-#endif\n-\n-#ifdef TESTDRIVE_CLUSTAL\n-/*****************************************************************\n- * msf.c test driver: \n- * cc -DTESTDRIVE_CLUSTAL -g -O2 -Wall -o test clustal.c msa.c gki.c sqerror.c sre_string.c file.c hsregex.c sre_math.c sre_ctype.c -lm\n- * \n- */\n-int\n-main(int argc, char **argv)\n-{\n- MSAFILE *afp;\n- MSA *msa;\n- char *file;\n- \n- file = argv[1];\n-\n- if ((afp = MSAFileOpen(file, MSAFILE_CLUSTAL, NULL)) == NULL)\n- Die("Couldn\'t open %s\\n", file);\n-\n- while ((msa = ReadClustal(afp)) != NULL)\n- {\n- WriteClustal(stdout, msa);\n- MSAFree(msa); \n- }\n- \n- MSAFileClose(afp);\n- exit(0);\n-}\n-/******************************************************************/\n-#endif /* testdrive_clustal */\n-\n-\n-/* Function: ReadClustal()\n- * Date: SRE, Sun Jun 6 17:53:49 1999 [bus from Madison, 1999 worm mtg]\n- *\n- * Purpose: Parse an alignment read from an open Clustal format\n- * alignment file. Clustal is a single-alignment format.\n- * Return the alignment, or NULL if we have no data.\n- * \n- * Args: afp - open alignment file\n- *\n- * Returns: MSA * - an alignment object\n- * caller responsible for an MSAFree()\n- * NULL if no more alignments\n- *\n- * Diagnostics: \n- * Will Die() here with a (potentially) useful message\n- * if a parsing error occurs.\n- */\n-MSA *\n-ReadClustal(MSAFILE *afp)\n-{\n- MSA *msa;\n- char *s;\n- int slen;\n- int sqidx;\n- char *name;\n- char *seq;\n- char *s2;\n-\n- if (feof(afp->f)) return NULL;\n-\n- /* Skip until we see the CLUSTAL header\n- */\n- while ((s = MSAFileGetLine(afp)) != NULL)\n- {\n- if (strncmp(s, "CLUSTAL", 7) == 0 &&\n-\t strstr(s, "multiple sequence alignment") != NULL)\n-\tbreak;\n- }\n- if (s == NULL) return NULL;\n-\n- msa = MSAAlloc(10, 0);\n-\n- /* Now we\'re in the sequence section. \n- * As discussed above, if we haven\'t seen a sequence name, then we\n- * don\'t include the sequence in the alignment.\n- * Watch out for conservation markup lines that contain *.: chars\n- */\n- while ((s = MSAFileGetLine(afp)) != NULL) \n- {\n- if ((name = sre_strtok(&s, WHITESPACE, NULL)) == NULL) continue;\n- if ((seq = sre_strtok(&s, WHITESPACE, &slen)) == NULL) continue;\n- s2 = sre_strt'..b'\n- bail = 1;\n- break;\n- }\n- }\n- if(!bail)\n- fprintf(fp, "*");\n- else\n- {\n- /* if not then check strong */\n- for(bin = 0; bin < 9; bin++)\n- strong_bins[bin] = 0; /* clear the bins */\n-\n- for(idx = 0; idx < msa->nseq; idx++)\n- {\n- switch(msa->aseq[idx][subpos])\n- {\n- case \'S\': strong_bins[0]++; break;\n- case \'T\': strong_bins[0]++; break;\n- case \'A\': strong_bins[0]++; break;\n- case \'N\': strong_bins[1]++; strong_bins[2]++; strong_bins[3]++; break;\n- case \'E\': strong_bins[1]++; strong_bins[3]++; break;\n- case \'Q\': strong_bins[1]++; strong_bins[2]++; strong_bins[3]++; strong_bins[4]++; break;\n- case \'K\': strong_bins[1]++; strong_bins[2]++; strong_bins[4]++; break;\n- case \'D\': strong_bins[3]++; break;\n- case \'R\': strong_bins[4]++; break;\n- case \'H\': strong_bins[4]++; strong_bins[7]++; break;\n- case \'M\': strong_bins[5]++; strong_bins[6]++; break;\n- case \'I\': strong_bins[5]++; strong_bins[6]++; break;\n- case \'L\': strong_bins[5]++; strong_bins[6]++; break;\n- case \'V\': strong_bins[5]++; break;\n- case \'F\': strong_bins[6]++; strong_bins[8]++; break;\n- case \'Y\': strong_bins[7]++; strong_bins[8]++; break;\n- case \'W\': strong_bins[8]++; break;\n- }\n- }\n- bail = 0;\n- for(bin = 0; bin < 9; bin++)\n- if(strong_bins[bin] == msa->nseq)\n- {\n- bail = 1;\n- break;\n- }\n- if(bail)\n- fprintf(fp, ":");\n- else\n- {\n- /* check weak */\n- for(bin = 0; bin < 11; bin++)\n- weak_bins[bin] = 0; /* clear the bins */\n-\n- for(idx = 0; idx < msa->nseq; idx++)\n- {\n- switch(msa->aseq[idx][subpos])\n- {\n- case \'C\': weak_bins[0]++; break;\n- case \'S\': weak_bins[0]++; weak_bins[2]++; weak_bins[3]++; weak_bins[4]++; weak_bins[5]++; weak_bins[6]++; break;\n- case \'A\': weak_bins[0]++; weak_bins[1]++; weak_bins[2]++; weak_bins[4]++; break;\n- case \'T\': weak_bins[1]++; weak_bins[3]++; weak_bins[4]++; break;\n- case \'V\': weak_bins[1]++; weak_bins[9]++; break;\n- case \'G\': weak_bins[2]++; break;\n- case \'N\': weak_bins[3]++; weak_bins[5]++; weak_bins[6]++; weak_bins[7]++; weak_bins[8]++; break;\n- case \'K\': weak_bins[3]++; weak_bins[6]++; weak_bins[7]++; weak_bins[8]++; break;\n- case \'D\': weak_bins[5]++; weak_bins[6]++; weak_bins[7]++; break;\n- case \'E\': weak_bins[6]++; weak_bins[7]++; weak_bins[8]++; break;\n- case \'Q\': weak_bins[6]++; weak_bins[7]++; weak_bins[8]++; break;\n- case \'H\': weak_bins[7]++; weak_bins[8]++; weak_bins[10]++; break;\n- case \'R\': weak_bins[8]++; break;\n- case \'F\': weak_bins[9]++; weak_bins[10]++; break;\n- case \'L\': weak_bins[9]++; break;\n- case \'I\': weak_bins[9]++; break;\n- case \'M\': weak_bins[9]++; break;\n- case \'Y\': weak_bins[10]++; break;\n- }\n- }\n- bail = 0;\n- for(bin = 0; bin < 11; bin++)\n- if(weak_bins[bin] == msa->nseq)\n- {\n- bail = 1;\n- break;\n- }\n- if(bail)\n- fprintf(fp, ".");\n- else\n- fprintf(fp, " ");\n- }\n- }\n- }\n- fprintf(fp,"\\n");\n-#endif\n- }\n-\n- return;\n-}\n-\n-\n-\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/squid/clustalo.README --- a/clustalomega/clustal-omega-0.2.0/src/squid/clustalo.README Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,9 +0,0 @@ -This is a trimmed down and patched version of Sean Eddy's squid library version 1.9 -See squid-1.9g.tar.gz for the original files. -Downloaded from ftp://selab.janelia.org/pub/software/squid/ - -changes in source code are all done via #ifdef CLUSTALO, which is set via Makefile - -We use our own config header instead of squidconf (see squid.h) - - |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/squid/cluster.c --- a/clustalomega/clustal-omega-0.2.0/src/squid/cluster.c Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,543 +0,0 @@\n-/*****************************************************************\n- * SQUID - a library of functions for biological sequence analysis\n- * Copyright (C) 1992-2002 Washington University School of Medicine\n- * \n- * This source code is freely distributed under the terms of the\n- * GNU General Public License. See the files COPYRIGHT and LICENSE\n- * for details.\n- *****************************************************************/\n-\n-/* cluster.c\n- * SRE, Sun Jul 18 09:49:47 1993\n- * moved to squid Thu Mar 3 08:42:57 1994\n- * RCS $Id: cluster.c 217 2011-03-19 10:27:10Z andreas $ (Original squid RCS Id: cluster.c,v 1.3 1999/07/15 22:32:16 eddy Exp)\n- *\n- * almost identical to bord.c, from fd\n- * also now contains routines for constructing difference matrices\n- * from alignments\n- * \n- * "branch ordering": Input a symmetric or upper-right-diagonal \n- * NxN difference matrix (usually constructed by pairwise alignment \n- * and similarity calculations for N sequences). Use the simple \n- * cluster analysis part of the Fitch/Margoliash tree-building algorithm\n- * (as described by Fitch and Margoliash 1967 as well as Feng\n- * and Doolittle 1987) to calculate the topology of an "evolutionary\n- * tree" consistent with the difference matrix. Returns an array\n- * which represents the tree.\n- * \n- * The input difference matrix is just an NxN matrix of floats.\n- * A good match is a small difference score (the algorithm is going\n- * to search for minima among the difference scores). The original difference\n- * matrix remains unchanged by the calculations.\n- * \n- * The output requires some explanation. A phylogenetic\n- * tree is a binary tree, with N "leaves" and N-1 "nodes". The\n- * topology of the tree may be completely described by N-1 structures\n- * containing two pointers; each pointer points to either a leaf\n- * or another node. Here, this is implemented with integer indices\n- * rather than pointers. An array of N-1 pairs of ints is returned.\n- * If the index is in the range (0..N-1), it is a "leaf" -- the\n- * number of one of the sequences. If the index is in the range\n- * (N..2N-2), it is another "node" -- (index-N) is the index\n- * of the node in the returned array.\n- * \n- * If both indices of a member of the returned array point to\n- * nodes, the tree is "compound": composed of more than one\n- * cluster of related sequences.\n- * \n- * The higher-numbered elements of the returned array were the\n- * first constructed, and hence represent the distal tips\n- * of the tree -- the most similar sequences. The root\n- * is node 0.\n- ******************************************************************\n- *\n- * Algorithm\n- * \n- * INITIALIZATIONS:\n- * - copy the difference matrix (otherwise the caller\'s copy would\n- * get destroyed by the operations of this algorithm). If\n- * it\'s asymmetric, make it symmetric.\n- * - make a (0..N-1) array of ints to keep track of the indices in\n- * the difference matrix as they get swapped around. Initialize\n- * this matrix to 0..N-1.\n- * - make a (0..N-2) array of int[2] to store the results (the tree\n- * topology). Doesn\'t need to be initialized.\n- * - keep track of a "N\'", the current size of the difference\n- * matrix being operated on.\n- *\n- * PROCESSING THE DIFFERENCE MATRIX:\n- * - for N\' = N down to N\' = 2 (N-1 steps):\n- * - in the half-diagonal N\'xN\' matrix, find the indices i,j at which\n- * there\'s the minimum difference score\n- * \n- * Store the results:\n- * - at position N\'-2 of the result array, store coords[i] and \n- * coords[j].\n- * \n- * Move i,j rows, cols to the outside edges of the matrix:\n- * - swap row i and row N\'-2\n- * - swap row j and row N\'-1 \n- * - swap column i and column N\'-2\n- * - swap column j and column N\'-1\n- * - swap indices i, N\'-2 in the index array\n- * - swap indices j, N\'-1 in the index array\n- * \n- * Build a average difference score for differences to i,'..b's\n- * less confusing to have two distinct functions, I find.\n- * \n- * Args: aseqs - flushed, aligned sequences\n- * num - number of aseqs\n- * ret_imx - RETURN: identity matrix (caller must free)\n- * \n- * Return: 1 on success, 0 on failure.\n- * Caller must free imx using FMX2Free(imx)\n- */\n-void\n-MakeIdentityMx(char **aseqs, int num, float ***ret_imx)\n-{\n- float **imx; /* RETURN: identity matrix */\n- int i,j;\t\t/* counters over sequences */\n-\n- /* Allocate 2D float matrix\n- */\n- imx = FMX2Alloc(num, num);\n-\n- /* Calculate distances, symmetric matrix\n- */\n- for (i = 0; i < num; i++)\n- for (j = i; j < num; j++)\n- imx[i][j] = imx[j][i] = PairwiseIdentity(aseqs[i], aseqs[j]);\n-\n- *ret_imx = imx;\n- return;\n-}\n-\n-\n-\n-/* Function: PrintNewHampshireTree()\n- * \n- * Purpose: Print out a tree in the "New Hampshire" standard\n- * format. See PHYLIP\'s draw.doc for a definition of\n- * the New Hampshire format.\n- *\n- * Like a CFG, we generate the format string left to\n- * right by a preorder tree traversal.\n- * \n- * Args: fp - file to print to\n- * ainfo- alignment info, including sequence names \n- * tree - tree to print\n- * N - number of leaves\n- * \n- */\n-void\n-PrintNewHampshireTree(FILE *fp, AINFO *ainfo, struct phylo_s *tree, int N)\n-{ \n- struct intstack_s *stack;\n- int code;\n- float *blen;\n- int docomma; \n-\n- blen = (float *) MallocOrDie (sizeof(float) * (2*N-1));\n- stack = InitIntStack();\n- PushIntStack(stack, N);\t/* push root on stack */\n- docomma = FALSE;\n- \n- /* node index code:\n- * 0..N-1 = leaves; indexes of sequences.\n- * N..2N-2 = interior nodes; node-N = index of node in tree structure.\n- * code N is the root. \n- * 2N..3N-2 = special flags for closing interior nodes; node-2N = index in tree\n- */\n- while (PopIntStack(stack, &code))\n- {\n- if (code < N)\t\t/* we\'re a leaf. */\n-\t{\n-\t\t\t\t/* 1) print name:branchlength */\n-\t if (docomma) fputs(",", fp);\n-\t fprintf(fp, "%s:%.5f", ainfo->sqinfo[code].name, blen[code]);\n-\t docomma = TRUE;\n-\t}\n-\n- else if (code < 2*N) /* we\'re an interior node */\n-\t{\n-\t\t\t\t/* 1) print a \'(\' */\n-\t if (docomma) fputs(",\\n", fp);\n-\t fputs("(", fp);\n-\t\t\t\t/* 2) push on stack: ), rchild, lchild */\n-\t PushIntStack(stack, code+N);\n-\t PushIntStack(stack, tree[code-N].right);\n-\t PushIntStack(stack, tree[code-N].left);\n-\t\t\t\t/* 3) record branch lengths */\n-\t blen[tree[code-N].right] = tree[code-N].rblen;\n-\t blen[tree[code-N].left] = tree[code-N].lblen;\n-\t docomma = FALSE;\n-\t}\n-\n- else\t\t\t/* we\'re closing an interior node */\n-\t{\n-\t\t\t\t/* print a ):branchlength */\n-\t if (code == 2*N) fprintf(fp, ");\\n");\n-\t else fprintf(fp, "):%.5f", blen[code-N]);\n-\t docomma = TRUE;\n-\t}\n- }\n-\n- FreeIntStack(stack);\n- free(blen);\n- return;\n-}\n-\n-\n-/* Function: PrintPhylo()\n- * \n- * Purpose: Debugging output of a phylogenetic tree structure.\n- */\n-void\n-PrintPhylo(FILE *fp, AINFO *ainfo, struct phylo_s *tree, int N)\n-{\n- int idx;\n-\n- for (idx = 0; idx < N-1; idx++)\n- {\n- fprintf(fp, "Interior node %d (code %d)\\n", idx, idx+N);\n- fprintf(fp, "\\tParent: %d (code %d)\\n", tree[idx].parent-N, tree[idx].parent);\n- fprintf(fp, "\\tLeft: %d (%s) %f\\n", \n-\t tree[idx].left < N ? tree[idx].left-N : tree[idx].left,\n-\t tree[idx].left < N ? ainfo->sqinfo[tree[idx].left].name : "interior",\n-\t tree[idx].lblen);\n- fprintf(fp, "\\tRight: %d (%s) %f\\n", \n-\t tree[idx].right < N ? tree[idx].right-N : tree[idx].right,\n-\t tree[idx].right < N ? ainfo->sqinfo[tree[idx].right].name : "interior",\n-\t tree[idx].rblen);\n- fprintf(fp, "\\tHeight: %f\\n", tree[idx].diff);\n- fprintf(fp, "\\tIncludes:%d seqs\\n", tree[idx].incnum);\n- }\n-}\n- \n-\n-\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/squid/dayhoff.c --- a/clustalomega/clustal-omega-0.2.0/src/squid/dayhoff.c Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,174 +0,0 @@ -/***************************************************************** - * SQUID - a library of functions for biological sequence analysis - * Copyright (C) 1992-2002 Washington University School of Medicine - * - * This source code is freely distributed under the terms of the - * GNU General Public License. See the files COPYRIGHT and LICENSE - * for details. - *****************************************************************/ - -/* dayhoff.c - * - * Routines for dealing with PAM matrices. - * - * Includes: - * ParsePAMFile() -- read a PAM matrix from disk. - * - * - * SRE - Fri Apr 2 11:23:45 1993 - * RCS $Id: dayhoff.c 217 2011-03-19 10:27:10Z andreas $ (Original squid RCS Id: dayhoff.c,v 1.5 2002/07/03 15:03:39 eddy Exp) - */ - - -#include <stdlib.h> -#include <stdio.h> -#include <string.h> -#include <math.h> -#include <ctype.h> -#include "squid.h" - -/* Function: ParsePAMFile() - * - * Purpose: Given a pointer to an open file containing a PAM matrix, - * parse the file and allocate and fill a 2D array of - * floats containing the matrix. The PAM file is - * assumed to be in the format that NCBI distributes - * with BLAST. BLOSUM matrices also work fine, as - * produced by Henikoff's program "MATBLAS". - * - * Parses both old format and new format BLAST matrices. - * Old format just had rows of integers. - * New format includes a leading character on each row. - * - * The PAM matrix is a 27x27 matrix, 0=A..25=Z,26=*. - * Note that it's not a 20x20 matrix as you might expect; - * this is for speed of indexing as well as the ability - * to deal with ambiguous characters. - * - * Args: fp - open PAM file - * ret_pam - RETURN: pam matrix, integers - * ret_scale - RETURN: scale factor for converting - * to real Sij. For instance, PAM120 is - * given in units of ln(2)/2. This may - * be passed as NULL if the caller - * doesn't care. - * - * Returns: 1 on success; 0 on failure and sets squid_errno to - * indicate the cause. ret_pam is allocated here and - * must be freed by the caller (use FreePAM). - */ -int -ParsePAMFile(FILE *fp, int ***ret_pam, float *ret_scale) -{ - int **pam; - char buffer[512]; /* input buffer from fp */ - int order[27]; /* order of fields, obtained from header */ - int nsymbols; /* total number of symbols in matrix */ - char *sptr; - int idx; - int row, col; - float scale; - int gotscale = FALSE; - - scale = 0.0; /* just to silence gcc uninit warnings */ - if (fp == NULL) { squid_errno = SQERR_NODATA; return 0; } - - /* Look at the first non-blank, non-comment line in the file. - * It gives single-letter codes in the order the PAM matrix - * is arrayed in the file. - */ - do { - if (fgets(buffer, 512, fp) == NULL) - { squid_errno = SQERR_NODATA; return 0; } - - /* Get the scale factor from the header. - * For BLOSUM files, we assume the line looks like: - * BLOSUM Clustered Scoring Matrix in 1/2 Bit Units - * and we assume that the fraction is always 1/x; - * - * For PAM files, we assume the line looks like: - * PAM 120 substitution matrix, scale = ln(2)/2 = 0.346574 - * and we assume that the number following the final '=' is our scale - */ - if (strstr(buffer, "BLOSUM Clustered Scoring Matrix") != NULL && - (sptr = strchr(buffer, '/')) != NULL) - { - sptr++; - if (! isdigit((int) (*sptr))) { squid_errno = SQERR_FORMAT; return 0; } - scale = (float) (log(2.0) / atof(sptr)); - gotscale = TRUE; - } - else if (strstr(buffer, "substitution matrix,") != NULL) - { - while ((sptr = strrchr(buffer, '=')) != NULL) { - sptr += 2; - if (IsReal(sptr)) { - scale = atof(sptr); - gotscale = TRUE; - break; - } - } - } - } while ((sptr = strtok(buffer, " \t\n")) == NULL || *sptr == '#'); - - idx = 0; - do { - order[idx] = (int) *sptr - (int) 'A'; - if (order[idx] < 0 || order[idx] > 25) order[idx] = 26; - idx++; - } while ((sptr = strtok(NULL, " \t\n")) != NULL); - nsymbols = idx; - - /* Allocate a pam matrix. For speed of indexing, we use - * a 27x27 matrix so we can do lookups using the ASCII codes - * of amino acid single-letter representations, plus one - * extra field to deal with the "*" (terminators). - */ - if ((pam = (int **) calloc (27, sizeof(int *))) == NULL) - Die("calloc failed"); - for (idx = 0; idx < 27; idx++) - if ((pam[idx] = (int *) calloc (27, sizeof(int))) == NULL) - Die("calloc failed"); - - /* Parse the rest of the file. - */ - for (row = 0; row < nsymbols; row++) - { - if (fgets(buffer, 512, fp) == NULL) - { squid_errno = SQERR_NODATA; return 0; } - - if ((sptr = strtok(buffer, " \t\n")) == NULL) - { squid_errno = SQERR_NODATA; return 0; } - for (col = 0; col < nsymbols; col++) - { - if (sptr == NULL) { squid_errno = SQERR_NODATA; return 0; } - - /* Watch out for new BLAST format, with leading characters - */ - if (*sptr == '*' || isalpha((int) *sptr)) - col--; /* hack hack */ - else - pam [order[row]] [order[col]] = atoi(sptr); - - sptr = strtok(NULL, " \t\n"); - } - } - - /* Return - */ - if (ret_scale != NULL) - { - if (gotscale) *ret_scale = scale; - else - { -#ifdef CLUSTALO - Warning("Failed to parse PAM matrix scale factor. Defaulting to ln(2)/2!"); -#else - Warn("Failed to parse PAM matrix scale factor. Defaulting to ln(2)/2!"); -#endif - *ret_scale = log(2.0) / 2.0; - } - } - *ret_pam = pam; - return 1; -} |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/squid/eps.c --- a/clustalomega/clustal-omega-0.2.0/src/squid/eps.c Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,115 +0,0 @@ -/***************************************************************** - * SQUID - a library of functions for biological sequence analysis - * Copyright (C) 1992-2002 Washington University School of Medicine - * - * This source code is freely distributed under the terms of the - * GNU General Public License. See the files COPYRIGHT and LICENSE - * for details. - *****************************************************************/ - -/* eps.c - * SRE, Thu Jun 21 18:02:31 2001 [St. Louis] - * - * Some crude support for Encapsulated PostScript (EPS) output, - * DSC compliant. - * - * CVS $Id: eps.c,v 1.4 2002/02/24 19:39:27 eddy Exp) - */ - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - -#include "squid.h" -#include "msa.h" - -/* Function: EPSWriteSmallMSA() - * Date: SRE, Thu Jun 21 18:15:21 2001 [St. Louis] - * - * Purpose: Write an alignment in singleblock, Stockholm/SELEX like - * format to an open file. Very crude. - * Currently fails if the alignment is >50 columns long, because - * it doesn't think it will fit on a single page. - * - * Args: fp - open file for writing - * msa - alignment to write - * - * Returns: (void) - */ -void -EPSWriteSmallMSA(FILE *fp, MSA *msa) -{ - int namewidth; /* namewidth in PostScript units */ - int fontwidth; /* width of a character in this font */ - int hspace; /* horizontal space between aligned chars */ - int vspace; /* vertical space between sequences */ - char *font; /* font name, e.g. "Courier" */ - int fontsize; /* font size in pts */ - int i,j; /* counter over sequences, columns */ - int len; /* tmp var holding length of something */ - int width, height; /* width and height of bounding box */ - int xpos, ypos; /* x,y position */ - - /* Set some font characteristics; done here, so it'll - * be easy to change. Magic numbers for Courier 12 determined - * by trial and error. - */ - fontwidth = 8; - hspace = 9; - vspace = 15; - font = sre_strdup("Courier", -1); - fontsize = 12; - - /* Find the width of the longest sequence name in characters. - */ - namewidth = 0; - for (i = 0; i < msa->nseq; i++) - if ((len = (int) strlen(msa->sqname[i])) > namewidth) - namewidth = len; - namewidth += 1; /* add a space to separate name & aligned seq */ - namewidth *= fontwidth; - - /* Determine bounding box - */ - if (msa->alen > 50) Die("No EPS fmt if alignment is >50 columns"); - width = namewidth + hspace*msa->alen; - if (width > 612) Die("Alignment too wide to write in EPS"); - height = vspace*msa->nseq; - if (height > 792) Die("Too many seqs to write in EPS"); - - /* Magic EPS header, bare-bones DSC-compliant. - */ - fprintf(fp, "%%!PS-Adobe-3.0 EPSF-3.0\n"); - fprintf(fp, "%%%%BoundingBox: %d %d %d %d\n", 0, 0, width, height); - fprintf(fp, "%%%%Pages: 1\n"); - fprintf(fp, "%%%%EndComments\n"); - - /* More postscript magic before we start the alignment - */ - fprintf(fp, "/%s findfont\n", font); - fprintf(fp, "%d scalefont\n", fontsize); - fprintf(fp, "setfont\n"); - fprintf(fp, "newpath\n"); - - /* Write the alignment in PostScript in a single block - */ - for (i = 0; i < msa->nseq; i++) - { - ypos = (msa->nseq-i-1)*vspace; - /* name first */ - fprintf(fp, "%d %d moveto\n", 0, ypos); - fprintf(fp, "(%s) show\n", msa->sqname[i]); - /* now seq */ - xpos = namewidth; - for (j = 0; j < msa->alen; j++) - { - fprintf(fp, "%d %d moveto\n", xpos, ypos); - fprintf(fp, "(%c) show\n", msa->aseq[i][j]); - xpos+= hspace; - } - } - - free(font); -} - - |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/squid/file.c --- a/clustalomega/clustal-omega-0.2.0/src/squid/file.c Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,271 +0,0 @@\n-/*****************************************************************\n- * SQUID - a library of functions for biological sequence analysis\n- * Copyright (C) 1992-2002 Washington University School of Medicine\n- * \n- * This source code is freely distributed under the terms of the\n- * GNU General Public License. See the files COPYRIGHT and LICENSE\n- * for details.\n- *****************************************************************/\n-\n-\n-/* file.c\n- * SRE, Wed Jun 19 11:19:22 1996\n- * \n- * File operation utilities, dealing with pathnames, directories,\n- * and environment variables.\n- * \n- * The goal is to have these be platform-independent but they\n- * currently are UNIX-specific: i.e. this file is currently POSIX compliant\n- * but it is NOT ANSI C compliant. (The sole offender is getenv().)\n- *\n- * RCS $Id: file.c 217 2011-03-19 10:27:10Z andreas $ (Original squid RCS Id: file.c,v 1.8 2002/03/07 03:18:02 eddy Exp)\n- */\n-\n-#include <stdio.h>\n-#include <stdlib.h>\n-#include <string.h>\n-\n-#include "squid.h"\n-#include "sqfuncs.h"\n-\n-/* \n- * VMS: #define DIRSLASH \']\'\n- * MacOS: #define DIRSLASH \':\'\n- * DOS: #define DIRSLASH \'\\\\\'\n- * \n- * The code assumes that \'.\' is used for file name extensions,\n- * such as "foo.bar".\n- */\n-#define DIRSLASH \'/\' /* UNIX directory paths have /foo/bar */\n-\n-\n-\n-/* Function: FileDirname()\n- * \n- * Purpose: Returns the path from a filename:\n- * "/foo/bar/baz" -> "/foo/bar"\n- * "foo/bar" -> "foo" \n- * "foo" -> "."\n- * "/" -> "/" \n- * i.e. the string will be non-NULL; it will\n- * contain the string up to but not including the\n- * last \'/\' character; returns "." if\n- * there are no \'/\' characters, and returns "/"\n- * if the last slash is the first character.\n- * Modeled on Tcl\'s "file dirname" command.\n- *\n- * Args: file - name of file "/foo/bar/baz".\n- * \n- * Return: ptr to malloc\'ed string "/foo/bar". \n- */\n-char *\n-FileDirname(char *file)\n-{\n- char *dirname;\n- char *lastslash;\n- int len;\n- \n- lastslash = strrchr(file, DIRSLASH);\n- len = (lastslash == NULL) ? 0 : (int) (lastslash - file);\n- dirname = (char *) MallocOrDie (sizeof(char) * (len+2));\n- if (len > 0) strncpy(dirname, file, len);\n- else if (*file != DIRSLASH) { *dirname = \'.\'; len = 1; }\n- else { *dirname = DIRSLASH; len = 1; }\n- dirname[len] = \'\\0\';\n- return dirname;\n-}\n-\n-\n-/* Function: FileTail()\n- * \n- * Purpose: Return everything after the DIRSLASH:\n- * "/foo/bar/baz.1" -> "baz.1"\n- * "foo/bar" -> "bar" \n- * "foo" -> "foo"\n- * "/" -> "" \n- * If noextension is TRUE, removes a trailing ".foo" extension\n- * too.\n- * \n- * Args: file - name of file "/foo/bar/baz.1" \n- * noextension - TRUE to also remove extensions\n- * \n- * Return: ptr to malloc\'ed string "baz.1" \n- */ \n-char * \n-FileTail(char *file, int noextension)\n-{\n- char *tail;\n- char *lastslash;\n- char *lastdot;\n-\t\t\t\t/* remove directory prefix */\n- lastslash = strrchr(file, DIRSLASH);\n- tail = (char *) MallocOrDie (sizeof(char) * (strlen(file)+1));\n- if (lastslash == NULL) strcpy(tail, file);\n- else strcpy(tail, lastslash+1);\n-\t\t\t\t/* remove trailing suffix */\n- if (noextension) {\n- if ((lastdot = strrchr(tail, \'.\')) != NULL)\n- *lastdot = \'\\0\';\n- }\n-\n- return tail;\n-}\n-\n-\n-/* Function: FileSameDirectory()\n- * Date: SRE, Wed Mar 6 20:03:23 2002 [St. Louis]\n- *\n- * Purpose: Given a path to one file, and the \n- * name of another file in the same directory,\n- * concat the path from file1 onto file2, and\n- * return the result. Caller must free the ptr\n- * that\'s returned. \n- * \n- '..b'ncat(path, tail);\n- if (! seems_ok && strcmp(result, file2) != 0) {\n- free(result); result = NULL; \n- }\n- free(path);\n- free(tail);\n- return result;\n-}\n-\n-/* Function: FileConcat()\n- * \n- * Purpose: Concatenate a directory path and a file name,\n- * returning a pointer to a malloc\'ed string with the\n- * full filename. This isn\'t just a string concat,\n- * because we\'re careful about the dir slash.\n- */\n-char *\n-FileConcat(char *dir, char *file)\n-{\n- char *full;\n-\n- full = (char *) MallocOrDie (sizeof(char) * (strlen(dir)+strlen(file)+2));\n- if (*file == DIRSLASH) strcpy(full, file); /* file = "/foo", ignore directory. */\n- else sprintf(full, "%s%c%s", dir, DIRSLASH, file);\n- return full;\n-}\n-\n-\n-/* Function: FileAddSuffix()\n- * Date: SRE, Wed Aug 1 11:19:33 2001 [Pasadena]\n- *\n- * Purpose: Add a suffix to a filename, return a malloc\'ed\n- * string containing the new filename.sfx name.\n- * Example:\n- * FileAddSuffix("genbank", "ssi")\n- * returns "genbank.ssi". \n- */\n-char *\n-FileAddSuffix(char *filename, char *sfx)\n-{\n- char *new;\n- new = MallocOrDie(strlen(filename) + strlen(sfx) + 2);\n- sprintf(new, "%s.%s", filename, sfx);\n- return new;\n-}\n-\n-/* Function: EnvFileOpen()\n- * Date: Sun Feb 12 10:55:29 1995 \n- * \n- * Purpose: Open a file, given a file name and an environment\n- * variable that contains a directory path. Files\n- * are opened read-only. Does not look at current directory\n- * unless "." is explicitly in the path specified by env.\n- * \n- * For instance: \n- * fp = EnvFileOpen("BLOSUM45", "BLASTMAT", NULL);\n- * or:\n- * fp = EnvFileOpen("swiss", "BLASTDB", NULL); \n- * \n- * Environment variables may contain a colon-delimited\n- * list of more than one path; e.g.\n- * setenv BLASTDB /nfs/databases/foo:/nfs/databases/bar\n- * \n- * Sometimes a group of files may be found in\n- * one directory; for instance, an index file with a\n- * database. The caller can EnvFileOpen() the main\n- * file, and ask to get the name of the\n- * directory back in ret_dir, so it can construct\n- * the other auxiliary file names and fopen() them. (If it called\n- * EnvFileOpen(), it might get confused by \n- * file name clashes and open files in different\n- * directories.\n- * \n- * Args: fname - name of file to open\n- * env - name of environment variable containing path\n- * ret_dir - if non-NULL, RETURN: name of dir that was used.\n- * \n- * Return: FILE * to open file, or NULL on failure -- same as fopen()\n- * Caller must free ret_dir if it passed a non-NULL address.\n- */\n-FILE *\n-EnvFileOpen(char *fname, char *env, char **ret_dir)\n-{\n- FILE *fp;\n- char *path;\n- char *s; /* ptr to indiv element in env list */\n- char full[1024]; /* constructed file name */\n-\n- if (env == NULL) return NULL;\n- if ((path = Strdup(getenv(env))) == NULL) return NULL;\n- \n- fp = NULL;\n- s = strtok(path, ":");\n- while (s != NULL)\n- {\n- if (((int) strlen(fname) + (int) strlen(s) + 2) > 1024) \n-\t{ free(path); return NULL; }\n- sprintf(full, "%s%c%s", s, DIRSLASH, fname);\n- if ((fp = fopen(full, "r")) != NULL) break;\n- s = strtok(NULL, ":");\n- }\n-\n- /* Return the path we used, if caller wants it\n- */\n- if (ret_dir != NULL) *ret_dir = Strdup(s);\n- free(path);\n- \n- return fp;\n-}\n-\n-\n-/* Function: FileExists()\n- * \n- * Purpose: Return TRUE if filename exists.\n- * Testing fopen() is the only possible platform-independent test\n- * I\'m aware of. \n- */\n-int\n-FileExists(char *filename)\n-{\n- FILE *fp;\n- if ((fp = fopen(filename, "r"))) { fclose(fp); return TRUE; }\n- return FALSE;\n-}\n-\n-\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/squid/getopt.c --- a/clustalomega/clustal-omega-0.2.0/src/squid/getopt.c Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,250 +0,0 @@\n-/*****************************************************************\n- * SQUID - a library of functions for biological sequence analysis\n- * Copyright (C) 1992-2002 Washington University School of Medicine\n- * \n- * This source code is freely distributed under the terms of the\n- * GNU General Public License. See the files COPYRIGHT and LICENSE\n- * for details.\n- *****************************************************************/\n-\n-/* RCS $Id: getopt.c 217 2011-03-19 10:27:10Z andreas $ (Original squid RCS Id: getopt.c,v 1.7 2001/02/21 21:09:10 eddy Exp)\n- */\n-\n-#include <stdio.h>\n-#include <string.h>\n-#include <stdlib.h>\n-\n-#include "squid.h"\n-\n-/* Function: Getopt()\n- * \n- * Purpose: Portable command line option parsing with abbreviated\n- * option switches. Replaces UNIX getopt(). Using UNIX getopt()\n- * hinders portability to non-UNIX platforms, and getopt()\n- * is also limited to single letter options.\n- *\n- * Getopt() implements a superset of UNIX getopt().\n- * All of getopt()\'s single-character switch behavior\n- * is emulated, and "--" by itself terminates the options.\n- * Additionally, Getopt() provides extended switches\n- * like "--youroptionhere", and Getopt() type checks\n- * arguments. \n- * \n- * Extended options must start with "--", as in "--option1".\n- * Normal options must start with "-", as in "-o".\n- * Normal options may be concatenated, as in "-a -b" == "-ab".\n- * \n- * See bottom of this .c file after #fdef GETOPT_TESTDRIVER\n- * for an example of calling Getopt().\n- * \n- * Args: argc - from main(). number of elems in argv.\n- * argv - from main(). argv[0] is the name of the command.\n- * opt - array of opt_s structures, defining option switches\n- * nopts - number of switches in opt\n- * usage - a (possibly long) string to print if usage error.\n- * ret_optind - RETURN: the index in argv[] of the next \n- * valid command-line token.\n- * ret_optname- RETURN: ptr to the name of option switch \n- * seen, or NULL if no option was seen.\n- * ret_optarg - RETURN: ptr to the optional argument, if any;\n- * NULL if option takes no argument.\n- * \n- * Return: 1 if a valid option was parsed.\n- * 0 if no option was found, and command-line parsing is complete.\n- * Die()\'s here if an error is detected.\n- */\n-int\n-Getopt(int argc, char **argv, struct opt_s *opt, int nopts, char *usage,\n- int *ret_optind, char **ret_optname, char **ret_optarg)\n-{\n- int i;\n- int arglen;\n- int nmatch;\n- static int optind = 1; /* init to 1 on first call */\n- static char *optptr = NULL; /* ptr to next valid switch */\n- int opti = 0;\t\t\t /* init only to silence gcc uninit warnings */\n-\n- /* Check to see if we\'ve run out of options.\n- * A \'-\' by itself is an argument (e.g. "read from stdin")\n- * not an option.\n- */\n- if (optind >= argc || argv[optind][0] != \'-\' || strcmp(argv[optind], "-") == 0)\n- { \n- *ret_optind = optind; \n- *ret_optarg = NULL; \n- *ret_optname = NULL; \n- return 0; \n- }\n-\n- /* Check to see if we\'re being told that this is the end\n- * of the options with the special "--" flag.\n- */\n- if (strcmp(argv[optind], "--") == 0)\n- { \n- optind++;\n- *ret_optind = optind; \n- *ret_optname = NULL;\n- *ret_optarg = NULL; \n- return 0; \n- }\n-\n- /* We have a real option. Find which one it is.\n- * We handle single letter switches "-o" separately\n- * from full switches "--option", based on the "-" vs. "--"\n- * prefix -- single letter switches can be concatenated\n- * as long as they don\'t have arguments.\n- */\n-\t\t\t\t/* full option */\n- if (optptr == NULL && strncmp(argv[optind], '..b'd], \'=\')) != NULL)\n-\t{ *optptr = \'\\0\'; optptr++; }\n-\n- arglen = strlen(argv[optind]);\n- nmatch = 0;\n- for (i = 0; i < nopts; i++)\n-\tif (opt[i].single == FALSE && \n-\t strncmp(opt[i].name, argv[optind], arglen) == 0)\n-\t { \n-\t nmatch++;\n-\t opti = i;\n-\t if (arglen == strlen(opt[i].name)) break; /* exact match, stop now */\n-\t }\n- if (nmatch > 1 && arglen != strlen(opt[i].name)) \n-\tDie("Option \\"%s\\" is ambiguous; please be more specific.\\n%s",\n-\t argv[optind], usage);\n- if (nmatch == 0)\n-\tDie("No such option \\"%s\\".\\n%s", argv[optind], usage);\n-\n- *ret_optname = opt[opti].name;\n-\n- /* Set the argument, if there is one\n- */\n- if (opt[opti].argtype != sqdARG_NONE) \n-\t{\n-\t if (optptr != NULL)\n-\t {\t\t\t/* --foo=666 style */\n-\t *ret_optarg = optptr;\n-\t optptr = NULL;\n-\t optind++;\n-\t }\n-\t else if (optind+1 >= argc)\n-\t Die("Option %s requires an argument\\n%s", opt[opti].name, usage);\n-\t else\t\t\t/* "--foo 666" style */\n-\t {\n-\t *ret_optarg = argv[optind+1];\n-\t optind+=2;\n-\t }\n-\t}\n- else /* sqdARG_NONE */\n-\t{\n-\t if (optptr != NULL) \n-\t Die("Option %s does not take an argument\\n%s", opt[opti].name, usage);\n-\t *ret_optarg = NULL;\n-\t optind++;\n-\t}\n- }\n- else\t\t\t\t/* else, a single letter option "-o" */\n- {\n-\t\t\t\t/* find the option */\n- if (optptr == NULL) \n-\toptptr = argv[optind]+1;\n- for (opti = -1, i = 0; i < nopts; i++)\n-\tif (opt[i].single == TRUE && *optptr == opt[i].name[1])\n-\t { opti = i; break; }\n- if (opti == -1)\n-\tDie("No such option \\"%c\\".\\n%s", *optptr, usage);\n- *ret_optname = opt[opti].name;\n-\n-\t\t\t\t/* set the argument, if there is one */\n- if (opt[opti].argtype != sqdARG_NONE) \n-\t{\n-\t if (*(optptr+1) != \'\\0\') /* attached argument */\n-\t {\n-\t *ret_optarg = optptr+1;\n-\t optind++;\n-\t }\n-\t else if (optind+1 < argc) /* unattached argument */\n-\t {\n-\t *ret_optarg = argv[optind+1];\n-\t optind+=2;\t \n-\t }\n-\t else Die("Option %s requires an argument\\n%s", opt[opti].name, usage);\n-\n-\t optptr = NULL;\t/* can\'t concatenate after an argument */\n-\t}\n- else /* sqdARG_NONE */\n-\t{\n-\t *ret_optarg = NULL;\n-\t if (*(optptr+1) != \'\\0\') /* concatenation */\n-\t optptr++; \n-\t else\n-\t {\n-\t optind++; /* move to next field */\n-\t optptr = NULL;\n-\t }\n-\t}\n-\n- }\n-\n- /* Type check the argument, if there is one\n- */\n- if (opt[opti].argtype != sqdARG_NONE) \n- {\n- if (opt[opti].argtype == sqdARG_INT && ! IsInt(*ret_optarg))\n-\tDie("Option %s requires an integer argument\\n%s",\n-\t opt[opti].name, usage);\n- else if (opt[opti].argtype == sqdARG_FLOAT && ! IsReal(*ret_optarg))\n-\tDie("Option %s requires a numerical argument\\n%s",\n-\t opt[opti].name, usage);\n- else if (opt[opti].argtype == sqdARG_CHAR && strlen(*ret_optarg) != 1)\n-\tDie("Option %s requires a single-character argument\\n%s",\n-\t opt[opti].name, usage);\n- /* sqdARG_STRING is always ok, no type check necessary */\n- }\n-\n- *ret_optind = optind;\n- return 1;\n-}\n-\n-\n-\n-#ifdef GETOPT_TESTDRIVER \n-/* cc -DGETOPT_TESTDRIVER -L ~/lib/squid.linux/ getopt.c -lsquid\n- */\n-struct opt_s OPTIONS[] = {\n- { "--test1", FALSE, sqdARG_INT },\n- { "--test2", FALSE, sqdARG_FLOAT },\n- { "--test3", FALSE, sqdARG_STRING },\n- { "--test4", FALSE, sqdARG_CHAR },\n- { "-a", TRUE, sqdARG_NONE },\n- { "-b", TRUE, sqdARG_INT },\n-};\n-#define NOPTIONS (sizeof(OPTIONS) / sizeof(struct opt_s))\n- \n-int\n-main(int argc, char **argv)\n-{\n- int optind;\n- char *optarg;\n- char *optname;\n-\n- while (Getopt(argc, argv, OPTIONS, NOPTIONS, "Usage/help here",\n-\t\t&optind, &optname, &optarg))\n- {\n- printf("Option: index: %d name: %s argument: %s\\n",\n-\t optind, optname, optarg);\n- }\n- while (optind < argc)\n- {\n- printf("Argument: index: %d name: %s\\n", optind, argv[optind]);\n- optind++;\n- }\n-\n-\n-}\n-\n-\n-#endif /*GETOPT_TESTDRIVER*/\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/squid/gki.c --- a/clustalomega/clustal-omega-0.2.0/src/squid/gki.c Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,389 +0,0 @@\n-/*****************************************************************\n- * SQUID - a library of functions for biological sequence analysis\n- * Copyright (C) 1992-2002 Washington University School of Medicine\n- * \n- * This source code is freely distributed under the terms of the\n- * GNU General Public License. See the files COPYRIGHT and LICENSE\n- * for details.\n- *****************************************************************/\n-\n-/* gki.c\n- * SRE, Sat May 1 14:49:08 1999\n- * \n- * "generic key index" module: emulation of Perl hashes.\n- * Maps keys (ASCII char strings) to array index. Dynamically\n- * resizes the hash table. \n- * \n- * Limitations:\n- * - hash table can only grow; no provision for deleting keys\n- * or downsizing the hash table.\n- * - Maximum hash table size set at 100003. Performance \n- * will degrade for key sets much larger than this.\n- * - Assumes that integers are 32 bits (or greater). \n- * \n- * Defines a typedef\'d structure:\n- * gki - a key index hash table.\n- * Provides functions:\n- * GKIInit() - start a hash table.\n- * GKIStoreKey() - store a new key, get a unique index. \n- * GKIKeyIndex() - retrieve an existing key\'s index.\n- * GKIFree() - free a hash table.\n- * GKIStatus() - Debugging: prints internal status of a hash struct\n- * \n- *\n- * Note that there are no dependencies on squid; the gki.c/gki.h\n- * pair are base ANSI C and can be reused anywhere.\n- *****************************************************************\n- * \n- * API for storing/reading stuff: \n- * moral equivalent of Perl\'s $foo{$key} = whatever, $bar{$key} = whatever:\n- * #include "gki.h"\n- * \n- * gki *hash;\n- * int idx;\n- * char *key;\n- * \n- * hash = GKIInit();\n- * (Storing:) \n- * (foreach key) {\n- * idx = GKIStoreKey(hash, key); \n- * (reallocate foo, bar as needed)\n- * foo[idx] = whatever;\n- * bar[idx] = whatever;\n- * } \n- * (Reading:)\n- * (foreach key) {\n- * idx = GKIKeyIndex(hash, key);\n- * if (idx == -1) {no_such_key; }\n- * (do something with) foo[idx];\n- * (do something with) bar[idx];\n- * } \n- * GKIFree();\n- * \n- *****************************************************************\n- *\n- * Timings on wrasse for 45402 keys in /usr/dict/words using\n- * Tests/test_gki: \n- * 250 msec store (6 usec/store)\n- * 140 msec retrieve (3 usec/retrieve)\n- * and using the 13408 names of Pfam\'s GP120.full alignment:\n- * 70 msec store (5 usec/store)\n- * 50 msec retrieve (4 usec/retrieve) \n- * \n- * RCS $Id: gki.c 217 2011-03-19 10:27:10Z andreas $ (Original squid RCS Id: gki.c,v 1.3 2000/12/21 23:42:59 eddy Exp)\n- */\n-\n-\n-\n-#include <stdio.h>\n-#include <stdlib.h>\n-#include <string.h>\n-#include <limits.h>\n-#include "squid.h"\n-#include "gki.h"\n-\n-/* \n- * Best hash table sizes are prime numbers (see Knuth vol 3, Sorting\n- * and Searching). \n- * gki_primes[] defines the ascending order of hash table sizes\n- * that we use in upsizing the hash table dynamically.\n- * useful site for testing primes:\n- * http://www.idbsu.edu/people/jbrennan/algebra/numbers/sieve.html\n- * Because of the way gki_hashvalue works, the largest number\n- * must be < INT_MAX / 128 / 128 : 131072 on a 32 bit machine.\n- */\n-static int gki_primes[] = { 101, 1009, 10007, 100003 };\n-#define GKI_NPRIMES 4\n-#define GKI_ALPHABETSIZE 128\n-\n-static GKI *gki_alloc(int primelevel);\n-static int gki_hashvalue(GKI *hash, char *key);\n-static int gki_upsize(GKI *old);\n-\n-\n-/* Function: GKIInit()\n- * Date: SRE, Sat May 1 11:12:24 1999 [May Day geek-out]\n- *\n- * Purpose: Initialize a hash table for key indexing. \n- * Simply a wrapper around a level 0 gki_alloc().\n- *\n- * Args: (void)\n- *\n- * Returns: An allocated hash table structure.\n- * '..b'->nxt)\n-\tnkeys++;\n-\n- if (nkeys == 0) nempty++;\n- if (nkeys > maxkeys) maxkeys = nkeys;\n- if (nkeys < minkeys) minkeys = nkeys;\n- }\n-\n- printf("Total keys: %d\\n", hash->nkeys);\n- printf("Hash table size: %d\\n", hash->nhash);\n- printf("Average occupancy: %.1f\\n", (float) hash->nkeys / (float) hash->nhash);\n- printf("Unoccupied slots: %d\\n", nempty);\n- printf("Most in one slot: %d\\n", maxkeys);\n- printf("Least in one slot: %d\\n", minkeys);\n- \n-}\n-\n-\n-/* Function: gki_alloc()\n- * Date: SRE, Sat May 1 11:55:47 1999 [May Day geek-out]\n- *\n- * Purpose: Allocate a hash table structure with the\n- * size given by primelevel.\n- *\n- * Args: primelevel - level 0..GKI_NPRIMES-1, specifying\n- * the size of the table; see gki_primes[]\n- * array.\n- *\n- * Returns: An allocated hash table structure. \n- * Caller frees with GKIFree().\n- */\n-static GKI *\n-gki_alloc(int primelevel)\n-{\n- GKI *hash;\n- int i;\n-\n- if (primelevel < 0 || primelevel >= GKI_NPRIMES) \n- Die("bad primelevel in gki_alloc()");\n- hash = MallocOrDie(sizeof(GKI));\n-\n- hash->primelevel = primelevel;\n- hash->nhash = gki_primes[hash->primelevel];\n- hash->table = MallocOrDie(sizeof(struct gki_elem) * hash->nhash);\n- for (i = 0; i < hash->nhash; i++)\n- hash->table[i] = NULL;\n- hash->nkeys = 0;\n- return hash;\n-} \n-\n-\n-/* Function: gki_hashvalue()\n- * Date: SRE, Sat May 1 11:14:10 1999 [May Day geek-out]\n- *\n- * Purpose: Calculate the hash value for a key. Usually\n- * we expect a one-word key, but the function will\n- * hash any ASCII string effectively. The hash function\n- * is a simple one (see p. 233 of Sedgewick,\n- * Algorithms in C).\n- * Slightly optimized: does two characters at a time\n- * before doing the modulo; this gives us a significant\n- * speedup. \n- *\n- * Args: hash - the gki structure (we need to know the hash table size)\n- * key - a string to calculate the hash value for \n- *\n- * Returns: a hash value, in the range 0..hash->nhash-1.\n- * hash table is unmodified.\n- */\n-static int\n-gki_hashvalue(GKI *hash, char *key)\n-{\n- int val = 0;\n-\n- for (; *key != \'\\0\'; key++)\n- {\n- val = GKI_ALPHABETSIZE*val + *key; \n- if (*(++key) == \'\\0\') { val = val % hash->nhash; break; }\n- val = (GKI_ALPHABETSIZE*val + *key) % hash->nhash;\n- }\n- return val;\n-}\n-\n-/* Function: gki_upsize()\n- * Date: SRE, Sat May 1 11:46:07 1999 [May Day geek-out]\n- *\n- * Purpose: Grow the hash table to the next available size.\n- *\n- * Args: old - the GKI hash table to reallocate.\n- *\n- * Returns: 1 on success (the hash table is changed);\n- * 0 on failure; the table is already at its maximum size,\n- * and the hash table is returned unchanged.\n- */\n-static int\n-gki_upsize(GKI *old)\n-{\n- GKI *new;\n- int i;\n- struct gki_elem *optr;\n- struct gki_elem *nptr;\n- int val;\n-\n- if (old->primelevel >= GKI_NPRIMES-1) return 0;\n- new = gki_alloc(old->primelevel+1);\n-\n- /* Read the old, store in the new, while *not changing*\n- * any key indices. Because of the way the lists are\n- * treated as LIFO stacks, all the lists are reversed \n- * in the new structure.\n- */\n- for (i = 0; i < old->nhash; i++)\n- {\n- optr = old->table[i];\n- while (optr != NULL)\n-\t{\n-\t val = gki_hashvalue(new, optr->key);\n-\n-\t nptr = new->table[val];\n-\t new->table[val] = optr;\n-\t optr = optr->nxt;\n-\t new->table[val]->nxt = nptr;\n-\t}\n- }\n- free(old->table);\n-\n- /* Now swap within the interior of the structures, so the old\n- * structure is updated to the new structure.\n- * (nkeys is identical, so we don\'t need to swap that element.)\n- */\n- old->primelevel = new->primelevel;\n- old->nhash = new->nhash;\n- old->table = new->table;\n- free(new);\n- return 1;\n-}\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/squid/gki.h --- a/clustalomega/clustal-omega-0.2.0/src/squid/gki.h Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,50 +0,0 @@ -/***************************************************************** - * SQUID - a library of functions for biological sequence analysis - * Copyright (C) 1992-2002 Washington University School of Medicine - * - * This source code is freely distributed under the terms of the - * GNU General Public License. See the files COPYRIGHT and LICENSE - * for details. - *****************************************************************/ - -#ifndef SQUID_GKI_INCLUDED -#define SQUID_GKI_INCLUDED - -/* gki.h - * SRE, Sat May 1 15:07:22 1999 - * - * Declarations of structures, functions for generic key index - * module: emulation of Perl hashes. See gki.c. - * - * RCS $Id: gki.h 217 2011-03-19 10:27:10Z andreas $ (Original squid RCS Id: gki.h,v 1.2 1999/07/15 22:30:45 eddy Exp) - */ - -/* gki_elem: - * key, array index pairs are kept in linked list structures. - */ -struct gki_elem { - char *key; - int idx; - struct gki_elem *nxt; -}; - -/* gki: - * a dynamically resized hash structure; - * contains a hash table and associated data - */ -typedef struct { - struct gki_elem **table; - - int primelevel; - int nhash; - int nkeys; -} GKI; - -GKI *GKIInit(void); -void GKIFree(GKI *hash); -int GKIHashValue(GKI *hash, char *key); -int GKIStoreKey(GKI *hash, char *key); -int GKIKeyIndex(GKI *hash, char *key); -void GKIStatus(GKI *hash); - -#endif /* SQUID_GKI_INCLUDED */ |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/squid/gsi.c --- a/clustalomega/clustal-omega-0.2.0/src/squid/gsi.c Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,387 +0,0 @@\n-/*****************************************************************\n- * SQUID - a library of functions for biological sequence analysis\n- * Copyright (C) 1992-2002 Washington University School of Medicine\n- * \n- * This source code is freely distributed under the terms of the\n- * GNU General Public License. See the files COPYRIGHT and LICENSE\n- * for details.\n- *****************************************************************/\n-\n-/* gsi.c\n- * Interfaces for GSI "generic sequence index" files.\n- * broken away from sqio.c and extended: SRE, Wed Aug 5 10:32:53 1998\n- * \n- * \n- * GSI definition: \n- * 1 + <nfiles> + <nkeys> total records.\n- * Each record = 38 bytes.\n- *\n- * one header record : <"GSI" (32)> <nfiles (2)> <nkeys (4)> \n- * <nfiles> file records : <filename (32)> <fileno (2)> <fmt (4)> \n- * <nkeys> key records : <key (32)> <fileno (2)> <offset(4)> \n- *\n- * Matches up with my Perl scripts that create GSI files.\n- * \n- * RCS $Id: gsi.c 217 2011-03-19 10:27:10Z andreas $ (Original squid RCS Id: gsi.c,v 1.5 2001/08/04 20:15:42 eddy Exp)\n- */\n-\n-#include <stdio.h>\n-#include <stdlib.h>\n-#include <string.h>\n-#ifndef SEEK_SET\n-#include <unistd.h>\t/* needed for poor crippled SunOS */\n-#endif\n-\n-#include "squid.h"\n-#include "gsi.h"\n-\n-\n-/*****************************************************************\n- * GSI index file access routines\n- *****************************************************************/\n-\n-/* Function: GSIOpen()\n- * \n- * Purpose: Open a GSI file. Returns the number of records in\n- * the file and a file pointer. Returns NULL on failure.\n- * The file pointer should be fclose()\'d normally.\n- */\n-GSIFILE *\n-GSIOpen(char *gsifile)\n-{\n- GSIFILE *gsi;\n- char magic[GSI_KEYSIZE];\n-\n- gsi = (GSIFILE *) MallocOrDie (sizeof(GSIFILE));\n- if ((gsi->gsifp = fopen(gsifile, "r")) == NULL)\n- { free(gsi); squid_errno = SQERR_NOFILE; return NULL; }\n-\n- if (! fread(magic, sizeof(char), GSI_KEYSIZE, gsi->gsifp))\n- { free(gsi); squid_errno = SQERR_NODATA; return NULL; }\n- if (strcmp(magic, "GSI") != 0) \n- { free(gsi); squid_errno = SQERR_FORMAT; return NULL; }\n-\n- if (! fread(&(gsi->nfiles), sizeof(sqd_uint16), 1, gsi->gsifp))\n- { free(gsi); squid_errno = SQERR_NODATA; return NULL; }\n- if (! fread(&(gsi->recnum), sizeof(sqd_uint32), 1, gsi->gsifp))\n- { free(gsi); squid_errno = SQERR_NODATA; return NULL; }\n-\n- gsi->nfiles = sre_ntoh16(gsi->nfiles); /* convert from network short */\n- gsi->recnum = sre_ntoh32(gsi->recnum); /* convert from network long */\n-\n- return gsi;\n-}\n-\n-/* Function: GSIGetRecord()\n- * \n- * Purpose: Each non-header record of a GSI index files consists\n- * of 38 bytes: 32 bytes of character string, a 2 byte\n- * short, and a 4 byte long. This function returns the\n- * three values.\n- * \n- * Args: gsi - open GSI index file, correctly positioned at a record\n- * f1 - char[32], allocated by caller (or NULL if unwanted)\n- * f2 - pointer to short (or NULL if unwanted)\n- * f3 - pointer to long (or NULL if unwanted)\n- * \n- * Return: 0 on failure and sets squid_errno. \n- */\n-int\n-GSIGetRecord(GSIFILE *gsi, char *f1, sqd_uint16 *f2, sqd_uint32 *f3)\n-{\n- if (f1 == NULL) fseek(gsi->gsifp, GSI_KEYSIZE, SEEK_CUR);\n- else if (! fread(f1, GSI_KEYSIZE, 1, gsi->gsifp))\n- { squid_errno = SQERR_NODATA; return 0; }\n-\n- if (f2 == NULL) fseek(gsi->gsifp, sizeof(sqd_uint16), SEEK_CUR);\n- else if (! fread(f2, sizeof(sqd_uint16), 1, gsi->gsifp))\n- { squid_errno = SQERR_NODATA; return 0; }\n-\n- if (f3 == NULL) fseek(gsi->gsifp, sizeof(sqd_uint32), SEEK_CUR);\n- else if (! fread(f3, sizeof(sqd_uint32), 1, gsi->gsifp))\n- { squid_errno = SQERR_NODATA; return 0; }\n-\n- if (f2 != NULL) *f2 = sre_ntoh16(*f2);\n- if (f3 != NULL) *f3 = sre_ntoh32(*f3);\n-\n- return 1;\n-}\n-\n-\n-/* Function: GSIGetOffset()\n- * \n-'..b'ms = ReallocOrDie(g->elems, sizeof(struct gsikey_s) * (g->nkeys + 100));\n-}\n-static int \n-gsi_keysorter(const void *k1, const void *k2)\n-{\n- struct gsikey_s *key1;\n- struct gsikey_s *key2;\n- key1 = (struct gsikey_s *) k1;\n- key2 = (struct gsikey_s *) k2;\n- return strcmp(key1->key, key2->key);\n-}\n-void\n-GSISortIndex(struct gsiindex_s *g)\n-{\n- qsort((void *) g->elems, g->nkeys, sizeof(struct gsikey_s), gsi_keysorter); \n-}\n-void\n-GSIWriteIndex(FILE *fp, struct gsiindex_s *g)\n-{\n- sqd_uint32 i;\n-\n- /* Range checking.\n- */\n- /* AW: gcc says: comparison always false die to limited range of data type */\n-#ifndef CLUSTALO\n- if (g->nfiles > SQD_UINT16_MAX) Die("Too many files in GSI index.");\n-#endif\n- if (g->nkeys > SQD_UINT32_MAX) Die("Too many keys in GSI index.");\n-\n- GSIWriteHeader(fp, g->nfiles, g->nkeys);\n- for (i = 0; i < g->nfiles; i++)\n- GSIWriteFileRecord(fp, g->filenames[i], i+1, g->fmt[i]);\n- for (i = 0; i < g->nkeys; i++)\n- GSIWriteKeyRecord(fp, g->elems[i].key, g->elems[i].filenum, g->elems[i].offset);\n-}\n-\n-\n-\n-\n-\n-/* Function: GSIWriteHeader()\n- * Date: SRE, Wed Aug 5 10:36:02 1998 [St. Louis]\n- *\n- * Purpose: Write the first record to an open GSI file:\n- * "GSI" <nfiles> <nkeys>\n- *\n- * Args: fp - open file to write to.\n- * nfiles - number of files indexed\n- * nkeys - number of keys indexed \n- *\n- * Returns: void\n- */\n-void\n-GSIWriteHeader(FILE *fp, int nfiles, long nkeys)\n-{\n- char key[GSI_KEYSIZE];\n- sqd_uint16 f1;\n- sqd_uint32 f2;\n-\n- /* beware potential range errors!\n- */\n- if (nfiles > SQD_UINT16_MAX) Die("GSI: nfiles out of range");\n- if (nkeys > SQD_UINT32_MAX) Die("GSI: nkeys out of range");\n-\n- f1 = (sqd_uint16) nfiles;\n- f2 = (sqd_uint32) nkeys;\n- f1 = sre_hton16(f1);\n- f2 = sre_hton32(f2);\n- strcpy(key, "GSI");\n-\n- if (fwrite(key, 1, GSI_KEYSIZE, fp) < GSI_KEYSIZE) PANIC;\n- if (fwrite(&f1, 2, 1, fp) < 1) PANIC;\n- if (fwrite(&f2, 4, 1, fp) < 1) PANIC;\n-}\n-\n-\n-/* Function: GSIWriteFileRecord()\n- * Date: SRE, Wed Aug 5 10:45:51 1998 [St. Louis]\n- *\n- * Purpose: Write a file record to an open GSI file.\n- *\n- * Args: fp - open GSI file\n- * fname - file name (max 31 characters)\n- * idx - file number\n- * fmt - file format (e.g. kPearson, etc.)\n- *\n- * Returns: 0 on failure. 1 on success.\n- */\n-int\n-GSIWriteFileRecord(FILE *fp, char *fname, int idx, int fmt)\n-{\n- sqd_uint16 f1;\n- sqd_uint32 f2;\n-\n- if (strlen(fname) >= GSI_KEYSIZE) return 0;\n- if (idx > SQD_UINT16_MAX) Die("GSI: file index out of range");\n- if (fmt > SQD_UINT32_MAX) Die("GSI: format index out of range");\n-\n- f1 = (sqd_uint16) idx;\n- f2 = (sqd_uint32) fmt;\n- f1 = sre_hton16(f1);\n- f2 = sre_hton32(f2);\n-\n- if (fwrite(fname, 1, GSI_KEYSIZE, fp) < GSI_KEYSIZE) PANIC;\n- if (fwrite(&f1, 2, 1, fp) < 1) PANIC;\n- if (fwrite(&f2, 4, 1, fp) < 1) PANIC;\n- return 1;\n-}\n-\n-\n-/* Function: GSIWriteKeyRecord()\n- * Date: SRE, Wed Aug 5 10:52:30 1998 [St. Louis]\n- *\n- * Purpose: Write a key record to a GSI file.\n- *\n- * Args: fp - open GSI file for writing\n- * key - key (max 31 char + \\0)\n- * fileidx - which file number to find this key in\n- * offset - offset for this key \n- * \n- * Returns: 1 on success, else 0.\n- * will fail if key >= 32 chars, for instance.\n- */\n-int\n-GSIWriteKeyRecord(FILE *fp, char *key, int fileidx, long offset)\n-{\n- sqd_uint16 f1;\n- sqd_uint32 f2;\n-\n- if (strlen(key) >= GSI_KEYSIZE) return 0;\n- if (fileidx > SQD_UINT16_MAX) Die("GSI: file index out of range");\n- if (offset > SQD_UINT32_MAX) Die("GSI: offset out of range");\n-\n- f1 = (sqd_uint16) fileidx;\n- f2 = (sqd_uint32) offset;\n- f1 = sre_hton16(f1);\n- f2 = sre_hton32(f2);\n- \n- if (fwrite(key, 1, GSI_KEYSIZE, fp) < GSI_KEYSIZE) PANIC;\n- if (fwrite(&f1, 2, 1, fp) < 1) PANIC;\n- if (fwrite(&f2, 4, 1, fp) < 1) PANIC;\n- return 1;\n-}\n-\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/squid/gsi.h --- a/clustalomega/clustal-omega-0.2.0/src/squid/gsi.h Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,84 +0,0 @@ -/***************************************************************** - * SQUID - a library of functions for biological sequence analysis - * Copyright (C) 1992-2002 Washington University School of Medicine - * - * This source code is freely distributed under the terms of the - * GNU General Public License. See the files COPYRIGHT and LICENSE - * for details. - *****************************************************************/ - -#ifndef GSIH_INCLUDED -#define GSIH_INCLUDED - -/* gsi.h - * Database indexing (GSI format support) - * RCS $Id: gsi.h 217 2011-03-19 10:27:10Z andreas $ (Original squid RCS Id: gsi.h,v 1.3 2001/08/04 20:15:42 eddy Exp) - * - * A GSI (generic sequence index) file is composed of - * recnum + nfiles + 1 records. Each record contains - * three fields; key, file number, and disk offset. - * Record 0 contains: - * [ "GSI" ] [ nfiles ] [ recnum ] - * Records 1..nfiles map file names to file numbers, and contain: - * [ filename ] [ file number, 1..nfiles ] [ 0 (unused) ] - * Records nfiles+1 to recnum+nfiles+1 provide disk offset - * and file number indices for every key: - * [ key ] [ file number ] [ offset] - * - * Because the file is binary, we take some (but not - * complete) care to improve portability amongst platforms. - * This means using network order integers (see ntohl()) - * and defining types for 16 and 32 bit integers. - * - * Because we use 32-bit offsets, ftell(), and fseek(), - * there is an implicit 2 Gb file size maximum. - * AFAIK neither ANSI C nor POSIX provide a portable solution - * to this problem. fsetpos(), fgetpos() use an - * opaque fpos_t datatype that we can't write portably - * to a disk file. Suggestions welcomed. - */ -#define GSI_KEYSIZE 32 /* keys are 32 bytes long */ -#define GSI_RECSIZE 38 /* 32 + 2 + 4 bytes */ -#define SQD_UINT16_MAX 65535 /* 2^16-1 */ -#define SQD_UINT32_MAX 4294967295U/* 2^32-1 */ - -struct gsi_s { - FILE *gsifp; /* open GSI index file */ - sqd_uint16 nfiles; /* number of files = 16 bit int */ - sqd_uint32 recnum; /* number of records = 32 bit int */ -}; -typedef struct gsi_s GSIFILE; - -struct gsikey_s { - char key[GSI_KEYSIZE]; - sqd_uint16 filenum; - sqd_uint32 offset; -}; -struct gsiindex_s { - char **filenames; - int *fmt; - sqd_uint16 nfiles; - - struct gsikey_s *elems; - int nkeys; -}; - - -/* from gsi.c - */ -extern GSIFILE *GSIOpen(char *gsifile); -extern int GSIGetRecord(GSIFILE *gsi, char *f1, sqd_uint16 *f2, sqd_uint32 *f3); -extern int GSIGetOffset(GSIFILE *gsi, char *key, char *sqfile, - int *fmt, long *ret_offset); -extern void GSIClose(GSIFILE *gsi); -extern struct gsiindex_s *GSIAllocIndex(void); -extern void GSIFreeIndex(struct gsiindex_s *g); -extern void GSIAddFileToIndex(struct gsiindex_s *g, char *filename, int fmt); -extern void GSIAddKeyToIndex(struct gsiindex_s *g, char *key, int filenum, long offset); -extern void GSISortIndex(struct gsiindex_s *g); -extern void GSIWriteIndex(FILE *fp, struct gsiindex_s *g); -extern void GSIWriteHeader(FILE *fp, int nfiles, long nkeys); -extern int GSIWriteFileRecord(FILE *fp, char *fname, int idx, int fmt); -extern int GSIWriteKeyRecord(FILE *fp, char *key, int fileidx, long offset); - -#endif /*GSIH_INCLUDED*/ |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/squid/gsi64.c --- a/clustalomega/clustal-omega-0.2.0/src/squid/gsi64.c Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,394 +0,0 @@\n-/*****************************************************************\n- * SQUID - a library of functions for biological sequence analysis\n- * Copyright (C) 1992-2002 Washington University School of Medicine\n- * \n- * This source code is freely distributed under the terms of the\n- * GNU General Public License. See the files COPYRIGHT and LICENSE\n- * for details.\n- *****************************************************************/ \n-#ifdef USE_GSI64\n-\n-/* gsi64.c\n- * Updated interfaces for GSI64 64-bit "generic sequence index" files.\n- * See gsi.c for old interfaces.\n- * This is a temporary hack! Needed for human genome project.\n- */\n-\n-/* 1 + <nfiles> + <nkeys> total records.\n- * Each record = 42 bytes.\n- *\n- * one header record : <"GSI64" (32)> <nfiles (2)> <nkeys (8)> \n- * <nfiles> file records : <filename (32)> <fileno (2)> <fmt (8)> \n- * <nkeys> key records : <key (32)> <fileno (2)> <offset(8)> \n- * \n- * CVS $Id: gsi64.c,v 1.2 2000/12/21 23:42:59 eddy Exp)\n- */\n-\n-#include <stdio.h>\n-#include <stdlib.h>\n-#include <string.h>\n-#ifndef SEEK_SET\n-#include <unistd.h>\t/* needed for poor crippled SunOS */\n-#endif\n-\n-#include "squid.h"\n-#include "gsi64.h"\n-\n-/*****************************************************************\n- * GSI64 index file access routines\n- *****************************************************************/\n-\n-/* Function: GSI64Open()\n- * \n- * Purpose: Open a GSI64 file. Returns the number of records in\n- * the file and a file pointer. Returns NULL on failure.\n- * The file pointer should be fclose()\'d normally.\n- */\n-GSI64FILE *\n-GSI64Open(char *gsifile)\n-{\n- GSI64FILE *gsi;\n- char magic[GSI64_KEYSIZE];\n-\n- gsi = (GSI64FILE *) MallocOrDie (sizeof(GSI64FILE));\n- if ((gsi->gsifp = fopen(gsifile, "r")) == NULL)\n- { free(gsi); squid_errno = SQERR_NOFILE; return NULL; }\n-\n- if (! fread(magic, sizeof(char), GSI64_KEYSIZE, gsi->gsifp))\n- { free(gsi); squid_errno = SQERR_NODATA; return NULL; }\n- if (strcmp(magic, "GSI64") != 0) \n- { free(gsi); squid_errno = SQERR_FORMAT; return NULL; }\n-\n- if (! fread(&(gsi->nfiles), sizeof(sqd_uint16), 1, gsi->gsifp))\n- { free(gsi); squid_errno = SQERR_NODATA; return NULL; }\n- if (! fread(&(gsi->recnum), sizeof(sqd_uint64), 1, gsi->gsifp))\n- { free(gsi); squid_errno = SQERR_NODATA; return NULL; }\n-\n-#if 0\t\t\t/* HACK! we don\'t byteswap */\n- gsi->nfiles = sre_ntohs(gsi->nfiles); /* convert from network short */\n- gsi->recnum = sre_ntohl(gsi->recnum); /* convert from network long */\n-#endif\n-\n- return gsi;\n-}\n-\n-/* Function: GSI64GetRecord()\n- * \n- * Purpose: Each non-header record of a GSI64 index file consists\n- * of 42 bytes: 32 bytes of character string, a 2 byte\n- * short, and an 8 byte long long. This function returns the\n- * three values.\n- * \n- * Args: gsi - open GSI64 index file, correctly positioned at a record\n- * f1 - char[32], allocated by caller (or NULL if unwanted)\n- * f2 - pointer to short (or NULL if unwanted)\n- * f3 - pointer to long long (or NULL if unwanted)\n- * \n- * Return: 0 on failure and sets squid_errno. \n- */\n-int\n-GSI64GetRecord(GSI64FILE *gsi, char *f1, sqd_uint16 *f2, sqd_uint64 *f3)\n-{\n- if (f1 == NULL) fseek64(gsi->gsifp, GSI64_KEYSIZE, SEEK_CUR);\n- else if (! fread(f1, GSI64_KEYSIZE, 1, gsi->gsifp))\n- { squid_errno = SQERR_NODATA; return 0; }\n-\n- if (f2 == NULL) fseek64(gsi->gsifp, sizeof(sqd_uint16), SEEK_CUR);\n- else if (! fread(f2, sizeof(sqd_uint16), 1, gsi->gsifp))\n- { squid_errno = SQERR_NODATA; return 0; }\n-\n- if (f3 == NULL) fseek64(gsi->gsifp, sizeof(sqd_uint64), SEEK_CUR);\n- else if (! fread(f3, sizeof(sqd_uint64), 1, gsi->gsifp))\n- { squid_errno = SQERR_NODATA; return 0; }\n-\n-#if 0 /* no byteswap yet! HACK! */\n- if (f2 != NULL) *f2 = sre_ntohs(*f2);\n- if (f3 != NULL) *f3 = sre_ntohl(*f3);\n-#endif \n-\n- r'..b'oid *k2)\n-{\n- struct gsi64key_s *key1;\n- struct gsi64key_s *key2;\n- key1 = (struct gsi64key_s *) k1;\n- key2 = (struct gsi64key_s *) k2;\n- return strcmp(key1->key, key2->key);\n-}\n-void\n-GSI64SortIndex(struct gsi64index_s *g)\n-{\n- qsort((void *) g->elems, g->nkeys, sizeof(struct gsi64key_s), gsi_keysorter); \n-}\n-void\n-GSI64WriteIndex(FILE *fp, struct gsi64index_s *g)\n-{\n- sqd_uint16 i;\n- sqd_uint64 j;\n-\n- /* Range checking.\n- */\n- if (g->nfiles > SQD_UINT16_MAX) Die("Too many files in GSI64 index.");\n- if (g->nkeys > SQD_UINT64_MAX) Die("Too many keys in GSI64 index.");\n-\n- GSI64WriteHeader(fp, g->nfiles, g->nkeys);\n- for (i = 0; i < g->nfiles; i++)\n- GSI64WriteFileRecord(fp, g->filenames[i], i+1, g->fmt[i]);\n- for (j = 0; j < g->nkeys; j++)\n- GSI64WriteKeyRecord(fp, g->elems[j].key, g->elems[j].filenum, g->elems[j].offset);\n-}\n-\n-\n-\n-\n-\n-/* Function: GSI64WriteHeader()\n- * Date: SRE, Wed Aug 5 10:36:02 1998 [St. Louis]\n- *\n- * Purpose: Write the first record to an open GSI64 file:\n- * "GSI64" <nfiles> <nkeys>\n- *\n- * Args: fp - open file to write to.\n- * nfiles - number of files indexed\n- * nkeys - number of keys indexed \n- *\n- * Returns: void\n- */\n-void\n-GSI64WriteHeader(FILE *fp, int nfiles, long long nkeys)\n-{\n- char key[GSI64_KEYSIZE];\n- sqd_uint16 f1;\n- sqd_uint64 f2;\n-\n- /* beware potential range errors!\n- */\n- if (nfiles > SQD_UINT16_MAX) Die("GSI64: nfiles out of range");\n- if (nkeys > SQD_UINT64_MAX) Die("GSI64: nkeys out of range");\n-\n- f1 = (sqd_uint16) nfiles;\n- f2 = (sqd_uint64) nkeys;\n-#if 0 /* HACK no byteswap */\n- f1 = sre_htons(f1);\n- f2 = sre_htonl(f2);\n-#endif\n- strcpy(key, "GSI64");\n-\n- if (fwrite(key, 1, GSI64_KEYSIZE, fp) < GSI64_KEYSIZE) PANIC;\n- if (fwrite(&f1, 2, 1, fp) < 1) PANIC;\n- if (fwrite(&f2, 8, 1, fp) < 1) PANIC;\n-}\n-\n-\n-/* Function: GSI64WriteFileRecord()\n- * Date: SRE, Wed Aug 5 10:45:51 1998 [St. Louis]\n- *\n- * Purpose: Write a file record to an open GSI64 file.\n- *\n- * Args: fp - open GSI64 file\n- * fname - file name (max 31 characters)\n- * idx - file number\n- * fmt - file format (e.g. kPearson, etc.)\n- *\n- * Returns: 0 on failure. 1 on success.\n- */\n-int\n-GSI64WriteFileRecord(FILE *fp, char *fname, int idx, int fmt)\n-{\n- sqd_uint16 f1;\n- sqd_uint64 f2;\n-\n- if (strlen(fname) >= GSI64_KEYSIZE) return 0;\n- if (idx > SQD_UINT16_MAX) Die("GSI64: file index out of range");\n- if (fmt > SQD_UINT64_MAX) Die("GSI64: format index out of range");\n-\n- f1 = (sqd_uint16) idx;\n- f2 = (sqd_uint64) fmt;\n-#if 0 /* hack : no byteswap */\n- f1 = sre_htons(f1);\n- f2 = sre_htonl(f2);\n-#endif\n-\n- if (fwrite(fname, 1, GSI64_KEYSIZE, fp) < GSI64_KEYSIZE) PANIC;\n- if (fwrite(&f1, 2, 1, fp) < 1) PANIC;\n- if (fwrite(&f2, 8, 1, fp) < 1) PANIC;\n- return 1;\n-}\n-\n-\n-/* Function: GSI64WriteKeyRecord()\n- * Date: SRE, Wed Aug 5 10:52:30 1998 [St. Louis]\n- *\n- * Purpose: Write a key record to a GSI64 file.\n- *\n- * Args: fp - open GSI64 file for writing\n- * key - key (max 31 char + \\0)\n- * fileidx - which file number to find this key in\n- * offset - offset for this key \n- * \n- * Returns: 1 on success, else 0.\n- * will fail if key >= 32 chars, for instance.\n- */\n-int\n-GSI64WriteKeyRecord(FILE *fp, char *key, int fileidx, long long offset)\n-{\n- sqd_uint16 f1;\n- sqd_uint64 f2;\n-\n- if (strlen(key) >= GSI64_KEYSIZE) return 0;\n- if (fileidx > SQD_UINT16_MAX) Die("GSI64: file index out of range");\n- if (offset > SQD_UINT64_MAX) Die("GSI64: offset out of range");\n-\n- f1 = (sqd_uint16) fileidx;\n- f2 = (sqd_uint64) offset;\n-#if 0 /* HACK! */\n- f1 = sre_htons(f1);\n- f2 = sre_htonl(f2);\n-#endif \n- \n- if (fwrite(key, 1, GSI64_KEYSIZE, fp) < GSI64_KEYSIZE) PANIC;\n- if (fwrite(&f1, 2, 1, fp) < 1) PANIC;\n- if (fwrite(&f2, 8, 1, fp) < 1) PANIC;\n- return 1;\n-}\n-\n-#endif /*USE_GSI64 */\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/squid/gsi64.h --- a/clustalomega/clustal-omega-0.2.0/src/squid/gsi64.h Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,95 +0,0 @@ -/***************************************************************** - * @LICENSE@ - *****************************************************************/ - -#ifndef GSI64H_INCLUDED -#define GSI64H_INCLUDED -#ifdef USE_GSI64 - -/* gsi64.h - * Database indexing (GSI64 format support) - * CVS $Id: gsi64.h,v 1.2 2000/12/21 23:42:59 eddy Exp) - * - * A GSI64 (generic sequence index, 64 bit hack) file is composed of - * recnum + nfiles + 1 records. Each record contains - * three fields; key, file number, and disk offset. - * Record 0 contains: - * [ "GSI64" ] [ nfiles ] [ recnum ] - * Records 1..nfiles map file names to file numbers, and contain: - * [ filename ] [ file number, 1..nfiles ] [ 0 (unused) ] - * Records nfiles+1 to recnum+nfiles+1 provide disk offset - * and file number indices for every key: - * [ key ] [ file number ] [ offset] - * - * Because the file is binary, we take some (but not - * complete) care to improve portability amongst platforms. - * This means using network order integers (see ntohl()) - * and defining types for 16 and 64 bit integers. - * - * A short test program that verifies the sizes of these - * data types would be a good idea... - * - * Because we use 64-bit offsets, ftell64(), and fseek64(), - * we rely on the OS actually providing these. This is - * a temporary hack for human genome analysis. - */ -typedef unsigned long long sqd_uint64; /* 64 bit integer. */ - -#define GSI64_KEYSIZE 32 /* keys are 32 bytes long */ -#define GSI64_RECSIZE 42 /* 32 + 2 + 8 bytes */ -#define SQD_UINT16_MAX 65535 /* 2^16-1 */ -#define SQD_UINT64_MAX 18446744073709551615LU /* 2^64-1 */ - -struct gsi64_s { - FILE *gsifp; /* open GSI index file */ - sqd_uint16 nfiles; /* number of files = 16 bit int */ - sqd_uint64 recnum; /* number of records = 64 bit int */ -}; -typedef struct gsi64_s GSI64FILE; - -struct gsi64key_s { - char key[GSI64_KEYSIZE]; - sqd_uint16 filenum; - sqd_uint64 offset; -}; -struct gsi64index_s { - char **filenames; - int *fmt; - sqd_uint16 nfiles; - - struct gsi64key_s *elems; - sqd_uint64 nkeys; -}; - - - -/* if ntohl() and friends are not available, you - * can slip replacements in by providing sre_ntohl() - * functions. (i.e., there is a possible portability problem here.) - */ -#if 0 -#define sre_ntohl(x) ntohl(x); -#define sre_ntohs(x) ntohs(x); -#define sre_htonl(x) htonl(x); -#define sre_htons(x) htons(x); -#endif - -/* from gsi64.c - */ -extern GSI64FILE *GSI64Open(char *gsifile); -extern int GSI64GetRecord(GSI64FILE *gsi, char *f1, sqd_uint16 *f2, sqd_uint64 *f3); -extern int GSI64GetOffset(GSI64FILE *gsi, char *key, char *sqfile, - int *fmt, long long *ret_offset); -extern void GSI64Close(GSI64FILE *gsi); -extern struct gsi64index_s *GSI64AllocIndex(void); -extern void GSI64FreeIndex(struct gsi64index_s *g); -extern void GSI64AddFileToIndex(struct gsi64index_s *g, char *filename, int fmt); -extern void GSI64AddKeyToIndex(struct gsi64index_s *g, char *key, int filenum, long long offset); -extern void GSI64SortIndex(struct gsi64index_s *g); -extern void GSI64WriteIndex(FILE *fp, struct gsi64index_s *g); -extern void GSI64WriteHeader(FILE *fp, int nfiles, long long nkeys); -extern int GSI64WriteFileRecord(FILE *fp, char *fname, int idx, int fmt); -extern int GSI64WriteKeyRecord(FILE *fp, char *key, int fileidx, long long offset); - -#endif /* USE_GSI64 */ -#endif /*GSIH_INCLUDED*/ |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/squid/hsregex.c --- a/clustalomega/clustal-omega-0.2.0/src/squid/hsregex.c Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,1350 +0,0 @@\n-/*****************************************************************\n- * SQUID - a library of functions for biological sequence analysis\n- * Copyright (C) 1992-2002 Washington University School of Medicine\n- * \n- * This source code is freely distributed under the terms of the\n- * GNU General Public License. See the files COPYRIGHT and LICENSE\n- * for details.\n- *****************************************************************/\n-\n-/*****************************************************************\n- * This code is an altered version of Henry Spencer\'s\n- * regex library. Alterations are limited to minor streamlining,\n- * and some name changes to protect the SQUID namespace.\n- * Henry\'s copyright notice appears below.\n- * You can obtain the original from \n- * ftp://ftp.zoo.toronto.edu/pub/bookregex.tar.Z\n- * Thanks, Henry!\n- * \n- * The magic word for compiling a testdriver: NBA_TEAM_IN_STL\n- * gcc -o test -g -DNBA_TEAM_IN_STL -L. hsregex.c -lsquid -lm\n- * \n- * Usage: \n- * test <pattern> <ntok> <string>\n- * \n- * SRE, Fri Aug 28 11:10:17 1998\n- * CVS $Id: hsregex.c,v 1.7 2001/08/09 17:50:17 eddy Exp)\n- *****************************************************************/ \n-\n-#include <stdio.h>\n-#include <stdlib.h>\n-#include <string.h>\n-#include <ctype.h>\n-#include "squid.h"\n-\n-/* global sqd_parse[] are managed by Strparse().\n- * WARNING: TODO: this code is not threadsafe, and needs to be revised. \n- */\n-char *sqd_parse[10];\n-\n-/* Function: Strparse()\n- * \n- * Purpose: Match a regexp to a string. Returns 1 if pattern matches,\n- * else 0.\n- *\n- * Much like Perl, Strparse() makes copies of the matching\n- * substrings available via globals, sqd_parse[].\n- * sqd_parse[0] contains a copy of the complete matched\n- * text. sqd_parse[1-9] contain copies of up to nine\n- * different substrings matched within parentheses.\n- * The memory for these strings is internally managed and\n- * volatile; the next call to Strparse() may destroy them.\n- * If the caller needs the matched substrings to persist\n- * beyond a new Strparse() call, it must make its own \n- * copies.\n- * \n- * A minor drawback of the memory management is that\n- * there will be a small amount of unfree\'d memory being\n- * managed by Strparse() when a program exits; this may\n- * confuse memory debugging (Purify, dbmalloc). The\n- * general cleanup function SqdClean() is provided;\n- * you can call this before exiting.\n- * \n- * Uses an extended POSIX regular expression interface.\n- * A copylefted GNU implementation is included in the squid\n- * implementation (gnuregex.c) for use on non-POSIX compliant\n- * systems. POSIX 1003.2-compliant systems (all UNIX,\n- * some WinNT, I believe) can omit the GNU code if necessary.\n- * \n- * I built this for ease of use, not speed nor efficiency.\n- *\n- * Example: Strparse("foo-...-baz", "foo-bar-baz") returns 0\n- * Strparse("foo-(...)-baz", "foo-bar-baz")\n- * returns 0; sqd_parse[0] is "foo-bar-baz";\n- * sqd_parse[1] is "bar".\n- * \n- * A real example: \n- * s = ">gnl|ti|3 G10P69425RH2.T0 {SUB 81..737} /len=657"\n- * pat = "SUB ([0-9]+)"\n- * Strparse(pat, s, 1)\n- * returns 1; sqd_parse[1] is "81".\n- * \n- * Args: rexp - regular expression, extended POSIX form\n- * s - string to match against\n- * ntok - number of () substrings we will save (maximum NSUBEXP-1)\n- * \n- * Return: 1 on match, 0 if no match\n- */\n-int\n-Strparse(char *rexp, char *s, int ntok)\n-{\n- sqd_regexp *pat;\n- int code;\n- int len;\n- int i;\n-\t\t\t\t/* sanity check */\n- if (ntok >= NSUBEXP ) Die("Strparse()'..b'();\n-\n-/*\n- - regdump - dump a regexp onto stdout in vaguely comprehensible form\n- */\n-void\n-regdump(r)\n-sqd_regexp *r;\n-{\n-\tregister char *s;\n-\tregister char op = EXACTLY;\t/* Arbitrary non-END op. */\n-\tregister char *next;\n-\n-\n-\ts = r->program + 1;\n-\twhile (op != END) {\t/* While that wasn\'t END last time... */\n-\t\top = OP(s);\n-\t\tprintf("%2d%s", s-r->program, regprop(s));\t/* Where, what. */\n-\t\tnext = regnext(s);\n-\t\tif (next == NULL)\t\t/* Next ptr. */\n-\t\t\tprintf("(0)");\n-\t\telse \n-\t\t\tprintf("(%d)", (s-r->program)+(next-s));\n-\t\ts += 3;\n-\t\tif (op == ANYOF || op == ANYBUT || op == EXACTLY) {\n-\t\t\t/* Literal string, where present. */\n-\t\t\twhile (*s != \'\\0\') {\n-\t\t\t\tputchar(*s);\n-\t\t\t\ts++;\n-\t\t\t}\n-\t\t\ts++;\n-\t\t}\n-\t\tputchar(\'\\n\');\n-\t}\n-\n-\t/* Header fields of interest. */\n-\tif (r->regstart != \'\\0\')\n-\t\tprintf("start `%c\' ", r->regstart);\n-\tif (r->reganch)\n-\t\tprintf("anchored ");\n-\tif (r->regmust != NULL)\n-\t\tprintf("must have \\"%s\\"", r->regmust);\n-\tprintf("\\n");\n-}\n-\n-/*\n- - regprop - printable representation of opcode\n- */\n-static char *\n-regprop(op)\n-char *op;\n-{\n-\tregister char *p;\n-\tstatic char buf[50];\n-\n-\t(void) strcpy(buf, ":");\n-\n-\tswitch (OP(op)) {\n-\tcase BOL:\n-\t\tp = "BOL";\n-\t\tbreak;\n-\tcase EOL:\n-\t\tp = "EOL";\n-\t\tbreak;\n-\tcase ANY:\n-\t\tp = "ANY";\n-\t\tbreak;\n-\tcase ANYOF:\n-\t\tp = "ANYOF";\n-\t\tbreak;\n-\tcase ANYBUT:\n-\t\tp = "ANYBUT";\n-\t\tbreak;\n-\tcase BRANCH:\n-\t\tp = "BRANCH";\n-\t\tbreak;\n-\tcase EXACTLY:\n-\t\tp = "EXACTLY";\n-\t\tbreak;\n-\tcase NOTHING:\n-\t\tp = "NOTHING";\n-\t\tbreak;\n-\tcase BACK:\n-\t\tp = "BACK";\n-\t\tbreak;\n-\tcase END:\n-\t\tp = "END";\n-\t\tbreak;\n-\tcase OPEN+1:\n-\tcase OPEN+2:\n-\tcase OPEN+3:\n-\tcase OPEN+4:\n-\tcase OPEN+5:\n-\tcase OPEN+6:\n-\tcase OPEN+7:\n-\tcase OPEN+8:\n-\tcase OPEN+9:\n-\t\tsprintf(buf+strlen(buf), "OPEN%d", OP(op)-OPEN);\n-\t\tp = NULL;\n-\t\tbreak;\n-\tcase CLOSE+1:\n-\tcase CLOSE+2:\n-\tcase CLOSE+3:\n-\tcase CLOSE+4:\n-\tcase CLOSE+5:\n-\tcase CLOSE+6:\n-\tcase CLOSE+7:\n-\tcase CLOSE+8:\n-\tcase CLOSE+9:\n-\t\tsprintf(buf+strlen(buf), "CLOSE%d", OP(op)-CLOSE);\n-\t\tp = NULL;\n-\t\tbreak;\n-\tcase STAR:\n-\t\tp = "STAR";\n-\t\tbreak;\n-\tcase PLUS:\n-\t\tp = "PLUS";\n-\t\tbreak;\n-\tdefault:\n-\t\tsqd_regerror("corrupted opcode");\n-\t\tbreak;\n-\t}\n-\tif (p != NULL)\n-\t\t(void) strcat(buf, p);\n-\treturn(buf);\n-}\n-#endif\n-\n-\n-/*\n- - sqd_regsub - perform substitutions after a regexp match\n- */\n-void\n-sqd_regsub(rp, source, dest)\n-const sqd_regexp *rp;\n-const char *source;\n-char *dest;\n-{\n-\tregister sqd_regexp * const prog = (sqd_regexp *)rp;\n-\tregister char *src = (char *)source;\n-\tregister char *dst = dest;\n-\tregister char c;\n-\tregister int no;\n-\tregister size_t len;\n-\n-\tif (prog == NULL || source == NULL || dest == NULL) {\n-\t\tsqd_regerror("NULL parameter to sqd_regsub");\n-\t\treturn;\n-\t}\n-\tif ((unsigned char)*(prog->program) != SQD_REGMAGIC) {\n-\t\tsqd_regerror("damaged regexp");\n-\t\treturn;\n-\t}\n-\n-\twhile ((c = *src++) != \'\\0\') {\n-\t\tif (c == \'&\')\n-\t\t\tno = 0;\n-\t\telse if (c == \'\\\\\' && isdigit((int) (*src)))\n-\t\t\tno = *src++ - \'0\';\n-\t\telse\n-\t\t\tno = -1;\n-\n-\t\tif (no < 0) {\t/* Ordinary character. */\n-\t\t\tif (c == \'\\\\\' && (*src == \'\\\\\' || *src == \'&\'))\n-\t\t\t\tc = *src++;\n-\t\t\t*dst++ = c;\n-\t\t} else if (prog->startp[no] != NULL && prog->endp[no] != NULL &&\n-\t\t\t\t\tprog->endp[no] > prog->startp[no]) {\n-\t\t\tlen = prog->endp[no] - prog->startp[no];\n-\t\t\t(void) strncpy(dst, prog->startp[no], len);\n-\t\t\tdst += len;\n-\t\t\tif (*(dst-1) == \'\\0\') {\t/* strncpy hit NUL. */\n-\t\t\t\tsqd_regerror("damaged match string");\n-\t\t\t\treturn;\n-\t\t\t}\n-\t\t}\n-\t}\n-\t*dst++ = \'\\0\';\n-}\n-\n-\n-void\n-sqd_regerror(s)\n-char *s;\n-{\n- fprintf(stderr, "regexp(3): %s\\n", s);\n- exit(EXIT_FAILURE);\n- /* NOTREACHED */\n-}\n-\n-#ifdef NBA_TEAM_IN_STL\n-int\n-main(int argc, char **argv)\n-{\n- char *pat;\n- int ntok;\n- char *s;\n- int status;\n-\n- pat = argv[1];\n- ntok = atoi(argv[2]);\n- s = argv[3];\n-\n- status = Strparse(pat, s, ntok);\n- if (status == 0) {\n- printf("no match\\n");\n- } else {\n- int i;\n- printf("MATCH.\\n");\n- for (i = 1; i <= ntok; i++) \n- printf("matched token %1d: %s\\n", i, sqd_parse[i]);\n- }\n-}\n-#endif /*NBA_TEAM_IN_STL*/\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/squid/iupac.c --- a/clustalomega/clustal-omega-0.2.0/src/squid/iupac.c Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,219 +0,0 @@ -/***************************************************************** - * SQUID - a library of functions for biological sequence analysis - * Copyright (C) 1992-2002 Washington University School of Medicine - * - * This source code is freely distributed under the terms of the - * GNU General Public License. See the files COPYRIGHT and LICENSE - * for details. - *****************************************************************/ - -/* iupac.c - * - * Globally defines the IUPAC symbols for nucleic acid sequence - * Slowly evolving into a repository of globals. Tue Apr 20 1993 - * - * RCS $Id: iupac.c 217 2011-03-19 10:27:10Z andreas $ (Original squid RCS Id: iupac.c,v 1.3 2001/02/21 21:09:10 eddy Exp) - */ -#include "squid.h" - -/* Default expected nucleotide occurrence frequencies, A/C/G/T. - * Used (for instance) as the default distribution for - * i.i.d. random nucleotide sequences. - */ -float dnafq[4] = { 0.25, 0.25, 0.25, 0.25 }; - -/* Dayhoff f(i) amino acid occurrence frequencies. - * From SwissProt 34: 21,210,388 residues - * In alphabetic order by single-letter code. - * Used (for instance) as the default distribution for - * i.i.d. random protein sequences. - */ -float aafq[20] = { - 0.075520, /* A */ - 0.016973, /* C */ - 0.053029, /* D */ - 0.063204, /* E */ - 0.040762, /* F */ - 0.068448, /* G */ - 0.022406, /* H */ - 0.057284, /* I */ - 0.059398, /* K */ - 0.093399, /* L */ - 0.023569, /* M */ - 0.045293, /* N */ - 0.049262, /* P */ - 0.040231, /* Q */ - 0.051573, /* R */ - 0.072214, /* S */ - 0.057454, /* T */ - 0.065252, /* V */ - 0.012513, /* W */ - 0.031985 /* Y */ -}; - -char aa_alphabet[] = AMINO_ALPHABET; - /* aa_index converts to pam's 27x27 scheme */ -int aa_index[20] = { 0, 2, 3, 4, 5, 6, 7, 8, 10, 11, - 12, 13, 15, 16, 17, 18, 19, 21, 22, 24 }; - - /* IUPAC code translations */ - /* note: sequence chars are UPPER CASE */ -struct iupactype iupac[] = { - { 'A', 'T', NTA, NTT, }, - { 'C', 'G', NTC, NTG, }, - { 'G', 'C', NTG, NTC, }, - { 'T', 'A', NTT, NTA, }, - { 'U', 'A', NTU, NTA, }, - { 'N', 'N', NTN, NTN, }, - { ' ', ' ', NTGAP, NTGAP, }, - { 'R', 'Y', NTR, NTY, }, - { 'Y', 'R', NTY, NTR, }, - { 'M', 'K', NTM, NTK, }, - { 'K', 'M', NTK, NTM, }, - { 'S', 'S', NTS, NTS, }, - { 'W', 'W', NTW, NTW, }, - { 'H', 'D', NTH, NTD, }, - { 'B', 'V', NTB, NTV, }, - { 'V', 'B', NTV, NTB, }, - { 'D', 'H', NTD, NTH, }, - }; - - -char *stdcode1[65] = { - "K", /* AAA */ - "N", /* AAC */ - "K", /* AAG */ - "N", /* AAU */ - "T", /* ACA */ - "T", /* ACC */ - "T", /* ACG */ - "T", /* ACU */ - "R", /* AGA */ - "S", /* AGC */ - "R", /* AGG */ - "S", /* AGU */ - "I", /* AUA */ - "I", /* AUC */ - "M", /* AUG */ - "I", /* AUU */ - "Q", /* CAA */ - "H", /* CAC */ - "Q", /* CAG */ - "H", /* CAU */ - "P", /* CCA */ - "P", /* CCC */ - "P", /* CCG */ - "P", /* CCU */ - "R", /* CGA */ - "R", /* CGC */ - "R", /* CGG */ - "R", /* CGU */ - "L", /* CUA */ - "L", /* CUC */ - "L", /* CUG */ - "L", /* CUU */ - "E", /* GAA */ - "D", /* GAC */ - "E", /* GAG */ - "D", /* GAU */ - "A", /* GCA */ - "A", /* GCC */ - "A", /* GCG */ - "A", /* GCU */ - "G", /* GGA */ - "G", /* GGC */ - "G", /* GGG */ - "G", /* GGU */ - "V", /* GUA */ - "V", /* GUC */ - "V", /* GUG */ - "V", /* GUU */ - "*", /* UAA */ - "Y", /* UAC */ - "*", /* UAG */ - "Y", /* UAU */ - "S", /* UCA */ - "S", /* UCC */ - "S", /* UCG */ - "S", /* UCU */ - "*", /* UGA */ - "C", /* UGC */ - "W", /* UGG */ - "C", /* UGU */ - "L", /* UUA */ - "F", /* UUC */ - "L", /* UUG */ - "F", /* UUU */ - "X", /* unknown */ -}; - - - - -char *stdcode3[65] = { - "Lys", /* AAA */ - "Asn", /* AAC */ - "Lys", /* AAG */ - "Asn", /* AAU */ - "Thr", /* ACA */ - "Thr", /* ACC */ - "Thr", /* ACG */ - "Thr", /* ACU */ - "Arg", /* AGA */ - "Ser", /* AGC */ - "Arg", /* AGG */ - "Ser", /* AGU */ - "Ile", /* AUA */ - "Ile", /* AUC */ - "Met", /* AUG */ - "Ile", /* AUU */ - "Gln", /* CAA */ - "His", /* CAC */ - "Gln", /* CAG */ - "His", /* CAU */ - "Pro", /* CCA */ - "Pro", /* CCC */ - "Pro", /* CCG */ - "Pro", /* CCU */ - "Arg", /* CGA */ - "Arg", /* CGC */ - "Arg", /* CGG */ - "Arg", /* CGU */ - "Leu", /* CUA */ - "Leu", /* CUC */ - "Leu", /* CUG */ - "Leu", /* CUU */ - "Glu", /* GAA */ - "Asp", /* GAC */ - "Glu", /* GAG */ - "Asp", /* GAU */ - "Ala", /* GCA */ - "Ala", /* GCC */ - "Ala", /* GCG */ - "Ala", /* GCU */ - "Gly", /* GGA */ - "Gly", /* GGC */ - "Gly", /* GGG */ - "Gly", /* GGU */ - "Val", /* GUA */ - "Val", /* GUC */ - "Val", /* GUG */ - "Val", /* GUU */ - "***", /* UAA */ - "Tyr", /* UAC */ - "***", /* UAG */ - "Tyr", /* UAU */ - "Ser", /* UCA */ - "Ser", /* UCC */ - "Ser", /* UCG */ - "Ser", /* UCU */ - "***", /* UGA */ - "Cys", /* UGC */ - "Trp", /* UGG */ - "Cys", /* UGU */ - "Leu", /* UUA */ - "Phe", /* UUC */ - "Leu", /* UUG */ - "Trp", /* UUU */ - "XXX", /* unknown */ -}; |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/squid/msa.c --- a/clustalomega/clustal-omega-0.2.0/src/squid/msa.c Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,1442 +0,0 @@\n-/*****************************************************************\n- * SQUID - a library of functions for biological sequence analysis\n- * Copyright (C) 1992-2002 Washington University School of Medicine\n- * \n- * This source code is freely distributed under the terms of the\n- * GNU General Public License. See the files COPYRIGHT and LICENSE\n- * for details.\n- *****************************************************************/\n-\n-/* msa.c\n- * SRE, Mon May 17 10:48:47 1999\n- * \n- * SQUID\'s interface for multiple sequence alignment\n- * manipulation: access to the MSA object.\n- * \n- * RCS $Id: msa.c 217 2011-03-19 10:27:10Z andreas $ (Original squid RCS Id: msa.c,v 1.18 2002/10/12 04:40:35 eddy Exp)\n- */\n-\n-#include <stdio.h>\n-#include <stdlib.h>\n-#include <string.h>\n-#include "squid.h"\n-#include "msa.h"\t/* multiple sequence alignment object support */\n-#include "gki.h"\t/* string indexing hashtable code */\n-#include "ssi.h"\t/* SSI sequence file indexing code */\n-\n-/* Function: MSAAlloc()\n- * Date: SRE, Tue May 18 10:45:47 1999 [St. Louis]\n- *\n- * Purpose: Allocate an MSA structure, return a pointer\n- * to it.\n- * \n- * Designed to be used in three ways:\n- * 1) We know exactly the dimensions of the alignment:\n- * both nseq and alen.\n- * msa = MSAAlloc(nseq, alen);\n- * \n- * 2) We know the number of sequences but not alen.\n- * (We add sequences later.) \n- * msa = MSAAlloc(nseq, 0);\n- * \n- * 3) We even don\'t know the number of sequences, so\n- * we\'ll have to dynamically expand allocations.\n- * We provide a blocksize for the allocation expansion,\n- * and expand when needed.\n- * msa = MSAAlloc(10, 0);\n- * if (msa->nseq == msa->nseqalloc) MSAExpand(msa); \n- *\n- * Args: nseq - number of sequences, or nseq allocation blocksize\n- * alen - length of alignment in columns, or 0 \n- *\n- * Returns: pointer to new MSA object, w/ all values initialized.\n- * Note that msa->nseq is initialized to 0, though space\n- * is allocated.\n- * \n- * Diagnostics: "always works". Die()\'s on memory allocation failure.\n- * \n- */\n-MSA *\n-MSAAlloc(int nseq, int alen)\n-{\n- MSA *msa;\n- int i;\n-\n- msa = MallocOrDie(sizeof(MSA));\n- msa->aseq = MallocOrDie(sizeof(char *) * nseq);\n- msa->sqname = MallocOrDie(sizeof(char *) * nseq);\n- msa->sqlen = MallocOrDie(sizeof(int) * nseq);\n- msa->wgt = MallocOrDie(sizeof(float) * nseq);\n-\n- for (i = 0; i < nseq; i++)\n- {\n- msa->sqname[i] = NULL;\n- msa->sqlen[i] = 0;\n- msa->wgt[i] = -1.0;\n-\n- if (alen != 0) msa->aseq[i] = MallocOrDie(sizeof(char) * (alen+1));\n- else msa->aseq[i] = NULL;\n- } \n-\n- msa->alen = alen;\n- msa->nseq = 0;\n- msa->nseqalloc = nseq;\n- msa->nseqlump = nseq;\n-\n- msa->flags = 0;\n- msa->type = kOtherSeq;\n- msa->name = NULL;\n- msa->desc = NULL;\n- msa->acc = NULL;\n- msa->au = NULL;\n- msa->ss_cons = NULL;\n- msa->sa_cons = NULL;\n- msa->rf = NULL;\n- msa->sqacc = NULL;\n- msa->sqdesc = NULL;\n- msa->ss = NULL;\n- msa->sslen = NULL;\n- msa->sa = NULL;\n- msa->salen = NULL;\n- msa->index = GKIInit();\n- msa->lastidx = 0;\n-\n- for (i = 0; i < MSA_MAXCUTOFFS; i++) {\n- msa->cutoff[i] = 0.;\n- msa->cutoff_is_set[i] = FALSE;\n- }\n-\n- /* Initialize unparsed optional markup\n- */\n- msa->comment = NULL;\n- msa->ncomment = 0;\n- msa->alloc_ncomment = 0;\n-\n- msa->gf_tag = NULL;\n- msa->gf = NULL;\n- msa->ngf = 0;\n-\n- msa->gs_tag = NULL;\n- msa->gs = NULL;\n- msa->gs_idx = NULL;\n- msa->ngs = 0;\n-\n- msa->gc_tag = NULL;\n- msa->gc = NULL;\n- msa->'..b"E/FALSE flags; TRUE means include \n- * this seq in new alignment\n- * ret_new -- RETURN: new alignment \n- *\n- * Returns: void\n- * ret_new is allocated here; free with MSAFree() \n- */\n-void\n-MSASmallerAlignment(MSA *msa, int *useme, MSA **ret_new)\n-{\n- MSA *new; /* RETURN: new alignment */\n- int nnew;\t\t\t/* number of seqs in new msa (e.g. # of TRUEs) */\n- int oidx, nidx;\t\t/* old, new indices */\n- int i;\n-\n- nnew = 0;\n- for (oidx = 0; oidx < msa->nseq; oidx++)\n- if (useme[oidx]) nnew++;\n- if (nnew == 0) { *ret_new = NULL; return; }\n- \n- new = MSAAlloc(nnew, 0);\n- nidx = 0;\n- for (oidx = 0; oidx < msa->nseq; oidx++)\n- if (useme[oidx])\n- {\n-\tnew->aseq[nidx] = sre_strdup(msa->aseq[oidx], msa->alen);\n-\tnew->sqname[nidx] = sre_strdup(msa->sqname[oidx], msa->alen);\n-\tGKIStoreKey(new->index, msa->sqname[oidx]);\n-\tnew->wgt[nidx] = msa->wgt[oidx];\n-\tif (msa->sqacc != NULL)\n-\t MSASetSeqAccession(new, nidx, msa->sqacc[oidx]);\n-\tif (msa->sqdesc != NULL)\n-\t MSASetSeqDescription(new, nidx, msa->sqdesc[oidx]);\n-\tif (msa->ss != NULL && msa->ss[oidx] != NULL)\n-\t {\n-\t if (new->ss == NULL) new->ss = MallocOrDie(sizeof(char *) * new->nseq);\n-\t new->ss[nidx] = sre_strdup(msa->ss[oidx], -1);\n-\t }\n-\tif (msa->sa != NULL && msa->sa[oidx] != NULL)\n-\t {\n-\t if (new->sa == NULL) new->sa = MallocOrDie(sizeof(char *) * new->nseq);\n-\t new->sa[nidx] = sre_strdup(msa->sa[oidx], -1);\n-\t }\n-\tnidx++;\n- }\n-\n- new->nseq = nnew;\n- new->alen = msa->alen; \n- new->flags = msa->flags;\n- new->type = msa->type;\n- new->name = sre_strdup(msa->name, -1);\n- new->desc = sre_strdup(msa->desc, -1);\n- new->acc = sre_strdup(msa->acc, -1);\n- new->au = sre_strdup(msa->au, -1);\n- new->ss_cons = sre_strdup(msa->ss_cons, -1);\n- new->sa_cons = sre_strdup(msa->sa_cons, -1);\n- new->rf = sre_strdup(msa->rf, -1);\n- for (i = 0; i < MSA_MAXCUTOFFS; i++) {\n- new->cutoff[i] = msa->cutoff[i];\n- new->cutoff_is_set[i] = msa->cutoff_is_set[i];\n- }\n- free(new->sqlen);\n-\n- MSAMingap(new);\n- *ret_new = new;\n- return;\n-}\n-\n-\n-/*****************************************************************\n- * Retrieval routines\n- * \n- * Access to MSA structure data is possible through these routines.\n- * I'm not doing this because of object oriented design, though\n- * it might work in my favor someday.\n- * I'm doing this because lots of MSA data is optional, and\n- * checking through the chain of possible NULLs is a pain.\n- *****************************************************************/\n-\n-char *\n-MSAGetSeqAccession(MSA *msa, int idx)\n-{\n- if (msa->sqacc != NULL && msa->sqacc[idx] != NULL)\n- return msa->sqacc[idx];\n- else\n- return NULL;\n-}\n-char *\n-MSAGetSeqDescription(MSA *msa, int idx)\n-{\n- if (msa->sqdesc != NULL && msa->sqdesc[idx] != NULL)\n- return msa->sqdesc[idx];\n- else\n- return NULL;\n-}\n-char *\n-MSAGetSeqSS(MSA *msa, int idx)\n-{\n- if (msa->ss != NULL && msa->ss[idx] != NULL)\n- return msa->ss[idx];\n- else\n- return NULL;\n-}\n-char *\n-MSAGetSeqSA(MSA *msa, int idx)\n-{\n- if (msa->sa != NULL && msa->sa[idx] != NULL)\n- return msa->sa[idx];\n- else\n- return NULL;\n-}\n-\n-\n-/*****************************************************************\n- * Information routines\n- * \n- * Access information about the MSA.\n- *****************************************************************/\n-\n-/* Function: MSAAverageSequenceLength()\n- * Date: SRE, Sat Apr 6 09:41:34 2002 [St. Louis]\n- *\n- * Purpose: Return the average length of the (unaligned) sequences\n- * in the MSA.\n- *\n- * Args: msa - the alignment\n- *\n- * Returns: average length\n- */\n-float\n-MSAAverageSequenceLength(MSA *msa)\n-{\n- int i;\n- float avg;\n- \n- avg = 0.;\n- for (i = 0; i < msa->nseq; i++) \n- avg += (float) DealignedLength(msa->aseq[i]);\n-\n- if (msa->nseq == 0) return 0.;\n- else return (avg / msa->nseq);\n-}\n-\n-\n" |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/squid/msa.h --- a/clustalomega/clustal-omega-0.2.0/src/squid/msa.h Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,302 +0,0 @@\n-/*****************************************************************\n- * SQUID - a library of functions for biological sequence analysis\n- * Copyright (C) 1992-2002 Washington University School of Medicine\n- * \n- * This source code is freely distributed under the terms of the\n- * GNU General Public License. See the files COPYRIGHT and LICENSE\n- * for details.\n- *****************************************************************/\n-\n-#ifndef SQUID_MSA_INCLUDED\n-#define SQUID_MSA_INCLUDED\n-\n-/* msa.h\n- * SRE, Mon May 17 10:24:30 1999\n- * \n- * Header file for SQUID\'s multiple sequence alignment \n- * manipulation code.\n- * \n- * RCS $Id: msa.h 217 2011-03-19 10:27:10Z andreas $ (Original squid RCS Id: msa.h,v 1.12 2002/10/12 04:40:35 eddy Exp)\n- */\n-\n-#include <stdio.h>\t\t/* FILE support */\n-#include "gki.h"\t\t/* hash table support */\n-#include "ssi.h"\t\t/* sequence file index support */\n-#include "squid.h"\t\t/* need SQINFO */\n-\n-/****************************************************\n- * Obsolete alignment information, AINFO\n- * Superceded by MSA structure further below; but we\n- * need AINFO for the near future for backwards\n- * compatibility.\n- ****************************************************/\n-/* Structure: aliinfo_s\n- * \n- * Purpose: Optional information returned from an alignment file.\n- * \n- * flags: always used. Flags for which info is valid/alloced.\n- * \n- * alen: mandatory. Alignments are always flushed right\n- * with gaps so that all aseqs are the same length, alen.\n- * Available for all alignment formats.\n- *\n- * nseq: mandatory. Aligned seqs are indexed 0..nseq-1. \n- * \n- * wgt: 0..nseq-1 vector of sequence weights. Mandatory.\n- * If not explicitly set, weights are initialized to 1.0.\n- *\n- * cs: 0..alen-1, just like the alignment. Contains single-letter\n- * secondary structure codes for consensus structure; "<>^+"\n- * for RNA, "EHL." for protein. May be NULL if unavailable\n- * from seqfile. Only available for SELEX format files.\n- * \n- * rf: 0..alen-1, just like the alignment. rf is an arbitrary string\n- * of characters, used for annotating columns. Blanks are\n- * interpreted as non-canonical columns and anything else is\n- * considered canonical. Only available from SELEX files.\n- * \n- * sqinfo: mandatory. Array of 0..nseq-1 \n- * per-sequence information structures, carrying\n- * name, id, accession, coords.\n- * \n- */\n-struct aliinfo_s {\t\t\n- int flags; /* flags for what info is valid */\n- int alen;\t/* length of alignment (columns) */\n- int nseq; /* number of seqs in alignment */\n- float *wgt;\t/* sequence weights [0..nseq-1] */\n- char *cs; /* consensus secondary structure string */\n- char *rf; /* reference coordinate system */\n- struct seqinfo_s *sqinfo; /* name, id, coord info for each sequence */\n-\n- /* Pfam/HMMER pick-ups */\t\n- char *name;\t\t\t/* name of alignment */\n- char *desc;\t\t\t/* description of alignment */\n- char *acc;\t\t\t/* accession of alignment */\n- char *au;\t\t\t/* "author" information */\n- float tc1, tc2;\t\t/* trusted score cutoffs (per-seq, per-domain) */\n- float nc1, nc2;\t\t/* noise score cutoffs (per-seq, per-domain) */\n- float ga1, ga2;\t\t/* gathering cutoffs */\n-};\n-typedef struct aliinfo_s AINFO;\n-#define AINFO_TC (1 << 0)\n-#define AINFO_NC (1 << 1)\n-#define AINFO_GA (1 << 2)\n-\n-/*****************************************************************\n- * MSA \n- * SRE, Sun Jun 27 15:03:35 1999 [TW 723 over Greenland]\n- * '..b"-\n- SSIFILE *ssi;\t\t /* open SSI index file; or NULL, if none. */\n-\n- int do_gzip;\t\t/* TRUE if f is a pipe from gzip -dc (need pclose(f)) */\n- int do_stdin;\t\t/* TRUE if f is stdin (don't close f, not our problem) */\n- int format;\t\t\t/* format of alignment file we're reading */\n-} MSAFILE;\n-\n-\n-/* Alignment file formats.\n- * Must coexist with sqio.c/squid.h unaligned file format codes.\n- * Rules:\n- * - 0 is an unknown/unassigned format \n- * - <100 reserved for unaligned formats\n- * - >100 reserved for aligned formats\n- */\n-#define MSAFILE_UNKNOWN 0\t/* unknown format */\n-#define MSAFILE_STOCKHOLM 101\t/* Pfam/HMMER's Stockholm format */\n-#define MSAFILE_SELEX\t 102\t/* Obsolete(!): old HMMER/SELEX format */\n-#define MSAFILE_MSF\t 103\t/* GCG MSF format */\n-#define MSAFILE_CLUSTAL\t 104\t/* Clustal V/W format */\n-#define MSAFILE_A2M\t 105\t/* aligned FASTA (A2M is UCSC terminology) */\n-#define MSAFILE_PHYLIP 106\t/* Felsenstein's PHYLIP format */\n-#define MSAFILE_EPS 107\t/* Encapsulated PostScript (output only) */\n-#ifdef CLUSTALO\n-#define MSAFILE_VIENNA 108\t/* Vienna: concatenated fasta */\n-#endif\n-\n-#define IsAlignmentFormat(fmt) ((fmt) > 100)\n-\n-\n-/* from msa.c\n- */\n-extern MSAFILE *MSAFileOpen(char *filename, int format, char *env);\n-extern MSA *MSAFileRead(MSAFILE *afp);\n-extern void MSAFileClose(MSAFILE *afp);\n-extern void MSAFree(MSA *msa);\n-extern void MSAFileWrite(FILE *fp, MSA *msa, int outfmt, int do_oneline);\n-\n-extern int MSAFileRewind(MSAFILE *afp);\n-extern int MSAFilePositionByKey(MSAFILE *afp, char *key);\n-extern int MSAFilePositionByIndex(MSAFILE *afp, int idx);\n-\n-extern int MSAFileFormat(MSAFILE *afp);\n-extern MSA *MSAAlloc(int nseq, int alen);\n-extern void MSAExpand(MSA *msa);\n-extern char *MSAFileGetLine(MSAFILE *afp);\n-extern void MSASetSeqAccession(MSA *msa, int seqidx, char *acc);\n-extern void MSASetSeqDescription(MSA *msa, int seqidx, char *desc);\n-extern void MSAAddComment(MSA *msa, char *s);\n-extern void MSAAddGF(MSA *msa, char *tag, char *value);\n-extern void MSAAddGS(MSA *msa, char *tag, int seqidx, char *value);\n-extern void MSAAppendGC(MSA *msa, char *tag, char *value);\n-extern char *MSAGetGC(MSA *msa, char *tag);\n-extern void MSAAppendGR(MSA *msa, char *tag, int seqidx, char *value);\n-extern void MSAVerifyParse(MSA *msa);\n-extern int MSAGetSeqidx(MSA *msa, char *name, int guess);\n-\n-extern MSA *MSAFromAINFO(char **aseq, AINFO *ainfo); \n-\n-extern void MSAMingap(MSA *msa);\n-extern void MSANogap(MSA *msa);\n-extern void MSAShorterAlignment(MSA *msa, int *useme);\n-extern void MSASmallerAlignment(MSA *msa, int *useme, MSA **ret_new);\n-\n-extern char *MSAGetSeqAccession(MSA *msa, int idx);\n-extern char *MSAGetSeqDescription(MSA *msa, int idx);\n-extern char *MSAGetSeqSS(MSA *msa, int idx);\n-extern char *MSAGetSeqSA(MSA *msa, int idx);\n-\n-extern float MSAAverageSequenceLength(MSA *msa);\n-\n-/* from a2m.c\n- */\n-extern MSA *ReadA2M(MSAFILE *afp);\n-#ifdef CLUSTALO\n-extern void WriteA2M(FILE *fp, MSA *msa, int vienna);\n-#else\n-extern void WriteA2M(FILE *fp, MSA *msa);\n-#endif\n-/* from clustal.c\n- */\n-extern MSA *ReadClustal(MSAFILE *afp);\n-extern void WriteClustal(FILE *fp, MSA *msa);\n-\n-/* from eps.c\n- */\n-extern void EPSWriteSmallMSA(FILE *fp, MSA *msa);\n-\n-/* from msf.c\n- */\n-extern MSA *ReadMSF(MSAFILE *afp);\n-extern void WriteMSF(FILE *fp, MSA *msa);\n-\n-/* from phylip.c\n- */\n-extern MSA *ReadPhylip(MSAFILE *afp);\n-extern void WritePhylip(FILE *fp, MSA *msa);\n-\n-/* from selex.c\n- */\n-extern MSA *ReadSELEX(MSAFILE *afp);\n-extern void WriteSELEX(FILE *fp, MSA *msa);\n-extern void WriteSELEXOneBlock(FILE *fp, MSA *msa);\n-\n-/* from stockholm.c\n- */\n-extern MSA *ReadStockholm(MSAFILE *afp);\n-extern void WriteStockholm(FILE *fp, MSA *msa);\n-extern void WriteStockholmOneBlock(FILE *fp, MSA *msa);\n-\n-#endif /*SQUID_MSA_INCLUDED*/\n" |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/squid/msf.c --- a/clustalomega/clustal-omega-0.2.0/src/squid/msf.c Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,388 +0,0 @@\n-/*****************************************************************\n- * SQUID - a library of functions for biological sequence analysis\n- * Copyright (C) 1992-2002 Washington University School of Medicine\n- * \n- * This source code is freely distributed under the terms of the\n- * GNU General Public License. See the files COPYRIGHT and LICENSE\n- * for details.\n- *****************************************************************/\n-\n-/* msf.c\n- * SRE, Sun Jul 11 16:17:32 1993\n- * \n- * Import/export of GCG MSF multiple sequence alignment\n- * formatted files. Designed using format specifications\n- * kindly provided by Steve Smith of Genetics Computer Group.\n- * \n- * RCS $Id: msf.c 217 2011-03-19 10:27:10Z andreas $ (Original squid RCS Id: msf.c,v 1.4 2001/04/23 00:35:33 eddy Exp)\n- */\n-\n-#include <stdio.h>\n-#include <stdlib.h>\n-#include <string.h>\n-#include <ctype.h>\n-#include <time.h>\n-#include "squid.h"\n-#include "msa.h"\n-\n-#ifdef TESTDRIVE_MSF\n-/*****************************************************************\n- * msf.c test driver: \n- * cc -DTESTDRIVE_MSF -g -O2 -Wall -o test msf.c msa.c gki.c sqerror.c sre_string.c file.c hsregex.c sre_math.c sre_ctype.c sqio.c alignio.c selex.c interleaved.c types.c -lm\n- * \n- */\n-int\n-main(int argc, char **argv)\n-{\n- MSAFILE *afp;\n- MSA *msa;\n- char *file;\n- \n- file = argv[1];\n-\n- if ((afp = MSAFileOpen(file, MSAFILE_STOCKHOLM, NULL)) == NULL)\n- Die("Couldn\'t open %s\\n", file);\n-\n- while ((msa = ReadMSF(afp)) != NULL)\n- {\n- WriteMSF(stdout, msa);\n- MSAFree(msa); \n- }\n- \n- MSAFileClose(afp);\n- exit(0);\n-}\n-/******************************************************************/\n-#endif /* testdrive_msf */\n-\n-\n-\n-/* Function: ReadMSF()\n- * Date: SRE, Tue Jun 1 08:07:22 1999 [St. Louis]\n- *\n- * Purpose: Parse an alignment read from an open MSF format\n- * alignment file. (MSF is a single-alignment format.)\n- * Return the alignment, or NULL if we\'ve already\n- * read the alignment.\n- * \n- * Args: afp - open alignment file\n- *\n- * Returns: MSA * - an alignment object\n- * caller responsible for an MSAFree()\n- * NULL if no more alignments\n- *\n- * Diagnostics: \n- * Will Die() here with a (potentially) useful message\n- * if a parsing error occurs.\n- */\n-MSA *\n-ReadMSF(MSAFILE *afp)\n-{\n- MSA *msa;\n- char *s;\n- int alleged_alen;\n- int alleged_type;\n- int alleged_checksum;\n- char *tok;\n- char *sp;\n- int slen;\n- int sqidx;\n- char *name;\n- char *seq;\n-\n- if (feof(afp->f)) return NULL;\n- if ((s = MSAFileGetLine(afp)) == NULL) return NULL;\n-\n- /* The first line is the header.\n- * This is a new-ish GCG feature. Don\'t count on it, so\n- * we can be a bit more tolerant towards non-GCG software\n- * generating "MSF" files.\n- */\n- msa = MSAAlloc(10, 0);\n- if (strncmp(s, "!!AA_MULTIPLE_ALIGNMENT", 23) == 0) {\n- msa->type = kAmino;\n- if ((s = MSAFileGetLine(afp)) == NULL) return NULL;\n- } else if (strncmp(s, "!!NA_MULTIPLE_ALIGNMENT", 23) == 0) {\n- msa->type = kRNA;\n- if ((s = MSAFileGetLine(afp)) == NULL) return NULL;\n- }\n-\n- /* Now we\'re in the free text comment section of the MSF file.\n- * It ends when we see the "MSF: Type: Check: .." line.\n- * This line must be present. \n- */\n- do\n- {\n- if ((strstr(s, "..") != NULL && strstr(s, "MSF:") != NULL) &&\n-\t Strparse("^.+MSF: +([0-9]+) +Type: +([PNX]).+Check: +([0-9]+) +\\\\.\\\\.", s, 3))\n-\t{\n-\t alleged_alen = atoi(sqd_parse[0]);\n-\t switch (*(sqd_parse[1])) {\n-\t case \'N\' : alleged_type = kRNA; break;\n-\t case \'P\' : alleged_type = kAmino; break; \n-\t case \'X\' : alleged_type = kOtherSeq; break;\n-\t default : alleged_type = kOtherSeq; \n-\t }\n-\t alleged_checksum = atoi(sqd_parse[3]);\n-\t if (msa->type == kOtherSeq) msa->type = alleged_type;\n-\t break;\t\t/* we\'re done with comment section. */\n-\t}\n- if (! Is'..b'ernal gap.\n- *****************************************************************/ \n- \n-\t\t\t\t/* make copies that we can edit */\n- gcg_aseq = MallocOrDie(sizeof(char *) * msa->nseq);\n- gcg_sqname = MallocOrDie(sizeof(char *) * msa->nseq);\n- for (idx = 0; idx < msa->nseq; idx++)\n- {\n- gcg_aseq[idx] = sre_strdup(msa->aseq[idx], msa->alen);\n- gcg_sqname[idx] = sre_strdup(msa->sqname[idx], -1);\n- }\n-\t\t\t\t/* alter names as needed */\n- for (idx = 0; idx < msa->nseq; idx++)\n- for (s = gcg_sqname[idx]; *s != \'\\0\'; s++)\n- if (! isalnum((int) *s) && *s != \'-\' && *s != \'_\')\n-\t *s = \'_\';\n-\t\t\t\t/* alter gap chars in seq */\n- for (idx = 0; idx < msa->nseq; idx++)\n- {\n- for (s = gcg_aseq[idx]; *s != \'\\0\' && isgap(*s); s++)\n-\t *s = \'~\';\n- for (; *s != \'\\0\'; s++)\n-\t if (isgap(*s)) *s = \'.\';\n- for (pos = msa->alen-1; pos > 0 && isgap(gcg_aseq[idx][pos]); pos--)\n-\t gcg_aseq[idx][pos] = \'~\';\n- }\n-\t\t\t\t/* calculate max namelen used */\n- namelen = 0;\n- for (idx = 0; idx < msa->nseq; idx++)\n- if ((len = strlen(msa->sqname[idx])) > namelen) \n- namelen = len;\n-\n- /*****************************************************\n- * Write the MSF header\n- *****************************************************/\n-\t\t\t\t/* required file type line */\n- if (msa->type == kOtherSeq)\n- msa->type = GuessAlignmentSeqtype(msa->aseq, msa->nseq);\n-\n- if (msa->type == kRNA) fprintf(fp, "!!NA_MULTIPLE_ALIGNMENT 1.0\\n");\n- else if (msa->type == kDNA) fprintf(fp, "!!NA_MULTIPLE_ALIGNMENT 1.0\\n");\n- else if (msa->type == kAmino) fprintf(fp, "!!AA_MULTIPLE_ALIGNMENT 1.0\\n");\n- else if (msa->type == kOtherSeq) \n- Die("WriteMSF(): couldn\'t guess whether that alignment is RNA or protein.\\n"); \n- else \n- Die("Invalid sequence type %d in WriteMSF()\\n", msa->type); \n-\n-\t\t\t\t/* free text comments */\n- if (msa->ncomment > 0)\n- {\n- for (idx = 0; idx < msa->ncomment; idx++)\n-\tfprintf(fp, "%s\\n", msa->comment[idx]);\n- fprintf(fp, "\\n");\n- }\n-\t\t\t\t/* required checksum line */\n- now = time(NULL);\n- if (strftime(date, 64, "%B %d, %Y %H:%M", localtime(&now)) == 0)\n- Die("What time is it on earth? strftime() failed in WriteMSF().\\n");\n- fprintf(fp, " %s MSF: %d Type: %c %s Check: %d ..\\n", \n-\t msa->name != NULL ? msa->name : "squid.msf",\n-\t msa->alen,\n-\t msa->type == kRNA ? \'N\' : \'P\',\n-\t date,\n-\t GCGMultchecksum(gcg_aseq, msa->nseq));\n- fprintf(fp, "\\n");\n-\n- /*****************************************************\n- * Names/weights section\n- *****************************************************/\n-\n- for (idx = 0; idx < msa->nseq; idx++)\n- {\n- fprintf(fp, " Name: %-*.*s Len: %5d Check: %4d Weight: %.2f\\n",\n-\t namelen, namelen,\n-\t gcg_sqname[idx],\n-\t msa->alen,\n-\t GCGchecksum(gcg_aseq[idx], msa->alen),\n-\t msa->wgt[idx]);\n- }\n- fprintf(fp, "\\n");\n- fprintf(fp, "//\\n");\n-\n- /*****************************************************\n- * Write the sequences\n- *****************************************************/\n-\n- for (pos = 0; pos < msa->alen; pos += 50)\n- {\n- fprintf(fp, "\\n");\t/* Blank line between sequence blocks */\n-\n-\t\t\t\t/* Coordinate line */\n- len = (pos + 50) > msa->alen ? msa->alen - pos : 50;\n- if (len > 10)\n-\tfprintf(fp, "%*s %-6d%*s%6d\\n", namelen, "", \n-\t\tpos+1,\n-\t\tlen + ((len-1)/10) - 12, "",\n-\t\tpos + len);\n- else\n-\tfprintf(fp, "%*s %-6d\\n", namelen, "", pos+1);\n-\n- for (idx = 0; idx < msa->nseq; idx++)\n-\t{\n-\t fprintf(fp, "%-*s ", namelen, gcg_sqname[idx]);\n-\t\t\t\t/* get next line\'s worth of 50 from seq */\n-\t strncpy(buffer, gcg_aseq[idx] + pos, 50);\n-\t buffer[50] = \'\\0\';\n-\t\t\t\t/* draw the sequence line */\n-\t for (i = 0; i < len; i++)\n-\t {\n-\t if (! (i % 10)) fputc(\' \', fp);\n-\t fputc(buffer[i], fp);\n-\t }\n-\t fputc(\'\\n\', fp);\n-\t}\n- }\n-\n- Free2DArray((void **) gcg_aseq, msa->nseq);\n- Free2DArray((void **) gcg_sqname, msa->nseq);\n- return;\n-}\n-\n-\n-\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/squid/phylip.c --- a/clustalomega/clustal-omega-0.2.0/src/squid/phylip.c Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,173 +0,0 @@ -/***************************************************************** - * SQUID - a library of functions for biological sequence analysis - * Copyright (C) 1992-2002 Washington University School of Medicine - * - * This source code is freely distributed under the terms of the - * GNU General Public License. See the files COPYRIGHT and LICENSE - * for details. - *****************************************************************/ - -/* phylip.c - * SRE, Mon Jun 14 14:08:33 1999 [St. Louis] - * - * Import/export of PHYLIP interleaved multiple sequence alignment - * format files. - * - * RCS $Id: phylip.c 217 2011-03-19 10:27:10Z andreas $ (Original squid RCS Id: phylip.c,v 1.1 1999/07/15 22:29:20 eddy Exp) - */ - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <ctype.h> -#include "squid.h" -#include "msa.h" - -#ifdef TESTDRIVE_PHYLIP -/***************************************************************** - * phylip.c test driver: - * - */ -int -main(int argc, char **argv) -{ - MSAFILE *afp; - MSA *msa; - char *file; - - file = argv[1]; - - if ((afp = MSAFileOpen(file, MSAFILE_UNKNOWN, NULL)) == NULL) - Die("Couldn't open %s\n", file); - - printf("format %d\n", afp->format); - - while ((msa = ReadPhylip(afp)) != NULL) - { - WritePhylip(stdout, msa); - MSAFree(msa); - } - - MSAFileClose(afp); - exit(0); -} -/******************************************************************/ -#endif /* testdrive_phylip */ - - - -/* Function: ReadPhylip() - * Date: SRE, Fri Jun 18 12:59:37 1999 [Sanger Centre] - * - * Purpose: Parse an alignment from an open Phylip format - * alignment file. Phylip is a single-alignment format. - * Return the alignment, or NULL if we have no data. - * - * Args: afp - open alignment file - * - * Returns: MSA * - an alignment object - * Caller responsible for an MSAFree() - * NULL if no more alignments - */ -MSA * -ReadPhylip(MSAFILE *afp) -{ - MSA *msa; - char *s, *s1, *s2; - char name[11]; /* seq name max len = 10 char */ - int nseq, alen; - int idx; /* index of current sequence */ - int slen; - int nblock; - - if (feof(afp->f)) return NULL; - - /* Skip until we see a nonblank line; it's the header, - * containing nseq/alen - */ - nseq = 0; alen = 0; - while ((s = MSAFileGetLine(afp)) != NULL) - { - if ((s1 = sre_strtok(&s, WHITESPACE, NULL)) == NULL) continue; - if ((s2 = sre_strtok(&s, WHITESPACE, NULL)) == NULL) - Die("Failed to parse nseq/alen from first line of PHYLIP file %s\n", afp->fname); - if (! IsInt(s1) || ! IsInt(s2)) - Die("nseq and/or alen not an integer in first line of PHYLIP file %s\n", afp->fname); - nseq = atoi(s1); - alen = atoi(s2); - break; - } - - msa = MSAAlloc(nseq, 0); - idx = 0; - nblock = 0; - while ((s = MSAFileGetLine(afp)) != NULL) - { - /* ignore blank lines. nonblank lines start w/ nonblank char */ - if (isspace(*s)) continue; - /* First block has seq names */ - if (nblock == 0) { - strncpy(name, s, 10); - name[10] = '\0'; - GKIStoreKey(msa->index, name); - msa->sqname[idx] = sre_strdup(name, -1); - s += 10; - } - /* be careful of trailing whitespace on lines */ - if ((s1 = sre_strtok(&s, WHITESPACE, &slen)) == NULL) - Die("Failed to parse sequence at line %d of PHYLIP file %s\n", - afp->linenumber, afp->fname); - msa->sqlen[idx] = sre_strcat(&(msa->aseq[idx]), msa->sqlen[idx], s1, slen); - - idx++; - if (idx == nseq) { idx = 0; nblock++; } - } - msa->nseq = nseq; - MSAVerifyParse(msa); /* verifies; sets alen, wgt; frees sqlen[] */ - return msa; -} - - - -/* Function: WritePhylip() - * Date: SRE, Fri Jun 18 12:07:41 1999 [Sanger Centre] - * - * Purpose: Write an alignment in Phylip format to an open file. - * - * Args: fp - file that's open for writing. - * msa - alignment to write. - * - * Returns: (void) - */ -void -WritePhylip(FILE *fp, MSA *msa) -{ - int idx; /* counter for sequences */ - int cpl = 50; /* 50 seq char per line */ - char buf[51]; /* buffer for writing seq */ - int pos; - - /* First line has nseq, alen - */ - fprintf(fp, " %d %d\n", msa->nseq, msa->alen); - - /* Alignment section. - * PHYLIP is a multiblock format, blocks (optionally) separated - * by blanks; names only attached to first block. Names are - * restricted to ten char; we achieve this by simple truncation (!). - * (Do we need to convert gap characters from our ./- convention?) - */ - for (pos = 0; pos < msa->alen; pos += cpl) - { - if (pos > 0) fprintf(fp, "\n"); - - for (idx = 0; idx < msa->nseq; idx++) - { - strncpy(buf, msa->aseq[idx] + pos, cpl); - buf[cpl] = '\0'; - if (pos > 0) fprintf(fp, "%s\n", buf); - else fprintf(fp, "%-10.10s%s\n", msa->sqname[idx], buf); - } - } - return; -} |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/squid/revcomp.c --- a/clustalomega/clustal-omega-0.2.0/src/squid/revcomp.c Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,87 +0,0 @@ -/***************************************************************** - * SQUID - a library of functions for biological sequence analysis - * Copyright (C) 1992-2002 Washington University School of Medicine - * - * This source code is freely distributed under the terms of the - * GNU General Public License. See the files COPYRIGHT and LICENSE - * for details. - *****************************************************************/ - -/* revcomp.c - * - * Reverse complement of a IUPAC character string - * RCS $Id: revcomp.c 217 2011-03-19 10:27:10Z andreas $ (Original squid RCS Id: revcomp.c,v 1.5 2002/06/25 20:06:06 eddy Exp) - */ - -#include <stdio.h> -#include <string.h> -#include <ctype.h> -#include "squid.h" - -/* Function: revcomp() - * - * Purpose: Reverse complement seq; store in comp. - * Can revcomp "in place" (revcomp(seq, seq)). - * - * Args: comp - destination for reverse complement of seq - * seq - sequence to reverse complement - * - * Returns: NULL on failure; or a (useless) pointer to comp. - */ -char * -revcomp(char *comp, char *seq) -{ - char *s; - char c; - - if (comp == NULL) return NULL; - if (seq == NULL) return NULL; - - StrReverse(comp, seq); - for (s = comp; *s != '\0'; s++) - { - c = *s; - c = sre_toupper(c); - switch (c) { - case 'A': c = 'T'; break; - case 'C': c = 'G'; break; - case 'G': c = 'C'; break; - case 'T': c = 'A'; break; - case 'U': c = 'A'; break; - case 'R': c = 'Y'; break; - case 'Y': c = 'R'; break; - case 'M': c = 'K'; break; - case 'K': c = 'M'; break; - case 'S': c = 'S'; break; - case 'W': c = 'W'; break; - case 'H': c = 'D'; break; - case 'D': c = 'H'; break; - case 'B': c = 'V'; break; - case 'V': c = 'B'; break; - default: break; /* anything else? leave it; it's prob a gap or an X */ - } - if (islower((int) *s)) c = (char) sre_tolower((int) c); - *s = c; - } - return comp; -} - -#ifdef REVCOMP_TESTDRIVER -/* gcc -g -DREVCOMP_TESTDRIVER revcomp.c sre_string.c shuffle.c sre_math.c sre_ctype.c sqerror.c -lm -*/ -int -main(void) -{ - float p[4] = {0.25, 0.25, 0.25, 0.25}; - char *alphabet = "ACGT"; - int len = 10; - char *seq; - - seq = RandomSequence(alphabet, p, 4, len); - printf("%s\n", seq); - revcomp(seq, seq); - printf("%s\n", seq); - free(seq); - exit(0); -} -#endif |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/squid/rk.c --- a/clustalomega/clustal-omega-0.2.0/src/squid/rk.c Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,133 +0,0 @@ -/***************************************************************** - * SQUID - a library of functions for biological sequence analysis - * Copyright (C) 1992-2002 Washington University School of Medicine - * - * This source code is freely distributed under the terms of the - * GNU General Public License. See the files COPYRIGHT and LICENSE - * for details. - *****************************************************************/ - -/* rk.c (originally from rnabob's patsearch.c) - * - * Contains a compiler and a search engine for Rabin-Karp - * based primary sequence pattern searching on encoded - * sequences. - * - * See Sedgewick, _Algorithms_, for a general discussion of - * the Rabin-Karp algorithm. See the rkcomp or rkexec man - * pages for specific details. - * - * RCS $Id: rk.c 217 2011-03-19 10:27:10Z andreas $ (Original squid RCS Id: rk.c,v 1.2 1998/10/09 18:07:16 eddy Exp) - */ - -#include <stdio.h> -#include <string.h> -#include <ctype.h> -#include "squid.h" /* seq encoding utilities and typedefs */ -#include "rk.h" - - -#ifdef MEMDEBUG -#include "dbmalloc.h" -#endif - -Hashseq -rkcomp(char *probe) /* A,C,G,T/U, N probe string, 0-8 nt long */ -{ - Hashseq hashprobe = 0; - char coded[RK_HASHSIZE + 1]; - int len; - int i; - /* check bounds violation on probe */ - if ((len = strlen(probe)) > RK_HASHSIZE) return 0; - /* encode the probe */ - if (seqencode(coded, probe) == 0) return 0; - /* pack the probe into a Hashseq */ - for (i = 0; i < len; i++) - { - hashprobe <<= 4; - hashprobe |= (Hashseq) coded[i]; - } - /* left adjust as needed */ - for (; i < RK_HASHSIZE; i++) - { - hashprobe <<= 4; - hashprobe |= (Hashseq) NTN; - } - /* return the compiled probe */ - return hashprobe; -} - -int -rkseq(Hashseq hashprobe, /* up to 8 nt packed into the probe */ - char *sequence) /* encoded sequence */ -{ - long i; - long pos = 0; - Hashseq target = 0; - - /* initialize the target hashseq */ - for (i = 0; i < RK_HASHSIZE; i++) - { - if (*(sequence + i) == NTEND) - break; - target <<= 4; - target |= (Hashseq) (*(sequence + i)); - } - - while (*(sequence + pos + RK_HASHSIZE -1) != NTEND) - { -#ifdef DEBUG - printf("hashprobe: "); - writehash(hashprobe); - printf("\ttarget: "); - writehash(target); - printf("\nhashprobe & target: "); - writehash(hashprobe & target); - printf("\n"); -#endif - if ((hashprobe & target) == target) - return ((int) pos); - target <<= 4; - target |= (Hashseq) (*(sequence + pos + RK_HASHSIZE)); - pos++; - } - /* now we deal with an end effect */ - for (i = 0; i < RK_HASHSIZE; i++) - { - target |= (Hashseq) NTN; - if ((hashprobe & target) == target) - return ((int) pos); - target <<=4; - pos++; - } - - return(-1); -} - - -#ifdef DEBUG /* Debugging aids */ - -static void -writehash(Hashseq hashseq) -{ - int idx; - int sym; - - if (hashseq/16) - writehash(hashseq/16); - - sym = (int) (hashseq % 16); - if (sym == 0) - putchar('-'); - else - { - for (idx = 0; sym != iupac[idx].code && idx < IUPACSYMNUM; idx++); - if (idx > IUPACSYMNUM) - printf("(%d)", sym); - else - putchar(iupac[idx].sym); - } -} - -#endif |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/squid/rk.h --- a/clustalomega/clustal-omega-0.2.0/src/squid/rk.h Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,39 +0,0 @@ -/***************************************************************** - * SQUID - a library of functions for biological sequence analysis - * Copyright (C) 1992-2002 Washington University School of Medicine - * - * This source code is freely distributed under the terms of the - * GNU General Public License. See the files COPYRIGHT and LICENSE - * for details. - *****************************************************************/ - -#ifndef SQRKH_INCLUDED -#define SQRKH_INCLUDED - -/* rk.h - * - * Header file for Rabin-Karp pattern searching on encoded - * sequence strings. - * - * Sean Eddy, Thu Oct 1 11:45:42 1992 - * RCS $Id: rk.h 217 2011-03-19 10:27:10Z andreas $ (Original squid RCS Id: rk.h,v 1.2 1998/10/09 18:07:16 eddy Exp) - */ - - - /* expect 32 bits for 8 nt */ -typedef unsigned long Hashseq; - /* but we count to be sure... - RK_HASHSIZE is the number of nt that fit - in one probe */ -#define RK_HASHSIZE (sizeof(Hashseq)*2) - /* empirically, how many nt minimum we require - in a pattern before we abandon rk and - go with something else */ -#define RK_REQUIRE 4 - -extern int rkseq(Hashseq hashprobe, char *sequence); -extern Hashseq rkcomp(char *probe); /* compile a Hashseq from a pattern */ - - - -#endif /* SQRKH_INCLUDED */ |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/squid/selex.c --- a/clustalomega/clustal-omega-0.2.0/src/squid/selex.c Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,833 +0,0 @@\n-/*****************************************************************\n- * SQUID - a library of functions for biological sequence analysis\n- * Copyright (C) 1992-2002 Washington University School of Medicine\n- * \n- * This source code is freely distributed under the terms of the\n- * GNU General Public License. See the files COPYRIGHT and LICENSE\n- * for details.\n- *****************************************************************/\n-\n-/* selex.c \n- * \n- * SRE, Mon Jun 14 11:08:38 1999\n- * SELEX obsolete as the preferred HMMER/SQUID format\n- * replaced by Stockholm format\n- * selex support retained for backwards compatibility\n- * kludged to use the MSA interface\n- * \n- * SRE, Mon Jan 30 14:41:49 1995:\n- * #=SA side chain % surface accessibility annotation supported\n- * \n- * SRE, Tue Nov 9 17:40:50 1993: \n- * major revision. #= special comments and aliinfo_s optional\n- * alignment info support added. Support for #=CS (consensus\n- * secondary structure), #=SS (individual secondary structure),\n- * #=RF (reference coordinate system), #=SQ (per-sequence header info),\n- * and #=AU ("author") added.\n- *\n- * Fri Dec 4 17:43:24 1992, SRE:\n- * Reading and writing aligned sequences to/from disk files.\n- * Implements a new, broader specification of SELEX format\n- * and supercedes alignio.c.\n- *\n- * SELEX format is documented in Docs/formats.tex.\n- ****************************************************************************\n- * RCS $Id: selex.c 217 2011-03-19 10:27:10Z andreas $ (Original squid RCS Id: selex.c,v 1.11 2002/10/12 04:40:35 eddy Exp)\n- */\n-\n-#include <stdio.h>\n-#include <stdlib.h>\n-#include <string.h>\n-#include <ctype.h>\n-#include <memory.h>\n-#include "squid.h"\n-#include "msa.h"\n-\n-static int copy_alignment_line(char *aseq, int apos, int name_rcol, \n-\t\t\t\tchar *buffer, int lcol, int rcol, char gapsym);\n-static void actually_write_selex(FILE *fp, MSA *msa, int cpl);\n-\n-static char commentsyms[] = "%#";\n-\n-/* Function: ReadSELEX()\n- * Date: SRE, Sun Jun 6 18:24:09 1999 [St. Louis]\n- *\n- * Purpose: Parse an alignment read from an open SELEX format\n- * alignment file. (SELEX is a single alignment format).\n- * Return the alignment, or NULL if we\'ve already read the\n- * alignment or there\'s no alignment data in the file.\n- * \n- * Limitations: SELEX is the only remaining multipass parser for\n- * alignment files. It cannot read from gzip or from stdin.\n- * It Die()\'s here if you try. The reason for this\n- * that SELEX allows space characters as gaps, so we don\'t\n- * know the borders of an alignment block until we\'ve seen\n- * the whole block. I could rewrite to allow single-pass\n- * parsing (by storing the whole block in memory) but\n- * since SELEX is now legacy, why bother.\n- * \n- * Note that the interface is totally kludged: fastest\n- * possible adaptation of old ReadSELEX() to the new\n- * MSA interface. \n- *\n- * Args: afp - open alignment file\n- *\n- * Returns: MSA * - an alignment object\n- * caller responsible for an MSAFree()\n- * NULL if no alignment data. \n- */\n-MSA *\n-ReadSELEX(MSAFILE *afp)\n-{\n- MSA *msa; /* RETURN: mult seq alignment */\n- FILE *fp; /* ptr to opened seqfile */\n- char **aseqs; /* aligned seqs */\n- int num = 0;\t\t/* number of seqs read */\n- char buffer[LINEBUFLEN];\t/* input buffer for lines */\n- char bufcpy[LINEBUFLEN];\t/* strtok\'able copy of buffer */\n- struct block_struc { /** alignment data for a block: */\n- int lcol;\t\t\t/* furthest left aligned sym */\n- int rcol;\t\t\t/* furthest right aligned sym */\n- } *blocks = NULL;\n- int blocknum;\t\t/* number of blocks in file */\n- char *nptr; /* ptr to start of name on line */\n- char '..b'- for (i = lcol; i <= rcol; i++)\n- {\n- if (*s2 == \'\\t\') {\n-#ifdef CLUSTALO\n-\tWarning("TAB characters will corrupt a SELEX alignment! Please remove them first.");\n-#else\n-\tWarn("TAB characters will corrupt a SELEX alignment! Please remove them first.");\n-#endif \n-\treturn 0;\n- }\n- if (name_rcol >= i)\t/* name intrusion special case: pad left w/ gaps */\n-\t*s1 = gapsym;\n-\t\t\t\t/* short buffer special case: pad right w/ gaps */\n- else if (*s2 == \'\\0\' || *s2 == \'\\n\')\n-\t*s1 = gapsym;\n-\n- else if (*s2 == \' \')\t/* new: disallow spaces as gap symbols */\n-\t*s1 = gapsym;\n-\n- else\t\t\t/* normal case: copy buffer into aseq */\n-\t*s1 = *s2;\n-\n- s1++;\n- if (*s2) s2++;\n- }\n- return 1;\n-}\n-\n- \n- \n-\n-\n-/* Function: DealignAseqs()\n- * \n- * Given an array of (num) aligned sequences aseqs,\n- * strip the gaps. Store the raw sequences in a new allocated array.\n- * \n- * Caller is responsible for free\'ing the memory allocated to\n- * rseqs.\n- * \n- * Returns 1 on success. Returns 0 and sets squid_errno on\n- * failure.\n- */\n-int\n-DealignAseqs(char **aseqs, int num, char ***ret_rseqs)\n-{\n- char **rseqs; /* de-aligned sequence array */\n- int idx;\t\t\t/* counter for sequences */\n- int depos; \t\t/* position counter for dealigned seq*/\n- int apos;\t\t\t/* position counter for aligned seq */\n- int seqlen;\t\t/* length of aligned seq */\n-\n-\t\t\t\t/* alloc space */\n- rseqs = (char **) MallocOrDie (num * sizeof(char *));\n-\t\t\t\t/* main loop */\n- for (idx = 0; idx < num; idx++)\n- {\n- seqlen = strlen(aseqs[idx]);\n-\t\t\t\t/* alloc space */\n- rseqs[idx] = (char *) MallocOrDie ((seqlen + 1) * sizeof(char));\n-\n-\t\t\t\t/* strip gaps */\n- depos = 0;\n- for (apos = 0; aseqs[idx][apos] != \'\\0\'; apos++)\n-\tif (!isgap(aseqs[idx][apos]))\n-\t {\n-\t rseqs[idx][depos] = aseqs[idx][apos];\n-\t depos++;\n-\t }\n- rseqs[idx][depos] = \'\\0\';\n- }\n- *ret_rseqs = rseqs;\n- return 1;\n-}\n-\n-\n-/* Function: IsSELEXFormat()\n- * \n- * Return TRUE if filename may be in SELEX format.\n- * \n- * Accuracy is sacrificed for speed; a TRUE return does\n- * *not* guarantee that the file will pass the stricter\n- * error-checking of ReadSELEX(). All it checks is that\n- * the first 500 non-comment lines of a file are \n- * blank, or if there\'s a second "word" on the line\n- * it looks like sequence (i.e., it\'s not kOtherSeq).\n- * \n- * Returns TRUE or FALSE.\n- */\n-int\n-IsSELEXFormat(char *filename)\n-{\n- FILE *fp; /* ptr to open sequence file */\n- char buffer[LINEBUFLEN];\n- char *sptr; /* ptr to first word */\n- int linenum;\n-\n-\n- if ((fp = fopen(filename, "r")) == NULL)\n- { squid_errno = SQERR_NOFILE; return 0; }\n-\n- linenum = 0;\n- while (linenum < 500 && \n-\t fgets(buffer, LINEBUFLEN, fp) != NULL)\n- {\n- linenum++;\n-\t\t\t\t/* dead giveaways for extended SELEX */\n- if (strncmp(buffer, "#=AU", 4) == 0) goto DONE;\n- else if (strncmp(buffer, "#=ID", 4) == 0) goto DONE;\n- else if (strncmp(buffer, "#=AC", 4) == 0) goto DONE;\n- else if (strncmp(buffer, "#=DE", 4) == 0) goto DONE;\n- else if (strncmp(buffer, "#=GA", 4) == 0) goto DONE;\n- else if (strncmp(buffer, "#=TC", 4) == 0) goto DONE;\n- else if (strncmp(buffer, "#=NC", 4) == 0) goto DONE;\n- else if (strncmp(buffer, "#=SQ", 4) == 0) goto DONE;\n- else if (strncmp(buffer, "#=SS", 4) == 0) goto DONE;\n- else if (strncmp(buffer, "#=CS", 4) == 0) goto DONE;\n- else if (strncmp(buffer, "#=RF", 4) == 0) goto DONE;\n-\n-\t\t\t\t/* a comment? */\n- if (strchr(commentsyms, *buffer) != NULL) continue;\n-\n-\t\t\t\t/* a blank line? */\n- if ((sptr = strtok(buffer, WHITESPACE)) == NULL) continue;\n-\n-\t\t\t\t/* a one-word line (name only)\n-\t\t\t\t is possible, though rare */\n- if ((sptr = strtok(NULL, "\\n")) == NULL) continue;\n- \n- if (Seqtype(sptr) == kOtherSeq) {fclose(fp); return 0;}\n- }\n-\n- DONE:\n- fclose(fp);\n- return 1;\n-}\n-\n-\n-\n-\n-\n-\n-\n-\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/squid/seqencode.c --- a/clustalomega/clustal-omega-0.2.0/src/squid/seqencode.c Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,176 +0,0 @@ -/***************************************************************** - * SQUID - a library of functions for biological sequence analysis - * Copyright (C) 1992-2002 Washington University School of Medicine - * - * This source code is freely distributed under the terms of the - * GNU General Public License. See the files COPYRIGHT and LICENSE - * for details. - *****************************************************************/ - -/* seqencode.c - * - * Routines for creating and manipulating encoded sequence strings. - * RCS $Id: seqencode.c 217 2011-03-19 10:27:10Z andreas $ (Original squid RCS Id: seqencode.c,v 1.3 1999/05/02 21:55:27 eddy Exp) - */ -#include <stdio.h> -#include <string.h> -#include <ctype.h> -#include "squid.h" - - -#ifdef MEMDEBUG -#include "dbmalloc.h" -#endif - /* seqcmp() - returns 0 if s1 == s2 - mismatch number otherwise */ -int -seqcmp(char *s1, char *s2, int allow) -{ - int mmat = 0; - - while ((*s1 != NTEND) && (*s2 != NTEND) && (mmat <= allow)) - { - if (!(ntmatch(*s1, *s2))) - mmat++;; - s1++; - s2++; - } - while ((*s1++ != NTEND) && (mmat <= allow)) - mmat++; - return(mmat); -} - /* seqncmp() - same as seqcmp but it looks at, - at most, n positions */ -int -seqncmp(char *s1, char *s2, int n, int allow) -{ - int mmat = 0; - - while ((*s2 != NTEND) && - (n-- != 0)) - { - if ((!(ntmatch(*s1, *s2))) && - (++mmat > allow)) - return(mmat); - s1++; - s2++; - } - while ((n-- != 0) && (*s1++ != NTEND) && (mmat <= allow)) - mmat++; - return (mmat); -} - - /* seqencode() - given a character text string str (A,C,G,T), - convert to an encoded seq string; - return 1 for success, 0 if fail */ -int -seqencode(char *codeseq, /* pre-allocated space for answer */ - char *str) /* character string to convert */ -{ - char *ptr; - int idx; - - ptr = codeseq; - while (*str != '\0') - { - if (islower((int) (*str))) *str = (char) toupper((int) (*str)); - for (idx = 0; *str != iupac[idx].sym && idx <= IUPACSYMNUM; idx++) - ; - if (idx > IUPACSYMNUM) - { - *ptr = (char) NTEND; - return 0; - } - else - *ptr = iupac[idx].code; - ptr++; - str++; - } - *ptr = NTEND; - return 1; -} - - -int -coded_revcomp(char *comp, char *seq) -{ - long bases; - char *bckp, *fwdp; - int idx; - long pos; - - bases = strlen(seq); - - fwdp = comp; - bckp = seq + bases -1; - for (pos = 0; pos < bases; pos++) - { - for (idx = 0; *bckp != iupac[idx].code && idx < IUPACSYMNUM; idx++); - if (idx > IUPACSYMNUM) - { - *fwdp = NTEND; - return 0; - } - else - *fwdp = iupac[idx].comp; - fwdp++; - bckp--; - } - *fwdp = NTEND; - return(1); -} - -int -seqdecode(char *str, char *codeseq) -{ - int idx; - int pos; - - pos = 0; - while (*codeseq != NTEND) - { - for (idx = 0; *codeseq != iupac[idx].code && idx < IUPACSYMNUM; idx++) - ; - if (idx > IUPACSYMNUM) - { - str[pos] = 'X'; - return 0; - } - else - str[pos] = iupac[idx].sym; - codeseq++; - pos++; - } - str[pos] = '\0'; - return 1; -} - -int -seqndecode( - char *str, /* pre-allocated string to write into */ - char *codeseq, /* sequence to decode */ - int n) /* how many bases to decode */ -{ - int idx; - int pos = 0; - - while (--n >= 0) - { - for (idx = 0; *codeseq != iupac[idx].code && idx < IUPACSYMNUM; idx++); - if (idx > IUPACSYMNUM) - { - str[pos] = 'X'; - return 0; - } - else - str[pos] = iupac[idx].sym; - codeseq++; - pos++; - } - str[pos] = '\0'; - return 1; -} - |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/squid/shuffle.c --- a/clustalomega/clustal-omega-0.2.0/src/squid/shuffle.c Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,638 +0,0 @@\n-/*****************************************************************\n- * SQUID - a library of functions for biological sequence analysis\n- * Copyright (C) 1992-2002 Washington University School of Medicine\n- * \n- * This source code is freely distributed under the terms of the\n- * GNU General Public License. See the files COPYRIGHT and LICENSE\n- * for details.\n- *****************************************************************/\n-\n-/* shuffle.c\n- * \n- * Routines for randomizing sequences.\n- * \n- * All routines are alphabet-independent (DNA, protein, RNA, whatever);\n- * they assume that input strings are purely alphabetical [a-zA-Z], and\n- * will return strings in all upper case [A-Z].\n- * \n- * All return 1 on success, and 0 on failure; 0 status invariably\n- * means the input string was not alphabetical.\n- * \n- * StrShuffle() - shuffled string, preserve mono-symbol composition.\n- * StrDPShuffle() - shuffled string, preserve mono- and di-symbol composition.\n- * \n- * StrMarkov0() - random string, same zeroth order Markov properties.\n- * StrMarkov1() - random string, same first order Markov properties.\n- * \n- * StrReverse() - simple reversal of string\n- * StrRegionalShuffle() - mono-symbol shuffled string in regional windows\n- *\n- * There are also similar routines for shuffling alignments:\n- *\n- * AlignmentShuffle() - alignment version of StrShuffle().\n- * AlignmentBootstrap() - sample with replacement; a bootstrap dataset.\n- * QRNAShuffle() - shuffle a pairwise alignment, preserving all gap positions.\n- * \n- * CVS $Id: shuffle.c,v 1.6 2002/10/09 14:26:09 eddy Exp)\n- */\n-\n-#include <string.h>\n-#include <ctype.h>\n-\n-#include "squid.h"\n-#include "sre_random.h"\n-\n-/* Function: StrShuffle()\n- * \n- * Purpose: Returns a shuffled version of s2, in s1.\n- * (s1 and s2 can be identical, to shuffle in place.)\n- * \n- * Args: s1 - allocated space for shuffled string.\n- * s2 - string to shuffle.\n- * \n- * Return: 1 on success.\n- */\n-int\n-StrShuffle(char *s1, char *s2)\n-{\n- int len;\n- int pos;\n- char c;\n- \n- if (s1 != s2) strcpy(s1, s2);\n- for (len = strlen(s1); len > 1; len--)\n- {\t\t\t\t\n- pos = CHOOSE(len);\n- c = s1[pos];\n- s1[pos] = s1[len-1];\n- s1[len-1] = c;\n- }\n- return 1;\n-}\n-\n-/* Function: StrDPShuffle()\n- * Date: SRE, Fri Oct 29 09:15:17 1999 [St. Louis]\n- *\n- * Purpose: Returns a shuffled version of s2, in s1.\n- * (s1 and s2 may be identical; i.e. a string\n- * may be shuffled in place.) The shuffle is a \n- * "doublet-preserving" (DP) shuffle. Both\n- * mono- and di-symbol composition are preserved.\n- * \n- * Done by searching for a random Eulerian \n- * walk on a directed multigraph. \n- * Reference: S.F. Altschul and B.W. Erickson, Mol. Biol.\n- * Evol. 2:526-538, 1985. Quoted bits in my comments\n- * are from Altschul\'s outline of the algorithm.\n- *\n- * Args: s1 - RETURN: the string after it\'s been shuffled\n- * (space for s1 allocated by caller)\n- * s2 - the string to be shuffled\n- *\n- * Returns: 0 if string can\'t be shuffled (it\'s not all [a-zA-z]\n- * alphabetic.\n- * 1 on success. \n- */\n-int\n-StrDPShuffle(char *s1, char *s2)\n-{\n- int len;\n- int pos;\t/* a position in s1 or s2 */\n- int x,y; /* indices of two characters */\n- char **E; /* edge lists: E[0] is the edge list from vertex A */\n- int *nE; /* lengths of edge lists */\n- int *iE; /* positions in edge lists */\n- int n;\t/* tmp: remaining length of an edge list to be shuffled */\n- char sf; /* last character in s2 */\n- char Z[26]; /* connectivity in last edge graph Z */ \n- int keep_connecting; /* flag used in Z connectivity algorithm */\n- int is_eulerian;\t\t/* flag used for when we\'ve got a good Z */\n- \n- /* First, verify that the string is en'..b'- for (i = 0; i < nseq; i++)\n- ali1[i][alen] = \'\\0\';\n-\n- return 1;\n-}\n-\n-\n-/* Function: QRNAShuffle()\n- * Date: SRE, Mon Dec 10 10:14:12 2001 [St. Louis]\n- *\n- * Purpose: Shuffle a pairwise alignment x,y while preserving the\n- * position of gaps; return the shuffled alignment in xs,\n- * ys.\n- * \n- * Works by doing three separate\n- * shuffles, of (1) columns with residues in both\n- * x and y, (2) columns with residue in x and gap in y,\n- * and (3) columns with gap in x and residue in y.\n- * \n- * xs,x and ys,y may be identical: that is, to shuffle\n- * an alignment "in place", destroying the original\n- * alignment, just call:\n- * QRNAShuffle(x,y,x,y);\n- *\n- * Args: xs, ys: allocated space for shuffled pairwise ali of x,y [L+1]\n- * x, y: pairwise alignment to be shuffled [0..L-1]\n- *\n- * Returns: 1 on success, 0 on failure.\n- * The shuffled alignment is returned in xs, ys.\n- */\n-int\n-QRNAShuffle(char *xs, char *ys, char *x, char *y)\n-{\n- int L;\n- int *xycol, *xcol, *ycol;\n- int nxy, nx, ny;\n- int i;\n- int pos, c;\n- char xsym, ysym;\n-\n- if (xs != x) strcpy(xs, x);\n- if (ys != y) strcpy(ys, y);\n-\n- /* First, construct three arrays containing lists of the column positions\n- * of the three types of columns. (If a column contains gaps in both x and y,\n- * we\'ve already simply copied it to the shuffled sequence.)\n- */\n- L = strlen(x);\n- xycol = MallocOrDie(sizeof(int) * L);\n- xcol = MallocOrDie(sizeof(int) * L);\n- ycol = MallocOrDie(sizeof(int) * L);\n- nxy = nx = ny = 0;\n-\n- for (i = 0; i < L; i++)\n- {\n- if (isgap(x[i]) && isgap(y[i])) { continue; }\n- else if (! isgap(x[i]) && ! isgap(y[i])) { xycol[nxy] = i; nxy++; }\n- else if (isgap(x[i])) { ycol[ny] = i; ny++; }\n- else if (isgap(y[i])) { xcol[nx] = i; nx++; }\n- }\n-\n- /* Second, shuffle the sequences indirectly, via shuffling these arrays.\n- * Yow, careful with those indices, and with order of the statements...\n- */\n- for (; nxy > 1; nxy--) {\n- pos = CHOOSE(nxy);\n- xsym = xs[xycol[pos]]; ysym = ys[xycol[pos]]; c = xycol[pos]; \n- xs[xycol[pos]] = xs[xycol[nxy-1]]; ys[xycol[pos]] = ys[xycol[nxy-1]]; xycol[pos] = xycol[nxy-1];\n- xs[xycol[nxy-1]] = xsym; ys[xycol[nxy-1]] = ysym; xycol[pos] = xycol[nxy-1];\n- }\n- for (; nx > 1; nx--) {\n- pos = CHOOSE(nx); \n- xsym = xs[xcol[pos]]; ysym = ys[xcol[pos]]; c = xcol[pos]; \n- xs[xcol[pos]] = xs[xcol[nx-1]]; ys[xcol[pos]] = ys[xcol[nx-1]]; xcol[pos] = xcol[nx-1]; \n- xs[xcol[nx-1]] = xsym; ys[xcol[nx-1]] = ysym; xcol[nx-1] = c; \n- }\n- for (; ny > 1; ny--) {\n- pos = CHOOSE(ny); \n- xsym = xs[ycol[pos]]; ysym = ys[ycol[pos]]; c = ycol[pos]; \n- xs[ycol[pos]] = xs[ycol[ny-1]]; ys[ycol[pos]] = ys[ycol[ny-1]]; ycol[pos] = ycol[ny-1];\n- xs[ycol[ny-1]] = xsym; ys[ycol[ny-1]] = ysym; ycol[ny-1] = c; \n- }\n-\n- free(xycol); free(xcol); free(ycol);\n- return 1;\n-}\n-\n-\n-#ifdef TESTDRIVER\n-/*\n- * cc -g -o testdriver -DTESTDRIVER -L. shuffle.c -lsquid -lm\n- */\n-int \n-main(int argc, char **argv)\n-{\n- char s1[100];\n- char s2[100];\n-\n- sre_srandom(42);\n- strcpy(s2, "GGGGGGGGGGCCCCCCCCCC");\n- /* strcpy(s2, "AGACATAAAGTTCCGTACTGCCGGGAT");\n- */\n- StrDPShuffle(s1, s2);\n- printf("DPshuffle: %s\\n", s1);\n- StrMarkov0(s1,s2);\n- printf("Markov 0 : %s\\n", s1);\n- StrMarkov1(s1,s2);\n- printf("Markov 1 : %s\\n", s1);\n-\n- strcpy(s1, "ACGTACGT--------ACGTACGT----ACGTACGT");\n- strcpy(s2, "ACGTACGTACGTACGT------------ACGTACGT");\n- QRNAShuffle(s1,s2,s1,s2);\n- printf("QRNA : %s\\n", s1);\n- printf(" : %s\\n", s2);\n-\n- return 0;\n-}\n-#endif\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/squid/sqerror.c --- a/clustalomega/clustal-omega-0.2.0/src/squid/sqerror.c Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,98 +0,0 @@ -/***************************************************************** - * SQUID - a library of functions for biological sequence analysis - * Copyright (C) 1992-2002 Washington University School of Medicine - * - * This source code is freely distributed under the terms of the - * GNU General Public License. See the files COPYRIGHT and LICENSE - * for details. - *****************************************************************/ - -/* sqerror.c - * - * error handling for the squid library - * RCS $Id: sqerror.c 217 2011-03-19 10:27:10Z andreas $ (Original squid RCS Id: sqerror.c,v 1.4 1999/07/15 22:28:31 eddy Exp) - */ - - /* a global errno equivalent */ -int squid_errno; - -#include <stdio.h> -#include <stdlib.h> -#include <stdarg.h> - -#ifdef MEMDEBUG -#include "dbmalloc.h" -#endif - -/* Function: Die() - * - * Purpose: Print an error message and die. The arguments - * are formatted exactly like arguments to printf(). - * - * Return: None. Exits the program. - */ -/* VARARGS0 */ -void -Die(char *format, ...) -{ - va_list argp; - /* format the error mesg */ - fprintf(stderr, "\nFATAL: "); - va_start(argp, format); - vfprintf(stderr, format, argp); - va_end(argp); - fprintf(stderr, "\n"); - fflush(stderr); - /* exit */ - exit(1); -} - - - -/* Function: Warn() - * - * Purpose: Print an error message and return. The arguments - * are formatted exactly like arguments to printf(). - * - * Return: (void) - */ -/* VARARGS0 */ -void -#ifdef CLUSTALO -Warning(char *format, ...) -#else -Warn(char *format, ...) -#endif -{ - va_list argp; - /* format the error mesg */ - fprintf(stderr, "WARNING: "); - va_start(argp, format); - vfprintf(stderr, format, argp); - va_end(argp); - fprintf(stderr, "\n"); - fflush(stderr); -} - -/* Function: Panic() - * - * Purpose: Die from a lethal error that's not my problem, - * but instead a failure of a StdC/POSIX call that - * shouldn't fail. Call perror() to get the - * errno flag, then die. - * - * Usually called by the PANIC macro which adds - * the __FILE__ and __LINE__ information; see - * structs.h. - * - * Inspired by code in Donald Lewine's book, _POSIX - * Programmer's Guide_. - */ -void -Panic(char *file, int line) -{ - (void) fprintf(stderr, "\nPANIC [%s line %d] ", file, line); - (void) perror("Unusual error"); - exit(EXIT_FAILURE); -} - |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/squid/sqfuncs.h --- a/clustalomega/clustal-omega-0.2.0/src/squid/sqfuncs.h Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
b"@@ -1,274 +0,0 @@\n-/*****************************************************************\n- * SQUID - a library of functions for biological sequence analysis\n- * Copyright (C) 1992-2002 Washington University School of Medicine\n- * \n- * This source code is freely distributed under the terms of the\n- * GNU General Public License. See the files COPYRIGHT and LICENSE\n- * for details.\n- *****************************************************************/\n-\n-#ifndef SQFUNCSH_INCLUDED\n-#define SQFUNCSH_INCLUDED\n-/* sqfuncs.h\n- * \n- * Prototypes for squid library functions;\n- * also makes a good reference list for what the package contains.\n- *\n- * Warning: squid is a slowly evolving beast. Some functions are\n- * obsolete. Some functions are probably just wrong, dating to\n- * a primordial era before I knew anything about what I was doing.\n- * Some functions are both obsolete and wrong but still necessary\n- * to get legacy code to compile.\n- *\n- * CVS $Id: sqfuncs.h,v 1.28 2002/10/09 14:26:09 eddy Exp)\n- */\n-\n-/* \n- * from aligneval.c\n- */\n-extern float ComparePairAlignments(char *known1, char *known2, char *calc1, char *calc2);\n-extern float CompareRefPairAlignments(int *ref, char *known1, char *known2, char *calc1, char *calc2);\n-extern float CompareMultAlignments(char **kseqs, char **tseqs, int N);\n-extern float CompareRefMultAlignments(int *ref, char **kseqs, char **tseqs, int N);\n-extern float PairwiseIdentity(char *s1, char *s2);\n-extern float AlignmentIdentityBySampling(char **aseq, int L, int N, int nsample);\n-extern char *MajorityRuleConsensus(char **aseq, int nseq, int alen);\n-\n-/* \n- * from alignio.c\n- */\n-extern void AllocAlignment(int nseq, int alen, char ***ret_aseq, AINFO *ainfo);\n-extern void InitAinfo(AINFO *ainfo);\n-extern void FreeAlignment(char **aseqs, AINFO *ainfo);\n-extern void SAMizeAlignment(char **aseq, int nseq, int alen);\n-extern void SAMizeAlignmentByGapFrac(char **aseq, int nseq, int alen, float maxgap);\n-extern int MakeAlignedString(char *aseq, int alen, char *ss, char **ret_s);\n-extern int MakeDealignedString(char *aseq, int alen, char *ss, char **ret_s);\n-extern int DealignedLength(char *aseq);\n-extern int WritePairwiseAlignment(FILE *ofp, char *aseq1, char *name1, int spos1,\n-\t\t\t\t char *aseq2, char *name2, int spos2,\n-\t\t\t\t int **pam, int indent);\n-extern int MingapAlignment(char **aseqs, AINFO *ainfo);\n-extern int RandomAlignment(char **rseqs, SQINFO *sqinfo, int nseq, float pop, float pex,\n-\t\t\t char ***ret_aseqs, AINFO *ainfo);\n-extern void AlignmentHomogenousGapsym(char **aseq, int nseq, int alen, char gapsym);\n-\n-/* from cluster.c\n- */\n-extern int Cluster(float **mx, int N, enum clust_strategy mode, struct phylo_s **ret_tree);\n-extern struct phylo_s *AllocPhylo(int N);\n-extern void FreePhylo(struct phylo_s *tree, int N);\n-extern void MakeDiffMx(char **aseqs, int num, float ***ret_dmx);\n-extern void MakeIdentityMx(char **aseqs, int num, float ***ret_imx);\n-extern void PrintNewHampshireTree(FILE *fp, AINFO *ainfo, struct phylo_s *tree, int N);\n-extern void PrintPhylo(FILE *fp, AINFO *ainfo, struct phylo_s *tree, int N);\n-\n-/* \n- * from dayhoff.c\n- */\n-extern int ParsePAMFile(FILE *fp, int ***ret_pam, float *ret_scale);\n-extern void ScalePAM(int **pam, int scale);\n-\n-\n-/* from file.c\n- */\n-extern char *FileDirname(char *filename);\n-extern char *FileTail(char *file, int noextension);\n-extern char *FileSameDirectory(char *full, char *file);\n-extern char *FileConcat(char *dir, char *file);\n-extern char *FileAddSuffix(char *filename, char *sfx);\n-extern FILE *EnvFileOpen(char *fname, char *env, char **ret_dir);\n-extern int FileExists(char *filename);\n-\n-\n-/* from getopt.c\n- */\n-extern int Getopt(int argc, char **argv, \n-\t\t struct opt_s *opt, int nopts, char *usage,\n-\t\t int *ret_optind, char **ret_optname, char **ret_optarg);\n-\n-\n-/* from hsregex.c\n- * Henry Spencer's regex() code\n- */\n-extern int Strparse(char *rexp, char *s, int ntok);\n-extern void SqdClean"..b'tion(SQFILE *sfp, SSIOFFSET *offset);\n-extern void SeqfileRewind(SQFILE *sfp);\n-extern void SeqfileClose(SQFILE *sfp);\n-\n-extern int ReadSeq(SQFILE *fp, int format, char **ret_seq, SQINFO *sqinfo);\n-extern int GCGBinaryToSequence(char *seq, int len);\n-extern int GCGchecksum(char *seq, int seqlen);\n-extern int GCGMultchecksum(char **seqs, int nseq);\n-extern void WriteSimpleFASTA(FILE *fp, char *seq, char *name, char *desc);\n-extern int WriteSeq(FILE *outf, int outfmt, char *seq, SQINFO *sqinfo);\n-extern int Seqtype(char *seq);\n-extern int GuessAlignmentSeqtype(char **aseq, int nseq);\n-extern int String2SeqfileFormat(char *s);\n-extern char *SeqfileFormat2String(int code);\n-extern SQINFO *MSAToSqinfo(MSA *msa); \n-\n-/* from squidcore.c\n- */\n-extern void Banner(FILE *fp, char *banner); \n-\n-\n-/* from sre_ctype.c\n- */\n-extern int sre_tolower(int c);\n-extern int sre_toupper(int c);\n-\n-/* from sre_math.c\n- */\n-extern int Linefit(float *x, float *y, int N, \n-\t\t float *ret_a, float *ret_b, float *ret_r);\n-extern void WeightedLinefit(float *x, float *y, float *var, int N,\n-\t\t\t float *ret_m, float *ret_b);\n-extern double Gammln(double xx);\n-extern float **FMX2Alloc(int rows, int cols);\n-extern void FMX2Free(float **mx);\n-extern double **DMX2Alloc(int rows, int cols);\n-extern void DMX2Free(double **mx);\n-extern void FMX2Multiply(float **A, float **B, float **C, int m, int p, int n);\n-extern double IncompleteGamma(double a, double x);\n-\n-/* from sre_string.c\n- */\n-#ifdef NOSTR\n-extern char *strstr(char *s, char *subs);\n-#endif\n-extern char *Strdup(char *s);\n-extern void StringChop(char *s);\n-extern int Strinsert(char *s1, char c, int pos);\n-extern int Strdelete(char *s1, int pos);\n-extern void s2lower(char *s);\n-extern void s2upper(char *s);\n-extern void *sre_malloc(char *file, int line, size_t size);\n-extern void *sre_realloc(char *file, int line, void *p, size_t size);\n-extern void Free2DArray(void **p, int dim1);\n-extern void Free3DArray(void ***p, int dim1, int dim2);\n-extern char *RandomSequence(char *alphabet, float *p, int n, int len);\n-extern char *sre_fgets(char **buf, int *n, FILE *fp);\n-extern int sre_strcat(char **dest, int ldest, char *src, int lsrc);\n-extern char *sre_strtok(char **s, char *delim, int *len);\n-extern char *sre_strdup(char *s, int n);\n-extern char *sre_strncat(char *s1, char *s2, int n);\n-extern int IsBlankline(char *s);\n-\n-/* from stack.c\n- */\n-extern struct intstack_s *InitIntStack(void);\n-extern void PushIntStack(struct intstack_s *stack, int data);\n-extern int PopIntStack(struct intstack_s *stack, int *ret_data);\n-extern void ReverseIntStack(struct intstack_s *stack);\n-extern int FreeIntStack( struct intstack_s *stack );\n-\n-/* \n- * from translate.c\n- */\n-extern char *Translate(char *seq, char **code);\n-\n-/* \n- * from types.c\n- */\n-extern int IsInt(char *s);\n-extern int IsReal(char *s);\n-extern void Byteswap(char *swap, int nbytes);\n-#ifndef USE_HOST_BYTESWAP_FUNCTIONS\n-extern sqd_uint16 sre_ntoh16(sqd_uint16 netshort);\n-extern sqd_uint32 sre_ntoh32(sqd_uint32 netlong);\n-extern sqd_uint16 sre_hton16(sqd_uint16 hostshort);\n-extern sqd_uint32 sre_hton32(sqd_uint32 hostlong);\n-#endif /*!USE_HOST_BYTESWAP_FUNCTIONS*/\n-extern sqd_uint64 sre_ntoh64(sqd_uint64 net_int64);\n-extern sqd_uint64 sre_hton64(sqd_uint64 host_int64);\n-\n-/* \n- * from weight.c\n- */\n-extern void GSCWeights(char **aseq, int nseq, int alen, float *wgt);\n-extern void VoronoiWeights(char **aseq, int nseq, int alen, float *wgt);\n-extern void BlosumWeights(char **aseq, int nseq, int alen, float blosumlevel, float *wgt);\n-extern void PositionBasedWeights(char **aseq, int nseq, int alen, float *wgt);\n-extern void FilterAlignment(MSA *msa, float cutoff, MSA **ret_new);\n-extern void SampleAlignment(MSA *msa, int sample, MSA **ret_new);\n-extern void SingleLinkCluster(char **aseq, int nseq, int alen, float maxid, \n-\t\t int **ret_c, int *ret_nc);\n-#endif /* SQFUNCSH_INCLUDED */\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/squid/sqio.c --- a/clustalomega/clustal-omega-0.2.0/src/squid/sqio.c Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,2033 +0,0 @@\n-/*****************************************************************\n- * SQUID - a library of functions for biological sequence analysis\n- * Copyright (C) 1992-2002 Washington University School of Medicine\n- * \n- * This source code is freely distributed under the terms of the\n- * GNU General Public License. See the files COPYRIGHT and LICENSE\n- * for details.\n- *****************************************************************/\n-\n-/* File: sqio.c\n- * From: ureadseq.c in Don Gilbert\'s sequence i/o package\n- *\n- * Reads and writes nucleic/protein sequence in various\n- * formats. Data files may have multiple sequences.\n- *\n- * Heavily modified from READSEQ package\n- * Copyright (C) 1990 by D.G. Gilbert\n- * Biology Dept., Indiana University, Bloomington, IN 47405\n- * email: gilbertd@bio.indiana.edu\n- * Thanks Don!\n- *\n- * SRE: Modifications as noted. Fri Jul 3 09:44:54 1992\n- * Packaged for squid, Thu Oct 1 10:07:11 1992\n- * ANSI conversion in full swing, Mon Jul 12 12:22:21 1993\n- *\n- * CVS $Id: sqio.c,v 1.29 2002/08/26 23:10:52 eddy Exp)\n- * \n- *****************************************************************\n- * Basic API for single sequence reading:\n- * \n- * SQFILE *sqfp;\n- * char *seqfile;\n- * int format; - see squid.h for formats; example: SQFILE_FASTA\n- * char *seq;\n- * SQINFO sqinfo;\n- * \n- * if ((sqfp = SeqfileOpen(seqfile, format, "BLASTDB")) == NULL)\n- * Die("Failed to open sequence database file %s\\n%s\\n", seqfile, usage);\n- * while (ReadSeq(sqfp, sqfp->format, &seq, &sqinfo)) {\n- * do_stuff;\n- * FreeSequence(seq, &sqinfo);\n- * }\n- * SeqfileClose(sqfp); \n- * \n- ***************************************************************** \n- */\n-\n-#include <stdio.h>\n-#include <stdlib.h>\n-#include <string.h>\n-#include <ctype.h>\n-\n-#ifndef SEEK_SET\n-#include <unistd.h>\t\n-#endif\n-\n-#include "squid.h"\n-#include "msa.h"\n-#include "ssi.h"\n-\n-static void SeqfileGetLine(SQFILE *V);\n-\n-#define kStartLength 500\n-\n-static char *aminos = "ABCDEFGHIKLMNPQRSTVWXYZ*";\n-static char *primenuc = "ACGTUN";\n-static char *protonly = "EFIPQZ";\n-\n-static SQFILE *seqfile_open(char *filename, int format, char *env, int ssimode);\n-\n-/* Function: SeqfileOpen()\n- * \n- * Purpose : Open a sequence database file and prepare for reading\n- * sequentially.\n- * \n- * Args: filename - name of file to open\n- * format - format of file\n- * env - environment variable for path (e.g. BLASTDB) \n- * ssimode - -1, SSI_OFFSET_I32, or SSI_OFFSET_I64\n- *\n- * Returns opened SQFILE ptr, or NULL on failure.\n- */\n-SQFILE *\n-SeqfileOpen(char *filename, int format, char *env)\n-{\n- return seqfile_open(filename, format, env, -1);\n-}\n-SQFILE *\n-SeqfileOpenForIndexing(char *filename, int format, char *env, int ssimode)\n-{\n- return seqfile_open(filename, format, env, ssimode);\n-}\n-static SQFILE *\n-seqfile_open(char *filename, int format, char *env, int ssimode)\n-{\n- SQFILE *dbfp;\n-\n- dbfp = (SQFILE *) MallocOrDie (sizeof(SQFILE));\n-\n- dbfp->ssimode = ssimode;\n- dbfp->rpl = -1;\t\t/* flag meaning "unset" */\n- dbfp->lastrpl = 0;\n- dbfp->maxrpl = 0;\n- dbfp->bpl = -1;\t\t/* flag meaning "unset" */\n- dbfp->lastbpl = 0;\n- dbfp->maxbpl = 0;\n-\n- /* Open our file handle.\n- * Three possibilities:\n- * 1. normal file open\n- * 2. filename = "-"; read from stdin\n- * 3. filename = "*.gz"; read thru pipe from gzip \n- * If we\'re reading from stdin or a pipe, we can\'t reliably\n- * back up, so we can\'t do two-pass parsers like the interleaved alignment \n- * formats.\n- */\n- if (strcmp(filename, "-") == 0)\n- {\n- dbfp->f = stdin;\n- dbfp->do_stdin = TRUE; \n- dbfp->do_gzip = FALSE;\n- dbfp->fname = sre_strdup("[STDIN]", -1);\n- }\n-#ifndef SRE_STRICT_ANSI\n- /* popen(), pclose() aren\'t portable to non-POSIX systems; disable */\n- else if (Strparse("^.*\\\\.gz$", filename, 0)'..b'eFormat2String(int code)\n-{\n- switch (code) {\n- case SQFILE_UNKNOWN: return "unknown";\n- case SQFILE_FASTA: return "FASTA";\n-#ifdef CLUSTALO\n- case SQFILE_VIENNA: return "Vienna";\n-#endif\n- case SQFILE_GENBANK: return "Genbank";\n- case SQFILE_EMBL: return "EMBL"; \n- case SQFILE_GCG: return "GCG";\n- case SQFILE_GCGDATA: return "GCG data library";\n- case SQFILE_RAW: return "raw"; \n- case SQFILE_IG: return "Intelligenetics";\n- case SQFILE_STRIDER: return "MacStrider";\n- case SQFILE_IDRAW: return "Idraw Postscript";\n- case SQFILE_ZUKER: return "Zuker"; \n- case SQFILE_PIR: return "PIR";\n- case SQFILE_SQUID: return "SQUID";\n- case MSAFILE_STOCKHOLM: return "Stockholm";\n- case MSAFILE_SELEX: return "SELEX";\n- case MSAFILE_MSF: return "MSF";\n- case MSAFILE_CLUSTAL: return "Clustal";\n- case MSAFILE_A2M: return "a2m";\n- case MSAFILE_PHYLIP: return "Phylip";\n- case MSAFILE_EPS: return "EPS";\n- default: \n- Die("Bad code passed to MSAFormat2String()");\n- }\n- /*NOTREACHED*/\n- return NULL;\n-}\n-\n-\n-/* Function: MSAToSqinfo()\n- * Date: SRE, Tue Jul 20 14:36:56 1999 [St. Louis]\n- *\n- * Purpose: Take an MSA and generate a SQINFO array suitable\n- * for use in annotating the unaligned sequences.\n- * Return the array.\n- * \n- * Permanent temporary code. sqinfo was poorly designed.\n- * it must eventually be replaced, but the odds\n- * of this happening soon are nil, so I have to deal.\n- *\n- * Args: msa - the alignment\n- *\n- * Returns: ptr to allocated sqinfo array.\n- * Freeing is ghastly: free in each individual sqinfo[i] \n- * with FreeSequence(NULL, &(sqinfo[i])), then\n- * free(sqinfo).\n- */\n-SQINFO *\n-MSAToSqinfo(MSA *msa)\n-{\n- int idx;\n- SQINFO *sqinfo;\n-\n- sqinfo = MallocOrDie(sizeof(SQINFO) * msa->nseq);\n-\n- for (idx = 0; idx < msa->nseq; idx++)\n- {\n- sqinfo[idx].flags = 0;\n- SetSeqinfoString(&(sqinfo[idx]), \n-\t\t msa->sqname[idx], SQINFO_NAME);\n- SetSeqinfoString(&(sqinfo[idx]), \n-\t\t MSAGetSeqAccession(msa, idx), SQINFO_ACC);\n- SetSeqinfoString(&(sqinfo[idx]), \n-\t\t MSAGetSeqDescription(msa, idx), SQINFO_DESC);\n-\n- if (msa->ss != NULL && msa->ss[idx] != NULL) {\n-\tMakeDealignedString(msa->aseq[idx], msa->alen, \n-\t\t\t msa->ss[idx], &(sqinfo[idx].ss));\n-\tsqinfo[idx].flags |= SQINFO_SS;\n- }\n-\n- if (msa->sa != NULL && msa->sa[idx] != NULL) {\n-\tMakeDealignedString(msa->aseq[idx], msa->alen, \n-\t\t\t msa->sa[idx], &(sqinfo[idx].sa));\n-\tsqinfo[idx].flags |= SQINFO_SA;\n- }\n-\n- sqinfo[idx].len = DealignedLength(msa->aseq[idx]);\n- sqinfo[idx].flags |= SQINFO_LEN;\n- }\n- return sqinfo;\n-}\n-\n-\n-\n-/* cc -o sqio_test -DA_QUIET_DAY -L. sqio.c -lsquid */\n-#ifdef A_QUIET_DAY\n-#include "ssi.h"\n-int\n-main(int argc, char **argv)\n-{\n- FILE *fp;\n- char *filename;\n- char *buf;\n- int len;\n- int mode = 3;\n- SSIOFFSET off;\n-\n- filename = argv[1];\n-\n- if (mode == 1) {\n- buf = malloc(sizeof(char) * 256);\n- if ((fp = fopen(filename, "r")) == NULL)\n- Die("open of %s failed", filename); \n- while (fgets(buf, 255, fp) != NULL)\n- ;\n- fclose(fp);\n- free(buf);\n- } else if (mode == 2) {\n- if ((fp = fopen(filename, "r")) == NULL)\n- Die("open of %s failed", filename); \n- buf = NULL; len = 0;\n- while (sre_fgets(&buf, &len, fp) != NULL)\n- SSIGetFilePosition(fp, SSI_OFFSET_I32, &off); \n- fclose(fp);\n- free(buf);\n- } else if (mode == 3) {\n- SQFILE *dbfp;\n- SQINFO info;\n-\n- if ((dbfp = SeqfileOpen(filename, SQFILE_FASTA, NULL)) == NULL)\n- Die("open of %s failed", filename); \n- while (ReadSeq(dbfp, dbfp->format, &buf, &info)) { \n- SSIGetFilePosition(dbfp->f, SSI_OFFSET_I32, &off); \n- FreeSequence(buf, &info);\n- }\n- SeqfileClose(dbfp);\n- }\n- \n-}\n- \n-\n-#endif\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/squid/squid-1.9g.tar.gz |
b |
Binary file clustalomega/clustal-omega-0.2.0/src/squid/squid-1.9g.tar.gz has changed |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/squid/squid.h --- a/clustalomega/clustal-omega-0.2.0/src/squid/squid.h Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,531 +0,0 @@\n-/* Generated automatically from squid.h.in by configure. */\n-/*****************************************************************\n- * SQUID - a library of functions for biological sequence analysis\n- * Copyright (C) 1992-2002 Washington University School of Medicine\n- * \n- * This source code is freely distributed under the terms of the\n- * GNU General Public License. See the files COPYRIGHT and LICENSE\n- * for details.\n- *****************************************************************/\n-\n-#ifndef SQUIDH_INCLUDED\n-#define SQUIDH_INCLUDED\n-\n-/* squid.h\n- * Header file for my library of sequence functions.\n- *\n- * CVS $Id: squid.h.in,v 1.5 2002/10/09 14:26:09 eddy Exp)\n- */\n-\n-#include <stdio.h>\n-#include <math.h>\n-#include <stdlib.h>\n-#include <unistd.h>\t\t/* for sysconf() #define\'s */\n-\n-\n-#if DEBUGLEVEL > 0\n-#include <assert.h>\t\t/* for SQD_DASSERT1(), etc. */\n-#endif\n-\n-/* include clustal\'s config.h */\n-#ifdef CLUSTALO\n-#include "config.h"\n-#define CLUSTALO 1\n-#else\n-#include "clustal-omega-config.h"\n-#define CLUSTALO 1\n-#endif\n-\n-#ifdef CLUSTALO\n-/* we don\'t want squidconf.h but our own config header. but, there are\n- * some checks, espcially at the end of squidconf.h might be\n- * necessary for squid to work. They follow after the inclusion of\n- * config.h\n- */\n-#undef DEBUG\n-\n-/* squidconf.h checks:\n- */\n-#if defined HAVE_NTOHL && defined HAVE_NTOHS && defined HAVE_HTONS && defined HAVE_HTONL\n-#define USE_HOST_BYTESWAP_FUNCTIONS 1\n-#endif\n-/* On 64-bit machines like Alphas, strtoull doesn\'t exist, strotul will work\n- */\n-#if SIZEOF_UNSIGNED_LONG == 8 && defined HAVE_STRTOUL && ! defined HAVE_STRTOULL\n-#define strtoull strtoul\n-#endif\n-\n-#if defined HAVE_FTELLO && defined HAVE_FSEEKO && SIZEOF_OFF_T == 8\n-#define HAS_64BIT_FILE_OFFSETS 1\n-#elif defined HAVE_FTELLO64 && defined HAVE_FSEEKO64 && SIZEOF_OFF64_T == 8\n-#define HAS_64BIT_FILE_OFFSETS 1\n-#elif defined HAVE_FTELL64 && defined HAVE_FSEEK64 \n-#define HAS_64BIT_FILE_OFFSETS 1\n-#elif defined ARITHMETIC_FPOS_T && SIZEOF_FPOS_T == 8\n-#define HAS_64BIT_FILE_OFFSETS 1\n-#else\n-#undef HAS_64BIT_FILE_OFFSETS \n-#endif\n-\n-/* The following check seems like nonsense to me (AW), therefore */\n-#if 0\n-/* Stuff to work around Tru64 not having strtoull() -\n- * on systems with 64-bit longs, we can use strtoul()\n- */\n-#undef HAVE_STRTOULL\n-#if ! defined HAVE_STRTOULL && SIZEOF_UNSIGNED_LONG == 8\n-#define strtoull strtoul\n-#endif\n-#endif\n-\n-#else /* CLUSTALO */\n-#include "squidconf.h"\t\t/* #define\'s generated by ./configure script */\n-#endif\n-\n-/*****************************************************************\n- * Integers of guaranteed size. (used for instance in gsi.c, gsi2.c)\n- * These are set by the ./configure script; if they show up as FIXME,\n- * they must be manually edited to appropriate type definitions. You\n- * do need 64-bit integers in the current code; email me if this\n- * prevents you from compiling SQUID and tell me your system (I don\'t\n- * know of any systems that don\'t have 64-bit integers these days).\n- *****************************************************************/\n-typedef unsigned short sqd_uint16;\n-typedef unsigned int sqd_uint32;\n-typedef unsigned long sqd_uint64;\n-\n-#ifdef USE_HOST_BYTESWAP_FUNCTIONS\n-#include <sys/types.h>\t\t/* only for ntohl() and friends. */\n-#include <netinet/in.h>\t\t/* only for ntohl() and friends. */\n-#define sre_ntoh16(x) ntohs(x);\n-#define sre_ntoh32(x) ntohl(x);\n-#define sre_hton16(x) htons(x);\n-#define sre_hton32(x) htonl(x);\n-#endif /* USE_HOST_BYTESWAP_FUNCTIONS */\n-\n-/* Library version info is made available as a global to\n- * any interested program. These are defined in iupac.c\n- * with the other globals.\n- */\n-extern char squid_version[];\t/* version number */\n-extern char squid_date[];\t/* date of release */\n-extern int squid_errno;\t/* error codes */\n-\n-\n-\n-/****************************************************\n- * Error codes returned by squid library functions (squid_errn'..b' library.\n- ****************************************************/\n-\n-#define NSUBEXP 10\n-typedef struct sqd_regexp {\n-\tchar *startp[NSUBEXP];\n-\tchar *endp[NSUBEXP];\n-\tchar regstart;\t\t/* Internal use only. */\n-\tchar reganch;\t\t/* Internal use only. */\n-\tchar *regmust;\t\t/* Internal use only. */\n-\tint regmlen;\t\t/* Internal use only. */\n-\tchar program[1];\t/* Unwarranted chumminess with compiler. */\n-} sqd_regexp;\n-\n-/* Strparse() defines and manages these. \n- * sqd_parse[0] contains the substring that matched the pattern.\n- * sqd_parse[1-9] contain substrings matched with ()\'s.\n- */\n-extern char *sqd_parse[10];\n-\n-/****************************************************\n- * Portable detection of multiprocessor # of CPUs.\n- * #include <unistd.h>\n- * long foo = SQD_NPROC;\n- * returns the number of available processors.\n- * if foo == -1, we failed.\n- ****************************************************/\n-\n-/* Our problem here is that POSIX apparently doesn\'t specify\n- * a standard for how to get sysconf() to report the number of\n- * processors on-line. _SC_NPROCESSORS_ONLN is specified\n- * by SVR4.0MP. Thanks to W. Gish for help here.\n- */\n-#undef SQD_NPROC\n-#ifdef _SC_NPROCESSORS_ONLN /* Sun Solaris, Digital UNIX */\n-#define SQD_NPROC sysconf(_SC_NPROCESSORS_ONLN)\n-#else\n-#ifdef _SC_NPROC_ONLN\t\t/* Silicon Graphics IRIX */\n-#define SQD_NPROC sysconf(_SC_NPROC_ONLN)\n-#else /* FreeBSD, Linux don\'t support getting ncpu via sysconf() */\n-#define SQD_NPROC -1\n-#endif\n-#endif\n-\n-/****************************************************\n- * Three levels of debugging printf\'s and assert\'s\n- * level 1: little impact on verbosity or performance\n- * level 2: moderate impact\n- * level 3: high impact\n- * Example:\n- * SQD_DPRINTF3(("Matrix row %d col %d = %f\\n", i, j, val));\n- * Note the double parentheses; these are important.\n- ****************************************************/\n-\n-#ifndef DEBUGLEVEL\n-#define DEBUGLEVEL 0\n-#endif\n-\n-#if (DEBUGLEVEL >= 1)\n-#define SQD_DPRINTF1(x) printf x\n-#define SQD_DASSERT1(x) assert x\n-#else\n-#define SQD_DPRINTF1(x) \n-#define SQD_DASSERT1(x)\n-#endif\n-#if (DEBUGLEVEL >= 2)\n-#define SQD_DPRINTF2(x) printf x\n-#define SQD_DASSERT2(x) assert x\n-#else\n-#define SQD_DPRINTF2(x) \n-#define SQD_DASSERT2(x)\n-#endif\n-#if (DEBUGLEVEL >= 3)\n-#define SQD_DPRINTF3(x) printf x\n-#define SQD_DASSERT3(x) assert x\n-#else\n-#define SQD_DPRINTF3(x) \n-#define SQD_DASSERT3(x)\n-#endif\n-\n-/* PANIC is called for failures of Std C/POSIX functions,\n- * instead of my own functions. Panic() calls perror() and exits\n- * abnormally.\n- */\n-#define PANIC Panic(__FILE__, __LINE__)\n-\n-/* Malloc/realloc calls are wrapped\n- */\n-#define MallocOrDie(x) sre_malloc(__FILE__, __LINE__, (x))\n-#define ReallocOrDie(x,y) sre_realloc(__FILE__, __LINE__, (x), (y))\n-\n-/****************************************************\n- * Miscellaneous macros and defines\n- ****************************************************/\n-\n-#define SQDCONST_E 2.71828182845904523536028747135\n-#define SQDCONST_PI 3.14159265358979323846264338328\n-\n-\t\t\t\t/* must declare swapfoo to use SWAP() */\n-#define SWAP(a,b) {swapfoo = b; b = a; a = swapfoo;}\n-#define ScalarsEqual(a,b) (fabs((a)-(b)) < 1e-7)\n-\n-#ifndef MIN\n-#define MIN(a,b) (((a)<(b))?(a):(b))\n-#endif\n-#ifndef MAX\n-#define MAX(a,b) (((a)>(b))?(a):(b))\n-#endif\n-\n-/* For convenience and (one hopes) clarity in boolean tests:\n- */\n-#ifndef TRUE\n-#define TRUE 1\n-#endif\n-#ifndef FALSE \n-#define FALSE 0\n-#endif\n-\n-/* Somewhere, there is a universe in which Unix vendors comply\n- * with the ANSI C standard. Unfortunately, it is not ours:\n- */\n-#ifndef EXIT_SUCCESS\n-#define EXIT_SUCCESS 0\n-#endif\n-#ifndef EXIT_FAILURE\n-#define EXIT_FAILURE 1\n-#endif\n-\n-#include "sqfuncs.h"\t\t/* squid function declarations */\n-#include "sre_random.h" /* random number generator and samplers */\n-#include "vectorops.h" /* vector operations */\n-#endif /* SQUIDH_INCLUDED */\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/squid/squidcore.c --- a/clustalomega/clustal-omega-0.2.0/src/squid/squidcore.c Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,52 +0,0 @@ -/************************************************************ - * SQUID - a library of functions for biological sequence analysis - * Copyright (C) 1992-2002 Washington University School of Medicine - * - * This source code is freely distributed under the terms of the - * GNU General Public License. See the files COPYRIGHT and LICENSE - * for details. - ************************************************************/ - -/* squidcore.c - * SRE, Sun Jun 20 17:19:04 1999 [Graeme's kitchen] - * - * Core functions for SQUID library. - * RCS $Id: squidcore.c 217 2011-03-19 10:27:10Z andreas $ (Original squid RCS Id: squidcore.c,v 1.1 1999/07/15 22:24:41 eddy Exp) - */ - -#include <stdio.h> -#include "version.h" - -/* Function: Banner() - * Date: SRE, Sun Jun 20 17:19:41 1999 [Graeme's kitchen] - * - * Purpose: Print a package version and copyright banner. - * Used by all the main()'s. - * - * Expects to be able to pick up defined macros: - * macro example - * ------ -------------- - * PACKAGE "HMMER" - * RELEASE "2.0.42" - * RELEASEDATE "April 1 1999" - * COPYRIGHT "Copyright (C) 1992-1999 Washington University School of Medicine" - * LICENSE "HMMER is freely distributed under the GNU General Public License (GPL)." - * - * This gives us a general mechanism to update release information - * without changing multiple points in the code; we can also override - * SQUID release data with another package's release data (e.g. - * HMMER) just by redefining macros. - * - * Args: fp - where to print it - * banner - one-line program description, e.g.: - * "foobar - make bars from foo with elan" - * Returns: (void) - */ -void -Banner(FILE *fp, char *banner) -{ - fprintf(fp, "%s\n%s %s (%s)\n%s\n%s\n", banner, PACKAGE, RELEASE, RELEASEDATE, COPYRIGHT, LICENSE); - fprintf(fp, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n"); -} - - |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/squid/sre_ctype.c --- a/clustalomega/clustal-omega-0.2.0/src/squid/sre_ctype.c Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,34 +0,0 @@ -/***************************************************************** - * SQUID - a library of functions for biological sequence analysis - * Copyright (C) 1992-2002 Washington University School of Medicine - * - * This source code is freely distributed under the terms of the - * GNU General Public License. See the files COPYRIGHT and LICENSE - * for details. - *****************************************************************/ - -/* sre_ctype.c - * - * For portability. Some systems have functions tolower, toupper - * as macros (for instance, MIPS M-2000 RISC/os!) - * - * RCS $Id: sre_ctype.c 217 2011-03-19 10:27:10Z andreas $ (Original squid RCS Id: sre_ctype.c,v 1.3 2001/09/02 23:43:19 eddy Exp) - */ - -#include <ctype.h> -#include "squid.h" - -int -sre_tolower(int c) -{ - if (isupper(c)) return tolower(c); - else return c; -} - -int -sre_toupper(int c) -{ - if (islower(c)) return toupper(c); - else return c; -} - |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/squid/sre_math.c --- a/clustalomega/clustal-omega-0.2.0/src/squid/sre_math.c Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,331 +0,0 @@\n-/*****************************************************************\n- * SQUID - a library of functions for biological sequence analysis\n- * Copyright (C) 1992-2002 Washington University School of Medicine\n- * \n- * This source code is freely distributed under the terms of the\n- * GNU General Public License. See the files COPYRIGHT and LICENSE\n- * for details.\n- *****************************************************************/\n-\n-/* sre_math.c\n- * \n- * Portability for and extensions to C math library.\n- * RCS $Id: sre_math.c 217 2011-03-19 10:27:10Z andreas $ (Original squid RCS Id: sre_math.c,v 1.12 2002/10/09 14:26:09 eddy Exp)\n- */\n-\n-#include <stdio.h>\n-#include <stdlib.h>\n-#include <math.h>\n-#include "squid.h"\n-\n- \n-/* Function: Linefit()\n- * \n- * Purpose: Given points x[0..N-1] and y[0..N-1], fit to\n- * a straight line y = a + bx.\n- * a, b, and the linear correlation coefficient r\n- * are filled in for return.\n- * \n- * Args: x - x values of data\n- * y - y values of data \n- * N - number of data points\n- * ret_a - RETURN: intercept\n- * ret_b - RETURN: slope\n- * ret_r - RETURN: correlation coefficient \n- * \n- * Return: 1 on success, 0 on failure.\n- */\n-int \n-Linefit(float *x, float *y, int N, float *ret_a, float *ret_b, float *ret_r) \n-{\t\t\t\t\n- float xavg, yavg;\n- float sxx, syy, sxy;\n- int i;\n- \n- /* Calculate averages, xavg and yavg\n- */\n- xavg = yavg = 0.0;\n- for (i = 0; i < N; i++)\n- {\n- xavg += x[i];\n- yavg += y[i];\n- }\n- xavg /= (float) N;\n- yavg /= (float) N;\n-\n- sxx = syy = sxy = 0.0;\n- for (i = 0; i < N; i++)\n- {\n- sxx += (x[i] - xavg) * (x[i] - xavg);\n- syy += (y[i] - yavg) * (y[i] - xavg);\n- sxy += (x[i] - xavg) * (y[i] - yavg);\n- }\n- *ret_b = sxy / sxx;\n- *ret_a = yavg - xavg*(*ret_b);\n- *ret_r = sxy / (sqrt(sxx) * sqrt(syy));\n- return 1;\n-}\n-\n-\n-/* Function: WeightedLinefit()\n- * \n- * Purpose: Given points x[0..N-1] and y[0..N-1] with\n- * variances (measurement errors) var[0..N-1], \n- * fit to a straight line y = mx + b.\n- * \n- * Method: Algorithm from Numerical Recipes in C, [Press88].\n- * \n- * Return: (void)\n- * ret_m contains slope; ret_b contains intercept \n- */ \n-void\n-WeightedLinefit(float *x, float *y, float *var, int N, float *ret_m, float *ret_b) \n-{\n- int i;\n- double s;\n- double sx, sy;\n- double sxx, sxy;\n- double delta;\n- double m, b;\n- \n- s = sx = sy = sxx = sxy = 0.;\n- for (i = 0; i < N; i++)\n- {\n- s += 1./var[i];\n- sx += x[i] / var[i];\n- sy += y[i] / var[i];\n- sxx += x[i] * x[i] / var[i];\n- sxy += x[i] * y[i] / var[i];\n- }\n-\n- delta = s * sxx - (sx * sx);\n- b = (sxx * sy - sx * sxy) / delta;\n- m = (s * sxy - sx * sy) / delta;\n-\n- *ret_m = m;\n- *ret_b = b;\n-}\n- \n-\n-/* Function: Gammln()\n- *\n- * Returns the natural log of the gamma function of x.\n- * x is > 0.0. \n- *\n- * Adapted from a public domain implementation in the\n- * NCBI core math library. Thanks to John Spouge and\n- * the NCBI. (According to the NCBI, that\'s Dr. John\n- * "Gammas Galore" Spouge to you, pal.)\n- */\n-double\n-Gammln(double x)\n-{\n- int i;\n- double xx, tx;\n- double tmp, value;\n- static double cof[11] = {\n- 4.694580336184385e+04,\n- -1.560605207784446e+05,\n- 2.065049568014106e+05,\n- -1.388934775095388e+05,\n- 5.031796415085709e+04,\n- -9.601592329182778e+03,\n- 8.785855930895250e+02,\n- -3.155153906098611e+01,\n- 2.908143421162229e-01,\n- -2.319827630494973e-04,\n- 1.251639670050933e-10\n- };\n- \n- /* Protect against x=0. We see this in Dirichlet code,\n- * for terms alpha = 0. This is a severe hack but it is effective\n- * and (we think?) safe. (due to GJM)\n- */ \n- if (x <= 0.0) return 999999.; \n-\n- xx = x - 1.0;\n- tx = tmp = xx + '..b'ize.\n- */\n-void\n-FMX2Multiply(float **A, float **B, float **C, int m, int p, int n)\n-{\n- int i, j, k;\n-\n- for (i = 0; i < m; i++)\n- for (j = 0; j < n; j++)\n- {\n-\tC[i][j] = 0.;\n-\tfor (k = 0; k < p; k++)\n-\t C[i][j] += A[i][p] * B[p][j];\n- }\n-}\n-\n-\n-/* Function: IncompleteGamma()\n- * \n- * Purpose: Returns 1 - P(a,x) where:\n- * P(a,x) = \\frac{1}{\\Gamma(a)} \\int_{0}^{x} t^{a-1} e^{-t} dt\n- * = \\frac{\\gamma(a,x)}{\\Gamma(a)}\n- * = 1 - \\frac{\\Gamma(a,x)}{\\Gamma(a)}\n- * \n- * Used in a chi-squared test: for a X^2 statistic x\n- * with v degrees of freedom, call:\n- * p = IncompleteGamma(v/2., x/2.) \n- * to get the probability p that a chi-squared value\n- * greater than x could be obtained by chance even for\n- * a correct model. (i.e. p should be large, say \n- * 0.95 or more).\n- * \n- * Method: Based on ideas from Numerical Recipes in C, Press et al.,\n- * Cambridge University Press, 1988. \n- * \n- * Args: a - for instance, degrees of freedom / 2 [a > 0]\n- * x - for instance, chi-squared statistic / 2 [x >= 0] \n- * \n- * Return: 1 - P(a,x).\n- */ \n-double\n-IncompleteGamma(double a, double x)\n-{\n- int iter;\t\t\t/* iteration counter */\n-\n- if (a <= 0.) Die("IncompleteGamma(): a must be > 0");\n- if (x < 0.) Die("IncompleteGamma(): x must be >= 0");\n-\n- /* For x > a + 1 the following gives rapid convergence;\n- * calculate 1 - P(a,x) = \\frac{\\Gamma(a,x)}{\\Gamma(a)}:\n- * use a continued fraction development for \\Gamma(a,x).\n- */\n- if (x > a+1) \n- {\n- double oldp;\t\t/* previous value of p */\n- double nu0, nu1;\t\t/* numerators for continued fraction calc */\n- double de0, de1;\t\t/* denominators for continued fraction calc */\n-\n- nu0 = 0.;\t\t\t/* A_0 = 0 */\n- de0 = 1.;\t\t\t/* B_0 = 1 */\n- nu1 = 1.;\t\t\t/* A_1 = 1 */\n- de1 = x;\t\t\t/* B_1 = x */\n-\n- oldp = nu1;\n- for (iter = 1; iter < 100; iter++)\n-\t{\n-\t /* Continued fraction development:\n-\t * set A_j = b_j A_j-1 + a_j A_j-2\n-\t * B_j = b_j B_j-1 + a_j B_j-2\n- * We start with A_2, B_2.\n-\t */\n-\t\t\t\t/* j = even: a_j = iter-a, b_j = 1 */\n-\t\t\t\t/* A,B_j-2 are in nu0, de0; A,B_j-1 are in nu1,de1 */\n-\t nu0 = nu1 + ((double)iter - a) * nu0;\n-\t de0 = de1 + ((double)iter - a) * de0;\n-\n-\t\t\t\t/* j = odd: a_j = iter, b_j = x */\n-\t\t\t\t/* A,B_j-2 are in nu1, de1; A,B_j-1 in nu0,de0 */\n-\t nu1 = x * nu0 + (double) iter * nu1;\n-\t de1 = x * de0 + (double) iter * de1;\n-\n-\t\t\t\t/* rescale */\n-\t if (de1 != 0.) \n-\t { \n-\t nu0 /= de1; \n-\t de0 /= de1;\n-\t nu1 /= de1;\n-\t de1 = 1.;\n-\t }\n-\t\t\t\t/* check for convergence */\n-\t if (fabs((nu1-oldp)/nu1) < 1.e-7)\n-\t return nu1 * exp(a * log(x) - x - Gammln(a));\n-\n-\t oldp = nu1;\n-\t}\n- Die("IncompleteGamma(): failed to converge using continued fraction approx");\n- }\n- else /* x <= a+1 */\n- {\n- double p;\t\t\t/* current sum */\n- double val;\t\t/* current value used in sum */\n-\n- /* For x <= a+1 we use a convergent series instead:\n- * P(a,x) = \\frac{\\gamma(a,x)}{\\Gamma(a)},\n- * where\n- * \\gamma(a,x) = e^{-x}x^a \\sum_{n=0}{\\infty} \\frac{\\Gamma{a}}{\\Gamma{a+1+n}} x^n\n- * which looks appalling but the sum is in fact rearrangeable to\n- * a simple series without the \\Gamma functions:\n- * = \\frac{1}{a} + \\frac{x}{a(a+1)} + \\frac{x^2}{a(a+1)(a+2)} ...\n- * and it\'s obvious that this should converge nicely for x <= a+1.\n- */\n- \n- p = val = 1. / a;\n- for (iter = 1; iter < 10000; iter++)\n-\t{\n-\t val *= x / (a+(double)iter);\n-\t p += val;\n-\t \n-\t if (fabs(val/p) < 1.e-7)\n-\t return 1. - p * exp(a * log(x) - x - Gammln(a));\n-\t}\n- Die("IncompleteGamma(): failed to converge using series approx");\n- }\n- /*NOTREACHED*/\n- return 0.;\n-}\n- \n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/squid/sre_random.c --- a/clustalomega/clustal-omega-0.2.0/src/squid/sre_random.c Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,313 +0,0 @@\n-/* sre_random.c\n- * \n- * Portable random number generator, and sampling routines.\n- *\n- * SRE, Tue Oct 1 15:24:11 2002 [St. Louis]\n- * CVS $Id: sre_random.c,v 1.1 2002/10/09 14:26:09 eddy Exp)\n- */\n-\n-#include <stdio.h>\n-#include <stdlib.h>\n-#include <math.h>\n-#include "sre_random.h"\n-\n-static int sre_randseed = 42;\t/* default seed for sre_random() */\n-\n-/* Function: sre_random()\n- * \n- * Purpose: Return a uniform deviate x, 0.0 <= x < 1.0.\n- * \n- * sre_randseed is a static variable, set\n- * by sre_srandom(). When it is non-zero, \n- * we re-seed.\n- * \n- * Implements L\'Ecuyer\'s algorithm for combining output\n- * of two linear congruential generators, plus a Bays-Durham\n- * shuffle. This is essentially ran2() from Numerical Recipes,\n- * sans their nonhelpful Rand/McNally-esque code obfuscation.\n- * \n- * Overflow errors are avoided by Schrage\'s algorithm:\n- * az % m = a(z%q) - r(z/q) (+m if <0)\n- * where q=m/a, r=m%a\n- *\n- * Requires that long int\'s have at least 32 bits.\n- * This function uses statics and is NOT THREADSAFE.\n- * \n- * Reference: Press et al. Numerical Recipes in C, 1992. \n- *\n- * Reliable and portable, but slow. Benchmarks on wrasse,\n- * using Linux gcc and Linux glibc rand() (see randspeed, in Testsuite):\n- * sre_random(): 0.5 usec/call\n- * rand(): 0.2 usec/call\n- */\n-double\n-sre_random(void)\n-{\n- static long rnd1;\t\t/* random number from LCG1 */\n- static long rnd2; /* random number from LCG2 */\n- static long rnd; /* random number we return */\n- static long tbl[64];\t\t/* table for Bays/Durham shuffle */\n- long x,y;\n- int i;\n-\n- /* Magic numbers a1,m1, a2,m2 from L\'Ecuyer, for 2 LCGs.\n- * q,r derive from them (q=m/a, r=m%a) and are needed for Schrage\'s algorithm.\n- */\n- long a1 = 40014;\t\t\n- long m1 = 2147483563;\t\t\n- long q1 = 53668;\n- long r1 = 12211;\n-\n- long a2 = 40692;\n- long m2 = 2147483399;\n- long q2 = 52774;\n- long r2 = 3791;\n-\n- if (sre_randseed > 0) \n- {\n- rnd1 = sre_randseed;\n- rnd2 = sre_randseed;\n-\t\t\t\t/* Fill the table for Bays/Durham */\n- for (i = 0; i < 64; i++) {\n-\tx = a1*(rnd1%q1); /* LCG1 in action... */\n-\ty = r1*(rnd1/q1);\n-\trnd1 = x-y;\n-\tif (rnd1 < 0) rnd1 += m1;\n-\n-\tx = a2*(rnd2%q2); /* LCG2 in action... */\n-\ty = r2*(rnd2/q2);\n-\trnd2 = x-y;\n-\tif (rnd2 < 0) rnd2 += m2;\n-\n-\ttbl[i] = rnd1-rnd2;\n-\tif (tbl[i] < 0) tbl[i] += m1;\n- }\n- sre_randseed = 0;\t\t/* drop the flag. */\n- }/* end of initialization*/\n-\n-\n- x = a1*(rnd1%q1); /* LCG1 in action... */\n- y = r1*(rnd1/q1);\n- rnd1 = x-y;\n- if (rnd1 < 0) rnd1 += m1;\n-\n- x = a2*(rnd2%q2); /* LCG2 in action... */\n- y = r2*(rnd2/q2);\n- rnd2 = x-y;\n- if (rnd2 < 0) rnd2 += m2;\n-\n- \t\t\t/* Choose our random number from the table... */\n- i = (int) (((double) rnd / (double) m1) * 64.);\n- rnd = tbl[i];\n-\t\t\t/* and replace with a new number by L\'Ecuyer. */\n- tbl[i] = rnd1-rnd2;\n- if (tbl[i] < 0) tbl[i] += m1;\n-\n- return ((double) rnd / (double) m1); \n-}\n-\n-/* Function: sre_srandom()\n- * \n- * Purpose: Initialize with a random seed. Seed must be\n- * >= 0 to work; we silently enforce this.\n- */\n-void\n-sre_srandom(int seed)\n-{\n- if (seed < 0) seed = -1 * seed;\n- if (seed == 0) seed = 42;\n- sre_randseed = seed;\n-}\n-\n-/* Function: sre_random_positive()\n- * Date: SRE, Wed Apr 17 13:34:32 2002 [St. Louis]\n- *\n- * Purpose: Assure 0 < x < 1 (positive uniform deviate)\n- */\n-double\n-sre_random_positive(void)\n-{\n- double x;\n- do { x = sre_random(); } while (x == 0.0);\n- return x;\n-}\n-\n-/* Function: ExponentialRandom()\n- * Date: SRE, Mon Sep 6 21:24:29 1999 [St. Louis]\n- *\n- * Purpose: Pick an exponentially distributed random variable\n- * 0 > x >= infinity\n- * \n- * Args: (void)\n- *\n- * Returns: x\n- */\n-double\n-E'..b'tion", Math. Comput. 27:927-937 (1973).\n- *\n- * Impenetrability of the code is to be blamed on its FORTRAN/f2c lineage.\n- * \n- */\n-double\n-Gaussrandom(double mean, double stddev)\n-{\n- static double a[32] = {\n- 0.0,3.917609E-2,7.841241E-2,0.11777,0.1573107,0.1970991,0.2372021,0.2776904, 0.3186394,0.36013,0.4022501,0.4450965,0.4887764,0.5334097,0.5791322,\n- 0.626099,0.6744898,0.7245144,0.7764218,0.8305109,0.8871466,0.9467818,\n- 1.00999,1.077516,1.150349,1.229859,1.318011,1.417797,1.534121,1.67594,\n- 1.862732,2.153875\n- };\n- static double d[31] = {\n- 0.0,0.0,0.0,0.0,0.0,0.2636843,0.2425085,0.2255674,0.2116342,0.1999243,\n- 0.1899108,0.1812252,0.1736014,0.1668419,0.1607967,0.1553497,0.1504094,\n- 0.1459026,0.14177,0.1379632,0.1344418,0.1311722,0.128126,0.1252791,\n- 0.1226109,0.1201036,0.1177417,0.1155119,0.1134023,0.1114027,0.1095039\n- };\n- static double t[31] = {\n- 7.673828E-4,2.30687E-3,3.860618E-3,5.438454E-3,7.0507E-3,8.708396E-3,\n- 1.042357E-2,1.220953E-2,1.408125E-2,1.605579E-2,1.81529E-2,2.039573E-2,\n- 2.281177E-2,2.543407E-2,2.830296E-2,3.146822E-2,3.499233E-2,3.895483E-2,\n- 4.345878E-2,4.864035E-2,5.468334E-2,6.184222E-2,7.047983E-2,8.113195E-2,\n- 9.462444E-2,0.1123001,0.136498,0.1716886,0.2276241,0.330498,0.5847031\n- };\n- static double h[31] = {\n- 3.920617E-2,3.932705E-2,3.951E-2,3.975703E-2,4.007093E-2,4.045533E-2,\n- 4.091481E-2,4.145507E-2,4.208311E-2,4.280748E-2,4.363863E-2,4.458932E-2,\n- 4.567523E-2,4.691571E-2,4.833487E-2,4.996298E-2,5.183859E-2,5.401138E-2,\n- 5.654656E-2,5.95313E-2,6.308489E-2,6.737503E-2,7.264544E-2,7.926471E-2,\n- 8.781922E-2,9.930398E-2,0.11556,0.1404344,0.1836142,0.2790016,0.7010474\n- };\n- static long i;\n- static double snorm,u,s,ustar,aa,w,y,tt;\n-\n- u = sre_random();\n- s = 0.0;\n- if(u > 0.5) s = 1.0;\n- u += (u-s);\n- u = 32.0*u;\n- i = (long) (u);\n- if(i == 32) i = 31;\n- if(i == 0) goto S100;\n- /*\n- * START CENTER\n- */\n- ustar = u-(double)i;\n- aa = *(a+i-1);\n-S40:\n- if(ustar <= *(t+i-1)) goto S60;\n- w = (ustar-*(t+i-1))**(h+i-1);\n-S50:\n- /*\n- * EXIT (BOTH CASES)\n- */\n- y = aa+w;\n- snorm = y;\n- if(s == 1.0) snorm = -y;\n- return (stddev*snorm + mean);\n-S60:\n- /*\n- * CENTER CONTINUED\n- */\n- u = sre_random();\n- w = u*(*(a+i)-aa);\n- tt = (0.5*w+aa)*w;\n- goto S80;\n-S70:\n- tt = u;\n- ustar = sre_random();\n-S80:\n- if(ustar > tt) goto S50;\n- u = sre_random();\n- if(ustar >= u) goto S70;\n- ustar = sre_random();\n- goto S40;\n-S100:\n- /*\n- * START TAIL\n- */\n- i = 6;\n- aa = *(a+31);\n- goto S120;\n-S110:\n- aa += *(d+i-1);\n- i += 1;\n-S120:\n- u += u;\n- if(u < 1.0) goto S110;\n- u -= 1.0;\n-S140:\n- w = u**(d+i-1);\n- tt = (0.5*w+aa)*w;\n- goto S160;\n-S150:\n- tt = u;\n-S160:\n- ustar = sre_random();\n- if(ustar > tt) goto S50;\n- u = sre_random();\n- if(ustar >= u) goto S150;\n- u = sre_random();\n- goto S140;\n-}\n-\n- \n-/* Functions: DChoose(), FChoose()\n- *\n- * Purpose: Make a random choice from a normalized distribution.\n- * DChoose() is for double-precision vectors;\n- * FChoose() is for single-precision float vectors.\n- * Returns the number of the choice.\n- */\n-int\n-DChoose(double *p, int N)\n-{\n- double roll; /* random fraction */\n- double sum; /* integrated prob */\n- int i; /* counter over the probs */\n-\n- roll = sre_random();\n- sum = 0.0;\n- for (i = 0; i < N; i++)\n- {\n- sum += p[i];\n- if (roll < sum) return i;\n- }\n- return (int) (sre_random() * N); /* bulletproof */\n-}\n-int\n-FChoose(float *p, int N)\n-{\n- float roll; /* random fraction */\n- float sum;\t\t\t/* integrated prob */\n- int i; /* counter over the probs */\n-\n- roll = sre_random();\n- sum = 0.0;\n- for (i = 0; i < N; i++)\n- {\n- sum += p[i];\n- if (roll < sum) return i;\n- }\n- return (int) (sre_random() * N); /* bulletproof */\n-}\n-\n- \n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/squid/sre_random.h --- a/clustalomega/clustal-omega-0.2.0/src/squid/sre_random.h Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,18 +0,0 @@ -/* sre_random.h - * Header file for sre_random.c - * - * SRE, Tue Oct 1 15:24:29 2002 - * CVS $Id: sre_random.h,v 1.1 2002/10/09 14:26:09 eddy Exp) - */ - -extern double sre_random(void); -extern void sre_srandom(int seed); -extern double sre_random_positive(void); -extern double ExponentialRandom(void); -extern double Gaussrandom(double mean, double stddev); -extern int DChoose(double *p, int N); -extern int FChoose(float *p, int N); - -#define CHOOSE(a) ((int) (sre_random() * (a))) - - |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/squid/sre_string.c --- a/clustalomega/clustal-omega-0.2.0/src/squid/sre_string.c Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,523 +0,0 @@\n-/*****************************************************************\n- * SQUID - a library of functions for biological sequence analysis\n- * Copyright (C) 1992-2002 Washington University School of Medicine\n- * \n- * This source code is freely distributed under the terms of the\n- * GNU General Public License. See the files COPYRIGHT and LICENSE\n- * for details.\n- *****************************************************************/\n-\n-/* sre_string.c\n- * \n- * my library of extra string functions. Some for portability\n- * across UNIXes\n- *\n- * RCS $Id: sre_string.c 217 2011-03-19 10:27:10Z andreas $ (Original squid RCS Id: sre_string.c,v 1.11 2001/06/07 16:59:37 eddy Exp)\n- */\n-\n-#include <stdio.h>\n-#include <stdlib.h>\n-#include <string.h>\n-#include <stdarg.h>\n-#include <ctype.h>\n-#include "squid.h"\n-\n-/* Function: Strdup()\n- * \n- * Purpose: Implementation of the common (but non-ANSI) function\n- * strdup(). Robust against being passed a NULL pointer.\n- * \n- */\n-char *\n-Strdup(char *s)\n-{\n- char *new;\n- if (s == NULL) return NULL;\n- if ((new = (char *) malloc (strlen(s) +1)) == NULL) return NULL;\n- strcpy(new, s);\n- return new;\n-}\n-\n-/* Function: StringChop()\n- * Date: SRE, Wed Oct 29 12:10:02 1997 [TWA 721]\n- * \n- * Purpose: Chop trailing whitespace off of a string.\n- */\n-void\n-StringChop(char *s)\n-{\n- int i;\n-\n- i = strlen(s) - 1;\t\t /* set i at last char in string */\n- while (i >= 0 && isspace((int) s[i])) i--; /* i now at last non-whitespace char, or -1 */\n- s[i+1] = \'\\0\';\n-}\n-\n-int\n-Strinsert(char *s1, /* string to insert a char into */\n-\t char c,\t\t/* char to insert */\n-\t int pos)\t\t/* position in s1 to insert c at */\n-{\n- char oldc;\n- char *s;\n-\n- for (s = s1 + pos; c; s++)\n- {\n-\t\t\t\t/* swap current char for inserted one */\n- oldc = *s;\t\t/* pick up current */\n- *s = c; \t\t/* put down inserted one */\n- c = oldc;\t\t/* old becomes next to insert */\n- }\n- *s = \'\\0\';\n-\n- return 1;\n-}\n-\n-\n-int\n-Strdelete(char *s1, /* string to delete a char from */\n-\t int pos)\t\t/* position of char to delete 0..n-1 */\n-{\n- char *s; \n-\n- for (s = s1 + pos; *s; s++)\n- *s = *(s + 1);\n-\n- return 1;\n-}\n-\n-void\n-s2lower(char *s)\n-{\n- for (; *s != \'\\0\'; s++)\n- *s = sre_tolower((int) *s);\n-}\n-\n-void\n-s2upper(char *s)\n-{\n- for (; *s != \'\\0\'; s++)\n- *s = sre_toupper((int) *s);\n-}\n-\n-\n-void *\n-sre_malloc(char *file, int line, size_t size)\n-{\n- void *ptr;\n-\n- SQD_DPRINTF3(("MALLOC: %d bytes (file %s line %d)\\n", size, file, line));\n- if ((ptr = malloc (size)) == NULL)\n- Die("malloc of %ld bytes failed: file %s line %d", size, file, line);\n- return ptr;\n-}\n-\n-void *\n-sre_realloc(char *file, int line, void *p, size_t size)\n-{\n- void *ptr;\n-\n- if ((ptr = realloc(p, size)) == NULL)\n- Die("realloc of %ld bytes failed: file %s line %d", size, file, line);\n- return ptr;\n-}\n-\n-\n-\n-/* Function: Free2DArray(), Free3DArray()\n- * Date: SRE, Tue Jun 1 14:47:14 1999 [St. Louis]\n- *\n- * Purpose: Convenience functions for free\'ing 2D\n- * and 3D pointer arrays. Tolerates any of the\n- * pointers being NULL, to allow "sparse" \n- * arrays.\n- *\n- * Args: p - array to be freed\n- * dim1 - n for first dimension\n- * dim2 - n for second dimension\n- *\n- * e.g. a 2d array is indexed p[0..dim1-1][]\n- * a 3D array is indexed p[0..dim1-1][0..dim2-1][]\n- * \n- * Returns: void\n- * \n- * Diagnostics: (void)\n- * "never fails"\n- */\n-void\n-Free2DArray(void **p, int dim1)\n-{\n- int i;\n- \n- if (p != NULL) {\n- for (i = 0; i < dim1; i++)\n- if (p[i] != NULL) free(p[i]);\n- free(p);\n- }\n-}\n-void\n-Free3DArray(void ***p, int dim1, int dim2)\n-{\n- int i, j;\n-\n- if (p != NULL) {\n- for (i = 0; i < dim1; i++)\n- if (p[i] != NULL) {\n-\tfor (j = 0; j < dim2; j++)\n-'..b'ons:\n- * *s can\'t be a constant string, since we write to it.\n- * \n- * Example: \n- * char *tok;\n- * int len;\n- * char *s; \n- * char buf[50] = "This is a sentence.";\n- * \n- * s = buf; \n- * tok = sre_strtok(&s, " ", &len);\n- * tok is "This"; s is "is a sentence."; len is 4.\n- * tok = sre_strtok(&s, " ", &len);\n- * tok is "is"; s is " a sentence."; len is 2.\n- * tok = sre_strtok(&s, " ", &len);\n- * tok is "a"; s is "sentence."; len is 1.\n- * tok = sre_strtok(&s, " ", &len);\n- * tok is "sentence."; s is "\\0"; len is 9.\n- * tok = sre_strtok(&s, " ", &len);\n- * tok is NULL; s is "\\0", len is undefined.\n- * \n- * Args: s - a tmp, modifiable ptr to string\n- * delim - characters that delimits tokens\n- * len - RETURN: length of token; pass NULL if not wanted\n- *\n- * Returns: ptr to next token, or NULL if there aren\'t any.\n- */\n-char *\n-sre_strtok(char **s, char *delim, int *len)\n-{\n- char *begin, *end;\n- int n;\n-\n- begin = *s;\n- begin += strspn(begin, delim);\n- if (! *begin) return NULL;\n-\n- n = strcspn(begin, delim);\n- end = begin + n;\n- if (*end == \'\\0\') { *s = end;}\n- else {\n- *end = \'\\0\';\n- *s = end+1;\n- }\n-\n- if (len != NULL) *len = n;\n- return begin;\n-}\n-\n-\n-\n-/* Function: sre_strdup()\n- * Date: SRE, Wed May 19 17:57:28 1999 [St. Louis]\n- *\n- * Purpose: A version of the common but non-ANSI strdup()\n- * function. Can pass len, if known, to save a\n- * strlen() call.\n- *\n- * Args: s - string to duplicate\n- * n - length of string, if known; -1 if unknown.\n- * \n- * Returns: allocated copy of string.\n- * NULL on failure.\n- */\n-char *\n-sre_strdup(char *s, int n)\n-{\n- char *new;\n-\n- if (s == NULL) return NULL;\n- if (n < 0) n = strlen(s);\n- new = MallocOrDie (sizeof(char) * (n+1));\n- strcpy(new, s);\n- return new;\n-}\n-\n-\n-/* Function: sre_strncpy()\n- * Date: SRE, Tue Jun 22 10:10:46 1999 [Sanger Centre]\n- *\n- * Purpose: a strncpy() that makes sure it adds a trailing \\0.\n- *\n- * Args: s1 - string to copy to (allocated n+1 or larger)\n- * s2 - string to copy from\n- * n - number of chars to copy \n- *\n- * Returns: s1. \n- * Done only for consistency with strncpy(). Not clear\n- * why it\'s useful for a strncpy() to return s1.\n- */\n-char *\n-sre_strncpy(char *s1, char *s2, int n)\n-{\n- strncpy(s1,s2,n);\n- s1[n] = \'\\0\';\n- return s1;\n-}\n-\n-/* Function: IsBlankline()\n- * Date: SRE, Fri Jun 18 14:36:08 1999 [St. Louis]\n- *\n- * Purpose: Returns TRUE if string consists solely of whitespace.\n- *\n- * Args: s - string to check\n- */\n-int\n-IsBlankline(char *s)\n-{\n- for (; *s != \'\\0\'; s++)\n- if (! isspace(*s)) return FALSE;\n- return TRUE;\n-}\n-\n-\n-\n-#ifdef CUBS_WIN\n-/* A timing test for sre_strcat()\n- * cc -O2 -g sre_string.c sre_ctype.c sqerror.c sre_math.c hsregex.c -lm \n- * 15.200u - 5.360u = 9.84u if sre_strcat() with no length info passed\n- * 13.660u - 5.360u = 8.30u if strcat(), with a single malloc().\n- * 11.370u - 5.360u = 6.01u if sre_strcat() with length info passed.\n- */\n-int main(void)\n-{\n- float p[4] = {0.25, 0.25, 0.25, 0.25};\n- int buflen;\n- int len;\n- int nappends;\n- int nstrings;\n- char *s1 = NULL;\n- char *s2;\n- int i;\n-\n- nappends = 100;\n- nstrings = 1000;\n- while (nstrings--)\n- {\n- /* s1 = malloc(sizeof(char) * (255*nappends+1));\n-\t s1[0] = \'\\0\';\n- */\n-\n- s1 = NULL;\n- len = 0;\n- for (i = 0; i < nappends; i++)\n-\t{\n-\t buflen = CHOOSE(255) + 1;\n-\t s2 = RandomSequence("ACGT", p, 4, buflen);\n- \n-\t /* strcat(s1,s2); */\n-\t if ((len = sre_strcat(&s1, len, s2, buflen)) < 0) exit(1); \n-\t free(s2);\n-\t}\n- free(s1); \n- }\n- exit(0);\n-}\n-#endif /*CUBS_WIN*/\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/squid/ssi.c --- a/clustalomega/clustal-omega-0.2.0/src/squid/ssi.c Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,1537 +0,0 @@\n-/*****************************************************************\n- * SQUID - a library of functions for biological sequence analysis\n- * Copyright (C) 1992-2002 Washington University School of Medicine\n- * \n- * This source code is freely distributed under the terms of the\n- * GNU General Public License. See the files COPYRIGHT and LICENSE\n- * for details.\n- *****************************************************************/\n-\n-#include <stdio.h>\n-#include <stdlib.h>\n-#include <string.h>\n-#include <sys/stat.h>\n-#include <sys/types.h>\n-#include <unistd.h>\n-#include "squid.h"\n-#include "ssi.h"\n-#ifdef CLUSTALO\n-#include <limits.h>\n-#endif\n-\n-static sqd_uint32 v20magic = 0xf3f3e9b1; /* SSI 1.0: "ssi1" + 0x80808080 */\n-static sqd_uint32 v20swap = 0xb1e9f3f3; /* byteswapped */\n-\n-static int read_i16(FILE *fp, sqd_uint16 *ret_result);\n-static int read_i32(FILE *fp, sqd_uint32 *ret_result);\n-static int read_i64(FILE *fp, sqd_uint64 *ret_result);\n-static int read_offset(FILE *fp, char mode, SSIOFFSET *ret_offset);\n-static int write_i16(FILE *fp, sqd_uint16 n);\n-static int write_i32(FILE *fp, sqd_uint32 n);\n-static int write_i64(FILE *fp, sqd_uint64 n);\n-static int write_offset(FILE *fp, SSIOFFSET *offset);\n-static int binary_search(SSIFILE *sfp, char *key, int klen, SSIOFFSET *base, \n-\t\t\t sqd_uint32 recsize, sqd_uint32 maxidx);\n-static int indexfile_position(SSIFILE *sfp, SSIOFFSET *base, sqd_uint32 len,\n-\t\t\t sqd_uint32 n);\n-static void clear_ssifile(SSIFILE *sfp);\n-static sqd_uint64 current_index_size(SSIINDEX *g);\n-static int activate_external_sort(SSIINDEX *g);\n-static int load_indexfile(SSIFILE *sfp);\n-static int parse_pkey_info(char *buf, char mode, struct ssipkey_s *pkey);\n-static int parse_skey_info(char *buf, struct ssiskey_s *skey);\n-\n-/* Function: SSIOpen()\n- * Date: SRE, Sun Dec 31 12:40:03 2000 [St. Louis]\n- *\n- * Purpose: Opens the SSI index file {filename} and returns\n- * a SSIFILE * stream thru {ret_sfp}.\n- * The caller must eventually close this stream using\n- * SSIClose(). More than one index file can be open\n- * at once.\n- *\n- * Args: filename - full path to a SSI index file\n- *\n- * Returns: Returns 0 on success, nonzero on failure.\n- */\n-int\n-SSIOpen(char *filename, SSIFILE **ret_sfp)\n-{\n- SSIFILE *sfp = NULL;\n- int status;\n- if ((sfp = malloc(sizeof(SSIFILE))) == NULL) return SSI_ERR_MALLOC;\n- if ((sfp->fp = fopen(filename, "rb")) == NULL) {\n- free(sfp);\n- return SSI_ERR_NOFILE; \n- }\n- status = load_indexfile(sfp);\n- *ret_sfp = sfp;\n- return status;\n-}\n-/* load_indexfile(): given a SSIFILE structure with an open and positioned \n- * stream (fp) -- but no other data loaded -- read the next SSIFILE\n- * in from disk. We use this routine without its SSIOpen() wrapper\n- * as part of the external mergesort when creating large indices.\n- */\n-static int\n-load_indexfile(SSIFILE *sfp)\n-{\n- sqd_uint32 magic;\n- sqd_uint16 i;\t\t/* counter over files */\n- int status;\t\t/* overall return status if an error is thrown */\n-\n- status = SSI_ERR_BADFORMAT; /* default: almost every kind of error is a bad format error */\n-\n- sfp->filename = NULL;\n- sfp->fileformat = NULL;\n- sfp->fileflags = NULL;\n- sfp->bpl = NULL;\n- sfp->rpl = NULL;\n- sfp->nfiles = 0; \n- if (! read_i32(sfp->fp, &magic)) {status = SSI_ERR_BADMAGIC; goto FAILURE; }\n- if (magic != v20magic && magic != v20swap) {status = SSI_ERR_BADMAGIC; goto FAILURE; }\n- if (! read_i32(sfp->fp, &(sfp->flags))) goto FAILURE; \n-\n- /* If we have 64-bit offsets, make sure we can deal with them.\n- */\n-#ifndef HAS_64BIT_FILE_OFFSETS \n- if ((sfp->flags & SSI_USE64_INDEX) ||\n- (sfp->flags & SSI_USE64))\n- { status = SSI_ERR_NO64BIT; goto FAILURE; }\n-#endif\n-\n- sfp->imode = (sfp->flags & SSI_USE64_INDEX) ? SSI_OFFSET_I64 : SSI_OFFSET_I32;\n- sfp->smode = (sfp->fla'..b'>skeys); \n- g->pkeys = NULL;\n- g->skeys = NULL;\n-\n- /* Turn control over to external accumulation mode.\n- */\n- g->external = TRUE;\n- return 0;\n-}\n-\n-\n-/*****************************************************************\n- * Debugging API\n- *****************************************************************/\n-void\n-SSIForceExternalSort(SSIINDEX *g)\n-{\n- if (activate_external_sort(g) != 0)\n- Die("failed to turn external sorting on.");\n-}\n-\n-\n-/*****************************************************************\n- * Test driving mode\n- *****************************************************************/\n-#ifdef MUGGINS_LETS_ME_SLEEP \n-/* Minimally: \n- cc -g -Wall -o shiva -DDEBUGLEVEL=1 -DMUGGINS_LETS_ME_SLEEP ssi.c sqerror.c sre_string.c types.c sre_ctype.c sre_math.c file.c -lm \n-*/\n-\n-int\n-main(int argc, char **argv)\n-{\n- char name[32], accession[32];\n- SSIINDEX *ssi;\n- int mode;\n- SSIOFFSET r_off, d_off;\n- FILE *ofp;\n- int i;\n- int fh;\t\t\t/* a file handle */\n- int status;\t\t/* return status from a SSI call */\n- \n- mode = SSI_OFFSET_I32;\n- if ((ssi = SSICreateIndex(mode)) == NULL)\n- Die("Failed to allocate SSI index");\n-\n- /* Generate two FASTA files, tmp.0 and tmp.1, and index them.\n- */\n- if ((ofp = fopen("tmp.0", "w")) == NULL) \n- Die("failed to open tmp.0");\n- if ((status = SSIAddFileToIndex(ssi, "tmp.0", SQFILE_FASTA, &fh)) != 0)\n- Die("SSIAddFileToIndex() failed: %s", SSIErrorString(status));\n- for (i = 0; i < 10; i++) {\n- if ((status = SSIGetFilePosition(ofp, mode, &r_off)) != 0)\n- Die("SSIGetFilePosition() failed: %s", SSIErrorString(status));\n- sprintf(name, "seq%d", i);\n- sprintf(accession, "ac%d", i);\n- fprintf(ofp, ">%s [%s] Description? we don\'t need no steenking description.\\n", \n-\t name, accession);\n- if ((status = SSIGetFilePosition(ofp, mode, &d_off)) != 0) \n- Die("SSIGetFilePosition() failed: %s", SSIErrorString(status));\n- fprintf(ofp, "AAAAAAAAAA\\n");\n- fprintf(ofp, "CCCCCCCCCC\\n");\n- fprintf(ofp, "GGGGGGGGGG\\n");\n- fprintf(ofp, "TTTTTTTTTT\\n");\n-\n- if ((status = SSIAddPrimaryKeyToIndex(ssi, name, fh, &r_off, &d_off, 40)) != 0)\n- Die("SSIAddPrimaryKeyToIndex() failed: %s", SSIErrorString(status));\n- if ((status = SSIAddSecondaryKeyToIndex(ssi, accession, name)) != 0)\n- Die("SSIAddSecondaryKeyToIndex() failed: %s", SSIErrorString(status));\n- }\n- SSISetFileForSubseq(ssi, fh, 11, 10);\n- fclose(ofp);\n- \n- if ((ofp = fopen("tmp.1", "w")) == NULL) \n- Die("failed to open tmp.1");\n- if ((status = SSIAddFileToIndex(ssi, "tmp.1", SQFILE_FASTA, &fh)) != 0)\n- Die("SSIAddFileToIndex() failed: %s", SSIErrorString(status));\n- for (i = 10; i < 20; i++) {\n- if ((status = SSIGetFilePosition(ofp, mode, &r_off)) != 0)\n- Die("SSIGetFilePosition() failed: %s", SSIErrorString(status));\n- sprintf(name, "seq%d", i);\n- sprintf(accession, "ac%d", i);\n- fprintf(ofp, ">%s [%s] i/o, i/o, it\'s off to disk we go.\\n", \n-\t name, accession);\n- if ((status = SSIGetFilePosition(ofp, mode, &d_off)) != 0)\n- Die("SSIGetFilePosition() failed: %s", SSIErrorString(status));\n- fprintf(ofp, "AAAAAAAAAA 10\\n");\n- fprintf(ofp, "CCCCCCCCCC 20\\n");\n- fprintf(ofp, "GGGGGGGGGG 30\\n");\n- fprintf(ofp, "TTTTTTTTTT 40\\n");\n-\n- if ((status = SSIAddPrimaryKeyToIndex(ssi, name, fh, &r_off, &d_off, 40)) != 0)\n- Die("SSIAddPrimaryKeyToIndex() failed: %s", SSIErrorString(status));\n- if ((status = SSIAddSecondaryKeyToIndex(ssi, accession, name)) != 0)\n- Die("SSIAddSecondaryKeyToIndex() failed: %s", SSIErrorString(status));\n- }\n- SSISetFileForSubseq(ssi, fh, 14, 10);\n- fclose(ofp);\n- \n- /* Write the index to tmp.ssi\n- */ \n- if ((status = SSIWriteIndex("tmp.ssi", ssi)) != 0) \n- Die("SSIWriteIndex() failed: %s", SSIErrorString(status));\n- SSIFreeIndex(ssi);\n-\n- /* Now reopen the index and run some tests.\n- */\n- exit(0);\n-}\n-\n-\n-#endif /* test driving code */\n-\n-\n-\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/squid/ssi.h --- a/clustalomega/clustal-omega-0.2.0/src/squid/ssi.h Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,189 +0,0 @@ -/***************************************************************** - * SQUID - a library of functions for biological sequence analysis - * Copyright (C) 1992-2002 Washington University School of Medicine - * - * This source code is freely distributed under the terms of the - * GNU General Public License. See the files COPYRIGHT and LICENSE - * for details. - *****************************************************************/ - -#ifndef SSIH_INCLUDED -#define SSIH_INCLUDED - -/* ssi.h - * Database indexing (SSI format support) - * CVS $Id: ssi.h,v 1.7 2002/02/24 19:39:27 eddy Exp) - * - * See: ssi_format.tex in Docs/ - */ - -#include <stdio.h> -#include "squid.h" - -/* Limits - */ -#define SSI_MAXFILES 32767 /* 2^15-1 */ -#define SSI_MAXKEYS 2147483647L /* 2^31-1 */ -#define SSI_MAXRAM 200 /* allow 200MB indexes before external sort mode */ - -/* typedef: SSIOFFSET - * Use the union to save space, since the two offset types are - * mutually exclusive, controlled by "mode" - */ -struct ssioffset_s { - char mode; /* GSI_OFFSET_I32, for example */ - union { - sqd_uint32 i32; /* an offset that fseek() can use */ - sqd_uint64 i64; /* an offset that e.g. fseeko64() can use */ - } off; -}; -typedef struct ssioffset_s SSIOFFSET; -#define SSI_OFFSET_I32 0 -#define SSI_OFFSET_I64 1 - -/* Structure: SSIFILE - * xref: SSI API documentation in ssi-format.tex - */ -struct ssifile_s { - FILE *fp; /* open SSI index file */ - sqd_uint32 flags; /* optional behavior flags */ - sqd_uint16 nfiles; /* number of files = 16 bit int */ - sqd_uint32 nprimary; /* number of primary keys */ - sqd_uint32 nsecondary; /* number of secondary keys */ - sqd_uint32 flen; /* length of filenames (inc '\0') */ - sqd_uint32 plen; /* length of primary keys (inc '\0') */ - sqd_uint32 slen; /* length of secondary keys (inc '\0') */ - sqd_uint32 frecsize; /* # bytes in a file record */ - sqd_uint32 precsize; /* # bytes in a primary key record */ - sqd_uint32 srecsize; /* # bytes in a secondary key record */ - SSIOFFSET foffset; /* disk offset, start of file records */ - SSIOFFSET poffset; /* disk offset, start of pri key recs */ - SSIOFFSET soffset; /* disk offset, start of sec key recs */ - - char imode; /* mode for index file offsets, 32 v. 64 bit */ - char smode; /* mode for sequence file offsets, 32 v. 64 bit */ - - /* File information: - */ - char **filename; /* list of file names [0..nfiles-1] */ - sqd_uint32 *fileformat; /* file formats */ - sqd_uint32 *fileflags; /* optional per-file behavior flags */ - sqd_uint32 *bpl; /* bytes per line in file */ - sqd_uint32 *rpl; /* residues per line in file */ -}; -typedef struct ssifile_s SSIFILE; - -/* optional per-index behavior flags in SSIFILE structure's flags: - */ -#define SSI_USE64 1<<0 /* seq offsets are 64-bit */ -#define SSI_USE64_INDEX 1<<1 /* index file offsets are 64-bit */ - -/* optional per-file behavior flags in fileflags - */ -#define SSI_FAST_SUBSEQ 1<<0 /* can do subseq lookup in this file */ - -/* Structure: SSIINDEX - * - * Used when building up an index and writing it to disk - */ -struct ssipkey_s { /* Primary key data: */ - char *key; /* key name */ - sqd_uint16 fnum; /* file number */ - SSIOFFSET r_off; /* record offset */ - SSIOFFSET d_off; /* data offset */ - sqd_uint32 len; /* sequence length */ -}; -struct ssiskey_s { /* Secondary key data: */ - char *key; /* secondary key name */ - char *pkey; /* primary key name */ -}; -struct ssiindex_s { - int smode; /* sequence mode: SSI_OFFSET_I32 or _I64 */ - int imode; /* index mode: SSI_OFFSET_I32 or _I64 */ - int external; /* TRUE if pkeys and skeys are on disk */ - int max_ram; /* maximum RAM in MB before switching to external */ - - char **filenames; - sqd_uint32 *fileformat; - sqd_uint32 *bpl; - sqd_uint32 *rpl; - sqd_uint32 flen; /* length of longest filename, inc '\0' */ - sqd_uint16 nfiles; - - struct ssipkey_s *pkeys; - sqd_uint32 plen; /* length of longest pkey, including '\0' */ - sqd_uint32 nprimary; - char *ptmpfile; /* name of tmp file, for external sort mode */ - FILE *ptmp; /* handle on open ptmpfile */ - - struct ssiskey_s *skeys; - sqd_uint32 slen; /* length of longest skey, including '\0' */ - sqd_uint32 nsecondary; - char *stmpfile; /* name of tmp file, for external sort mode */ - FILE *stmp; /* handle on open ptmpfile */ -}; -typedef struct ssiindex_s SSIINDEX; - -/* These control malloc and realloc chunk sizes in the index - * construction code. - */ -#define SSI_FILE_BLOCK 10 -#define SSI_KEY_BLOCK 100 - -/* Error codes set by the API - */ -#define SSI_ERR_OK 0 -#define SSI_ERR_NODATA 1 /* no data? an fread() failed */ -#define SSI_ERR_NO_SUCH_KEY 2 /* that key's not in the index */ -#define SSI_ERR_MALLOC 3 -#define SSI_ERR_NOFILE 4 /* no such file? an fopen() failed */ -#define SSI_ERR_BADMAGIC 5 /* magic number mismatch in GSIOpen() */ -#define SSI_ERR_BADFORMAT 6 /* didn't read what I expected to fread() */ -#define SSI_ERR_NO64BIT 7 /* needed 64-bit support and didn't have it */ -#define SSI_ERR_SEEK_FAILED 8 /* an fseek() (or similar) failed */ -#define SSI_ERR_TELL_FAILED 9 /* an ftell() (or similar) failed */ -#define SSI_ERR_NO_SUBSEQS 10 /* fast subseq is disallowed */ -#define SSI_ERR_RANGE 11 /* subseq requested is out of range */ -#define SSI_ERR_BADARG 12 /* something wrong with a function argument */ -#define SSI_ERR_TOOMANY_FILES 13 /* ran out of range for files in an index */ -#define SSI_ERR_TOOMANY_KEYS 14 /* ran out of range for keys in an index */ -#define SSI_ERR_FWRITE 15 -#define SSI_ERR_EXTERNAL_SORT 16 /* external sort failed */ - -/* The SSI file reading API: - */ -extern int SSIOpen(char *filename, SSIFILE **ret_sfp); -extern int SSIGetOffsetByName(SSIFILE *sfp, char *key, int *ret_fh, - SSIOFFSET *ret_offset); -extern int SSIGetOffsetByNumber(SSIFILE *sfp, int n, int *ret_fh, - SSIOFFSET *ret_offset); -extern int SSIGetSubseqOffset(SSIFILE *sfp, char *key, int requested_start, - int *ret_fh, SSIOFFSET *record_offset, - SSIOFFSET *data_offset, int *ret_actual_start); -extern int SSISetFilePosition(FILE *fp, SSIOFFSET *offset); -extern int SSIFileInfo(SSIFILE *sfp, int fh, char **ret_filename, int *ret_format); -extern void SSIClose(SSIFILE *sfp); - -/* The SSI index file writing API: - */ -extern int SSIRecommendMode(char *file); -extern SSIINDEX *SSICreateIndex(int mode); -extern int SSIGetFilePosition(FILE *fp, int mode, SSIOFFSET *ret_offset); -extern int SSIAddFileToIndex(SSIINDEX *g, char *filename, int fmt, int *ret_fh); -extern int SSISetFileForSubseq(SSIINDEX *g, int fh, int bpl, int rpl); -extern int SSIAddPrimaryKeyToIndex(SSIINDEX *g, char *key, int fh, - SSIOFFSET *r_off, SSIOFFSET *d_off, - int L); -extern int SSIAddSecondaryKeyToIndex(SSIINDEX *g, char *key, char *pkey); -extern int SSIWriteIndex(char *file, SSIINDEX *g); -extern void SSIFreeIndex(SSIINDEX *g); - -/* The SSI misc. functions API: - */ -extern char *SSIErrorString(int n); - -/* The SSI debugging API: - */ -extern void SSIForceExternalSort(SSIINDEX *g); - -#endif /*SSIH_INCLUDED*/ |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/squid/stack.c --- a/clustalomega/clustal-omega-0.2.0/src/squid/stack.c Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,102 +0,0 @@ -/***************************************************************** - * SQUID - a library of functions for biological sequence analysis - * Copyright (C) 1992-2002 Washington University School of Medicine - * - * This source code is freely distributed under the terms of the - * GNU General Public License. See the files COPYRIGHT and LICENSE - * for details. - *****************************************************************/ - -/* stack.c - * SRE, Thu Mar 3 10:08:48 1994 - * - * Implementation of generic stack structures. - * RCS $Id: stack.c 217 2011-03-19 10:27:10Z andreas $ (Original squid RCS Id: stack.c,v 1.2 1998/10/09 18:07:16 eddy Exp) - */ - -#include <stdlib.h> -#include "squid.h" - -#ifdef MEMDEBUG -#include "dbmalloc.h" -#endif - - -/************************************************************ - * intstack_s implementation. - * - * Functions: InitIntStack() - returns ptr to new stack - * PushIntStack() - (void) - * PopIntStack() - returns 1 on success, 0 if stack empty - * FreeIntStack() - returns number of elements free'd, or 0 if - * stack was empty. - * - * Implementation of the pushdown stack for storing single - * integers. - *************************************************************/ -struct intstack_s * -InitIntStack(void) -{ - struct intstack_s *stack; - - if ((stack = (struct intstack_s *) malloc (sizeof(struct intstack_s))) == NULL) - Die("Memory allocation failure at %s line %d", __FILE__, __LINE__); - stack->nxt = NULL; - return stack; -} -void -PushIntStack(struct intstack_s *stack, int data) -{ - struct intstack_s *new; - - if ((new = (struct intstack_s *) malloc (sizeof(struct intstack_s))) == NULL) - Die("Memory allocation failure at %s line %d", __FILE__, __LINE__); - new->data = data; - - new->nxt = stack->nxt; - stack->nxt = new; -} - -int -PopIntStack(struct intstack_s *stack, int *ret_data) -{ - struct intstack_s *old; - - if (stack->nxt == NULL) return 0; - - old = stack->nxt; - stack->nxt = old->nxt; - - *ret_data = old->data; - free(old); - return 1; -} - -void -ReverseIntStack(struct intstack_s *stack) -{ - struct intstack_s *old; - struct intstack_s *new; - - old = stack->nxt; - stack->nxt = NULL; - while (old != NULL) - { - new = old; /* remove one from top of old stack */ - old = old->nxt; - new->nxt = stack->nxt; /* push it onto new stack */ - stack->nxt = new; - } -} - -int -FreeIntStack( struct intstack_s *stack ) -{ - int data; - int count = 0; - - while (PopIntStack(stack, &data)) - count++; - free(stack); - return count; -} |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/squid/stockholm.c --- a/clustalomega/clustal-omega-0.2.0/src/squid/stockholm.c Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,627 +0,0 @@\n-/*****************************************************************\n- * SQUID - a library of functions for biological sequence analysis\n- * Copyright (C) 1992-2002 Washington University School of Medicine\n- * \n- * This source code is freely distributed under the terms of the\n- * GNU General Public License. See the files COPYRIGHT and LICENSE\n- * for details.\n- *****************************************************************/\n-\n-/* stockholm.c\n- * SRE, Fri May 28 15:46:41 1999\n- * \n- * Reading/writing of Stockholm format multiple sequence alignments.\n- * \n- * example of API:\n- * \n- * MSA *msa;\n- * FILE *fp; -- opened for write with fopen()\n- * MSAFILE *afp; -- opened for read with MSAFileOpen()\n- * \n- * while ((msa = ReadStockholm(afp)) != NULL)\n- * {\n- * WriteStockholm(fp, msa);\n- * MSAFree(msa);\n- * }\n- * \n- * RCS $Id: stockholm.c 217 2011-03-19 10:27:10Z andreas $ (Original squid RCS Id: stockholm.c,v 1.7 2002/10/12 04:40:36 eddy Exp)\n- */\n-#include <stdio.h>\n-#include <string.h>\n-#include "squid.h"\n-#include "msa.h"\n-\n-static int parse_gf(MSA *msa, char *buf);\n-static int parse_gs(MSA *msa, char *buf);\n-static int parse_gc(MSA *msa, char *buf);\n-static int parse_gr(MSA *msa, char *buf);\n-static int parse_comment(MSA *msa, char *buf);\n-static int parse_sequence(MSA *msa, char *buf);\n-static void actually_write_stockholm(FILE *fp, MSA *msa, int cpl);\n-\n-#ifdef TESTDRIVE_STOCKHOLM\n-/*****************************************************************\n- * stockholm.c test driver: \n- * cc -DTESTDRIVE_STOCKHOLM -g -O2 -Wall -o test stockholm.c msa.c gki.c sqerror.c sre_string.c file.c hsregex.c sre_math.c sre_ctype.c -lm \n- * \n- */\n-int\n-main(int argc, char **argv)\n-{\n- MSAFILE *afp;\n- MSA *msa;\n- char *file;\n- \n- file = argv[1];\n-\n- if ((afp = MSAFileOpen(file, MSAFILE_STOCKHOLM, NULL)) == NULL)\n- Die("Couldn\'t open %s\\n", file);\n-\n- while ((msa = ReadStockholm(afp)) != NULL)\n- {\n- WriteStockholm(stdout, msa);\n- MSAFree(msa); \n- }\n- \n- MSAFileClose(afp);\n- exit(0);\n-}\n-/******************************************************************/\n-#endif /* testdriver */\n-\n-\n-/* Function: ReadStockholm()\n- * Date: SRE, Fri May 21 17:33:10 1999 [St. Louis]\n- *\n- * Purpose: Parse the next alignment from an open Stockholm\n- * format alignment file. Return the alignment, or\n- * NULL if there are no more alignments in the file.\n- *\n- * Args: afp - open alignment file\n- *\n- * Returns: MSA * - an alignment object. \n- * caller responsible for an MSAFree() \n- * NULL if no more alignments\n- *\n- * Diagnostics:\n- * Will Die() here with a (potentially) useful message\n- * if a parsing error occurs \n- */\n-MSA *\n-ReadStockholm(MSAFILE *afp)\n-{\n- MSA *msa;\n- char *s;\n- int status;\n-\n- if (feof(afp->f)) return NULL;\n-\n- /* Initialize allocation of the MSA.\n- */\n- msa = MSAAlloc(10, 0);\n-\n- /* Check the magic Stockholm header line.\n- * We have to skip blank lines here, else we perceive\n- * trailing blank lines in a file as a format error when\n- * reading in multi-record mode.\n- */\n- do {\n- if ((s = MSAFileGetLine(afp)) == NULL) {\n- MSAFree(msa);\n- return NULL;\n- }\n- } while (IsBlankline(s));\n-\n- if (strncmp(s, "# STOCKHOLM 1.", 14) != 0)\n- Die("\\\n-File %s doesn\'t appear to be in Stockholm format.\\n\\\n-Assuming there isn\'t some other problem with your file (it is an\\n\\\n-alignment file, right?), please either:\\n\\\n- a) use the Babelfish format autotranslator option (-B, usually);\\n\\\n- b) specify the file\'s format with the --informat option; or\\n\\\n- a) reformat the alignment to Stockholm format.\\n", \n-\tafp->fname);\n-\n- /* Read the alignment file one line at a time.\n- */\n- while ((s = MSAFileGetLine(afp)) != NULL) \n- {\n- while (*s == \' \' || *s == \'\\t\') s++; /* skip leading whitespace */\n-\n- if (*s == \'#\') {\n-'..b'L)) == NULL) return 0;\n- while (*text && (*text == \' \' || *text == \'\\t\')) text++;\n- \n- /* GS usually follows another GS; guess lastidx+1\n- */\n- seqidx = MSAGetSeqidx(msa, seqname, msa->lastidx+1);\n- msa->lastidx = seqidx;\n-\n- if (strcmp(featurename, "WT") == 0)\n- {\n- msa->wgt[seqidx] = atof(text);\n- msa->flags |= MSA_SET_WGT;\n- }\n-\n- else if (strcmp(featurename, "AC") == 0)\n- MSASetSeqAccession(msa, seqidx, text);\n-\n- else if (strcmp(featurename, "DE") == 0)\n- MSASetSeqDescription(msa, seqidx, text);\n-\n- else\t\t\t\t\n- MSAAddGS(msa, featurename, seqidx, text);\n-\n- return 1;\n-}\n-\n-/* Format of a GC line:\n- * #=GC <featurename> <text>\n- */\n-static int \n-parse_gc(MSA *msa, char *buf)\n-{\n- char *gc;\n- char *featurename;\n- char *text; \n- char *s;\n- int len;\n-\n- s = buf;\n- if ((gc = sre_strtok(&s, WHITESPACE, NULL)) == NULL) return 0;\n- if ((featurename = sre_strtok(&s, WHITESPACE, NULL)) == NULL) return 0;\n- if ((text = sre_strtok(&s, WHITESPACE, &len)) == NULL) return 0;\n- \n- if (strcmp(featurename, "SS_cons") == 0)\n- sre_strcat(&(msa->ss_cons), -1, text, len);\n- else if (strcmp(featurename, "SA_cons") == 0)\n- sre_strcat(&(msa->sa_cons), -1, text, len);\n- else if (strcmp(featurename, "RF") == 0)\n- sre_strcat(&(msa->rf), -1, text, len);\n- else\n- MSAAppendGC(msa, featurename, text);\n-\n- return 1;\n-}\n-\n-/* Format of a GR line:\n- * #=GR <seqname> <featurename> <text>\n- */\n-static int\n-parse_gr(MSA *msa, char *buf)\n-{\n- char *gr;\n- char *seqname;\n- char *featurename;\n- char *text;\n- int seqidx;\n- int len;\n- int j;\n- char *s;\n-\n- s = buf;\n- if ((gr = sre_strtok(&s, WHITESPACE, NULL)) == NULL) return 0;\n- if ((seqname = sre_strtok(&s, WHITESPACE, NULL)) == NULL) return 0;\n- if ((featurename = sre_strtok(&s, WHITESPACE, NULL)) == NULL) return 0;\n- if ((text = sre_strtok(&s, WHITESPACE, &len)) == NULL) return 0;\n-\n- /* GR usually follows sequence it refers to; guess msa->lastidx */\n- seqidx = MSAGetSeqidx(msa, seqname, msa->lastidx);\n- msa->lastidx = seqidx;\n-\n- if (strcmp(featurename, "SS") == 0) \n- {\n- if (msa->ss == NULL)\n-\t{\n-\t msa->ss = MallocOrDie(sizeof(char *) * msa->nseqalloc);\n-\t msa->sslen = MallocOrDie(sizeof(int) * msa->nseqalloc);\n-\t for (j = 0; j < msa->nseqalloc; j++)\n-\t {\n-\t msa->ss[j] = NULL;\n-\t msa->sslen[j] = 0;\n-\t }\n-\t}\n- msa->sslen[seqidx] = sre_strcat(&(msa->ss[seqidx]), msa->sslen[seqidx], text, len);\n- }\n- else if (strcmp(featurename, "SA") == 0)\n- {\n- if (msa->sa == NULL)\n-\t{\n-\t msa->sa = MallocOrDie(sizeof(char *) * msa->nseqalloc);\n-\t msa->salen = MallocOrDie(sizeof(int) * msa->nseqalloc);\n-\t for (j = 0; j < msa->nseqalloc; j++) \n-\t {\n-\t msa->sa[j] = NULL;\n-\t msa->salen[j] = 0;\n-\t }\n-\t}\n- msa->salen[seqidx] = sre_strcat(&(msa->sa[seqidx]), msa->salen[seqidx], text, len);\n- }\n- else \n- MSAAppendGR(msa, featurename, seqidx, text);\n-\n- return 1;\n-}\n-\n-\n-/* comments are simply stored verbatim, not parsed\n- */\n-static int\n-parse_comment(MSA *msa, char *buf)\n-{\n- char *s;\n- char *comment;\n-\n- s = buf + 1;\t\t\t /* skip leading \'#\' */\n- if (*s == \'\\n\') { *s = \'\\0\'; comment = s; } /* deal with blank comment */\n- else if ((comment = sre_strtok(&s, "\\n", NULL)) == NULL) return 0;\n- \n- MSAAddComment(msa, comment);\n- return 1;\n-}\n-\n-static int\n-parse_sequence(MSA *msa, char *buf)\n-{\n- char *s;\n- char *seqname;\n- char *text;\n- int seqidx;\n- int len;\n-\n- s = buf;\n- if ((seqname = sre_strtok(&s, WHITESPACE, NULL)) == NULL) return 0;\n- if ((text = sre_strtok(&s, WHITESPACE, &len)) == NULL) return 0; \n- \n- /* seq usually follows another seq; guess msa->lastidx +1 */\n- seqidx = MSAGetSeqidx(msa, seqname, msa->lastidx+1);\n- msa->lastidx = seqidx;\n-\n- msa->sqlen[seqidx] = sre_strcat(&(msa->aseq[seqidx]), msa->sqlen[seqidx], text, len);\n- return 1;\n-}\n-\n-\n-\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/squid/stockholm.h --- a/clustalomega/clustal-omega-0.2.0/src/squid/stockholm.h Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,51 +0,0 @@ -#ifndef STOCKHOLM_H_INCLUDED -#define STOCKHOLM_H_INCLUDED - -#include "gki.h" - -typedef struct { - int *linetype; /* e.g. STOCKHOLM_GF_LINE; always valid */ - int *featurecode; /* all markup codes: e.g. STOCKHOLM_GF_ID; - nonmarkup: always set to STOCKHOLM_UNPARSED */ - char **featurename; /* all unparsed markup codes: string, e.g. "ID"; - all other lines: NULL */ - int *seqidx; /* all GS, GR, GC, sequence lines: which sequence; - other lines: 0 */ - int *len; /* all GR, GC, sequence lines: length of text field; - other lines: 0 */ - char **text; /* all unparsed nonblank lines: rest of data - other lines: NULL */ - int nseqalloc; /* current nseqs allocated for in aseqs and ainfo */ - int nlines; /* number of lines in this skel */ - int nlinealloc; /* current # of lines allocated for in this skel */ - int overall_line; /* line # in file (important in files w/ >1 ali)*/ -} alifile_skeleton; - -#define STOCKHOLM_GF_LINE 0 -#define STOCKHOLM_GS_LINE 1 -#define STOCKHOLM_GC_LINE 2 -#define STOCKHOLM_GR_LINE 3 -#define STOCKHOLM_SEQ_LINE 4 -#define STOCKHOLM_BLANK_LINE 5 -#define STOCKHOLM_COMMENT_LINE 6 - -#define STOCKHOLM_UNPARSED 0 -#define STOCKHOLM_GF_ID 1 -#define STOCKHOLM_GF_AC 2 -#define STOCKHOLM_GF_DE 3 -#define STOCKHOLM_GF_AU 4 -#define STOCKHOLM_GF_GA 5 -#define STOCKHOLM_GF_NC 6 -#define STOCKHOLM_GF_TC 7 -#define STOCKHOLM_GS_WT 100 -#define STOCKHOLM_GS_AC 101 -#define STOCKHOLM_GS_DE 102 -#define STOCKHOLM_GC_CS 200 -#define STOCKHOLM_GC_RF 201 -#define STOCKHOLM_GR_SS 300 -#define STOCKHOLM_GR_SA 301 - -#define SKEL_NSEQLUMP 10 /* allocate for new seqs in blocks of this size */ -#define SKEL_LUMPSIZE 100 /* allocate for new lines in skel in blocks of this size */ - -#endif /*STOCKHOLM_H_INCLUDED*/ |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/squid/stopwatch.c --- a/clustalomega/clustal-omega-0.2.0/src/squid/stopwatch.c Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,306 +0,0 @@\n-/************************************************************\n- * SQUID - a library of functions for biological sequence analysis\n- * Copyright (C) 1992-2002 Washington University School of Medicine\n- * \n- * This source code is freely distributed under the terms of the\n- * GNU General Public License. See the files COPYRIGHT and LICENSE\n- * for details.\n- ************************************************************/\n-\n-/* stopwatch.c\n- * SRE, Fri Nov 26 14:54:21 1999 [St. Louis] [HMMER]\n- * SRE, Thu Aug 3 08:11:52 2000 [St. Louis] [moved to SQUID]\n- * \n- * Reporting of cpu/system/elapsed time used by a process.\n- * thanks to Warren Gish for assistance.\n- * \n- * Basic API:\n- * \n- * Stopwatch_t *w;\n- * w = StopwatchCreate();\n- * \n- * StopwatchStart(w);\n- * do_lots_of_stuff;\n- * StopwatchStop(w);\n- * StopwatchDisplay(stdout, "CPU time: ", w);\n- * \n- * StopwatchFree(w);\n- * \n- * Some behavior can be controlled at compile time by #define\'s:\n- * \n- * SRE_STRICT_ANSI: By default, stopwatch module assumes that a\n- * machine is POSIX-compliant (e.g. has struct tms, sys/times.h, \n- * and times()). If compiled with -DSRE_STRICT_ANSI, reverts to \n- * pure ANSI C conformant implementation. This simpler system \n- * won\'t report system times, only user and elapsed times.\n- * \n- * SRE_ENABLE_PVM: If compiled with -DSRE_ENABLE_PVM, the\n- * functions StopwatchPVMPack() and StopwatchPVMUnpack()\n- * are compiled, providing PVM communications ability.\n- * \n- * One additional compile-time configuration note: \n- * PTHREAD_TIMES_HACK: Linux pthreads, as of RH6.0/glibc-devel-2.1.1-6, \n- * appears to interact poorly with times() -- usage times in all \n- * but the master thread are lost. A workaround for this bug is \n- * to run stopwatches in each worker thread, and accumulate those \n- * times back into the master stopwatch using StopwatchInclude().\n- * (Just like a PVM implementation has to do.) In HMMER, this \n- * behavior is compiled in with -DPTHREAD_TIMES_HACK. No\n- * changes are made in stopwatch functions themselves, though;\n- * all the extra code is HMMER code. See hmmcalibrate.c for\n- * an example.\n- * \n- * See hmmcalibrate.c for examples of more complex usage\n- * in dealing with pthreads and PVM.\n- */\n-\n-#include <stdio.h>\n-#include <stdlib.h>\n-#include <unistd.h>\n-#ifdef SRE_ENABLE_PVM\n-#include <pvm3.h>\n-#endif\n-\n-#include "stopwatch.h"\n-\n-/* Function: format_time_string()\n- * Date: SRE, Fri Nov 26 15:06:28 1999 [St. Louis]\n- *\n- * Purpose: Given a number of seconds, format into\n- * hh:mm:ss.xx in a provided buffer.\n- *\n- * Args: buf - allocated space (128 is plenty!)\n- * sec - number of seconds\n- * do_frac - TRUE (1) to include hundredths of a sec\n- */\n-static void\n-format_time_string(char *buf, double sec, int do_frac)\n-{\n- int h, m, s, hs;\n- \n- h = (int) (sec / 3600.);\n- m = (int) (sec / 60.) - h * 60;\n- s = (int) (sec) - h * 3600 - m * 60;\n- if (do_frac) {\n- hs = (int) (sec * 100.) - h * 360000 - m * 6000 - s * 100;\n- sprintf(buf, "%02d:%02d:%02d.%02d", h,m,s,hs);\n- } else {\n- sprintf(buf, "%02d:%02d:%02d", h,m,s);\n- }\n-}\n-\n-/* Function: StopwatchStart()\n- * Date: SRE, Fri Nov 26 15:07:48 1999 [St. Louis]\n- *\n- * Purpose: Start a stopwatch.\n- *\n- * Args: w - the watch\n- */\n-void\n-StopwatchStart(Stopwatch_t *w)\n-{\n- w->t0 = time(NULL);\n-#ifdef SRE_STRICT_ANSI\n- w->cpu0 = clock();\n-#else\n- (void) times(&(w->cpu0));\n-#endif\n-\n- w->elapsed = 0.;\n- w->user = 0.;\n- w->sys = 0.;\n-}\n-\n-/* Function: StopwatchStop()\n- * Date: SRE, Fri Nov 26 15:08:16 1999 [St. Louis]\n- *\n- * Purpose: Stop a stopwatch. \n- *\n- * The implementation allows "split times":\n- * you can stop a watch multiple times, reporting\n- * times at multiple poi'..b'>sys = (double) (cpu1.tms_stime + cpu1.tms_cstime -\n-\t\t w->cpu0.tms_stime - w->cpu0.tms_cstime) /\n- (double) clk_tck;\n-#endif\n-}\n-\n-/* Function: StopwatchInclude()\n- * Date: SRE, Fri Nov 26 15:09:34 1999 [St. Louis]\n- *\n- * Purpose: Merge the cpu and system times from a slave into\n- * a master stopwatch. Both watches must be\n- * stopped, and should not be stopped again unless\n- * You Know What You\'re Doing.\n- * \n- * Elapsed time is *not* merged; master is assumed\n- * to be keeping track of the wall clock time,\n- * and the slave/worker watch is ignored.\n- * \n- * Used in two cases:\n- * 1) PVM; merge in the stopwatch(es) from separate\n- * process(es) in a cluster.\n- * 2) Threads, for broken pthreads/times() implementations\n- * that lose track of cpu times used by spawned\n- * threads.\n- * \n- * Args: w1 - the master stopwatch\n- * w2 - the slave/worker watch\n- *\n- */\n-void\n-StopwatchInclude(Stopwatch_t *w1, Stopwatch_t *w2)\n-{\n- w1->user += w2->user;\n- w1->sys += w2->sys;\n-}\n-\n-/* Function: StopwatchAlloc(), StopwatchZero(), StopwatchCopy(), \n- * StopwatchFree()\n- * Date: SRE, Fri Nov 26 15:13:14 1999 [St. Louis]\n- *\n- * Purpose: The usual creation/manipulation/destruction routines\n- * for a stopwatch object.\n- */\n-Stopwatch_t *\n-StopwatchCreate(void)\n-{\n- Stopwatch_t *w;\n- w = malloc(sizeof(Stopwatch_t));\n- return w;\n-}\n-void\n-StopwatchZero(Stopwatch_t *w)\n-{\n- w->elapsed = 0.;\n- w->user = 0.;\n- w->sys = 0.;\n-}\n-void \n-StopwatchCopy(Stopwatch_t *w1, Stopwatch_t *w2)\n-{\n- w1->t0 = w2->t0;\n-#ifdef SRE_STRICT_ANSI\n- w1->cpu0 = w2->cpu0;\n-#else\n- w1->cpu0.tms_utime = w2->cpu0.tms_utime;\n- w1->cpu0.tms_stime = w2->cpu0.tms_stime;\n- w1->cpu0.tms_cutime = w2->cpu0.tms_cutime;\n- w1->cpu0.tms_cstime = w2->cpu0.tms_cstime;\n-#endif\n- w1->elapsed = w2->elapsed;\n- w1->user = w2->user;\n- w1->sys = w2->sys;\n-}\n-void\n-StopwatchFree(Stopwatch_t *w)\n-{\n- free(w);\n-}\n-\n-\n-/* Function: StopwatchDisplay()\n- * Date: SRE, Fri Nov 26 15:14:12 1999 [St. Louis]\n- *\n- * Purpose: Output a usage summary line from a *stopped*\n- * stopwatch (the times will reflect the last\n- * time StopwatchStop() was called.)\n- * \n- * For s = "CPU Time: " an example output line is:\n- * CPU Time: 142.55u 7.17s 149.72 Elapsed: 00:02:35.00\n- *\n- * Args: fp - open file for writing (stdout, possibly)\n- * s - prefix for the report line\n- * w - a (recently stopped) stopwatch \n- *\n- */\n-void\n-StopwatchDisplay(FILE *fp, char *s, Stopwatch_t *w)\n-{\n- char buf[128];\t/* (safely holds up to 10^14 years) */\n- \n- if (s == NULL)\n- fputs("CPU Time: ", fp);\n- else \n- fputs(s, fp);\n-\n- format_time_string(buf, w->user+w->sys, 1);\n-#ifdef SRE_STRICT_ANSI\n- fprintf(fp, "%.2fu %s ", w->user, buf);\n-#else\n- fprintf(fp, "%.2fu %.2fs %s ", w->user, w->sys, buf);\n-#endif\n-\n- format_time_string(buf, w->elapsed, 0);\n- fprintf(fp, "Elapsed: %s\\n", buf);\n-}\n- \n-#ifdef SRE_ENABLE_PVM\n-/* Function: StopwatchPVMPack(), StopwatchPVMUnpack()\n- * Date: SRE, Fri Nov 26 15:22:04 1999 [St. Louis]\n- *\n- * Purpose: Transmission of stopwatch data in a PVM\n- * cluster.\n- */\n-void\n-StopwatchPVMPack(Stopwatch_t *w)\n-{\n- pvm_pkdouble(&(w->elapsed), 1, 1);\n- pvm_pkdouble(&(w->user), 1, 1);\n- pvm_pkdouble(&(w->sys), 1, 1);\n-}\n-void\n-StopwatchPVMUnpack(Stopwatch_t *w)\n-{\n- pvm_upkdouble(&(w->elapsed), 1, 1);\n- pvm_upkdouble(&(w->user), 1, 1);\n- pvm_upkdouble(&(w->sys), 1, 1);\n-}\n-#endif /*SRE_ENABLE_PVM*/\n-\n-\n-#ifdef TESTDRIVER\n-int\n-main(int argc, char **argv)\n-{\n- Stopwatch_t stopwatch;\n-\n- StopwatchStart(&stopwatch);\n-\n- sleep(5);\n-\n- StopwatchStop(&stopwatch);\n- StopwatchDisplay(stdout, "CPU Time: ", &stopwatch);\n-}\n-#endif\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/squid/stopwatch.h --- a/clustalomega/clustal-omega-0.2.0/src/squid/stopwatch.h Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,58 +0,0 @@ -/* stopwatch.h - * SRE, Fri Nov 26 14:54:21 1999 [St. Louis] [HMMER] - * SRE, Thu Aug 3 08:00:35 2000 [St. Louis] [moved to SQUID] - * CVS $Id: stopwatch.h,v 1.2 2000/08/03 22:24:38 eddy Exp) - * - * Header file for stopwatch.c module: - * reporting of cpu/system/elapsed time used by a process. - * See stopwatch.c comments for documentation of compile-time - * configuration options and API. - * - ***************************************************************** - * SQUID - a library of functions for biological sequence analysis - * Copyright (C) 1992-2002 Washington University School of Medicine - * - * This source code is freely distributed under the terms of the - * GNU General Public License. See the files COPYRIGHT and LICENSE - * for details. - ***************************************************************** - */ -#include <stdio.h> -#include <time.h> -#ifndef SRE_STRICT_ANSI -#include <sys/times.h> -#endif - -#ifndef STOPWATCH_H_INCLUDED -#define STOPWATCH_H_INCLUDED - -struct stopwatch_s { - time_t t0; /* Wall clock time, ANSI time() */ -#ifdef SRE_STRICT_ANSI - clock_t cpu0; /* CPU time, ANSI clock() */ -#else - struct tms cpu0; /* CPU/system time, POSIX times()*/ -#endif - - double elapsed; /* elapsed time, seconds */ - double user; /* CPU time, seconds */ - double sys; /* system time, seconds */ -}; -typedef struct stopwatch_s Stopwatch_t; - -extern void StopwatchStart(Stopwatch_t *w); -extern void StopwatchStop(Stopwatch_t *w); -extern void StopwatchInclude(Stopwatch_t *w1, Stopwatch_t *w2); -extern Stopwatch_t *StopwatchCreate(void); -extern void StopwatchZero(Stopwatch_t *w); -extern void StopwatchCopy(Stopwatch_t *w1, Stopwatch_t *w2); -extern void StopwatchFree(Stopwatch_t *w); -extern void StopwatchDisplay(FILE *fp, char *s, Stopwatch_t *w); - -#ifdef HMMER_PVM -extern void StopwatchPVMPack(Stopwatch_t *w); -extern void StopwatchPVMUnpack(Stopwatch_t *w); -#endif - -#endif /*STOPWATCH_H_INCLUDED*/ - |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/squid/translate.c --- a/clustalomega/clustal-omega-0.2.0/src/squid/translate.c Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,86 +0,0 @@ -/***************************************************************** - * SQUID - a library of functions for biological sequence analysis - * Copyright (C) 1992-2002 Washington University School of Medicine - * - * This source code is freely distributed under the terms of the - * GNU General Public License. See the files COPYRIGHT and LICENSE - * for details. - *****************************************************************/ - -/* - * translate.c - functions for translating nucleic acid sequence - * created Tue Jan 12 11:27:29 1993, SRE - * - * RCS $Id: translate.c 217 2011-03-19 10:27:10Z andreas $ (Original squid RCS Id: translate.c,v 1.2 1998/10/09 18:07:16 eddy Exp) - */ - -#include <stdio.h> -#include <string.h> -#include "squid.h" - - -#ifdef MEMDEBUG -#include "dbmalloc.h" -#endif - - - -/* Function: Translate(char *seq, char **code) - * - * Given a ptr to the start of a nucleic acid sequence, - * and a genetic code, translate the sequence into - * amino acid sequence. - * - * code is an array of 65 strings, representing - * the translations of the 64 codons, arranged - * in order AAA, AAC, AAG, AAU, ..., UUA, UUC, UUG, UUU. - * '*' or '***' is used to represent termination - * codons, usually. The final string, code[64], - * is the code for an ambiguous amino acid. - * - * Because of the way space is allocated for the amino - * acid sequence, the amino acid strings cannot be - * longer than 3 letters each. (I don't foresee using - * anything but the single- and triple- letter codes.) - * - * Returns a ptr to the translation string on success, - * or NULL on failure. - */ -char * -Translate(char *seq, char **code) -{ - int codon; /* index for codon */ - char *aaseq; /* RETURN: the translation */ - char *aaptr; /* ptr into aaseq */ - int i; - - if (seq == NULL) - { squid_errno = SQERR_NODATA; return NULL; } - if ((aaseq = (char *) calloc (strlen(seq) + 1, sizeof(char))) == NULL) - Die("calloc failed"); - - aaptr = aaseq; - for (; *seq != '\0' && *(seq+1) != '\0' && *(seq+2) != '\0'; seq += 3) - { - /* calculate the lookup value for - this codon */ - codon = 0; - for (i = 0; i < 3; i++) - { - codon *= 4; - switch (*(seq + i)) { - case 'A': case 'a': break; - case 'C': case 'c': codon += 1; break; - case 'G': case 'g': codon += 2; break; - case 'T': case 't': codon += 3; break; - case 'U': case 'u': codon += 3; break; - default: codon = 64; break; - } - if (codon == 64) break; - } - - strcpy(aaptr, code[codon]); - aaptr += strlen(code[codon]); - } - return aaseq; -} |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/squid/types.c --- a/clustalomega/clustal-omega-0.2.0/src/squid/types.c Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,227 +0,0 @@ -/***************************************************************** - * SQUID - a library of functions for biological sequence analysis - * Copyright (C) 1992-2002 Washington University School of Medicine - * - * This source code is freely distributed under the terms of the - * GNU General Public License. See the files COPYRIGHT and LICENSE - * for details. - *****************************************************************/ - -/* file: types.c - * - * Finicky type checkers for strings. Return 1 (TRUE) if ok, 0 elsewise. - * Also, finicky type converters (sre_ntoh32() and friends) - * - * CVS $Id: types.c,v 1.5 2001/01/08 22:58:12 eddy Exp) - */ - -#include <string.h> -#include <ctype.h> -#include "squid.h" - -/* Function: IsInt() - * - * Returns TRUE if s points to something that atoi() will parse - * completely and convert to an integer. - */ -int -IsInt(char *s) -{ - int hex = 0; - - if (s == NULL) {squid_errno = SQERR_PARAMETER; return 0; } - - /* skip whitespace */ - while (isspace((int) (*s))) s++; - /* skip leading sign */ - if (*s == '-' || *s == '+') s++; - /* skip leading conversion signals */ - if ((strncmp(s, "0x", 2) == 0 && (int) strlen(s) > 2) || - (strncmp(s, "0X", 2) == 0 && (int) strlen(s) > 2)) - { - s += 2; - hex = 1; - } - else if (*s == '0' && (int) strlen(s) > 1) - s++; - /* examine remainder for garbage chars */ - if (!hex) - while (*s != '\0') - { - if (!isdigit((int) (*s))) return 0; - s++; - } - else - while (*s != '\0') - { - if (!isxdigit((int) (*s))) return 0; - s++; - } - - return 1; -} - - -/* Function: IsReal() - * - * Purpose: Returns TRUE if s is a string representation - * of a valid floating point number. - */ -int -IsReal(char *s) -{ - int gotdecimal = 0; - int gotexp = 0; - int gotreal = 0; - - if (s == NULL) return 0; - - while (isspace((int) (*s))) s++; /* skip leading whitespace */ - if (*s == '-' || *s == '+') s++; /* skip leading sign */ - - /* Examine remainder for garbage. Allowed one '.' and - * one 'e' or 'E'; if both '.' and e/E occur, '.' - * must be first. - */ - while (*s != '\0') - { - if (isdigit((int) (*s))) - gotreal++; - else if (*s == '.') - { - if (gotdecimal) return 0; /* can't have two */ - if (gotexp) return 0; /* e/E preceded . */ - else gotdecimal++; - } - else if (*s == 'e' || *s == 'E') - { - if (gotexp) return 0; /* can't have two */ - else gotexp++; - } - else if (isspace((int) (*s))) - break; - - s++; - } - - while (isspace((int) (*s))) s++; /* skip trailing whitespace */ - if (*s == '\0' && gotreal) return 1; - else return 0; -} - - -/* Function: Byteswap() - * - * Purpose: Swap between big-endian and little-endian. - * For example: - * int foo = 0x12345678; - * byteswap((char *) &foo, sizeof(int)); - * printf("%x\n", foo) - * gives 78563412. - * - * I don't fully understand byte-swapping issues. - * However, I have tested this on chars through floats, - * on various machines: - * SGI IRIX 4.0.5, SunOS 4.1.3, DEC Alpha OSF/1, Alliant - * - * Date: Sun Feb 12 10:26:22 1995 - */ -void -Byteswap(char *swap, int nbytes) -{ - int x; - char byte; - - for (x = 0; x < nbytes / 2; x++) - { - byte = swap[nbytes - x - 1]; - swap[nbytes - x - 1] = swap[x]; - swap[x] = byte; - } -} - - - -/* Functions: sre_ntoh16(), etc. - * Date: SRE, Sun Dec 31 11:26:53 2000 [St. Louis] - * - * Purpose: Provide functionality of ntohs(), etc; extended - * to 64-bit unsigned ints, and explicitly provided - * in case a machine doesn't have the ntohs() - * family. - * - * If we're using the host functions, - * USE_HOST_BYTESWAP_FUNCTIONS was set to 1 in - * squidconf.h, and we #define'd sre_hton16(x)=hton(x), etc. - * in squid.h. In doing this, we assumed that the - * host functions work on 16- and 32-bit unsigned quantities. - * If for some reason that's not true, set - * USE_HOST_BYTESWAP_FUNCTIONS to 0. - */ -#ifndef USE_HOST_BYTESWAP_FUNCTIONS -sqd_uint16 -sre_ntoh16(sqd_uint16 netshort) -{ -#ifdef WORDS_BIGENDIAN - return netshort; -#else - Byteswap((char *) &netshort, 2); - return netshort; -#endif -} -sqd_uint32 -sre_ntoh32(sqd_uint32 netlong) -{ -#ifdef WORDS_BIGENDIAN - return netlong; -#else - Byteswap((char *) &netlong, 4); - return netlong; -#endif -} -sqd_uint16 -sre_hton16(sqd_uint16 hostshort) -{ -#ifdef WORDS_BIGENDIAN - return hostshort; -#else - Byteswap((char *) &hostshort, 2); - return hostshort; -#endif -} -sqd_uint32 -sre_hton32(sqd_uint32 hostlong) -{ -#ifdef WORDS_BIGENDIAN - return hostlong; -#else - Byteswap((char *) &hostlong, 4); - return hostlong; -#endif -} -#endif /*USE_HOST_BYTESWAP_FUNCTIONS*/ - -sqd_uint64 -sre_ntoh64(sqd_uint64 net_int64) -{ -#ifdef WORDS_BIGENDIAN - return net_int64; -#else - Byteswap((char *) &net_int64, 8); - return net_int64; -#endif -} -sqd_uint64 -sre_hton64(sqd_uint64 host_int64) -{ -#ifdef WORDS_BIGENDIAN - return host_int64; -#else - Byteswap((char *) &host_int64, 8); - return host_int64; -#endif -} - - - - |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/squid/vectorops.c --- a/clustalomega/clustal-omega-0.2.0/src/squid/vectorops.c Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,297 +0,0 @@ -/* vectorops.c - * Operations on vectors of floats or doubles. - * - * DSet(), FSet() - set all items in vector to value. - * DScale(), FScale() - multiply all items in vector by scale - * DSum(), FSum() - return sum of values in vector - * DAdd(), FAdd() - add vec2 to vec1. - * DCopy(), FCopy() - set vec1 to be same as vec2. - * DDot(), FDot() - return dot product of two vectors. - * DMax(), FMax() - return value of maximum element in vector - * DMin(), FMin() - return value of minimum element in vector - * DArgMax(), FArgMax() - return index of maximum element in vector - * DArgMin(), FArgMin() - return index of minimum element in vector - * - * DNorm(), FNorm() - normalize a probability vector of length n. - * DLog(), FLog() - convert to log probabilities - * DExp(), FExp() - convert log p's back to probabilities - * DLogSum(), FLogSum() - given vector of log p's; return log of summed p's. - * - * SRE, Tue Oct 1 15:23:25 2002 [St. Louis] - * CVS $Id: vectorops.c,v 1.1 2002/10/09 14:26:09 eddy Exp) - */ - -#include <stdlib.h> -#include <math.h> -#include <float.h> -#include "vectorops.h" - -void -DSet(double *vec, int n, double value) -{ - int x; - for (x = 0; x < n; x++) vec[x] = value; -} - -void -FSet(float *vec, int n, float value) -{ - int x; - for (x = 0; x < n; x++) vec[x] = value; -} - -void -DScale(double *vec, int n, double scale) -{ - int x; - for (x = 0; x < n; x++) vec[x] *= scale; -} - -void -FScale(float *vec, int n, float scale) -{ - int x; - for (x = 0; x < n; x++) vec[x] *= scale; -} - -double -DSum(double *vec, int n) -{ - double sum = 0.; - int x; - for (x = 0; x < n; x++) sum += vec[x]; - return sum; -} - -float -FSum(float *vec, int n) -{ - float sum = 0.; - int x; - for (x = 0; x < n; x++) sum += vec[x]; - return sum; -} - -void -DAdd(double *vec1, double *vec2, int n) -{ - int x; - for (x = 0; x < n; x++) vec1[x] += vec2[x]; -} - -void -FAdd(float *vec1, float *vec2, int n) -{ - int x; - for (x = 0; x < n; x++) vec1[x] += vec2[x]; -} - -void -DCopy(double *vec1, double *vec2, int n) -{ - int x; - for (x = 0; x < n; x++) vec1[x] = vec2[x]; -} - -void -FCopy(float *vec1, float *vec2, int n) -{ - int x; - for (x = 0; x < n; x++) vec1[x] = vec2[x]; -} - -double -DDot(double *vec1, double *vec2, int n) -{ - double result = 0.; - int x; - for (x = 0; x < n; x++) result += vec1[x] * vec2[x]; - return result; -} - -float -FDot(float *vec1, float *vec2, int n) -{ - float result = 0.; - int x; - for (x = 0; x < n; x++) result += vec1[x] * vec2[x]; - return result; -} - -double -DMax(double *vec, int n) -{ - int i; - double best; - - best = vec[0]; - for (i = 1; i < n; i++) - if (vec[i] > best) best = vec[i]; - return best; -} - -float -FMax(float *vec, int n) -{ - int i; - float best; - - best = vec[0]; - for (i = 1; i < n; i++) - if (vec[i] > best) best = vec[i]; - return best; -} - -double -DMin(double *vec, int n) -{ - int i; - double best; - - best = vec[0]; - for (i = 1; i < n; i++) - if (vec[i] < best) best = vec[i]; - return best; -} - -float -FMin(float *vec, int n) -{ - int i; - float best; - - best = vec[0]; - for (i = 1; i < n; i++) - if (vec[i] < best) best = vec[i]; - return best; -} - -double -DArgMax(double *vec, int n) -{ - int i; - int best = 0; - - for (i = 1; i < n; i++) - if (vec[i] > vec[best]) best = i; - return best; -} - -float -FArgMax(float *vec, int n) -{ - int i; - int best = 0; - - for (i = 1; i < n; i++) - if (vec[i] > vec[best]) best = i; - return best; -} - -double -DArgMin(double *vec, int n) -{ - int i; - int best = 0; - for (i = 1; i < n; i++) - if (vec[i] < vec[best]) best = i; - return best; -} - -float -FArgMin(float *vec, int n) -{ - int i; - int best = 0; - - for (i = 1; i < n; i++) - if (vec[i] < vec[best]) best = i; - return best; -} - -void -DNorm(double *vec, int n) -{ - int x; - double sum; - - sum = DSum(vec, n); - if (sum != 0.0) for (x = 0; x < n; x++) vec[x] /= sum; - else for (x = 0; x < n; x++) vec[x] = 1. / (double) n; -} - -void -FNorm(float *vec, int n) -{ - int x; - float sum; - - sum = FSum(vec, n); - if (sum != 0.0) for (x = 0; x < n; x++) vec[x] /= sum; - else for (x = 0; x < n; x++) vec[x] = 1. / (float) n; -} - -void -DLog(double *vec, int n) -{ - int x; - for (x = 0; x < n; x++) - if (vec[x] > 0.) vec[x] = log(vec[x]); - else vec[x] = -DBL_MAX; -} - -void -FLog(float *vec, int n) -{ - int x; - for (x = 0; x < n; x++) - if (vec[x] > 0.) vec[x] = log(vec[x]); - else vec[x] = -FLT_MAX; -} - -void -DExp(double *vec, int n) -{ - int x; - for (x = 0; x < n; x++) vec[x] = exp(vec[x]); -} - -void -FExp(float *vec, int n) -{ - int x; - for (x = 0; x < n; x++) vec[x] = exp(vec[x]); -} - -float -DLogSum(double *vec, int n) -{ - int x; - double max, sum; - - max = DMax(vec, n); - sum = 0.0; - for (x = 0; x < n; x++) - if (vec[x] > max - 50.) - sum += exp(vec[x] - max); - sum = log(sum) + max; - return sum; -} - -float -FLogSum(float *vec, int n) -{ - int x; - float max, sum; - - max = FMax(vec, n); - sum = 0.0; - for (x = 0; x < n; x++) - if (vec[x] > max - 50.) - sum += exp(vec[x] - max); - sum = log(sum) + max; - return sum; -} - - - |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/squid/vectorops.h --- a/clustalomega/clustal-omega-0.2.0/src/squid/vectorops.h Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
@@ -1,36 +0,0 @@ -/* vectorops.h - * Header file for vectorops.c - * - * SRE, Tue Oct 1 15:23:37 2002 [St. Louis] - * CVS $Id: vectorops.h,v 1.1 2002/10/09 14:26:09 eddy Exp) - */ - -extern void DSet(double *vec, int n, double value); -extern void FSet(float *vec, int n, float value); -extern void DScale(double *vec, int n, double scale); -extern void FScale(float *vec, int n, float scale); -extern double DSum(double *vec, int n); -extern float FSum(float *vec, int n); -extern void DAdd(double *vec1, double *vec2, int n); -extern void FAdd(float *vec1, float *vec2, int n); -extern void DCopy(double *vec1, double *vec2, int n); -extern void FCopy(float *vec1, float *vec2, int n); -extern double DDot(double *vec1, double *vec2, int n); -extern float FDot(float *vec1, float *vec2, int n); -extern double DMax(double *vec, int n); -extern float FMax(float *vec, int n); -extern double DMin(double *vec, int n); -extern float FMin(float *vec, int n); -extern double DArgMax(double *vec, int n); -extern float FArgMax(float *vec, int n); -extern double DArgMin(double *vec, int n); -extern float FArgMin(float *vec, int n); -extern void DNorm(double *vec, int n); -extern void FNorm(float *vec, int n); -extern void DLog(double *vec, int n); -extern void FLog(float *vec, int n); -extern void DExp(double *vec, int n); -extern void FExp(float *vec, int n); -extern float DLogSum(double *vec, int n); -extern float FLogSum(float *vec, int n); - |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/squid/version.h --- a/clustalomega/clustal-omega-0.2.0/src/squid/version.h Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
b |
@@ -1,6 +0,0 @@ -/* version.h -- automatically generated by a Makefile. DO NOT EDIT. */ -#define PACKAGE "SQUID" -#define RELEASE "1.9g" -#define RELEASEDATE "Oct 2002" -#define COPYRIGHT "Copyright (C) 1992-2002 HHMI/Washington University School of Medicine" -#define LICENSE "Freely distributed under the GNU General Public License (GPL)" |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-0.2.0/src/squid/weight.c --- a/clustalomega/clustal-omega-0.2.0/src/squid/weight.c Tue Jun 07 17:04:25 2011 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
[ |
b'@@ -1,748 +0,0 @@\n-/*****************************************************************\n- * SQUID - a library of functions for biological sequence analysis\n- * Copyright (C) 1992-2002 Washington University School of Medicine\n- * \n- * This source code is freely distributed under the terms of the\n- * GNU General Public License. See the files COPYRIGHT and LICENSE\n- * for details.\n- *****************************************************************/\n-\n-/* weight.c\n- * SRE, Thu Mar 3 07:56:01 1994\n- * \n- * Calculate weights for sequences in an alignment.\n- * RCS $Id: weight.c 217 2011-03-19 10:27:10Z andreas $ (Original squid RCS Id: weight.c,v 1.9 2002/10/09 14:26:09 eddy Exp)\n- */\n-\n-#include <ctype.h>\n-#include <string.h>\n-#include "squid.h"\n-#include "sre_random.h"\n-\n-static void upweight(struct phylo_s *tree, int nseq, float *lwt, float *rwt, int node);\n-static void downweight(struct phylo_s *tree, int nseq, float *lwt, float *rwt, \n-\t\t float *fwt, int node);\n-static float simple_distance(char *s1, char *s2);\n-static int simple_diffmx(char **aseqs,int num, float ***ret_dmx);\n-\n-/* Function: GSCWeights()\n- * \n- * Purpose: Use Erik\'s tree-based algorithm to set weights for\n- * sequences in an alignment. upweight() and downweight()\n- * are derived from Graeme Mitchison\'s code.\n- * \n- * Args: aseq - array of (0..nseq-1) aligned sequences\n- * nseq - number of seqs in alignment \n- * alen - length of alignment\n- * wgt - allocated [0..nseq-1] array of weights to be returned\n- * \n- * Return: (void)\n- * wgt is filled in.\n- */\n-void\n-GSCWeights(char **aseq, int nseq, int alen, float *wgt)\n-{\n- float **dmx; /* distance (difference) matrix */\n- struct phylo_s *tree;\n- float *lwt, *rwt; /* weight on left, right of this tree node */\n- float *fwt; /* final weight assigned to this node */\n- int i;\n- \n- /* Sanity check first\n- */\n- if (nseq == 1) { wgt[0] = 1.0; return; }\n-\n- /* I use a simple fractional difference matrix derived by\n- * pairwise identity. Perhaps I should include a Poisson\n- * distance correction.\n- */\n- MakeDiffMx(aseq, nseq, &dmx);\n- if (! Cluster(dmx, nseq, CLUSTER_MIN, &tree)) Die("Cluster() failed");\n- \n- /* Allocations\n- */\n- lwt = MallocOrDie (sizeof(float) * (2 * nseq - 1));\n- rwt = MallocOrDie (sizeof(float) * (2 * nseq - 1));\n- fwt = MallocOrDie (sizeof(float) * (2 * nseq - 1));\n- \n- /* lwt and rwt are the total branch weight to the left and\n- * right of a node or sequence. They are 0..2N-2. 0..N-1 are \n- * the sequences; these have weight 0. N..2N-2 are the actual\n- * tree nodes.\n- */\n- for (i = 0; i < nseq; i++)\n- lwt[i] = rwt[i] = 0.0;\n-\t\t\t\t/* recursively calculate rwt, lwt, starting\n-\t\t\t\t at node nseq (the root) */\n- upweight(tree, nseq, lwt, rwt, nseq);\n-\n-\t\t\t\t/* recursively distribute weight across the\n-\t\t\t\t tree */\n- fwt[nseq] = nseq;\n- downweight(tree, nseq, lwt, rwt, fwt, nseq);\n-\t\t\t\t/* collect the weights */\n- for (i = 0; i < nseq; i++)\n- wgt[i] = fwt[i];\n-\n- FMX2Free(dmx);\n- FreePhylo(tree, nseq);\n- free(lwt); free(rwt); free(fwt);\n-}\n-\n-static void \n-upweight(struct phylo_s *tree, int nseq, float *lwt, float *rwt, int node)\n-{\n- int ld,rd;\n-\n- ld = tree[node-nseq].left;\n- if (ld >= nseq) upweight(tree, nseq, lwt, rwt, ld);\n- rd = tree[node-nseq].right;\n- if (rd >= nseq) upweight(tree, nseq, lwt, rwt, rd);\n- lwt[node] = lwt[ld] + rwt[ld] + tree[node-nseq].lblen;\n- rwt[node] = lwt[rd] + rwt[rd] + tree[node-nseq].rblen;\n-}\n-\n-\n-static void \n-downweight(struct phylo_s *tree, int nseq, float *lwt, float *rwt, float *fwt, int node)\n-{\n- int ld,rd;\n- float lnum, rnum;\n-\n- ld = tree[node-nseq].left;\n- rd = tree[node-nseq].right;\n- if (lwt[node] + rwt[node] > 0.0)\n- {\n- fwt[ld] = fwt[node] * (lwt[node] / (lwt[node] + rwt[node]));\n- fwt[rd] = fwt[node]'..b" within a column, there's no mixed case.\n- * \n- * Algorithm: \n- * I don't know if this algorithm is published. I \n- * haven't seen it in graph theory books, but that might\n- * be because it's so obvious that nobody's bothered.\n- * \n- * In brief, we're going to do a breadth-first search\n- * of the graph, and we're going to calculate links\n- * on the fly rather than precalculating them into\n- * some sort of standard adjacency structure.\n- * \n- * While working, we keep two stacks of maximum length N:\n- * a : list of vertices that are still unconnected.\n- * b : list of vertices that we've connected to \n- * in our current breadth level, but we haven't\n- * yet tested for other connections to a.\n- * The current length (number of elements in) a and b are\n- * kept in na, nb.\n- * \n- * We store our results in an array of length N:\n- * c : assigns each vertex to a component. for example\n- * c[4] = 1 means that vertex 4 is in component 1.\n- * nc is the number of components. Components\n- * are numbered from 0 to nc-1. We return c and nc\n- * to our caller.\n- * \n- * The algorithm is:\n- * \n- * Initialisation: \n- * a <-- all the vertices\n- * na <-- N\n- * b <-- empty set\n- * nb <-- 0\n- * nc <-- 0\n- * \n- * Then:\n- * while (a is not empty)\n- * pop a vertex off a, push onto b\n- * while (b is not empty)\n- * pop vertex v off b\n- * assign c[v] = nc\n- * for each vertex w in a:\n- * compare v,w. If w is linked to v, remove w\n- * from a, push onto b.\n- * nc++ \n- * q.e.d. :) \n- *\n- * Args: aseq - aligned sequences\n- * nseq - number of sequences in aseq\n- * alen - alignment length\n- * maxid - fractional identity threshold 0..1. if id >= maxid, seqs linked\n- * ret_c - RETURN: 0..nseq-1 assignments of seqs to components (clusters)\n- * ret_nc - RETURN: number of components\n- *\n- * Returns: void.\n- * ret_c is allocated here. Caller free's with free(*ret_c)\n- */\n-void\n-SingleLinkCluster(char **aseq, int nseq, int alen, float maxid, \n-\t\t int **ret_c, int *ret_nc)\n-{\n- int *a, na; /* stack of available vertices */\n- int *b, nb; /* stack of working vertices */\n- int *c; /* array of results */\n- int nc;\t\t\t/* total number of components */\n- int v,w;\t\t\t/* index of a working vertices */\n- int i;\t\t\t/* loop counter */\n-\n- /* allocations and initializations\n- */\n- a = MallocOrDie (sizeof(int) * nseq);\n- b = MallocOrDie (sizeof(int) * nseq);\n- c = MallocOrDie (sizeof(int) * nseq);\n- for (i = 0; i < nseq; i++) a[i] = i;\n- na = nseq;\n- nb = 0;\n- nc = 0;\n-\n- /* Main algorithm\n- */\n- while (na > 0)\n- {\n- v = a[na-1]; na--;\t/* pop a vertex off a, */\n- b[nb] = v; nb++;\t/* and push onto b */\n- while (nb > 0)\n-\t{\n-\t v = b[nb-1]; nb--;\t/* pop vertex off b */\n-\t c[v] = nc;\t\t/* assign it to component nc */\n-\t for (i = na-1; i >= 0; i--)/* backwards, becase of deletion/swapping we do*/\n-\t if (simple_distance(aseq[v], aseq[a[i]]) <= 1. - maxid) /* linked? */\n-\t {\t\t\t\n-\t\tw = a[i]; a[i] = a[na-1]; na--;\t/* delete w from a (note swap) */\n-\t\tb[nb] = w; nb++; /* push w onto b */\n-\t }\n-\t}\n- nc++;\n- }\n-\n- /* Cleanup and return\n- */\n- free(a);\n- free(b);\n- *ret_c = c;\n- *ret_nc = nc;\n- return;\n-}\n" |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/AUTHORS --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/AUTHORS Thu Jul 21 13:35:08 2011 -0400 |
b |
@@ -0,0 +1,20 @@ +* Clustal Omega: +Fabian Sievers UCD Dublin, Ireland +Andreas Wilm UCD Dublin, Ireland +David Dineen UCD Dublin, Ireland +Johannes Söding Gene Center Munich, Germany +Michael Remmert Gene Center Munich, Germany + +* Clustal 2 +Mark Larkin UCD Dublin, Ireland + +* Clustal 1.X +Toby Gibson EMBL Heidelberg, Germany +Des Higgins UCC Cork, Ireland +Julie Thompson IGBMC Strasbourg, France + +* Contributors: +Chenna Ramu EMBL Heidelberg, Germany +Nigel Brown EMBL Heidelberg, Germany + + |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/COPYING --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/COPYING Thu Jul 21 13:35:08 2011 -0400 |
b |
b'@@ -0,0 +1,339 @@\n+ GNU GENERAL PUBLIC LICENSE\n+ Version 2, June 1991\n+\n+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,\n+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n+ Everyone is permitted to copy and distribute verbatim copies\n+ of this license document, but changing it is not allowed.\n+\n+ Preamble\n+\n+ The licenses for most software are designed to take away your\n+freedom to share and change it. By contrast, the GNU General Public\n+License is intended to guarantee your freedom to share and change free\n+software--to make sure the software is free for all its users. This\n+General Public License applies to most of the Free Software\n+Foundation\'s software and to any other program whose authors commit to\n+using it. (Some other Free Software Foundation software is covered by\n+the GNU Lesser General Public License instead.) You can apply it to\n+your programs, too.\n+\n+ When we speak of free software, we are referring to freedom, not\n+price. Our General Public Licenses are designed to make sure that you\n+have the freedom to distribute copies of free software (and charge for\n+this service if you wish), that you receive source code or can get it\n+if you want it, that you can change the software or use pieces of it\n+in new free programs; and that you know you can do these things.\n+\n+ To protect your rights, we need to make restrictions that forbid\n+anyone to deny you these rights or to ask you to surrender the rights.\n+These restrictions translate to certain responsibilities for you if you\n+distribute copies of the software, or if you modify it.\n+\n+ For example, if you distribute copies of such a program, whether\n+gratis or for a fee, you must give the recipients all the rights that\n+you have. You must make sure that they, too, receive or can get the\n+source code. And you must show them these terms so they know their\n+rights.\n+\n+ We protect your rights with two steps: (1) copyright the software, and\n+(2) offer you this license which gives you legal permission to copy,\n+distribute and/or modify the software.\n+\n+ Also, for each author\'s protection and ours, we want to make certain\n+that everyone understands that there is no warranty for this free\n+software. If the software is modified by someone else and passed on, we\n+want its recipients to know that what they have is not the original, so\n+that any problems introduced by others will not reflect on the original\n+authors\' reputations.\n+\n+ Finally, any free program is threatened constantly by software\n+patents. We wish to avoid the danger that redistributors of a free\n+program will individually obtain patent licenses, in effect making the\n+program proprietary. To prevent this, we have made it clear that any\n+patent must be licensed for everyone\'s free use or not licensed at all.\n+\n+ The precise terms and conditions for copying, distribution and\n+modification follow.\n+\n+ GNU GENERAL PUBLIC LICENSE\n+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\n+\n+ 0. This License applies to any program or other work which contains\n+a notice placed by the copyright holder saying it may be distributed\n+under the terms of this General Public License. The "Program", below,\n+refers to any such program or work, and a "work based on the Program"\n+means either the Program or any derivative work under copyright law:\n+that is to say, a work containing the Program or a portion of it,\n+either verbatim or with modifications and/or translated into another\n+language. (Hereinafter, translation is included without limitation in\n+the term "modification".) Each licensee is addressed as "you".\n+\n+Activities other than copying, distribution and modification are not\n+covered by this License; they are outside its scope. The act of\n+running the Program is not restricted, and the output from the Program\n+is covered only if its contents constitute a work based on the\n+Program (i'..b'PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED\n+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS\n+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE\n+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,\n+REPAIR OR CORRECTION.\n+\n+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\n+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR\n+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,\n+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING\n+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED\n+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY\n+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER\n+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE\n+POSSIBILITY OF SUCH DAMAGES.\n+\n+ END OF TERMS AND CONDITIONS\n+\n+ How to Apply These Terms to Your New Programs\n+\n+ If you develop a new program, and you want it to be of the greatest\n+possible use to the public, the best way to achieve this is to make it\n+free software which everyone can redistribute and change under these terms.\n+\n+ To do so, attach the following notices to the program. It is safest\n+to attach them to the start of each source file to most effectively\n+convey the exclusion of warranty; and each file should have at least\n+the "copyright" line and a pointer to where the full notice is found.\n+\n+ <one line to give the program\'s name and a brief idea of what it does.>\n+ Copyright (C) <year> <name of author>\n+\n+ This program is free software; you can redistribute it and/or modify\n+ it under the terms of the GNU General Public License as published by\n+ the Free Software Foundation; either version 2 of the License, or\n+ (at your option) any later version.\n+\n+ This program is distributed in the hope that it will be useful,\n+ but WITHOUT ANY WARRANTY; without even the implied warranty of\n+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n+ GNU General Public License for more details.\n+\n+ You should have received a copy of the GNU General Public License along\n+ with this program; if not, write to the Free Software Foundation, Inc.,\n+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\n+\n+Also add information on how to contact you by electronic and paper mail.\n+\n+If the program is interactive, make it output a short notice like this\n+when it starts in an interactive mode:\n+\n+ Gnomovision version 69, Copyright (C) year name of author\n+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w\'.\n+ This is free software, and you are welcome to redistribute it\n+ under certain conditions; type `show c\' for details.\n+\n+The hypothetical commands `show w\' and `show c\' should show the appropriate\n+parts of the General Public License. Of course, the commands you use may\n+be called something other than `show w\' and `show c\'; they could even be\n+mouse-clicks or menu items--whatever suits your program.\n+\n+You should also get your employer (if you work as a programmer) or your\n+school, if any, to sign a "copyright disclaimer" for the program, if\n+necessary. Here is a sample; alter the names:\n+\n+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program\n+ `Gnomovision\' (which makes passes at compilers) written by James Hacker.\n+\n+ <signature of Ty Coon>, 1 April 1989\n+ Ty Coon, President of Vice\n+\n+This General Public License does not permit incorporating your program into\n+proprietary programs. If your program is a subroutine library, you may\n+consider it more useful to permit linking proprietary applications with the\n+library. If this is what you want to do, use the GNU Lesser General\n+Public License instead of this License.\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/ChangeLog --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/ChangeLog Thu Jul 21 13:35:08 2011 -0400 |
b |
@@ -0,0 +1,15 @@ +2010-06-17 Release 0.0.1 (Dubliniensis) + + First "release" as program has been able for a while to perform + all basic tasks without problems. + + Non-standard features already built-in include: + HMM-iteration (using HMMER for building an HMM) and guide-tree + iteration. On top of that HMM input works fine and + background-frequencies are added to the HHalign process. + + Known issues: RNA/DNA alignment is considered buggy. Aligned + sequences have to be dealigned for HHalign to work properly. + + The HMMER version message can be ignored if no HMM-iteration + was used. |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/Doxyfile --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/Doxyfile Thu Jul 21 13:35:08 2011 -0400 |
[ |
b'@@ -0,0 +1,1510 @@\n+# Doxyfile 1.5.8\n+\n+# This file describes the settings to be used by the documentation system\n+# doxygen (www.doxygen.org) for a project\n+#\n+# All text after a hash (#) is considered a comment and will be ignored\n+# The format is:\n+# TAG = value [value, ...]\n+# For lists items can also be appended using:\n+# TAG += value [value, ...]\n+# Values that contain spaces should be placed between quotes (" ")\n+\n+#---------------------------------------------------------------------------\n+# Project related configuration options\n+#---------------------------------------------------------------------------\n+\n+# This tag specifies the encoding used for all characters in the config file \n+# that follow. The default is UTF-8 which is also the encoding used for all \n+# text before the first occurrence of this tag. Doxygen uses libiconv (or the \n+# iconv built into libc) for the transcoding. See \n+# http://www.gnu.org/software/libiconv for the list of possible encodings.\n+\n+DOXYFILE_ENCODING = UTF-8\n+\n+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded \n+# by quotes) that should identify the project.\n+\n+PROJECT_NAME = "Clustal Omega"\n+\n+# The PROJECT_NUMBER tag can be used to enter a project or revision number. \n+# This could be handy for archiving the generated documentation or \n+# if some version control system is used.\n+\n+PROJECT_NUMBER = 1.0.2\n+\n+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) \n+# base path where the generated documentation will be put. \n+# If a relative path is entered, it will be relative to the location \n+# where doxygen was started. If left blank the current directory will be used.\n+\n+OUTPUT_DIRECTORY = ./doc/doxygen/\n+\n+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create \n+# 4096 sub-directories (in 2 levels) under the output directory of each output \n+# format and will distribute the generated files over these directories. \n+# Enabling this option can be useful when feeding doxygen a huge amount of \n+# source files, where putting all generated files in the same directory would \n+# otherwise cause performance problems for the file system.\n+\n+CREATE_SUBDIRS = NO\n+\n+# The OUTPUT_LANGUAGE tag is used to specify the language in which all \n+# documentation generated by doxygen is written. Doxygen will use this \n+# information to generate all constant output in the proper language. \n+# The default language is English, other supported languages are: \n+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, \n+# Croatian, Czech, Danish, Dutch, Farsi, Finnish, French, German, Greek, \n+# Hungarian, Italian, Japanese, Japanese-en (Japanese with English messages), \n+# Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, Polish, \n+# Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, Slovene, \n+# Spanish, Swedish, and Ukrainian.\n+\n+OUTPUT_LANGUAGE = English\n+\n+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will \n+# include brief member descriptions after the members that are listed in \n+# the file and class documentation (similar to JavaDoc). \n+# Set to NO to disable this.\n+\n+BRIEF_MEMBER_DESC = YES\n+\n+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend \n+# the brief description of a member or function before the detailed description. \n+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the \n+# brief descriptions will be completely suppressed.\n+\n+REPEAT_BRIEF = YES\n+\n+# This tag implements a quasi-intelligent brief description abbreviator \n+# that is used to form the text in various listings. Each string \n+# in this list, if found as the leading text of the brief description, will be \n+# stripped from the text and the result after processing the whole list, is \n+# used as the annotated text. Otherwise, the brief description is used as-is. \n+# If left blank, the following values'..b'ss method. Note that enabling this option will significantly increase \n+# the time of a run. So in most cases it will be better to enable caller \n+# graphs for selected functions only using the \\callergraph command.\n+\n+CALLER_GRAPH = NO\n+\n+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen \n+# will graphical hierarchy of all classes instead of a textual one.\n+\n+GRAPHICAL_HIERARCHY = YES\n+\n+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES \n+# then doxygen will show the dependencies a directory has on other directories \n+# in a graphical way. The dependency relations are determined by the #include \n+# relations between the files in the directories.\n+\n+DIRECTORY_GRAPH = YES\n+\n+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images \n+# generated by dot. Possible values are png, jpg, or gif \n+# If left blank png will be used.\n+\n+DOT_IMAGE_FORMAT = png\n+\n+# The tag DOT_PATH can be used to specify the path where the dot tool can be \n+# found. If left blank, it is assumed the dot tool can be found in the path.\n+\n+DOT_PATH = \n+\n+# The DOTFILE_DIRS tag can be used to specify one or more directories that \n+# contain dot files that are included in the documentation (see the \n+# \\dotfile command).\n+\n+DOTFILE_DIRS = \n+\n+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of \n+# nodes that will be shown in the graph. If the number of nodes in a graph \n+# becomes larger than this value, doxygen will truncate the graph, which is \n+# visualized by representing a node as a red box. Note that doxygen if the \n+# number of direct children of the root node in a graph is already larger than \n+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note \n+# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.\n+\n+DOT_GRAPH_MAX_NODES = 50\n+\n+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the \n+# graphs generated by dot. A depth value of 3 means that only nodes reachable \n+# from the root by following a path via at most 3 edges will be shown. Nodes \n+# that lay further from the root node will be omitted. Note that setting this \n+# option to 1 or 2 may greatly reduce the computation time needed for large \n+# code bases. Also note that the size of a graph can be further restricted by \n+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.\n+\n+MAX_DOT_GRAPH_DEPTH = 0\n+\n+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent \n+# background. This is disabled by default, because dot on Windows does not \n+# seem to support this out of the box. Warning: Depending on the platform used, \n+# enabling this option may lead to badly anti-aliased labels on the edges of \n+# a graph (i.e. they become hard to read).\n+\n+DOT_TRANSPARENT = NO\n+\n+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output \n+# files in one run (i.e. multiple -o and -T options on the command line). This \n+# makes dot run faster, but since only newer versions of dot (>1.8.10) \n+# support this, this feature is disabled by default.\n+\n+DOT_MULTI_TARGETS = NO\n+\n+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will \n+# generate a legend page explaining the meaning of the various boxes and \n+# arrows in the dot generated graphs.\n+\n+GENERATE_LEGEND = YES\n+\n+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will \n+# remove the intermediate dot files that are used to generate \n+# the various graphs.\n+\n+DOT_CLEANUP = YES\n+\n+#---------------------------------------------------------------------------\n+# Options related to the search engine\n+#---------------------------------------------------------------------------\n+\n+# The SEARCHENGINE tag specifies whether or not a search engine should be \n+# used. If set to NO the values of all tags below this one will be ignored.\n+\n+SEARCHENGINE = NO\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/Doxyfile.in --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/Doxyfile.in Thu Jul 21 13:35:08 2011 -0400 |
[ |
b'@@ -0,0 +1,1510 @@\n+# Doxyfile 1.5.8\n+\n+# This file describes the settings to be used by the documentation system\n+# doxygen (www.doxygen.org) for a project\n+#\n+# All text after a hash (#) is considered a comment and will be ignored\n+# The format is:\n+# TAG = value [value, ...]\n+# For lists items can also be appended using:\n+# TAG += value [value, ...]\n+# Values that contain spaces should be placed between quotes (" ")\n+\n+#---------------------------------------------------------------------------\n+# Project related configuration options\n+#---------------------------------------------------------------------------\n+\n+# This tag specifies the encoding used for all characters in the config file \n+# that follow. The default is UTF-8 which is also the encoding used for all \n+# text before the first occurrence of this tag. Doxygen uses libiconv (or the \n+# iconv built into libc) for the transcoding. See \n+# http://www.gnu.org/software/libiconv for the list of possible encodings.\n+\n+DOXYFILE_ENCODING = UTF-8\n+\n+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded \n+# by quotes) that should identify the project.\n+\n+PROJECT_NAME = "@PACKAGE_NAME@"\n+\n+# The PROJECT_NUMBER tag can be used to enter a project or revision number. \n+# This could be handy for archiving the generated documentation or \n+# if some version control system is used.\n+\n+PROJECT_NUMBER = @PACKAGE_VERSION@\n+\n+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) \n+# base path where the generated documentation will be put. \n+# If a relative path is entered, it will be relative to the location \n+# where doxygen was started. If left blank the current directory will be used.\n+\n+OUTPUT_DIRECTORY = ./doc/doxygen/\n+\n+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create \n+# 4096 sub-directories (in 2 levels) under the output directory of each output \n+# format and will distribute the generated files over these directories. \n+# Enabling this option can be useful when feeding doxygen a huge amount of \n+# source files, where putting all generated files in the same directory would \n+# otherwise cause performance problems for the file system.\n+\n+CREATE_SUBDIRS = NO\n+\n+# The OUTPUT_LANGUAGE tag is used to specify the language in which all \n+# documentation generated by doxygen is written. Doxygen will use this \n+# information to generate all constant output in the proper language. \n+# The default language is English, other supported languages are: \n+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, \n+# Croatian, Czech, Danish, Dutch, Farsi, Finnish, French, German, Greek, \n+# Hungarian, Italian, Japanese, Japanese-en (Japanese with English messages), \n+# Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, Polish, \n+# Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, Slovene, \n+# Spanish, Swedish, and Ukrainian.\n+\n+OUTPUT_LANGUAGE = English\n+\n+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will \n+# include brief member descriptions after the members that are listed in \n+# the file and class documentation (similar to JavaDoc). \n+# Set to NO to disable this.\n+\n+BRIEF_MEMBER_DESC = YES\n+\n+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend \n+# the brief description of a member or function before the detailed description. \n+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the \n+# brief descriptions will be completely suppressed.\n+\n+REPEAT_BRIEF = YES\n+\n+# This tag implements a quasi-intelligent brief description abbreviator \n+# that is used to form the text in various listings. Each string \n+# in this list, if found as the leading text of the brief description, will be \n+# stripped from the text and the result after processing the whole list, is \n+# used as the annotated text. Otherwise, the brief description is used as-is. \n+# If left blank, the fol'..b'ss method. Note that enabling this option will significantly increase \n+# the time of a run. So in most cases it will be better to enable caller \n+# graphs for selected functions only using the \\callergraph command.\n+\n+CALLER_GRAPH = NO\n+\n+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen \n+# will graphical hierarchy of all classes instead of a textual one.\n+\n+GRAPHICAL_HIERARCHY = YES\n+\n+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES \n+# then doxygen will show the dependencies a directory has on other directories \n+# in a graphical way. The dependency relations are determined by the #include \n+# relations between the files in the directories.\n+\n+DIRECTORY_GRAPH = YES\n+\n+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images \n+# generated by dot. Possible values are png, jpg, or gif \n+# If left blank png will be used.\n+\n+DOT_IMAGE_FORMAT = png\n+\n+# The tag DOT_PATH can be used to specify the path where the dot tool can be \n+# found. If left blank, it is assumed the dot tool can be found in the path.\n+\n+DOT_PATH = \n+\n+# The DOTFILE_DIRS tag can be used to specify one or more directories that \n+# contain dot files that are included in the documentation (see the \n+# \\dotfile command).\n+\n+DOTFILE_DIRS = \n+\n+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of \n+# nodes that will be shown in the graph. If the number of nodes in a graph \n+# becomes larger than this value, doxygen will truncate the graph, which is \n+# visualized by representing a node as a red box. Note that doxygen if the \n+# number of direct children of the root node in a graph is already larger than \n+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note \n+# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.\n+\n+DOT_GRAPH_MAX_NODES = 50\n+\n+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the \n+# graphs generated by dot. A depth value of 3 means that only nodes reachable \n+# from the root by following a path via at most 3 edges will be shown. Nodes \n+# that lay further from the root node will be omitted. Note that setting this \n+# option to 1 or 2 may greatly reduce the computation time needed for large \n+# code bases. Also note that the size of a graph can be further restricted by \n+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.\n+\n+MAX_DOT_GRAPH_DEPTH = 0\n+\n+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent \n+# background. This is disabled by default, because dot on Windows does not \n+# seem to support this out of the box. Warning: Depending on the platform used, \n+# enabling this option may lead to badly anti-aliased labels on the edges of \n+# a graph (i.e. they become hard to read).\n+\n+DOT_TRANSPARENT = NO\n+\n+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output \n+# files in one run (i.e. multiple -o and -T options on the command line). This \n+# makes dot run faster, but since only newer versions of dot (>1.8.10) \n+# support this, this feature is disabled by default.\n+\n+DOT_MULTI_TARGETS = NO\n+\n+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will \n+# generate a legend page explaining the meaning of the various boxes and \n+# arrows in the dot generated graphs.\n+\n+GENERATE_LEGEND = YES\n+\n+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will \n+# remove the intermediate dot files that are used to generate \n+# the various graphs.\n+\n+DOT_CLEANUP = YES\n+\n+#---------------------------------------------------------------------------\n+# Options related to the search engine\n+#---------------------------------------------------------------------------\n+\n+# The SEARCHENGINE tag specifies whether or not a search engine should be \n+# used. If set to NO the values of all tags below this one will be ignored.\n+\n+SEARCHENGINE = NO\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/INSTALL --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/INSTALL Thu Jul 21 13:35:08 2011 -0400 |
b |
b"@@ -0,0 +1,400 @@\n+The impatient can try:\n+\n+$ ./configure\n+$ make\n+$ make install\n+\n+\n+Clustal-Omega needs argtable2 (http://argtable.sourceforge.net/). If\n+argtable2 is installed in a non-standard directory you might have to\n+point configure to its installation directory. For example, if you are\n+on a Mac and have argtable installed via MacPorts then you should use\n+the following command line:\n+\n+$ ./configure CFLAGS='-I/opt/local/include' LDFLAGS='-L/opt/local/lib'\n+\n+ClustalO will automatically support multi-threading if your compiler\n+supports OpenMP. For some reason automake's OpenMP detection for\n+Apple's gcc is broken. You can force OpenMP detection by calling configure \n+like so:\n+\n+$ ./configure OPENMP_CFLAGS='-fopenmp' CFLAGS='-DHAVE_OPENMP'\n+\n+You could use a non-Apple gcc installed via MacPorts, adding\n+\n+CC=/opt/local/bin/gcc-mp-4.5\n+\n+to the configure call (you will have to change the exact string to match\n+your gcc version).\n+\n+See below for generic installation instructions:\n+\n+----------------------------------------------------------------------\n+\n+\n+\n+Installation Instructions\n+*************************\n+\n+Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,\n+2006, 2007, 2008, 2009 Free Software Foundation, Inc.\n+\n+ Copying and distribution of this file, with or without modification,\n+are permitted in any medium without royalty provided the copyright\n+notice and this notice are preserved. This file is offered as-is,\n+without warranty of any kind.\n+\n+Basic Installation\n+==================\n+\n+ Briefly, the shell commands `./configure; make; make install' should\n+configure, build, and install this package. The following\n+more-detailed instructions are generic; see the `README' file for\n+instructions specific to this package. Some packages provide this\n+`INSTALL' file but do not implement all of the features documented\n+below. The lack of an optional feature in a given package is not\n+necessarily a bug. More recommendations for GNU packages can be found\n+in *note Makefile Conventions: (standards)Makefile Conventions.\n+\n+ The `configure' shell script attempts to guess correct values for\n+various system-dependent variables used during compilation. It uses\n+those values to create a `Makefile' in each directory of the package.\n+It may also create one or more `.h' files containing system-dependent\n+definitions. Finally, it creates a shell script `config.status' that\n+you can run in the future to recreate the current configuration, and a\n+file `config.log' containing compiler output (useful mainly for\n+debugging `configure').\n+\n+ It can also use an optional file (typically called `config.cache'\n+and enabled with `--cache-file=config.cache' or simply `-C') that saves\n+the results of its tests to speed up reconfiguring. Caching is\n+disabled by default to prevent problems with accidental use of stale\n+cache files.\n+\n+ If you need to do unusual things to compile the package, please try\n+to figure out how `configure' could check whether to do them, and mail\n+diffs or instructions to the address given in the `README' so they can\n+be considered for the next release. If you are using the cache, and at\n+some point `config.cache' contains results you don't want to keep, you\n+may remove or edit it.\n+\n+ The file `configure.ac' (or `configure.in') is used to create\n+`configure' by a program called `autoconf'. You need `configure.ac' if\n+you want to change it or regenerate `configure' using a newer version\n+of `autoconf'.\n+\n+ The simplest way to compile this package is:\n+\n+ 1. `cd' to the directory containing the package's source code and type\n+ `./configure' to configure the package for your system.\n+\n+ Running `configure' might take a while. While running, it prints\n+ some messages telling which features it is checking for.\n+\n+ 2. Type `make' to compile the package.\n+\n+ 3. Optionally, type `make check' to run any self-tests that come with\n+ the package, generally using "..b'ermine by the type of machine the package\n+will run on. Usually, assuming the package is built to be run on the\n+_same_ architectures, `configure\' can figure that out, but if it prints\n+a message saying it cannot guess the machine type, give it the\n+`--build=TYPE\' option. TYPE can either be a short name for the system\n+type, such as `sun4\', or a canonical name which has the form:\n+\n+ CPU-COMPANY-SYSTEM\n+\n+where SYSTEM can have one of these forms:\n+\n+ OS\n+ KERNEL-OS\n+\n+ See the file `config.sub\' for the possible values of each field. If\n+`config.sub\' isn\'t included in this package, then this package doesn\'t\n+need to know the machine type.\n+\n+ If you are _building_ compiler tools for cross-compiling, you should\n+use the option `--target=TYPE\' to select the type of system they will\n+produce code for.\n+\n+ If you want to _use_ a cross compiler, that generates code for a\n+platform different from the build platform, you should specify the\n+"host" platform (i.e., that on which the generated programs will\n+eventually be run) with `--host=TYPE\'.\n+\n+Sharing Defaults\n+================\n+\n+ If you want to set default values for `configure\' scripts to share,\n+you can create a site shell script called `config.site\' that gives\n+default values for variables like `CC\', `cache_file\', and `prefix\'.\n+`configure\' looks for `PREFIX/share/config.site\' if it exists, then\n+`PREFIX/etc/config.site\' if it exists. Or, you can set the\n+`CONFIG_SITE\' environment variable to the location of the site script.\n+A warning: not all `configure\' scripts look for a site script.\n+\n+Defining Variables\n+==================\n+\n+ Variables not defined in a site shell script can be set in the\n+environment passed to `configure\'. However, some packages may run\n+configure again during the build, and the customized values of these\n+variables may be lost. In order to avoid this problem, you should set\n+them in the `configure\' command line, using `VAR=value\'. For example:\n+\n+ ./configure CC=/usr/local2/bin/gcc\n+\n+causes the specified `gcc\' to be used as the C compiler (unless it is\n+overridden in the site shell script).\n+\n+Unfortunately, this technique does not work for `CONFIG_SHELL\' due to\n+an Autoconf bug. Until the bug is fixed you can use this workaround:\n+\n+ CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash\n+\n+`configure\' Invocation\n+======================\n+\n+ `configure\' recognizes the following options to control how it\n+operates.\n+\n+`--help\'\n+`-h\'\n+ Print a summary of all of the options to `configure\', and exit.\n+\n+`--help=short\'\n+`--help=recursive\'\n+ Print a summary of the options unique to this package\'s\n+ `configure\', and exit. The `short\' variant lists options used\n+ only in the top level, while the `recursive\' variant lists options\n+ also present in any nested packages.\n+\n+`--version\'\n+`-V\'\n+ Print the version of Autoconf used to generate the `configure\'\n+ script, and exit.\n+\n+`--cache-file=FILE\'\n+ Enable the cache: use and save the results of the tests in FILE,\n+ traditionally `config.cache\'. FILE defaults to `/dev/null\' to\n+ disable caching.\n+\n+`--config-cache\'\n+`-C\'\n+ Alias for `--cache-file=config.cache\'.\n+\n+`--quiet\'\n+`--silent\'\n+`-q\'\n+ Do not print messages saying which checks are being made. To\n+ suppress all normal output, redirect it to `/dev/null\' (any error\n+ messages will still be shown).\n+\n+`--srcdir=DIR\'\n+ Look for the package\'s source code in directory DIR. Usually\n+ `configure\' can determine that directory automatically.\n+\n+`--prefix=DIR\'\n+ Use DIR as the installation prefix. *note Installation Names::\n+ for more details, including other options available for fine-tuning\n+ the installation locations.\n+\n+`--no-create\'\n+`-n\'\n+ Run the configure checks, but stop before creating any output\n+ files.\n+\n+`configure\' also accepts some other, not widely useful, options. Run\n+`configure --help\' for more details.\n+\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/Makefile.am --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/Makefile.am Thu Jul 21 13:35:08 2011 -0400 |
b |
@@ -0,0 +1,25 @@ +# Some useful automake documentation: +# http://www.openismus.com/documents/linux/automake/automake.shtml +# http://www.bioinf.uni-freiburg.de/~mmann/HowTo/automake.html + +# we do not use GNU-style files: NEWS README AUTHORS ChangeLog +#AUTOMAKE_OPTIONS = foreign + +ACLOCAL_AMFLAGS=-I m4 +SUBDIRS = src +# SUBDIRS = src tests + +dist_doc_DATA = README + +EXTRA_DIST = Doxyfile + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = clustalo.pc + + +bug-tests: all + cd bug-tests && $(SHELL) bug-tests.sh; + +#dist-hook: +# svnversion . > $(distdir)/src/svnversion.h 2>/dev/null + |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/Makefile.in --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/Makefile.in Thu Jul 21 13:35:08 2011 -0400 |
[ |
b'@@ -0,0 +1,804 @@\n+# Makefile.in generated by automake 1.11.1 from Makefile.am.\n+# @configure_input@\n+\n+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,\n+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,\n+# Inc.\n+# This Makefile.in is free software; the Free Software Foundation\n+# gives unlimited permission to copy and/or distribute it,\n+# with or without modifications, as long as this notice is preserved.\n+\n+# This program is distributed in the hope that it will be useful,\n+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without\n+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A\n+# PARTICULAR PURPOSE.\n+\n+@SET_MAKE@\n+\n+# Some useful automake documentation:\n+# http://www.openismus.com/documents/linux/automake/automake.shtml\n+# http://www.bioinf.uni-freiburg.de/~mmann/HowTo/automake.html\n+\n+# we do not use GNU-style files: NEWS README AUTHORS ChangeLog\n+#AUTOMAKE_OPTIONS = foreign\n+\n+VPATH = @srcdir@\n+pkgdatadir = $(datadir)/@PACKAGE@\n+pkgincludedir = $(includedir)/@PACKAGE@\n+pkglibdir = $(libdir)/@PACKAGE@\n+pkglibexecdir = $(libexecdir)/@PACKAGE@\n+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd\n+install_sh_DATA = $(install_sh) -c -m 644\n+install_sh_PROGRAM = $(install_sh) -c\n+install_sh_SCRIPT = $(install_sh) -c\n+INSTALL_HEADER = $(INSTALL_DATA)\n+transform = $(program_transform_name)\n+NORMAL_INSTALL = :\n+PRE_INSTALL = :\n+POST_INSTALL = :\n+NORMAL_UNINSTALL = :\n+PRE_UNINSTALL = :\n+POST_UNINSTALL = :\n+build_triplet = @build@\n+host_triplet = @host@\n+subdir = .\n+DIST_COMMON = README $(am__configure_deps) $(dist_doc_DATA) \\\n+\t$(srcdir)/Doxyfile.in $(srcdir)/Makefile.am \\\n+\t$(srcdir)/Makefile.in $(srcdir)/clustalo.pc.in \\\n+\t$(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \\\n+\tTODO config.guess config.sub depcomp install-sh ltmain.sh \\\n+\tmissing\n+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4\n+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_prefix_config_h.m4 \\\n+\t$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \\\n+\t$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \\\n+\t$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/ax_openmp.m4 \\\n+\t$(top_srcdir)/configure.ac\n+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \\\n+\t$(ACLOCAL_M4)\n+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \\\n+ configure.lineno config.status.lineno\n+mkinstalldirs = $(install_sh) -d\n+CONFIG_HEADER = $(top_builddir)/src/config.h\n+CONFIG_CLEAN_FILES = clustalo.pc Doxyfile\n+CONFIG_CLEAN_VPATH_FILES =\n+SOURCES =\n+DIST_SOURCES =\n+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \\\n+\thtml-recursive info-recursive install-data-recursive \\\n+\tinstall-dvi-recursive install-exec-recursive \\\n+\tinstall-html-recursive install-info-recursive \\\n+\tinstall-pdf-recursive install-ps-recursive install-recursive \\\n+\tinstallcheck-recursive installdirs-recursive pdf-recursive \\\n+\tps-recursive uninstall-recursive\n+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed \'s|.|.|g\'`;\n+am__vpath_adj = case $$p in \\\n+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \\\n+ *) f=$$p;; \\\n+ esac;\n+am__strip_dir = f=`echo $$p | sed -e \'s|^.*/||\'`;\n+am__install_max = 40\n+am__nobase_strip_setup = \\\n+ srcdirstrip=`echo "$(srcdir)" | sed \'s/[].[^$$\\\\*|]/\\\\\\\\&/g\'`\n+am__nobase_strip = \\\n+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"\n+am__nobase_list = $(am__nobase_strip_setup); \\\n+ for p in $$list; do echo "$$p $$p"; done | \\\n+ sed "s| $$srcdirstrip/| |;"\' / .*\\//!s/ .*/ ./; s,\\( .*\\)/[^/]*$$,\\1,\' | \\\n+ $(AWK) \'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \\\n+ if (++n[$$2] == $(am__install_max)) \\\n+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \\\n+ END { for (dir in files) print dir, files[dir] }\'\n+am__base_list = \\\n+ sed \'$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\\n/ /g\' | \\\n+ sed \'$$!N;$$!N;$$!N;$$!N;s/\\n/ /g\'\n+am__installdirs = "$(DESTDIR)$(docdir)" "$(DESTDIR)$(pkgconfigdir)"\n+DATA = '..b' distcleancheck can only run from a VPATH build" ; \\\n+\t exit 1 ; \\\n+\tfi\n+\t@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \\\n+\t || { echo "ERROR: files left in build directory after distclean:" ; \\\n+\t $(distcleancheck_listfiles) ; \\\n+\t exit 1; } >&2\n+check-am: all-am\n+check: check-recursive\n+all-am: Makefile $(DATA)\n+installdirs: installdirs-recursive\n+installdirs-am:\n+\tfor dir in "$(DESTDIR)$(docdir)" "$(DESTDIR)$(pkgconfigdir)"; do \\\n+\t test -z "$$dir" || $(MKDIR_P) "$$dir"; \\\n+\tdone\n+install: install-recursive\n+install-exec: install-exec-recursive\n+install-data: install-data-recursive\n+uninstall: uninstall-recursive\n+\n+install-am: all-am\n+\t@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am\n+\n+installcheck: installcheck-recursive\n+install-strip:\n+\t$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \\\n+\t install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \\\n+\t `test -z \'$(STRIP)\' || \\\n+\t echo "INSTALL_PROGRAM_ENV=STRIPPROG=\'$(STRIP)\'"` install\n+mostlyclean-generic:\n+\n+clean-generic:\n+\n+distclean-generic:\n+\t-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)\n+\t-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)\n+\n+maintainer-clean-generic:\n+\t@echo "This command is intended for maintainers to use"\n+\t@echo "it deletes files that may require special tools to rebuild."\n+clean: clean-recursive\n+\n+clean-am: clean-generic clean-libtool mostlyclean-am\n+\n+distclean: distclean-recursive\n+\t-rm -f $(am__CONFIG_DISTCLEAN_FILES)\n+\t-rm -f Makefile\n+distclean-am: clean-am distclean-generic distclean-libtool \\\n+\tdistclean-tags\n+\n+dvi: dvi-recursive\n+\n+dvi-am:\n+\n+html: html-recursive\n+\n+html-am:\n+\n+info: info-recursive\n+\n+info-am:\n+\n+install-data-am: install-dist_docDATA install-pkgconfigDATA\n+\n+install-dvi: install-dvi-recursive\n+\n+install-dvi-am:\n+\n+install-exec-am:\n+\n+install-html: install-html-recursive\n+\n+install-html-am:\n+\n+install-info: install-info-recursive\n+\n+install-info-am:\n+\n+install-man:\n+\n+install-pdf: install-pdf-recursive\n+\n+install-pdf-am:\n+\n+install-ps: install-ps-recursive\n+\n+install-ps-am:\n+\n+installcheck-am:\n+\n+maintainer-clean: maintainer-clean-recursive\n+\t-rm -f $(am__CONFIG_DISTCLEAN_FILES)\n+\t-rm -rf $(top_srcdir)/autom4te.cache\n+\t-rm -f Makefile\n+maintainer-clean-am: distclean-am maintainer-clean-generic\n+\n+mostlyclean: mostlyclean-recursive\n+\n+mostlyclean-am: mostlyclean-generic mostlyclean-libtool\n+\n+pdf: pdf-recursive\n+\n+pdf-am:\n+\n+ps: ps-recursive\n+\n+ps-am:\n+\n+uninstall-am: uninstall-dist_docDATA uninstall-pkgconfigDATA\n+\n+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \\\n+\tinstall-am install-strip tags-recursive\n+\n+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \\\n+\tall all-am am--refresh check check-am clean clean-generic \\\n+\tclean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \\\n+\tdist-gzip dist-lzma dist-shar dist-tarZ dist-xz dist-zip \\\n+\tdistcheck distclean distclean-generic distclean-libtool \\\n+\tdistclean-tags distcleancheck distdir distuninstallcheck dvi \\\n+\tdvi-am html html-am info info-am install install-am \\\n+\tinstall-data install-data-am install-dist_docDATA install-dvi \\\n+\tinstall-dvi-am install-exec install-exec-am install-html \\\n+\tinstall-html-am install-info install-info-am install-man \\\n+\tinstall-pdf install-pdf-am install-pkgconfigDATA install-ps \\\n+\tinstall-ps-am install-strip installcheck installcheck-am \\\n+\tinstalldirs installdirs-am maintainer-clean \\\n+\tmaintainer-clean-generic mostlyclean mostlyclean-generic \\\n+\tmostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \\\n+\tuninstall uninstall-am uninstall-dist_docDATA \\\n+\tuninstall-pkgconfigDATA\n+\n+\n+bug-tests: all\n+\tcd bug-tests && $(SHELL) bug-tests.sh;\n+\n+#dist-hook:\n+#\tsvnversion . > $(distdir)/src/svnversion.h 2>/dev/null\n+\n+# Tell versions [3.59,3.63) of GNU make to not export all variables.\n+# Otherwise a system limit (for SysV at least) may be exceeded.\n+.NOEXPORT:\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/README --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/README Thu Jul 21 13:35:08 2011 -0400 |
[ |
b'@@ -0,0 +1,619 @@\n+\r\n+\r\n+CLUSTAL-OMEGA is a general purpose multiple sequence alignment program\r\n+for proteins.\r\n+\r\n+\r\n+\r\n+INTRODUCTION\r\n+\r\n+Clustal-Omega is a general purpose multiple sequence alignment (MSA)\r\n+program for proteins. It produces high quality MSAs and is capable of\r\n+handling data-sets of hundreds of thousands of sequences in reasonable\r\n+time.\r\n+\r\n+In default mode, users give a file of sequences to be aligned and\r\n+these are clustered to produce a guide tree and this is used to guide\r\n+a "progressive alignment" of the sequences. There are also facilities\r\n+for aligning existing alignments to each other, aligning a sequence to\r\n+an alignment and for using a hidden Markov model (HMM) to help guide\r\n+an alignment of new sequences that are homologous to the sequences\r\n+used to make the HMM. This latter procedure is referred to as\r\n+"external profile alignment" or EPA.\r\n+\r\n+Clustal-Omega uses HMMs for the alignment engine, based on the HHalign\r\n+package from Johannes Soeding [1]. Guide trees are made using an\r\n+enhanced version of mBed [2] which can cluster very large numbers of\r\n+sequences in O(N*log(N)) time. Multiple alignment then proceeds by\r\n+aligning larger and larger alignments using HHalign, following the\r\n+clustering given by the guide tree.\r\n+\r\n+In its current form Clustal-Omega can only align protein sequences but\r\n+not DNA/RNA sequences. It is envisioned that DNA/RNA will become\r\n+available in a future version.\r\n+\r\n+\r\n+\r\n+SEQUENCE INPUT:\r\n+\r\n+-i, --in, --infile={<file>,-}\r\n+\tMultiple sequence input file (- for stdin)\r\n+\r\n+--hmm-in=<file>\r\n+\tHMM input files\r\n+\r\n+--dealign\r\n+\tDealign input sequences\r\n+\r\n+--profile1, --p1=<file>\r\n+\tPre-aligned multiple sequence file (aligned columns will be kept fixed)\r\n+\r\n+--profile2, --p2=<file>\r\n+\tPre-aligned multiple sequence file (aligned columns will be kept fixed)\r\n+\r\n+\r\n+For sequence and profile input Clustal-Omega uses the Squid library\r\n+from Sean Eddy [3].\r\n+\r\n+\r\n+Clustal-Omega accepts 3 types of sequence input: (i) a sequence file\r\n+with un-aligned or aligned sequences, (ii) profiles (a multiple\r\n+alignment in a file) of aligned sequences, (iii) a HMM. Valid\r\n+combinations of the above are:\r\n+\r\n+(a) one file with un-aligned or aligned sequences (i); the sequences\r\n+ will be aligned, and the alignment will be written out. For this\r\n+ mode use the -i flag. If the sequences are aligned (all sequences\r\n+ have the same length and at least one sequence has at least one\r\n+ gap), then the alignment is turned into a HMM, the sequences are\r\n+ de-aligned and the now un-aligned sequences are aligned using the\r\n+ HMM as an External Profile for External Profile Alignment (EPA).\r\n+ If no EPA is desired use the --dealign flag.\r\n+\r\n+ Use the above option to make a multiple alignment from a set of\r\n+ sequences. A sequence file must contain more than one sequence (at\r\n+ least two sequences).\r\n+\r\n+(b) two profiles (ii)+(ii); the columns in each profile will be kept\r\n+ fixed and the alignment of the two profiles will be written\r\n+ out. Use the --p1 and --p2 flags for this mode.\r\n+\r\n+ Use this option to align two alignments (profiles) together.\r\n+\r\n+(c) one file with un/aligned sequences (i) and one profile (ii); the\r\n+ profile is converted into a HMM and the un-aligned sequences will\r\n+ be multiply aligned (using the HMM background information) to form\r\n+ a profile; this constructed profile is aligned with the input\r\n+ profile; the columns in each profile (the original one and the one\r\n+ created from the un-aligned sequences) will be kept fixed and the\r\n+ alignment of the two profiles will be written out. Use the -i flag\r\n+ in conjunction with the --p1 flag for this mode.\r\n+ The un/aligned sequences file (i) must contain at least two\r\n+ sequences. If a single sequence has to be aligned with a profile\r\n+ the profile-profile option (b) has to be used.\r\n+\r\n+ Use the above option to add new sequences to an ex'..b'lls Clustal-Omega to\r\n+erase all alignment information and re-align the sequences from\r\n+scratch. As there are several thousand sequences calculating a full\r\n+distance matrix may be slow. Setting the --full flag specifically\r\n+selects the full distance mode over the default mBed mode. The\r\n+alignment is then written out in Vienna format (fasta format all on\r\n+one line, no line breaks per sequence) to file PF00042_full.vie.\r\n+\r\n+\r\n+./clustalo -i PF00042_full.fa --dealign --outfmt=vie -o PF00042_full.vie --force\r\n+\r\n+Clustal-Omega reads the file PF00042_full.fa. This file contains\r\n+several thousand aligned sequences. --dealign tells Clustal-Omega to\r\n+erase all alignment information and re-align the sequences from\r\n+scratch. Calculating the distance matrix will be done by mBed\r\n+(default). Clustal-Omega will calculate pairwise distances to a\r\n+small number of reference sequences only. This will give a significant\r\n+speed-up. The speed-up is greater for larger families (more\r\n+sequences). The alignment is then written out in Vienna format (fasta\r\n+format all on one line, no line breaks per sequence) to file\r\n+PF00042_full.vie.\r\n+\r\n+\r\n+./clustalo --p1=globin.sto --p2=PF00042_full.vie -o globin+pf00042.fa\r\n+\r\n+Clustal-Omega reads files globin.sto and PF00042_full.vie of aligned\r\n+sequences (profiles). Both profiles are then aligned. The relative\r\n+positions of residues in both profiles are not changed during this\r\n+alignment, however, columns of gaps may be inserted into the profiles,\r\n+respectively. The final alignment is written to file globin+pf00042.fa\r\n+in fasta format.\r\n+\r\n+\r\n+./clustalo -i globin.fa --p1=PF00042_full.vie -o pf00042+globin.fa\r\n+\r\n+Clustal-Omega reads file globin.fa of un-aligned sequences and the\r\n+profile (of aligned sequences) in file PF00042_full.vie. A HMM is\r\n+created from the profile. This HMM is used to guide the alignment of\r\n+the un-aligned sequences in globin.fa. The profile that was generated\r\n+during this alignment of un-aligned globin.fa sequences is then\r\n+aligned to the input profile PF00042_full.vie. The relative positions\r\n+of residues in profile PF00042_full.vie is not changed during this\r\n+alignment, however, columns of gaps may be inserted into the\r\n+profile. The final alignment is output to file pf00042+globin.fa in\r\n+fasta format. The alignment in this example may be slightly different\r\n+from the alignment in the previous example, because no HMM guidance\r\n+was used generate the profile globin.sto. In this example HMM guidance\r\n+was used to align the sequences in globin.fa; the hope being that this\r\n+intermediate alignment will have profited from the bigger profile.\r\n+\r\n+\r\n+\r\n+LITERATURE:\r\n+\r\n+[1] Johannes Soding (2005) Protein homology detection by HMM-HMM\r\n+ comparison. Bioinformatics 21 (7): 951\xe2\x80\x93960.\r\n+\r\n+[2] Blackshields G, Sievers F, Shi W, Wilm A, Higgins DG. Sequence\r\n+ embedding for fast construction of guide trees for multiple\r\n+ sequence alignment. Algorithms Mol Biol. 2010 May 14;5:21.\r\n+\r\n+[3] http://www.genetics.wustl.edu/eddy/software/#squid\r\n+\r\n+[4] Wilbur and Lipman, 1983; PMID 6572363\r\n+\r\n+[5] Thompson JD, Higgins DG, Gibson TJ. (1994). CLUSTAL W: improving\r\n+ the sensitivity of progressive multiple sequence alignment through\r\n+ sequence weighting, position-specific gap penalties and weight\r\n+ matrix choice. Nucleic Acids Res., 22, 4673-4680.\r\n+\r\n+[6] Larkin MA, Blackshields G, Brown NP, Chenna R, McGettigan PA,\r\n+ McWilliam H, Valentin F, Wallace IM, Wilm A, Lopez R, Thompson JD,\r\n+ Gibson TJ, Higgins DG. (2007). Clustal W and Clustal X version\r\n+ 2.0. Bioinformatics, 23, 2947-2948.\r\n+\r\n+[7] Kimura M (1980). "A simple method for estimating evolutionary\r\n+ rates of base substitutions through comparative studies of\r\n+ nucleotide sequences". Journal of Molecular Evolution 16: 111\xe2\x80\x93120.\r\n+\r\n+[8] Edgar, R.C. (2004) MUSCLE: multiple sequence alignment with high\r\n+ accuracy and high throughput.Nucleic Acids Res. 32(5):1792-1797.\r\n+\r\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/TODO --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/TODO Thu Jul 21 13:35:08 2011 -0400 |
b |
@@ -0,0 +1,45 @@ +IMPORTANT +--------- + +- consensus output (sto,aln) and compatibilety with bioperl/biopython + +- Split Homfam refs in two. Use one part as background HMM, the other parts + for benchmarking + +- Implement meta flags: + accurate: --iterations 3 + default: --mbed --iterations 1 + fast: --mbed + and for more than 10k sequences: --mbed --mbed-iter + +- SSE instructions for hhalign (little use in ClustalO frontend; DD) + / + Patch new code which already contains SSE instructions + + also fix automake/configure then + +- Multi-HMMs; also for Pfam+iteration (FS) + +- Show degradation of alignment quality when using x reference sequences + added to y random/false sequences + (Lio Pachter) + +- Seed pre-alignment with M-Coffee, MSAProbs, ... + +- GUI/API: + Will have to catch/override exits from source. + find . -name \*.c -or -name \*.cpp -or -name \*.h | xargs grep 'exit(' + Also best to allow for user override of + void Fatal(char *msg, ...); + void Error(char *msg, ...); + void Warn(char *msg, ...); + void Info(int level, char *msg, ...); + + +- Soeding: DNA/RNA alignment incl. reading of nucleotide HMMs + +- Automatic HMM-selection/search/download for input + +- Structure input: Psipred predictions are apparently part of their + hhms and should therefore be ready to use (part automatic + HMM-selection) |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/aclocal.m4 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/aclocal.m4 Thu Jul 21 13:35:08 2011 -0400 |
[ |
b"@@ -0,0 +1,997 @@\n+# generated automatically by aclocal 1.11.1 -*- Autoconf -*-\n+\n+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,\n+# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.\n+# This file is free software; the Free Software Foundation\n+# gives unlimited permission to copy and/or distribute it,\n+# with or without modifications, as long as this notice is preserved.\n+\n+# This program is distributed in the hope that it will be useful,\n+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without\n+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A\n+# PARTICULAR PURPOSE.\n+\n+m4_ifndef([AC_AUTOCONF_VERSION],\n+ [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl\n+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.65],,\n+[m4_warning([this file was generated for autoconf 2.65.\n+You have another version of autoconf. It may work, but is not guaranteed to.\n+If you have problems, you may need to regenerate the build system entirely.\n+To do so, use the procedure documented by the package, typically `autoreconf'.])])\n+\n+# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.\n+#\n+# This file is free software; the Free Software Foundation\n+# gives unlimited permission to copy and/or distribute it,\n+# with or without modifications, as long as this notice is preserved.\n+\n+# AM_AUTOMAKE_VERSION(VERSION)\n+# ----------------------------\n+# Automake X.Y traces this macro to ensure aclocal.m4 has been\n+# generated from the m4 files accompanying Automake X.Y.\n+# (This private macro should not be called outside this file.)\n+AC_DEFUN([AM_AUTOMAKE_VERSION],\n+[am__api_version='1.11'\n+dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to\n+dnl require some minimum version. Point them to the right macro.\n+m4_if([$1], [1.11.1], [],\n+ [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl\n+])\n+\n+# _AM_AUTOCONF_VERSION(VERSION)\n+# -----------------------------\n+# aclocal traces this macro to find the Autoconf version.\n+# This is a private macro too. Using m4_define simplifies\n+# the logic in aclocal, which can simply ignore this definition.\n+m4_define([_AM_AUTOCONF_VERSION], [])\n+\n+# AM_SET_CURRENT_AUTOMAKE_VERSION\n+# -------------------------------\n+# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.\n+# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.\n+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],\n+[AM_AUTOMAKE_VERSION([1.11.1])dnl\n+m4_ifndef([AC_AUTOCONF_VERSION],\n+ [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl\n+_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])\n+\n+# AM_AUX_DIR_EXPAND -*- Autoconf -*-\n+\n+# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.\n+#\n+# This file is free software; the Free Software Foundation\n+# gives unlimited permission to copy and/or distribute it,\n+# with or without modifications, as long as this notice is preserved.\n+\n+# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets\n+# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to\n+# `$srcdir', `$srcdir/..', or `$srcdir/../..'.\n+#\n+# Of course, Automake must honor this variable whenever it calls a\n+# tool from the auxiliary directory. The problem is that $srcdir (and\n+# therefore $ac_aux_dir as well) can be either absolute or relative,\n+# depending on how configure is run. This is pretty annoying, since\n+# it makes $ac_aux_dir quite unusable in subdirectories: in the top\n+# source directory, any form will work fine, but in subdirectories a\n+# relative path needs to be adjusted first.\n+#\n+# $ac_aux_dir/missing\n+# fails when called from a subdirectory if $ac_aux_dir is relative\n+# $top_srcdir/$ac_aux_dir/missing\n+# fails if $ac_aux_dir is absolute,\n+# fails when called from a subdirectory in a VPATH build with\n+# a relative $ac_aux_dir\n+#\n+# The reason of the latter failure is that $top_srcdir and $ac_aux_dir\n+# are both prefixed by $srcdir. In "..b' Free Software Foundation, Inc.\n+#\n+# This file is free software; the Free Software Foundation\n+# gives unlimited permission to copy and/or distribute it,\n+# with or without modifications, as long as this notice is preserved.\n+\n+# serial 2\n+\n+# _AM_SUBST_NOTMAKE(VARIABLE)\n+# ---------------------------\n+# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.\n+# This macro is traced by Automake.\n+AC_DEFUN([_AM_SUBST_NOTMAKE])\n+\n+# AM_SUBST_NOTMAKE(VARIABLE)\n+# ---------------------------\n+# Public sister of _AM_SUBST_NOTMAKE.\n+AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])\n+\n+# Check how to create a tarball. -*- Autoconf -*-\n+\n+# Copyright (C) 2004, 2005 Free Software Foundation, Inc.\n+#\n+# This file is free software; the Free Software Foundation\n+# gives unlimited permission to copy and/or distribute it,\n+# with or without modifications, as long as this notice is preserved.\n+\n+# serial 2\n+\n+# _AM_PROG_TAR(FORMAT)\n+# --------------------\n+# Check how to create a tarball in format FORMAT.\n+# FORMAT should be one of `v7\', `ustar\', or `pax\'.\n+#\n+# Substitute a variable $(am__tar) that is a command\n+# writing to stdout a FORMAT-tarball containing the directory\n+# $tardir.\n+# tardir=directory && $(am__tar) > result.tar\n+#\n+# Substitute a variable $(am__untar) that extract such\n+# a tarball read from stdin.\n+# $(am__untar) < result.tar\n+AC_DEFUN([_AM_PROG_TAR],\n+[# Always define AMTAR for backward compatibility.\n+AM_MISSING_PROG([AMTAR], [tar])\n+m4_if([$1], [v7],\n+ [am__tar=\'${AMTAR} chof - "$$tardir"\'; am__untar=\'${AMTAR} xf -\'],\n+ [m4_case([$1], [ustar],, [pax],,\n+ [m4_fatal([Unknown tar format])])\n+AC_MSG_CHECKING([how to create a $1 tar archive])\n+# Loop over all known methods to create a tar archive until one works.\n+_am_tools=\'gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none\'\n+_am_tools=${am_cv_prog_tar_$1-$_am_tools}\n+# Do not fold the above two line into one, because Tru64 sh and\n+# Solaris sh will not grok spaces in the rhs of `-\'.\n+for _am_tool in $_am_tools\n+do\n+ case $_am_tool in\n+ gnutar)\n+ for _am_tar in tar gnutar gtar;\n+ do\n+ AM_RUN_LOG([$_am_tar --version]) && break\n+ done\n+ am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "\'"$$tardir"\'\n+ am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "\'"$tardir"\'\n+ am__untar="$_am_tar -xf -"\n+ ;;\n+ plaintar)\n+ # Must skip GNU tar: if it does not support --format= it doesn\'t create\n+ # ustar tarball either.\n+ (tar --version) >/dev/null 2>&1 && continue\n+ am__tar=\'tar chf - "$$tardir"\'\n+ am__tar_=\'tar chf - "$tardir"\'\n+ am__untar=\'tar xf -\'\n+ ;;\n+ pax)\n+ am__tar=\'pax -L -x $1 -w "$$tardir"\'\n+ am__tar_=\'pax -L -x $1 -w "$tardir"\'\n+ am__untar=\'pax -r\'\n+ ;;\n+ cpio)\n+ am__tar=\'find "$$tardir" -print | cpio -o -H $1 -L\'\n+ am__tar_=\'find "$tardir" -print | cpio -o -H $1 -L\'\n+ am__untar=\'cpio -i -H $1 -d\'\n+ ;;\n+ none)\n+ am__tar=false\n+ am__tar_=false\n+ am__untar=false\n+ ;;\n+ esac\n+\n+ # If the value was cached, stop now. We just wanted to have am__tar\n+ # and am__untar set.\n+ test -n "${am_cv_prog_tar_$1}" && break\n+\n+ # tar/untar a dummy directory, and stop if the command works\n+ rm -rf conftest.dir\n+ mkdir conftest.dir\n+ echo GrepMe > conftest.dir/file\n+ AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])\n+ rm -rf conftest.dir\n+ if test -s conftest.tar; then\n+ AM_RUN_LOG([$am__untar <conftest.tar])\n+ grep GrepMe conftest.dir/file >/dev/null 2>&1 && break\n+ fi\n+done\n+rm -rf conftest.dir\n+\n+AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])\n+AC_MSG_RESULT([$am_cv_prog_tar_$1])])\n+AC_SUBST([am__tar])\n+AC_SUBST([am__untar])\n+]) # _AM_PROG_TAR\n+\n+m4_include([m4/ax_prefix_config_h.m4])\n+m4_include([m4/libtool.m4])\n+m4_include([m4/ltoptions.m4])\n+m4_include([m4/ltsugar.m4])\n+m4_include([m4/ltversion.m4])\n+m4_include([m4/lt~obsolete.m4])\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/clustalo.pc.in --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/clustalo.pc.in Thu Jul 21 13:35:08 2011 -0400 |
b |
@@ -0,0 +1,12 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: clustal-omega +Description: @PACKAGE_NAME@ library. +Version: @PACKAGE_VERSION@ +Requires: +Libs: -L${libdir} -lclustalo +Cflags: -I${includedir}/clustalo/ + |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/config.guess --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/config.guess Thu Jul 21 13:35:08 2011 -0400 |
[ |
b'@@ -0,0 +1,1533 @@\n+#! /bin/sh\n+# Attempt to guess a canonical system name.\n+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,\n+# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009\n+# Free Software Foundation, Inc.\n+\n+timestamp=\'2009-06-10\'\n+\n+# This file is free software; you can redistribute it and/or modify it\n+# under the terms of the GNU General Public License as published by\n+# the Free Software Foundation; either version 2 of the License, or\n+# (at your option) any later version.\n+#\n+# This program is distributed in the hope that it will be useful, but\n+# WITHOUT ANY WARRANTY; without even the implied warranty of\n+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n+# General Public License for more details.\n+#\n+# You should have received a copy of the GNU General Public License\n+# along with this program; if not, write to the Free Software\n+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA\n+# 02110-1301, USA.\n+#\n+# As a special exception to the GNU General Public License, if you\n+# distribute this file as part of a program that contains a\n+# configuration script generated by Autoconf, you may include it under\n+# the same distribution terms that you use for the rest of that program.\n+\n+\n+# Originally written by Per Bothner <per@bothner.com>.\n+# Please send patches to <config-patches@gnu.org>. Submit a context\n+# diff and a properly formatted ChangeLog entry.\n+#\n+# This script attempts to guess a canonical system name similar to\n+# config.sub. If it succeeds, it prints the system name on stdout, and\n+# exits with 0. Otherwise, it exits with 1.\n+#\n+# The plan is that this can be called by configure scripts if you\n+# don\'t specify an explicit build system type.\n+\n+me=`echo "$0" | sed -e \'s,.*/,,\'`\n+\n+usage="\\\n+Usage: $0 [OPTION]\n+\n+Output the configuration name of the system \\`$me\' is run on.\n+\n+Operation modes:\n+ -h, --help print this help, then exit\n+ -t, --time-stamp print date of last modification, then exit\n+ -v, --version print version number, then exit\n+\n+Report bugs and patches to <config-patches@gnu.org>."\n+\n+version="\\\n+GNU config.guess ($timestamp)\n+\n+Originally written by Per Bothner.\n+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,\n+2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.\n+\n+This is free software; see the source for copying conditions. There is NO\n+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."\n+\n+help="\n+Try \\`$me --help\' for more information."\n+\n+# Parse command line\n+while test $# -gt 0 ; do\n+ case $1 in\n+ --time-stamp | --time* | -t )\n+ echo "$timestamp" ; exit ;;\n+ --version | -v )\n+ echo "$version" ; exit ;;\n+ --help | --h* | -h )\n+ echo "$usage"; exit ;;\n+ -- ) # Stop option processing\n+ shift; break ;;\n+ - )\t# Use stdin as input.\n+ break ;;\n+ -* )\n+ echo "$me: invalid option $1$help" >&2\n+ exit 1 ;;\n+ * )\n+ break ;;\n+ esac\n+done\n+\n+if test $# != 0; then\n+ echo "$me: too many arguments$help" >&2\n+ exit 1\n+fi\n+\n+trap \'exit 1\' 1 2 15\n+\n+# CC_FOR_BUILD -- compiler used by this script. Note that the use of a\n+# compiler to aid in system detection is discouraged as it requires\n+# temporary files to be created and, as you can see below, it is a\n+# headache to deal with in a portable fashion.\n+\n+# Historically, `CC_FOR_BUILD\' used to be named `HOST_CC\'. We still\n+# use `HOST_CC\' if defined, but it is deprecated.\n+\n+# Portable tmp directory creation inspired by the Autoconf team.\n+\n+set_cc_for_build=\'\n+trap "exitcode=\\$?; (rm -f \\$tmpfiles 2>/dev/null; rmdir \\$tmp 2>/dev/null) && exit \\$exitcode" 0 ;\n+trap "rm -f \\$tmpfiles 2>/dev/null; rmdir \\$tmp 2>/dev/null; exit 1" 1 2 13 15 ;\n+: ${TMPDIR=/tmp} ;\n+ { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||\n+ { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 07'..b'\'s/.*NeXT Mach \\([0-9]*\\).*/\\1/p\') 2>/dev/null`;\n+ if (version < 4)\n+ printf ("%s-next-nextstep%d\\n", __ARCHITECTURE__, version);\n+ else\n+ printf ("%s-next-openstep%d\\n", __ARCHITECTURE__, version);\n+ exit (0);\n+#endif\n+\n+#if defined (MULTIMAX) || defined (n16)\n+#if defined (UMAXV)\n+ printf ("ns32k-encore-sysv\\n"); exit (0);\n+#else\n+#if defined (CMU)\n+ printf ("ns32k-encore-mach\\n"); exit (0);\n+#else\n+ printf ("ns32k-encore-bsd\\n"); exit (0);\n+#endif\n+#endif\n+#endif\n+\n+#if defined (__386BSD__)\n+ printf ("i386-pc-bsd\\n"); exit (0);\n+#endif\n+\n+#if defined (sequent)\n+#if defined (i386)\n+ printf ("i386-sequent-dynix\\n"); exit (0);\n+#endif\n+#if defined (ns32000)\n+ printf ("ns32k-sequent-dynix\\n"); exit (0);\n+#endif\n+#endif\n+\n+#if defined (_SEQUENT_)\n+ struct utsname un;\n+\n+ uname(&un);\n+\n+ if (strncmp(un.version, "V2", 2) == 0) {\n+\tprintf ("i386-sequent-ptx2\\n"); exit (0);\n+ }\n+ if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */\n+\tprintf ("i386-sequent-ptx1\\n"); exit (0);\n+ }\n+ printf ("i386-sequent-ptx\\n"); exit (0);\n+\n+#endif\n+\n+#if defined (vax)\n+# if !defined (ultrix)\n+# include <sys/param.h>\n+# if defined (BSD)\n+# if BSD == 43\n+ printf ("vax-dec-bsd4.3\\n"); exit (0);\n+# else\n+# if BSD == 199006\n+ printf ("vax-dec-bsd4.3reno\\n"); exit (0);\n+# else\n+ printf ("vax-dec-bsd\\n"); exit (0);\n+# endif\n+# endif\n+# else\n+ printf ("vax-dec-bsd\\n"); exit (0);\n+# endif\n+# else\n+ printf ("vax-dec-ultrix\\n"); exit (0);\n+# endif\n+#endif\n+\n+#if defined (alliant) && defined (i860)\n+ printf ("i860-alliant-bsd\\n"); exit (0);\n+#endif\n+\n+ exit (1);\n+}\n+EOF\n+\n+$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&\n+\t{ echo "$SYSTEM_NAME"; exit; }\n+\n+# Apollos put the system type in the environment.\n+\n+test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }\n+\n+# Convex versions that predate uname can use getsysinfo(1)\n+\n+if [ -x /usr/convex/getsysinfo ]\n+then\n+ case `getsysinfo -f cpu_type` in\n+ c1*)\n+\techo c1-convex-bsd\n+\texit ;;\n+ c2*)\n+\tif getsysinfo -f scalar_acc\n+\tthen echo c32-convex-bsd\n+\telse echo c2-convex-bsd\n+\tfi\n+\texit ;;\n+ c34*)\n+\techo c34-convex-bsd\n+\texit ;;\n+ c38*)\n+\techo c38-convex-bsd\n+\texit ;;\n+ c4*)\n+\techo c4-convex-bsd\n+\texit ;;\n+ esac\n+fi\n+\n+cat >&2 <<EOF\n+$0: unable to guess system type\n+\n+This script, last modified $timestamp, has failed to recognize\n+the operating system you are using. It is advised that you\n+download the most up to date version of the config scripts from\n+\n+ http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD\n+and\n+ http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD\n+\n+If the version you run ($0) is already up to date, please\n+send the following data and any information you think might be\n+pertinent to <config-patches@gnu.org> in order to provide the needed\n+information to handle your system.\n+\n+config.guess timestamp = $timestamp\n+\n+uname -m = `(uname -m) 2>/dev/null || echo unknown`\n+uname -r = `(uname -r) 2>/dev/null || echo unknown`\n+uname -s = `(uname -s) 2>/dev/null || echo unknown`\n+uname -v = `(uname -v) 2>/dev/null || echo unknown`\n+\n+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`\n+/bin/uname -X = `(/bin/uname -X) 2>/dev/null`\n+\n+hostinfo = `(hostinfo) 2>/dev/null`\n+/bin/universe = `(/bin/universe) 2>/dev/null`\n+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`\n+/bin/arch = `(/bin/arch) 2>/dev/null`\n+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`\n+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`\n+\n+UNAME_MACHINE = ${UNAME_MACHINE}\n+UNAME_RELEASE = ${UNAME_RELEASE}\n+UNAME_SYSTEM = ${UNAME_SYSTEM}\n+UNAME_VERSION = ${UNAME_VERSION}\n+EOF\n+\n+exit 1\n+\n+# Local variables:\n+# eval: (add-hook \'write-file-hooks \'time-stamp)\n+# time-stamp-start: "timestamp=\'"\n+# time-stamp-format: "%:y-%02m-%02d"\n+# time-stamp-end: "\'"\n+# End:\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/config.sub --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/config.sub Thu Jul 21 13:35:08 2011 -0400 |
[ |
b'@@ -0,0 +1,1693 @@\n+#! /bin/sh\n+# Configuration validation subroutine script.\n+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,\n+# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009\n+# Free Software Foundation, Inc.\n+\n+timestamp=\'2009-06-11\'\n+\n+# This file is (in principle) common to ALL GNU software.\n+# The presence of a machine in this file suggests that SOME GNU software\n+# can handle that machine. It does not imply ALL GNU software can.\n+#\n+# This file is free software; you can redistribute it and/or modify\n+# it under the terms of the GNU General Public License as published by\n+# the Free Software Foundation; either version 2 of the License, or\n+# (at your option) any later version.\n+#\n+# This program is distributed in the hope that it will be useful,\n+# but WITHOUT ANY WARRANTY; without even the implied warranty of\n+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n+# GNU General Public License for more details.\n+#\n+# You should have received a copy of the GNU General Public License\n+# along with this program; if not, write to the Free Software\n+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA\n+# 02110-1301, USA.\n+#\n+# As a special exception to the GNU General Public License, if you\n+# distribute this file as part of a program that contains a\n+# configuration script generated by Autoconf, you may include it under\n+# the same distribution terms that you use for the rest of that program.\n+\n+\n+# Please send patches to <config-patches@gnu.org>. Submit a context\n+# diff and a properly formatted ChangeLog entry.\n+#\n+# Configuration subroutine to validate and canonicalize a configuration type.\n+# Supply the specified configuration type as an argument.\n+# If it is invalid, we print an error message on stderr and exit with code 1.\n+# Otherwise, we print the canonical config type on stdout and succeed.\n+\n+# This file is supposed to be the same for all GNU packages\n+# and recognize all the CPU types, system types and aliases\n+# that are meaningful with *any* GNU software.\n+# Each package is responsible for reporting which valid configurations\n+# it does not support. The user should be able to distinguish\n+# a failure to support a valid configuration from a meaningless\n+# configuration.\n+\n+# The goal of this file is to map all the various variations of a given\n+# machine specification into a single specification in the form:\n+#\tCPU_TYPE-MANUFACTURER-OPERATING_SYSTEM\n+# or in some cases, the newer four-part form:\n+#\tCPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM\n+# It is wrong to echo any other type of specification.\n+\n+me=`echo "$0" | sed -e \'s,.*/,,\'`\n+\n+usage="\\\n+Usage: $0 [OPTION] CPU-MFR-OPSYS\n+ $0 [OPTION] ALIAS\n+\n+Canonicalize a configuration name.\n+\n+Operation modes:\n+ -h, --help print this help, then exit\n+ -t, --time-stamp print date of last modification, then exit\n+ -v, --version print version number, then exit\n+\n+Report bugs and patches to <config-patches@gnu.org>."\n+\n+version="\\\n+GNU config.sub ($timestamp)\n+\n+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,\n+2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.\n+\n+This is free software; see the source for copying conditions. There is NO\n+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."\n+\n+help="\n+Try \\`$me --help\' for more information."\n+\n+# Parse command line\n+while test $# -gt 0 ; do\n+ case $1 in\n+ --time-stamp | --time* | -t )\n+ echo "$timestamp" ; exit ;;\n+ --version | -v )\n+ echo "$version" ; exit ;;\n+ --help | --h* | -h )\n+ echo "$usage"; exit ;;\n+ -- ) # Stop option processing\n+ shift; break ;;\n+ - )\t# Use stdin as input.\n+ break ;;\n+ -* )\n+ echo "$me: invalid option $1$help"\n+ exit 1 ;;\n+\n+ *local*)\n+ # First pass through any local machine types.\n+ echo $1\n+ exit ;;\n+\n+ * )\n+ break ;;\n+ esac\n+done\n+\n+case $# in\n+'..b'of $os.\n+\t\tos=`echo $os | sed \'s/[^-]*-//\'`\n+\t\techo Invalid configuration \\`$1\\\': system \\`$os\\\' not recognized 1>&2\n+\t\texit 1\n+\t\t;;\n+esac\n+else\n+\n+# Here we handle the default operating systems that come with various machines.\n+# The value should be what the vendor currently ships out the door with their\n+# machine or put another way, the most popular os provided with the machine.\n+\n+# Note that if you\'re going to try to match "-MANUFACTURER" here (say,\n+# "-sun"), then you have to tell the case statement up towards the top\n+# that MANUFACTURER isn\'t an operating system. Otherwise, code above\n+# will signal an error saying that MANUFACTURER isn\'t an operating\n+# system, and we\'ll never get to this point.\n+\n+case $basic_machine in\n+ score-*)\n+\t\tos=-elf\n+\t\t;;\n+ spu-*)\n+\t\tos=-elf\n+\t\t;;\n+\t*-acorn)\n+\t\tos=-riscix1.2\n+\t\t;;\n+\tarm*-rebel)\n+\t\tos=-linux\n+\t\t;;\n+\tarm*-semi)\n+\t\tos=-aout\n+\t\t;;\n+ c4x-* | tic4x-*)\n+ \tos=-coff\n+\t\t;;\n+\t# This must come before the *-dec entry.\n+\tpdp10-*)\n+\t\tos=-tops20\n+\t\t;;\n+\tpdp11-*)\n+\t\tos=-none\n+\t\t;;\n+\t*-dec | vax-*)\n+\t\tos=-ultrix4.2\n+\t\t;;\n+\tm68*-apollo)\n+\t\tos=-domain\n+\t\t;;\n+\ti386-sun)\n+\t\tos=-sunos4.0.2\n+\t\t;;\n+\tm68000-sun)\n+\t\tos=-sunos3\n+\t\t# This also exists in the configure program, but was not the\n+\t\t# default.\n+\t\t# os=-sunos4\n+\t\t;;\n+\tm68*-cisco)\n+\t\tos=-aout\n+\t\t;;\n+ mep-*)\n+\t\tos=-elf\n+\t\t;;\n+\tmips*-cisco)\n+\t\tos=-elf\n+\t\t;;\n+\tmips*-*)\n+\t\tos=-elf\n+\t\t;;\n+\tor32-*)\n+\t\tos=-coff\n+\t\t;;\n+\t*-tti)\t# must be before sparc entry or we get the wrong os.\n+\t\tos=-sysv3\n+\t\t;;\n+\tsparc-* | *-sun)\n+\t\tos=-sunos4.1.1\n+\t\t;;\n+\t*-be)\n+\t\tos=-beos\n+\t\t;;\n+\t*-haiku)\n+\t\tos=-haiku\n+\t\t;;\n+\t*-ibm)\n+\t\tos=-aix\n+\t\t;;\n+ \t*-knuth)\n+\t\tos=-mmixware\n+\t\t;;\n+\t*-wec)\n+\t\tos=-proelf\n+\t\t;;\n+\t*-winbond)\n+\t\tos=-proelf\n+\t\t;;\n+\t*-oki)\n+\t\tos=-proelf\n+\t\t;;\n+\t*-hp)\n+\t\tos=-hpux\n+\t\t;;\n+\t*-hitachi)\n+\t\tos=-hiux\n+\t\t;;\n+\ti860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)\n+\t\tos=-sysv\n+\t\t;;\n+\t*-cbm)\n+\t\tos=-amigaos\n+\t\t;;\n+\t*-dg)\n+\t\tos=-dgux\n+\t\t;;\n+\t*-dolphin)\n+\t\tos=-sysv3\n+\t\t;;\n+\tm68k-ccur)\n+\t\tos=-rtu\n+\t\t;;\n+\tm88k-omron*)\n+\t\tos=-luna\n+\t\t;;\n+\t*-next )\n+\t\tos=-nextstep\n+\t\t;;\n+\t*-sequent)\n+\t\tos=-ptx\n+\t\t;;\n+\t*-crds)\n+\t\tos=-unos\n+\t\t;;\n+\t*-ns)\n+\t\tos=-genix\n+\t\t;;\n+\ti370-*)\n+\t\tos=-mvs\n+\t\t;;\n+\t*-next)\n+\t\tos=-nextstep3\n+\t\t;;\n+\t*-gould)\n+\t\tos=-sysv\n+\t\t;;\n+\t*-highlevel)\n+\t\tos=-bsd\n+\t\t;;\n+\t*-encore)\n+\t\tos=-bsd\n+\t\t;;\n+\t*-sgi)\n+\t\tos=-irix\n+\t\t;;\n+\t*-siemens)\n+\t\tos=-sysv4\n+\t\t;;\n+\t*-masscomp)\n+\t\tos=-rtu\n+\t\t;;\n+\tf30[01]-fujitsu | f700-fujitsu)\n+\t\tos=-uxpv\n+\t\t;;\n+\t*-rom68k)\n+\t\tos=-coff\n+\t\t;;\n+\t*-*bug)\n+\t\tos=-coff\n+\t\t;;\n+\t*-apple)\n+\t\tos=-macos\n+\t\t;;\n+\t*-atari*)\n+\t\tos=-mint\n+\t\t;;\n+\t*)\n+\t\tos=-none\n+\t\t;;\n+esac\n+fi\n+\n+# Here we handle the case where we know the os, and the CPU type, but not the\n+# manufacturer. We pick the logical manufacturer.\n+vendor=unknown\n+case $basic_machine in\n+\t*-unknown)\n+\t\tcase $os in\n+\t\t\t-riscix*)\n+\t\t\t\tvendor=acorn\n+\t\t\t\t;;\n+\t\t\t-sunos*)\n+\t\t\t\tvendor=sun\n+\t\t\t\t;;\n+\t\t\t-cnk*|-aix*)\n+\t\t\t\tvendor=ibm\n+\t\t\t\t;;\n+\t\t\t-beos*)\n+\t\t\t\tvendor=be\n+\t\t\t\t;;\n+\t\t\t-hpux*)\n+\t\t\t\tvendor=hp\n+\t\t\t\t;;\n+\t\t\t-mpeix*)\n+\t\t\t\tvendor=hp\n+\t\t\t\t;;\n+\t\t\t-hiux*)\n+\t\t\t\tvendor=hitachi\n+\t\t\t\t;;\n+\t\t\t-unos*)\n+\t\t\t\tvendor=crds\n+\t\t\t\t;;\n+\t\t\t-dgux*)\n+\t\t\t\tvendor=dg\n+\t\t\t\t;;\n+\t\t\t-luna*)\n+\t\t\t\tvendor=omron\n+\t\t\t\t;;\n+\t\t\t-genix*)\n+\t\t\t\tvendor=ns\n+\t\t\t\t;;\n+\t\t\t-mvs* | -opened*)\n+\t\t\t\tvendor=ibm\n+\t\t\t\t;;\n+\t\t\t-os400*)\n+\t\t\t\tvendor=ibm\n+\t\t\t\t;;\n+\t\t\t-ptx*)\n+\t\t\t\tvendor=sequent\n+\t\t\t\t;;\n+\t\t\t-tpf*)\n+\t\t\t\tvendor=ibm\n+\t\t\t\t;;\n+\t\t\t-vxsim* | -vxworks* | -windiss*)\n+\t\t\t\tvendor=wrs\n+\t\t\t\t;;\n+\t\t\t-aux*)\n+\t\t\t\tvendor=apple\n+\t\t\t\t;;\n+\t\t\t-hms*)\n+\t\t\t\tvendor=hitachi\n+\t\t\t\t;;\n+\t\t\t-mpw* | -macos*)\n+\t\t\t\tvendor=apple\n+\t\t\t\t;;\n+\t\t\t-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)\n+\t\t\t\tvendor=atari\n+\t\t\t\t;;\n+\t\t\t-vos*)\n+\t\t\t\tvendor=stratus\n+\t\t\t\t;;\n+\t\tesac\n+\t\tbasic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`\n+\t\t;;\n+esac\n+\n+echo $basic_machine$os\n+exit\n+\n+# Local variables:\n+# eval: (add-hook \'write-file-hooks \'time-stamp)\n+# time-stamp-start: "timestamp=\'"\n+# time-stamp-format: "%:y-%02m-%02d"\n+# time-stamp-end: "\'"\n+# End:\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/configure --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/configure Thu Jul 21 13:35:08 2011 -0400 |
[ |
b'@@ -0,0 +1,19827 @@\n+#! /bin/sh\n+# Guess values for system-dependent variables and create Makefiles.\n+# Generated by GNU Autoconf 2.65 for Clustal Omega 1.0.2.\n+#\n+# Report bugs to <clustalw@ucd.ie>.\n+#\n+#\n+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,\n+# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,\n+# Inc.\n+#\n+#\n+# This configure script is free software; the Free Software Foundation\n+# gives unlimited permission to copy, distribute and modify it.\n+## -------------------- ##\n+## M4sh Initialization. ##\n+## -------------------- ##\n+\n+# Be more Bourne compatible\n+DUALCASE=1; export DUALCASE # for MKS sh\n+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :\n+ emulate sh\n+ NULLCMD=:\n+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which\n+ # is contrary to our usage. Disable this feature.\n+ alias -g \'${1+"$@"}\'=\'"$@"\'\n+ setopt NO_GLOB_SUBST\n+else\n+ case `(set -o) 2>/dev/null` in #(\n+ *posix*) :\n+ set -o posix ;; #(\n+ *) :\n+ ;;\n+esac\n+fi\n+\n+\n+as_nl=\'\n+\'\n+export as_nl\n+# Printing a long string crashes Solaris 7 /usr/bin/printf.\n+as_echo=\'\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'\n+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo\n+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo\n+# Prefer a ksh shell builtin over an external printf program on Solaris,\n+# but without wasting forks for bash or zsh.\n+if test -z "$BASH_VERSION$ZSH_VERSION" \\\n+ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then\n+ as_echo=\'print -r --\'\n+ as_echo_n=\'print -rn --\'\n+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then\n+ as_echo=\'printf %s\\n\'\n+ as_echo_n=\'printf %s\'\n+else\n+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then\n+ as_echo_body=\'eval /usr/ucb/echo -n "$1$as_nl"\'\n+ as_echo_n=\'/usr/ucb/echo -n\'\n+ else\n+ as_echo_body=\'eval expr "X$1" : "X\\\\(.*\\\\)"\'\n+ as_echo_n_body=\'eval\n+ arg=$1;\n+ case $arg in #(\n+ *"$as_nl"*)\n+\texpr "X$arg" : "X\\\\(.*\\\\)$as_nl";\n+\targ=`expr "X$arg" : ".*$as_nl\\\\(.*\\\\)"`;;\n+ esac;\n+ expr "X$arg" : "X\\\\(.*\\\\)" | tr -d "$as_nl"\n+ \'\n+ export as_echo_n_body\n+ as_echo_n=\'sh -c $as_echo_n_body as_echo\'\n+ fi\n+ export as_echo_body\n+ as_echo=\'sh -c $as_echo_body as_echo\'\n+fi\n+\n+# The user is always right.\n+if test "${PATH_SEPARATOR+set}" != set; then\n+ PATH_SEPARATOR=:\n+ (PATH=\'/bin;/bin\'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {\n+ (PATH=\'/bin:/bin\'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||\n+ PATH_SEPARATOR=\';\'\n+ }\n+fi\n+\n+\n+# IFS\n+# We need space, tab and new line, in precisely that order. Quoting is\n+# there to prevent editors from complaining about space-tab.\n+# (If _AS_PATH_WALK were called with IFS unset, it would disable word\n+# splitting by setting IFS to empty value.)\n+IFS=" ""\t$as_nl"\n+\n+# Find who we are. Look in the path if we contain no directory separator.\n+case $0 in #((\n+ *[\\\\/]* ) as_myself=$0 ;;\n+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR\n+for as_dir in $PATH\n+do\n+ IFS=$as_save_IFS\n+ test -z "$as_dir" && as_dir=.\n+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break\n+ done\n+IFS=$as_save_IFS\n+\n+ ;;\n+esac\n+# We did not find ourselves, most probably we were run as `sh COMMAND\'\n+# in which case we are not to be found in the path.\n+if test "x$as_myself" = x; then\n+ as_myself=$0\n+fi\n+if test ! -f "$as_myself"; then\n+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2\n+ exit 1\n+fi\n+\n+# Unset variables that we do not need and which cause bugs (e.g. in\n+# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"\n+# suppresses any "Segmentation fault" message there. \'((\' could\n+# trigger a bug in pdksh 5.2.14.\n+for as_var in BASH_ENV ENV MAIL MAILPATH\n+do eval test x\\${$as_var+set} = xset \\\n+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :\n+done\n+PS1=\'$'..b'# Set to "yes" if using DIR/libNAME\\${shared_ext} during linking hardcodes\n+# DIR into the resulting binary.\n+hardcode_direct=$hardcode_direct_CXX\n+\n+# Set to "yes" if using DIR/libNAME\\${shared_ext} during linking hardcodes\n+# DIR into the resulting binary and the resulting library dependency is\n+# "absolute",i.e impossible to change by setting \\${shlibpath_var} if the\n+# library is relocated.\n+hardcode_direct_absolute=$hardcode_direct_absolute_CXX\n+\n+# Set to "yes" if using the -LDIR flag during linking hardcodes DIR\n+# into the resulting binary.\n+hardcode_minus_L=$hardcode_minus_L_CXX\n+\n+# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR\n+# into the resulting binary.\n+hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX\n+\n+# Set to "yes" if building a shared library automatically hardcodes DIR\n+# into the library and all subsequent libraries and executables linked\n+# against it.\n+hardcode_automatic=$hardcode_automatic_CXX\n+\n+# Set to yes if linker adds runtime paths of dependent libraries\n+# to runtime path list.\n+inherit_rpath=$inherit_rpath_CXX\n+\n+# Whether libtool must link a program against all its dependency libraries.\n+link_all_deplibs=$link_all_deplibs_CXX\n+\n+# Fix the shell variable \\$srcfile for the compiler.\n+fix_srcfile_path=$lt_fix_srcfile_path_CXX\n+\n+# Set to "yes" if exported symbols are required.\n+always_export_symbols=$always_export_symbols_CXX\n+\n+# The commands to list exported symbols.\n+export_symbols_cmds=$lt_export_symbols_cmds_CXX\n+\n+# Symbols that should not be listed in the preloaded symbols.\n+exclude_expsyms=$lt_exclude_expsyms_CXX\n+\n+# Symbols that must always be exported.\n+include_expsyms=$lt_include_expsyms_CXX\n+\n+# Commands necessary for linking programs (against libraries) with templates.\n+prelink_cmds=$lt_prelink_cmds_CXX\n+\n+# Specify filename containing input files.\n+file_list_spec=$lt_file_list_spec_CXX\n+\n+# How to hardcode a shared library path into an executable.\n+hardcode_action=$hardcode_action_CXX\n+\n+# The directories searched by this compiler when creating a shared library.\n+compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX\n+\n+# Dependencies to place before and after the objects being linked to\n+# create a shared library.\n+predep_objects=$lt_predep_objects_CXX\n+postdep_objects=$lt_postdep_objects_CXX\n+predeps=$lt_predeps_CXX\n+postdeps=$lt_postdeps_CXX\n+\n+# The library search path used internally by the compiler when linking\n+# a shared library.\n+compiler_lib_search_path=$lt_compiler_lib_search_path_CXX\n+\n+# ### END LIBTOOL TAG CONFIG: CXX\n+_LT_EOF\n+\n+ ;;\n+\n+ esac\n+done # for ac_tag\n+\n+\n+as_fn_exit 0\n+_ACEOF\n+ac_clean_files=$ac_clean_files_save\n+\n+test $ac_write_fail = 0 ||\n+ as_fn_error "write failure creating $CONFIG_STATUS" "$LINENO" 5\n+\n+\n+# configure is writing to config.log, and then calls config.status.\n+# config.status does its own redirection, appending to config.log.\n+# Unfortunately, on DOS this fails, as config.log is still kept open\n+# by configure, so config.status won\'t be able to write to it; its\n+# output is simply discarded. So we exec the FD to /dev/null,\n+# effectively closing config.log, so it can be properly (re)opened and\n+# appended to by config.status. When coming back to configure, we\n+# need to make the FD available again.\n+if test "$no_create" != yes; then\n+ ac_cs_success=:\n+ ac_config_status_args=\n+ test "$silent" = yes &&\n+ ac_config_status_args="$ac_config_status_args --quiet"\n+ exec 5>/dev/null\n+ $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false\n+ exec 5>>config.log\n+ # Use ||, not &&, to avoid exiting from the if with $? = 1, which\n+ # would make configure fail if this is the last instruction.\n+ $ac_cs_success || as_fn_exit $?\n+fi\n+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then\n+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5\n+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}\n+fi\n+\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/configure.ac --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/configure.ac Thu Jul 21 13:35:08 2011 -0400 |
[ |
b'@@ -0,0 +1,499 @@\n+# configure.ac for Clustal Omega\n+#\n+# RCS $Id: configure.ac 256 2011-06-23 13:57:28Z fabian $\n+\n+\n+# release\n+#\n+#AC_INIT([Clustal Omega], [0.1.1], [clustalw@ucd.ie])\n+#PACKAGE_CODENAME="OppidumLeonis"\n+#r238\n+#AC_INIT([Clustal Omega], [0.2.0], [clustalw@ucd.ie])\n+#PACKAGE_CODENAME="IbiMeVidebunt"\n+#r250\n+#AC_INIT([Clustal Omega], [1.0.1], [clustalw@ucd.ie])\n+#PACKAGE_CODENAME="DeshilHollesEamus"\n+#r255\n+AC_INIT([Clustal Omega], [1.0.2], [clustalw@ucd.ie])\n+PACKAGE_CODENAME="DeshilHollesEamus"\n+\n+# The AC_INIT macro can take any source file as an argument. It just\n+# checks that the file is there, which should, in turn, mean that the\n+# source directory is there. AC_INIT generates the following m4\n+# macros, output variables and preprocessor symbols:\n+AC_SUBST(PACKAGE_NAME)\n+AC_SUBST(PACKAGE_TARNAME)\n+AC_SUBST(PACKAGE_VERSION)\n+AC_SUBST(PACKAGE_STRING)\n+AC_SUBST(PACKAGE_BUGREPORT)\n+AC_SUBST(PACKAGE_CODENAME)\n+\n+AC_MSG_NOTICE([\n+\n+ Welcome to $PACKAGE_NAME - version $PACKAGE_VERSION ($PACKAGE_CODENAME)\n+ \n+ +NMMMMMMMMMS= \n+ MMMMM? :MMMMM8 \n+ IMMMMS MMMMM, \n+ ~MMMMN ,MMMMM \n+ =MMMMM MMMMM \n+ ?MMMMM +MMMMM \n+ MMMMMS MMMMM \n+ MMMMM MMMMM: \n+ MMMMM MMMMM+ \n+ MMMMM MMMMM~ \n+ MMMMM MMMMM \n+ MMMMMZ MMMMM \n+ MMMMM ,MMMMZ \n+ MMMM8 MMMM+ \n+ MMMMS MMMM, \n+ MMMMO MMMM \n+ ,N SMMM MMM8 +8 \n+ ,M7 M+ M+ :M8 \n+ ,MMMMMMMMMMMMI MMMMMMMMMMMM8 \n+ ,MMMMMMMMMMMM8 MMMMMMMMMMMM8 \n+ ,MMMMMMMMMMMMN MMMMMMMMMMMM8 \n+ \n+ ])\n+#\n+# Created with http://www.glassgiant.com/ascii/ and Wikipedia\'s Omega\n+# Replaced all dollars with S\'s.\n+#\n+# \n+# ,MMMMMMMMMD: MMMMM \n+# NMMMMMMMMMMMMMM+ SMMMM \n+# DMMMMMMMMMMMMMMMMMM, +MMMM \n+# MMMMMMMMM8ZSO8MMMMMMMM +MMMM \n+# MMMMM7 SMMMM +MMMM \n+# MMMO MM? +MMMM \n+# ?MMI NMIIMMMM \n+# MMM MMMMMMM \n+# MM \n+# MN \n+# MD \n+# MM \n+# MM? ,~+ISON \n+# =MMI MMSOMMMM \n+# MMMZ MMS +MMMM \n+# MMMM8: :NMMM +MMMM \n+# MMMMMMMMMDOODMMMMMMMMM +MMMM \n+# MMMMMMMMMMMMMMMMMMMM +MMMM \n+# OMMMMMMMMMMMMMMZ SMMMM \n+# MMMMMMMMMM+ MMMMM \n+# \n+\n+\n+# AC_MSG_NOTICE([Configuring for your system...])\n+\n+AC_PREREQ(2.6) # 2.60 needed for AC_USE_SYSTEM_EXTENSIONS\n+# consider 2.64 which allows to define a URL as well\n+\n+# The AM_INIT_AUTOMAKE line adds several standard checks. \n+# This macro is always needed for automake\n+# Obsolete: It takes the program name and version number as arguments.\n+AM_INIT_AUTOMAKE\n+\n+# config header: provides a way for people to customise the\n+# configuration for their platform, via #defines. config.h.in can be\n+# generated automatically with the autoheader tool. However, you need\n+# a stamp-h file in your project to'..b'seem to support OpenMP]))\n+# AC_SUBST(OPENMP_CFLAGS)\n+# AC_SUBST(OPENMP_CXXFLAGS)\n+#fi\n+\n+# --- squid\n+#\n+#\n+# Extra checks for squid; see their configure, config.log, squidconf.h\n+# etc. For example, I\'m not sure about USE_HOST_BYTESWAP_FUNCTIONS,\n+# SIZEOF_UNSIGNED_LONG, HAVE_STRTOUL and HAVE_STRTOULL\n+#\n+# Might not just have to set compiler flags but create use squidconf.h.in\n+#\n+# The following hopefully takes about byte ordering (big-endian...).\n+# My hope is that it will set WORDS_BIGENDIAN and\n+# USE_HOST_BYTESWAP_FUNCTIONS (as used by squid) if necessary:\n+#\n+AC_C_BIGENDIAN(AC_MSG_WARN([$PACKAGE_NAME hasn\'t been tested on Big-Endian machines...expecting trouble!]))\n+AC_CHECK_FUNCS([ntohs ntohl ntons ntonl])\n+#\n+AC_CHECK_SIZEOF(unsigned short)\n+AC_CHECK_SIZEOF(unsigned int)\n+AC_CHECK_SIZEOF(unsigned long)\n+AC_CHECK_SIZEOF(unsigned long long)\n+#\n+AC_CHECK_FUNCS([stroul strtoull])\n+AC_CHECK_FUNCS([ftello fseeko])\n+AC_CHECK_FUNCS([ftello64 fseeko64])\n+AC_CHECK_FUNCS([ftell64 fseek64])\n+#\n+AC_TYPE_OFF_T\n+AC_CHECK_SIZEOF(fpos_t)\n+#\n+# struct stat64 and stat64 test:\n+# version 1:\n+#AC_CHECK_TYPE(struct stat64,\n+# [AC_CHECK_FUNC([stat64],\n+# AC_DEFINE([HAVE_STAT64], [1], [Define if you have the stat64 function]))])\n+# version 2:\n+#AC_MSG_CHECKING(for struct stat64)\n+#AC_CACHE_VAL(sc_cv_type_stat64,\n+#[AC_TRY_COMPILE([#include <sys/stat.h>],[struct stat64 s;],\n+#[sc_cv_type_stat64=yes],\n+#[sc_cv_type_stat64=no])])\n+#if test $sc_cv_type_stat64 = yes; then\n+# AC_MSG_RESULT($sc_cv_type_stat64)\n+# AC_CHECK_FUNC([stat64], AC_DEFINE([HAVE_STAT64], [1], [Define if you have the stat64 function]))\n+# #AC_DEFINE(HAVE_STAT64, [1], [Define if you have the stat64 function])\n+#fi\n+#\n+#\n+# Above fails on myosin because storage size of struct 64 is unknown:\n+# ssi.c:480: error: storage size of \xe2\x80\x98s1\xe2\x80\x99 isn\xe2\x80\x99t known \n+#\n+# On my MacBook OS X 10.6 I get:\n+# ssi.c:481: warning: \xe2\x80\x98stat64\xe2\x80\x99 is deprecated (declared at /usr/include/sys/stat.h:465)\n+#\n+# So forget about it: we won\'t use stat64 or define HAVE_STAT64 and\n+# consequently do no tests here\n+#\n+\n+\n+\n+# Add support for the Dmalloc package. If the user runs configure with\n+# --with-dmalloc, then define WITH_DMALLOC and add -ldmalloc to LIBS.\n+AM_WITH_DMALLOC\n+\n+\n+# Check if svnversion is installed\n+#AC_PATH_PROG([SVNVERSION_BIN], [svnversionFIXME], [no])\n+## checking if we build in a subversion WC\n+#wc_found="no";\n+#if test "$SVNVERSION_BIN" != "no"; then\n+# SVNVERSION=`$SVNVERSION_BIN -n $srcdir`\n+# if test $SVNVERSION != "exported";\n+# then\n+# AC_MSG_NOTICE($SVNVERSION);\n+# fi\n+#fi\n+\n+\n+# --- debugging\n+# \n+# \n+#\n+AC_MSG_CHECKING([whether to build with debug information])\n+AC_ARG_ENABLE([debug],\n+ [AS_HELP_STRING([--enable-debug],\n+ [Enable debugging (default=no)])],\n+ [debugit="$enableval"],\n+ [debugit=no])\n+AC_MSG_RESULT([$debugit])\n+\n+if test x"$debugit" = x"yes"; then\n+ # User variables CFLAGS/CXXFLAGS are used last during compilation and\n+ # can therefore overwrite system settings.\n+ #\n+ # if debugging was requested, add debugging info at the end of\n+ # C[XX]FLAGS, which makes sure previous optimisation flags are\n+ # overwritten (normally C[XX]FLAGS should not be modified as they\n+ # are user variables):\n+ # switch off assert etc\n+ # AC_DEFINE([DEBUG],[],[Debug Mode])\n+ CFLAGS="${CFLAGS} -g -ansi -Wall -O0"\n+ CXXFLAGS="${CXXFLAGS} -g -ansi -Wall -O0"\n+else\n+ # switch off assert etc\n+ AC_DEFINE([NDEBUG],[],[No-debug Mode])\n+ # if no debugging is requested, we make optimisation explicit\n+ AM_CXXFLAGS="${AM_CXXFLAGS} -O3"\n+ AM_CFLAGS="${AM_CFLAGS} -O3"\n+fi\n+\n+\n+\n+AC_SUBST([AM_CXXFLAGS])\n+AC_SUBST([AM_CFLAGS])\n+AC_SUBST([AM_LDFLAGS])\n+\n+\n+AC_CONFIG_FILES(Makefile\n+ src/Makefile\n+ clustalo.pc\n+ Doxyfile\n+ src/clustal/Makefile\n+ src/hhalign/Makefile\n+ src/kmpp/Makefile\n+ src/squid/Makefile)\n+AC_OUTPUT\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/depcomp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/depcomp Thu Jul 21 13:35:08 2011 -0400 |
[ |
b'@@ -0,0 +1,630 @@\n+#! /bin/sh\n+# depcomp - compile a program generating dependencies as side-effects\n+\n+scriptversion=2009-04-28.21; # UTC\n+\n+# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free\n+# Software Foundation, Inc.\n+\n+# This program is free software; you can redistribute it and/or modify\n+# it under the terms of the GNU General Public License as published by\n+# the Free Software Foundation; either version 2, or (at your option)\n+# any later version.\n+\n+# This program is distributed in the hope that it will be useful,\n+# but WITHOUT ANY WARRANTY; without even the implied warranty of\n+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n+# GNU General Public License for more details.\n+\n+# You should have received a copy of the GNU General Public License\n+# along with this program. If not, see <http://www.gnu.org/licenses/>.\n+\n+# As a special exception to the GNU General Public License, if you\n+# distribute this file as part of a program that contains a\n+# configuration script generated by Autoconf, you may include it under\n+# the same distribution terms that you use for the rest of that program.\n+\n+# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.\n+\n+case $1 in\n+ \'\')\n+ echo "$0: No command. Try \\`$0 --help\' for more information." 1>&2\n+ exit 1;\n+ ;;\n+ -h | --h*)\n+ cat <<\\EOF\n+Usage: depcomp [--help] [--version] PROGRAM [ARGS]\n+\n+Run PROGRAMS ARGS to compile a file, generating dependencies\n+as side-effects.\n+\n+Environment variables:\n+ depmode Dependency tracking mode.\n+ source Source file read by `PROGRAMS ARGS\'.\n+ object Object file output by `PROGRAMS ARGS\'.\n+ DEPDIR directory where to store dependencies.\n+ depfile Dependency file to output.\n+ tmpdepfile Temporary file to use when outputing dependencies.\n+ libtool Whether libtool is used (yes/no).\n+\n+Report bugs to <bug-automake@gnu.org>.\n+EOF\n+ exit $?\n+ ;;\n+ -v | --v*)\n+ echo "depcomp $scriptversion"\n+ exit $?\n+ ;;\n+esac\n+\n+if test -z "$depmode" || test -z "$source" || test -z "$object"; then\n+ echo "depcomp: Variables source, object and depmode must be set" 1>&2\n+ exit 1\n+fi\n+\n+# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.\n+depfile=${depfile-`echo "$object" |\n+ sed \'s|[^\\\\/]*$|\'${DEPDIR-.deps}\'/&|;s|\\.\\([^.]*\\)$|.P\\1|;s|Pobj$|Po|\'`}\n+tmpdepfile=${tmpdepfile-`echo "$depfile" | sed \'s/\\.\\([^.]*\\)$/.T\\1/\'`}\n+\n+rm -f "$tmpdepfile"\n+\n+# Some modes work just like other modes, but use different flags. We\n+# parameterize here, but still list the modes in the big case below,\n+# to make depend.m4 easier to write. Note that we *cannot* use a case\n+# here, because this file can only contain one case statement.\n+if test "$depmode" = hp; then\n+ # HP compiler uses -M and no extra arg.\n+ gccflag=-M\n+ depmode=gcc\n+fi\n+\n+if test "$depmode" = dashXmstdout; then\n+ # This is just like dashmstdout with a different argument.\n+ dashmflag=-xM\n+ depmode=dashmstdout\n+fi\n+\n+cygpath_u="cygpath -u -f -"\n+if test "$depmode" = msvcmsys; then\n+ # This is just like msvisualcpp but w/o cygpath translation.\n+ # Just convert the backslash-escaped backslashes to single forward\n+ # slashes to satisfy depend.m4\n+ cygpath_u="sed s,\\\\\\\\\\\\\\\\,/,g"\n+ depmode=msvisualcpp\n+fi\n+\n+case "$depmode" in\n+gcc3)\n+## gcc 3 implements dependency tracking that does exactly what\n+## we want. Yay! Note: for some reason libtool 1.4 doesn\'t like\n+## it if -MD -MP comes after the -MF stuff. Hmm.\n+## Unfortunately, FreeBSD c89 acceptance of flags depends upon\n+## the command line argument order; so add the flags where they\n+## appear in depend2.am. Note that the slowdown incurred here\n+## affects only configure: in makefiles, %FASTDEP% shortcuts this.\n+ for arg\n+ do\n+ case $arg in\n+ -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;\n+ *) set fnord "$@" "$arg" ;;\n+ esac\n+ shift # fnord\n+ shift # $arg\n+ done\n+ "$@"\n+ stat=$?\n+ i'..b'around.\n+ sed -e \'s/^\\\\$//\' -e \'/^$/d\' -e \'/:$/d\' | sed -e \'s/$/ :/\' >> "$depfile"\n+ rm -f "$tmpdepfile"\n+ ;;\n+\n+dashXmstdout)\n+ # This case only exists to satisfy depend.m4. It is never actually\n+ # run, as this mode is specially recognized in the preamble.\n+ exit 1\n+ ;;\n+\n+makedepend)\n+ "$@" || exit $?\n+ # Remove any Libtool call\n+ if test "$libtool" = yes; then\n+ while test "X$1" != \'X--mode=compile\'; do\n+ shift\n+ done\n+ shift\n+ fi\n+ # X makedepend\n+ shift\n+ cleared=no eat=no\n+ for arg\n+ do\n+ case $cleared in\n+ no)\n+ set ""; shift\n+ cleared=yes ;;\n+ esac\n+ if test $eat = yes; then\n+ eat=no\n+ continue\n+ fi\n+ case "$arg" in\n+ -D*|-I*)\n+ set fnord "$@" "$arg"; shift ;;\n+ # Strip any option that makedepend may not understand. Remove\n+ # the object too, otherwise makedepend will parse it as a source file.\n+ -arch)\n+ eat=yes ;;\n+ -*|$object)\n+ ;;\n+ *)\n+ set fnord "$@" "$arg"; shift ;;\n+ esac\n+ done\n+ obj_suffix=`echo "$object" | sed \'s/^.*\\././\'`\n+ touch "$tmpdepfile"\n+ ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"\n+ rm -f "$depfile"\n+ cat < "$tmpdepfile" > "$depfile"\n+ sed \'1,2d\' "$tmpdepfile" | tr \' \' \'\n+\' | \\\n+## Some versions of the HPUX 10.20 sed can\'t process this invocation\n+## correctly. Breaking it into two sed invocations is a workaround.\n+ sed -e \'s/^\\\\$//\' -e \'/^$/d\' -e \'/:$/d\' | sed -e \'s/$/ :/\' >> "$depfile"\n+ rm -f "$tmpdepfile" "$tmpdepfile".bak\n+ ;;\n+\n+cpp)\n+ # Important note: in order to support this mode, a compiler *must*\n+ # always write the preprocessed file to stdout.\n+ "$@" || exit $?\n+\n+ # Remove the call to Libtool.\n+ if test "$libtool" = yes; then\n+ while test "X$1" != \'X--mode=compile\'; do\n+ shift\n+ done\n+ shift\n+ fi\n+\n+ # Remove `-o $object\'.\n+ IFS=" "\n+ for arg\n+ do\n+ case $arg in\n+ -o)\n+ shift\n+ ;;\n+ $object)\n+ shift\n+ ;;\n+ *)\n+ set fnord "$@" "$arg"\n+ shift # fnord\n+ shift # $arg\n+ ;;\n+ esac\n+ done\n+\n+ "$@" -E |\n+ sed -n -e \'/^# [0-9][0-9]* "\\([^"]*\\)".*/ s:: \\1 \\\\:p\' \\\n+ -e \'/^#line [0-9][0-9]* "\\([^"]*\\)".*/ s:: \\1 \\\\:p\' |\n+ sed \'$ s: \\\\$::\' > "$tmpdepfile"\n+ rm -f "$depfile"\n+ echo "$object : \\\\" > "$depfile"\n+ cat < "$tmpdepfile" >> "$depfile"\n+ sed < "$tmpdepfile" \'/^$/d;s/^ //;s/ \\\\$//;s/$/ :/\' >> "$depfile"\n+ rm -f "$tmpdepfile"\n+ ;;\n+\n+msvisualcpp)\n+ # Important note: in order to support this mode, a compiler *must*\n+ # always write the preprocessed file to stdout.\n+ "$@" || exit $?\n+\n+ # Remove the call to Libtool.\n+ if test "$libtool" = yes; then\n+ while test "X$1" != \'X--mode=compile\'; do\n+ shift\n+ done\n+ shift\n+ fi\n+\n+ IFS=" "\n+ for arg\n+ do\n+ case "$arg" in\n+ -o)\n+ shift\n+ ;;\n+ $object)\n+ shift\n+ ;;\n+ "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")\n+\tset fnord "$@"\n+\tshift\n+\tshift\n+\t;;\n+ *)\n+\tset fnord "$@" "$arg"\n+\tshift\n+\tshift\n+\t;;\n+ esac\n+ done\n+ "$@" -E 2>/dev/null |\n+ sed -n \'/^#line [0-9][0-9]* "\\([^"]*\\)"/ s::\\1:p\' | $cygpath_u | sort -u > "$tmpdepfile"\n+ rm -f "$depfile"\n+ echo "$object : \\\\" > "$depfile"\n+ sed < "$tmpdepfile" -n -e \'s% %\\\\ %g\' -e \'/^\\(.*\\)$/ s::\t\\1 \\\\:p\' >> "$depfile"\n+ echo "\t" >> "$depfile"\n+ sed < "$tmpdepfile" -n -e \'s% %\\\\ %g\' -e \'/^\\(.*\\)$/ s::\\1\\::p\' >> "$depfile"\n+ rm -f "$tmpdepfile"\n+ ;;\n+\n+msvcmsys)\n+ # This case exists only to let depend.m4 do its work. It works by\n+ # looking at the text of this script. This case will never be run,\n+ # since it is checked for above.\n+ exit 1\n+ ;;\n+\n+none)\n+ exec "$@"\n+ ;;\n+\n+*)\n+ echo "Unknown depmode $depmode" 1>&2\n+ exit 1\n+ ;;\n+esac\n+\n+exit 0\n+\n+# Local Variables:\n+# mode: shell-script\n+# sh-indentation: 2\n+# eval: (add-hook \'write-file-hooks \'time-stamp)\n+# time-stamp-start: "scriptversion="\n+# time-stamp-format: "%:y-%02m-%02d.%02H"\n+# time-stamp-time-zone: "UTC"\n+# time-stamp-end: "; # UTC"\n+# End:\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/install-sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/install-sh Thu Jul 21 13:35:08 2011 -0400 |
[ |
b'@@ -0,0 +1,520 @@\n+#!/bin/sh\n+# install - install a program, script, or datafile\n+\n+scriptversion=2009-04-28.21; # UTC\n+\n+# This originates from X11R5 (mit/util/scripts/install.sh), which was\n+# later released in X11R6 (xc/config/util/install.sh) with the\n+# following copyright and license.\n+#\n+# Copyright (C) 1994 X Consortium\n+#\n+# Permission is hereby granted, free of charge, to any person obtaining a copy\n+# of this software and associated documentation files (the "Software"), to\n+# deal in the Software without restriction, including without limitation the\n+# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n+# sell copies of the Software, and to permit persons to whom the Software is\n+# furnished to do so, subject to the following conditions:\n+#\n+# The above copyright notice and this permission notice shall be included in\n+# all copies or substantial portions of the Software.\n+#\n+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n+# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN\n+# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-\n+# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n+#\n+# Except as contained in this notice, the name of the X Consortium shall not\n+# be used in advertising or otherwise to promote the sale, use or other deal-\n+# ings in this Software without prior written authorization from the X Consor-\n+# tium.\n+#\n+#\n+# FSF changes to this file are in the public domain.\n+#\n+# Calling this script install-sh is preferred over install.sh, to prevent\n+# `make\' implicit rules from creating a file called install from it\n+# when there is no Makefile.\n+#\n+# This script is compatible with the BSD install script, but was written\n+# from scratch.\n+\n+nl=\'\n+\'\n+IFS=" ""\t$nl"\n+\n+# set DOITPROG to echo to test this script\n+\n+# Don\'t use :- since 4.3BSD and earlier shells don\'t like it.\n+doit=${DOITPROG-}\n+if test -z "$doit"; then\n+ doit_exec=exec\n+else\n+ doit_exec=$doit\n+fi\n+\n+# Put in absolute file names if you don\'t have them in your path;\n+# or use environment vars.\n+\n+chgrpprog=${CHGRPPROG-chgrp}\n+chmodprog=${CHMODPROG-chmod}\n+chownprog=${CHOWNPROG-chown}\n+cmpprog=${CMPPROG-cmp}\n+cpprog=${CPPROG-cp}\n+mkdirprog=${MKDIRPROG-mkdir}\n+mvprog=${MVPROG-mv}\n+rmprog=${RMPROG-rm}\n+stripprog=${STRIPPROG-strip}\n+\n+posix_glob=\'?\'\n+initialize_posix_glob=\'\n+ test "$posix_glob" != "?" || {\n+ if (set -f) 2>/dev/null; then\n+ posix_glob=\n+ else\n+ posix_glob=:\n+ fi\n+ }\n+\'\n+\n+posix_mkdir=\n+\n+# Desired mode of installed file.\n+mode=0755\n+\n+chgrpcmd=\n+chmodcmd=$chmodprog\n+chowncmd=\n+mvcmd=$mvprog\n+rmcmd="$rmprog -f"\n+stripcmd=\n+\n+src=\n+dst=\n+dir_arg=\n+dst_arg=\n+\n+copy_on_change=false\n+no_target_directory=\n+\n+usage="\\\n+Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE\n+ or: $0 [OPTION]... SRCFILES... DIRECTORY\n+ or: $0 [OPTION]... -t DIRECTORY SRCFILES...\n+ or: $0 [OPTION]... -d DIRECTORIES...\n+\n+In the 1st form, copy SRCFILE to DSTFILE.\n+In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.\n+In the 4th, create DIRECTORIES.\n+\n+Options:\n+ --help display this help and exit.\n+ --version display version info and exit.\n+\n+ -c (ignored)\n+ -C install only if different (preserve the last data modification time)\n+ -d create directories instead of installing files.\n+ -g GROUP $chgrpprog installed files to GROUP.\n+ -m MODE $chmodprog installed files to MODE.\n+ -o USER $chownprog installed files to USER.\n+ -s $stripprog installed files.\n+ -t DIRECTORY install into DIRECTORY.\n+ -T report an error if DSTFILE is a directory.\n+\n+Environment variables override the default commands:\n+ CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG\n+ RMPROG STRIPPROG\n'..b'\n+\t/*) prefix=\'/\';;\n+\t-*) prefix=\'./\';;\n+\t*) prefix=\'\';;\n+ esac\n+\n+ eval "$initialize_posix_glob"\n+\n+ oIFS=$IFS\n+ IFS=/\n+ $posix_glob set -f\n+ set fnord $dstdir\n+ shift\n+ $posix_glob set +f\n+ IFS=$oIFS\n+\n+ prefixes=\n+\n+ for d\n+ do\n+\ttest -z "$d" && continue\n+\n+\tprefix=$prefix$d\n+\tif test -d "$prefix"; then\n+\t prefixes=\n+\telse\n+\t if $posix_mkdir; then\n+\t (umask=$mkdir_umask &&\n+\t $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break\n+\t # Don\'t fail if two instances are running concurrently.\n+\t test -d "$prefix" || exit 1\n+\t else\n+\t case $prefix in\n+\t *\\\'*) qprefix=`echo "$prefix" | sed "s/\'/\'\\\\\\\\\\\\\\\\\'\'/g"`;;\n+\t *) qprefix=$prefix;;\n+\t esac\n+\t prefixes="$prefixes \'$qprefix\'"\n+\t fi\n+\tfi\n+\tprefix=$prefix/\n+ done\n+\n+ if test -n "$prefixes"; then\n+\t# Don\'t fail if two instances are running concurrently.\n+\t(umask $mkdir_umask &&\n+\t eval "\\$doit_exec \\$mkdirprog $prefixes") ||\n+\t test -d "$dstdir" || exit 1\n+\tobsolete_mkdir_used=true\n+ fi\n+ fi\n+ fi\n+\n+ if test -n "$dir_arg"; then\n+ { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&\n+ { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&\n+ { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||\n+ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1\n+ else\n+\n+ # Make a couple of temp file names in the proper directory.\n+ dsttmp=$dstdir/_inst.$$_\n+ rmtmp=$dstdir/_rm.$$_\n+\n+ # Trap to clean up those temp files at exit.\n+ trap \'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret\' 0\n+\n+ # Copy the file name to the temp name.\n+ (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&\n+\n+ # and set any options; do chmod last to preserve setuid bits.\n+ #\n+ # If any of these fail, we abort the whole thing. If we want to\n+ # ignore errors from any of these, just make sure not to ignore\n+ # errors from the above "$doit $cpprog $src $dsttmp" command.\n+ #\n+ { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&\n+ { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&\n+ { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&\n+ { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&\n+\n+ # If -C, don\'t bother to copy if it wouldn\'t change the file.\n+ if $copy_on_change &&\n+ old=`LC_ALL=C ls -dlL "$dst"\t2>/dev/null` &&\n+ new=`LC_ALL=C ls -dlL "$dsttmp"\t2>/dev/null` &&\n+\n+ eval "$initialize_posix_glob" &&\n+ $posix_glob set -f &&\n+ set X $old && old=:$2:$4:$5:$6 &&\n+ set X $new && new=:$2:$4:$5:$6 &&\n+ $posix_glob set +f &&\n+\n+ test "$old" = "$new" &&\n+ $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1\n+ then\n+ rm -f "$dsttmp"\n+ else\n+ # Rename the file to the real destination.\n+ $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||\n+\n+ # The rename failed, perhaps because mv can\'t rename something else\n+ # to itself, or perhaps because mv is so ancient that it does not\n+ # support -f.\n+ {\n+\t# Now remove or move aside any old file at destination location.\n+\t# We try this two ways since rm can\'t unlink itself on some\n+\t# systems and the destination file might be busy for other\n+\t# reasons. In this case, the final cleanup might fail but the new\n+\t# file should still install successfully.\n+\t{\n+\t test ! -f "$dst" ||\n+\t $doit $rmcmd -f "$dst" 2>/dev/null ||\n+\t { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&\n+\t { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }\n+\t } ||\n+\t { echo "$0: cannot unlink or rename $dst" >&2\n+\t (exit 1); exit 1\n+\t }\n+\t} &&\n+\n+\t# Now rename the file to the real destination.\n+\t$doit $mvcmd "$dsttmp" "$dst"\n+ }\n+ fi || exit 1\n+\n+ trap \'\' 0\n+ fi\n+done\n+\n+# Local variables:\n+# eval: (add-hook \'write-file-hooks \'time-stamp)\n+# time-stamp-start: "scriptversion="\n+# time-stamp-format: "%:y-%02m-%02d.%02H"\n+# time-stamp-time-zone: "UTC"\n+# time-stamp-end: "; # UTC"\n+# End:\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/ltmain.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/ltmain.sh Thu Jul 21 13:35:08 2011 -0400 |
[ |
b'@@ -0,0 +1,8413 @@\n+# Generated from ltmain.m4sh.\n+\n+# ltmain.sh (GNU libtool) 2.2.6b\n+# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996\n+\n+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 Free Software Foundation, Inc.\n+# This is free software; see the source for copying conditions. There is NO\n+# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n+\n+# GNU Libtool is free software; you can redistribute it and/or modify\n+# it under the terms of the GNU General Public License as published by\n+# the Free Software Foundation; either version 2 of the License, or\n+# (at your option) any later version.\n+#\n+# As a special exception to the GNU General Public License,\n+# if you distribute this file as part of a program or library that\n+# is built using GNU Libtool, you may include this file under the\n+# same distribution terms that you use for the rest of that program.\n+#\n+# GNU Libtool is distributed in the hope that it will be useful, but\n+# WITHOUT ANY WARRANTY; without even the implied warranty of\n+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n+# General Public License for more details.\n+#\n+# You should have received a copy of the GNU General Public License\n+# along with GNU Libtool; see the file COPYING. If not, a copy\n+# can be downloaded from http://www.gnu.org/licenses/gpl.html,\n+# or obtained by writing to the Free Software Foundation, Inc.,\n+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\n+\n+# Usage: $progname [OPTION]... [MODE-ARG]...\n+#\n+# Provide generalized library-building support services.\n+#\n+# --config show all configuration variables\n+# --debug enable verbose shell tracing\n+# -n, --dry-run display commands without modifying any files\n+# --features display basic configuration information and exit\n+# --mode=MODE use operation mode MODE\n+# --preserve-dup-deps don\'t remove duplicate dependency libraries\n+# --quiet, --silent don\'t print informational messages\n+# --tag=TAG use configuration variables from tag TAG\n+# -v, --verbose print informational messages (default)\n+# --version print version information\n+# -h, --help print short or long help message\n+#\n+# MODE must be one of the following:\n+#\n+# clean remove files from the build directory\n+# compile compile a source file into a libtool object\n+# execute automatically set library path, then run a program\n+# finish complete the installation of libtool libraries\n+# install install libraries or executables\n+# link create a library or an executable\n+# uninstall remove libraries from an installed directory\n+#\n+# MODE-ARGS vary depending on the MODE.\n+# Try `$progname --help --mode=MODE\' for a more detailed description of MODE.\n+#\n+# When reporting a bug, please describe a test case to reproduce it and\n+# include the following information:\n+#\n+# host-triplet:\t$host\n+# shell:\t\t$SHELL\n+# compiler:\t\t$LTCC\n+# compiler flags:\t\t$LTCFLAGS\n+# linker:\t\t$LD (gnu? $with_gnu_ld)\n+# $progname:\t\t(GNU libtool) 2.2.6b Debian-2.2.6b-2ubuntu1\n+# automake:\t\t$automake_version\n+# autoconf:\t\t$autoconf_version\n+#\n+# Report bugs to <bug-libtool@gnu.org>.\n+\n+PROGRAM=ltmain.sh\n+PACKAGE=libtool\n+VERSION="2.2.6b Debian-2.2.6b-2ubuntu1"\n+TIMESTAMP=""\n+package_revision=1.3017\n+\n+# Be Bourne compatible\n+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then\n+ emulate sh\n+ NULLCMD=:\n+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which\n+ # is contrary to our usage. Disable this feature.\n+ alias -g \'${1+"$@"}\'=\'"$@"\'\n+ setopt NO_GLOB_SUBST\n+else\n+ case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac\n+fi\n+BIN_SH=xpg4; export BIN_SH # for Tru64\n+DUALCASE=1; ex'..b'mmand in the postuninstall commands.\n+\t func_execute_cmds "$postuninstall_cmds" \'test "$rmforce" = yes || exit_status=1\'\n+\t fi\n+\n+\t if test -n "$old_library"; then\n+\t # Do each command in the old_postuninstall commands.\n+\t func_execute_cmds "$old_postuninstall_cmds" \'test "$rmforce" = yes || exit_status=1\'\n+\t fi\n+\t # FIXME: should reinstall the best remaining shared library.\n+\t ;;\n+\t esac\n+\tfi\n+\t;;\n+\n+ *.lo)\n+\t# Possibly a libtool object, so verify it.\n+\tif func_lalib_p "$file"; then\n+\n+\t # Read the .lo file\n+\t func_source $dir/$name\n+\n+\t # Add PIC object to the list of files to remove.\n+\t if test -n "$pic_object" &&\n+\t test "$pic_object" != none; then\n+\t rmfiles="$rmfiles $dir/$pic_object"\n+\t fi\n+\n+\t # Add non-PIC object to the list of files to remove.\n+\t if test -n "$non_pic_object" &&\n+\t test "$non_pic_object" != none; then\n+\t rmfiles="$rmfiles $dir/$non_pic_object"\n+\t fi\n+\tfi\n+\t;;\n+\n+ *)\n+\tif test "$mode" = clean ; then\n+\t noexename=$name\n+\t case $file in\n+\t *.exe)\n+\t func_stripname \'\' \'.exe\' "$file"\n+\t file=$func_stripname_result\n+\t func_stripname \'\' \'.exe\' "$name"\n+\t noexename=$func_stripname_result\n+\t # $file with .exe has already been added to rmfiles,\n+\t # add $file without .exe\n+\t rmfiles="$rmfiles $file"\n+\t ;;\n+\t esac\n+\t # Do a test to see if this is a libtool program.\n+\t if func_ltwrapper_p "$file"; then\n+\t if func_ltwrapper_executable_p "$file"; then\n+\t func_ltwrapper_scriptname "$file"\n+\t relink_command=\n+\t func_source $func_ltwrapper_scriptname_result\n+\t rmfiles="$rmfiles $func_ltwrapper_scriptname_result"\n+\t else\n+\t relink_command=\n+\t func_source $dir/$noexename\n+\t fi\n+\n+\t # note $name still contains .exe if it was in $file originally\n+\t # as does the version of $file that was added into $rmfiles\n+\t rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"\n+\t if test "$fast_install" = yes && test -n "$relink_command"; then\n+\t rmfiles="$rmfiles $objdir/lt-$name"\n+\t fi\n+\t if test "X$noexename" != "X$name" ; then\n+\t rmfiles="$rmfiles $objdir/lt-${noexename}.c"\n+\t fi\n+\t fi\n+\tfi\n+\t;;\n+ esac\n+ func_show_eval "$RM $rmfiles" \'exit_status=1\'\n+ done\n+ objdir="$origobjdir"\n+\n+ # Try to remove the ${objdir}s in the directories where we deleted files\n+ for dir in $rmdirs; do\n+ if test -d "$dir"; then\n+\tfunc_show_eval "rmdir $dir >/dev/null 2>&1"\n+ fi\n+ done\n+\n+ exit $exit_status\n+}\n+\n+{ test "$mode" = uninstall || test "$mode" = clean; } &&\n+ func_mode_uninstall ${1+"$@"}\n+\n+test -z "$mode" && {\n+ help="$generic_help"\n+ func_fatal_help "you must specify a MODE"\n+}\n+\n+test -z "$exec_cmd" && \\\n+ func_fatal_help "invalid operation mode \\`$mode\'"\n+\n+if test -n "$exec_cmd"; then\n+ eval exec "$exec_cmd"\n+ exit $EXIT_FAILURE\n+fi\n+\n+exit $exit_status\n+\n+\n+# The TAGs below are defined such that we never get into a situation\n+# in which we disable both kinds of libraries. Given conflicting\n+# choices, we go for a static library, that is the most portable,\n+# since we can\'t tell whether shared libraries were disabled because\n+# the user asked for that or because the platform doesn\'t support\n+# them. This is particularly important on AIX, because we don\'t\n+# support having both static and shared libraries enabled at the same\n+# time on that platform, so we default to a shared-only configuration.\n+# If a disable-shared tag is given, we\'ll fallback to a static-only\n+# configuration. But we\'ll never go from static-only to shared-only.\n+\n+# ### BEGIN LIBTOOL TAG CONFIG: disable-shared\n+build_libtool_libs=no\n+build_old_libs=yes\n+# ### END LIBTOOL TAG CONFIG: disable-shared\n+\n+# ### BEGIN LIBTOOL TAG CONFIG: disable-static\n+build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`\n+# ### END LIBTOOL TAG CONFIG: disable-static\n+\n+# Local Variables:\n+# mode:shell-script\n+# sh-indentation:2\n+# End:\n+# vi:sw=2\n+\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/m4/ax_openmp.m4 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/m4/ax_openmp.m4 Thu Jul 21 13:35:08 2011 -0400 |
[ |
@@ -0,0 +1,99 @@ +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_openmp.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_OPENMP([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) +# +# DESCRIPTION +# +# This macro tries to find out how to compile programs that use OpenMP a +# standard API and set of compiler directives for parallel programming +# (see http://www-unix.mcs/) +# +# On success, it sets the OPENMP_CFLAGS/OPENMP_CXXFLAGS/OPENMP_F77FLAGS +# output variable to the flag (e.g. -omp) used both to compile *and* link +# OpenMP programs in the current language. +# +# NOTE: You are assumed to not only compile your program with these flags, +# but also link it with them as well. +# +# If you want to compile everything with OpenMP, you should set: +# +# CFLAGS="$CFLAGS $OPENMP_CFLAGS" +# #OR# CXXFLAGS="$CXXFLAGS $OPENMP_CXXFLAGS" +# #OR# FFLAGS="$FFLAGS $OPENMP_FFLAGS" +# +# (depending on the selected language). +# +# The user can override the default choice by setting the corresponding +# environment variable (e.g. OPENMP_CFLAGS). +# +# ACTION-IF-FOUND is a list of shell commands to run if an OpenMP flag is +# found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it is +# not found. If ACTION-IF-FOUND is not specified, the default action will +# define HAVE_OPENMP. +# +# LICENSE +# +# Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu> +# +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation, either version 3 of the License, or (at your +# option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +# Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see <http://www.gnu.org/licenses/>. +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. + +#serial 8 + +AC_DEFUN([AX_OPENMP], [ +AC_PREREQ(2.59) dnl for _AC_LANG_PREFIX + +AC_CACHE_CHECK([for OpenMP flag of _AC_LANG compiler], ax_cv_[]_AC_LANG_ABBREV[]_openmp, [save[]_AC_LANG_PREFIX[]FLAGS=$[]_AC_LANG_PREFIX[]FLAGS +ax_cv_[]_AC_LANG_ABBREV[]_openmp=unknown +# Flags to try: -fopenmp (gcc), -openmp (icc), -mp (SGI & PGI), +# -xopenmp (Sun), -omp (Tru64), -qsmp=omp (AIX), none +ax_openmp_flags="-fopenmp -openmp -mp -xopenmp -omp -qsmp=omp none" +if test "x$OPENMP_[]_AC_LANG_PREFIX[]FLAGS" != x; then + ax_openmp_flags="$OPENMP_[]_AC_LANG_PREFIX[]FLAGS $ax_openmp_flags" +fi +for ax_openmp_flag in $ax_openmp_flags; do + case $ax_openmp_flag in + none) []_AC_LANG_PREFIX[]FLAGS=$save[]_AC_LANG_PREFIX[] ;; + *) []_AC_LANG_PREFIX[]FLAGS="$save[]_AC_LANG_PREFIX[]FLAGS $ax_openmp_flag" ;; + esac + AC_TRY_LINK_FUNC(omp_set_num_threads, + [ax_cv_[]_AC_LANG_ABBREV[]_openmp=$ax_openmp_flag; break]) +done +[]_AC_LANG_PREFIX[]FLAGS=$save[]_AC_LANG_PREFIX[]FLAGS +]) +if test "x$ax_cv_[]_AC_LANG_ABBREV[]_openmp" = "xunknown"; then + m4_default([$2],:) +else + if test "x$ax_cv_[]_AC_LANG_ABBREV[]_openmp" != "xnone"; then + OPENMP_[]_AC_LANG_PREFIX[]FLAGS=$ax_cv_[]_AC_LANG_ABBREV[]_openmp + fi + m4_default([$1], [AC_DEFINE(HAVE_OPENMP,1,[Define if OpenMP is enabled])]) +fi +])dnl AX_OPENMP |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/m4/ax_prefix_config_h.m4 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/m4/ax_prefix_config_h.m4 Thu Jul 21 13:35:08 2011 -0400 |
[ |
b'@@ -0,0 +1,209 @@\n+# ===========================================================================\n+# http://www.gnu.org/software/autoconf-archive/ax_prefix_config_h.html\n+# ===========================================================================\n+#\n+# SYNOPSIS\n+#\n+# AX_PREFIX_CONFIG_H [(OUTPUT-HEADER [,PREFIX [,ORIG-HEADER]])]\n+#\n+# DESCRIPTION\n+#\n+# This is a new variant from ac_prefix_config_ this one will use a\n+# lowercase-prefix if the config-define was starting with a\n+# lowercase-char, e.g. "#define const", "#define restrict", or "#define\n+# off_t", (and this one can live in another directory, e.g.\n+# testpkg/config.h therefore I decided to move the output-header to be the\n+# first arg)\n+#\n+# takes the usual config.h generated header file; looks for each of the\n+# generated "#define SOMEDEF" lines, and prefixes the defined name (ie.\n+# makes it "#define PREFIX_SOMEDEF". The result is written to the output\n+# config.header file. The PREFIX is converted to uppercase for the\n+# conversions.\n+#\n+# Defaults:\n+#\n+# OUTPUT-HEADER = $PACKAGE-config.h\n+# PREFIX = $PACKAGE\n+# ORIG-HEADER, from AM_CONFIG_HEADER(config.h)\n+#\n+# Your configure.ac script should contain both macros in this order, and\n+# unlike the earlier variations of this prefix-macro it is okay to place\n+# the AX_PREFIX_CONFIG_H call before the AC_OUTPUT invokation.\n+#\n+# Example:\n+#\n+# AC_INIT(config.h.in) # config.h.in as created by "autoheader"\n+# AM_INIT_AUTOMAKE(testpkg, 0.1.1) # makes #undef VERSION and PACKAGE\n+# AM_CONFIG_HEADER(config.h) # prep config.h from config.h.in\n+# AX_PREFIX_CONFIG_H(mylib/_config.h) # prep mylib/_config.h from it..\n+# AC_MEMORY_H # makes "#undef NEED_MEMORY_H"\n+# AC_C_CONST_H # makes "#undef const"\n+# AC_OUTPUT(Makefile) # creates the "config.h" now\n+# # and also mylib/_config.h\n+#\n+# if the argument to AX_PREFIX_CONFIG_H would have been omitted then the\n+# default outputfile would have been called simply "testpkg-config.h", but\n+# even under the name "mylib/_config.h" it contains prefix-defines like\n+#\n+# #ifndef TESTPKG_VERSION\n+# #define TESTPKG_VERSION "0.1.1"\n+# #endif\n+# #ifndef TESTPKG_NEED_MEMORY_H\n+# #define TESTPKG_NEED_MEMORY_H 1\n+# #endif\n+# #ifndef _testpkg_const\n+# #define _testpkg_const _const\n+# #endif\n+#\n+# and this "mylib/_config.h" can be installed along with other\n+# header-files, which is most convenient when creating a shared library\n+# (that has some headers) where some functionality is dependent on the\n+# OS-features detected at compile-time. No need to invent some\n+# "mylib-confdefs.h.in" manually. :-)\n+#\n+# Note that some AC_DEFINEs that end up in the config.h file are actually\n+# self-referential - e.g. AC_C_INLINE, AC_C_CONST, and the AC_TYPE_OFF_T\n+# say that they "will define inline|const|off_t if the system does not do\n+# it by itself". You might want to clean up about these - consider an\n+# extra mylib/conf.h that reads something like:\n+#\n+# #include <mylib/_config.h>\n+# #ifndef _testpkg_const\n+# #define _testpkg_const const\n+# #endif\n+#\n+# and then start using _testpkg_const in the header files. That is also a\n+# good thing to differentiate whether some library-user has starting to\n+# take up with a different compiler, so perhaps it could read something\n+# like this:\n+#\n+# #ifdef _MSC_VER\n+# #include <mylib/_msvc.h>\n+# #else\n+# #include <mylib/_config.h>\n+# #endif\n+# #ifndef _testpkg_const\n+# #define _testpkg_const const\n+# #endif\n+#\n+# LICENSE\n+#\n+# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>\n+# Copyright (c) 2008 Marten Svantesson\n+# Copyright (c) 2008 Gerald Point <Gerald.Point@labri.fr>\n+#\n+# This program is free software; you can redistribute it and/or modify it\n+'..b' need not follow the terms of the GNU General Public License when using\n+# or distributing such scripts, even though portions of the text of the\n+# Macro appear in them. The GNU General Public License (GPL) does govern\n+# all other use of the material that constitutes the Autoconf Macro.\n+#\n+# This special exception to the GPL applies to versions of the Autoconf\n+# Macro released by the Autoconf Archive. When you make and distribute a\n+# modified version of the Autoconf Macro, you may extend this special\n+# exception to the GPL to apply to your modified version as well.\n+\n+#serial 11\n+\n+AC_DEFUN([AX_PREFIX_CONFIG_H],[dnl\n+AC_PREREQ([2.62])\n+AC_BEFORE([AC_CONFIG_HEADERS],[$0])dnl\n+AC_CONFIG_COMMANDS([ifelse($1,,$PACKAGE-config.h,$1)],[dnl\n+AS_VAR_PUSHDEF([_OUT],[ac_prefix_conf_OUT])dnl\n+AS_VAR_PUSHDEF([_DEF],[ac_prefix_conf_DEF])dnl\n+AS_VAR_PUSHDEF([_PKG],[ac_prefix_conf_PKG])dnl\n+AS_VAR_PUSHDEF([_LOW],[ac_prefix_conf_LOW])dnl\n+AS_VAR_PUSHDEF([_UPP],[ac_prefix_conf_UPP])dnl\n+AS_VAR_PUSHDEF([_INP],[ac_prefix_conf_INP])dnl\n+m4_pushdef([_script],[conftest.prefix])dnl\n+m4_pushdef([_symbol],[m4_cr_Letters[]m4_cr_digits[]_])dnl\n+_OUT=`echo ifelse($1, , $PACKAGE-config.h, $1)`\n+_DEF=`echo _$_OUT | sed -e "y:m4_cr_letters:m4_cr_LETTERS[]:" -e "s/@<:@^m4_cr_Letters@:>@/_/g"`\n+_PKG=`echo ifelse($2, , $PACKAGE, $2)`\n+_LOW=`echo _$_PKG | sed -e "y:m4_cr_LETTERS-:m4_cr_letters[]_:"`\n+_UPP=`echo $_PKG | sed -e "y:m4_cr_letters-:m4_cr_LETTERS[]_:" -e "/^@<:@m4_cr_digits@:>@/s/^/_/"`\n+_INP=`echo "ifelse($3,,,$3)" | sed -e \'s/ *//\'`\n+if test ".$_INP" = "."; then\n+ for ac_file in : $CONFIG_HEADERS; do test "_$ac_file" = _: && continue\n+ case "$ac_file" in\n+ *.h) _INP=$ac_file ;;\n+ *)\n+ esac\n+ test ".$_INP" != "." && break\n+ done\n+fi\n+if test ".$_INP" = "."; then\n+ case "$_OUT" in\n+ */*) _INP=`basename "$_OUT"`\n+ ;;\n+ *-*) _INP=`echo "$_OUT" | sed -e "s/@<:@_symbol@:>@*-//"`\n+ ;;\n+ *) _INP=config.h\n+ ;;\n+ esac\n+fi\n+if test -z "$_PKG" ; then\n+ AC_MSG_ERROR([no prefix for _PREFIX_PKG_CONFIG_H])\n+else\n+ if test ! -f "$_INP" ; then if test -f "$srcdir/$_INP" ; then\n+ _INP="$srcdir/$_INP"\n+ fi fi\n+ AC_MSG_NOTICE(creating $_OUT - prefix $_UPP for $_INP defines)\n+ if test -f $_INP ; then\n+ AS_ECHO(["s/^@%:@undef *\\\\(@<:@m4_cr_LETTERS[]_@:>@\\\\)/@%:@undef $_UPP""_\\\\1/"]) > _script\n+ AS_ECHO(["s/^@%:@undef *\\\\(@<:@m4_cr_letters@:>@\\\\)/@%:@undef $_LOW""_\\\\1/"]) >> _script\n+ AS_ECHO(["s/^@%:@def[]ine *\\\\(@<:@m4_cr_LETTERS[]_@:>@@<:@_symbol@:>@*\\\\)\\\\(.*\\\\)/@%:@ifndef $_UPP""_\\\\1\\\\"]) >> _script\n+ AS_ECHO(["@%:@def[]ine $_UPP""_\\\\1\\\\2\\\\"]) >> _script\n+ AS_ECHO(["@%:@endif/"]) >> _script\n+ AS_ECHO(["s/^@%:@def[]ine *\\\\(@<:@m4_cr_letters@:>@@<:@_symbol@:>@*\\\\)\\\\(.*\\\\)/@%:@ifndef $_LOW""_\\\\1\\\\"]) >> _script\n+ AS_ECHO(["@%:@define $_LOW""_\\\\1\\\\2\\\\"]) >> _script\n+ AS_ECHO(["@%:@endif/"]) >> _script\n+ # now executing _script on _DEF input to create _OUT output file\n+ echo "@%:@ifndef $_DEF" >$tmp/pconfig.h\n+ echo "@%:@def[]ine $_DEF 1" >>$tmp/pconfig.h\n+ echo \' \' >>$tmp/pconfig.h\n+ echo /\'*\' $_OUT. Generated automatically at end of configure. \'*\'/ >>$tmp/pconfig.h\n+\n+ sed -f _script $_INP >>$tmp/pconfig.h\n+ echo \' \' >>$tmp/pconfig.h\n+ echo \'/* once:\' $_DEF \'*/\' >>$tmp/pconfig.h\n+ echo "@%:@endif" >>$tmp/pconfig.h\n+ if cmp -s $_OUT $tmp/pconfig.h 2>/dev/null; then\n+ AC_MSG_NOTICE([$_OUT is unchanged])\n+ else\n+ ac_dir=`AS_DIRNAME(["$_OUT"])`\n+ AS_MKDIR_P(["$ac_dir"])\n+ rm -f "$_OUT"\n+ mv $tmp/pconfig.h "$_OUT"\n+ fi\n+ cp _script _configs.sed\n+ else\n+ AC_MSG_ERROR([input file $_INP does not exist - skip generating $_OUT])\n+ fi\n+ rm -f conftest.*\n+fi\n+m4_popdef([_symbol])dnl\n+m4_popdef([_script])dnl\n+AS_VAR_POPDEF([_INP])dnl\n+AS_VAR_POPDEF([_UPP])dnl\n+AS_VAR_POPDEF([_LOW])dnl\n+AS_VAR_POPDEF([_PKG])dnl\n+AS_VAR_POPDEF([_DEF])dnl\n+AS_VAR_POPDEF([_OUT])dnl\n+],[PACKAGE="$PACKAGE"])])\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/m4/libtool.m4 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/m4/libtool.m4 Thu Jul 21 13:35:08 2011 -0400 |
[ |
b'@@ -0,0 +1,7377 @@\n+# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-\n+#\n+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,\n+# 2006, 2007, 2008 Free Software Foundation, Inc.\n+# Written by Gordon Matzigkeit, 1996\n+#\n+# This file is free software; the Free Software Foundation gives\n+# unlimited permission to copy and/or distribute it, with or without\n+# modifications, as long as this notice is preserved.\n+\n+m4_define([_LT_COPYING], [dnl\n+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,\n+# 2006, 2007, 2008 Free Software Foundation, Inc.\n+# Written by Gordon Matzigkeit, 1996\n+#\n+# This file is part of GNU Libtool.\n+#\n+# GNU Libtool is free software; you can redistribute it and/or\n+# modify it under the terms of the GNU General Public License as\n+# published by the Free Software Foundation; either version 2 of\n+# the License, or (at your option) any later version.\n+#\n+# As a special exception to the GNU General Public License,\n+# if you distribute this file as part of a program or library that\n+# is built using GNU Libtool, you may include this file under the\n+# same distribution terms that you use for the rest of that program.\n+#\n+# GNU Libtool is distributed in the hope that it will be useful,\n+# but WITHOUT ANY WARRANTY; without even the implied warranty of\n+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n+# GNU General Public License for more details.\n+#\n+# You should have received a copy of the GNU General Public License\n+# along with GNU Libtool; see the file COPYING. If not, a copy\n+# can be downloaded from http://www.gnu.org/licenses/gpl.html, or\n+# obtained by writing to the Free Software Foundation, Inc.,\n+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\n+])\n+\n+# serial 56 LT_INIT\n+\n+\n+# LT_PREREQ(VERSION)\n+# ------------------\n+# Complain and exit if this libtool version is less that VERSION.\n+m4_defun([LT_PREREQ],\n+[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,\n+ [m4_default([$3],\n+\t\t [m4_fatal([Libtool version $1 or higher is required],\n+\t\t 63)])],\n+ [$2])])\n+\n+\n+# _LT_CHECK_BUILDDIR\n+# ------------------\n+# Complain if the absolute build directory name contains unusual characters\n+m4_defun([_LT_CHECK_BUILDDIR],\n+[case `pwd` in\n+ *\\ * | *\\\t*)\n+ AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;\n+esac\n+])\n+\n+\n+# LT_INIT([OPTIONS])\n+# ------------------\n+AC_DEFUN([LT_INIT],\n+[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT\n+AC_BEFORE([$0], [LT_LANG])dnl\n+AC_BEFORE([$0], [LT_OUTPUT])dnl\n+AC_BEFORE([$0], [LTDL_INIT])dnl\n+m4_require([_LT_CHECK_BUILDDIR])dnl\n+\n+dnl Autoconf doesn\'t catch unexpanded LT_ macros by default:\n+m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl\n+m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl\n+dnl aclocal doesn\'t pull ltoptions.m4, ltsugar.m4, or ltversion.m4\n+dnl unless we require an AC_DEFUNed macro:\n+AC_REQUIRE([LTOPTIONS_VERSION])dnl\n+AC_REQUIRE([LTSUGAR_VERSION])dnl\n+AC_REQUIRE([LTVERSION_VERSION])dnl\n+AC_REQUIRE([LTOBSOLETE_VERSION])dnl\n+m4_require([_LT_PROG_LTMAIN])dnl\n+\n+dnl Parse OPTIONS\n+_LT_SET_OPTIONS([$0], [$1])\n+\n+# This can be used to rebuild libtool when needed\n+LIBTOOL_DEPS="$ltmain"\n+\n+# Always use our own libtool.\n+LIBTOOL=\'$(SHELL) $(top_builddir)/libtool\'\n+AC_SUBST(LIBTOOL)dnl\n+\n+_LT_SETUP\n+\n+# Only expand once:\n+m4_define([LT_INIT])\n+])# LT_INIT\n+\n+# Old names:\n+AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])\n+AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])\n+dnl aclocal-1.4 backwards compatibility:\n+dnl AC_DEFUN([AC_PROG_LIBTOOL], [])\n+dnl AC_DEFUN([AM_PROG_LIBTOOL], [])\n+\n+\n+# _LT_CC_BASENAME(CC)\n+# -------------------\n+# Calculate cc_basename. Skip known compiler wrappers and cross-prefix.\n+m4_defun([_LT_CC_BASENAME],\n+[for cc_temp in $1""; do\n+ case $cc_temp in\n+ compile | *[[\\\\/]]compile | ccache | *[[\\\\/]]ccache ) ;;\n+ distcc | *[[\\\\/]]distcc | purify | *[[\\\\/'..b'me_result"\n+# Implementation must be kept synchronized with func_dirname\n+# and func_basename. For efficiency, we do not delegate to\n+# those functions but instead duplicate the functionality here.\n+func_dirname_and_basename ()\n+{\n+ case ${1} in\n+ */*) func_dirname_result="${1%/*}${2}" ;;\n+ * ) func_dirname_result="${3}" ;;\n+ esac\n+ func_basename_result="${1##*/}"\n+}\n+\n+# func_stripname prefix suffix name\n+# strip PREFIX and SUFFIX off of NAME.\n+# PREFIX and SUFFIX must not contain globbing or regex special\n+# characters, hashes, percent signs, but SUFFIX may contain a leading\n+# dot (in which case that matches only a dot).\n+func_stripname ()\n+{\n+ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\n+ # positional parameters, so assign one to ordinary parameter first.\n+ func_stripname_result=${3}\n+ func_stripname_result=${func_stripname_result#"${1}"}\n+ func_stripname_result=${func_stripname_result%"${2}"}\n+}\n+\n+# func_opt_split\n+func_opt_split ()\n+{\n+ func_opt_split_opt=${1%%=*}\n+ func_opt_split_arg=${1#*=}\n+}\n+\n+# func_lo2o object\n+func_lo2o ()\n+{\n+ case ${1} in\n+ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\n+ *) func_lo2o_result=${1} ;;\n+ esac\n+}\n+\n+# func_xform libobj-or-source\n+func_xform ()\n+{\n+ func_xform_result=${1%.*}.lo\n+}\n+\n+# func_arith arithmetic-term...\n+func_arith ()\n+{\n+ func_arith_result=$(( $[*] ))\n+}\n+\n+# func_len string\n+# STRING may not start with a hyphen.\n+func_len ()\n+{\n+ func_len_result=${#1}\n+}\n+\n+_LT_EOF\n+ ;;\n+ *) # Bourne compatible functions.\n+ cat << \\_LT_EOF >> "$cfgfile"\n+\n+# func_dirname file append nondir_replacement\n+# Compute the dirname of FILE. If nonempty, add APPEND to the result,\n+# otherwise set result to NONDIR_REPLACEMENT.\n+func_dirname ()\n+{\n+ # Extract subdirectory from the argument.\n+ func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`\n+ if test "X$func_dirname_result" = "X${1}"; then\n+ func_dirname_result="${3}"\n+ else\n+ func_dirname_result="$func_dirname_result${2}"\n+ fi\n+}\n+\n+# func_basename file\n+func_basename ()\n+{\n+ func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`\n+}\n+\n+dnl func_dirname_and_basename\n+dnl A portable version of this function is already defined in general.m4sh\n+dnl so there is no need for it here.\n+\n+# func_stripname prefix suffix name\n+# strip PREFIX and SUFFIX off of NAME.\n+# PREFIX and SUFFIX must not contain globbing or regex special\n+# characters, hashes, percent signs, but SUFFIX may contain a leading\n+# dot (in which case that matches only a dot).\n+# func_strip_suffix prefix name\n+func_stripname ()\n+{\n+ case ${2} in\n+ .*) func_stripname_result=`$ECHO "X${3}" \\\n+ | $Xsed -e "s%^${1}%%" -e "s%\\\\\\\\${2}\\$%%"`;;\n+ *) func_stripname_result=`$ECHO "X${3}" \\\n+ | $Xsed -e "s%^${1}%%" -e "s%${2}\\$%%"`;;\n+ esac\n+}\n+\n+# sed scripts:\n+my_sed_long_opt=\'1s/^\\(-[[^=]]*\\)=.*/\\1/;q\'\n+my_sed_long_arg=\'1s/^-[[^=]]*=//\'\n+\n+# func_opt_split\n+func_opt_split ()\n+{\n+ func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"`\n+ func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"`\n+}\n+\n+# func_lo2o object\n+func_lo2o ()\n+{\n+ func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"`\n+}\n+\n+# func_xform libobj-or-source\n+func_xform ()\n+{\n+ func_xform_result=`$ECHO "X${1}" | $Xsed -e \'s/\\.[[^.]]*$/.lo/\'`\n+}\n+\n+# func_arith arithmetic-term...\n+func_arith ()\n+{\n+ func_arith_result=`expr "$[@]"`\n+}\n+\n+# func_len string\n+# STRING may not start with a hyphen.\n+func_len ()\n+{\n+ func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len`\n+}\n+\n+_LT_EOF\n+esac\n+\n+case $lt_shell_append in\n+ yes)\n+ cat << \\_LT_EOF >> "$cfgfile"\n+\n+# func_append var value\n+# Append VALUE to the end of shell variable VAR.\n+func_append ()\n+{\n+ eval "$[1]+=\\$[2]"\n+}\n+_LT_EOF\n+ ;;\n+ *)\n+ cat << \\_LT_EOF >> "$cfgfile"\n+\n+# func_append var value\n+# Append VALUE to the end of shell variable VAR.\n+func_append ()\n+{\n+ eval "$[1]=\\$$[1]\\$[2]"\n+}\n+\n+_LT_EOF\n+ ;;\n+ esac\n+])\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/m4/ltoptions.m4 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/m4/ltoptions.m4 Thu Jul 21 13:35:08 2011 -0400 |
[ |
b"@@ -0,0 +1,368 @@\n+# Helper functions for option handling. -*- Autoconf -*-\n+#\n+# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.\n+# Written by Gary V. Vaughan, 2004\n+#\n+# This file is free software; the Free Software Foundation gives\n+# unlimited permission to copy and/or distribute it, with or without\n+# modifications, as long as this notice is preserved.\n+\n+# serial 6 ltoptions.m4\n+\n+# This is to help aclocal find these macros, as it can't see m4_define.\n+AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])\n+\n+\n+# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)\n+# ------------------------------------------\n+m4_define([_LT_MANGLE_OPTION],\n+[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])\n+\n+\n+# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)\n+# ---------------------------------------\n+# Set option OPTION-NAME for macro MACRO-NAME, and if there is a\n+# matching handler defined, dispatch to it. Other OPTION-NAMEs are\n+# saved as a flag.\n+m4_define([_LT_SET_OPTION],\n+[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl\n+m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),\n+ _LT_MANGLE_DEFUN([$1], [$2]),\n+ [m4_warning([Unknown $1 option `$2'])])[]dnl\n+])\n+\n+\n+# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])\n+# ------------------------------------------------------------\n+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.\n+m4_define([_LT_IF_OPTION],\n+[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])\n+\n+\n+# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)\n+# -------------------------------------------------------\n+# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME\n+# are set.\n+m4_define([_LT_UNLESS_OPTIONS],\n+[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),\n+\t [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),\n+\t\t [m4_define([$0_found])])])[]dnl\n+m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3\n+])[]dnl\n+])\n+\n+\n+# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)\n+# ----------------------------------------\n+# OPTION-LIST is a space-separated list of Libtool options associated\n+# with MACRO-NAME. If any OPTION has a matching handler declared with\n+# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about\n+# the unknown option and exit.\n+m4_defun([_LT_SET_OPTIONS],\n+[# Set options\n+m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),\n+ [_LT_SET_OPTION([$1], _LT_Option)])\n+\n+m4_if([$1],[LT_INIT],[\n+ dnl\n+ dnl Simply set some default values (i.e off) if boolean options were not\n+ dnl specified:\n+ _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no\n+ ])\n+ _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no\n+ ])\n+ dnl\n+ dnl If no reference was made to various pairs of opposing options, then\n+ dnl we run the default mode handler for the pair. For example, if neither\n+ dnl `shared' nor `disable-shared' was passed, we enable building of shared\n+ dnl archives by default:\n+ _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])\n+ _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])\n+ _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])\n+ _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],\n+ \t\t [_LT_ENABLE_FAST_INSTALL])\n+ ])\n+])# _LT_SET_OPTIONS\n+\n+\n+## --------------------------------- ##\n+## Macros to handle LT_INIT options. ##\n+## --------------------------------- ##\n+\n+# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)\n+# -----------------------------------------\n+m4_define([_LT_MANGLE_DEFUN],\n+[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])\n+\n+\n+# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)\n+# -----------------------------------------------\n+m4_define([LT_OPTION_DEFINE],\n+[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl\n+])# LT_OPTION_DEFINE\n+\n+\n+# dlopen\n+# ------\n+LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes\n+])\n+\n+AU_DEFUN([AC_LIBTOOL_DLOPEN],\n+[_LT_SET_OPTION([LT_INIT], [dlopen])\n+AC_DIAGNOSE("..b'TIC],\n+[_LT_SET_OPTION([LT_INIT], [disable-static])\n+])\n+\n+AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])\n+AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])\n+\n+dnl aclocal-1.4 backwards compatibility:\n+dnl AC_DEFUN([AM_ENABLE_STATIC], [])\n+dnl AC_DEFUN([AM_DISABLE_STATIC], [])\n+\n+\n+\n+# _LT_ENABLE_FAST_INSTALL([DEFAULT])\n+# ----------------------------------\n+# implement the --enable-fast-install flag, and support the `fast-install\'\n+# and `disable-fast-install\' LT_INIT options.\n+# DEFAULT is either `yes\' or `no\'. If omitted, it defaults to `yes\'.\n+m4_define([_LT_ENABLE_FAST_INSTALL],\n+[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl\n+AC_ARG_ENABLE([fast-install],\n+ [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],\n+ [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],\n+ [p=${PACKAGE-default}\n+ case $enableval in\n+ yes) enable_fast_install=yes ;;\n+ no) enable_fast_install=no ;;\n+ *)\n+ enable_fast_install=no\n+ # Look at the argument we got. We use all the common list separators.\n+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"\n+ for pkg in $enableval; do\n+\tIFS="$lt_save_ifs"\n+\tif test "X$pkg" = "X$p"; then\n+\t enable_fast_install=yes\n+\tfi\n+ done\n+ IFS="$lt_save_ifs"\n+ ;;\n+ esac],\n+ [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)\n+\n+_LT_DECL([fast_install], [enable_fast_install], [0],\n+\t [Whether or not to optimize for fast installation])dnl\n+])# _LT_ENABLE_FAST_INSTALL\n+\n+LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])\n+LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])\n+\n+# Old names:\n+AU_DEFUN([AC_ENABLE_FAST_INSTALL],\n+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])\n+AC_DIAGNOSE([obsolete],\n+[$0: Remove this warning and the call to _LT_SET_OPTION when you put\n+the `fast-install\' option into LT_INIT\'s first parameter.])\n+])\n+\n+AU_DEFUN([AC_DISABLE_FAST_INSTALL],\n+[_LT_SET_OPTION([LT_INIT], [disable-fast-install])\n+AC_DIAGNOSE([obsolete],\n+[$0: Remove this warning and the call to _LT_SET_OPTION when you put\n+the `disable-fast-install\' option into LT_INIT\'s first parameter.])\n+])\n+\n+dnl aclocal-1.4 backwards compatibility:\n+dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])\n+dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])\n+\n+\n+# _LT_WITH_PIC([MODE])\n+# --------------------\n+# implement the --with-pic flag, and support the `pic-only\' and `no-pic\'\n+# LT_INIT options.\n+# MODE is either `yes\' or `no\'. If omitted, it defaults to `both\'.\n+m4_define([_LT_WITH_PIC],\n+[AC_ARG_WITH([pic],\n+ [AS_HELP_STRING([--with-pic],\n+\t[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],\n+ [pic_mode="$withval"],\n+ [pic_mode=default])\n+\n+test -z "$pic_mode" && pic_mode=m4_default([$1], [default])\n+\n+_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl\n+])# _LT_WITH_PIC\n+\n+LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])\n+LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])\n+\n+# Old name:\n+AU_DEFUN([AC_LIBTOOL_PICMODE],\n+[_LT_SET_OPTION([LT_INIT], [pic-only])\n+AC_DIAGNOSE([obsolete],\n+[$0: Remove this warning and the call to _LT_SET_OPTION when you\n+put the `pic-only\' option into LT_INIT\'s first parameter.])\n+])\n+\n+dnl aclocal-1.4 backwards compatibility:\n+dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])\n+\n+## ----------------- ##\n+## LTDL_INIT Options ##\n+## ----------------- ##\n+\n+m4_define([_LTDL_MODE], [])\n+LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],\n+\t\t [m4_define([_LTDL_MODE], [nonrecursive])])\n+LT_OPTION_DEFINE([LTDL_INIT], [recursive],\n+\t\t [m4_define([_LTDL_MODE], [recursive])])\n+LT_OPTION_DEFINE([LTDL_INIT], [subproject],\n+\t\t [m4_define([_LTDL_MODE], [subproject])])\n+\n+m4_define([_LTDL_TYPE], [])\n+LT_OPTION_DEFINE([LTDL_INIT], [installable],\n+\t\t [m4_define([_LTDL_TYPE], [installable])])\n+LT_OPTION_DEFINE([LTDL_INIT], [convenience],\n+\t\t [m4_define([_LTDL_TYPE], [convenience])])\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/m4/ltsugar.m4 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/m4/ltsugar.m4 Thu Jul 21 13:35:08 2011 -0400 |
[ |
@@ -0,0 +1,123 @@ +# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- +# +# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. +# Written by Gary V. Vaughan, 2004 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# serial 6 ltsugar.m4 + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) + + +# lt_join(SEP, ARG1, [ARG2...]) +# ----------------------------- +# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their +# associated separator. +# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier +# versions in m4sugar had bugs. +m4_define([lt_join], +[m4_if([$#], [1], [], + [$#], [2], [[$2]], + [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) +m4_define([_lt_join], +[m4_if([$#$2], [2], [], + [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) + + +# lt_car(LIST) +# lt_cdr(LIST) +# ------------ +# Manipulate m4 lists. +# These macros are necessary as long as will still need to support +# Autoconf-2.59 which quotes differently. +m4_define([lt_car], [[$1]]) +m4_define([lt_cdr], +[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], + [$#], 1, [], + [m4_dquote(m4_shift($@))])]) +m4_define([lt_unquote], $1) + + +# lt_append(MACRO-NAME, STRING, [SEPARATOR]) +# ------------------------------------------ +# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. +# Note that neither SEPARATOR nor STRING are expanded; they are appended +# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). +# No SEPARATOR is output if MACRO-NAME was previously undefined (different +# than defined and empty). +# +# This macro is needed until we can rely on Autoconf 2.62, since earlier +# versions of m4sugar mistakenly expanded SEPARATOR but not STRING. +m4_define([lt_append], +[m4_define([$1], + m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) + + + +# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) +# ---------------------------------------------------------- +# Produce a SEP delimited list of all paired combinations of elements of +# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list +# has the form PREFIXmINFIXSUFFIXn. +# Needed until we can rely on m4_combine added in Autoconf 2.62. +m4_define([lt_combine], +[m4_if(m4_eval([$# > 3]), [1], + [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl +[[m4_foreach([_Lt_prefix], [$2], + [m4_foreach([_Lt_suffix], + ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, + [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) + + +# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) +# ----------------------------------------------------------------------- +# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited +# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. +m4_define([lt_if_append_uniq], +[m4_ifdef([$1], + [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], + [lt_append([$1], [$2], [$3])$4], + [$5])], + [lt_append([$1], [$2], [$3])$4])]) + + +# lt_dict_add(DICT, KEY, VALUE) +# ----------------------------- +m4_define([lt_dict_add], +[m4_define([$1($2)], [$3])]) + + +# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) +# -------------------------------------------- +m4_define([lt_dict_add_subkey], +[m4_define([$1($2:$3)], [$4])]) + + +# lt_dict_fetch(DICT, KEY, [SUBKEY]) +# ---------------------------------- +m4_define([lt_dict_fetch], +[m4_ifval([$3], + m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), + m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) + + +# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) +# ----------------------------------------------------------------- +m4_define([lt_if_dict_fetch], +[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], + [$5], + [$6])]) + + +# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) +# -------------------------------------------------------------- +m4_define([lt_dict_filter], +[m4_if([$5], [], [], + [lt_join(m4_quote(m4_default([$4], [[, ]])), + lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), + [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl +]) |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/m4/ltversion.m4 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/m4/ltversion.m4 Thu Jul 21 13:35:08 2011 -0400 |
[ |
@@ -0,0 +1,23 @@ +# ltversion.m4 -- version numbers -*- Autoconf -*- +# +# Copyright (C) 2004 Free Software Foundation, Inc. +# Written by Scott James Remnant, 2004 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# Generated from ltversion.in. + +# serial 3017 ltversion.m4 +# This file is part of GNU Libtool + +m4_define([LT_PACKAGE_VERSION], [2.2.6b]) +m4_define([LT_PACKAGE_REVISION], [1.3017]) + +AC_DEFUN([LTVERSION_VERSION], +[macro_version='2.2.6b' +macro_revision='1.3017' +_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) +_LT_DECL(, macro_revision, 0) +]) |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/m4/lt~obsolete.m4 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/m4/lt~obsolete.m4 Thu Jul 21 13:35:08 2011 -0400 |
[ |
@@ -0,0 +1,92 @@ +# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- +# +# Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc. +# Written by Scott James Remnant, 2004. +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# serial 4 lt~obsolete.m4 + +# These exist entirely to fool aclocal when bootstrapping libtool. +# +# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) +# which have later been changed to m4_define as they aren't part of the +# exported API, or moved to Autoconf or Automake where they belong. +# +# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN +# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us +# using a macro with the same name in our local m4/libtool.m4 it'll +# pull the old libtool.m4 in (it doesn't see our shiny new m4_define +# and doesn't know about Autoconf macros at all.) +# +# So we provide this file, which has a silly filename so it's always +# included after everything else. This provides aclocal with the +# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything +# because those macros already exist, or will be overwritten later. +# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. +# +# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. +# Yes, that means every name once taken will need to remain here until +# we give up compatibility with versions before 1.7, at which point +# we need to keep only those names which we still refer to. + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) + +m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) +m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) +m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) +m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) +m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) +m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) +m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) +m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) +m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) +m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) +m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) +m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) +m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) +m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) +m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) +m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) +m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) +m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) +m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) +m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) +m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) +m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) +m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) +m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) +m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) +m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) +m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) +m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) +m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) +m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) +m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) +m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) +m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) +m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) +m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) +m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) +m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) +m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) +m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) +m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) +m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) +m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) +m4_ifndef([AC_LIBTOOL_RC], [AC_DEFUN([AC_LIBTOOL_RC])]) +m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) +m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) +m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) +m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) +m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) +m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) +m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) +m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/missing --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/missing Thu Jul 21 13:35:08 2011 -0400 |
[ |
b'@@ -0,0 +1,376 @@\n+#! /bin/sh\n+# Common stub for a few missing GNU programs while installing.\n+\n+scriptversion=2009-04-28.21; # UTC\n+\n+# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,\n+# 2008, 2009 Free Software Foundation, Inc.\n+# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.\n+\n+# This program is free software; you can redistribute it and/or modify\n+# it under the terms of the GNU General Public License as published by\n+# the Free Software Foundation; either version 2, or (at your option)\n+# any later version.\n+\n+# This program is distributed in the hope that it will be useful,\n+# but WITHOUT ANY WARRANTY; without even the implied warranty of\n+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n+# GNU General Public License for more details.\n+\n+# You should have received a copy of the GNU General Public License\n+# along with this program. If not, see <http://www.gnu.org/licenses/>.\n+\n+# As a special exception to the GNU General Public License, if you\n+# distribute this file as part of a program that contains a\n+# configuration script generated by Autoconf, you may include it under\n+# the same distribution terms that you use for the rest of that program.\n+\n+if test $# -eq 0; then\n+ echo 1>&2 "Try \\`$0 --help\' for more information"\n+ exit 1\n+fi\n+\n+run=:\n+sed_output=\'s/.* --output[ =]\\([^ ]*\\).*/\\1/p\'\n+sed_minuso=\'s/.* -o \\([^ ]*\\).*/\\1/p\'\n+\n+# In the cases where this matters, `missing\' is being run in the\n+# srcdir already.\n+if test -f configure.ac; then\n+ configure_ac=configure.ac\n+else\n+ configure_ac=configure.in\n+fi\n+\n+msg="missing on your system"\n+\n+case $1 in\n+--run)\n+ # Try to run requested program, and just exit if it succeeds.\n+ run=\n+ shift\n+ "$@" && exit 0\n+ # Exit code 63 means version mismatch. This often happens\n+ # when the user try to use an ancient version of a tool on\n+ # a file that requires a minimum version. In this case we\n+ # we should proceed has if the program had been absent, or\n+ # if --run hadn\'t been passed.\n+ if test $? = 63; then\n+ run=:\n+ msg="probably too old"\n+ fi\n+ ;;\n+\n+ -h|--h|--he|--hel|--help)\n+ echo "\\\n+$0 [OPTION]... PROGRAM [ARGUMENT]...\n+\n+Handle \\`PROGRAM [ARGUMENT]...\' for when PROGRAM is missing, or return an\n+error status if there is no known handling for PROGRAM.\n+\n+Options:\n+ -h, --help display this help and exit\n+ -v, --version output version information and exit\n+ --run try to run the given command, and emulate it if it fails\n+\n+Supported PROGRAM values:\n+ aclocal touch file \\`aclocal.m4\'\n+ autoconf touch file \\`configure\'\n+ autoheader touch file \\`config.h.in\'\n+ autom4te touch the output file, or create a stub one\n+ automake touch all \\`Makefile.in\' files\n+ bison create \\`y.tab.[ch]\', if possible, from existing .[ch]\n+ flex create \\`lex.yy.c\', if possible, from existing .c\n+ help2man touch the output file\n+ lex create \\`lex.yy.c\', if possible, from existing .c\n+ makeinfo touch the output file\n+ tar try tar, gnutar, gtar, then tar without non-portable flags\n+ yacc create \\`y.tab.[ch]\', if possible, from existing .[ch]\n+\n+Version suffixes to PROGRAM as well as the prefixes \\`gnu-\', \\`gnu\', and\n+\\`g\' are ignored when checking the name.\n+\n+Send bug reports to <bug-automake@gnu.org>."\n+ exit $?\n+ ;;\n+\n+ -v|--v|--ve|--ver|--vers|--versi|--versio|--version)\n+ echo "missing $scriptversion (GNU Automake)"\n+ exit $?\n+ ;;\n+\n+ -*)\n+ echo 1>&2 "$0: Unknown \\`$1\' option"\n+ echo 1>&2 "Try \\`$0 --help\' for more information"\n+ exit 1\n+ ;;\n+\n+esac\n+\n+# normalize program name to check for.\n+program=`echo "$1" | sed \'\n+ s/^gnu-//; t\n+ s/^gnu//; t\n+ s/^g//; t\'`\n+\n+# Now exit if we have it, but it failed. Also exit now if we\n+# don\'t have it and --version was passed (most likely to detect\n+# the program). This is about non-GNU programs, so use $1 not\n+# $program.\n+case $1 in\n+ lex*|yacc*'..b' if test ! -f y.tab.c; then\n+\techo \'main() { return 0; }\' >y.tab.c\n+ fi\n+ ;;\n+\n+ lex*|flex*)\n+ echo 1>&2 "\\\n+WARNING: \\`$1\' is $msg. You should only need it if\n+ you modified a \\`.l\' file. You may need the \\`Flex\' package\n+ in order for those modifications to take effect. You can get\n+ \\`Flex\' from any GNU archive site."\n+ rm -f lex.yy.c\n+ if test $# -ne 1; then\n+ eval LASTARG="\\${$#}"\n+\tcase $LASTARG in\n+\t*.l)\n+\t SRCFILE=`echo "$LASTARG" | sed \'s/l$/c/\'`\n+\t if test -f "$SRCFILE"; then\n+\t cp "$SRCFILE" lex.yy.c\n+\t fi\n+\t ;;\n+\tesac\n+ fi\n+ if test ! -f lex.yy.c; then\n+\techo \'main() { return 0; }\' >lex.yy.c\n+ fi\n+ ;;\n+\n+ help2man*)\n+ echo 1>&2 "\\\n+WARNING: \\`$1\' is $msg. You should only need it if\n+\t you modified a dependency of a manual page. You may need the\n+\t \\`Help2man\' package in order for those modifications to take\n+\t effect. You can get \\`Help2man\' from any GNU archive site."\n+\n+ file=`echo "$*" | sed -n "$sed_output"`\n+ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`\n+ if test -f "$file"; then\n+\ttouch $file\n+ else\n+\ttest -z "$file" || exec >$file\n+\techo ".ab help2man is required to generate this page"\n+\texit $?\n+ fi\n+ ;;\n+\n+ makeinfo*)\n+ echo 1>&2 "\\\n+WARNING: \\`$1\' is $msg. You should only need it if\n+ you modified a \\`.texi\' or \\`.texinfo\' file, or any other file\n+ indirectly affecting the aspect of the manual. The spurious\n+ call might also be the consequence of using a buggy \\`make\' (AIX,\n+ DU, IRIX). You might want to install the \\`Texinfo\' package or\n+ the \\`GNU make\' package. Grab either from any GNU archive site."\n+ # The file to touch is that specified with -o ...\n+ file=`echo "$*" | sed -n "$sed_output"`\n+ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`\n+ if test -z "$file"; then\n+ # ... or it is the one specified with @setfilename ...\n+ infile=`echo "$*" | sed \'s/.* \\([^ ]*\\) *$/\\1/\'`\n+ file=`sed -n \'\n+\t/^@setfilename/{\n+\t s/.* \\([^ ]*\\) *$/\\1/\n+\t p\n+\t q\n+\t}\' $infile`\n+ # ... or it is derived from the source name (dir/f.texi becomes f.info)\n+ test -z "$file" && file=`echo "$infile" | sed \'s,.*/,,;s,.[^.]*$,,\'`.info\n+ fi\n+ # If the file does not exist, the user really needs makeinfo;\n+ # let\'s fail without touching anything.\n+ test -f $file || exit 1\n+ touch $file\n+ ;;\n+\n+ tar*)\n+ shift\n+\n+ # We have already tried tar in the generic part.\n+ # Look for gnutar/gtar before invocation to avoid ugly error\n+ # messages.\n+ if (gnutar --version > /dev/null 2>&1); then\n+ gnutar "$@" && exit 0\n+ fi\n+ if (gtar --version > /dev/null 2>&1); then\n+ gtar "$@" && exit 0\n+ fi\n+ firstarg="$1"\n+ if shift; then\n+\tcase $firstarg in\n+\t*o*)\n+\t firstarg=`echo "$firstarg" | sed s/o//`\n+\t tar "$firstarg" "$@" && exit 0\n+\t ;;\n+\tesac\n+\tcase $firstarg in\n+\t*h*)\n+\t firstarg=`echo "$firstarg" | sed s/h//`\n+\t tar "$firstarg" "$@" && exit 0\n+\t ;;\n+\tesac\n+ fi\n+\n+ echo 1>&2 "\\\n+WARNING: I can\'t seem to be able to run \\`tar\' with the given arguments.\n+ You may want to install GNU tar or Free paxutils, or check the\n+ command line arguments."\n+ exit 1\n+ ;;\n+\n+ *)\n+ echo 1>&2 "\\\n+WARNING: \\`$1\' is needed, and is $msg.\n+ You might have modified some files without having the\n+ proper tools for further handling them. Check the \\`README\' file,\n+ it often tells you about the needed prerequisites for installing\n+ this package. You may also peek at any GNU archive site, in case\n+ some other package would contain this missing \\`$1\' program."\n+ exit 1\n+ ;;\n+esac\n+\n+exit 0\n+\n+# Local variables:\n+# eval: (add-hook \'write-file-hooks \'time-stamp)\n+# time-stamp-start: "scriptversion="\n+# time-stamp-format: "%:y-%02m-%02d.%02H"\n+# time-stamp-time-zone: "UTC"\n+# time-stamp-end: "; # UTC"\n+# End:\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/Makefile.am --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/Makefile.am Thu Jul 21 13:35:08 2011 -0400 |
b |
@@ -0,0 +1,31 @@ +EXTRA_DIST = clustalo-api-test.c + +SUBDIRS = hhalign squid kmpp clustal + +AM_LDFLAGS = @AM_LDFLAGS@ +AM_CXXFLAGS = @AM_CXXFLAGS@ @OPENMP_CXXFLAGS@ +AM_CFLAGS = @AM_CFLAGS@ @OPENMP_CFLAGS@ + + +# the following is the clustalo convenience library which wraps all +# the other noinst libraries + +lib_LTLIBRARIES = libclustalo.la + +libclustalo_la_SOURCES = clustal-omega.c +libclustalo_la_LIBADD = clustal/libclustal.la \ + hhalign/libhhalign.la \ + squid/libsquid.la \ + kmpp/libkmpp.la +libclustalo_la_LDFLAGS = -static +library_includedir=$(includedir)/clustalo/ +library_include_HEADERS = clustal-omega-config.h clustal-omega.h + + + +bin_PROGRAMS = clustalo + +clustalo_SOURCES = main.cpp \ + mymain.c mymain.h + +clustalo_LDADD = libclustalo.la |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/Makefile.in --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/Makefile.in Thu Jul 21 13:35:08 2011 -0400 |
[ |
b'@@ -0,0 +1,832 @@\n+# Makefile.in generated by automake 1.11.1 from Makefile.am.\n+# @configure_input@\n+\n+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,\n+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,\n+# Inc.\n+# This Makefile.in is free software; the Free Software Foundation\n+# gives unlimited permission to copy and/or distribute it,\n+# with or without modifications, as long as this notice is preserved.\n+\n+# This program is distributed in the hope that it will be useful,\n+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without\n+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A\n+# PARTICULAR PURPOSE.\n+\n+@SET_MAKE@\n+\n+\n+\n+VPATH = @srcdir@\n+pkgdatadir = $(datadir)/@PACKAGE@\n+pkgincludedir = $(includedir)/@PACKAGE@\n+pkglibdir = $(libdir)/@PACKAGE@\n+pkglibexecdir = $(libexecdir)/@PACKAGE@\n+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd\n+install_sh_DATA = $(install_sh) -c -m 644\n+install_sh_PROGRAM = $(install_sh) -c\n+install_sh_SCRIPT = $(install_sh) -c\n+INSTALL_HEADER = $(INSTALL_DATA)\n+transform = $(program_transform_name)\n+NORMAL_INSTALL = :\n+PRE_INSTALL = :\n+POST_INSTALL = :\n+NORMAL_UNINSTALL = :\n+PRE_UNINSTALL = :\n+POST_UNINSTALL = :\n+build_triplet = @build@\n+host_triplet = @host@\n+bin_PROGRAMS = clustalo$(EXEEXT)\n+subdir = src\n+DIST_COMMON = $(library_include_HEADERS) $(srcdir)/Makefile.am \\\n+\t$(srcdir)/Makefile.in $(srcdir)/config.h.in\n+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4\n+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_prefix_config_h.m4 \\\n+\t$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \\\n+\t$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \\\n+\t$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/ax_openmp.m4 \\\n+\t$(top_srcdir)/configure.ac\n+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \\\n+\t$(ACLOCAL_M4)\n+mkinstalldirs = $(install_sh) -d\n+CONFIG_HEADER = config.h\n+CONFIG_CLEAN_FILES =\n+CONFIG_CLEAN_VPATH_FILES =\n+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed \'s|.|.|g\'`;\n+am__vpath_adj = case $$p in \\\n+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \\\n+ *) f=$$p;; \\\n+ esac;\n+am__strip_dir = f=`echo $$p | sed -e \'s|^.*/||\'`;\n+am__install_max = 40\n+am__nobase_strip_setup = \\\n+ srcdirstrip=`echo "$(srcdir)" | sed \'s/[].[^$$\\\\*|]/\\\\\\\\&/g\'`\n+am__nobase_strip = \\\n+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"\n+am__nobase_list = $(am__nobase_strip_setup); \\\n+ for p in $$list; do echo "$$p $$p"; done | \\\n+ sed "s| $$srcdirstrip/| |;"\' / .*\\//!s/ .*/ ./; s,\\( .*\\)/[^/]*$$,\\1,\' | \\\n+ $(AWK) \'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \\\n+ if (++n[$$2] == $(am__install_max)) \\\n+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \\\n+ END { for (dir in files) print dir, files[dir] }\'\n+am__base_list = \\\n+ sed \'$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\\n/ /g\' | \\\n+ sed \'$$!N;$$!N;$$!N;$$!N;s/\\n/ /g\'\n+am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \\\n+\t"$(DESTDIR)$(library_includedir)"\n+LTLIBRARIES = $(lib_LTLIBRARIES)\n+libclustalo_la_DEPENDENCIES = clustal/libclustal.la \\\n+\thhalign/libhhalign.la squid/libsquid.la kmpp/libkmpp.la\n+am_libclustalo_la_OBJECTS = clustal-omega.lo\n+libclustalo_la_OBJECTS = $(am_libclustalo_la_OBJECTS)\n+libclustalo_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \\\n+\t$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \\\n+\t$(libclustalo_la_LDFLAGS) $(LDFLAGS) -o $@\n+PROGRAMS = $(bin_PROGRAMS)\n+am_clustalo_OBJECTS = main.$(OBJEXT) mymain.$(OBJEXT)\n+clustalo_OBJECTS = $(am_clustalo_OBJECTS)\n+clustalo_DEPENDENCIES = libclustalo.la\n+DEFAULT_INCLUDES = -I.@am__isrc@\n+depcomp = $(SHELL) $(top_srcdir)/depcomp\n+am__depfiles_maybe = depfiles\n+am__mv = mv -f\n+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \\\n+\t$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)\n+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \\\n+\t--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \\\n+\t'..b'dir" \\\n+\t distdir="$$new_distdir" \\\n+\t\tam__remove_distdir=: \\\n+\t\tam__skip_length_check=: \\\n+\t\tam__skip_mode_fix=: \\\n+\t distdir) \\\n+\t || exit 1; \\\n+\t fi; \\\n+\tdone\n+check-am: all-am\n+check: check-recursive\n+all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(HEADERS) config.h\n+install-binPROGRAMS: install-libLTLIBRARIES\n+\n+installdirs: installdirs-recursive\n+installdirs-am:\n+\tfor dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(library_includedir)"; do \\\n+\t test -z "$$dir" || $(MKDIR_P) "$$dir"; \\\n+\tdone\n+install: install-recursive\n+install-exec: install-exec-recursive\n+install-data: install-data-recursive\n+uninstall: uninstall-recursive\n+\n+install-am: all-am\n+\t@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am\n+\n+installcheck: installcheck-recursive\n+install-strip:\n+\t$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \\\n+\t install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \\\n+\t `test -z \'$(STRIP)\' || \\\n+\t echo "INSTALL_PROGRAM_ENV=STRIPPROG=\'$(STRIP)\'"` install\n+mostlyclean-generic:\n+\n+clean-generic:\n+\n+distclean-generic:\n+\t-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)\n+\t-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)\n+\n+maintainer-clean-generic:\n+\t@echo "This command is intended for maintainers to use"\n+\t@echo "it deletes files that may require special tools to rebuild."\n+clean: clean-recursive\n+\n+clean-am: clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \\\n+\tclean-libtool mostlyclean-am\n+\n+distclean: distclean-recursive\n+\t-rm -rf ./$(DEPDIR)\n+\t-rm -f Makefile\n+distclean-am: clean-am distclean-compile distclean-generic \\\n+\tdistclean-hdr distclean-tags\n+\n+dvi: dvi-recursive\n+\n+dvi-am:\n+\n+html: html-recursive\n+\n+html-am:\n+\n+info: info-recursive\n+\n+info-am:\n+\n+install-data-am: install-library_includeHEADERS\n+\n+install-dvi: install-dvi-recursive\n+\n+install-dvi-am:\n+\n+install-exec-am: install-binPROGRAMS install-libLTLIBRARIES\n+\n+install-html: install-html-recursive\n+\n+install-html-am:\n+\n+install-info: install-info-recursive\n+\n+install-info-am:\n+\n+install-man:\n+\n+install-pdf: install-pdf-recursive\n+\n+install-pdf-am:\n+\n+install-ps: install-ps-recursive\n+\n+install-ps-am:\n+\n+installcheck-am:\n+\n+maintainer-clean: maintainer-clean-recursive\n+\t-rm -rf ./$(DEPDIR)\n+\t-rm -f Makefile\n+maintainer-clean-am: distclean-am maintainer-clean-generic\n+\n+mostlyclean: mostlyclean-recursive\n+\n+mostlyclean-am: mostlyclean-compile mostlyclean-generic \\\n+\tmostlyclean-libtool\n+\n+pdf: pdf-recursive\n+\n+pdf-am:\n+\n+ps: ps-recursive\n+\n+ps-am:\n+\n+uninstall-am: uninstall-binPROGRAMS uninstall-libLTLIBRARIES \\\n+\tuninstall-library_includeHEADERS\n+\n+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \\\n+\tctags-recursive install-am install-strip tags-recursive\n+\n+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \\\n+\tall all-am check check-am clean clean-binPROGRAMS \\\n+\tclean-generic clean-libLTLIBRARIES clean-libtool ctags \\\n+\tctags-recursive distclean distclean-compile distclean-generic \\\n+\tdistclean-hdr distclean-libtool distclean-tags distdir dvi \\\n+\tdvi-am html html-am info info-am install install-am \\\n+\tinstall-binPROGRAMS install-data install-data-am install-dvi \\\n+\tinstall-dvi-am install-exec install-exec-am install-html \\\n+\tinstall-html-am install-info install-info-am \\\n+\tinstall-libLTLIBRARIES install-library_includeHEADERS \\\n+\tinstall-man install-pdf install-pdf-am install-ps \\\n+\tinstall-ps-am install-strip installcheck installcheck-am \\\n+\tinstalldirs installdirs-am maintainer-clean \\\n+\tmaintainer-clean-generic mostlyclean mostlyclean-compile \\\n+\tmostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \\\n+\ttags tags-recursive uninstall uninstall-am \\\n+\tuninstall-binPROGRAMS uninstall-libLTLIBRARIES \\\n+\tuninstall-library_includeHEADERS\n+\n+\n+# Tell versions [3.59,3.63) of GNU make to not export all variables.\n+# Otherwise a system limit (for SysV at least) may be exceeded.\n+.NOEXPORT:\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/clustal-omega-config.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/clustal-omega-config.h Thu Jul 21 13:35:08 2011 -0400 |
b |
b"@@ -0,0 +1,353 @@\n+#ifndef _SRC_CLUSTAL_OMEGA_CONFIG_H\n+#define _SRC_CLUSTAL_OMEGA_CONFIG_H 1\n+ \n+/* src/clustal-omega-config.h. Generated automatically at end of configure. */\n+/* src/config.h. Generated from config.h.in by configure. */\n+/* src/config.h.in. Generated from configure.ac by autoheader. */\n+\n+/* Define if building universal (internal helper macro) */\n+/* #undef AC_APPLE_UNIVERSAL_BUILD */\n+\n+/* Let all files know they are being used inside Clustal Omega */\n+#ifndef CLUSTAL_OMEGA_CLUSTALO\n+#define CLUSTAL_OMEGA_CLUSTALO 1\n+#endif\n+\n+/* This is a CYGWIN system */\n+/* #undef CYGWIN */\n+\n+/* This is a Darwin system */\n+/* #undef DARWIN */\n+\n+/* Define to 1 if you have the <argtable2.h> header file. */\n+#ifndef CLUSTAL_OMEGA_HAVE_ARGTABLE2_H\n+#define CLUSTAL_OMEGA_HAVE_ARGTABLE2_H 1\n+#endif\n+\n+/* Define to 1 if you have the <assert.h> header file. */\n+#ifndef CLUSTAL_OMEGA_HAVE_ASSERT_H\n+#define CLUSTAL_OMEGA_HAVE_ASSERT_H 1\n+#endif\n+\n+/* Define to 1 if you have the <ctype.h> header file. */\n+#ifndef CLUSTAL_OMEGA_HAVE_CTYPE_H\n+#define CLUSTAL_OMEGA_HAVE_CTYPE_H 1\n+#endif\n+\n+/* Define to 1 if you have the <dlfcn.h> header file. */\n+#ifndef CLUSTAL_OMEGA_HAVE_DLFCN_H\n+#define CLUSTAL_OMEGA_HAVE_DLFCN_H 1\n+#endif\n+\n+/* Define to 1 if you have the <float.h> header file. */\n+#ifndef CLUSTAL_OMEGA_HAVE_FLOAT_H\n+#define CLUSTAL_OMEGA_HAVE_FLOAT_H 1\n+#endif\n+\n+/* Define to 1 if you have the `fseek64' function. */\n+/* #undef HAVE_FSEEK64 */\n+\n+/* Define to 1 if you have the `fseeko' function. */\n+#ifndef CLUSTAL_OMEGA_HAVE_FSEEKO\n+#define CLUSTAL_OMEGA_HAVE_FSEEKO 1\n+#endif\n+\n+/* Define to 1 if you have the `fseeko64' function. */\n+#ifndef CLUSTAL_OMEGA_HAVE_FSEEKO64\n+#define CLUSTAL_OMEGA_HAVE_FSEEKO64 1\n+#endif\n+\n+/* Define to 1 if you have the `ftell64' function. */\n+/* #undef HAVE_FTELL64 */\n+\n+/* Define to 1 if you have the `ftello' function. */\n+#ifndef CLUSTAL_OMEGA_HAVE_FTELLO\n+#define CLUSTAL_OMEGA_HAVE_FTELLO 1\n+#endif\n+\n+/* Define to 1 if you have the `ftello64' function. */\n+#ifndef CLUSTAL_OMEGA_HAVE_FTELLO64\n+#define CLUSTAL_OMEGA_HAVE_FTELLO64 1\n+#endif\n+\n+/* Define to 1 if you have the <inttypes.h> header file. */\n+#ifndef CLUSTAL_OMEGA_HAVE_INTTYPES_H\n+#define CLUSTAL_OMEGA_HAVE_INTTYPES_H 1\n+#endif\n+\n+/* Define to 1 if you have the `argtable2' library (-largtable2). */\n+#ifndef CLUSTAL_OMEGA_HAVE_LIBARGTABLE2\n+#define CLUSTAL_OMEGA_HAVE_LIBARGTABLE2 1\n+#endif\n+\n+/* Define to 1 if you have the `m' library (-lm). */\n+#ifndef CLUSTAL_OMEGA_HAVE_LIBM\n+#define CLUSTAL_OMEGA_HAVE_LIBM 1\n+#endif\n+\n+/* Define to 1 if you have the <limits.h> header file. */\n+#ifndef CLUSTAL_OMEGA_HAVE_LIMITS_H\n+#define CLUSTAL_OMEGA_HAVE_LIMITS_H 1\n+#endif\n+\n+/* Has log2() */\n+#ifndef CLUSTAL_OMEGA_HAVE_LOG2\n+#define CLUSTAL_OMEGA_HAVE_LOG2 1\n+#endif\n+\n+/* Define to 1 if you have the <math.h> header file. */\n+#ifndef CLUSTAL_OMEGA_HAVE_MATH_H\n+#define CLUSTAL_OMEGA_HAVE_MATH_H 1\n+#endif\n+\n+/* Define to 1 if you have the <memory.h> header file. */\n+#ifndef CLUSTAL_OMEGA_HAVE_MEMORY_H\n+#define CLUSTAL_OMEGA_HAVE_MEMORY_H 1\n+#endif\n+\n+/* Define to 1 if you have the `ntohl' function. */\n+#ifndef CLUSTAL_OMEGA_HAVE_NTOHL\n+#define CLUSTAL_OMEGA_HAVE_NTOHL 1\n+#endif\n+\n+/* Define to 1 if you have the `ntohs' function. */\n+#ifndef CLUSTAL_OMEGA_HAVE_NTOHS\n+#define CLUSTAL_OMEGA_HAVE_NTOHS 1\n+#endif\n+\n+/* Define to 1 if you have the `ntonl' function. */\n+/* #undef HAVE_NTONL */\n+\n+/* Define to 1 if you have the `ntons' function. */\n+/* #undef HAVE_NTONS */\n+\n+/* Defined if OpenMP should and can be used */\n+#ifndef CLUSTAL_OMEGA_HAVE_OPENMP\n+#define CLUSTAL_OMEGA_HAVE_OPENMP 1\n+#endif\n+\n+/* Define to 1 if you have the <stdarg.h> header file. */\n+#ifndef CLUSTAL_OMEGA_HAVE_STDARG_H\n+#define CLUSTAL_OMEGA_HAVE_STDARG_H 1\n+#endif\n+\n+/* Define to 1 if you have the <stdint.h> header file. */\n+#ifndef CLUSTAL_OMEGA_HAVE_STDINT_H\n+#define CLUSTAL_OMEGA_HAVE_STDINT_H 1\n+#endif\n+\n+/* Define to 1 if you have the <stdio.h> header file. */\n+#ifndef C"..b'Define to the address where bug reports for this package should be sent. */\n+#ifndef CLUSTAL_OMEGA_PACKAGE_BUGREPORT\n+#define CLUSTAL_OMEGA_PACKAGE_BUGREPORT "clustalw@ucd.ie"\n+#endif\n+\n+/* The package code name */\n+#ifndef CLUSTAL_OMEGA_PACKAGE_CODENAME\n+#define CLUSTAL_OMEGA_PACKAGE_CODENAME "DeshilHollesEamus"\n+#endif\n+\n+/* Define to the full name of this package. */\n+#ifndef CLUSTAL_OMEGA_PACKAGE_NAME\n+#define CLUSTAL_OMEGA_PACKAGE_NAME "Clustal Omega"\n+#endif\n+\n+/* Define to the full name and version of this package. */\n+#ifndef CLUSTAL_OMEGA_PACKAGE_STRING\n+#define CLUSTAL_OMEGA_PACKAGE_STRING "Clustal Omega 1.0.2"\n+#endif\n+\n+/* Define to the one symbol short name of this package. */\n+#ifndef CLUSTAL_OMEGA_PACKAGE_TARNAME\n+#define CLUSTAL_OMEGA_PACKAGE_TARNAME "clustal-omega"\n+#endif\n+\n+/* Define to the home page for this package. */\n+#ifndef CLUSTAL_OMEGA_PACKAGE_URL\n+#define CLUSTAL_OMEGA_PACKAGE_URL ""\n+#endif\n+\n+/* Define to the version of this package. */\n+#ifndef CLUSTAL_OMEGA_PACKAGE_VERSION\n+#define CLUSTAL_OMEGA_PACKAGE_VERSION "1.0.2"\n+#endif\n+\n+/* The size of `fpos_t\', as computed by sizeof. */\n+#ifndef CLUSTAL_OMEGA_SIZEOF_FPOS_T\n+#define CLUSTAL_OMEGA_SIZEOF_FPOS_T 16\n+#endif\n+\n+/* The size of `unsigned int\', as computed by sizeof. */\n+#ifndef CLUSTAL_OMEGA_SIZEOF_UNSIGNED_INT\n+#define CLUSTAL_OMEGA_SIZEOF_UNSIGNED_INT 4\n+#endif\n+\n+/* The size of `unsigned long\', as computed by sizeof. */\n+#ifndef CLUSTAL_OMEGA_SIZEOF_UNSIGNED_LONG\n+#define CLUSTAL_OMEGA_SIZEOF_UNSIGNED_LONG 8\n+#endif\n+\n+/* The size of `unsigned long long\', as computed by sizeof. */\n+#ifndef CLUSTAL_OMEGA_SIZEOF_UNSIGNED_LONG_LONG\n+#define CLUSTAL_OMEGA_SIZEOF_UNSIGNED_LONG_LONG 8\n+#endif\n+\n+/* The size of `unsigned short\', as computed by sizeof. */\n+#ifndef CLUSTAL_OMEGA_SIZEOF_UNSIGNED_SHORT\n+#define CLUSTAL_OMEGA_SIZEOF_UNSIGNED_SHORT 2\n+#endif\n+\n+/* This is a Solaris system */\n+/* #undef SOLARIS */\n+\n+/* This is a BSD system */\n+/* #undef SOMEBSD */\n+\n+/* Define to 1 if you have the ANSI C header files. */\n+#ifndef CLUSTAL_OMEGA_STDC_HEADERS\n+#define CLUSTAL_OMEGA_STDC_HEADERS 1\n+#endif\n+\n+/* Enable extensions on AIX 3, Interix. */\n+#ifndef _ALL_SOURCE\n+# define _ALL_SOURCE 1\n+#endif\n+/* Enable GNU extensions on systems that have them. */\n+#ifndef _GNU_SOURCE\n+# define _GNU_SOURCE 1\n+#endif\n+/* Enable threading extensions on Solaris. */\n+#ifndef _POSIX_PTHREAD_SEMANTICS\n+# define _POSIX_PTHREAD_SEMANTICS 1\n+#endif\n+/* Enable extensions on HP NonStop. */\n+#ifndef _TANDEM_SOURCE\n+# define _TANDEM_SOURCE 1\n+#endif\n+/* Enable general extensions on Solaris. */\n+#ifndef __EXTENSIONS__\n+# define __EXTENSIONS__ 1\n+#endif\n+\n+\n+/* Version number of package */\n+#ifndef CLUSTAL_OMEGA_VERSION\n+#define CLUSTAL_OMEGA_VERSION "1.0.2"\n+#endif\n+\n+/* Define if using the dmalloc debugging malloc package */\n+/* #undef WITH_DMALLOC */\n+\n+/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most\n+ significant byte first (like Motorola and SPARC, unlike Intel). */\n+#if defined AC_APPLE_UNIVERSAL_BUILD\n+# if defined __BIG_ENDIAN__\n+# define WORDS_BIGENDIAN 1\n+# endif\n+#else\n+# ifndef WORDS_BIGENDIAN\n+/* # undef WORDS_BIGENDIAN */\n+# endif\n+#endif\n+\n+/* Define to 1 if on MINIX. */\n+/* #undef _MINIX */\n+\n+/* Define to 2 if the system does not provide POSIX.1 features except with\n+ this defined. */\n+/* #undef _POSIX_1_SOURCE */\n+\n+/* Define to 1 if you need to in order for `stat\' and other things to work. */\n+/* #undef _POSIX_SOURCE */\n+\n+/* Define to empty if `const\' does not conform to ANSI C. */\n+/* #undef const */\n+\n+/* Define to `__inline__\' or `__inline\' if that\'s what the C compiler\n+ calls it, or to nothing if \'inline\' is not supported under any name. */\n+#ifndef __cplusplus\n+/* #undef inline */\n+#endif\n+\n+/* Define to `long int\' if <sys/types.h> does not define. */\n+/* #undef off_t */\n+\n+/* Define to `unsigned int\' if <sys/types.h> does not define. */\n+/* #undef size_t */\n+ \n+/* once: _SRC_CLUSTAL_OMEGA_CONFIG_H */\n+#endif\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/clustal-omega.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/clustal-omega.c Thu Jul 21 13:35:08 2011 -0400 |
[ |
b'@@ -0,0 +1,1385 @@\n+/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n+\n+/*********************************************************************\n+ * Clustal Omega - Multiple sequence alignment\n+ *\n+ * Copyright (C) 2010 University College Dublin\n+ *\n+ * Clustal-Omega is free software; you can redistribute it and/or\n+ * modify it under the terms of the GNU General Public License as\n+ * published by the Free Software Foundation; either version 2 of the\n+ * License, or (at your option) any later version.\n+ *\n+ * This file is part of Clustal-Omega.\n+ *\n+ ********************************************************************/\n+\n+/*\n+ * RCS $Id: clustal-omega.c 254 2011-06-21 13:07:50Z andreas $\n+ */\n+\n+#ifdef HAVE_CONFIG_H\n+#include "config.h"\n+#endif\n+\n+#include <assert.h>\n+\n+#include "clustal-omega.h"\n+#include "hhalign/general.h"\n+\n+/* The following comment block contains the frontpage/mainpage of the doxygen\n+ * documentation. Please add some more info. FIXME add more\n+ */\n+\n+/**\n+ *\n+ * @mainpage Clustal-Omega Documentation\n+ *\n+ * @section intro_sec Introduction\n+ *\n+ * For more information see http://www.clustal.org/\n+ *\n+ * @section api_section API\n+ *\n+ * @subsection example_prog_subsection An Example Program\n+ *\n+ * To use libclustalo you will have to include the clustal-omega.h header and\n+ * link against libclustalo. For linking against libclustalo you will have to\n+ * use a C++ compiler, no matter if your program was written in C or C++.\n+ *\n+ * First compile (no linking) your source (for an example see section "\\ref\n+ * example_src_subsubsec"):\n+ *\n+ * @code\n+ * $ gcc -c -ansi -Wall clustalo-api-test.c\n+ * @endcode\n+ *\n+ * Then link against libclustalo (we recommend the use of pkg-config as\n+ * explained in \\ref pkgconfig_subsubsec). Assuming Clustal Omega was installed\n+ * in system-wide default directory (e.g. /usr) just type:\n+ *\n+ * @code\n+ * $ g++ -ansi -Wall -o clustalo-api-test clustalo-api-test.o -lclustalo\n+ * @endcode\n+ *\n+ * Voila! Now you have your own alignment program which can be run with\n+ *\n+ * @code\n+ * $ ./clustalo-api-test <your-sequence-input>\n+ * @endcode\n+ * \n+ * It\'s best to use the same compiler that you used for compiling libclustal.\n+ * If libclustal was compiled with OpenMP support, you will have to use OpenMP\n+ * flags for you program as well.\n+ *\n+ *\n+ * @subsubsection pkgconfig_subsubsec Using pkg-config / Figuring out compiler flags\n+ *\n+ * Clustal Omega comes with support for <a\n+ * href="http://pkg-config.freedesktop.org">pkg-config</a>, which means you\n+ * can run\n+ *\n+ * @code\n+ * $ pkg-config --cflags --libs clustalo\n+ * @endcode\n+ *\n+ * to figure out cflags and library flags needed to compile and link against\n+ * libclustalo. This is especially handy if Clustal Omega was installed to a\n+ * non-standard directory.\n+ * \n+ * You might have to change PKG_CONFIG_PATH. For example, if you used the prefix $HOME/local/ for\n+ * installation then you will first need to set PKG_CONFIG_PATH:\n+ *\n+ * @code\n+ * $ export PKG_CONFIG_PATH=$HOME/local/lib/pkgconfig\n+ * $ pkg-config --cflags --libs clustalo\n+ * @endcode\n+ * \n+ * \n+ * To compile your source use:\n+ * \n+ * @code\n+ * $ export PKG_CONFIG_PATH=$HOME/local/lib/pkgconfig\n+ * $ gcc -c -ansi -Wall clustalo-api-test.c $(pkg-config --cflags clustalo)\n+ * $ g++ -ansi -Wall -o clustalo-api-test clustalo-api-test.o $(pkg-config --libs clustalo)\n+ * @endcode\n+ *\n+ *\n+ * @subsubsection example_src_subsubsec Example Source Code\n+ *\n+ * @include "clustalo-api-test.c"\n+ *\n+ *\n+ */\n+\n+\n+\n+\n+/* FIXME: doc */\n+/* the following are temporary flags while the code is still under construction;\n+ had problems internalising hhmake, so as temporary crutch \n+ write alignment to file and get external hmmer/hhmake via system call \n+ to read alignment and convert into HMM\n+ All this will go, once hhmake is properly internalised */\n+#define INDIRECT_HMM 0 /* temp flag: (1) write aln to file, use system(hmmer/hhmake), (0) '..b' &rHMMLocal, 1, -1, rHhalignPara);\n+ Log(&rLog, LOG_VERBOSE,\n+ "Alignment score for alignmnent in hmm-iteration no %d = %f (last score = %f)",\n+ iIterationCounter+1, dAlnScore, dLastAlnScore);\n+ \n+ \n+ FreeHMMstruct(&rHMMLocal);\n+\n+#if 0\n+ /* FIXME: need a better score for automatic iteration */\n+ if (prOpts->bIterationsAuto) {\n+ /* automatic iteration: break if score improvement was not\n+ * big enough\n+ */\n+ double dScoreImprovement = (dAlnScore-dLastAlnScore)/dLastAlnScore;\n+ if (dScoreImprovement < ITERATION_SCORE_IMPROVEMENT_THRESHOLD) {\n+ Log(&rLog, LOG_INFO,\n+ "Stopping after %d guide-tree iterations. No further alignment score improvement achieved.",\n+ iIterationCounter+1);\n+ /* use previous alignment */\n+ FreeMSeq(&prMSeq);\n+ Log(&rLog, LOG_FORCED_DEBUG, "FIXME: %s", "CopyMSeq breaks things in this context");\n+ CopyMSeq(&prMSeq, prMSeqCopy);\n+ /* FIXME: prOpts->pcDistmatOutfile and pcGuidetreeOutfile\n+ * might have been updated, but then discarded here?\n+ */\n+ break;\n+ } else {\n+ Log(&rLog, LOG_INFO,\n+ "Got a %d%% better score in iteration step %d",\n+ (int)dScoreImprovement*100, iIterationCounter+1);\n+ FreeMSeq(&prMSeqCopy);\n+ }\n+ }\n+ dLastAlnScore = dAlnScore;\n+#endif\n+\n+ }\n+ /* end of iterations */\n+\n+\n+\n+ /* Last step: if a profile was also provided then align now-aligned mseq\n+ * with this profile\n+ *\n+ * Don\'t use the backgrounds HMMs anymore and don\'t iterate.\n+ * (which was done before).\n+ *\n+ */\n+ if (NULL != prMSeqProfile) {\n+ if (AlignProfiles(prMSeq, prMSeqProfile, rHhalignPara)) {\n+ Log(&rLog, LOG_ERROR, "An error occured during the profile/profile alignment");\n+ return -1;\n+ }\n+ }\n+\n+ \n+ if (NULL != piOrderLR) {\n+ CKFREE(piOrderLR);\n+ }\n+ if (NULL != pdSeqWeights) {\n+ CKFREE(pdSeqWeights);\n+ }\n+ if (0 < prOpts->iHMMInputFiles) {\n+ for (i=0; i<prOpts->iHMMInputFiles; i++) {\n+ FreeHMMstruct(&prHMMs[i]);\n+ }\n+ CKFREE(prHMMs);\n+ }\n+\n+ return 0;\n+}\n+/* end of Align() */\n+\n+\n+\n+\n+/**\n+ * @brief Align two profiles, ie two sets of prealigned sequences. Already\n+ * aligned columns won\'t be changed.\n+ *\n+ * @param[out] prMSeqProfile1\n+ * First profile/aligned set of sequences. Merged alignment will be found in\n+ * here.\n+ * @param[in] prMSeqProfile2\n+ * First profile/aligned set of sequences\n+ *\n+ * @return 0 on success, -1 on failure\n+ *\n+ */\n+int\n+AlignProfiles(mseq_t *prMSeqProfile1, \n+ mseq_t *prMSeqProfile2, hhalign_para rHhalignPara) {\n+ \n+ double dAlnScore;\n+\n+ /* number of seqs in first half of joined profile */\n+ int iProfProfSeparator = prMSeqProfile1->nseqs;\n+\n+ assert(TRUE == prMSeqProfile1->aligned);\n+ assert(TRUE == prMSeqProfile2->aligned);\n+\n+ Log(&rLog, LOG_INFO, "Performing profile/profile alignment");\n+\n+ /* Combine the available mseqs into prMSeq\n+ * which will be aligned afterwards.\n+ */\n+ JoinMSeqs(&prMSeqProfile1, prMSeqProfile2);\n+\n+ \n+ /* set alignment flag explicitly to FALSE */\n+ prMSeqProfile1->aligned = FALSE;\n+ \n+ dAlnScore = HHalignWrapper(prMSeqProfile1,\n+ NULL, /* no order */\n+ NULL, /* no weights */\n+ 3, /* nodes: root+2profiles */\n+ NULL, 0 /* no bg-hmms */,\n+ iProfProfSeparator, rHhalignPara);\n+ \n+ Log(&rLog, LOG_VERBOSE, "Alignment score is = %f", dAlnScore);\n+\n+ return 0;\n+}\n+/* end of AlignProfiles() */\n+\n+\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/clustal-omega.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/clustal-omega.h Thu Jul 21 13:35:08 2011 -0400 |
b |
@@ -0,0 +1,167 @@ +/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ + +/********************************************************************* + * Clustal Omega - Multiple sequence alignment + * + * Copyright (C) 2010 University College Dublin + * + * Clustal-Omega is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This file is part of Clustal-Omega. + * + ********************************************************************/ + +/* + * RCS $Id: clustal-omega.h 212 2011-03-10 15:09:46Z andreas $ + */ + +#ifndef CLUSTALO_H +#define CLUSTALO_H + + + +#ifdef HAVE_OPENMP +#include <omp.h> +#endif + +#include "clustal-omega-config.h" + +/* the following needs to be kept in sync with library_include_HEADERS of all + * subdir Makefile.am's + */ + +/* hhalign */ +#include "hhalign/general.h" +#include "hhalign/hhfunc.h" + + +/* clustal */ +#include "clustal/log.h" +#include "clustal/util.h" +#include "clustal/symmatrix.h" +#include "clustal/tree.h" +#include "clustal/seq.h" +#include "clustal/mbed.h" +#include "clustal/weights.h" +#include "clustal/pair_dist.h" +#include "clustal/hhalign_wrapper.h" + + + +#define CLUSTERING_UNKNOWN 0 +#define CLUSTERING_UPGMA 1 + +/* weights will be computed if 1. but are not really used for now and they + * might slow things down. also, mbed's screws up branch lengths which will + * have a negative effect on weights +*/ +#define USE_WEIGHTS 0 + +extern int iNumberOfThreads; + + +/** user/commandline options + * + * changes here will have to be reflected in ParseCommandLine() + * and during setup of the default opts + * + */ +typedef struct { + /* auto: Clustal (know what) is good for you + */ + bool bAutoOptions; + + /* Distance matrix + */ + /** distance matrix input file */ + char *pcDistmatInfile; + /** distance matrix output file */ + char *pcDistmatOutfile; + + /* Clustering / guide-tree + */ + /** clustering type (from cmdline arg) */ + int iClusteringType; + /** pairwise distance method */ + int iPairDistType; + /** use mbed-like clustering */ + bool bUseMbed; + /** use mbed-like clustering also during iteration */ + bool bUseMbedForIteration; + /** guidetree output file */ + char *pcGuidetreeOutfile; + /** guidetree input file */ + char *pcGuidetreeInfile; + + /* HMMs + */ + /** HMM input files. index range: 0..iHMMInputFiles */ + char **ppcHMMInput; + /** number of provided HMM input files. not really a user + option but need for ppcHMMInput */ + int iHMMInputFiles; + + /* Iteration + */ + /** number of iterations */ + int iNumIterations; + /** determine number of iterations automatically */ + bool bIterationsAuto; + /** maximum number of hmm iterations */ + int iMaxHMMIterations; + /** max number of guidetree iterations */ + int iMaxGuidetreeIterations; + + /** max MAC RAM (maximum amount of RAM set aside for MAC algorithm) */ + int iMacRam; /* FS, r240 -> */ + + /* changes here will have to be reflected in FreeAlnOpts(), + * SetDefaultAlnOpts(), AlnOptsLogicCheck() etc + */ +} opts_t; + + + + + +extern void +PrintLongVersion(char *pcStr, int iSize); + +extern void +SetDefaultAlnOpts(opts_t *opts); + +extern void +FreeAlnOpts(opts_t *aln_opts); + +extern void +AlnOptsLogicCheck(opts_t *opts); + +extern void +PrintAlnOpts(FILE *prFile, opts_t *opts); + +extern void +InitClustalOmega(int iNumThreadsToUse); + +extern void +SequentialAlignmentOrder(int **piOrderLR_p, int iNumSeq); + +extern int +AlignmentOrder(int **piOrderLR_p, double **pdSeqWeights_p, mseq_t *prMSeq, + int iPairDistType, char *pcDistmatInfile, char *pcDistmatOutfile, + int iClusteringType, char *pcGuidetreeInfile, char *pcGuidetreeOutfile, + bool bUseMBed); + +extern int +Align(mseq_t *prMSeq, + mseq_t *prMSeqProfile, + opts_t *prOpts, + hhalign_para rHhalignPara); + +extern int +AlignProfiles(mseq_t *prMSeqProfile1, + mseq_t *prMSeqProfile2, hhalign_para rHhalignPara); + +#endif |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/clustal/Makefile.am --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/clustal/Makefile.am Thu Jul 21 13:35:08 2011 -0400 |
b |
@@ -0,0 +1,38 @@ +AM_CFLAGS = @OPENMP_CFLAGS@ @AM_CFLAGS@ +AM_LDFLAGS = @AM_LDFLAGS@ + +noinst_LTLIBRARIES = libclustal.la + +libclustal_la_SOURCES = \ + hhalign_wrapper.c hhalign_wrapper.h \ + ktuple_pair.c ktuple_pair.h \ + list.c list.h \ + log.c log.h \ + muscle_upgma.c muscle_upgma.h \ + muscle_tree.c muscle_tree.h \ + mbed.c mbed.h \ + pair_dist.h pair_dist.c \ + progress.c progress.h \ + queue.h \ + seq.c seq.h \ + symmatrix.c symmatrix.h \ + tree.c tree.h \ + util.c util.h \ + weights.c weights.h + +library_includedir=$(includedir)/clustalo/clustal + +library_include_HEADERS = \ + hhalign_wrapper.h \ + ktuple_pair.h \ + log.h \ + mbed.h \ + muscle_tree.h \ + pair_dist.h \ + progress.h \ + seq.h \ + symmatrix.h \ + tree.h \ + util.h \ + weights.h + |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/clustal/Makefile.in --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/clustal/Makefile.in Thu Jul 21 13:35:08 2011 -0400 |
[ |
b'@@ -0,0 +1,573 @@\n+# Makefile.in generated by automake 1.11.1 from Makefile.am.\n+# @configure_input@\n+\n+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,\n+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,\n+# Inc.\n+# This Makefile.in is free software; the Free Software Foundation\n+# gives unlimited permission to copy and/or distribute it,\n+# with or without modifications, as long as this notice is preserved.\n+\n+# This program is distributed in the hope that it will be useful,\n+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without\n+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A\n+# PARTICULAR PURPOSE.\n+\n+@SET_MAKE@\n+\n+\n+VPATH = @srcdir@\n+pkgdatadir = $(datadir)/@PACKAGE@\n+pkgincludedir = $(includedir)/@PACKAGE@\n+pkglibdir = $(libdir)/@PACKAGE@\n+pkglibexecdir = $(libexecdir)/@PACKAGE@\n+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd\n+install_sh_DATA = $(install_sh) -c -m 644\n+install_sh_PROGRAM = $(install_sh) -c\n+install_sh_SCRIPT = $(install_sh) -c\n+INSTALL_HEADER = $(INSTALL_DATA)\n+transform = $(program_transform_name)\n+NORMAL_INSTALL = :\n+PRE_INSTALL = :\n+POST_INSTALL = :\n+NORMAL_UNINSTALL = :\n+PRE_UNINSTALL = :\n+POST_UNINSTALL = :\n+build_triplet = @build@\n+host_triplet = @host@\n+subdir = src/clustal\n+DIST_COMMON = $(library_include_HEADERS) $(srcdir)/Makefile.am \\\n+\t$(srcdir)/Makefile.in\n+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4\n+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_prefix_config_h.m4 \\\n+\t$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \\\n+\t$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \\\n+\t$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/ax_openmp.m4 \\\n+\t$(top_srcdir)/configure.ac\n+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \\\n+\t$(ACLOCAL_M4)\n+mkinstalldirs = $(install_sh) -d\n+CONFIG_HEADER = $(top_builddir)/src/config.h\n+CONFIG_CLEAN_FILES =\n+CONFIG_CLEAN_VPATH_FILES =\n+LTLIBRARIES = $(noinst_LTLIBRARIES)\n+libclustal_la_LIBADD =\n+am_libclustal_la_OBJECTS = hhalign_wrapper.lo ktuple_pair.lo list.lo \\\n+\tlog.lo muscle_upgma.lo muscle_tree.lo mbed.lo pair_dist.lo \\\n+\tprogress.lo seq.lo symmatrix.lo tree.lo util.lo weights.lo\n+libclustal_la_OBJECTS = $(am_libclustal_la_OBJECTS)\n+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src\n+depcomp = $(SHELL) $(top_srcdir)/depcomp\n+am__depfiles_maybe = depfiles\n+am__mv = mv -f\n+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \\\n+\t$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)\n+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \\\n+\t--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \\\n+\t$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)\n+CCLD = $(CC)\n+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \\\n+\t--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \\\n+\t$(LDFLAGS) -o $@\n+SOURCES = $(libclustal_la_SOURCES)\n+DIST_SOURCES = $(libclustal_la_SOURCES)\n+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed \'s|.|.|g\'`;\n+am__vpath_adj = case $$p in \\\n+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \\\n+ *) f=$$p;; \\\n+ esac;\n+am__strip_dir = f=`echo $$p | sed -e \'s|^.*/||\'`;\n+am__install_max = 40\n+am__nobase_strip_setup = \\\n+ srcdirstrip=`echo "$(srcdir)" | sed \'s/[].[^$$\\\\*|]/\\\\\\\\&/g\'`\n+am__nobase_strip = \\\n+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"\n+am__nobase_list = $(am__nobase_strip_setup); \\\n+ for p in $$list; do echo "$$p $$p"; done | \\\n+ sed "s| $$srcdirstrip/| |;"\' / .*\\//!s/ .*/ ./; s,\\( .*\\)/[^/]*$$,\\1,\' | \\\n+ $(AWK) \'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \\\n+ if (++n[$$2] == $(am__install_max)) \\\n+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \\\n+ END { for (dir in files) print dir, files[dir] }\'\n+am__base_list = \\\n+ sed \'$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\\n/ /g\' | \\\n+ sed \'$$!N;$$!N;$$!N;$$!N;s/\\n/ /g\'\n+am__installdirs = "$(DESTDIR)$(library_includedir)"\n+HEADERS = $(library_include_HEADERS)\n+ETAGS ='..b'lddir)/|;t"`; \\\n+\tcase $$dist_files in \\\n+\t */*) $(MKDIR_P) `echo "$$dist_files" | \\\n+\t\t\t sed \'/\\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,\' | \\\n+\t\t\t sort -u` ;; \\\n+\tesac; \\\n+\tfor file in $$dist_files; do \\\n+\t if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \\\n+\t if test -d $$d/$$file; then \\\n+\t dir=`echo "/$$file" | sed -e \'s,/[^/]*$$,,\'`; \\\n+\t if test -d "$(distdir)/$$file"; then \\\n+\t find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \\;; \\\n+\t fi; \\\n+\t if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \\\n+\t cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \\\n+\t find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \\;; \\\n+\t fi; \\\n+\t cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \\\n+\t else \\\n+\t test -f "$(distdir)/$$file" \\\n+\t || cp -p $$d/$$file "$(distdir)/$$file" \\\n+\t || exit 1; \\\n+\t fi; \\\n+\tdone\n+check-am: all-am\n+check: check-am\n+all-am: Makefile $(LTLIBRARIES) $(HEADERS)\n+installdirs:\n+\tfor dir in "$(DESTDIR)$(library_includedir)"; do \\\n+\t test -z "$$dir" || $(MKDIR_P) "$$dir"; \\\n+\tdone\n+install: install-am\n+install-exec: install-exec-am\n+install-data: install-data-am\n+uninstall: uninstall-am\n+\n+install-am: all-am\n+\t@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am\n+\n+installcheck: installcheck-am\n+install-strip:\n+\t$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \\\n+\t install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \\\n+\t `test -z \'$(STRIP)\' || \\\n+\t echo "INSTALL_PROGRAM_ENV=STRIPPROG=\'$(STRIP)\'"` install\n+mostlyclean-generic:\n+\n+clean-generic:\n+\n+distclean-generic:\n+\t-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)\n+\t-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)\n+\n+maintainer-clean-generic:\n+\t@echo "This command is intended for maintainers to use"\n+\t@echo "it deletes files that may require special tools to rebuild."\n+clean: clean-am\n+\n+clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \\\n+\tmostlyclean-am\n+\n+distclean: distclean-am\n+\t-rm -rf ./$(DEPDIR)\n+\t-rm -f Makefile\n+distclean-am: clean-am distclean-compile distclean-generic \\\n+\tdistclean-tags\n+\n+dvi: dvi-am\n+\n+dvi-am:\n+\n+html: html-am\n+\n+html-am:\n+\n+info: info-am\n+\n+info-am:\n+\n+install-data-am: install-library_includeHEADERS\n+\n+install-dvi: install-dvi-am\n+\n+install-dvi-am:\n+\n+install-exec-am:\n+\n+install-html: install-html-am\n+\n+install-html-am:\n+\n+install-info: install-info-am\n+\n+install-info-am:\n+\n+install-man:\n+\n+install-pdf: install-pdf-am\n+\n+install-pdf-am:\n+\n+install-ps: install-ps-am\n+\n+install-ps-am:\n+\n+installcheck-am:\n+\n+maintainer-clean: maintainer-clean-am\n+\t-rm -rf ./$(DEPDIR)\n+\t-rm -f Makefile\n+maintainer-clean-am: distclean-am maintainer-clean-generic\n+\n+mostlyclean: mostlyclean-am\n+\n+mostlyclean-am: mostlyclean-compile mostlyclean-generic \\\n+\tmostlyclean-libtool\n+\n+pdf: pdf-am\n+\n+pdf-am:\n+\n+ps: ps-am\n+\n+ps-am:\n+\n+uninstall-am: uninstall-library_includeHEADERS\n+\n+.MAKE: install-am install-strip\n+\n+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \\\n+\tclean-libtool clean-noinstLTLIBRARIES ctags distclean \\\n+\tdistclean-compile distclean-generic distclean-libtool \\\n+\tdistclean-tags distdir dvi dvi-am html html-am info info-am \\\n+\tinstall install-am install-data install-data-am install-dvi \\\n+\tinstall-dvi-am install-exec install-exec-am install-html \\\n+\tinstall-html-am install-info install-info-am \\\n+\tinstall-library_includeHEADERS install-man install-pdf \\\n+\tinstall-pdf-am install-ps install-ps-am install-strip \\\n+\tinstallcheck installcheck-am installdirs maintainer-clean \\\n+\tmaintainer-clean-generic mostlyclean mostlyclean-compile \\\n+\tmostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \\\n+\ttags uninstall uninstall-am uninstall-library_includeHEADERS\n+\n+\n+# Tell versions [3.59,3.63) of GNU make to not export all variables.\n+# Otherwise a system limit (for SysV at least) may be exceeded.\n+.NOEXPORT:\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/clustal/hhalign_wrapper.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/clustal/hhalign_wrapper.c Thu Jul 21 13:35:08 2011 -0400 |
[ |
b'@@ -0,0 +1,1122 @@\n+/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n+\n+/*********************************************************************\n+ * Clustal Omega - Multiple sequence alignment\n+ *\n+ * Copyright (C) 2010 University College Dublin\n+ *\n+ * Clustal-Omega is free software; you can redistribute it and/or\n+ * modify it under the terms of the GNU General Public License as\n+ * published by the Free Software Foundation; either version 2 of the\n+ * License, or (at your option) any later version.\n+ *\n+ * This file is part of Clustal-Omega.\n+ *\n+ ********************************************************************/\n+\n+/*\n+ * RCS $Id: hhalign_wrapper.c 256 2011-06-23 13:57:28Z fabian $\n+ */\n+\n+#ifdef HAVE_CONFIG_H\n+#include "config.h"\n+#endif\n+\n+#include <stdlib.h>\n+#include <string.h>\n+#include <assert.h>\n+#include <ctype.h>\n+\n+#include "seq.h"\n+#include "tree.h"\n+#include "progress.h"\n+#include "hhalign/general.h"\n+#include "hhalign/hhfunc.h"\n+#include "hhalign/hhalign.h"\n+\n+/* up to this level (from leaf) will background HMM info be applied */\n+#define APPLY_BG_HMM_UP_TO_TREE_DEPTH 10\n+\n+#define TIMING 0\n+\n+#define TRACE 0\n+\n+/**\n+ * @brief get rid of unknown residues\n+ *\n+ * @note HHalignWrapper can be entered in 2 different ways: (i) all\n+ * sequences are un-aligned (ii) there are 2 (aligned) profiles. in\n+ * the un-aligned case (i) the sequences come straight from Squid,\n+ * that is, they have been sanitised, all non-alphabetic residues \n+ * have been rendered as X\'s. In profile mode (ii) one profile may \n+ * have been produced internally. In that case residues may have \n+ * been translated back into their \'native\' form, that is, they may\n+ * contain un-sanitised residues. These will cause trouble during\n+ * alignment\n+ * FS, r213->214\n+ */\n+void\n+SanitiseUnknown(mseq_t *mseq)\n+{\n+\n+ int iS; /* iterator for sequence */\n+ int iR; /* iterator for residue */\n+ int iLen; /* length of sequence */\n+ char *pcRes = NULL;\n+\n+\n+ for (iS = 0; iS < mseq->nseqs; iS++){\n+\n+ for (pcRes = mseq->seq[iS]; \'\\0\' != *pcRes; pcRes++){\n+\n+ if (isgap(*pcRes)){\n+ continue;\n+ }\n+\n+ if (mseq->seqtype==SEQTYPE_PROTEIN) {\n+ if (NULL == strchr(AMINO_ALPHABET, toupper(*pcRes))) {\n+ *pcRes = AMINOACID_ANY;\n+ }\n+ } else if (mseq->seqtype==SEQTYPE_DNA) {\n+ if (NULL == strchr(DNA_ALPHABET, toupper(*pcRes))) {\n+ *pcRes = NUCLEOTIDE_ANY;\n+ }\n+ } else if (mseq->seqtype==SEQTYPE_RNA) {\n+ if (NULL == strchr(RNA_ALPHABET, toupper(*pcRes))) {\n+ *pcRes = NUCLEOTIDE_ANY;\n+ }\n+ }\n+\n+ } /* !EO String */\n+\n+ } /* 0 <= iS < mseq->nseqs */\n+\n+ return;\n+\n+} /*** end: SanitiseUnknown() ***/\n+\n+/**\n+ * @brief translate unknown residues back to ambiguity codes;\n+ * hhalign translates ambiguity codes (B,Z) into unknown residue (X).\n+ * we still have the original (un-aligned) residue information,\n+ * by iterating along the original and aligned sequences we can\n+ * reconstruct where codes have been changed and restore them\n+ * to their original value\n+ *\n+ * @param[in,out] mseq\n+ * sequence/profile data, mseq->seq [in,out] is changed to conform\n+ * with mseq->orig_seq [in]\n+ *\n+ */\n+void\n+TranslateUnknown2Ambiguity(mseq_t *mseq)\n+{\n+\n+ int iS; /* iterator for sequence */\n+ int iR, iRo; /* iterator for residue (original) */\n+ int iChange, iCase, iAmbi; /* counts how many replacements */\n+ static int siOffset = \'a\' - \'A\';\n+\n+ for (iS = 0; iS < mseq->nseqs; iS++){\n+\n+ iR = iRo = 0;\n+ iChange = iCase = iAmbi = 0;\n+\n+ while((\'\\0\' != mseq->seq[iS][iR]) &&\n+ (\'\\0\' != mseq->orig_seq[iS][iRo])) {\n+\n+ /* skip gaps in aligned sequences */\n+ while(isgap(mseq->seq[iS][iR])) {\n+ iR++;\n+ } /* was gap i'..b' even Viterbi did not work\\n"\n+ "\\thh-error-code=%d (mac-ram=%d)\\n",\n+ __FUNCTION__, __FILE__, __LINE__, iHHret, rHhalignPara.iMacRamMB);\n+ Log(&rLog, LOG_FATAL, "could not perform alignment -- bailing out\\n");\n+ }\n+ else {\n+ fprintf(stderr, "%s:%s:%d: 2nd attempt worked", __FUNCTION__, __FILE__, __LINE__);\n+ }\n+ rHhalignPara.iMacRamMB = iOldMacRam; \n+ } /* 1st invocation failed */\n+\n+ } /* 2nd profile was shorter than 1st */\n+ \n+ }\n+ /* free left/right node lists,\n+ * after alignment left/right profiles no longer needed\n+ */\n+ if (NULL != ppcCopy1){\n+ int i;\n+ for (i = 0; i < piLeafCount[iL]; i++){\n+ CKFREE(ppcCopy1[i]);\n+ }\n+ CKFREE(ppcCopy1);\n+ CKFREE(pcReprsnt1);\n+ CKFREE(pcConsens1);\n+ }\n+ if (NULL != ppcCopy2){\n+ int i;\n+ for (i = 0; i < piLeafCount[iR]; i++){\n+ CKFREE(ppcCopy2[i]);\n+ }\n+ CKFREE(ppcCopy2);\n+ CKFREE(pcReprsnt2);\n+ CKFREE(pcConsens2);\n+ }\n+ ppiLeafList[iL] = CKFREE(ppiLeafList[iL]);\n+ ppiLeafList[iR] = CKFREE(ppiLeafList[iR]);\n+ piLeafCount[iL] = piLeafCount[iR] = 0;\n+\n+ } /* was a merge node */\n+\n+ if (rLog.iLogLevelEnabled <= LOG_DEBUG){\n+ int i, j;\n+ FILE *fp = LogGetFP(&rLog, LOG_DEBUG);\n+ for (i = 0; i < iNodeCount; i++){\n+ if (0 == piLeafCount[i]){\n+ continue;\n+ }\n+ fprintf(fp, "node %3d, #leaves=%d:\\t", i, piLeafCount[i]);\n+ for (j = 0; ppiLeafList && (j < piLeafCount[i]); j++){\n+ fprintf(fp, "%d,", ppiLeafList[i][j]);\n+ }\n+ fprintf(fp, "\\n");\n+ }\n+ }\n+\n+\n+ } /* 0 <= iN < iNodeCount */\n+ ProgressDone(prProgress);\n+\n+\n+ /* check length and set length info\n+ */\n+ iAlnLen = strlen(prMSeq->seq[0]);\n+ for (i=0; i<prMSeq->nseqs; i++) {\n+#if 0\n+ Log(&rLog, LOG_FORCED_DEBUG, "seq no %d: name %s; len %d; %s",\n+ i, prMSeq->sqinfo[i].name, strlen(prMSeq->seq[i]), prMSeq->seq[i]);\n+#endif\n+ \n+#ifndef NDEBUG\n+ assert(iAlnLen == strlen(prMSeq->seq[i]));\n+#endif\n+ prMSeq->sqinfo[i].len = iAlnLen;\n+ }\n+ prMSeq->aligned = TRUE;\n+\n+\n+ if (rLog.iLogLevelEnabled <= LOG_DEBUG){\n+ if (0 != prHMM->L){\n+ int i;\n+ Log(&rLog, LOG_DEBUG, "Alignment scores with HMM:");\n+ for (i = 0; /*pdScores[i] > 0.0*/i < prMSeq->nseqs; i++){\n+ Log(&rLog, LOG_DEBUG, "%2d:\\t%f\\n", i, pdScores[i]);\n+ }\n+ }\n+ }\n+\n+\n+ /** translate back ambiguity residues\n+ * hhalign translates ambiguity codes (B,Z) into unknown residues (X).\n+ * as we still have the original input we can substitute them back\n+ */\n+ TranslateUnknown2Ambiguity(prMSeq);\n+ ReAttachLeadingGaps(prMSeq, iProfProfSeparator);\n+\n+ if (NULL == prHMMList){\n+ CKFREE(prHMM);\n+ }\n+ CKFREE(ppcProfile2);\n+ CKFREE(ppcProfile1);\n+ CKFREE(ppiLeafList[piOrderLR[DIFF_NODE*(iNodeCount-1)+PRNT_NODE]]);\n+ CKFREE(ppiLeafList);\n+ CKFREE(piLeafCount);\n+ CKFREE(pdScores);\n+ FreeProgress(&prProgress);\n+ CKFREE(pdWeightsL);\n+ CKFREE(pdWeightsR);\n+\n+#if TIMING\n+ StopwatchStop(stopwatch);\n+ StopwatchDisplay(stdout, "Total time for HHalignWrapper():" , stopwatch);\n+ StopwatchFree(stopwatch);\n+#endif\n+\n+ return dScore; /* FIXME alternative: return averaged pdScores */\n+\n+}\n+/*** end: HHalignWrapper() ***/\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/clustal/hhalign_wrapper.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/clustal/hhalign_wrapper.h Thu Jul 21 13:35:08 2011 -0400 |
b |
@@ -0,0 +1,24 @@ +/********************************************************************* + * Clustal Omega - Multiple sequence alignment + * + * Copyright (C) 2010 University College Dublin + * + * Clustal-Omega is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This file is part of Clustal-Omega. + * + ********************************************************************/ + +/* + * RCS $Id: hhalign_wrapper.h 241 2011-05-04 14:37:17Z fabian $ + */ + + +extern double +HHalignWrapper(mseq_t *mseq, int *piOrderLR, + double *pdSeqWeights, int iNodeCount, + hmm_light *prHMMList, int iHMMCount, + int iProfProfSeparator, hhalign_para rHhalignPara); |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/clustal/ktuple_pair.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/clustal/ktuple_pair.c Thu Jul 21 13:35:08 2011 -0400 |
[ |
b'@@ -0,0 +1,842 @@\n+/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n+\n+/*********************************************************************\n+ * Clustal Omega - Multiple sequence alignment\n+ *\n+ * Copyright (C) 2010 University College Dublin\n+ *\n+ * Clustal-Omega is free software; you can redistribute it and/or\n+ * modify it under the terms of the GNU General Public License as\n+ * published by the Free Software Foundation; either version 2 of the\n+ * License, or (at your option) any later version.\n+ *\n+ * This file is part of Clustal-Omega.\n+ *\n+ ********************************************************************/\n+\n+/*\n+ * RCS $Id: ktuple_pair.c 230 2011-04-09 15:37:50Z andreas $\n+ *\n+ *\n+ * K-Tuple code for pairwise alignment (Wilbur and Lipman, 1983; PMID\n+ * 6572363). Most code taken from showpair.c (Clustal 1.83)\n+ * DD: some functions now have lots of parameters as static variables\n+ * were removed to make code OpenMP-friendly\n+ *\n+ */\n+\n+#ifdef HAVE_CONFIG_H\n+#include "config.h"\n+#endif\n+\n+\n+#include <stdio.h>\n+#include <string.h>\n+#include <ctype.h>\n+#include <stdlib.h>\n+#include <math.h>\n+#include <assert.h>\n+\n+#ifdef HAVE_OPENMP\n+#include <omp.h>\n+#endif\n+\n+#include "squid/squid.h"\n+#include "util.h"\n+#include "symmatrix.h"\n+#include "ktuple_pair.h"\n+#include "log.h"\n+#include "progress.h"\n+\n+#define END_MARK -3 /* see interface.c in 1.83 */\n+#define NUMRES 32 /* max size of comparison matrix */\n+\n+/* see notes below */\n+#undef SORT_LAST_ELEMENT_AS_WELL\n+\n+/* gap_pos1 = NUMRES-2; /@ code for gaps inserted by clustalw @/ */\n+static const int GAP_POS2 = NUMRES-1; /* code for gaps already in alignment */\n+static bool DNAFLAG = FALSE;\n+\n+static const char *AMINO_ACID_CODES = "ABCDEFGHIKLMNPQRSTUVWXYZ-";\n+static const char *NUCLEIC_ACID_CODES = "ACGTUN-";\n+/* As far as I understand the gap symbol should not be necessary here,\n+ * because we use isgap for testing later anyway. But changing this,\n+ * will affect max_res_code and max_nuc as well. So I leave it for now\n+ * as it is. AW\n+ */\n+\n+static bool percent = TRUE;\n+\n+static void make_ptrs(int *tptr, int *pl, const int naseq, const int l, const int ktup, const int max_res_code, char **seq_array);\n+static void put_frag(const int fs, const int v1, const int v2, const int flen, const int curr_frag, int *next, int *maxsf, int **accum);\n+static bool frag_rel_pos(int a1, int b1, int a2, int b2, int ktup);\n+static void des_quick_sort(int *array1, int *array2, const int array_size);\n+static void pair_align(int seq_no, int l1, int l2, int max_res_code, ktuple_param_t *aln_param,\n+ char **seq_array, int *maxsf, int **accum, int max_aln_length,\n+ int *zza, int *zzb, int *zzc, int *zzd);\n+static void encode(char *seq, char *naseq, int l, const char *res_codes);\n+static int res_index(const char *lookup, char c);\n+\n+\n+typedef struct {\n+ int i1;\n+ int i2;\n+} two_ints_t;\n+\n+\n+\n+/* default ktuple pairwise alignment parameters\n+ *\n+ */\n+/* protein\n+ */\n+/* designated initializer */\n+const ktuple_param_t default_protein_param = {\n+ .ktup = 1,\n+ .wind_gap = 3,\n+ .signif = 5,\n+ .window = 5,\n+};\n+/* dna\n+ */\n+/* designated initializer */\n+const ktuple_param_t default_dna_param = {\n+ .ktup = 2,\n+ .wind_gap = 5,\n+ .signif = 4,\n+ .window = 4,\n+};\n+\n+\n+/**\n+ * note: naseq should be unit-offset\n+ */\n+static void\n+encode(char *seq, char *naseq, int l, const char *res_codes)\n+{\n+ /* code seq as ints .. use GAP_POS2 for gap */\n+ register int i;\n+ bool seq_contains_unknown_char = FALSE;\n+ /*LOG_DEBUG("seq=%s naseq=%p l=%d", &(seq[1]), naseq, l); */\n+\n+\n+ for (i=1; i<=l; i++) {\n+ char res = toupper(seq[i]);\n+ if (isgap(res)) {\n+ naseq[i] = GAP_POS2; /* gap in input */\n+ } else {\n+ naseq[i] = res_index(res_codes, res);\n+ }\n+\n+ /*LOG_DEBUG("Character \'%c\' at pos %d", res, i);*/\n+ if (-1 == naseq[i]) {\n+ seq_contains_unknown_char = TRUE;\n+ '..b'max_res_code+1), aln_param.ktup)+1 ? \n+ max_aln_length : pow((max_res_code+1), aln_param.ktup)+1;\n+\n+ /*\n+ *\n+ * conversion to old style clustal done (in no time) */\n+\n+\n+ accum = (int **) CKCALLOC(5, sizeof (int *));\n+ for (i=0;i<5;i++) {\n+ accum[i] = (int *) CKCALLOC((2*max_aln_length+1), sizeof(int));\n+ }\n+ zza = (int *) CKCALLOC( (max_aln_length+1), sizeof(int));\n+ zzb = (int *) CKCALLOC( (max_aln_length+1), sizeof(int));\n+ zzc = (int *) CKCALLOC( (max_aln_length+1), sizeof(int));\n+ zzd = (int *) CKCALLOC( (max_aln_length+1), sizeof(int));\n+\n+ /* estimation of total number of steps (if istart and jstart are\n+ * both 0) (now handled in the calling routine)\n+ */\n+ /* uTotalStepNo = iend*jend - iend*iend/2 + iend/2;\n+ uStepNo = 0; */\n+ /*LOG_DEBUG("istart=%d iend=%d jstart=%d jend=%d", istart, iend, jstart, jend);*/\n+\n+ for (i=istart+1; i<=iend; ++i) {\n+ /* by definition a sequence compared to itself should give\n+ a score of 0. AW */\n+ SymMatrixSetValue(tmat, i-1, i-1, 0.0);\n+ make_ptrs(zza, zzc, i, seqlen_array[i], aln_param.ktup, max_res_code, seq_array);\n+\n+#ifdef HAVE_OPENMP\n+ #pragma omp critical(ktuple)\n+#endif\n+ {\n+ ProgressLog(prProgress, *ulStepNo, ulTotalStepNo, FALSE);\n+ }\n+\n+ for (j=MAX(i+1, jstart+1); j<=jend; ++j) {\n+ (*ulStepNo)++;\n+ private_step_no++;\n+ /*LOG_DEBUG("comparing pair %d:%d", i, j);*/\n+\n+ make_ptrs(zzb, zzd, j, seqlen_array[j], aln_param.ktup, max_res_code, seq_array);\n+ pair_align(i, seqlen_array[i], seqlen_array[j], max_res_code, &aln_param,\n+ seq_array, &maxsf, accum, max_aln_length, zza, zzb, zzc, zzd);\n+\n+ if (!maxsf) {\n+ calc_score=0.0;\n+ } else {\n+ calc_score=(double)accum[0][maxsf];\n+ if (percent) {\n+ dsr=(seqlen_array[i]<seqlen_array[j]) ?\n+ seqlen_array[i] : seqlen_array[j];\n+ calc_score = (calc_score/(double)dsr) * 100.0;\n+ }\n+ }\n+\n+ /* printf("%d %d %d\\n", i-1, j-1, (100.0 - calc_score)/100.0); */\n+ SymMatrixSetValue(tmat, i-1, j-1, (100.0 - calc_score)/100.0);\n+\n+ /* the function allows you not to compute the full matrix.\n+ * here we explicitely make the resulting matrix a\n+ * rectangle, i.e. we always set full rows. in other\n+ * words, if we don\'t complete the full matrix then we\n+ * don\'t have a full symmetry. so only use the defined\n+ * symmetric part. AW\n+ */\n+ /*LOG_DEBUG("setting %d : %d = %f", j, i, tmat[i][j]);*/\n+ /* not needed anymore since we use symmatrix_t\n+ if (j<=iend) {\n+ tmat[j][i] = tmat[i][j];\n+ }\n+ */\n+#ifdef HAVE_OPENMP\n+ #pragma omp critical(ktuple)\n+#endif\n+ {\n+ Log(&rLog, LOG_DEBUG, "K-tuple distance for sequence pair %d:%d = %lg",\n+ i, j, SymMatrixGetValue(tmat, i-1, j-1));\n+ }\n+ }\n+ }\n+ /*\n+ Log(&rLog, LOG_FORCED_DEBUG, "uTotalStepNo=%d for istart=%d iend=%d jstart=%d jend=%d", uStepNo, istart, iend, jstart, jend);\n+ Log(&rLog, LOG_FORCED_DEBUG, "Fabian = %d", iend*jend - iend*iend/2 + iend/2);\n+ */\n+\n+/* printf("\\n\\n%d\\t%d\\t%d\\t%d\\n\\n", omp_get_thread_num(), uStepNo, istart, iend); */\n+\n+ for (i=0;i<5;i++) {\n+ CKFREE(accum[i]);\n+ }\n+ CKFREE(accum);\n+\n+#ifdef HAVE_OPENMP\n+ #pragma omp critical(ktuple)\n+#if 0\n+ {\n+ printf("steps: %d\\n", private_step_no);\n+ }\n+#endif\n+#endif\n+\n+ CKFREE(zza);\n+ CKFREE(zzb);\n+ CKFREE(zzc);\n+ CKFREE(zzd);\n+\n+ free(seqlen_array);\n+\n+ for (i=1; i<=mseq->nseqs; i++) {\n+ CKFREE(seq_array[i]);\n+ }\n+ CKFREE(seq_array);\n+}\n+/* end of KTuplePairDist */\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/clustal/ktuple_pair.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/clustal/ktuple_pair.h Thu Jul 21 13:35:08 2011 -0400 |
b |
@@ -0,0 +1,47 @@ +/********************************************************************* + * Clustal Omega - Multiple sequence alignment + * + * Copyright (C) 2010 University College Dublin + * + * Clustal-Omega is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This file is part of Clustal-Omega. + * + ********************************************************************/ + +/* + * RCS $Id: ktuple_pair.h 193 2011-02-07 15:45:21Z andreas $ + */ + +/* K-Tuple code for pairwise alignment (Wilbur and Lipman (1983) + * Most code taken from showpair (Clustal 1.83) + */ + + +#ifndef CLUSTALO_KTUPLE_PAIR_H +#define CLUSTALO_KTUPLE_PAIR_H + +#include "seq.h" +#include "symmatrix.h" +#include "progress.h" + +typedef struct { + int ktup; + int window; + int wind_gap; + int signif; +} ktuple_param_t; + + +extern void +KTuplePairDist(symmatrix_t *tmat, mseq_t *mseq, + int istart, int iend, + int jstart, int jend, + ktuple_param_t *aln_param, + progress_t *prProgress, + unsigned long int *ulStepNo, unsigned long int ulTotalStepNo); + +#endif |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/clustal/list.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/clustal/list.c Thu Jul 21 13:35:08 2011 -0400 |
[ |
b'@@ -0,0 +1,389 @@\n+/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n+\n+/*********************************************************************\n+ * Clustal Omega - Multiple sequence alignment\n+ *\n+ * Copyright (C) 2010 University College Dublin\n+ *\n+ * Clustal-Omega is free software; you can redistribute it and/or\n+ * modify it under the terms of the GNU General Public License as\n+ * published by the Free Software Foundation; either version 2 of the\n+ * License, or (at your option) any later version.\n+ *\n+ * This file is part of Clustal-Omega.\n+ *\n+ ********************************************************************/\n+\n+/*\n+ * RCS $Id: list.c 156 2010-11-18 10:52:40Z andreas $\n+ *\n+ * Single linked list and FIFO/Queue\n+ *\n+ * Based on Kyle Loudon\'s Mastering Algorithms with C\n+ * http://oreilly.com/catalog/9781565924536\n+ *\n+ * Allows generic data types by using void* pointers, which works fine\n+ * as long as your data is just pointers.\n+ *\n+ */\n+\n+\n+#ifdef HAVE_CONFIG_H\n+#include "config.h"\n+#endif\n+\n+#include <assert.h>\n+#include <string.h> /* for memset */\n+\n+#include "list.h"\n+\n+#ifdef LIST_TEST\n+#include <stdio.h>\n+#include "queue.h"\n+#include "time.h"\n+#endif\n+\n+/**\n+ * @brief Initialise data members of a list\n+ *\n+ * @param[in] prList\n+ * List to initialise\n+ * @param[in] destroy\n+ * A function to be called with pointer to data when destroying the\n+ * list. NULL if in doubt, free in most other cases.\n+ * Note: doxygen will always fail to parse this...\n+ */\n+void\n+ListInit(list_t *prList, void (*destroy)(void *data)) {\n+ prList->size = 0;\n+ prList->destroy = destroy;\n+ prList->head = NULL;\n+ prList->tail = NULL;\n+ \n+ return;\n+}\n+/* end of ListInit() */\n+\n+\n+\n+/**\n+ * @brief Calls user defined function to free data in list and resets\n+ * the list to NULL. Call even if your destroy function is NULL.\n+ *\n+ * @param[in] prList\n+ * The list to destroy\n+ *\n+ */\n+void\n+ListDestroy(list_t *prList) {\n+ void *pvData;\n+\n+ while (LIST_SIZE(prList) > 0) {\n+ if (0 == ListRemoveNext(prList, NULL, (void **)&pvData)\n+ &&\n+ NULL != prList->destroy) {\n+ prList->destroy(pvData);\n+ }\n+ }\n+ /* precaution */\n+ memset(prList, 0, sizeof(list_t));\n+ \n+ return;\n+}\n+/* end of ListDestroy() */\n+\n+\n+\n+/**\n+ *\n+ * @brief Insert data next to given element\n+ *\n+ * @param[in] prList\n+ * List into which to insert\n+ * @param[in] prElement\n+ * Current position/element. Element after which to insert. If NULL\n+ * head is used.\n+ * @param[in] pvData\n+ * Pointer to data to store\n+ *\n+ * @return Non-zero on failure\n+ */\n+int\n+ListInsertNext(list_t *prList, list_elem_t *prElement, const void *pvData)\n+{\n+ list_elem_t *prNewElement;\n+\n+ if (NULL == (prNewElement = (list_elem_t *) malloc(sizeof(list_elem_t))))\n+ return -1;\n+\n+ prNewElement->data = (void *)pvData;\n+ \n+ if (NULL == prElement) {\n+ /* insertion at head */\n+ if (LIST_SIZE(prList) == 0)\n+ prList->tail = prNewElement;\n+ prNewElement->next = prList->head;\n+ prList->head = prNewElement;\n+ \n+ } else {\n+ /* insert somewhere other than at head */\n+ if (NULL == prElement->next)\n+ prList->tail = prNewElement;\n+ prNewElement->next = prElement->next;\n+ prElement->next = prNewElement;\n+ }\n+\n+ prList->size++;\n+\n+ return 0;\n+}\n+/* end of ListInsertNext() */\n+\n+\n+\n+/**\n+ * @brief Remove next element from current element/position.\n+ *\n+ * @param[in] prList\n+ * List from which an element is to be removed.\n+ * @param[in] prElement\n+ * Current element/position. Next item will be removed. If NULL head\n+ * is used.\n+ * @param[out] pvData_p\n+ * Will be pointed to removed elements data.\n+ *\n+ * @return Non-zero on failure\n+ */\n+int\n+ListRemoveNext(list_t *prList, list_elem_t *prElement, void **pvData_p)\n+{\n+ list_elem_t *prOldElement;\n+\n+ if (0 == LIST_SIZE(prList))\n+ return -1;\n+\n+ '..b'ram[in] prList\n+ * List from which an element is to be removed.\n+ * @param[in] prElement\n+ * Current element/position. Next item will be removed. If NULL head\n+ * is used.\n+ * @param[out] iData_p\n+ * Will be pointed to removed elements data.\n+ *\n+ * @return Non-zero on failure\n+ *\n+ */\n+int\n+IntListRemoveNext(list_t *prList, list_elem_t *prElement, int *iData_p)\n+{\n+ int *piData;\n+ int res;\n+ res = ListRemoveNext(prList, prElement, (void **)&piData);\n+ *iData_p = *piData;\n+ prList->destroy(piData);\n+ return res;\n+}\n+/* end of IntListRemoveNext */\n+\n+\n+\n+\n+#ifdef LIST_TEST\n+/* gcc list.c -o list_test -ansi -Wall -DLIST_TEST */\n+ \n+int main(int argc, char **argv)\n+{\n+\n+ int i;\n+ list_t *mylist;\n+ int_list_t *myintlist;\n+ queue_t *myqueue;\n+ int_queue_t *myintqueue;\n+ int res;\n+\n+ int iSeed = (int)time(NULL);\n+ srand((unsigned int)iSeed);\n+ \n+ printf("%s", "list test! also delete #include!\\n");\n+ \n+\n+ mylist = malloc(sizeof(list_t));\n+ ListInit(mylist, NULL);\n+\n+ printf("LIST test\\n");\n+\n+ for (i=0; i<argc; i++) {\n+ res = LIST_APPEND(mylist, argv[i]);\n+ printf("LIST Result for appending \'%s\' was %d\\n", argv[i], res);\n+ }\n+\n+ while (LIST_SIZE(mylist)) {\n+ char *argv_ptr;\n+ if (ListRemoveNext(mylist, NULL, (void **)&argv_ptr))\n+ perror("ListRemoveNext() failed");\n+ printf("LIST Popped %s\\n", argv_ptr);\n+ }\n+ printf("LIST %s", "No more elements to pop");\n+ \n+ /* could become list_free */\n+ ListDestroy(mylist);\n+ free(mylist);\n+\n+ \n+\n+\n+ myintlist = malloc(sizeof(list_t));\n+ INT_LIST_INIT(myintlist);\n+\n+ printf("\\n");\n+ printf("%s", "INT_LIST test");\n+\n+ for (i=0; i<argc; i++) {\n+ int data = 666-i;\n+ res = INT_LIST_APPEND(myintlist, data);\n+ printf("INT_LIST Result for appending \'%d\' was %d\\n", data, res);\n+ }\n+\n+ while (INT_LIST_SIZE(myintlist)) {\n+ int data;\n+ if (IntListRemoveNext(myintlist, NULL, &data))\n+ perror("ListRemoveNext() failed\\n");\n+ printf("INT_LIST Popped %d\\n", data);\n+ }\n+ printf("INT_LIST %s\\n", "No more elements to pop");\n+ \n+ /* could become list_free */\n+ INT_LIST_DESTROY(myintlist);\n+ free(myintlist);\n+\n+\n+\n+\n+ \n+ myqueue = malloc(sizeof(queue_t));\n+ QUEUE_INIT(myqueue, NULL);\n+\n+ printf("\\n");\n+ printf("%s", "QUEUE test\\n");\n+\n+ for (i=0; i<argc; i++) {\n+ res = QUEUE_PUSH(myqueue, argv[i]);\n+ printf("QUEUE Result for pushing \'%s\' was %d\\n", argv[i], res);\n+ }\n+\n+ while (! QUEUE_EMPTY(myqueue)) {\n+ char *argv_ptr;\n+ if (QUEUE_POP(myqueue, (void **)&argv_ptr))\n+ perror("QUEUE_POP() failed\\n");\n+ printf("QUEUE Popped %s\\n", argv_ptr);\n+ }\n+ printf("QUEUE %s\\n", "QUEUE No more elements to pop");\n+ \n+ /* could become list_free */\n+ QUEUE_DESTROY(myqueue);\n+ free(myqueue);\n+\n+\n+\n+\n+ myintqueue = malloc(sizeof(queue_t));\n+ INT_QUEUE_INIT(myintqueue);\n+\n+ printf("\\n");\n+ printf("%s\\n", "INT_QUEUE test");\n+\n+ for (i=0; i<argc; i++) {\n+ res = INT_QUEUE_PUSH(myintqueue, i);\n+ printf("INT_QUEUE Result for appending \'%d\' was %d\\n", i, res);\n+ }\n+\n+ while (! INT_QUEUE_EMPTY(myintqueue)) {\n+ int data;\n+ int rand_data;\n+ if (INT_QUEUE_POP(myintqueue, &data))\n+ perror("INT_QUEUE_POP() failed\\n");\n+ printf("INT_QUEUE Popped %d\\n", data);\n+\n+ rand_data = (int)( 10.0 * rand() / ( RAND_MAX+1.0));\n+ if (! (rand_data%3)) {\n+ res = INT_QUEUE_PUSH(myintqueue, rand_data);\n+ printf("INT_QUEUE Result for pushing random number \'%d\' was %d\\n", rand_data, res); \n+ }\n+ }\n+ printf("INT_QUEUE %s\\n", "INT_QUEUE No more elements to pop");\n+ \n+ /* could become list_free */\n+ INT_QUEUE_DESTROY(myintqueue);\n+ free(myintqueue);\n+ \n+\n+ exit(0);\n+}\n+\n+#endif\n+\n+\n+\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/clustal/list.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/clustal/list.h Thu Jul 21 13:35:08 2011 -0400 |
b |
@@ -0,0 +1,105 @@ +/********************************************************************* + * Clustal Omega - Multiple sequence alignment + * + * Copyright (C) 2010 University College Dublin + * + * Clustal-Omega is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This file is part of Clustal-Omega. + * + ********************************************************************/ + +/* + * RCS $Id: list.h 193 2011-02-07 15:45:21Z andreas $ + * + * Generic single linked list storing pointers to data + * + */ + +#ifndef CLUSTALO_LIST_H +#define CLUSTALO_LIST_H + +#include <stdlib.h> + +typedef struct list_elem_s { + void *data; + struct list_elem_s *next; +} list_elem_t; + +typedef struct { + /* size of list */ + int size; + /* user defined function for freeing data */ + void (*destroy)(void *data); + list_elem_t *head; + list_elem_t *tail; +} list_t; + +void ListInit(list_t *prList, void (*destroy)(void *data)); + +void ListDestroy(list_t *prList); + +int ListInsertNext(list_t *prList, list_elem_t *prElement, const void *data); + +#define LIST_APPEND(prList, data) ListInsertNext((prList), LIST_TAIL(prList), (data)) + +#define LIST_PREPEND(prList, data) ListInsertNext((prList), CLUSTALO_LIST_HEAD(prList), (data)) + +int ListRemoveNext(list_t *prList, list_elem_t *prElement, void **data); + +#define LIST_SIZE(prList) ((prList)->size) + +#define CLUSTALO_LIST_HEAD(prList) ((prList)->head) + +#define LIST_TAIL(prList) ((prList)->tail) + +#define LIST_IS_HEAD(prList, prElement) ((prElement) == (prList)->head ? 1 : 0) + +#define LIST_IS_TAIL(prElement) ((prElement)->next == NULL ? 1 : 0) + +#define LIST_DATA(prElement) ((prElement)->data) + +#define LIST_NEXT(prElement) ((prElement)->next) + + + + + +/* special int list: stores ints by copying them (instead of storing + * pointers as generic list) + * + */ + +typedef list_t int_list_t; + +#define INT_LIST_INIT(prList) ListInit((prList), free) + +#define INT_LIST_DESTROY(prList) ListDestroy((prList)); + +int IntListInsertNext(list_t *prList, list_elem_t *prElement, const int data); + +#define INT_LIST_APPEND(prList, data) IntListInsertNext((prList), LIST_TAIL(prList), (data)) + +#define INT_LIST_PREPEND(prList, data) IntListInsertNext((prList), CLUSTALO_LIST_HEAD(prList), (data)) + +int IntListRemoveNext(list_t *prList, list_elem_t *prElement, int *data); + +#define INT_LIST_SIZE(prList) LIST_SIZE(prList) + +#define INT_CLUSTALO_LIST_HEAD(prList) CLUSTALO_LIST_HEAD_INT((prList)) + +#define INT_LIST_TAIL(prList) LIST_TAIL_INT((prList) ) + +#define INT_LIST_IS_HEAD(prList, prElement) LIST_IS_HEAD(prList, prElement) + +#define INT_LIST_IS_TAIL(prElement) LIST_IS_TAIL((prElement)) + +#define INT_LIST_DATA(prElement) LIST_DATA((prElement)) + +#define INT_LIST_NEXT(prElement) LIST_NEXT((prElement)) + + +#endif |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/clustal/log.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/clustal/log.c Thu Jul 21 13:35:08 2011 -0400 |
[ |
@@ -0,0 +1,379 @@ +/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ + +/********************************************************************* + * Clustal Omega - Multiple sequence alignment + * + * Copyright (C) 2010 University College Dublin + * + * Clustal-Omega is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This file is part of Clustal-Omega. + * + ********************************************************************/ + +/* + * RCS $Id$ + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + + +#include <stdio.h> +#include <stdlib.h> +#include <stdarg.h> +#include <assert.h> + +#include "log.h" + +/* a default standard logger */ +log_t rLog; + + + +void +LogVfprintf(FILE *prFP, char *pcFmt, va_list rVArgList); +void +LogWarn(FILE *prFP, char *pcFmt, va_list rVArgList); +void +LogError(FILE *prFP, char *pcFmt, va_list rVArgList); +void +LogCritical(FILE *prFP, char *pcFmt, va_list rVArgList); +void +LogFatal(FILE *prFP, char *pcFmt, va_list rVArgList); +void +LogForcedDebug(FILE *prFP, char *pcFmt, va_list rVArgList); + + + + +/** + * @brief Plain, default print function + * + * Newline character is automatically appended to message. + * + */ +void +LogVfprintf(FILE *prFP, char *pcFmt, va_list rVArgList) +{ + /* print prefix */ + vfprintf(prFP, pcFmt, rVArgList); + fprintf(prFP,"\n"); + +#ifndef NDEBUG + fflush(prFP); +#endif +} +/* end of LogVfprintf() */ + + + +/** + * @brief + * + */ +void +LogWarn(FILE *prFP, char *pcFmt, va_list rVArgList) +{ + fprintf(prFP, "WARNING: "); + LogVfprintf(prFP, pcFmt, rVArgList); +} +/* end of LogWarn() */ + + + +/** + * @brief + * + */ +void +LogError(FILE *prFP, char *pcFmt, va_list rVArgList) +{ + fprintf(prFP, "ERROR: "); + LogVfprintf(prFP, pcFmt, rVArgList); +} +/* end of LogError() */ + + + +/** + * @brief + * + */ +void +LogCritical(FILE *prFP, char *pcFmt, va_list rVArgList) +{ + fprintf(prFP, "CRITICAL ERROR: "); + LogVfprintf(prFP, pcFmt, rVArgList); +} +/* end of LogCritical() */ + + + +/** + * @brief Will also exit! + */ +void +LogFatal(FILE *prFP, char *pcFmt, va_list rVArgList) +{ + fprintf(prFP, "FATAL: "); + LogVfprintf(prFP, pcFmt, rVArgList); + + exit(EXIT_FAILURE); +} +/* end of LogFatal() */ + + + +/** + * @brief + * + */ +void +LogForcedDebug(FILE *prFP, char *pcFmt, va_list rVArgList) +{ + fprintf(prFP, "FORCED DEBUG: "); + LogVfprintf(prFP, pcFmt, rVArgList); +} +/* end of LogForcedDebug() */ + + + +/** + * + * @brief Sets up default function pointers + * + */ +void +LogDefaultSetup(log_t *log) +{ + log->iLogLevelEnabled = LOG_WARN; + + log->prFP[LOG_DEBUG] = stdout; + log->prFP[LOG_INFO] = stdout; + log->prFP[LOG_WARN] = stderr; + log->prFP[LOG_ERROR] = stderr; + log->prFP[LOG_CRITICAL] = stderr; + log->prFP[LOG_FATAL] = stderr; + log->prFP[LOG_FORCED_DEBUG] = stderr; + + log->prFunc[LOG_DEBUG] = &LogVfprintf; + log->prFunc[LOG_INFO] = &LogVfprintf; + log->prFunc[LOG_WARN] = &LogWarn; + log->prFunc[LOG_ERROR] = &LogError; + log->prFunc[LOG_CRITICAL] = &LogCritical; + log->prFunc[LOG_FATAL] = &LogFatal; + log->prFunc[LOG_FORCED_DEBUG] = &LogForcedDebug; +} +/* end of LogDefaultSetup() */ + + + +/** + * @brief Log to certain level + * + * See also comp.lang.c FAQ list · Question 15.12 + * http://c-faq.com/varargs/handoff.html How can I write a function which + * takes a variable number of arguments and passes them to some other function + * (which takes a variable number of arguments)? + * + */ +void +Log(log_t *prLog, int iLevel, char *pcFmt, ...) +{ + va_list rVArgList; + void (*prFunc) (FILE *prFP, char *pcFormat, va_list rVArgList); + FILE *prFP; + + assert(iLevel>=0 && iLevel<=LOG_NUM_LEVELS); + + /* fprintf(stderr, "DEBUG: iLevel=%d and iLogLevelEnabled=%d\n", iLevel, prLog->iLogLevelEnabled); */ + + /* return if below current loglevel */ + if (iLevel < prLog->iLogLevelEnabled) { + return; + } + + prFunc = prLog->prFunc[iLevel]; + prFP = prLog->prFP[iLevel]; + + /* return if muted */ + if (NULL == prFunc) { + return; + } + + va_start(rVArgList, pcFmt); + prFunc(prFP, pcFmt, rVArgList); + va_end(rVArgList); +} +/* end of Log() */ + + + +/** + * + * @brief Change file pointer for certain level + * + */ +void +LogSetFP(log_t *prLog, int iLevel, FILE *prFP) +{ + assert(iLevel>=0 && iLevel<=LOG_NUM_LEVELS); + + prLog->prFP[iLevel] = prFP; +} +/* end of LogSetFP() */ + + + +/** + * + * @brief Return file pointer for certain level + * + */ +FILE * +LogGetFP(log_t *prLog, int iLevel) +{ + assert(iLevel>=0 && iLevel<=LOG_NUM_LEVELS); + + return prLog->prFP[iLevel]; +} +/* end of LogGetFP() */ + + + + + +/** + * + * @brief Change file pointer for all levels + * + */ +void +LogSetFPForAll(log_t *prLog, FILE *prFP) +{ + int iAux; + + for (iAux=0; iAux<LOG_NUM_LEVELS; iAux++) { + prLog->prFP[iAux] = prFP; + } +} +/* end of LogSetFP() */ + + + +/** + * + * @brief Mute certain level (i.e set the corresponding function to NULL) + * + */ +void +LogMute(log_t *prLog, int iLevel) +{ + assert(iLevel>=0 && iLevel<=LOG_NUM_LEVELS); + + prLog->prFunc[iLevel] = NULL; +} +/* end of LogMute() */ + + +/** + * + * @brief Mute all channels + * + */ +void +LogMuteAll(log_t *prLog) +{ + int iAux; + + for (iAux=0; iAux<LOG_NUM_LEVELS; iAux++) { + LogMute(prLog, iAux); + } +} +/* end of LogMuteAll() */ + + + +/** + * @brief + * + */ +void +LogFuncOverwrite(log_t *prLog, int iLevel, + void (*Func) (FILE *prFP, char *pcFormat, va_list rVArgList)) +{ + assert(iLevel>=0 && iLevel<=LOG_NUM_LEVELS); + + prLog->prFunc[iLevel] = Func; + +} +/* end of LogFuncOverwrite() */ + + + +#ifdef LOG_TEST + + +#define TEXT "Lorem ipsum dolor sit amet" + +void +PrintSomeTextToAll(log_t *prLog) { + int iAux; + for (iAux=0; iAux<LOG_NUM_LEVELS; iAux++) { + Log(prLog, iAux, TEXT); + } +} + + +int +main(int argc, char**argv) { + log_t prLog; + log_t pr2ndLog; + FILE *prFP; + char *pcTmpFileName = "schmock.txt"; + + prFP = fopen(pcTmpFileName, "w"); + + + LogDefaultSetup(&prLog); + LogDefaultSetup(&pr2ndLog); + + printf("Printing to log:\n"); + PrintSomeTextToAll(&prLog); + printf("---\n"); + + printf("Printing to pr2ndLog:\n"); + PrintSomeTextToAll(&prLog); + printf("---\n"); + + + + printf("Changing second log's FP to write to '%s'\n", pcTmpFileName); + LogSetFPForAll(&pr2ndLog, prFP); + + printf("Printing to pr2ndLog:\n"); + PrintSomeTextToAll(&pr2ndLog); + printf("---\n"); + + + printf("Changing Info() to new function (Fatal()) in log:\n"); + LogFuncOverwrite(&prLog, LOG_INFO, &LogFatal); + + printf("Printing to log:\n"); + PrintSomeTextToAll(&prLog); + printf("---\n"); + + + + fclose(prFP); + + return 0; +} + + +#endif |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/clustal/log.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/clustal/log.h Thu Jul 21 13:35:08 2011 -0400 |
[ |
@@ -0,0 +1,81 @@ +/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ + +/********************************************************************* + * Clustal Omega - Multiple sequence alignment + * + * Copyright (C) 2010 University College Dublin + * + * Clustal-Omega is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This file is part of Clustal-Omega. + * + ********************************************************************/ + +/* + * RCS $Id$ + */ + + +#include <stdio.h> +#include <stdarg.h> + +#ifndef LOG_H +#define LOG_H + + +#define LOG_DEBUG 0 +#define LOG_VERBOSE 1 +#define LOG_INFO 2 +#define LOG_WARN 3 +#define LOG_FORCED_DEBUG 4 +#define LOG_ERROR 5 +#define LOG_CRITICAL 6 +#define LOG_FATAL 7 + +#define LOG_NUM_LEVELS 8 + + +typedef struct { + /* the higher the level, the more priority it has. numbers must be + * sequential + */ + + /* array of function pointers */ + void (*prFunc[LOG_NUM_LEVELS]) (FILE *prFP, char *pcFormat, va_list rVArgList); + FILE *prFP[LOG_NUM_LEVELS]; + char *prPrefix[LOG_NUM_LEVELS]; + + /* everything above this level will be printed */ + int iLogLevelEnabled; +} log_t; + + + +/* a standard logger */ +extern log_t rLog; + + + +void +LogDefaultSetup(log_t *log); +void +Log(log_t *prLog, int iLevel, char *pcFmt, ...); +void +LogSetFP(log_t *log, int level, FILE *fp); +void +LogSetFPForAll(log_t *log, FILE *fp); +FILE * +LogGetFP(log_t *prLog, int iLevel); +void +LogMute(log_t *log, int level); +void +LogMuteAll(log_t *log); +void +LogFuncOverwrite(log_t *prLog, int iLevel, + void (*Func) (FILE *prFP, char *pcFormat, va_list rVArgList)); + + +#endif |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/clustal/mbed.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/clustal/mbed.c Thu Jul 21 13:35:08 2011 -0400 |
[ |
b'@@ -0,0 +1,1574 @@\n+/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n+\n+/*********************************************************************\n+ * Clustal Omega - Multiple sequence alignment\n+ *\n+ * Copyright (C) 2010 University College Dublin\n+ *\n+ * Clustal-Omega is free software; you can redistribute it and/or\n+ * modify it under the terms of the GNU General Public License as\n+ * published by the Free Software Foundation; either version 2 of the\n+ * License, or (at your option) any later version.\n+ *\n+ * This file is part of Clustal-Omega.\n+ *\n+ ********************************************************************/\n+\n+/*\n+ * RCS $Id: mbed.c 254 2011-06-21 13:07:50Z andreas $\n+ *\n+ *\n+ * Reimplementation from scratch of mBed:\n+ * Blackshields et al. (2010); PMID 20470396\n+ *\n+ *\n+ */\n+\n+#ifdef HAVE_CONFIG_H\n+#include "config.h"\n+#endif\n+\n+#include <assert.h>\n+#include <float.h>\n+\n+#include "mbed.h"\n+#include "pair_dist.h"\n+#include "symmatrix.h"\n+#include "ktuple_pair.h"\n+#include "tree.h"\n+#include "util.h"\n+#include "progress.h"\n+#include "queue.h"\n+\n+#include "log.h"\n+#include "kmpp/KMeans.h"\n+#include "mbed.h"\n+\n+#define TIMING 0\n+#if TIMING\n+#include "squid/stopwatch.h"\n+#endif\n+\n+\n+/* If FULL_WITHIN_CLUSTER_DISTANCES is not 0, distances within each\n+ * bisecting kmeans subcluster are not estimated using the vectors,\n+ * but calculated normally (using ktuple or kimura). Surprisingly this\n+ * results in 3% loss on a Homfam p24-h2010-08-09 subset (100-5000\n+ * seqs in test, at least 5 ref seqs; MAX_SEQ 100 vs 10000; NUM_SEEDS\n+ * log2 instead of log2^2). And of course it slows things down.\n+ */\n+#define FULL_WITHIN_CLUSTER_DISTANCES 1\n+\n+#define COMPUTE_WITHIN_SUBCLUSTER_AVERAGE 0\n+\n+/* Cluster size limits. Maximum is a soft limit, which might be\n+ * exceeded if a K-Means split was unsuccesful, where unsuccesful\n+ * might also mean that the minimum required number seqs. was not\n+ * reached */\n+#if FULL_WITHIN_CLUSTER_DISTANCES\n+static const int MAX_ALLOWED_SEQ_PER_PRECLUSTER = 100;\n+static const int MIN_REQUIRED_SEQ_PER_PRECLUSTER = 1;\n+#else\n+static const int MAX_ALLOWED_SEQ_PER_PRECLUSTER = 10000;\n+static const int MIN_REQUIRED_SEQ_PER_PRECLUSTER = 100;\n+#endif\n+\n+/* How many restarts per bisecting kmeans split. 10 give 0.5% increase\n+ * in quality on original HOMFAM over just 1. It also increases kmeans\n+ * time by a factor of ~3, but overall time is insignificant\n+ * compared to pairdist/progressive alignment part.\n+ */\n+static const int RESTARTS_PER_SPLIT = 10;\n+\n+\n+/* Use standard kmeans (lloyds) or kmeans++. Both are almost\n+ * indistinguishable here, although kmeans++ is slightly ahead the\n+ * fewer seeds you pick (and it should be better in theory)\n+ */\n+#define USE_KMEANS_LLOYDS 0\n+\n+\n+#ifndef HAVE_LOG2\n+#define log2(x) (log(x) / 0.69314718055994530942)\n+#endif\n+#define NUMBER_OF_SEEDS(n) pow(log2(((double)n)), 2)\n+\n+\n+/* Seed selection method: SAMPLE_SEEDS_BY_LENGTH is the original mBed\n+ * approach: Sample iSeeds sequence with constant stride from length-sorted X.\n+ * It might be better to pick the seeds randomly, because length sorting might\n+ * be more prone to including outliers (e.g. very long and very short seqs).\n+ * However, we could never observer such a thing. So just stick to the\n+ * original version as this also removes the random element.\n+ */\n+enum SEED_SELECTION_TYPE {\n+ SELECT_SEEDS_RANDOMLY,\n+ SELECT_SEEDS_BY_LENGTH\n+};\n+#define SEED_SELECTION SELECT_SEEDS_BY_LENGTH\n+\n+\n+/* Tests on BAliBase (RV11,12,20,30,40,50; 10 runs each) show there is\n+ * no difference between mbed-trees created from cosine or euclidean\n+ * distances (simple version, just using disparities).\n+ */\n+#define USE_EUCLIDEAN_DISTANCE 1\n+\n+\n+/* print some mbed pre-cluster usage to screen */\n+#define PRINT_CLUSTER_DISTRIBUTION 0\n+\n+\n+#define TRACE 0\n+\n+\n+typedef struct {\n+ /* Number of final clusters\n+ */\n+ int iNClusters;\n+\n+ /* Coordinates (columns) for each cluster (rows)\n+ '..b' iClusterIndex, prKMeansResult->iNClusters);\n+ SymMatrixPrint(prWithinClusterDistances, ppcLabels, NULL);\n+#endif\n+\n+ \n+ GuideTreeUpgma(&prSubClusterTree, ppcLabels,\n+ prWithinClusterDistances, NULL);\n+\n+ CKFREE(ppcLabels); /* don\'t free members, they just point */\n+#if 0\n+ Log(&rLog, LOG_FORCED_DEBUG, "Cluster %d guide-tree:", iClusterIndex);\n+ LogTree(prSubClusterTree);\n+#endif\n+\n+ \n+ /* The guide tree id\'s (that point to the sequences) now start\n+ * from 0, i.e. the association with the prMSeq numbering is\n+ * broken and fixed in the following\n+ */\n+ for (iNodeIndex = 0; iNodeIndex < (int)GetNodeCount(prSubClusterTree); iNodeIndex++) {\n+ if (IsLeaf(iNodeIndex, prSubClusterTree)) {\n+ int iLeafId = GetLeafId(iNodeIndex, prSubClusterTree);\n+ int iRealId = prKMeansResult->ppiObjIndicesPerCluster[iClusterIndex][iLeafId];\n+#if 0\n+ Log(&rLog, LOG_FORCED_DEBUG, "Correcting leaf node %d which has (wrong) id %d and name %s to id %d (prMSeq name %s)",\n+ iNodeIndex, iLeafId,\n+ GetLeafName(iNodeIndex, prSubClusterTree),\n+ iRealId, prMSeq->sqinfo[iRealId].name);\n+#endif\n+ SetLeafId(prSubClusterTree, iNodeIndex, iRealId);\n+ }\n+ }\n+\n+\n+ /* Append the newly created tree (prSubClusterTree) to the\n+ * corresponding node index of prMbedTree_p.\n+ */\n+#if TRACE\n+ Log(&rLog, LOG_FORCED_DEBUG, "Will join trees at leaf node %d = %s",\n+ piClusterToTreeNode[iClusterIndex],\n+ GetLeafName(piClusterToTreeNode[iClusterIndex], *prMbedTree_p));\n+#endif\n+\n+ AppendTree(*prMbedTree_p,\n+ piClusterToTreeNode[iClusterIndex],\n+ prSubClusterTree);\n+ /* Note: piClusterToTreeNode is still valid, because\n+ * AppendTrees() guarantees that no other than the node to\n+ * append to changes. */\n+\n+#if 0\n+ Log(&rLog, LOG_FORCED_DEBUG, "%s", "prMbedTree_p after cluster %d has appended:", iClusterIndex);\n+ LogTree(*prMbedTree_p);\n+\n+ if (0) {\n+ char fname[] = "mbed-joined-tree.dnd";\n+ FILE *pfOut;\n+ if (NULL == (pfOut = fopen(fname, "w"))) {\n+ Log(&rLog, LOG_FATAL, "Couldn\'t open %s for writing", fname);\n+ }\n+ MuscleTreeToFile(pfOut, *prMbedTree_p);\n+ Log(&rLog, LOG_FORCED_DEBUG, "Joined tree written to %s", fname);\n+ fclose(pfOut);\n+ Log(&rLog, LOG_FATAL, "DEBUG EXIT");\n+ }\n+#endif\n+\n+ /* cleanup\n+ */\n+ FreeMuscleTree(prSubClusterTree);\n+ FreeSymMatrix(&prWithinClusterDistances);\n+#if FULL_WITHIN_CLUSTER_DISTANCES\n+ FreeMSeq(&prSubClusterMSeq);\n+#endif\n+ } /* end for each cluster */\n+ ProgressDone(prSubClusterDistanceProgress);\n+ FreeProgress(&prSubClusterDistanceProgress);\n+\n+ \n+ if (NULL != pcGuidetreeOut) {\n+ if (NULL == (pfOut = fopen(pcGuidetreeOut, "w"))) {\n+ Log(&rLog, LOG_ERROR, "Couldn\'t open %s for writing", pcGuidetreeOut);\n+ } else {\n+ MuscleTreeToFile(pfOut, *prMbedTree_p);\n+ Log(&rLog, LOG_INFO, "Guide tree written to %s", pcGuidetreeOut);\n+ (void) fclose(pfOut);\n+ }\n+ }\n+\n+ \n+ /* cleanup\n+ *\n+ */\n+#if MBED_TIMING\n+ StopwatchStop(stopwatch);\n+ StopwatchDisplay(stdout, "mBed time (without pairwise distance computation): ", stopwatch);\n+ StopwatchFree(stopwatch);\n+#endif\n+\n+ FreeKMeansResult(&prKMeansResult);\n+ FreeSymMatrix(&prPreClusterDistmat);\n+ for (iI=0; iI<prMSeq->nseqs; iI++) {\n+ CKFREE(ppdSeqVec[iI]);\n+ }\n+ CKFREE(ppdSeqVec);\n+ CKFREE(piClusterToTreeNode);\n+\n+#ifndef NDEBUG\n+ TreeValidate(*prMbedTree_p);\n+#endif\n+ \n+ return 0;\n+}\n+/*** end: Mbed() ***/\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/clustal/mbed.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/clustal/mbed.h Thu Jul 21 13:35:08 2011 -0400 |
b |
@@ -0,0 +1,30 @@ +/********************************************************************* + * Clustal Omega - Multiple sequence alignment + * + * Copyright (C) 2010 University College Dublin + * + * Clustal-Omega is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This file is part of Clustal-Omega. + * + ********************************************************************/ + +/* + * RCS $Id: mbed.h 193 2011-02-07 15:45:21Z andreas $ + */ + +#ifndef CLUSTALO_MBED_H +#define CLUSTALO_MBED_H + +#include "muscle_tree.h" +#include "seq.h" + + +extern int +Mbed(tree_t **tree, mseq_t *prMSeq, + const int iPairDistType, const char *pcGuidetreeOutfile); + +#endif |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/clustal/muscle_tree.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/clustal/muscle_tree.c Thu Jul 21 13:35:08 2011 -0400 |
[ |
b'@@ -0,0 +1,2017 @@\n+/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n+\n+/* This a mix of tree functions and data-structures from\n+ * Bob Edgar\'s Muscle (version 3.7) ported to pure C, topped up with\n+ * some of our own stuff.\n+ *\n+ * Used files: phy.cpp, tree.h, phytofile.cpp and phyfromclust.cpp\n+ *\n+ * Muscle\'s code is public domain and so is this code here.\n+\n+ * From http://www.drive5.com/muscle/license.htm:\n+ * """\n+ * MUSCLE is public domain software\n+ *\n+ * The MUSCLE software, including object and source code and\n+ * documentation, is hereby donated to the public domain.\n+ *\n+ * Disclaimer of warranty\n+ * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,\n+ * EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION IMPLIED\n+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n+ * """\n+ *\n+ */\n+\n+/*\n+ * RCS $Id: muscle_tree.c 230 2011-04-09 15:37:50Z andreas $\n+ */\n+\n+#include <stdlib.h>\n+#include <stdio.h>\n+#include <string.h>\n+#include <limits.h>\n+#include <assert.h>\n+#include <ctype.h>\n+\n+#include "util.h"\n+#include "log.h"\n+#include "muscle_tree.h"\n+\n+\n+static const double VERY_NEGATIVE_DOUBLE = -9e29;\n+/*const double dInsane = VERY_NEGATIVE_DOUBLE;*/\n+static const double dInsane = -9e29;\n+static const unsigned uInsane = 8888888;\n+\n+typedef enum \n+{\n+ NTT_Unknown,\n+\n+ /* Returned from Tree::GetToken: */\n+ NTT_Lparen,\n+ NTT_Rparen,\n+ NTT_Colon,\n+ NTT_Comma,\n+ NTT_Semicolon,\n+ NTT_String,\n+ \n+ /* Following are never returned from Tree::GetToken: */\n+ NTT_SingleQuotedString,\n+ NTT_DoubleQuotedString,\n+ NTT_Comment\n+} NEWICK_TOKEN_TYPE;\n+\n+\n+static void\n+InitCache(uint uCacheCount, tree_t *tree);\n+static void\n+TreeZero(tree_t *tree);\n+static uint\n+GetNeighborCount(unsigned uNodeIndex, tree_t *tree);\n+static bool\n+IsEdge(unsigned uNodeIndex1, unsigned uNodeIndex2, tree_t *tree);\n+static bool\n+HasEdgeLength(uint uNodeIndex1, uint uNodeIndex2, tree_t *tree);\n+static void\n+TreeToFileNodeRooted(tree_t *tree, uint m_uRootNodeIndex, FILE *fp);\n+static void\n+ValidateNode(uint uNodeIndex, tree_t *tree);\n+static void\n+AssertAreNeighbors(unsigned uNodeIndex1, unsigned uNodeIndex2, tree_t *tree);\n+static void\n+ExpandCache(tree_t *tree);\n+static void\n+TreeCreateRooted(tree_t *tree);\n+static bool\n+GetGroupFromFile(FILE *fp, uint uNodeIndex, double *ptrdEdgeLength, tree_t *tree);\n+static NEWICK_TOKEN_TYPE\n+GetToken(FILE *fp, char szToken[], uint uBytes);\n+/* stuff from textfile.cpp */\n+static void\n+FileSkipWhite(FILE *fp);\n+static bool\n+FileSkipWhiteX(FILE *fp);\n+static void\n+SetLeafName(uint uNodeIndex, const char *ptrName, tree_t *tree);\n+uint\n+AppendBranch(tree_t *tree, uint uExistingLeafIndex);\n+static void\n+SetEdgeLength(uint uNodeIndex1, uint uNodeIndex2,\n+ double dLength, tree_t *tree);\n+static uint\n+UnrootFromFile(tree_t *tree);\n+uint\n+GetNeighbor(uint uNodeIndex, uint uNeighborSubscript, tree_t *tree);\n+static void\n+InitNode(tree_t *prTree, uint uNodeIndex);\n+\n+\n+/**\n+ * @param[in] uNodeIndex\n+ * node to examine\n+ * @param[in] tree\n+ * tree to examine\n+ * @return id of left node\n+ * @note called GetRight in Muscle3.7\n+ */\n+uint\n+GetLeft(uint uNodeIndex, tree_t *tree) \n+{\n+ assert(NULL != tree);\n+ assert(tree->m_bRooted && uNodeIndex < tree->m_uNodeCount);\n+ return tree->m_uNeighbor2[uNodeIndex];\n+}\n+/*** end: GetLeft ***/\n+\n+\n+\n+/**\n+ * @param[in] uNodeIndex\n+ * node to examine\n+ * @param[in] tree\n+ * tree to examine\n+ * @return id of right node\n+ * @note called GetRight in Muscle3.7\n+ */\n+uint\n+GetRight(uint uNodeIndex, tree_t *tree)\n+{\n+ assert(NULL != tree);\n+ assert(tree->m_bRooted && uNodeIndex < tree->m_uNodeCount);\n+ return tree->m_uNeighbor3[uNodeIndex];\n+}\n+/*** end: GetRight ***/\n+\n+\n+\n+/**\n+ * @param[in] uNodeIndex\n+ * node to examine\n+ * @param[in] tree\n+ * tree to examine\n+ * @return leaf id of current node\n+ */\n+uint\n+GetLeafId(uint uNodeIndex, tree_t *tree)\n+{\n+ assert(NU'..b'e edge length info to parent\n+ */\n+ prDstTree->m_bHasEdgeLength1[uNewDstNodeIndex] =\n+ prSrcTree->m_bHasEdgeLength1[uSrcTreeNodeIndex];\n+ prDstTree->m_dEdgeLength1[uNewDstNodeIndex] =\n+ prSrcTree->m_dEdgeLength1[uSrcTreeNodeIndex];\n+\n+ /* update sequence/object id\n+ */\n+ prDstTree->m_Ids[uNewDstNodeIndex] =\n+ prSrcTree->m_Ids[uSrcTreeNodeIndex]; \n+\n+ /* we used a new node so increase their count */\n+ prDstTree->m_uNodeCount += 1;\n+ \n+#if TRACE\n+ Log(&rLog, LOG_FORCED_DEBUG, "Updated dst node %d with a src leaf node: parent=%d (%f)",\n+ uNewDstNodeIndex,\n+ prDstTree->m_uNeighbor1[uNewDstNodeIndex], prDstTree->m_dEdgeLength1[uNewDstNodeIndex]);\n+#endif\n+ \n+ } else {\n+ /* src node is not root neither leaf, means we have an\n+ * internal node. Update all neighbour info\n+ * \n+ */\n+\n+ /* initialise/zero node values to default values\n+ */\n+ InitNode(prDstTree, uNewDstNodeIndex);\n+ \n+ /* update neigbours\n+ */\n+ /* parent: special case if parent was src tree root */\n+ if (IsRoot(prSrcTree->m_uNeighbor1[uSrcTreeNodeIndex], prSrcTree)) {\n+ prDstTree->m_uNeighbor1[uNewDstNodeIndex] =\n+ uDstTreeReplaceNodeIndex;\n+ } else {\n+ prDstTree->m_uNeighbor1[uNewDstNodeIndex] =\n+ prSrcTree->m_uNeighbor1[uSrcTreeNodeIndex] + uOrgDstTreeNodeCount;\n+ }\n+ /* left */\n+ prDstTree->m_uNeighbor2[uNewDstNodeIndex] =\n+ prSrcTree->m_uNeighbor2[uSrcTreeNodeIndex] + uOrgDstTreeNodeCount;\n+ /* right */\n+ prDstTree->m_uNeighbor3[uNewDstNodeIndex] =\n+ prSrcTree->m_uNeighbor3[uSrcTreeNodeIndex] + uOrgDstTreeNodeCount;\n+\n+ /* update edge length info\n+ */\n+ /* parent */\n+ prDstTree->m_bHasEdgeLength1[uNewDstNodeIndex] =\n+ prSrcTree->m_bHasEdgeLength1[uSrcTreeNodeIndex];\n+ prDstTree->m_dEdgeLength1[uNewDstNodeIndex] =\n+ prSrcTree->m_dEdgeLength1[uSrcTreeNodeIndex];\n+ /* left */\n+ prDstTree->m_bHasEdgeLength2[uNewDstNodeIndex] =\n+ prSrcTree->m_bHasEdgeLength2[uSrcTreeNodeIndex];\n+ prDstTree->m_dEdgeLength2[uNewDstNodeIndex] =\n+ prSrcTree->m_dEdgeLength2[uSrcTreeNodeIndex];\n+ /* right */\n+ prDstTree->m_bHasEdgeLength3[uNewDstNodeIndex] =\n+ prSrcTree->m_bHasEdgeLength3[uSrcTreeNodeIndex];\n+ prDstTree->m_dEdgeLength3[uNewDstNodeIndex] =\n+ prSrcTree->m_dEdgeLength3[uSrcTreeNodeIndex];\n+\n+ /* we used a new node so increase their count */\n+ prDstTree->m_uNodeCount += 1;\n+ \n+#if TRACE\n+ Log(&rLog, LOG_FORCED_DEBUG, "Updated dst node %d with an internal src node: parent=%d (%f) left=%d (%f) right=%d (%f)",\n+ uNewDstNodeIndex,\n+ prDstTree->m_uNeighbor1[uNewDstNodeIndex], prDstTree->m_dEdgeLength1[uNewDstNodeIndex],\n+ prDstTree->m_uNeighbor2[uNewDstNodeIndex], prDstTree->m_dEdgeLength2[uNewDstNodeIndex],\n+ prDstTree->m_uNeighbor3[uNewDstNodeIndex], prDstTree->m_dEdgeLength3[uNewDstNodeIndex]);\n+#endif\n+ }\n+\n+ }\n+ /* end for each src tree node */\n+\n+ \n+ /*\n+ * m_uRootNodeIndex stays the same.\n+ *\n+ * No need to touch m_uCacheCount.\n+ *\n+ */ \n+#if USE_HEIGHT\n+ Log(&rLog, LOG_FATAL, "Internal error: Height usage not implemented in %s", __FUNCTION__);\n+#endif \n+\n+ \n+#ifndef NDEBUG\n+ TreeValidate(prDstTree);\n+#endif\n+ \n+ return;\n+}\n+/*** end: AppendTree() ***/\n+\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/clustal/muscle_tree.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/clustal/muscle_tree.h Thu Jul 21 13:35:08 2011 -0400 |
[ |
@@ -0,0 +1,173 @@ +/* This a mix of tree functions and data-structures from + * Bob Edgar's Muscle (version 3.7) ported to pure C. + * + * Used files: phy.cpp, tree.h, phytofile.cpp and phyfromclust.cpp + * + * Muscle's code is public domain and so is this code here. + + * From http://www.drive5.com/muscle/license.htm: + * """ + * MUSCLE is public domain software + * + * The MUSCLE software, including object and source code and + * documentation, is hereby donated to the public domain. + * + * Disclaimer of warranty + * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, + * EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * """ + * + */ + +/* + * RCS $Id: muscle_tree.h 230 2011-04-09 15:37:50Z andreas $ + */ + + +#ifndef CLUSTALO_MUSCLE_CLUSTALO_TREE_H +#define CLUSTALO_MUSCLE_CLUSTALO_TREE_H + +#include <stdio.h> +#include "util.h" + +#ifndef uint +/* limit use of uint (see coding_style_guideline.txt) */ +typedef unsigned int uint; +#endif + +static const uint NULL_NEIGHBOR = UINT_MAX; + +/** + * @brief guide-tree structure + * + * @note We kept the original variable names here, to make it easy to + * search through Muscle's source code. + * From phy.cpp: + * Node has 0 to 3 neighbors: + * 0 neighbors: singleton root + * 1 neighbor: leaf, neighbor is parent + * 2 neigbors: non-singleton root + * 3 neighbors: internal node (other than root) + * + * Minimal rooted tree is single node. + * Minimal unrooted tree is single edge. + * Leaf node always has nulls in neighbors 2 and 3, neighbor 1 is parent. + * When tree is rooted, neighbor 1=parent, 2=left, 3=right. + * + */ +typedef struct { + uint m_uNodeCount;/**< number of nodes */ + uint m_uCacheCount;/**< reserved memory */ + + uint *m_uNeighbor1;/**< parent node */ + uint *m_uNeighbor2;/**< left node */ + uint *m_uNeighbor3;/**< right node */ + + /* do we have edge lengths info stored (m_dEdgeLength[123]) */ + bool *m_bHasEdgeLength1; + bool *m_bHasEdgeLength2; + bool *m_bHasEdgeLength3; + + double *m_dEdgeLength1; + double *m_dEdgeLength2; + double *m_dEdgeLength3; + +#if USE_HEIGHT + /* unused in our version of the code. we might need it at some + * stage so keep it in here, but disable via USE_HEIGHT throughout + * the code */ + double *m_dHeight; + bool *m_bHasHeight; +#endif + + /** + * leaf labels. + * index range: 0 -- (m_uNodeCount+1)/2 + */ + char **m_ptrName; + + /** + * node id. + * index range: 0 -- m_uNodeCount + */ + uint *m_Ids; + + bool m_bRooted; /**< tree is rooted */ + uint m_uRootNodeIndex; +} tree_t; + + +extern void +MuscleTreeCreate(tree_t *tree, uint uLeafCount, uint uRoot, const uint *Left, + const uint *Right, const float *LeftLength, const float* RightLength, + const uint *LeafIds, char **LeafNames); + +extern void +MuscleTreeToFile(FILE *fp, tree_t *tree); + +extern int +MuscleTreeFromFile(tree_t *tree, char *ftree); + +extern void +FreeMuscleTree(tree_t *tree); + +extern void +LogTree(tree_t *tree, FILE *fp); + +extern bool +IsRooted(tree_t *tree); + +extern uint +GetNodeCount(tree_t *tree); + +extern uint +GetLeafCount(tree_t *tree); + +extern uint +FirstDepthFirstNode(tree_t *tree); + +extern uint +NextDepthFirstNode(uint nodeindex, tree_t *tree); + +extern bool +IsLeaf(uint nodeindex, tree_t *tree); + +extern void +SetLeafId(tree_t *tree, uint uNodeIndex, uint uId); + +extern uint +GetLeafId(uint nodeindex, tree_t *tree); + +extern char * +GetLeafName(unsigned uNodeIndex, tree_t *tree); + +extern uint +GetLeft(uint nodeindex, tree_t *tree); + +extern uint +GetRight(uint nodeindex, tree_t *tree); + +extern uint +GetRootNodeIndex(tree_t *tree); + +extern bool +IsRoot(uint uNodeIndex, tree_t *tree); + +extern uint +GetParent(unsigned uNodeIndex, tree_t *tree); + +extern double +GetEdgeLength(uint uNodeIndex1, uint uNodeIndex2, tree_t *tree); + +extern uint +LeafIndexToNodeIndex(uint uLeafIndex, tree_t *prTree); + +extern void +AppendTree(tree_t *prDstTree, + uint uDstTreeNodeIndex, tree_t *prSrcTree); + +extern void +TreeValidate(tree_t *tree); + +#endif |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/clustal/muscle_upgma.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/clustal/muscle_upgma.c Thu Jul 21 13:35:08 2011 -0400 |
[ |
b'@@ -0,0 +1,502 @@\n+/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n+\n+/* This the fast UPGMA algorithm (O(N^2)) as implemented in Bob Edgar\'s\n+ * Muscle (UPGMA2.cpp; version 3.7) ported to pure C.\n+ *\n+ * Muscle\'s code is public domain and so is this code here.\n+ *\n+ * From http://www.drive5.com/muscle/license.htm:\n+ * """\n+ * MUSCLE is public domain software\n+ *\n+ * The MUSCLE software, including object and source code and\n+ * documentation, is hereby donated to the public domain.\n+ *\n+ * Disclaimer of warranty\n+ * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,\n+ * EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION IMPLIED\n+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n+ * """\n+ *\n+ */\n+\n+/*\n+ * RCS $Id: muscle_upgma.c 230 2011-04-09 15:37:50Z andreas $\n+ *\n+ *\n+ * Notes:\n+ * ------\n+ * LINKAGE become linkage_t here\n+ *\n+ * Replaced the the following member functions for DistCalc DC:\n+ * DC.GetId = sequence id as int\n+ * DC.GetName = sequence name\n+ * DC.GetCount = matrix dim\n+ * DC.DistRange = vector / matrix row for object i with index j<i\n+ *\n+ * Log() has been replaced with Clustal\'s Info(), Quiet() with Log(&rLog, LOG_FATAL)\n+ *\n+ * Made TriangleSubscript() and g_ulTriangleSize ulong to prevent overflow for many sequences\n+ */\n+\n+#ifndef ulint\n+/* limit use of unsigned vars (see coding_style_guideline.txt) */\n+typedef unsigned long int ulong;\n+#endif\n+\n+\n+\n+#include <stdlib.h>\n+#include <stdio.h>\n+#include <assert.h>\n+\n+#include "util.h"\n+#include "log.h"\n+#include "symmatrix.h"\n+\n+#include "muscle_tree.h"\n+#include "muscle_upgma.h"\n+\n+/* from distcalc.h */\n+typedef float dist_t;\n+static const dist_t BIG_DIST = (dist_t) 1e29;\n+/* from muscle.h */\n+static const unsigned uInsane = 8888888;\n+\n+\n+\n+\n+/*static inline*/\n+ulong TriangleSubscript(uint uIndex1, uint uIndex2);\n+\n+\n+\n+\n+#define TRACE 0\n+\n+#ifndef MIN\n+#define MIN(x, y) ((x) < (y) ? (x) : (y))\n+#endif\n+#ifndef MIN\n+#define MAX(x, y) ((x) > (y) ? (x) : (y))\n+#endif\n+#define AVG(x, y) (((x) + (y))/2)\n+\n+static uint g_uLeafCount;\n+static ulong g_ulTriangleSize;\n+static uint g_uInternalNodeCount;\n+static uint g_uInternalNodeIndex;\n+\n+/* Triangular distance matrix is g_Dist, which is allocated\n+ * as a one-dimensional vector of length g_ulTriangleSize.\n+ * TriangleSubscript(i,j) maps row,column=i,j to the subscript\n+ * into this vector.\n+ * Row / column coordinates are a bit messy.\n+ * Initially they are leaf indexes 0..N-1.\n+ * But each time we create a new node (=new cluster, new subtree),\n+ * we re-use one of the two rows that become available (the children\n+ * of the new node). This saves memory.\n+ * We keep track of this through the g_uNodeIndex vector.\n+ */\n+static dist_t *g_Dist;\n+\n+/* Distance to nearest neighbor in row i of distance matrix.\n+ * Subscript is distance matrix row.\n+ */\n+static dist_t *g_MinDist;\n+\n+/* Nearest neighbor to row i of distance matrix.\n+ * Subscript is distance matrix row.\n+ */\n+static uint *g_uNearestNeighbor;\n+\n+/* Node index of row i in distance matrix.\n+ * Node indexes are 0..N-1 for leaves, N..2N-2 for internal nodes.\n+ * Subscript is distance matrix row.\n+ */\n+static uint *g_uNodeIndex;\n+\n+/* The following vectors are defined on internal nodes,\n+ * subscripts are internal node index 0..N-2.\n+ * For g_uLeft/Right, value is the node index 0 .. 2N-2\n+ * because a child can be internal or leaf.\n+ */\n+static uint *g_uLeft;\n+static uint *g_uRight;\n+static dist_t *g_Height;\n+static dist_t *g_LeftLength;\n+static dist_t *g_RightLength;\n+\n+\n+/*** CalcDistRange\n+ *\n+ * Imitation of DistCalc.DistRange\n+ *\n+ * Sets values of row (vector / matrix row) to distances for object i with index j<i\n+ *\n+ * row must be preallocated\n+ */\n+void CalcDistRange(symmatrix_t *distmat, uint i, dist_t *row)\n+{\n+ uint j;\n+ for (j = 0; j < i; ++j) {\n+ row[j] = SymMatrixGetValue(distmat, i, j);\n+ }\n+}\n+/* end of CalcDistRange */\n+\n+\n+\n+/*static inline*/\n+ulong\n+'..b'eak;\n+/* couldn\'t be arsed to figure out proper usage of g_dSUEFF */\n+#if 0\n+ case LINKAGE_BIASED:\n+ dtNewDist = g_dSUEFF*AVG(dL, dR) + (1 - g_dSUEFF)*MIN(dL, dR);\n+ break;\n+#endif\n+ default:\n+ Log(&rLog, LOG_FATAL, "UPGMA2: Invalid LINKAGE_%u", linkage);\n+ }\n+\n+ /* Nasty special case.\n+ * If nearest neighbor of j is Lmin or Rmin, then make the new\n+ * node (which overwrites the row currently occupied by Lmin)\n+ * the nearest neighbor. This situation can occur when there are\n+ * equal distances in the matrix. If we don\'t make this fix,\n+ * the nearest neighbor pointer for j would become invalid.\n+ * (We don\'t need to test for == Lmin, because in that case\n+ * the net change needed is zero due to the change in row\n+ * numbering).\n+ */\n+ if (g_uNearestNeighbor[j] == Rmin)\n+ g_uNearestNeighbor[j] = Lmin;\n+\n+#if TRACE\n+ Info("New dist to %u = (%u/%.3g + %u/%.3g)/2 = %.3g\\n",\n+ j, Lmin, dL, Rmin, dR, dtNewDist);\n+#endif\n+ g_Dist[vL] = dtNewDist;\n+ if (dtNewDist < dtNewMinDist) {\n+ dtNewMinDist = dtNewDist;\n+ uNewNearestNeighbor = j;\n+ }\n+ }\n+\n+ assert(g_uInternalNodeIndex < g_uLeafCount - 1 || BIG_DIST != dtNewMinDist);\n+ assert(g_uInternalNodeIndex < g_uLeafCount - 1 || uInsane != uNewNearestNeighbor);\n+\n+ const ulong v = TriangleSubscript(Lmin, Rmin);\n+ const dist_t dLR = g_Dist[v];\n+ const dist_t dHeightNew = dLR/2;\n+ const uint uLeft = g_uNodeIndex[Lmin];\n+ const uint uRight = g_uNodeIndex[Rmin];\n+ const dist_t HeightLeft =\n+ uLeft < g_uLeafCount ? 0 : g_Height[uLeft - g_uLeafCount];\n+ const dist_t HeightRight =\n+ uRight < g_uLeafCount ? 0 : g_Height[uRight - g_uLeafCount];\n+\n+ g_uLeft[g_uInternalNodeIndex] = uLeft;\n+ g_uRight[g_uInternalNodeIndex] = uRight;\n+ g_LeftLength[g_uInternalNodeIndex] = dHeightNew - HeightLeft;\n+ g_RightLength[g_uInternalNodeIndex] = dHeightNew - HeightRight;\n+ g_Height[g_uInternalNodeIndex] = dHeightNew;\n+\n+ /* Row for left child overwritten by row for new node */\n+ g_uNodeIndex[Lmin] = g_uLeafCount + g_uInternalNodeIndex;\n+ g_uNearestNeighbor[Lmin] = uNewNearestNeighbor;\n+ g_MinDist[Lmin] = dtNewMinDist;\n+\n+ /* Delete row for right child */\n+ g_uNodeIndex[Rmin] = uInsane;\n+\n+#if TRACE\n+ Info("\\nInternalNodeIndex=%u Lmin=%u Rmin=%u\\n",\n+ g_uInternalNodeIndex, Lmin, Rmin);\n+ ListState();\n+#endif\n+ }\n+\n+ uint uRoot = g_uLeafCount - 2;\n+\n+#if TRACE\n+ Log(&rLog, LOG_FORCED_DEBUG, "uRoot=%d g_uLeafCount=%d g_uInternalNodeCount=%d", uRoot, g_uLeafCount, g_uInternalNodeCount);\n+ for (i=0; i<g_uInternalNodeCount; i++) {\n+ Log(&rLog, LOG_FORCED_DEBUG, "internal node=%d: g_uLeft=%d g_uRight=%d g_LeftLength=%f g_RightLength=%f g_Height=%f",\n+ i, g_uLeft[i], g_uRight[i],\n+ g_LeftLength[i], g_RightLength[i],\n+ g_Height[i]);\n+ }\n+ for (i=0; i<g_uLeafCount; i++) {\n+ Log(&rLog, LOG_FORCED_DEBUG, "leaf node=%d: Ids=%d names=%s",\n+ i, Ids[i], names[i]);\n+ }\n+#endif\n+ \n+ MuscleTreeCreate(tree, g_uLeafCount, uRoot,\n+ g_uLeft, g_uRight,\n+ g_LeftLength, g_RightLength,\n+ Ids, names);\n+#if TRACE\n+ tree.LogMe();\n+#endif\n+\n+ free(g_Dist);\n+\n+ free(g_uNodeIndex);\n+ free(g_uNearestNeighbor);\n+ free(g_MinDist);\n+ free(g_Height);\n+\n+ free(g_uLeft);\n+ free(g_uRight);\n+ free(g_LeftLength);\n+ free(g_RightLength);\n+\n+ /* NOTE: Muscle\'s "Names" variable is here the argument "names" */\n+ free(Ids);\n+}\n+/*** end of UPGMA2 ***/\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/clustal/muscle_upgma.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/clustal/muscle_upgma.h Thu Jul 21 13:35:08 2011 -0400 |
b |
@@ -0,0 +1,43 @@ +/* This the fast UPGMA algorithm (O(N^2)) as implemented in Bob Edgar's + * Muscle (UPGMA2.cpp; version 3.7) ported to pure C. + * + * Muscle's code is public domain and so is this code here. + * + * From http://www.drive5.com/muscle/license.htm: + * """ + * MUSCLE is public domain software + * + * The MUSCLE software, including object and source code and + * documentation, is hereby donated to the public domain. + * + * Disclaimer of warranty + * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, + * EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * """ + * + */ + +/* + * RCS $Id: muscle_upgma.h 193 2011-02-07 15:45:21Z andreas $ + */ + +#ifndef CLUSTALO_UPGMA_H +#define CLUSTALO_UPGMA_H + +#include "symmatrix.h" +#include "muscle_tree.h" + +enum linkage_e { + LINKAGE_MIN, + LINKAGE_AVG, + LINKAGE_MAX, + LINKAGE_NEIGHBORJOINING, + LINKAGE_BIASED +}; +typedef enum linkage_e linkage_t; + +void MuscleUpgma2(tree_t *tree, symmatrix_t *distmat, + linkage_t linkage, char **names); + +#endif |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/clustal/pair_dist.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/clustal/pair_dist.c Thu Jul 21 13:35:08 2011 -0400 |
[ |
b'@@ -0,0 +1,425 @@\n+/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n+\n+/*********************************************************************\n+ * Clustal Omega - Multiple sequence alignment\n+ *\n+ * Copyright (C) 2010 University College Dublin\n+ *\n+ * Clustal-Omega is free software; you can redistribute it and/or\n+ * modify it under the terms of the GNU General Public License as\n+ * published by the Free Software Foundation; either version 2 of the\n+ * License, or (at your option) any later version.\n+ *\n+ * This file is part of Clustal-Omega.\n+ *\n+ ********************************************************************/\n+\n+/*\n+ * RCS $Id: pair_dist.c 242 2011-05-27 14:04:21Z andreas $\n+ */\n+\n+#ifdef HAVE_CONFIG_H\n+#include "config.h"\n+#endif\n+\n+#include <stdlib.h>\n+#include <ctype.h>\n+#include <assert.h>\n+#include <time.h>\n+\n+/* only neededfor iNumberOfThreads */\n+#include "clustal-omega.h"\n+\n+#include "ktuple_pair.h"\n+#include "pair_dist.h"\n+#include "progress.h"\n+#include "util.h"\n+\n+\n+/* Up to rev 173 we had a USE_SYM_KTUPLE switch implemented here. When active\n+ * ktuple distances were computed twice for each pair and averaged. Idea was\n+ * to avoid assymmetries in the pairwise scores (score(a, b) is often not the\n+ * same as score(b, a)). Results on BAliBASE indicate that this is overkill:\n+ *\n+ * r92_default core columns: avg-sp=0.800656 avg-tc=0.47711 (of total 218)\n+ * r93-mod--norm-ktuple/ core columns: avg-sp=0.800656 avg-tc=0.47711 (of total 218)\n+ * r93-mod--sym-ktuple/ core columns: avg-sp=0.801083 avg-tc=0.476544 (of total 217)\n+ * r93-mod--rand-ktuple-1 core columns: avg-sp=0.799289 avg-tc=0.468028 (of total 218)\n+ * r93-mod--rand-ktuple-2 core columns: avg-sp=0.801654 avg-tc=0.47659 (of total 217)\n+ * r93-mod--rand-ktuple-3 core columns: avg-sp=0.800234 avg-tc=0.474908 (of total 218)\n+ * r93-mod--rand-ktuple-4 core columns: avg-sp=0.800573 avg-tc=0.476514 (of total 218)\n+ * r93-mod--rand-ktuple-5 core columns: avg-sp=0.799679 avg-tc=0.468716 (of total 218)\n+ *\n+ */\n+\n+static double\n+KimuraCorrection(double frac_id);\n+\n+static int\n+SquidIdPairDist(symmatrix_t *tmat, mseq_t *mseq,\n+ int istart, int iend,\n+ int jstart, int jend,\n+ bool use_KimuraCorrection, progress_t *prProgress,\n+ unsigned long int *ulStepNo, unsigned long int ulTotalStepNo);\n+\n+/* Taken from Muscle\'s msadistkimura.cpp */\n+static int DAYHOFF_PAMS[]={\n+ 195, /* 75.0% observed d; 195 PAMs estimated = 195% estimated d */\n+ 196, /* 75.1% observed d; 196 PAMs estimated */\n+ 197, 198, 199, 200, 200, 201, 202, 203,\n+ 204, 205, 206, 207, 208, 209, 209, 210, 211, 212,\n+ 213, 214, 215, 216, 217, 218, 219, 220, 221, 222,\n+ 223, 224, 226, 227, 228, 229, 230, 231, 232, 233,\n+ 234, 236, 237, 238, 239, 240, 241, 243, 244, 245,\n+ 246, 248, 249, 250, /* 250 PAMs = 80.3% observed d */\n+ 252, 253, 254, 255, 257, 258,\n+ 260, 261, 262, 264, 265, 267, 268, 270, 271, 273,\n+ 274, 276, 277, 279, 281, 282, 284, 285, 287, 289,\n+ 291, 292, 294, 296, 298, 299, 301, 303, 305, 307,\n+ 309, 311, 313, 315, 317, 319, 321, 323, 325, 328,\n+ 330, 332, 335, 337, 339, 342, 344, 347, 349, 352,\n+ 354, 357, 360, 362, 365, 368, 371, 374, 377, 380,\n+ 383, 386, 389, 393, 396, 399, 403, 407, 410, 414,\n+ 418, 422, 426, 430, 434, 438, 442, 447, 451, 456,\n+ 461, 466, 471, 476, 482, 487, 493, 498, 504, 511,\n+ 517, 524, 531, 538, 545, 553, 560, 569, 577, 586,\n+ 595, 605, 615, 626, 637, 649, 661, 675, 688, 703,\n+'..b'iend;\n+ for(iChunk = 0; iChunk <= iNumberOfThreads; iChunk++)\n+ {\n+ iChunkEnd = iChunkStart;\n+ if(iChunk == iNumberOfThreads - 1)\n+ iChunkStart = 0;\n+ else\n+ iChunkStart = iend - ((double)(iend - istart) * sqrt(((double)iChunk + 1.0)/(double)iNumberOfThreads));\n+ iChunkStarts[iChunk] = iChunkStart;\n+ iChunkEnds[iChunk] = iChunkEnd;\n+ }\n+\n+ if (PAIRDIST_KTUPLE == pairdist_type) {\n+\n+ Log(&rLog, LOG_INFO, "Calculating pairwise ktuple-distances...");\n+\n+ NewProgress(&prProgress, LogGetFP(&rLog, LOG_INFO),\n+ "Ktuple-distance calculation progress", bPrintCR);\n+#ifdef HAVE_OPENMP\n+ #pragma omp parallel for private(iChunk) schedule(dynamic)\n+#endif\n+ for(iChunk = 0; iChunk < iNumberOfThreads; iChunk++)\n+ {\n+ KTuplePairDist((*distmat), mseq, iChunkStarts[iChunk], \n+ iChunkEnds[iChunk], jstart, jend, NULL, prProgress, \n+ &ulStepNo, ulTotalStepNo);\n+ }\n+\n+#if 0\n+ printf("total ops %d\\n", ulStepNo);\n+#endif\n+ /* old format:\n+ KTuplePairDist((*distmat), mseq,\n+ istart, iend,\n+ jstart, jend, NULL); */\n+\n+ } else if (PAIRDIST_SQUIDID == pairdist_type) {\n+ Log(&rLog, LOG_INFO, "Calculating pairwise aligned identity distances...");\n+\n+ NewProgress(&prProgress, LogGetFP(&rLog, LOG_INFO),\n+ "Pairwise identity calculation progress", bPrintCR);\n+#ifdef HAVE_OPENMP\n+ #pragma omp parallel for private(iChunk) schedule(dynamic)\n+#endif\n+ for(iChunk = 0; iChunk < iNumberOfThreads; iChunk++)\n+ {\n+ iSquidSuccess = SquidIdPairDist((*distmat), mseq,\n+ iChunkStarts[iChunk], iChunkEnds[iChunk],\n+ jstart, jend, FALSE, prProgress,\n+ &ulStepNo, ulTotalStepNo);\n+ }\n+ if(iSquidSuccess != 0)\n+ return -1;\n+\n+ } else if (PAIRDIST_SQUIDID_KIMURA == pairdist_type) {\n+ Log(&rLog, LOG_INFO, "Calculating Kimura-corrected pairwise aligned identity distances...");\n+ NewProgress(&prProgress, LogGetFP(&rLog, LOG_INFO),\n+ "Pairwise identity calculation progress", bPrintCR);\n+#ifdef HAVE_OPENMP\n+ #pragma omp parallel for private(iChunk) schedule(dynamic)\n+#endif\n+ for(iChunk = 0; iChunk < iNumberOfThreads; iChunk++)\n+ {\n+ iSquidSuccess = SquidIdPairDist((*distmat), mseq,\n+ iChunkStarts[iChunk], iChunkEnds[iChunk],\n+ jstart, jend, TRUE, prProgress,\n+ &ulStepNo, ulTotalStepNo);\n+ }\n+ if(iSquidSuccess != 0)\n+ return -1;\n+ } else {\n+ Log(&rLog, LOG_FATAL, "INTERNAL ERROR: don\'t know about pairdist_type %d",\n+ pairdist_type);\n+ }\n+ }\n+#endif /* random/proper distance calculation */\n+\n+\n+ /* optional printing of matrix to file\n+ */\n+ if (NULL != fdist_out) {\n+ /* need a copy of sequence names for printing */\n+ char **names;\n+ names = (char **)CKMALLOC(mseq->nseqs * sizeof(char*));\n+ for (uSeqIndex=0; uSeqIndex<mseq->nseqs; uSeqIndex++) {\n+ names[uSeqIndex] = mseq->sqinfo[uSeqIndex].name;\n+ }\n+\n+ SymMatrixPrint((*distmat), names, fdist_out);\n+\n+ Log(&rLog, LOG_INFO, "Pairwise distance matrix written to %s",\n+ fdist_out);\n+ CKFREE(names);\n+ }\n+\n+#if 0\n+#include "distance-distrib.h" \n+#endif\n+\n+ if (NULL != prProgress) {\n+ ProgressDone(prProgress);\n+ FreeProgress(&prProgress);\n+ }\n+\n+ return 0;\n+}\n+/*** end: PairDistances() ***/\n+\n+\n+\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/clustal/pair_dist.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/clustal/pair_dist.h Thu Jul 21 13:35:08 2011 -0400 |
b |
@@ -0,0 +1,42 @@ +/********************************************************************* + * Clustal Omega - Multiple sequence alignment + * + * Copyright (C) 2010 University College Dublin + * + * Clustal-Omega is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This file is part of Clustal-Omega. + * + ********************************************************************/ + +/* + * RCS $Id: pair_dist.h 193 2011-02-07 15:45:21Z andreas $ + */ + + +#ifndef CLUSTALO_PAIR_DIST_H +#define CLUSTALO_PAIR_DIST_H + +#define PAIRDIST_UNKNOWN 0 +/* k-tuple distances: Wilbur and Lipman (1983) */ +#define PAIRDIST_KTUPLE 1 +/* fractional identity between aligned sequences. denominator is + * minimum seq len (see squid:aligneval.c) */ +#define PAIRDIST_SQUIDID 2 +/* SQUIDID + Kimura correction */ +#define PAIRDIST_SQUIDID_KIMURA 3 + +#include "seq.h" +#include "symmatrix.h" + +extern int +PairDistances(symmatrix_t **distmat, mseq_t *mseq, const int pairdist_type, + const int istart, const int iend, + const int jstart, const int jend, + char *fdist_in, char *fdist_out); + +#endif + |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/clustal/progress.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/clustal/progress.c Thu Jul 21 13:35:08 2011 -0400 |
[ |
@@ -0,0 +1,177 @@ +/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ + +/********************************************************************* + * Clustal Omega - Multiple sequence alignment + * + * Copyright (C) 2010 University College Dublin + * + * Clustal-Omega is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This file is part of Clustal-Omega. + * + ********************************************************************/ + +/* + * RCS $Id: progress.c 230 2011-04-09 15:37:50Z andreas $ + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <stdlib.h> +#include <stdio.h> +#include <assert.h> + +#include "util.h" +#include "log.h" +#include "progress.h" + +#define LOGLEVEL_THRESHOLD LOG_INFO + +/** + * @brief Allocates a new progress structure and initialises its members. + * Free with FreeProgress() + * + * @note Starts the internal stopwatch immediatly! + * + * @see FreeProgress() + * + * @param[out] pprProgress + * Pointer pointer to progress structure. Progress structure will be + * allocated here. + * @param[in] prFile + * Where to log messages to + * @param[in] pcPrefix + * What prefix to use for messages + * @param[in] bPrintCR + * If TRUE carriage return instead of newline will be printed between log messages + */ +void +NewProgress(progress_t **pprProgress, FILE *prFile, + char *pcPrefix, bool bPrintCR) +{ + assert(NULL!=pprProgress); + assert(NULL!=prFile); + assert(NULL!=pcPrefix); + + (*pprProgress) = (progress_t *) CKMALLOC(1*sizeof(progress_t)); + (*pprProgress)->prFile = prFile; + (*pprProgress)->bPrintCR = bPrintCR; + (*pprProgress)->pcPrefix = CkStrdup(pcPrefix); + strcpy((*pprProgress)->pcLastLogMsg, "\0"); + (*pprProgress)->prStopwatch = StopwatchCreate(); + StopwatchZero((*pprProgress)->prStopwatch); + StopwatchStart((*pprProgress)->prStopwatch); + + return; +} +/*** end: NewProgress() ***/ + + + +/** + * @brief Frees progress structure and its members + * + * @param[out] pprProgress + * Pointer pointer to progress structure + * + * @see NewProgress() + * + */ +void +FreeProgress(progress_t **pprProgress) +{ + (*pprProgress)->prFile = NULL; + CKFREE((*pprProgress)->pcPrefix); + StopwatchFree((*pprProgress)->prStopwatch); + + CKFREE(*pprProgress); + return; +} +/*** end: FreeProgress() ***/ + + + + +/** + * @brief Prints a progress update (and a carriage return) + * + * @param[in] prProgress + * Pointer to the progress structure + * @param[in] iStep + * Current step number + * @param[in] iTotalSteps + * Total step number + * @param[in] bForceOutput + * If percentage hasn't changed output is normally supressed + * normally. Output can be forced with this flag. + * + */ +void +ProgressLog(progress_t *prProgress, + unsigned long int iStep, unsigned long int iTotalSteps, + bool bForceOutput) +{ + char pcLogMsg[1024]; + assert(0!=iTotalSteps); + + if (rLog.iLogLevelEnabled>LOGLEVEL_THRESHOLD) { + return; + } + + (void) snprintf(pcLogMsg, sizeof(pcLogMsg), "%s: %lu %%", + prProgress->pcPrefix, (unsigned long int)(iStep/(float)iTotalSteps*100.0)); + + if (! bForceOutput) { + /* Skip logging, if we've just logged the same message */ + if (STR_EQ(pcLogMsg, prProgress->pcLastLogMsg)) { + return; + } + } + + strncpy(prProgress->pcLastLogMsg, pcLogMsg, + sizeof(prProgress->pcLastLogMsg)); + + fprintf(prProgress->prFile, "%s (%lu out of %lu)", pcLogMsg, iStep, iTotalSteps); + if (prProgress->bPrintCR) { + fprintf(prProgress->prFile, "\r"); + } else { + fprintf(prProgress->prFile, "\n"); + + } + (void) fflush(prProgress->prFile); + + return; +} +/*** end: ProgressLog() ***/ + + +/** + * @brief Finishes progress output by printing the elapsed time + * + * @param[in] prProgress + * Pointer to the progress structure + * + */ +void +ProgressDone(progress_t *prProgress) +{ + char pcBuf[1024]; + + if (rLog.iLogLevelEnabled>LOGLEVEL_THRESHOLD) { + return; + } + + (void) snprintf(pcBuf, sizeof(pcBuf), "%s done. CPU time: ", + prProgress->pcPrefix); + StopwatchStop(prProgress->prStopwatch); + StopwatchDisplay(prProgress->prFile, pcBuf, prProgress->prStopwatch); + (void) fflush(prProgress->prFile); + + return; +} +/*** end: ProgressDone() ***/ |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/clustal/progress.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/clustal/progress.h Thu Jul 21 13:35:08 2011 -0400 |
[ |
@@ -0,0 +1,50 @@ +/********************************************************************* + * Clustal Omega - Multiple sequence alignment + * + * Copyright (C) 2010 University College Dublin + * + * Clustal-Omega is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This file is part of Clustal-Omega. + * + ********************************************************************/ + +/* + * RCS $Id: progress.h 193 2011-02-07 15:45:21Z andreas $ + */ + + +#ifndef CLUSTALO_PROGRESS_H +#define CLUSTALO_PROGRESS_H + +#include "squid/stopwatch.h" + +typedef struct { + /* where to write to */ + FILE *prFile; + /* prefix printed before each step */ + char *pcPrefix; + bool bPrintCR; + char pcLastLogMsg[1024]; + Stopwatch_t *prStopwatch; +} progress_t; + + +extern void +NewProgress(progress_t **pprProgress, FILE *prFile, char *pcPrefix, bool bPrintCR); + +extern void +FreeProgress(progress_t **pprProgress); + +extern void +ProgressLog(progress_t *prProgress, + unsigned long int iStep, unsigned long int iTotalSteps, + bool bForceOutput); + +extern void +ProgressDone(progress_t *pprProgress); + +#endif |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/clustal/queue.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/clustal/queue.h Thu Jul 21 13:35:08 2011 -0400 |
b |
@@ -0,0 +1,75 @@ +/********************************************************************* + * Clustal Omega - Multiple sequence alignment + * + * Copyright (C) 2010 University College Dublin + * + * Clustal-Omega is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This file is part of Clustal-Omega. + * + ********************************************************************/ + +/* + * RCS $Id: queue.h 193 2011-02-07 15:45:21Z andreas $ + * + * Functions/Macros for FIFOs/Queues + * + */ + +#ifndef CLUSTALO_QUEUE_H +#define CLUSTALO_QUEUE_H + +#include "list.h" + + + +/* FIFO/Queue as list_t, storing data pointers + * + */ + +typedef list_t queue_t; + +/* setup queue */ +#define QUEUE_INIT(prQueue, destroy_func) ListInit((prQueue), (destroy_func)) + +/* free all elements from queue */ +#define QUEUE_DESTROY(prQueue) ListDestroy((prQueue)) + +/* enqueue */ +#define QUEUE_PUSH(prQueue, data) LIST_APPEND((prQueue), (data)) + +/* dequeue */ +#define QUEUE_POP(prQueue, data) ListRemoveNext((prQueue), NULL, (data)) + +/* is queue empty ? */ +#define QUEUE_EMPTY(prQueue) (0==LIST_SIZE((prQueue))) + + + +/* Special int FIF/Queue, storing ints by copying them instead of + * keeping pointers only + */ + +typedef queue_t int_queue_t; + +/* setup queue */ +#define INT_QUEUE_INIT(prQueue) INT_LIST_INIT((prQueue)) + +/* free all elements from queue */ +#define INT_QUEUE_DESTROY(prQueue) INT_LIST_DESTROY((prQueue)) + +/* enqueue */ +#define INT_QUEUE_PUSH(prQueue, data) INT_LIST_APPEND((prQueue), (data)) + +/* dequeue */ +#define INT_QUEUE_POP(prQueue, data) IntListRemoveNext((prQueue), NULL, (data)) + +/* is queue empty ? */ +#define INT_QUEUE_EMPTY(prQueue) (0==INT_LIST_SIZE((prQueue))) + + + +#endif |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/clustal/seq.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/clustal/seq.c Thu Jul 21 13:35:08 2011 -0400 |
[ |
b'@@ -0,0 +1,1185 @@\n+/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n+\n+/*********************************************************************\n+ * Clustal Omega - Multiple sequence alignment\n+ *\n+ * Copyright (C) 2010 University College Dublin\n+ *\n+ * Clustal-Omega is free software; you can redistribute it and/or\n+ * modify it under the terms of the GNU General Public License as\n+ * published by the Free Software Foundation; either version 2 of the\n+ * License, or (at your option) any later version.\n+ *\n+ * This file is part of Clustal-Omega.\n+ *\n+ ********************************************************************/\n+\n+/*\n+ * RCS $Id: seq.c 245 2011-06-15 12:38:53Z fabian $\n+ *\n+ *\n+ * Module for sequence/alignment IO and misc.\n+ *\n+ * This depends heavily on Sean Eddy\'s squid library, which is obsoleted by\n+ * HMMER3\'s Easel. However, easel doesn\'t support that many non-aligned input\n+ * formats.\n+ *\n+ */\n+\n+#ifdef HAVE_CONFIG_H\n+#include "config.h"\n+#endif\n+\n+#include <assert.h>\n+#include "squid/squid.h"\n+#include <ctype.h>\n+\n+#include "util.h"\n+#include "log.h"\n+#include "seq.h"\n+\n+\n+#define ALLOW_ONLY_PROTEIN 0 /* requested by Hamish, FS, r244 -> r245 */\n+\n+\n+\n+\n+/**\n+ * @brief Stripped down version of squid\'s alistat\n+ *\n+ *\n+ * @param[in] prMSeq\n+ * The alignment to analyse\n+ * @param[in] bSampling\n+ * For many sequences: samples from pool\n+ * @param[in] bReportAll\n+ * Report identities for all sequence pairs\n+ *\n+ * Don\'t have to worry about sequence case because our version of PairwiseIdentity is case insensitive\n+ */\n+void\n+AliStat(mseq_t *prMSeq, bool bSampling, bool bReportAll) {\n+\n+ /*\n+ * bSampling = squid\'s do_fast\n+ * bReportAll = squid\'s allreport\n+ */\n+ float **ppdIdentMx; /* identity matrix (squid: imx) */\n+ const int iNumSample = 1000; /* sample size (squid: nsample) */\n+ int iAux;\n+\n+ MSA *msa; /* squid\'s alignment structure */\n+ int small, large;\t\n+ int bestj, worstj;\n+ float sum;\n+ float worst_worst, worst_best, best_best;\n+ float avgid;\n+ int i, j;\n+ int nres; /* number of residues */\n+\n+ if (bSampling && bReportAll) {\n+ Log(&rLog, LOG_WARN,\n+ "Cannot report all and sample at the same time. Skipping %s()", __FUNCTION__);\n+ return;\n+ }\n+ if (FALSE == prMSeq->aligned) {\n+ Log(&rLog, LOG_WARN,\n+ "Sequences are not aligned. Skipping %s()", __FUNCTION__);\n+ return;\n+ }\n+\n+ /* silence gcc warnings about uninitialized variables\n+ */\n+ worst_worst = worst_best = best_best = 0.0;\n+ bestj = worstj = -1;\n+\n+\n+ /** mseq to squid msa\n+ *\n+ * FIXME code overlap with WriteAlignment. Make it a function and take\n+ * code there (contains more comments) as template\n+ *\n+ */\n+ msa = MSAAlloc(prMSeq->nseqs, \n+ /* derive alignment length from first seq */\n+ strlen(prMSeq->seq[0]));\n+ for (i=0; i<prMSeq->nseqs; i++) {\n+ int key; /* MSA struct internal index for sequence */\n+ char *this_name = prMSeq->sqinfo[i].name; /* prMSeq sequence name */\n+ char *this_seq = prMSeq->seq[i]; /* prMSeq sequence */\n+ SQINFO *this_sqinfo = &prMSeq->sqinfo[i]; /* prMSeq sequence name */\n+\n+ key = GKIStoreKey(msa->index, this_name);\n+ msa->sqname[key] = sre_strdup(this_name, strlen(this_name));\n+ /* setting msa->sqlen[idx] and msa->aseq[idx] */\n+ msa->sqlen[key] = sre_strcat(&(msa->aseq[key]), msa->sqlen[key],\n+ this_seq, strlen(this_seq));\n+ if (this_sqinfo->flags & SQINFO_DESC) {\n+ MSASetSeqDescription(msa, key, this_sqinfo->desc);\n+ } \n+ msa->nseq++;\n+ } \n+ \n+\n+\n+ nres = 0;\n+ small = large = -1;\n+ for (i = 0; i < msa->nseq; i++) {\n+ int rlen;\t\t/* raw sequence length */\n+ rlen = DealignedLength(msa->aseq[i]);\n+ nres += rlen;\n+ if (sma'..b'meLength, bGapFound);\n+#endif\n+ if (TRUE == bSameLength && TRUE == bGapFound) {\n+ return TRUE;\n+ } else {\n+ return FALSE;\n+ } \n+\n+}\n+/*** end: SeqsAreAligned() ***/\n+\n+\n+\n+/**\n+ * @brief Creates a new sequence entry and appends it to an existing mseq\n+ * structure.\n+ *\n+ * @param[out] prMSeqDest_p\n+ * Already existing and initialised mseq structure\n+ * @param[in] pcSeqName\n+ * sequence name of the sequence to add\n+ * @param[in] pcSeqRes\n+ * the actual sequence (residues) to add\n+ * \n+ * @note Don\'t forget to update the align and type flag if necessary!\n+ *\n+ * FIXME allow adding of more features\n+ *\n+ */ \n+void\n+AddSeq(mseq_t **prMSeqDest_p, char *pcSeqName, char *pcSeqRes)\n+{\n+ int iSeqIdx = 0;\n+ SQINFO sqinfo;\n+\n+ assert(NULL != prMSeqDest_p);\n+ assert(NULL != pcSeqName);\n+ assert(NULL != pcSeqRes);\n+\n+ iSeqIdx = (*prMSeqDest_p)->nseqs;\n+\n+ (*prMSeqDest_p)->seq = (char **)\n+ CKREALLOC((*prMSeqDest_p)->seq, (iSeqIdx+1) * sizeof(char *));\n+ (*prMSeqDest_p)->orig_seq = (char **)\n+ CKREALLOC((*prMSeqDest_p)->orig_seq, (iSeqIdx+1) * sizeof(char *));\n+ (*prMSeqDest_p)->sqinfo = (SQINFO *)\n+ CKREALLOC((*prMSeqDest_p)->sqinfo, (iSeqIdx+1) * sizeof(SQINFO));\n+\n+\n+ (*prMSeqDest_p)->seq[iSeqIdx] = CkStrdup(pcSeqRes);\n+ (*prMSeqDest_p)->orig_seq[iSeqIdx] = CkStrdup(pcSeqRes);\n+\n+ /* should probably get ri of SqInfo altogether in the long run and just\n+ transfer the intersting members into our own struct\n+ */\n+ sqinfo.flags = 0; /* init */\n+\n+ sqinfo.len = strlen(pcSeqRes);\n+ sqinfo.flags |= SQINFO_LEN;\n+\n+ /* name is an array of SQINFO_NAMELEN length */\n+ strncpy(sqinfo.name, pcSeqName, SQINFO_NAMELEN-1);\n+ sqinfo.name[SQINFO_NAMELEN-1] = \'\\0\';\n+ sqinfo.flags |= SQINFO_NAME;\n+ \n+ SeqinfoCopy(&(*prMSeqDest_p)->sqinfo[iSeqIdx],\n+ & sqinfo);\n+\n+ (*prMSeqDest_p)->nseqs++;\n+\n+ return; \n+}\n+/* end of AddSeq() */\n+\n+\n+\n+\n+/**\n+ * @brief Appends an mseq structure to an already existing one.\n+ * filename will be left untouched.\n+ *\n+ * @param[in] prMSeqDest_p\n+ * MSeq structure to which to append to\n+ * @param[out] prMSeqToAdd\n+ * MSeq structure which is to append\n+ *\n+ * \n+ */ \n+void\n+JoinMSeqs(mseq_t **prMSeqDest_p, mseq_t *prMSeqToAdd)\n+{\n+ int iSrcSeqIndex;\n+ int iNewNSeq;\n+ \n+ assert(NULL != prMSeqDest_p && NULL != (*prMSeqDest_p));\n+ assert(NULL != prMSeqToAdd);\n+ \n+ if (0 == prMSeqToAdd->nseqs) {\n+ Log(&rLog, LOG_WARN, "Was asked to add 0 sequences");\n+ return;\n+ }\n+ \n+ /* warn on seqtype mismatch and keep original seqtype */\n+ if ((*prMSeqDest_p)->seqtype != prMSeqToAdd->seqtype) {\n+ Log(&rLog, LOG_WARN, "Joining sequences of different type");\n+ }\n+ \n+ /* leave filename as it is */\n+\n+ /*\n+ * copy new seq/s, orig_seq/s, sqinfo/s\n+ */\n+ iNewNSeq = (*prMSeqDest_p)->nseqs + prMSeqToAdd->nseqs;\n+ \n+ (*prMSeqDest_p)->seq = (char **)\n+ CKREALLOC((*prMSeqDest_p)->seq, iNewNSeq * sizeof(char *));\n+ \n+ (*prMSeqDest_p)->orig_seq = (char **)\n+ CKREALLOC((*prMSeqDest_p)->orig_seq, iNewNSeq * sizeof(char *));\n+ \n+ (*prMSeqDest_p)->sqinfo = (SQINFO *)\n+ CKREALLOC((*prMSeqDest_p)->sqinfo, iNewNSeq * sizeof(SQINFO));\n+ \n+ \n+ for (iSrcSeqIndex=0; iSrcSeqIndex < prMSeqToAdd->nseqs; iSrcSeqIndex++) {\n+ int iDstSeqIndex = (*prMSeqDest_p)->nseqs++;\n+ \n+ (*prMSeqDest_p)->seq[iDstSeqIndex] =\n+ CkStrdup(prMSeqToAdd->seq[iSrcSeqIndex]);\n+ \n+ (*prMSeqDest_p)->orig_seq[iDstSeqIndex] =\n+ CkStrdup(prMSeqToAdd->orig_seq[iSrcSeqIndex]);\n+ \n+ SeqinfoCopy(&(*prMSeqDest_p)->sqinfo[iDstSeqIndex],\n+ & prMSeqToAdd->sqinfo[iSrcSeqIndex]);\n+ }\n+\n+ (*prMSeqDest_p)->nseqs = iNewNSeq;\n+ \n+ (*prMSeqDest_p)->aligned = SeqsAreAligned(*prMSeqDest_p);\n+ \n+ return; \n+}\n+/*** end: JoinMSeqs() ***/\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/clustal/seq.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/clustal/seq.h Thu Jul 21 13:35:08 2011 -0400 |
[ |
@@ -0,0 +1,164 @@ +/********************************************************************* + * Clustal Omega - Multiple sequence alignment + * + * Copyright (C) 2010 University College Dublin + * + * Clustal-Omega is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This file is part of Clustal-Omega. + * + ********************************************************************/ + +/* + * RCS $Id: seq.h 234 2011-04-13 05:26:16Z andreas $ + */ + +#ifndef CLUSTALO_SEQ_H +#define CLUSTALO_SEQ_H + +#include "squid/squid.h" + +#include "util.h" + + +/** + * int-encoded sequence types. + * these are in sync with squid's seqtypes and only used for + * convenience here + */ +#define SEQTYPE_UNKNOWN kOtherSeq +#define SEQTYPE_DNA kDNA +#define SEQTYPE_RNA kRNA +#define SEQTYPE_PROTEIN kAmino + +/* Alphabets are defined in squid.h: AMINO_ALPHABET, DNA_ALPHABET, + * RNA_ALPHABET (all uppercase) + */ +#define AMINOACID_ANY 'X' +#define NUCLEOTIDE_ANY 'N' + +/** + * @brief structure for storing multiple sequences + * + */ +typedef struct { + int nseqs; /**< number of sequences */ + int seqtype; /**< sequence type */ + char *filename; /**< input file / source of sequences */ + bool aligned; /**< true if all seqs are same length **/ + + /** (working) sequence residues as char pointer. + * range for first index: 0--nseq-1. + * changes during alignment. + */ + char **seq; + + /** original sequence residues as char pointer. + * range for first index: 0--nseq-1. + * only set during input + */ + char **orig_seq; + + /** + * @brief Squid's sequence info structure. + * Index range: 0--nseq-1. + * + * extra data are available: + * int flags; + * + * name: + * char name[SQINFO_NAMELEN]; + * + * database identifier: + * char id[SQINFO_NAMELEN]; + * + * database accession no: + * char acc[SQINFO_NAMELEN]; + * + * description: + * char desc[SQINFO_DESCLEN]; + * + * length of this seq, incl gaps in our case!: + * int len; + * + * start position on source seq (valid range: 1..len): + * int start; + * + * end position on source seq (valid range: 1..len): + * int stop; + * + * original length of source seq: + * int olen; + * + * kRNA, kDNA, kAmino, or kOther: + * int type; + * + * secondary structure string (index range: 0..len-1): + * char *ss; + * + * percent side chain surface access (index range: 0..len-1): + * char *sa; + * + * @see squid.h + * @see LogSqInfo() + * + */ + SQINFO *sqinfo; +} mseq_t; + +extern void +AliStat(mseq_t *prMSeq, bool bSampling, bool bReportAll); + +extern void +AddSeq(mseq_t **prMSeqDest_p, char *pcSeqName, char *pcSeqRes); + +extern void +SeqSwap(mseq_t *mseq, int i, int j); + +extern void +DealignMSeq(mseq_t *mseq); + +extern const char * +SeqTypeToStr(int seqtype); + +extern int +ReadSequences(mseq_t *prMSeq_p, char *pcSeqFile, int iSeqType, + int iMaxNumSeq, int iMaxSeqLen); + +extern void +NewMSeq(mseq_t **mseq); + +extern void +FreeMSeq(mseq_t **mseq); + +extern void +CopyMSeq(mseq_t **prMSeqDest_p, mseq_t *prMSeqSrc); + +extern void +LogSqInfo(SQINFO *sqinfo); + +extern int +FindSeqName(char *seqname, mseq_t *mseq); + +extern int +WriteAlignment(mseq_t *mseq, const char *aln_outfile, int msafile_format); + +extern void +DealignSeq(char *seq); + +extern void +ShuffleMSeq(mseq_t *prMSeq); + +extern void +SortMSeqByLength(mseq_t *prMSeq, const char cOrder); + +void +JoinMSeqs(mseq_t **prMSeqDest_p, mseq_t *prMSeqToAdd); + +bool +SeqsAreAligned(mseq_t *prMSeq); + +#endif |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/clustal/symmatrix.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/clustal/symmatrix.c Thu Jul 21 13:35:08 2011 -0400 |
[ |
b'@@ -0,0 +1,496 @@\n+/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n+\n+/*********************************************************************\n+ * Clustal Omega - Multiple sequence alignment\n+ *\n+ * Copyright (C) 2010 University College Dublin\n+ *\n+ * Clustal-Omega is free software; you can redistribute it and/or\n+ * modify it under the terms of the GNU General Public License as\n+ * published by the Free Software Foundation; either version 2 of the\n+ * License, or (at your option) any later version.\n+ *\n+ * This file is part of Clustal-Omega.\n+ *\n+ ********************************************************************/\n+\n+/*\n+ * RCS $Id: symmatrix.c 230 2011-04-09 15:37:50Z andreas $\n+ *\n+ *\n+ * Functions for symmetric (square) matrices including diagonal.\n+ * supports the notion of non-square sub-matrices of a symmetric\n+ * matrix, i.e. where |rows|<|cols|.\n+ *\n+ * FIXME Allocating one big chunk of memory is probably\n+ * much faster and also easier to maintain.\n+ */\n+\n+#ifdef HAVE_CONFIG_H\n+#include "config.h"\n+#endif\n+\n+#include <stdlib.h>\n+#include <stdio.h>\n+#include <ctype.h>\n+#include <string.h>\n+#include <assert.h>\n+#include "symmatrix.h"\n+\n+\n+#if 0\n+#define DEBUG\n+#endif\n+\n+#define MAX_BUF_SIZE 65536\n+\n+/**\n+ * @brief Allocates symmat and its members and initialises them. Data\n+ * will be calloced, i.e. initialised with zeros.\n+ *\n+ * @param[out] symmat\n+ * newly allocated and initialised symmatrix instance\n+ * @param[in] nrows\n+ * number of rows\n+ * @param[in]\n+ * ncols number of columns\n+ *\n+ * @return: non-zero on error\n+ *\n+ * @see FreeSymMatrix()\n+ *\n+ * @note: symmat data will be of fake shape nrows x ncols\n+ *\n+ */\n+int\n+NewSymMatrix(symmatrix_t **symmat, int nrows, int ncols)\n+{\n+ int i; /* aux */\n+ \n+ assert(nrows>0 && ncols>0 && ncols>=nrows);\n+ assert(ncols>0 && ncols>=nrows);\n+\n+ (*symmat) = (symmatrix_t *) malloc(1*sizeof(symmatrix_t));\n+ if (NULL == (*symmat)) {\n+ fprintf(stderr, "Couldn\'t allocate memory (%s|%s)\\n",\n+ __FILE__, __FUNCTION__);\n+ return -1;\n+ }\n+ \n+ (*symmat)->data = (double **) malloc(nrows * sizeof(double *));\n+ if (NULL == (*symmat)->data) {\n+ fprintf(stderr, "Couldn\'t allocate memory (%s|%s)\\n",\n+ __FILE__, __FUNCTION__);\n+ free(*symmat);\n+ *symmat = NULL;\n+ return -1;\n+ }\n+ for (i=0; i<nrows; i++) {\n+ (*symmat)->data[i] = (double *) calloc((ncols-i), sizeof(double));\n+ if (NULL == (*symmat)->data[i]) {\n+ fprintf(stderr, "Couldn\'t allocate memory (%s|%s)\\n",\n+ __FILE__, __FUNCTION__); \n+ while (0!=--i) {\n+ free((*symmat)->data[i]);\n+ } \n+ free((*symmat)->data);\n+ free(*symmat);\n+ *symmat = NULL;\n+ return -1;\n+ }\n+#ifdef TRACE\n+ fprintf(stderr, "DEBUG(%s|%s():%d) initialising symmat with the number of the beast\\n",\n+ __FILE__, __FUNCTION__, __LINE__);\n+ {\n+ int j;\n+ for (j=0; j<ncols-i; j++) {\n+ (*symmat)->data[i][j] = -666.0;\n+ }\n+\n+ }\n+#endif\n+ }\n+ \n+ (*symmat)->nrows = nrows;\n+ (*symmat)->ncols = ncols;\n+\n+ return 0;\n+}\n+/*** end: new_symmatrix ***/\n+\n+\n+/**\n+ * @brief Sets symmat data of given index to given value\n+ *\n+ * @param[in] symmat\n+ * symmatrix_t whose data is to be set\n+ * @param[in] i\n+ * first index \n+ * @param[in] j\n+ * second index \n+ * @param[in] value\n+ * value used to set data point\n+ *\n+ * @see SymMatrixGetValue()\n+ *\n+ * @note This is a convenience function that checks index order.\n+ *\n+ */\n+void\n+SymMatrixSetValue(symmatrix_t *symmat, const int i, const int j, const double value)\n+{\n+ assert(NULL != symmat);\n+\n+ if (i<=j) {\n+ assert(i < symmat->nrows && j < symmat->ncols);\n+ symmat->data[i][j-i] = value;\n+ } else {\n+ assert(j < symmat->nrows && i < symmat->nc'..b's for reading\\n", pcFileIn);\n+ free(buf);\n+ return -1;\n+ }\n+ \n+ /* get number of sequences from first line and allocate memory for\n+ * distance matrix\n+ *\n+ */\n+ if (NULL == fgets(buf, MAX_BUF_SIZE, prFilePointer) ) {\n+ fprintf(stderr, "Couldn\'t read first line from %s\\n", pcFileIn);\n+ iRetCode = -1;\n+ goto closefile_and_freebuf;\n+ }\n+ if (strlen(buf)==MAX_BUF_SIZE-1) {\n+ fprintf(stderr, "%s\\n", "Looks like I couldn\'t read complete line. Wrong format (or too small MAX_BUF_SIZE)");\n+ iRetCode = -1;\n+ goto closefile_and_freebuf;\n+ }\n+ if (sscanf(buf, "%d", &iTotalNSeq)!=1) {\n+ fprintf(stderr, "ERROR: couldn\'t parse number of sequences from first line of %s\\n", pcFileIn); \n+ iRetCode = -1;\n+ goto closefile_and_freebuf;\n+ }\n+\n+#if TRACE\n+ Log(&rLog, LOG_FORCED_DEBUG, "iTotalNSeq parsed from %s is %d\\n", pcFileIn, iTotalNSeq);\n+#endif\n+ \n+ if (NewSymMatrix(prSymMat_p, iTotalNSeq, iTotalNSeq)) {\n+ fprintf(stderr, "FATAL %s", "Memory allocation for distance matrix failed");\n+ iRetCode = -1;\n+ goto closefile_and_freebuf;\n+ }\n+\n+\n+ /* parse file line by line\n+ *\n+ */\n+ while (NULL != fgets(buf, MAX_BUF_SIZE, prFilePointer)) {\n+ char *szToken;\n+ int is_newseq;\n+\n+ if (MAX_BUF_SIZE-1 == strlen(buf)) {\n+ fprintf(stderr, "%s\\n", "Looks like I couldn\'t read complete line. Wrong format (or too small MAX_BUF_SIZE)");\n+ iRetCode = -1;\n+ goto closefile_and_freebuf;\n+ }\n+\n+#ifdef DEBUG\n+ Log(&rLog, LOG_FORCED_DEBUG, "Got line: %s\\n", buf);\n+#endif\n+\n+ /* new sequence label at beginning of line?\n+ */\n+ if (isblank(buf[0])) {\n+ is_newseq = 0;\n+ } else {\n+ is_newseq = 1;\n+ }\n+\n+ /* tokenise line and treat new sequence specially\n+ */\n+ szToken = strtok(buf, " \\t");\n+ if (is_newseq==1) {\n+ iNParsedSeq++;\n+ iNParsedDists=0;\n+\n+ /* if format is lower dimensional matrix then first\n+ * sequence has no distances but might have newline\n+ * character at it\'s end.\n+ */\n+ while (isspace(szToken[strlen(szToken)-1])) {\n+ szToken[strlen(szToken)-1]=\'\\0\';\n+ }\n+ /* FIXME save label? */\n+ szToken = strtok(NULL, " \\t");\n+ }\n+ /* from here on it\'s only parsing of distances */\n+ while (szToken != NULL) {\n+ double dist;\n+ iNParsedDists++;\n+\n+ /* only parse what\'s needed */\n+ if (iNParsedDists!=iNParsedSeq) {\n+ /* parse and store distance\n+ */\n+ if (sscanf(szToken, "%lf", &dist)!=1) {\n+ fprintf(stderr, "Couldn\'t parse float from entry \'%s\'\\n", szToken);\n+ iRetCode = -1;\n+ goto closefile_and_freebuf;\n+ }\n+#if TRACE\n+ Log(&rLog, LOG_FORCED_DEBUG, "Parsed distance %d for seq %d = %f\\n", iNParsedDists-1, iNParsedSeq-1, dist);\n+#endif\n+ SymMatrixSetValue(*prSymMat_p, iNParsedSeq-1, iNParsedDists-1, dist);\n+ SymMatrixSetValue(*prSymMat_p, iNParsedDists-1, iNParsedSeq-1, dist);\n+ }\n+ szToken = strtok(NULL, " \\t");\n+ } \n+ }\n+\n+ if (iTotalNSeq!=iNParsedSeq) {\n+ fprintf(stderr, "expected %d seqs, but only parsed %d\\n", iTotalNSeq, iNParsedSeq);\n+ iRetCode = -1;\n+ goto closefile_and_freebuf;\n+ }\n+#if TRACE\n+ for (i=0; i<iNParsedSeq; i++) {\n+ int j;\n+ for (j=0; j<iNParsedSeq; j++) {\n+ Log(&rLog, LOG_FORCED_DEBUG, "prSymMat_p[%d][%d]=%f\\n", i, j, (*prSymMat_p)[i][j]);\n+ }\n+ }\n+#endif\n+\n+closefile_and_freebuf:\n+ fclose(prFilePointer);\n+ free(buf);\n+ \n+ return iRetCode;\n+}\n+/*** end: SymMatrixRead ***/\n+\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/clustal/symmatrix.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/clustal/symmatrix.h Thu Jul 21 13:35:08 2011 -0400 |
[ |
@@ -0,0 +1,80 @@ +/********************************************************************* + * Clustal Omega - Multiple sequence alignment + * + * Copyright (C) 2010 University College Dublin + * + * Clustal-Omega is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This file is part of Clustal-Omega. + * + ********************************************************************/ + +/* + * RCS $Id: symmatrix.h 216 2011-03-19 10:11:53Z andreas $ + */ + +/** + * Functions for symmetric (square) matrices including diagonal. + * + * Supports the notion of non-square sub-matrices of a symmetric + * matrix, i.e. where |rows|<|cols| and the corresponding full matrix + * would be |cols|x|cols| + * + * Instead of making this one big chunk of memory we keep pointers to + * pointers, so that we can easily realloc (the project where this file + * originated from needed this for growing a "seed" matrix). + * + * FIXME Allocating one big chunk of memory is probably + * much faster and also easier to maintain. + * + * + */ + +#ifndef CLUSTALO_SYMMATRIX_H +#define CLUSTALO_SYMMATRIX_H + + +/** + * @brief symmetric matrix structure + */ +typedef struct { + int nrows; /**< number of rows */ + int ncols; /**< number of columns */ + /** + * stored data + * + * @note indices range: [i][j-i] i<=j. use getvalue() and + * setvalue() instead of accessing directly + * + * @see SymMatrixGetValue(), SymMatrixSetValue() + */ + double **data; +} symmatrix_t; + + + +extern int +NewSymMatrix(symmatrix_t **symmat, const int nrows, const int ncols); + +extern void +SymMatrixSetValue(symmatrix_t *symmat, const int i, const int j, const double value); + +extern double +SymMatrixGetValue(symmatrix_t *symmat, const int i, const int j); + +extern void +SymMatrixGetValueP(double **value, symmatrix_t *symmat, const int i, const int j); + +extern void +FreeSymMatrix(symmatrix_t **symmat); + +extern void +SymMatrixPrint(symmatrix_t *symmat, char **labels, const char *path); + +extern int +SymMatrixRead(char *pcFileIn, symmatrix_t **prSymMat_p); + +#endif |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/clustal/tree.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/clustal/tree.c Thu Jul 21 13:35:08 2011 -0400 |
[ |
@@ -0,0 +1,234 @@ +/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ + +/********************************************************************* + * Clustal Omega - Multiple sequence alignment + * + * Copyright (C) 2010 University College Dublin + * + * Clustal-Omega is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This file is part of Clustal-Omega. + * + ********************************************************************/ + +/* + * RCS $Id: tree.c 230 2011-04-09 15:37:50Z andreas $ + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <stdlib.h> +#include <string.h> +#include <assert.h> + +#include "util.h" +#include "log.h" +#include "muscle_upgma.h" +#include "tree.h" + +/** + * + * @brief Creates a UPGMA guide tree. This is a frontend function to + * the ported Muscle UPGMA code (). + * + * @param[out] tree + * created upgma tree. will be allocated here. use FreeMuscleTree() + * to free + * @param[in] labels + * pointer to nseq sequence names + * @param[in] distmat + * distance matrix + * @param[in] ftree + * optional: if non-NULL, tree will be written to this files + * + * @see FreeMuscleTree() + * @see MuscleUpgma2() + * + */ +void +GuideTreeUpgma(tree_t **tree, char **labels, + symmatrix_t *distmat, char *ftree) +{ + linkage_t linkage = LINKAGE_AVG; + FILE *fp = NULL; + + if (NULL != ftree) { + if (NULL == (fp=fopen(ftree, "w"))) { + Log(&rLog, LOG_ERROR, "Couldn't open tree-file '%s' for writing. Skipping", ftree); + } + /* fp NULL is handled later */ + } + + (*tree) = (tree_t *) CKMALLOC(1 * sizeof(tree_t)); + MuscleUpgma2((*tree), distmat, linkage, labels); + + if (rLog.iLogLevelEnabled <= LOG_DEBUG) { + Log(&rLog, LOG_DEBUG, "tree logging..."); + LogTree((*tree), LogGetFP(&rLog, LOG_DEBUG)); + } + + if (NULL != fp) { + MuscleTreeToFile(fp, (*tree)); + Log(&rLog, LOG_INFO, "Guide tree written to %s", ftree); + fclose(fp); + } +} +/*** end: guidetree_upgma ***/ + + + +/** + * + * @brief + * + * @param[out] tree + * created upgma tree. will be allocated here. use FreeMuscleTree() + * to free + * @param[in] mseq + * @param[in] ftree + * + * @return non-zero on error + * + */ +int +GuideTreeFromFile(tree_t **tree, mseq_t *mseq, char *ftree) +{ + int iNodeCount; + int iNodeIndex; + + (*tree) = (tree_t *) CKMALLOC(1 * sizeof(tree_t)); + if (MuscleTreeFromFile((*tree), ftree)!=0) { + Log(&rLog, LOG_ERROR, "%s", "MuscleTreeFromFile failed"); + return -1; + } + + /* Make sure tree is rooted */ + if (!IsRooted((*tree))) { + Log(&rLog, LOG_ERROR, "User tree must be rooted"); + return -1; + } + + if ((int)GetLeafCount((*tree)) != mseq->nseqs) { + Log(&rLog, LOG_ERROR, "User tree does not match input sequences"); + return -1; + } + + /* compare tree labels and sequence names and set leaf-ids */ + iNodeCount = GetNodeCount((*tree)); + for (iNodeIndex = 0; iNodeIndex < iNodeCount; ++iNodeIndex) { + char *LeafName; + int iSeqIndex; + + if (!IsLeaf(iNodeIndex, (*tree))) + continue; + LeafName = GetLeafName(iNodeIndex, (*tree)); + + if ((iSeqIndex=FindSeqName(LeafName, mseq))==-1) { + Log(&rLog, LOG_ERROR, "Label '%s' in tree could not be found in sequence names", LeafName); + return -1; + } + + SetLeafId((*tree), iNodeIndex, iSeqIndex); + } + + if (rLog.iLogLevelEnabled <= LOG_DEBUG) { + Log(&rLog, LOG_DEBUG, "tree logging..."); + LogTree((*tree), LogGetFP(&rLog, LOG_DEBUG)); + } + + return 0; +} +/*** end: GuideTreeFromFile() ***/ + + + +/** + * + * @brief Depth first traversal of tree, i.e. leaf nodes (sequences) + * will be visited first. Order can be used to guide progressive + * alignment order. + * + * @param[out] piOrderLR_p + * order in which left/right nodes (profiles) are to be aligned. + * allocated here; caller must free. + * @param[in] tree + * The tree to traverse; has to be rooted + * @param[in] mseq + * corresponding multiple sequence structure + * + */ +void +TraverseTree(int **piOrderLR_p, + tree_t *tree, mseq_t *mseq) +{ + int tree_nodeindex = 0; + int order_index = 0; + + assert(NULL!=tree); + assert(NULL!=mseq); + assert(IsRooted(tree)); + + /* allocate memory for node/profile alignment order; + * for every node allocate DIFF_NODE (3) int (1 left, 1 right, 1 parent) + */ + *piOrderLR_p = (int *)CKCALLOC(DIFF_NODE * GetNodeCount(tree), sizeof(int)); + + /* Log(&rLog, LOG_FORCED_DEBUG, "print tree->m_iNodeCount=%d", tree->m_iNodeCount); */ + + + tree_nodeindex = FirstDepthFirstNode(tree); + /*LOG_DEBUG("Starting with treenodeindex = %d", tree_nodeindex);*/ + + order_index = 0; + + do { + if (IsLeaf(tree_nodeindex, tree)) { + int leafid = GetLeafId(tree_nodeindex, tree); + if (leafid >= mseq->nseqs) + Log(&rLog, LOG_FATAL, "Sequence index out of range during tree traversal (leafid=%d nseqs=%d)", + leafid, mseq->nseqs); + + /* this is a leaf node, + * indicate this by registering same leafid for left/right + */ + + (*piOrderLR_p)[DIFF_NODE*order_index+LEFT_NODE] = leafid; + (*piOrderLR_p)[DIFF_NODE*order_index+RGHT_NODE] = leafid; + (*piOrderLR_p)[DIFF_NODE*order_index+PRNT_NODE] = tree_nodeindex; + + Log(&rLog, LOG_DEBUG, "Tree traversal: Visited leaf-node %d (leaf-id %d = Seq '%s')", + tree_nodeindex, leafid, mseq->sqinfo[leafid].name); + + } else { + int merge_nodeindex; + int left; + int right; + + merge_nodeindex = tree_nodeindex; + left = GetLeft(tree_nodeindex, tree); + right = GetRight(tree_nodeindex, tree); + + /* this is not a leaf node but a merge node, + * register left node (even) and right node (odd) + */ + (*piOrderLR_p)[DIFF_NODE*order_index+LEFT_NODE] = left; + (*piOrderLR_p)[DIFF_NODE*order_index+RGHT_NODE] = right; + (*piOrderLR_p)[DIFF_NODE*order_index+PRNT_NODE] = merge_nodeindex; + + Log(&rLog, LOG_DEBUG, "Tree traversal: Visited non-leaf node %d with siblings %d (L) and %d (R)", + merge_nodeindex, left, right); + } + tree_nodeindex = NextDepthFirstNode(tree_nodeindex, tree); + + order_index++; + + } while (NULL_NEIGHBOR != tree_nodeindex); + + return; +} +/*** end: TraverseTree ***/ |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/clustal/tree.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/clustal/tree.h Thu Jul 21 13:35:08 2011 -0400 |
b |
@@ -0,0 +1,40 @@ +/********************************************************************* + * Clustal Omega - Multiple sequence alignment + * + * Copyright (C) 2010 University College Dublin + * + * Clustal-Omega is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This file is part of Clustal-Omega. + * + ********************************************************************/ + +/* + * RCS $Id: tree.h 193 2011-02-07 15:45:21Z andreas $ + */ + +#ifndef CLUSTALO_TREE_H +#define CLUSTALO_TREE_H + +#include "symmatrix.h" +#include "muscle_tree.h" +#include "seq.h" + +enum {LEFT_NODE = 0, RGHT_NODE, PRNT_NODE, DIFF_NODE}; + +extern void +GuideTreeUpgma(tree_t **tree, + char **labels, symmatrix_t *tmat, char *ftree); + +extern int +GuideTreeFromFile(tree_t **tree, + mseq_t *mseq, char *ftree); + +extern void +TraverseTree(int **piOrderLR_p, + tree_t *tree, mseq_t *mseq); + +#endif |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/clustal/util.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/clustal/util.c Thu Jul 21 13:35:08 2011 -0400 |
[ |
b'@@ -0,0 +1,505 @@\n+/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n+\n+/*********************************************************************\n+ * Clustal Omega - Multiple sequence alignment\n+ *\n+ * Copyright (C) 2010 University College Dublin\n+ *\n+ * Clustal-Omega is free software; you can redistribute it and/or\n+ * modify it under the terms of the GNU General Public License as\n+ * published by the Free Software Foundation; either version 2 of the\n+ * License, or (at your option) any later version.\n+ *\n+ * This file is part of Clustal-Omega.\n+ *\n+ ********************************************************************/\n+\n+/*\n+ * RCS $Id: util.c 235 2011-04-13 14:13:19Z andreas $\n+ */\n+\n+#ifdef HAVE_CONFIG_H\n+#include "config.h"\n+#endif\n+\n+#include <stdio.h>\n+#include <stdlib.h>\n+#include <string.h>\n+#include <assert.h>\n+#include <time.h>\n+\n+#include "log.h"\n+#include "util.h"\n+\n+\n+\n+\n+/* struct for QSortAndTrackIndex and SortAndTrackIndexCmp[Asc|Desc] */\n+typedef struct {\n+ int piIndex;\n+ int piValue;\n+} sortwithindex_t;\n+\n+\n+\n+\n+/**\n+ * @brief Copy of squid\'s FileExists(). Copied here to make squid independent.\n+ */\n+int\n+CheckIfFileExists(char *pcFilename)\n+{\n+ FILE *prFile;\n+ if ((prFile = fopen(pcFilename, "r"))) { \n+ fclose(prFile);\n+ return TRUE; \n+ }\n+ return FALSE;\n+}\n+/* end of CheckIfFileExists */\n+\n+\n+/**\n+ * @brief Allocates memory (malloc)\n+ *\n+ * @param[in] bytes\n+ * bytes to allocated\n+ * @param[in] function\n+ * calling function name\n+ * @param[in] line\n+ * calling function line\n+ *\n+ * @return void pointer to the newly allocated memory\n+ *\n+ * @note use provided macro CKMALLOC() which automatically adds\n+ * function name and line number\n+ *\n+ */\n+void *\n+CkMalloc(size_t bytes, const char *function, const int line)\n+{\n+ void *ret;\n+ \n+ if(NULL == (ret = malloc(bytes * sizeof(char)))) {\n+ Log(&rLog, LOG_FATAL, "Out of memory (requested from %s:%d)\\n", function, line);\n+ }\n+\n+ return ret; \n+}\n+/*** end: ckmalloc ***/\n+\n+\n+\n+/**\n+ * @brief Allocates memory (calloc). Memory will be\n+ * set to zero.\n+ *\n+ * @param[in] count\n+ * Allocate space for count objects\n+ * @param[in] size\n+ * Objects are of this size\n+ * @param[in] function\n+ * calling function name\n+ * @param[in] line\n+ * calling function line\n+ *\n+ * @return void pointer to the newly allocated and zeroed memory (calloc).\n+ *\n+ * @note use provided macro CKCALLOC() which automatically adds\n+ * function name and line number\n+ *\n+ *\n+ */\n+void *\n+CkCalloc(size_t count, size_t size, const char *function, const int line)\n+{\n+ void *ret;\n+ \n+ if(NULL == (ret = calloc(count, size))) {\n+ Log(&rLog, LOG_FATAL, "Out of memory (requested from %s:%d)\\n",\n+ function, line);\n+ exit(EXIT_FAILURE);\n+ }\n+ \n+ return ret; \n+}\n+/*** end: CkCalloc ***/\n+\n+\n+/**\n+* @brief Reallocates memory\n+ *\n+ * @param[in] ptr\n+ * Pointer to memory to be reallocated\n+ * @param[in] bytes\n+ * bytes to allocated\n+ * @param[in] function\n+ * calling function name\n+ * @param[in] line\n+ * calling function line\n+ *\n+ * @return void pointer to the newly allocated memory\n+ *\n+ * @note use provided macro CKREALLOC() which automatically adds\n+ * function name and line number \n+ *\n+ */\n+void *\n+CkRealloc(void *ptr, size_t bytes, const char *function, const int line)\n+{\n+ void *ret=NULL;\n+\n+ if(NULL == (ret = realloc(ptr, bytes))) {\n+ Log(&rLog, LOG_FATAL, "FATAL: Out of memory (requested from %s:%d)\\n",\n+ function, line);\n+ }\n+\n+ return ret; \n+}\n+/*** end: ckrealloc ***/\n+\n+\n+\n+/**\n+ *\n+ * @brief Frees memory\n+ *\n+ * @param[in] ptr\n+ * Pointer to memory to be freed\n+ * @param[in] function\n+ * calling function name\n+ * @param[in] line\n+ * calling function line\n+ *\n+ * @return void pointer to the now zeroed memory\n+ *\n+ * @note use provided macro CKFREE()\n+ *\n+ */\n+void *\n+CkFree(void *ptr, const char *function, const int line)\n+{\n+ if (ptr '..b'n the int value of the 2nd sortwithindex_t and the\n+ * 1st. Used for descending sort order in QSortWithIndexes()\n+ *\n+ * @see SortAndTrackIndexCmpDesc() and QSortAndTrackIndex()\n+ */\n+int\n+SortAndTrackIndexCmpDesc(const void *a, const void *b)\n+{\n+ const sortwithindex_t *a_t = (const sortwithindex_t *)a;\n+ const sortwithindex_t *b_t = (const sortwithindex_t *)b;\n+ \n+ const int ia = (const int) a_t->piValue;\n+ const int ib = (const int) b_t->piValue;\n+ return ib - ia;\n+}\n+/*** end: SortAndTrackIndexCmpDesc ***/\n+\n+\n+\n+\n+/**\n+ * @brief Sort a given int array in ascending or descending order,\n+ * while keeping track of the element order.\n+ *\n+ * @param[out] piSortedIndices\n+ * Will contain the indices of the sorted elements. Has to be preallocated.\n+ * @param[out] piArrayToSort\n+ * Array with values to sort. Will only be overwritten if\n+ * bOverwriteArrayToSort it true.\n+ * @param[in] iArrayLen\n+ * Number of elements in piArrayToSort.\n+ * @param[in] cOrder\n+ * Sort order. \'a\' for ascending, \'d\' for descending.\n+ * @param[in] bOverwriteArrayToSort\n+ * If false do not overwrite the array to sort.\n+ *\n+ */ \n+void\n+QSortAndTrackIndex(int *piSortedIndices, int *piArrayToSort,\n+ const int iArrayLen, const char cOrder,\n+ const bool bOverwriteArrayToSort)\n+{\n+ int iCtr; /**< aux */\n+ \n+ sortwithindex_t *prSort;\n+\n+ \n+ assert(NULL!=piSortedIndices);\n+ assert(iArrayLen>0);\n+ assert(NULL!=piArrayToSort);\n+ assert(\'a\'==cOrder || \'d\'==cOrder);\n+\n+ prSort = (sortwithindex_t *) CKMALLOC(iArrayLen * sizeof(sortwithindex_t));\n+ \n+ for (iCtr=0; iCtr<iArrayLen; iCtr++) {\n+ prSort[iCtr].piIndex = iCtr;\n+ prSort[iCtr].piValue = piArrayToSort[iCtr];\n+#if 0\n+ LOG_DEBUG("b4 sort: prSort idx %d = val %d",\n+ prSort[iCtr].piIndex, prSort[iCtr].piValue);\n+#endif\n+ }\n+\n+ if (\'a\'==cOrder) {\n+ qsort(prSort, iArrayLen, sizeof(sortwithindex_t), SortAndTrackIndexCmpAsc);\n+ } else if (\'d\'==cOrder) {\n+ qsort(prSort, iArrayLen, sizeof(sortwithindex_t), SortAndTrackIndexCmpDesc);\n+ } else {\n+ Log(&rLog, LOG_FATAL, "Internal error: unknown order %c", cOrder);\n+ }\n+\n+ for (iCtr=0; iCtr<iArrayLen; iCtr++) {\n+ piSortedIndices[iCtr] = prSort[iCtr].piIndex;\n+ \n+ if (bOverwriteArrayToSort) {\n+ piArrayToSort[iCtr] = prSort[iCtr].piValue;\n+ }\n+#if 0\n+ LOG_DEBUG("after sort: prSort idx %d = val %d",\n+ prSort[iCtr].piIndex, prSort[iCtr].piValue);\n+#endif\n+ }\n+ free(prSort);\n+ \n+ return; \n+}\n+/*** end: QSortWithIndexes() ***/\n+\n+\n+\n+\n+/**\n+ * @brief Test if file is writable. File may or may not exist.\n+ *\n+ * @param[in] pcFileName\n+ * Filename to check\n+ *\n+ * @return True if file is writable at the time of calling\n+ *\n+ */ \n+bool\n+FileIsWritable(char *pcFileName)\n+{\n+ bool bFileAlreadyExisted;\n+ FILE *prFilePointer;\n+ bool bIsWritable;\n+ \n+ if (0 != CheckIfFileExists(pcFileName)) {\n+ bFileAlreadyExisted = TRUE;\n+ } else {\n+ bFileAlreadyExisted = FALSE;\n+ }\n+\n+ if (NULL == (prFilePointer=fopen(pcFileName, "a"))) {\n+ bIsWritable = FALSE;\n+ } else {\n+ bIsWritable = TRUE;\n+ if (0 != fclose(prFilePointer)) {\n+ Log(&rLog, LOG_ERROR, "Couldn\'t close temporily created file %s. Expect trouble...");\n+ }\n+ }\n+ \n+#if 0\n+ LOG_DEBUG("%s existed?=%d writable=%d", pcFileName,\n+ (TRUE==bFileAlreadyExisted? 1 : 0),\n+ (TRUE==bIsWritable? 1:0));\n+#endif\n+ \n+ /* delete if file didn\'t exist before and was created here\n+ * temporarily\n+ */\n+ if (FALSE==bFileAlreadyExisted && TRUE==bIsWritable) {\n+ if (0 != remove(pcFileName)) {\n+ Log(&rLog, LOG_ERROR, "Removing of temporarily created file %s failed. Expect trouble...");\n+ }\n+ }\n+ return bIsWritable; \n+}\n+/*** end: FileIsWritable() ***/\n+\n+\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/clustal/util.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/clustal/util.h Thu Jul 21 13:35:08 2011 -0400 |
b |
@@ -0,0 +1,76 @@ +/********************************************************************* + * Clustal Omega - Multiple sequence alignment + * + * Copyright (C) 2010 University College Dublin + * + * Clustal-Omega is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This file is part of Clustal-Omega. + * + ********************************************************************/ + +/* + * RCS $Id: util.h 230 2011-04-09 15:37:50Z andreas $ + */ + +#include <limits.h> +#include <string.h> +#include <strings.h> +#include <stdarg.h> +#include <stdbool.h> + +#ifndef CLUSTALO_UTIL_H +#define CLUSTALO_UTIL_H + + +#define CKMALLOC(b) CkMalloc((b), __FUNCTION__, __LINE__) +#define CKCALLOC(c, s) CkCalloc((c), (s), __FUNCTION__, __LINE__) +#define CKREALLOC(p, b) CkRealloc((p), (b), __FUNCTION__, __LINE__) +#define CKFREE(b) ((b)=CkFree((b), __FUNCTION__, __LINE__)) + +#ifndef MAX +#define MAX(a,b) ((a)>(b)?(a):(b)) +#endif +#ifndef MIN +#define MIN(a,b) ((a)<(b)?(a):(b)) +#endif + +/* STR_EQ: strings are equal, case sensitive */ +#define STR_EQ(a,b) (strcmp((a),(b)) == 0) +/* STR_NC_EQ: strings are equal, ignoring case */ +#define STR_NC_EQ(a,b) (strcasecmp((a),(b)) == 0) + + +/* type boolean and false and true defined in stdbool.h */ +#ifndef TRUE +#define TRUE true +#endif +#ifndef FALSE +#define FALSE false +#endif + +/* clashes with hhalign +#define FAIL -1 +#define OK 0 +*/ + + + +/* don't use the following directly; use macros provided above instead + */ +void *CkMalloc(size_t size, const char *function, const int line); +void *CkCalloc(size_t count, size_t size, const char *function, const int line); +void *CkRealloc(void *ptr, size_t bytes, const char *function, const int line); +void *CkFree(void *ptr, const char *function, const int line); +char *CkStrdup(const char *s); +void PermutationArray(int **array, const int len); +void RandomUniqueIntArray(int *array, const int array_len, const int max_value); +int IntCmp(const void *a, const void *b); +bool FileIsWritable(char *pcFileName); +void QSortAndTrackIndex(int *piSortedIndices, int *piArrayToSort, + const int uArrayLen, const char cOrder, const bool bOverwriteArrayToSort); + +#endif |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/clustal/weights.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/clustal/weights.c Thu Jul 21 13:35:08 2011 -0400 |
[ |
b'@@ -0,0 +1,337 @@\n+/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n+\n+/* Module for deriving sequence weights from a tree. Largely based on\n+ * Bob Edgar\'s Muscle (mainly clwwt.cpp; version 3.7). Ported to pure\n+ * C. Most functions where apparently based on Clustal 1.8 anyway.\n+ *\n+ * Muscle\'s code is public domain and so is this code here.\n+ *\n+ * From http://www.drive5.com/muscle/license.htm:\n+ * """\n+ * MUSCLE is public domain software\n+ *\n+ * The MUSCLE software, including object and source code and\n+ * documentation, is hereby donated to the public domain.\n+ *\n+ * Disclaimer of warranty\n+ * THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,\n+ * EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION IMPLIED\n+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n+ * """\n+ *\n+ */\n+ \n+/*\n+ * RCS $Id: weights.c 231 2011-04-09 17:13:06Z andreas $\n+ */\n+\n+/*\n+ * Documentation from Muscle\n+ *\n+ * """\n+ * Compute weights by the CLUSTALW method.\n+ * Thompson, Higgins and Gibson (1994), CABIOS (10) 19-29;\n+ * see also CLUSTALW paper.\n+ * \n+ * Weights are computed from the edge lengths of a rooted tree.\n+ * \n+ * Define the strength of an edge to be its length divided by the number\n+ * of leaves under that edge. The weight of a sequence is then the sum\n+ * of edge strengths on the path from the root to the leaf.\n+ * \n+ * Example.\n+ * \n+ * 0.2\n+ * -----A 0.1\n+ * -x ------- B 0.7\n+ * --------y ----------- C\n+ * 0.3 ----------z\n+ * 0.4 -------------- D\n+ * 0.8\n+ * \n+ * Edge Length Leaves Strength\n+ * ---- ----- ------ --------\n+ * xy 0.3 3 0.1\n+ * xA 0.2 1 0.2\n+ * yz 0.4 2 0.2\n+ * yB 0.1 1 0.1\n+ * zC 0.7 1 0.7\n+ * zD 0.8 1 0.8\n+ * \n+ * Leaf Path Strengths Weight\n+ * ---- ---- --------- ------\n+ * A xA 0.2 0.2\n+ * B xy-yB 0.1 + 0.1 0.2\n+ * C xy-yz-zC 0.1 + 0.2 + 0.7 1.0\n+ * D xy-yz-zD 0.1 + 0.2 + 0.8 1.1\n+ * """\n+ *\n+ */\n+\n+#ifdef HAVE_CONFIG_H\n+#include "config.h"\n+#endif\n+\n+#include <assert.h>\n+#include "log.h"\n+#include "muscle_tree.h"\n+#include "weights.h"\n+\n+\n+/* \n+ #undef DEBUG \n+*/\n+\n+\n+/**\n+ * @brief FIXME\n+ *\n+ * @param[out] puLeavesUnderNode\n+ * FIXME\n+ * @param[in] prTree\n+ * FIXME\n+ * @param[in] uNodeIndex\n+ * FIXME\n+ *\n+ * @return The return value\n+ *\n+ * @note see Muscle3.7:clwwt.cpp\n+ * \n+ */ \n+uint\n+CountLeaves(uint *puLeavesUnderNode, tree_t *prTree, uint uNodeIndex)\n+{\n+ uint uLeft;\n+ uint uRight;\n+ uint uRightCount;\n+ uint uLeftCount;\n+ uint uCount;\n+\n+\n+ if (IsLeaf(uNodeIndex, prTree)) {\n+\t\tpuLeavesUnderNode[uNodeIndex] = 1;\n+\t\treturn 1;\n+ }\n+\n+ uLeft = GetLeft(uNodeIndex, prTree);\n+ uRight = GetRight(uNodeIndex, prTree);\n+ uRightCount = CountLeaves(puLeavesUnderNode, prTree, uRight);\n+ uLeftCount = CountLeaves(puLeavesUnderNode, prTree, uLeft);\n+ uCount = uRightCount + uLeftCount;\n+\n+ puLeavesUnderNode[uNodeIndex] = uCount;\n+ \n+ return uCount; \n+}\n+/*** end: CountLeaves() ***/\n+\n+\n+\n+\n+/**\n+ * @brief Normalise values in a double array to values between 0 and 1.\n+ *\n+ * @param[out] p\n+ * double array with n elements\n+ * @param[in] n\n+ * number of elements in p\n+ *\n+ * @note From Muscle3.7: intmath.cpp:Normalize()\n+ * \n+ */ \n+void\n+Normalise(double *p, uint n) {\n+ unsigned i;\n+ double dSum = 0.0;\n+ for (i = 0; i < n; ++i) {\n+ '..b'1 == uLeafCount) {\n+\t\t(*pdWeights_p)[0] = 1.0;\n+\t\treturn 0;\n+ } else if (2 == uLeafCount) {\n+\t\t(*pdWeights_p)[0] = 0.5;\n+\t\t(*pdWeights_p)[1] = 0.5;\n+\t\treturn 0;\n+ }\n+ \n+ if (!IsRooted(prTree)) {\n+ Log(&rLog, LOG_ERROR, "Tree must be rooted to get weights");\n+ CKFREE(pdWeights_p);\n+ return -1;\n+ }\n+\n+\n+#ifdef TRACE\n+ Log(&rLog, LOG_FORCED_DEBUG, "%s", "Weights follow");\n+ fprintf(stderr, "Node Leaves Length Strength\\n");\n+ fprintf(stderr, "---- ------ -------- --------\\n");\n+ /* 1234 123456 12345678 12345678 */\n+#endif\n+ \n+ uRootNodeIndex = GetRootNodeIndex(prTree);\n+ puLeavesUnderNode = (uint *) CKCALLOC(uNodeCount, sizeof(uint));\n+\n+ uLeavesUnderRoot = CountLeaves(puLeavesUnderNode, prTree, uRootNodeIndex);\n+\tif (uLeavesUnderRoot != uLeafCount) {\n+\t\tLog(&rLog, LOG_FATAL, "Internal error, root count %u %u",\n+ uLeavesUnderRoot, uLeafCount);\n+ }\n+#if 0\n+ for (uNodeIndex=0; uNodeIndex<uNodeCount; uNodeIndex++) {\n+ Log(&rLog, LOG_FORCED_DEBUG, "LeavesUnderNode[%d]=%d", uNodeIndex, puLeavesUnderNode[uNodeIndex]);\n+ }\n+#endif\n+\n+ pdStrengths = (double *) CKMALLOC(uNodeCount * sizeof(double));\n+ \n+ for (uNodeIndex=0; uNodeIndex < uNodeCount; uNodeIndex++) {\n+ uint uParent;\n+ double dLength;\n+ uint uLeaves;\n+ double dStrength;\n+ \n+ if (IsRoot(uNodeIndex, prTree)) {\n+ pdStrengths[uNodeIndex] = 0.0;\n+ continue;\n+ }\n+ \n+ uParent = GetParent(uNodeIndex, prTree);\n+ dLength = GetEdgeLength(uNodeIndex, uParent, prTree);\n+ uLeaves = puLeavesUnderNode[uNodeIndex];\n+ dStrength = dLength / (double) uLeaves;\n+ pdStrengths[uNodeIndex] = dStrength;\n+ \n+#ifdef TRACE\n+ fprintf(stderr, "%4u %6u %8g %8g\\n", uNodeIndex, uLeaves, dLength, dStrength);\n+#endif \n+ }\n+\n+\n+\n+\n+ \n+ if (bLogWeights){\n+ fprintf(stderr, "\\n");\n+ fprintf(stderr, " Seq Path..Weight\\n");\n+ fprintf(stderr, "-------------------- ------------\\n");\n+ }\n+\tfor (i=0; i<uLeafCount; i++) {\n+\t\tdouble dWeight = 0.0;\n+\t\tunsigned uLeafNodeIndex;\n+\t\tunsigned uNode;\n+\n+ uLeafNodeIndex = LeafIndexToNodeIndex(i, prTree);\n+ uNode = uLeafNodeIndex;\n+\n+ if (bLogWeights){\n+ fprintf(stderr, "%20.20s %4u ", GetLeafName(uLeafNodeIndex, prTree), uLeafNodeIndex);\n+ }\n+\t\tif (! IsLeaf(uLeafNodeIndex, prTree)) {\n+\t\t\tLog(&rLog, LOG_FATAL, \n+ "Internal error: non-leaf-node %d", uLeafNodeIndex);\n+ }\n+ \n+ /*LOG_DEBUG("dWeight = %f", dWeight);*/\n+\t\twhile (! IsRoot(uNode, prTree)) {\n+\t\t\tdWeight += pdStrengths[uNode];\n+ /*LOG_DEBUG("dWeight +== %f", pdStrengths[uNode]);*/\n+\t\t\tuNode = GetParent(uNode, prTree);\n+ if (bLogWeights){\n+ fprintf(stderr, "->%u(%g)", uNode, pdStrengths[uNode]);\n+ }\n+ }\n+ /* AW: no idea what this is, but it\'s done like this in Muscle */\n+\t\tif (dWeight < 0.0001) {\n+#ifdef TRACE\n+\t\t\tfprintf(stderr, "zero->one");\n+#endif\n+\t\t\tdWeight = 1.0;\n+ }\n+\n+ /* @note: the only difference to the muscle code is here: we\n+ * use the input index for storing weights, instead of the\n+ * tree leaf index\n+ */\n+ (*pdWeights_p)[GetLeafId(uLeafNodeIndex, prTree)] = dWeight;\n+ if (bLogWeights){\n+ fprintf(stderr, " = %g\\n", dWeight);\n+ }\n+ }\n+\n+#if 0\n+ for (i=0; i<uLeafCount; i++) {\n+ Log(&rLog, LOG_FORCED_DEBUG, "Weights before normalisation: pdWeights_p[%d]=%f", i, (*pdWeights_p)[i]);\n+ /*LOG_DEBUG("Should be %d", GetLeafId(LeafIndexToNodeIndex(i, prTree), prTree));*/\n+ }\n+#endif\n+\n+\tNormalise((*pdWeights_p), uLeafCount);\n+ \n+\n+ CKFREE(puLeavesUnderNode);\n+ CKFREE(pdStrengths);\n+ \n+ return 0;\n+}\n+/*** end: CalcWeights() ***/\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/clustal/weights.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/clustal/weights.h Thu Jul 21 13:35:08 2011 -0400 |
b |
@@ -0,0 +1,26 @@ +/********************************************************************* + * Clustal Omega - Multiple sequence alignment + * + * Copyright (C) 2010 University College Dublin + * + * Clustal-Omega is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This file is part of Clustal-Omega. + * + ********************************************************************/ + +/* + * RCS $Id: weights.h 193 2011-02-07 15:45:21Z andreas $ + */ + +#ifndef CLUSTALO_WEIGHTS_H +#define CLUSTALO_WEIGHTS_H + +extern int +CalcClustalWeights(double **pdWeights_p, tree_t *prTree); + + +#endif |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/clustalo-api-test.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/clustalo-api-test.c Thu Jul 21 13:35:08 2011 -0400 |
[ |
@@ -0,0 +1,102 @@ +/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ + +/********************************************************************* + * Clustal Omega - Multiple sequence alignment + * + * Copyright (C) 2010 University College Dublin + * + * Clustal-Omega is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This file is part of Clustal-Omega. + * + ********************************************************************/ + +/* + * RCS $Id: clustalo-api-test.c 213 2011-03-11 16:10:15Z andreas $ + */ + + +#include <stdio.h> + +/* Include clustal-omega's header. That's all you need + * + * If you developing in C++, use the following instead: + * extern "C" { + * #include "clustal-omega.h" + * } + */ +#include "clustal-omega.h" + + +int +main(int argc, char **argv) +{ + /* the multiple sequence structure */ + mseq_t *prMSeq = NULL; + /* for openmp: number of threads to use */ + int iThreads = 1; + /* alignment options to use */ + opts_t rAlnOpts; + /* an input file */ + char *pcSeqInfile; + int iAux; + + /* use LOGLEVEL_QUIET to make Clustal shut up */ + iVerbosityLevel = LOGLEVEL_INFO; + + SetDefaultAlnOpts(&rAlnOpts); + + InitClustalOmega(iThreads); + + /* Get sequence input file name from command line + */ + if (argc!=2) { + Fatal("Need sequence file as argument"); + } + pcSeqInfile = argv[1]; + + /* Read sequence file + */ + NewMSeq(&prMSeq); + if (ReadSequences(prMSeq, pcSeqInfile, + SEQTYPE_UNKNOWN, + INT_MAX, INT_MAX)) { + Fatal("Reading sequence file '%s' failed", pcSeqInfile); + } + + /* Dump some info about the sequences + */ + for (iAux=0; iAux<prMSeq->nseqs; iAux++) { + Info(LOGLEVEL_INFO, + "Sequence no %d has the following name: %s", + iAux, prMSeq->sqinfo[iAux].name); + Info(LOGLEVEL_INFO, + "Sequence no %d has the following residues: %s", + iAux, prMSeq->seq[iAux]); + /* more info can be found in prMSeq->sqinfo[iAux] */ + } + + + /* Align the sequences without a profile (NULL) + */ + if (Align(prMSeq, NULL, & rAlnOpts)) { + Fatal("A fatal error happended during the alignment process"); + } + + + /* Output of final alignment to stdout (NULL) as aligned fasta/a2m + */ + if (WriteAlignment(prMSeq, NULL, MSAFILE_A2M)) { + Fatal("Could not save alignment"); + } + + FreeMSeq(&prMSeq); + + Info(LOGLEVEL_INFO, "Successfull program exit"); + + return EXIT_SUCCESS; +} +/*** end of main() ***/ |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/config.h.in --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/config.h.in Thu Jul 21 13:35:08 2011 -0400 |
b |
@@ -0,0 +1,247 @@ +/* src/config.h.in. Generated from configure.ac by autoheader. */ + +/* Define if building universal (internal helper macro) */ +#undef AC_APPLE_UNIVERSAL_BUILD + +/* Let all files know they are being used inside Clustal Omega */ +#undef CLUSTALO + +/* This is a CYGWIN system */ +#undef CYGWIN + +/* This is a Darwin system */ +#undef DARWIN + +/* Define to 1 if you have the <argtable2.h> header file. */ +#undef HAVE_ARGTABLE2_H + +/* Define to 1 if you have the <assert.h> header file. */ +#undef HAVE_ASSERT_H + +/* Define to 1 if you have the <ctype.h> header file. */ +#undef HAVE_CTYPE_H + +/* Define to 1 if you have the <dlfcn.h> header file. */ +#undef HAVE_DLFCN_H + +/* Define to 1 if you have the <float.h> header file. */ +#undef HAVE_FLOAT_H + +/* Define to 1 if you have the `fseek64' function. */ +#undef HAVE_FSEEK64 + +/* Define to 1 if you have the `fseeko' function. */ +#undef HAVE_FSEEKO + +/* Define to 1 if you have the `fseeko64' function. */ +#undef HAVE_FSEEKO64 + +/* Define to 1 if you have the `ftell64' function. */ +#undef HAVE_FTELL64 + +/* Define to 1 if you have the `ftello' function. */ +#undef HAVE_FTELLO + +/* Define to 1 if you have the `ftello64' function. */ +#undef HAVE_FTELLO64 + +/* Define to 1 if you have the <inttypes.h> header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the `argtable2' library (-largtable2). */ +#undef HAVE_LIBARGTABLE2 + +/* Define to 1 if you have the `m' library (-lm). */ +#undef HAVE_LIBM + +/* Define to 1 if you have the <limits.h> header file. */ +#undef HAVE_LIMITS_H + +/* Has log2() */ +#undef HAVE_LOG2 + +/* Define to 1 if you have the <math.h> header file. */ +#undef HAVE_MATH_H + +/* Define to 1 if you have the <memory.h> header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the `ntohl' function. */ +#undef HAVE_NTOHL + +/* Define to 1 if you have the `ntohs' function. */ +#undef HAVE_NTOHS + +/* Define to 1 if you have the `ntonl' function. */ +#undef HAVE_NTONL + +/* Define to 1 if you have the `ntons' function. */ +#undef HAVE_NTONS + +/* Defined if OpenMP should and can be used */ +#undef HAVE_OPENMP + +/* Define to 1 if you have the <stdarg.h> header file. */ +#undef HAVE_STDARG_H + +/* Define to 1 if you have the <stdint.h> header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the <stdio.h> header file. */ +#undef HAVE_STDIO_H + +/* Define to 1 if you have the <stdlib.h> header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the <strings.h> header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the <string.h> header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the `stroul' function. */ +#undef HAVE_STROUL + +/* Define to 1 if you have the `strtoull' function. */ +#undef HAVE_STRTOULL + +/* Define to 1 if you have the <sys/stat.h> header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the <sys/types.h> header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the <time.h> header file. */ +#undef HAVE_TIME_H + +/* Define to 1 if you have the <unistd.h> header file. */ +#undef HAVE_UNISTD_H + +/* This is a LINUX system */ +#undef LINUX + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#undef LT_OBJDIR + +/* This is a MinGW system */ +#undef MINGW + +/* No-debug Mode */ +#undef NDEBUG + +/* Some strange OS */ +#undef OTHEROS + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* The package code name */ +#undef PACKAGE_CODENAME + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the home page for this package. */ +#undef PACKAGE_URL + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* The size of `fpos_t', as computed by sizeof. */ +#undef SIZEOF_FPOS_T + +/* The size of `unsigned int', as computed by sizeof. */ +#undef SIZEOF_UNSIGNED_INT + +/* The size of `unsigned long', as computed by sizeof. */ +#undef SIZEOF_UNSIGNED_LONG + +/* The size of `unsigned long long', as computed by sizeof. */ +#undef SIZEOF_UNSIGNED_LONG_LONG + +/* The size of `unsigned short', as computed by sizeof. */ +#undef SIZEOF_UNSIGNED_SHORT + +/* This is a Solaris system */ +#undef SOLARIS + +/* This is a BSD system */ +#undef SOMEBSD + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# undef _ALL_SOURCE +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# undef _GNU_SOURCE +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# undef _POSIX_PTHREAD_SEMANTICS +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# undef _TANDEM_SOURCE +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# undef __EXTENSIONS__ +#endif + + +/* Version number of package */ +#undef VERSION + +/* Define if using the dmalloc debugging malloc package */ +#undef WITH_DMALLOC + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +# undef WORDS_BIGENDIAN +# endif +#endif + +/* Define to 1 if on MINIX. */ +#undef _MINIX + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +#undef _POSIX_1_SOURCE + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +#undef _POSIX_SOURCE + +/* Define to empty if `const' does not conform to ANSI C. */ +#undef const + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +#undef inline +#endif + +/* Define to `long int' if <sys/types.h> does not define. */ +#undef off_t + +/* Define to `unsigned int' if <sys/types.h> does not define. */ +#undef size_t |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/hhalign/Makefile.am --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/hhalign/Makefile.am Thu Jul 21 13:35:08 2011 -0400 |
b |
@@ -0,0 +1,26 @@ +# Some useful automake documentation: +# http://www.openismus.com/documents/linux/automake/automake.shtml +# http://www.bioinf.uni-freiburg.de/~mmann/HowTo/automake.html + +#SUBDIRS = +#EXTRA_DIST = +# LDADD = foofiles/libfoo.a + +AM_CXXFLAGS = -fno-strict-aliasing -DCLUSTALO -DCLUSTALO_NOFILE -DDEFAULT_FILTER=90 @OPENMP_CXXFLAGS@ @AM_CXXFLAGS@ + +noinst_LTLIBRARIES = libhhalign.la + +libhhalign_la_SOURCES = hhalign.cpp hhalign.h \ + hash-C.h hash.h hhdecl-C.h hhfunc-C.h hhfunc.h \ + hhmatrices-C.h hhutil-C.h \ + hhalignment-C.h hhalignment.h \ + hhfullalignment-C.h hhfullalignment.h \ + hhhalfalignment-C.h hhhalfalignment.h \ + hhhit-C.h hhhit.h hhhitlist-C.h hhhitlist.h \ + hhhmm-C.h hhhmm.h \ + util-C.h list-C.h list.h \ + general.h + +library_includedir=$(includedir)/clustalo/hhalign + +library_include_HEADERS = general.h hhfunc.h |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/hhalign/Makefile.in --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/hhalign/Makefile.in Thu Jul 21 13:35:08 2011 -0400 |
[ |
b'@@ -0,0 +1,556 @@\n+# Makefile.in generated by automake 1.11.1 from Makefile.am.\n+# @configure_input@\n+\n+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,\n+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,\n+# Inc.\n+# This Makefile.in is free software; the Free Software Foundation\n+# gives unlimited permission to copy and/or distribute it,\n+# with or without modifications, as long as this notice is preserved.\n+\n+# This program is distributed in the hope that it will be useful,\n+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without\n+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A\n+# PARTICULAR PURPOSE.\n+\n+@SET_MAKE@\n+\n+# Some useful automake documentation:\n+# http://www.openismus.com/documents/linux/automake/automake.shtml\n+# http://www.bioinf.uni-freiburg.de/~mmann/HowTo/automake.html\n+\n+#SUBDIRS = \n+#EXTRA_DIST =\n+# LDADD = foofiles/libfoo.a\n+\n+\n+VPATH = @srcdir@\n+pkgdatadir = $(datadir)/@PACKAGE@\n+pkgincludedir = $(includedir)/@PACKAGE@\n+pkglibdir = $(libdir)/@PACKAGE@\n+pkglibexecdir = $(libexecdir)/@PACKAGE@\n+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd\n+install_sh_DATA = $(install_sh) -c -m 644\n+install_sh_PROGRAM = $(install_sh) -c\n+install_sh_SCRIPT = $(install_sh) -c\n+INSTALL_HEADER = $(INSTALL_DATA)\n+transform = $(program_transform_name)\n+NORMAL_INSTALL = :\n+PRE_INSTALL = :\n+POST_INSTALL = :\n+NORMAL_UNINSTALL = :\n+PRE_UNINSTALL = :\n+POST_UNINSTALL = :\n+build_triplet = @build@\n+host_triplet = @host@\n+subdir = src/hhalign\n+DIST_COMMON = $(library_include_HEADERS) $(srcdir)/Makefile.am \\\n+\t$(srcdir)/Makefile.in\n+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4\n+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_prefix_config_h.m4 \\\n+\t$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \\\n+\t$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \\\n+\t$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/ax_openmp.m4 \\\n+\t$(top_srcdir)/configure.ac\n+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \\\n+\t$(ACLOCAL_M4)\n+mkinstalldirs = $(install_sh) -d\n+CONFIG_HEADER = $(top_builddir)/src/config.h\n+CONFIG_CLEAN_FILES =\n+CONFIG_CLEAN_VPATH_FILES =\n+LTLIBRARIES = $(noinst_LTLIBRARIES)\n+libhhalign_la_LIBADD =\n+am_libhhalign_la_OBJECTS = hhalign.lo\n+libhhalign_la_OBJECTS = $(am_libhhalign_la_OBJECTS)\n+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src\n+depcomp = $(SHELL) $(top_srcdir)/depcomp\n+am__depfiles_maybe = depfiles\n+am__mv = mv -f\n+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \\\n+\t$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)\n+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \\\n+\t--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \\\n+\t$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)\n+CXXLD = $(CXX)\n+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \\\n+\t--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \\\n+\t$(LDFLAGS) -o $@\n+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \\\n+\t$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)\n+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \\\n+\t--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \\\n+\t$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)\n+CCLD = $(CC)\n+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \\\n+\t--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \\\n+\t$(LDFLAGS) -o $@\n+SOURCES = $(libhhalign_la_SOURCES)\n+DIST_SOURCES = $(libhhalign_la_SOURCES)\n+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed \'s|.|.|g\'`;\n+am__vpath_adj = case $$p in \\\n+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \\\n+ *) f=$$p;; \\\n+ esac;\n+am__strip_dir = f=`echo $$p | sed -e \'s|^.*/||\'`;\n+am__install_max = 40\n+am__nobase_strip_setup = \\\n+ srcdirstrip=`echo "$(srcdir)" | sed \'s/[].[^$$\\\\*|]/\\\\\\\\&/g\'`\n+am__nobase_strip = \\\n+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"\n+am__nobase_list = $(am__nobase_strip_setup); \\\n+ for p in $$lis'..b'lddir)/|;t"`; \\\n+\tcase $$dist_files in \\\n+\t */*) $(MKDIR_P) `echo "$$dist_files" | \\\n+\t\t\t sed \'/\\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,\' | \\\n+\t\t\t sort -u` ;; \\\n+\tesac; \\\n+\tfor file in $$dist_files; do \\\n+\t if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \\\n+\t if test -d $$d/$$file; then \\\n+\t dir=`echo "/$$file" | sed -e \'s,/[^/]*$$,,\'`; \\\n+\t if test -d "$(distdir)/$$file"; then \\\n+\t find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \\;; \\\n+\t fi; \\\n+\t if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \\\n+\t cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \\\n+\t find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \\;; \\\n+\t fi; \\\n+\t cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \\\n+\t else \\\n+\t test -f "$(distdir)/$$file" \\\n+\t || cp -p $$d/$$file "$(distdir)/$$file" \\\n+\t || exit 1; \\\n+\t fi; \\\n+\tdone\n+check-am: all-am\n+check: check-am\n+all-am: Makefile $(LTLIBRARIES) $(HEADERS)\n+installdirs:\n+\tfor dir in "$(DESTDIR)$(library_includedir)"; do \\\n+\t test -z "$$dir" || $(MKDIR_P) "$$dir"; \\\n+\tdone\n+install: install-am\n+install-exec: install-exec-am\n+install-data: install-data-am\n+uninstall: uninstall-am\n+\n+install-am: all-am\n+\t@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am\n+\n+installcheck: installcheck-am\n+install-strip:\n+\t$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \\\n+\t install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \\\n+\t `test -z \'$(STRIP)\' || \\\n+\t echo "INSTALL_PROGRAM_ENV=STRIPPROG=\'$(STRIP)\'"` install\n+mostlyclean-generic:\n+\n+clean-generic:\n+\n+distclean-generic:\n+\t-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)\n+\t-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)\n+\n+maintainer-clean-generic:\n+\t@echo "This command is intended for maintainers to use"\n+\t@echo "it deletes files that may require special tools to rebuild."\n+clean: clean-am\n+\n+clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \\\n+\tmostlyclean-am\n+\n+distclean: distclean-am\n+\t-rm -rf ./$(DEPDIR)\n+\t-rm -f Makefile\n+distclean-am: clean-am distclean-compile distclean-generic \\\n+\tdistclean-tags\n+\n+dvi: dvi-am\n+\n+dvi-am:\n+\n+html: html-am\n+\n+html-am:\n+\n+info: info-am\n+\n+info-am:\n+\n+install-data-am: install-library_includeHEADERS\n+\n+install-dvi: install-dvi-am\n+\n+install-dvi-am:\n+\n+install-exec-am:\n+\n+install-html: install-html-am\n+\n+install-html-am:\n+\n+install-info: install-info-am\n+\n+install-info-am:\n+\n+install-man:\n+\n+install-pdf: install-pdf-am\n+\n+install-pdf-am:\n+\n+install-ps: install-ps-am\n+\n+install-ps-am:\n+\n+installcheck-am:\n+\n+maintainer-clean: maintainer-clean-am\n+\t-rm -rf ./$(DEPDIR)\n+\t-rm -f Makefile\n+maintainer-clean-am: distclean-am maintainer-clean-generic\n+\n+mostlyclean: mostlyclean-am\n+\n+mostlyclean-am: mostlyclean-compile mostlyclean-generic \\\n+\tmostlyclean-libtool\n+\n+pdf: pdf-am\n+\n+pdf-am:\n+\n+ps: ps-am\n+\n+ps-am:\n+\n+uninstall-am: uninstall-library_includeHEADERS\n+\n+.MAKE: install-am install-strip\n+\n+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \\\n+\tclean-libtool clean-noinstLTLIBRARIES ctags distclean \\\n+\tdistclean-compile distclean-generic distclean-libtool \\\n+\tdistclean-tags distdir dvi dvi-am html html-am info info-am \\\n+\tinstall install-am install-data install-data-am install-dvi \\\n+\tinstall-dvi-am install-exec install-exec-am install-html \\\n+\tinstall-html-am install-info install-info-am \\\n+\tinstall-library_includeHEADERS install-man install-pdf \\\n+\tinstall-pdf-am install-ps install-ps-am install-strip \\\n+\tinstallcheck installcheck-am installdirs maintainer-clean \\\n+\tmaintainer-clean-generic mostlyclean mostlyclean-compile \\\n+\tmostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \\\n+\ttags uninstall uninstall-am uninstall-library_includeHEADERS\n+\n+\n+# Tell versions [3.59,3.63) of GNU make to not export all variables.\n+# Otherwise a system limit (for SysV at least) may be exceeded.\n+.NOEXPORT:\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/hhalign/general.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/hhalign/general.h Thu Jul 21 13:35:08 2011 -0400 |
[ |
@@ -0,0 +1,101 @@ +/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ + +/********************************************************************* + * Clustal Omega - Multiple sequence alignment + * + * Copyright (C) 2010 University College Dublin + * + * Clustal-Omega is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This file is part of Clustal-Omega. + * + ********************************************************************/ + +/* + * RCS $Id: general.h 247 2011-06-16 11:41:15Z fabian $ + */ + + +#ifndef GENERAL_H +#define GENERAL_H + + +#include "../clustal/log.h" + +/* +***** Omega definitions************************************ + FS, 2010-02-19 +*/ +enum {NO = 0, YES}; +enum {BASE10 = 10}; +enum {AMINOACIDS = 20, STATE_TRANSITIONS = 7}; +enum {MAXWORD = 100, MAXLEN = 10000}; +enum {OVER_ALLOCATE = 2}; +enum {FAILURE = -1, OK}; +enum {RETURN_OK = 0, RETURN_FROM_MAC, RETURN_FROM_VITERBI, RETURN_FROM_PRINT_ALI, RETURN_FROM_RNP, RETURN_UNKNOWN}; +enum {REALLY_BIG_MEMORY_MB = 64000}; +enum {F_OFFSET = 1}; +enum {INTERN_ALN_2_HMM = 0, READ_ALN_2_HMM, READ_HMM_2_HMM, INTERN_HMM_2_HMM}; +#define UNITY 1.00 + +/*#define MIN(a,b) ((a)<(b)?(a):(b))*/ + + +/* parameters passed from Clustal-Omega to hhalign; FS, r240 -> */ +typedef struct { + + int iMacRamMB; /* dedicated amount of RAM for Maximum Accuracy (in MB) */ + +} hhalign_para; + +typedef struct { + /***public***/ + int n_display; + char **sname; + char **seq; + int ncons; + int nfirst; + int nss_dssp; + int nsa_dssp; + int nss_pred; + int nss_conf; + int L; + int N_in; + int N_filtered; + float *Neff_M; + float *Neff_I; + float *Neff_D; + float Neff_HMM; + char *longname; + char name[511]; + char file[511]; + char fam[511]; + char sfam[511]; + char fold[511]; + char cl[511]; + float lamda; + float mu; + /***private***/ + float **f; + float **g; + float **p; + float **tr; + float **linTr; + char trans_lin; + char *ss_dssp; + char *sa_dssp; + char *ss_pred; + char *ss_conf; + char *Xcons; + float pav[20]; + float pnul[20]; + int *l; + +} hmm_light; + + +#endif + |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/hhalign/hash-C.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/hhalign/hash-C.h Thu Jul 21 13:35:08 2011 -0400 |
[ |
b'@@ -0,0 +1,594 @@\n+/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n+\n+/*********************************************************************\n+ * Clustal Omega - Multiple sequence alignment\n+ *\n+ * Copyright (C) 2010 University College Dublin\n+ *\n+ * Clustal-Omega is free software; you can redistribute it and/or\n+ * modify it under the terms of the GNU General Public License as\n+ * published by the Free Software Foundation; either version 2 of the\n+ * License, or (at your option) any later version.\n+ *\n+ * This file is part of Clustal-Omega.\n+ *\n+ ********************************************************************/\n+\n+/*\n+ * RCS $Id: hash-C.h 143 2010-10-14 13:11:14Z andreas $\n+ */\n+\n+// hash.C\n+// Class for Hash data structure \n+// * works in the same way as a hash in Perl\n+// * keys are strings of type char*\n+// * data elements are of type Typ \n+// * objects have to be declared with maximal size, e.g. Hash hash1(10000) (num_slots should not be a power of 2)\n+// * works also if maximal size is exceeded, but gets slower by a factor ~num_keys/num_slots \n+\n+/*\n+ * RCS $Id: hash-C.h 143 2010-10-14 13:11:14Z andreas $\n+ */\n+\n+#ifndef HASH\n+#define HASH\n+\n+#ifndef MAIN\n+#include <iostream> // cin, cout, cerr\n+#include <cstdio> // printf\n+#include <stdlib.h> // exit\n+#include <string> // strcmp, strstr\n+#include <math.h> // sqrt, pow\n+#include <limits.h> // INT_MIN\n+#include <float.h> // FLT_MIN\n+#include <ctype.h> // islower, isdigit etc\n+#include <time.h> // clock\n+#include <errno.h> // perror()\n+using std::cout;\n+using std::cerr;\n+using std::endl;\n+using std::ios;\n+using std::ifstream;\n+using std::ofstream;\n+#endif\n+\n+#ifndef JLIST\n+#define JLIST\n+#include "list.h" // List<Typ>\n+#include "list-C.h" ////////////////////////////////// DEBUG\n+#endif\n+\n+#include "hash.h"\n+\n+\n+\n+//////////////////////////////////////////////////////////////////////////////\n+////////////////////// Methods of class Hash /////////////////////////////////\n+//////////////////////////////////////////////////////////////////////////////\n+\n+//////////////////////////////////////////////////////////////////////////////\n+// Private Methods\n+\n+\n+//////////////////////////////////////////////////////////////////////////////\n+// Constructor and Destructor of Hash\n+//////////////////////////////////////////////////////////////////////////////\n+// Constructor of class Hash\n+//////////////////////////////////////////////////////////////////////////////\n+template<class Typ> \n+Hash<Typ>::Hash()\n+{\n+ num_keys=0; max_len=0; prev=curr=num_slots = 0; slot=NULL;\n+}\n+\n+template<class Typ> \n+Hash<Typ>::Hash(int nslots)\n+{\n+ num_keys=0; max_len=0; prev=curr=num_slots = nslots;\n+ slot = new Slot<Typ>*[num_slots]; //Create array of num_slots slots\n+ for (int i=0; i<num_slots; i++) slot[i]=NULL; //set pointers to NULL\n+ fail = static_cast<Typ>(0);\n+}\n+\n+template<class Typ> \n+Hash<Typ>::Hash(int nslots, Typ f)\n+{\n+ num_keys=0; max_len=0; prev=curr=num_slots = nslots;\n+ slot = new Slot<Typ>*[num_slots]; //Create array of num_slots slots\n+ for (int i=0; i<num_slots; i++) slot[i]=NULL; //set pointers to NULL\n+ fail=f;\n+}\n+\n+\n+////////////////////////////////////////////////////////////////////////////////////////////\n+// Destructor of class Hash\n+////////////////////////////////////////////////////////////////////////////////////////////\n+template<class Typ> \n+Hash<Typ>::~Hash()\n+{\n+ RemoveAll();\n+ delete[] slot; slot = NULL;\n+}\n+\n+\n+////////////////////////////////////////////////////////////////////////////////////////////\n+// Hash function\n+////////////////////////////////////////////////////////////////////////////////////////////\n+template<class Typ> \n+inline unsigned int Hash<Typ>::HashValue(char* key) //returns the hash value for key \n+ {\n+ // Calculate a hash value by the division method: \n+ // Transform '..b'/////////////////////////////////////////////////////////\n+// Methods that return usefull information about the data stored in Hash:\n+\n+\n+////////////////////////////////////////////////////////////////////////////////////////////\n+// Returns 1 if the hash contains key, 0 otherwise \n+////////////////////////////////////////////////////////////////////////////////////////////\n+template<class Typ> \n+int Hash<Typ>::Contains(char* key)\n+{\n+ Slot<Typ>* pslot;\n+ int i = HashValue(key);\n+\n+ pslot = slot[i];\n+ if (!pslot) return 0;\n+ pslot->Reset();\n+ do{\n+ if(!strcmp(pslot->ReadNext().key,key)) return 1;\n+ } while(!pslot->End());\n+ return 0;\n+}\n+\n+/////////////////////////////////////////////////////////////////////////////////////////////\n+//print out list of keys and data\n+/////////////////////////////////////////////////////////////////////////////////////////////\n+template<class Typ> \n+void Hash<Typ>::Print()\n+{\n+ char key[MaxLen()+1];\n+\n+ cout<<"\\nPrint hash:\\n";\n+ Reset();\n+ while(!End()) \n+ cout<<key<<"->"<<ReadNext(key)<<"\\n";\n+}\n+\n+/////////////////////////////////////////////////////////////////////////////////////////////\n+//Print out hash with internal representation as array \n+/////////////////////////////////////////////////////////////////////////////////////////////\n+template<class Typ> \n+void Hash<Typ>::DebugPrint()\n+{\n+ Pair<Typ>* pairp;\n+ Slot<Typ>* pslot;\n+\n+ cout<<"\\n";\n+ cout<<"Debug-print hash:";\n+ for(int i=0; i<num_slots; i++)\n+ {\n+ pslot = slot[i];\n+ if (pslot) \n+\t{\n+\t cout<<"\\nhash value "<<i;\n+\t pslot->Reset();\n+\t while(!pslot->End())\n+\t {\n+\t pairp = pslot->ReadNextAddress(); \n+\t cout<<" "<<pairp->key<<"->"<<pairp->data;\n+\t }\n+\t}\n+ }\n+ cout<<"\\n\\n";\n+ return;\n+}\n+\n+\n+\n+#endif /* HASH */\n+\n+\n+\n+////////////////////////////////////////////////////////////////////////////////\n+// Main program: test class Hash\n+////////////////////////////////////////////////////////////////////////////////\n+// int main()\n+// {\n+// Hash<int> ihash(5);\n+// char* key=new char[128];\n+// int data;\n+\n+// ihash.Fail(1000);\n+// ihash.Add("So many monsters",36);\n+// ihash.Add("So many chickens",25);\n+\n+// // cerr<<"Address of ihash(\\"So many monsters\\") is "<<ihash("So many monsters")<<"\\n";\n+// // cerr<<"Address of ihash(\\"So many monsters\\") is "<<ihash("So many monsters")<<"\\n";\n+// // *ihash("So many monsters")=2;\n+// // (*ihash("So many monsters"))++;\n+// // (*ihash("So many monsters"))++;\n+// cout<<"Size of hash="<<ihash.Size()<<"\\n";\n+// ihash.DebugPrint();\n+// ihash.Print();\n+ \n+// strcpy(key,"Some more monsters");\n+// ihash.Add(key,3);\n+// strcpy(key,"Even more monsters");\n+// ihash.Add(key,7);\n+// cout<<"Size of hash="<<ihash.Size()<<"\\n";\n+// cout<<"Maximum key length = "<<ihash.MaxLen()<<"\\n";\n+// ihash.Print();\n+ \n+// cout<<"ihash.Remove(\\"Even more monsters\\") returns "<<ihash.Remove("Even more monsters")<<"\\n";\n+// ihash.Print();\n+\n+\n+// cout<<"ihash.Remove(\\"More monsters\\") returns "<<ihash.Remove("More monsters")<<"\\n";\n+// ihash.Add("So many chickens",999);\n+// ihash.Add("So many monster",1);\n+// ihash.Print();\n+\n+// cout<<"So many chickens:"<<ihash.Show("So many chickens")<<"\\n";\n+// cout<<"Size of hash="<<ihash.Size()<<"\\n";\n+\n+\n+\n+// ihash.Reset();\n+// while (!ihash.End())\n+// {\n+// data = ihash.ReadNext(key);\n+// cout<<" "<<key<<"->"<<data<<endl;\n+// data = ihash.ReadCurrent(key);\n+// cout<<" "<<key<<"->"<<data<<endl;\n+// }\n+// cout<<"Removing all keys..."<<endl;\n+// cout<<"Size of hash="<<ihash.Size()<<"\\n";\n+// ihash.Reset();\n+// while (ihash.Size())\n+// {\n+// data = ihash.RemoveCurrent(key);\n+// cout<<" "<<key<<"->"<<data<<"\\n";\n+// cout<<"Size of hash="<<ihash.Size()<<"\\n";\n+// }\n+\n+// ihash.ReadCurrent(key);\n+\n+// ihash.Print();\n+// return 0;\n+// }\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/hhalign/hash.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/hhalign/hash.h Thu Jul 21 13:35:08 2011 -0400 |
[ |
@@ -0,0 +1,199 @@ +/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ + +/********************************************************************* + * Clustal Omega - Multiple sequence alignment + * + * Copyright (C) 2010 University College Dublin + * + * Clustal-Omega is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This file is part of Clustal-Omega. + * + ********************************************************************/ + +/* + * RCS $Id: hash.h 143 2010-10-14 13:11:14Z andreas $ + */ + +// Class for Hash data structure +// * works in the same way as a hash in Perl +// * keys are strings of type char* +// * data elements are of type Typ +// * objects have to be declared with maximal size, e.g. Hash hash1(10000) (num_slots should not be a power of 2) +// * works also if maximal size is exceeded, but gets slower by a factor ~num_keys/num_slots +// +// Applications +// * fast storage and retrieval of data by a key +// * fast check if a string occurs in a list of strings (data field not used) +// +// Time complexity: (L is the length of the key string) +// * Show(key), Add(key), Remove(key): O(L) for calculating hash value & compare keys in slot list +// * ReadNext, ReadCurrent, RemoveCurrent: O(L) for copying key into returned string +// * Contains: O(L) for calculating hash value +// * Size, MaxLen, Reset: O(1) +// * RemoveAll(), Hash() and ~Hash(): O(num_slots) +// +// Memory complexity: ~3*num_keys*(datasize+12bytes) + num_slots*4bytes + total added length of keys (including \0) +// +// Implementation: +// Hash is an array of pointers to lists of size num_slots. The lists, called slots, contain key/data pairs. +// When a key/data pair is added (e.g. with Add()) the array index i for the key (0<=i<num_slots) +// is calculated with the HashValue() function. +// When data is to be retrieved for key (e.g. with Show()) the hash value for key is calculated and +// the corresponding list (=slot) is searched for the occurence of the key. +// Array elements of hash values that have no keys associated yet contain the null pointer +// for faster rejection of undefined keys. +// + +//////////////////////////////////////////////////////////////////////////////////////////// +// Declaration of Pair, consisting of a key string and a data element of type Typ +//////////////////////////////////////////////////////////////////////////////////////////// + +template<class Typ> +class Pair +{ +public: + char* key; //hash key + Typ data; //data for key + Pair() {} + Pair(char* k, Typ& d) {key = new char[strlen(k)+1]; strcpy(key,k); data=d;} + Pair(int& l, char* k, Typ& d) {key = new char[l+1]; strcpy(key,k); data=d;} +}; + + +//////////////////////////////////////////////////////////////////////////////////////////// +// Declaration of Slot, a list of key/data pairs +//////////////////////////////////////////////////////////////////////////////////////////// + +template<class Typ> +class Slot : public List< Pair<Typ> > +{ +public: + //Destructor of Slot deletes whole list TOGETHER WITH THE KEY STRINGS + ~Slot() {this->Reset(); while (!this->End()) delete[] this->Pop().key; } + + // Push key/data pair onto slot list and return address of data element + // Attention: l must be at least length of key + inline Typ* Push(int& l, char* key, Typ& data) + { + Pair<Typ> pair(l,key,data); //create a pair with key/data + return &(List<Pair<Typ> >::Push(pair)->data); + } +}; + + +//////////////////////////////////////////////////////////////////////////////////////////// +// Declaration of Hash, an array of slots, i.e. pointers to lists of key/data +//////////////////////////////////////////////////////////////////////////////////////////// + +template<class Typ> +class Hash +{ +private: + int num_slots; //number of slots in slot[]. num_slots is set with the constructor + int curr; //index of current slot + int prev; //index of slot from previous ReadNext() + int num_keys; //total number of keys in hash + int max_len; //length of longest key in hash + int key_len; //length of key in argument + Typ fail; + + Slot<Typ>** slot; //each slot[i] (i<num_slots) points to a list of key/data pairs for this slot + + inline unsigned int HashValue(char* key); //returns the hash value for key + +public: + Hash(); + Hash(int nslots); + Hash(int nslots, Typ n); + ~Hash(); + + // Set Fail element to be returned when the current key or supplied key are not defined + inline void Null(Typ f) {fail=f;} + inline void Fail(Typ f) {fail=f;} + + // Set 'fail' element to be returned when the current key or supplied key are not defined (default: 0) + void New(int nslots, Typ n=static_cast<Typ>(0)); + + // Update maximum key length and caculate key_len; + inline void KeyLen() {if(key_len>max_len) max_len=key_len; return;} + + +//////////////////////////////////////////////////////////////////////////////////////////// +// Methods that work with a key supplied as an argument + + // Return data element for key. Returns 'fail' if key does not exist + Typ Show(char* key); + inline Typ operator[](char* key) {return Show(key);} + + // Add/replace key/data pair to hash and return address of data element for key + Typ* Add(char* key, Typ data); + + // Add key to hash and return address of data element. If key exists leave data element unchanged, else set it to 'fail'. + Typ* Add(char* key); + inline Typ* operator()(char* key) {return Add(key);} + + // Remove key from hash and return data element for key ('fail' if key does not exist) + Typ Remove(char* key); + + // Remove all keys from hash + void RemoveAll(); + + +/////////////////////////////////////////////////////////////////////////////////////////// +// Methods that work with an internal "current key": +// It is set to the first key by Reset() and moves to the next key with ReadNext or RemoveCurrent +// Note:the methods above (e.g. Store, Show, [], Add, (), etc. DO NOT CHANGE the current key + + // Return data of next key. Return 'fail' data and empty key if at end + Typ ReadNext(); + + // Write next key into variable key and return data. Return 'fail' data and empty key if at end + // Attention: 'key' must have memory of at least char[MaxLen()+1] allocated! + Typ ReadNext(char* key); + + // Return data of current key + Typ ReadCurrent(); + + // Write key last read into variable key and return data + // Attention: 'key' must have memory of at least char[MaxLen()+1] allocated! + Typ ReadCurrent(char* key); + + // Remove current key, return data and advance to next key + Typ RemoveCurrent(); + + // Remove current key, return data, copy current key into key, and advance to next key + // (After Reset() remove first element) + // Attention: 'key' must have memory of at least char[MaxLen()+1] allocated! + Typ RemoveCurrent(char* key); + + // Reset readout of keys to beginning of hash + void Reset(); + + // Returns 1 if the current key has arrived at the end, 0 otherwise + int End() {return (curr>=num_slots);} + + + +/////////////////////////////////////////////////////////////////////////////////////////// +// Methods that return usefull information about the data stored in Hash: + + // Returns 1 if the hash contains key, 0 otherwise + int Contains(char* key); + + // Return number of slots + int Size() {return num_keys;} + + // Return length of longest key INCLUDING DELETED KEYS (excluding \0) + int MaxLen() {return max_len;} + + //print out list of keys and data + void Print(); + + //Print out hash with internal representation as array + void DebugPrint(); +}; + |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/hhalign/hhalign.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/hhalign/hhalign.cpp Thu Jul 21 13:35:08 2011 -0400 |
[ |
b'@@ -0,0 +1,1375 @@\n+/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n+\n+/*********************************************************************\n+ * Clustal Omega - Multiple sequence alignment\n+ *\n+ * Copyright (C) 2010 University College Dublin\n+ *\n+ * Clustal-Omega is free software; you can redistribute it and/or\n+ * modify it under the terms of the GNU General Public License as\n+ * published by the Free Software Foundation; either version 2 of the\n+ * License, or (at your option) any later version.\n+ *\n+ * This file is part of Clustal-Omega.\n+ *\n+ ********************************************************************/\n+\n+/*\n+ * RCS $Id: hhalign.cpp 250 2011-06-17 13:06:20Z fabian $\n+ */\n+\n+/* hhalign.C: \n+ * Align a multiple alignment to an alignment or HMM \n+ * Print out aligned input sequences in a3m format\n+ * Compile: g++ hhalign.C -o hhalign -I/usr/include/ -L/usr/lib -lpng -lz -O3 -fno-strict-aliasing \n+ * Compile with efence: g++ hhalign.C -o hhalign -I/usr/include/ -lefence -L/usr/lib -lpng -lz -O -g \n+ * \n+ * Error codes: 0: ok 1: file format error 2: file access error \n+ * 3: memory error 4: internal numeric error \n+ * 5: command line error\n+ */\n+#undef PNG /* include options for making png files? \n+\t\t\t(will need the png library) */\n+#define MAIN\n+#include <iostream> // cin, cout, cerr\n+#include <fstream> // ofstream, ifstream \n+#include <string.h> // strcmp, strstr\n+#include <stdio.h> // printf\n+#include <stdlib.h> // exit\n+#include <math.h> // sqrt, pow\n+#include <limits.h> // INT_MIN\n+#include <float.h> // FLT_MIN\n+#include <time.h> // clock\n+#include <ctype.h> // islower, isdigit etc\n+\n+using std::cout;\n+using std::cerr;\n+using std::endl;\n+using std::ios;\n+using std::ifstream;\n+using std::ofstream;\n+\n+int iAux_GLOBAL;\n+\n+#include "general.h"\n+#include "util-C.h" /* imax, fmax, iround, iceil, ifloor, strint, strscn, \n+\t\t\t strcut, substr, uprstr, uprchr, Basename etc. */\n+#include "list-C.h" // list data structure\n+#include "hash-C.h" // hash data structure\n+\n+#include "hhdecl-C.h" // Constants, global variables, struct Parameters\n+#include "hhutil-C.h" /* MatchChr, InsertChr, aa2i, i2aa, log2, \n+\t\t\t fast_log2, WriteToScreen, */\n+#include "hhmatrices-C.h" // BLOSUM50, GONNET, HSDM\n+#include "hhhmm.h" // class HMM\n+#include "hhhit.h" // class Hit\n+#include "hhalignment.h" // class Alignment\n+#include "hhhalfalignment.h" // class HalfAlignment\n+#include "hhfullalignment.h" // class FullAlignment\n+#include "hhhitlist.h" // class Hit\n+#include "hhhmm-C.h" // class HMM\n+#include "hhalignment-C.h" // class Alignment\n+#include "hhhit-C.h" // class Hit\n+#include "hhhalfalignment-C.h" // class HalfAlignment\n+#include "hhfullalignment-C.h" // class FullAlignment\n+#include "hhhitlist-C.h" // class HitList \n+#include "hhfunc-C.h" // some functions common to hh programs\n+\n+#ifdef PNG\n+#include "pngwriter.h" //PNGWriter (http://pngwriter.sourceforge.net/)\n+#include "pngwriter.cc" //PNGWriter (http://pngwriter.sourceforge.net/)\n+#endif\t \n+\n+////////////////////////////////////////////////////////////////////////\n+// Global variables \n+////////////////////////////////////////////////////////////////////////\n+HMM *q; // Create query HMM with maximum of MAXRES match states\n+HMM *t; /* Create template HMM with maximum of MAXRES \n+\t\t\t match states */\n+Alignment *qali; /* (query alignment might be needed outside of hhfunc.C \n+\t\t\t for -a option) */\n+Hit hit; // Ceate new hit object pointed at by hit\n+HitList hitlist; /* list of hits with one Hit object for each \n+\t\t\t pairwise comparison done */\n+char aliindices[256]; /* hash containing indices of all alignments \n+\t\t\t which to show in dot plot */\n+char* dmapfile=NULL; /* where to write the coordinates for the HTML map file \n+\t\t\t (to click the '..b',".a3m");\n+ FILE* qa3mf=fopen(qa3mfile,"r");\n+ if (!qa3mf) OpenFileError(qa3mfile);\n+ Qali.Read(qa3mf,qa3mfile);\n+ fclose(qa3mf);\n+ \n+ // Align query with template in master-slave mode \n+ Qali.MergeMasterSlave(hit,par.tfile); /*FS, NOFILE2 (commented out) */\n+ \n+ // Write output A3M alignment?\n+ if (*par.alnfile) {\n+ Qali.WriteToFile(par.alnfile,"a3m");\n+ }\n+ \n+ if (*par.psifile) \n+ {\n+ /* Convert ASCII to int (0-20),throw out all insert states, \n+ record their number in I[k][i] */\n+ Qali.Compress("merged A3M file");\n+ \n+ // Write output PSI-BLAST-formatted alignment?\n+ Qali.WriteToFile(par.psifile,"psi");\n+ }\n+ } /* if (*par.alnfile || *par.psifile || *par.hhmfile) */\n+#endif /* NOFILE2 */\n+ //////////////////////////////////////////////////////////////////////////\n+ \n+ \n+ \n+ \n+ // double log2Pvalue;\n+ // if (par.ssm && (par.ssm1 || par.ssm2))\n+ // {\n+ // log2Pvalue=hit.logPval/0.693147181+0.45*(4.0*par.ssw/0.15-hit.score_ss);\n+ // if (v>=2) \n+ // \tprintf("Aligned %s with %s:\\nApproximate P-value INCLUDING SS SCORE = %7.2g\\n",q.name,t.name,pow(2.0,log2Pvalue));\n+ // } else {\n+ // if (v>=2) \n+ // \tprintf("Aligned %s with %s:\\nApproximate P-value (without SS score) = %7.2g\\n",q.name,t.name,hit.Pval);\n+ // }\n+ \n+ if (v>=2)\n+ {\n+ if (par.hitrank==0)\n+ printf("Aligned %s with %s: Score = %-7.2f P-value = %-7.2g\\n",\n+ q.name,t.name,hit.score,hit.Pval);\n+ else\n+ printf("Aligned %s with %s (rank %i): Score = %-7.2f P-value = %-7.2g\\n",\n+ q.name,t.name,par.hitrank,hit.score,hit.Pval);\n+ }\n+ \n+ \n+ this_is_the_end: \n+\n+ // Delete memory for dynamic programming matrix\n+ hit.DeleteBacktraceMatrix(q.L+2);\n+ if (par.forward>=1 || Nstochali) \n+ hit.DeleteForwardMatrix(q.L+2);\n+ if (par.forward==2) \n+ hit.DeleteBackwardMatrix(q.L+2);\n+ /* if (Pstruc) { \n+ for (int i=0; i<q.L+2; i++) delete[](Pstruc[i]); delete[](Pstruc);}\n+ */\n+ \n+ // Delete content of hits in hitlist\n+ hitlist.Reset();\n+ while (!hitlist.End()) \n+ hitlist.ReadNext().Delete(); // Delete content of hit object\n+ \n+ if (strucfile && par.wstruc>0) \n+ {\n+ for (int i=0; i<q.L+2; i++){\n+ delete[] Pstruc[i]; Pstruc[i] = NULL;\n+ }\n+ delete[] Pstruc; Pstruc = NULL;\n+ for (int i=0; i<q.L+2; i++){\n+ delete[] Sstruc[i]; Sstruc[i] = NULL;\n+ }\n+ delete[] Sstruc; Sstruc = NULL;\n+ delete[] strucfile; strucfile = NULL;\n+ }\n+ \n+ if (pngfile){\n+ delete[] pngfile; pngfile = NULL;\n+ }\n+ if (alitabfile){\n+ delete[] alitabfile; alitabfile = NULL;\n+ }\n+ if (tcfile){\n+ delete[] tcfile; tcfile = NULL;\n+ }\n+ if (par.exclstr){\n+ delete[] par.exclstr; par.exclstr = NULL;\n+ }\n+ \n+#ifndef CLUSTALO_NOFILE\n+ // Print \'Done!\'\n+ FILE* outf=NULL;\n+ if (!strcmp(par.outfile,"stdout")) printf("Done!\\n");\n+ else\n+ {\n+ if (*par.outfile)\n+ {\n+ outf=fopen(par.outfile,"a"); //open for append\n+ fprintf(outf,"Done!\\n");\n+ fclose(outf);\n+ }\n+ if (v>=2) printf("Done\\n");\n+ }\n+#endif\n+ \n+ //qali.ClobberGlobal();\n+ hit.ClobberGlobal();\n+ if (iFirstCnt > 0){\n+ q.ClobberGlobal();\n+ }\n+ if (iSecndCnt > 0){\n+ t.ClobberGlobal();\n+ }\n+ hitlist.ClobberGlobal();\n+ \n+ return iRetVal;\n+\n+} /* this is the end of hhalign() //end main */\n+\n+//////////////////////////////////////////////////////////////////////////////\n+// END OF MAIN\n+//////////////////////////////////////////////////////////////////////////////\n+\n+/*\n+ * EOF hhalign.C\n+ */\n+\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/hhalign/hhalign.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/hhalign/hhalign.h Thu Jul 21 13:35:08 2011 -0400 |
[ |
@@ -0,0 +1,30 @@ +/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ + +/********************************************************************* + * Clustal Omega - Multiple sequence alignment + * + * Copyright (C) 2010 University College Dublin + * + * Clustal-Omega is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This file is part of Clustal-Omega. + * + ********************************************************************/ + +/* + * RCS $Id: hhalign.h 241 2011-05-04 14:37:17Z fabian $ + */ + + +extern int +hhalign(char **ppcFirstProf, int iFirstCnt, double *pdWeightsL, + char **ppcSecndProf, int iSecndCnt, double *pdWeightsR, + double *dScore_p, hmm_light *prHMM, + char *pcPrealigned1, char *pcRepresent1, + char *pcPrealigned2, char *pcRepresent2, + hhalign_para rHhalignPara, + int iFlag, + char zcAux[], char zcError[]); |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/hhalign/hhalignment-C.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/hhalign/hhalignment-C.h Thu Jul 21 13:35:08 2011 -0400 |
[ |
b'@@ -0,0 +1,3028 @@\n+/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n+\n+/*********************************************************************\n+ * Clustal Omega - Multiple sequence alignment\n+ *\n+ * Copyright (C) 2010 University College Dublin\n+ *\n+ * Clustal-Omega is free software; you can redistribute it and/or\n+ * modify it under the terms of the GNU General Public License as\n+ * published by the Free Software Foundation; either version 2 of the\n+ * License, or (at your option) any later version.\n+ *\n+ * This file is part of Clustal-Omega.\n+ *\n+ ********************************************************************/\n+\n+/*\n+ * RCS $Id: hhalignment-C.h 236 2011-04-14 11:30:04Z fabian $\n+ */\n+\n+\n+/*\n+ * Changelog: Michael Remmert made changes to hhalign stand-alone code\n+ * FS implemented some of the changes on 2010-10-28 -> MR1\n+ *\n+ * Note: MR seems to have changed all [aijk]++ to ++[aijk],\n+ * FS did not do that on 2010-10-28\n+ */\n+\n+// hhalignment.C\n+\n+//////////////////////////////////////////////////////////////////////////////\n+//// Class Alignment\n+//////////////////////////////////////////////////////////////////////////////\n+\n+// hhalignment.C\n+\n+#ifndef MAIN\n+#define MAIN\n+#include <iostream> // cin, cout, cerr\n+#include <fstream> // ofstream, ifstream\n+#include <stdio.h> // printf\n+using std::cout;\n+using std::cerr;\n+using std::endl;\n+using std::ios;\n+using std::ifstream;\n+using std::ofstream;\n+#include <stdlib.h> // exit\n+#include <string> // strcmp, strstr\n+#include <math.h> // sqrt, pow\n+#include <limits.h> // INT_MIN\n+#include <float.h> // FLT_MIN\n+#include <time.h> // clock\n+#include <ctype.h> // islower, isdigit etc\n+#include "util-C.h" // imax, fmax, iround, iceil, ifloor, strint, strscn, strcut, substr, uprstr, uprchr, Basename etc.\n+#include "list.h" // list data structure\n+#include "hash.h" // hash data structure\n+#include "hhdecl-C.h"\n+#include "hhutil-C.h" // imax, fmax, iround, iceil, ifloor, strint, strscn, strcut, substr, uprstr, uprchr, Basename etc.\n+#include "hhhmm.h"\n+#endif\n+\n+\n+enum {KEEP_NOT = 0, KEEP_CONDITIONALLY, KEEP_ALWAYS};\n+\n+//////////////////////////////////////////////////////////////////////////////\n+// Class Alignment\n+//////////////////////////////////////////////////////////////////////////////\n+\n+\n+//////////////////////////////////////////////////////////////////////////////\n+// Object constructor\n+//////////////////////////////////////////////////////////////////////////////\n+Alignment::Alignment(int maxseq, int maxres)\n+{\n+\n+ //printf(">>>>>>>>%s:%s:%d: maxseq=%d, maxres=%d\\n", __FUNCTION__, __FILE__, __LINE__, maxseq, maxres); /* (FS) */\n+ longname = new(char[DESCLEN]);\n+ sname = new(char*[maxseq+2]); /* MR1 */\n+ seq = new(char*[maxseq+2]); /* MR1 */\n+ l = new(int[maxres]);\n+ X = new(char*[maxseq+2]); /* MR1 */\n+ I = new(short unsigned int*[maxseq+2]); /* MR1 */\n+ keep = new(char[maxseq+2]); /* MR1 */\n+ display = new(char[maxseq+2]); /* MR1 */\n+ wg = new(float[maxseq+2]); /* MR1 */\n+ nseqs = new(int[maxres+2]); /* MR1 */\n+ N_in=L=0;\n+ nres=NULL; // number of residues per sequence k\n+ first=NULL; // first residue in sequence k\n+ last=NULL; // last residue in sequence k\n+ ksort=NULL; // sequence indices sorted by descending nres[k]\n+ name[0]=\'\\0\'; // no name defined yet\n+ longname[0]=\'\\0\'; // no name defined yet\n+ fam[0]=\'\\0\'; // no name defined yet\n+ file[0]=\'\\0\'; // no name defined yet\n+ readCommentLine = \'0\'; /* MR1 */\n+}\n+\n+//////////////////////////////////////////////////////////////////////////////\n+// Object destructor\n+//////////////////////////////////////////////////////////////////////////////\n+Alignment::~Alignment()\n+{\n+ delete[] longname; longname = NULL;\n+ for(int k=0; k<N_in; k++)\n+ {\n+ delete[] sname[k]; sname[k] = NULL;\n+ delete[] seq[k]; seq[k] = NULL;\n+ delete[] X[k]; X[k] = NULL;\n+ delete[] I[k]; I[k] = NULL;\n+ }\n+ delete[] sname; sname = NULL;\n+ delete[] seq; seq = NULL;\n+'..b'[k] = KEEP_CONDITIONALLY;\n+ display[k] = KEEP_CONDITIONALLY;\n+ sname[k] = new(char[GOOD_MEASURE]);\n+ strcpy(sname[k], "unknown_sname");\n+ } /* (0 <= k < iCnt) */\n+ /* FIXME: Soeding always makes 1st sequence permanent */\n+ /*keep[0] = KEEP_ALWAYS;\n+ display[k] = KEEP_ALWAYS;*/\n+#if 1\n+ /* Believe that the first and last positions are\n+ most important in stability of this algorithm.\n+ Must make sure that at least 2 sequences with\n+ residues in these positions are kept.\n+ Think any sequence will do, but better to keep\n+ the one with the longest \'contig\'\n+ */\n+ int iSeq; /* sequence iterator */\n+ int iHeadLen = 0, iHeadID = -1; /* length & ID of longest head contig */\n+ int iTailLen = 0, iTailID = -1; /* length & ID of longest head contig */\n+ int iCont = -1;\n+ char *pcFind = NULL;\n+\n+#if 0\n+ printf("%s:%s:%d: NEW PROFILE (%d seq) ================\\n",\n+ __FUNCTION__, __FILE__, __LINE__, iCnt);\n+#endif\n+ for (iSeq = 0; iSeq < iCnt; iSeq++){\n+#if 0\n+ printf("%s:%s:%d: consider seq %d ------------------\\n",\n+ __FUNCTION__, __FILE__, __LINE__, iSeq);\n+#endif\n+ pcFind = strchr(&seq[iSeq][1], \'-\');\n+ if (NULL == pcFind){\n+ /* no gap at all in this sequences, spans entire profile */\n+ iHeadID = iTailID = iSeq;\n+ iHeadLen = iTailLen = iLen;\n+ break;\n+ }\n+ iCont = (int)(pcFind - &seq[iSeq][1]);\n+ if (iCont > iHeadLen){\n+ iHeadLen = iCont;\n+ iHeadID = iSeq;\n+ }\n+ pcFind = strrchr(seq[iSeq], \'-\');\n+ iCont = iLen - (int)(pcFind - seq[iSeq]);\n+ if (iCont > iTailLen){\n+ iTailLen = iCont;\n+ iTailID = iSeq;\n+ }\n+\n+#if 0\n+ printf("%s:%s:%d: seq %3d: len = %d(%d) %s\\n",\n+ __FUNCTION__, __FILE__, __LINE__, iSeq, iCont, iLen, seq[iSeq]);\n+#endif\n+ } /* 0 <= iSeq < iCnt */\n+#if 0\n+ printf("%s:%s:%d: seq %d is winner with head contig of %d, seq %d tail contig of %d\\n"\n+ , __FUNCTION__, __FILE__, __LINE__, iHeadID, iHeadLen, iTailID, iTailLen);\n+#endif\n+ if ( (-1 == iHeadID) || (-1 == iTailID) ){\n+ printf("%s:%s:%d: profile has no leading and/or trailing residues (h=%d:t=%d:#=%d)\\n",\n+ __FUNCTION__, __FILE__, __LINE__, iHeadID, iTailID, iCnt);\n+ }\n+ else{\n+ keep[iHeadID] = KEEP_ALWAYS;\n+ keep[iTailID] = KEEP_ALWAYS;\n+ }\n+#endif\n+ /* @= */\n+ return;\n+\n+} /* this is the end of Transfer() */\n+#endif\n+\n+#ifdef CLUSTALO\n+/* @* Alignment::ClobberGlobal (eg: qali)\n+ *\n+ * Note: originally hhalign() was stand-alone code,\n+ * there are a couple of GLOBAL (!) variables,\n+ * which would have been destroyed on exit.\n+ * However, now there is no \'exit\' from hhalign(),\n+ * and on re-entry the global variable must be clean again.\n+ */\n+void \n+Alignment::ClobberGlobal(void){\n+\n+ /* @<essentials@>\n+ these are essential to re-set (as some of them are used as flags) */\n+ for(int k=0; k<N_in; k++)\n+ {\n+ delete[] sname[k]; sname[k] = NULL;\n+ delete[] seq[k]; seq[k] = NULL;\n+ delete[] X[k]; X[k] = NULL;\n+ delete[] I[k]; I[k] = NULL;\n+ }\n+ delete[] nres; nres = NULL;\n+ delete[] first; first = NULL;\n+ delete[] last; last = NULL;\n+ delete[] ksort; ksort = NULL;\n+ N_in = N_filtered = n_display = 0;\n+ L = 0;\n+ kss_dssp = ksa_dssp = kss_pred = kss_conf = kfirst = -1;\n+\n+ /* @<re-set but keep memory@>\n+ do not free the memory but re-set content */\n+ longname[0] = \'\\0\'; //delete[] longname; longname = NULL;\n+ keep[0] = \'\\0\'; //delete[] keep; keep = NULL;\n+ display[0] = \'\\0\'; //delete[] display; display = NULL;\n+ wg[0] = 0; //delete[] wg; wg = NULL;\n+ nseqs[0] = 0; //delete[] nseqs; nseqs = NULL;\n+ name[0]=\'\\0\';\n+ fam[0]=\'\\0\';\n+ file[0]=\'\\0\';\n+ //delete[] sname; sname = NULL;\n+ //delete[] seq; seq = NULL;\n+ //delete[] X; X = NULL;\n+ //delete[] I; I = NULL;\n+ //delete[] l; l = NULL;\n+\n+ /* @= */\n+ return;\n+}\n+#endif\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/hhalign/hhalignment.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/hhalign/hhalignment.h Thu Jul 21 13:35:08 2011 -0400 |
[ |
@@ -0,0 +1,129 @@ +/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ + +/********************************************************************* + * Clustal Omega - Multiple sequence alignment + * + * Copyright (C) 2010 University College Dublin + * + * Clustal-Omega is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This file is part of Clustal-Omega. + * + ********************************************************************/ + +/* + * RCS $Id: hhalignment.h 154 2010-11-09 18:29:05Z fabian $ + */ + +// hhalignment.h + +class Alignment +{ +public: + int L; // number of match states of alignment + int N_in; // total number of sequences in alignment + int N_filtered; /* number of sequences after sequence identity + filtering */ + int N_ss; // number of >ss_ or >sa sequences + + int kss_dssp; /* index of sequence with secondary structure + by dssp -1:no >ss_dssp line found */ + int ksa_dssp; /* index of sequence with solvent accessibility + by dssp -1:no >sa_dssp line found */ + int kss_pred; /* index of sequence with predicted secondary + structure -1:no >ss_pred line found */ + int kss_conf; /* index of sequence with confidence values of + prediction -1:no >ss_conf line found */ + int kfirst; // index of first real sequence + + char* longname; /* Full name of first sequence of original alignment + (NAME field) */ + char name[NAMELEN]; // HMM name = first word in longname in lower case + char fam[NAMELEN]; // family ID (derived from name) (FAM field) + char file[NAMELEN]; /* Rootname (w/o path, with extension) of alignment + file that is used to construct the HMM */ + + int n_display; /* number of sequences to be displayed + (INCLUDING >ss_pred, >ss_conf, >ss_dssp sequences) */ + char** sname; // names of display sequences (first seq=0, first char=0) + char** seq; // residues of display sequences (first char=1) + int* l; // l[i] = position of i'th match state in alignment + + char* keep; /* keep[k]=1 if sequence is included in amino acid + frequencies; 0 otherwise (first=0) */ + + double *pdExWeight; /* external sequence weight as given by tree FIXME (FS) */ + + Alignment(int maxseq=MAXSEQ, int maxres=/*MAXRES*/par.maxResLen); + ~Alignment(); + + // Read alignment into X (uncompressed) in ASCII characters + void Read(FILE* inf, char infile[NAMELEN], char* line=NULL); +#ifdef CLUSTALO + void Transfer(char **ppcProf, int iCnt); + void ClobberGlobal(); +#endif + + /* Convert ASCII to numbers between 0 and 20, throw out all insert states, + record their number in I[k][i] and store sequences to be displayed + in sname[k] and seq[k] */ + void Compress(const char infile[NAMELEN]); + + // Apply sequence identity filter + inline int FilterForDisplay(int max_seqid, int coverage=0, int qid=0, float qsc=0, int N=0); + inline int Filter(int max_seqid, int coverage=0, int qid=0, float qsc=0, int N=0); + int Filter2(char keep[], int coverage, int qid, float qsc, int seqid1, int seqid2, int Ndiff); + + bool FilterNeff(); /* MR1 */ + float filter_by_qsc(float qsc, char* dummy); /* MR1 */ + + // Filter alignment for min score per column with core query profile, defined by min_coverage_core and min_seqid_core + int HomologyFilter(int coverage_core, float qsc_core, float coresc); + + // Calculate AA frequencies q.p[i][a] and transition probabilities q.tr[i][a] from alignment + void FrequenciesAndTransitions(HMM& q, char* in=NULL); + + // Calculate freqs q.f[i][a] and transitions q.tr[i][a] (a=MM,MI,MD) with pos-specific subalignments + void Amino_acid_frequencies_and_transitions_from_M_state(HMM& q, char* in); + + // Calculate transitions q.tr[i][a] (a=DM,DD) with pos-specific subalignments + void Transitions_from_D_state(HMM& q, char* in); + + // Calculate transitions q.tr[i][a] (a=DM,DD) with pos-specific subalignments + void Transitions_from_I_state(HMM& q, char* in); + + // Write alignment without insert states to alignment file + void WriteWithoutInsertsToFile(char* alnfile); + + // Write alignment to alignment file + void WriteToFile(char* alnfile, const char format[]=NULL); + + // Read a3m slave alignment of hit from ta3mfile and merge into (query) master alignment + void MergeMasterSlave(Hit& hit, char ta3mfile[]); + + // Read a3m alignment of hit from ta3mfile and merge-combine with query alignment + void Merge(Hit& hit, char ta3mfile[]); + + // Add a sequence to Qali + void AddSequence(char Xk[], int Ik[]=NULL); + + // Determine matrix of position-specific weights w[k][i] for multiple alignment + void GetPositionSpecificWeights(float* w[]); + + char readCommentLine; // Set to 1, if a comment line with '#' is read /* MR1 */ + +private: + char** X; // X[k][i] contains column i of sequence k in alignment (first seq=0, first char=1) (0-3: ARND ..., 20:X, 21:GAP) + short unsigned int** I; // I[k][i] contains the number of inserts AFTER match state i (first=0) + char* display; // display[k]=1 if sequence will be displayed in output alignments; 0 otherwise (first=0) + float* wg; // w[k] = global weight of sequence k + int* nseqs; // number of sequences in subalignment i (only for DEBUGGING) + int* nres; // number of residues in sequence k + int* first; // first residue in sequence k + int* last; // last residue in sequence k + int* ksort; // index for sorting sequences: X[ksort[k]] + int FilterWithCoreHMM(char in[], float coresc, HMM& qcore); +}; |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/hhalign/hhdecl-C.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/hhalign/hhdecl-C.h Thu Jul 21 13:35:08 2011 -0400 |
[ |
b'@@ -0,0 +1,243 @@\n+/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n+\n+/*********************************************************************\n+ * Clustal Omega - Multiple sequence alignment\n+ *\n+ * Copyright (C) 2010 University College Dublin\n+ *\n+ * Clustal-Omega is free software; you can redistribute it and/or\n+ * modify it under the terms of the GNU General Public License as\n+ * published by the Free Software Foundation; either version 2 of the\n+ * License, or (at your option) any later version.\n+ *\n+ * This file is part of Clustal-Omega.\n+ *\n+ ********************************************************************/\n+\n+/*\n+ * RCS $Id: hhdecl-C.h 227 2011-03-28 17:03:09Z fabian $\n+ */\n+\n+/////////////////////////////////////////////////////////////////////////////////////\n+//// Constants\n+/////////////////////////////////////////////////////////////////////////////////////\n+\n+const char VERSION_AND_DATE[]="version 1.5.1.3 (November 2008)";\n+const char REFERENCE[]="Soding, J. Protein homology detection by HMM-HMM comparison. Bioinformatics 2005, 21, 951-960.\\n";\n+const char COPYRIGHT[]="(C) Johannes Soeding (see LICENSE file)\\n";\n+const int MAXSEQ=65535; //max number of sequences in input alignment (must be <~30000 on cluster nodes)\n+#if 0\n+const int MAXCOL=32765; //max number of residues in input files; must be <= LINELEN and >= MAXRES\n+const int MAXRES=15002; //max number of columns in HMM; must be <= LINELEN\n+#else\n+const int MAXCOL=2/*131072*/; //max number of residues in input files; must be <= LINELEN and >= MAXRES\n+const int MAXRES=1/*65536*/; //max number of columns in HMM; must be <= LINELEN\n+#endif\n+const int LINELEN=262144; //max length of line read in from input files; must be >= MAXCOL \n+const int MAXSEQDIS=3; //10238;//max number of sequences stored in \'hit\' objects and displayed in output alignment \n+const int IDLEN=255; //max length of scop hierarchy id and pdb-id\n+const int DESCLEN=32765;//max length of sequence description (longname)\n+const int NAMELEN=511; //max length of file names etc.\n+const int MAXOPT=127; //Maximum number of options to be read in from .hhconfig or command line\n+const int NAA=20; //number of amino acids (0-19)\n+const int NTRANS=10; //number of transitions recorded in HMM (M2M,M2I,M2D,I2M,I2I,D2M,D2D,M2M_GAPOPEN,GAPOPEN,GAPEXTD)\n+const int NCOLMIN=10; //min number of cols in subalignment for calculating pos-specific weights w[k][i]\n+const int ANY=20; //number representing an X (any amino acid) internally\n+const int GAP=21; //number representing a gap internally \n+const int ENDGAP=22; //Important to distinguish because end gaps do not contribute to tansition counts \n+const int HMMSCALE=1000;//Scaling number for log2-values in HMMs\n+const int NFAMMAX=5119; //Size of hash for counting number of HMMs in each family\n+const int MAXPROF=32766;//Maximum number of HMM scores for fitting EVD\n+const float MAXENDGAPFRAC=0.1; //For weighting: include only columns into subalignment i that have a max fraction of seqs with endgap\n+const float SMIN= 20.; //Minimum score of hit needed to search for another repeat of same profile: p=exp(-(4-mu)/lamda)=0.01\n+const float LAMDA=0.388; //lamda in score EVD used for -local mode in length correction: S = S-log(Lq*Lt)/LAMDA) \n+const float LAMDA_GLOB=0.42; //lamda in score EVD used for -global mode\n+const float PMAX=1E-2; //Maximum single-repeat p-value that can contribute to whole-protein p-value\n+const float MINEVALEXCL=0.5; //above this E-value from first ML fit hits are not used for final ML fit of EVD\n+const int SELFEXCL=3; // exclude self-alignments with j-i<SELFEXCL\n+const float PLTY_GAPOPEN=6.0f; // for -qsc option (filter for min similarity to query): 6 bits to open gap\n+const float PLTY_GAPEXTD=1.0f; // for -qsc option (filter for min similarity to query): 1 bit to extend gap\n+const int MINCOLS_REALIGN=6; // hits with MAC alignments with fewer matched columns will be deleted in hhsearch hitl'..b"\n+ char ssgap; // 1: add secondary structure-dependent gap penalties 0:off\n+ float ssgapd; // secondary structure-dependent gap-opening penalty (per residue)\n+ float ssgape; // secondary structure-dependent gap-extension penalty (per residue)\n+ char ssgapi; // max. number of inside-integer(ii); gap-open-penalty= -ii*ssgapd\n+\t\t \n+ char ssm; // SS comparison mode: 0:no ss scoring 1:ss scoring AFTER alignment 2:ss score in column score\n+ float ssw; // SS weight as compared to column score\n+ float ssa; // SS state evolution matrix M1 = (1-ssa)*I + ssa*M0\n+\t\t \n+ char loc; // 0: local alignment (wrt. query), 1: global alignement \n+ char forward; // 0:Viterbi algorithm 1:Forward algorithm 2: MAC\n+ char realign; // realign database hits to be displayed with MAC algorithm\n+ char altali; // find up to this many possibly overlapping alignments\n+ int columnscore; // 0: no aa comp corr 1: 1/2(qav+tav) 2: template av freqs 3: query av freqs 4:...\n+ float corr; // Weight of correlations between scores with |i-j|<=4\n+ float shift; // Score offset for match-match states\n+ float mact; // Score threshold (negative offset) in MAC alignment\n+\t\t \n+ char calibrate; // calibration of query HMM? 0:no, 1:yes (write lamda,mu into query profile)\n+ char calm; // derive P-values from: 0:query calibration 1:template calibration 2:both\n+ int opt; // for optimization: compare only every opt'th negative; 0: mode off\n+ int readdefaultsfile ; // read defaults file ./.hhdefaults or HOME/.hhdefaults?\n+ int min_overlap; // all cells of dyn. programming matrix with L_T-j+i or L_Q-i+j < min_overlap will be ignored\n+ int hitrank; // rank of hit to be printed as a3m alignment\n+ char notags; // neutralize His-tags, FLAG tags, C-myc tags?\n+ unsigned int maxdbstrlen; // maximum length of database string to be printed in 'Command' line of hhr file\n+\t\t \n+ char trans; // 0: normal pairwise scoring; 1:transitive scoring \n+ float Emax_trans; // max E-value for intermediate HMMs in transitive scoring (i.e. l is intermediate HMM if E_lq, E_lk <Emax_trans)\n+ float wtrans; // Ztot[k] = Zq[k] + wtrans * (Zforward[k]+Zreverse[k])\n+\n+\n+ // SCRAP THE FOLLOWING VARIABLES?\n+\n+ float wstruc; // weight of structure scores\n+ char repmode; // 1:repeat identification: multiple hits not treated as independent 0: repeat mode off\n+\n+ int idummy;\n+ int jdummy;\n+ float fdummy; \n+};\n+\n+/////////////////////////////////////////////////////////////////////////////////////\n+//// Global variable declarations\n+/////////////////////////////////////////////////////////////////////////////////////\n+\n+char v=1; // 1: show only warnings 2:verbose mode \n+Parameters par;\n+char program_name[NAMELEN]; //name of program executed (e.g. hhmake of hhsearch)\n+\n+// substitution matrix flavours\n+float P[21][21]; // P[a][b] = combined probability for a aligned to b\n+float R[21][21]; // R[a][b]=P[a][b]/p[b]=P(a|b); precalculated for pseudocounts\n+float Sim[21][21]; // Similarity matrix Sim[a][b]: how similar are a and b?\n+float S[21][21]; // Substitution score matrix S[a][b] = log2(Pab/pa/pb)\n+float pb[21]; // pb[a] = background amino acid probabilities for chosen substitution matrix\n+float qav[21]; // qav[a] = background amino acid probabilities for query HMM (needed for rate matrix rescaling)\n+\n+// secondary structure matrices\n+float S73[NDSSP][NSSPRED][MAXCF]; // P[A][B][cf] = log2 P(A,B,cf)/P(A)/P(B,cf)\n+float S33[NSSPRED][MAXCF][NSSPRED][MAXCF]; // P[B][cf][B'][cf'] = log2 sum_B' P(A,B',cf)/P(A)/P(B,cf) * P_b(B'|B)\n+// float S77[NDSSP][DSSP]; // P[A][B] = log2 P(A,B)/P(A)/P(B)\n+\n" |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/hhalign/hhfullalignment-C.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/hhalign/hhfullalignment-C.h Thu Jul 21 13:35:08 2011 -0400 |
[ |
b'@@ -0,0 +1,639 @@\n+/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n+\n+/*********************************************************************\n+ * Clustal Omega - Multiple sequence alignment\n+ *\n+ * Copyright (C) 2010 University College Dublin\n+ *\n+ * Clustal-Omega is free software; you can redistribute it and/or\n+ * modify it under the terms of the GNU General Public License as\n+ * published by the Free Software Foundation; either version 2 of the\n+ * License, or (at your option) any later version.\n+ *\n+ * This file is part of Clustal-Omega.\n+ *\n+ ********************************************************************/\n+\n+/*\n+ * RCS $Id: hhfullalignment-C.h 243 2011-05-31 13:49:19Z fabian $\n+ */\n+\n+// hhfullalignment.C\n+\n+#ifndef MAIN\n+#define MAIN\n+#include <iostream> // cin, cout, cerr\n+#include <fstream> // ofstream, ifstream \n+#include <stdio.h> // printf\n+#include <stdlib.h> // exit\n+#include <string> // strcmp, strstr\n+#include <math.h> // sqrt, pow\n+#include <limits.h> // INT_MIN\n+#include <float.h> // FLT_MIN\n+#include <time.h> // clock\n+#include <ctype.h> // islower, isdigit etc\n+using std::ios;\n+using std::ifstream;\n+using std::ofstream;\n+using std::cout;\n+using std::cerr;\n+using std::endl;\n+#include "util-C.h" // imax, fmax, iround, iceil, ifloor, strint, strscn, strcut, substr, uprstr, uprchr, Basename etc.\n+#include "list.h" // list data structure\n+#include "hash.h" // hash data structure\n+#include "hhdecl-C.h" // constants, class \n+#include "hhutil-C.h" // imax, fmax, iround, iceil, ifloor, strint, strscn, strcut, substr, uprstr, uprchr, Basename etc.\n+#include "hhhmm.h" // class HMM\n+#include "hhalignment.h" // class Alignment\n+#include "hhhit.h"\n+#include "hhhalfalignment.h"\n+#endif\n+\n+\n+\n+//////////////////////////////////////////////////////////////////////////////\n+//////////////////////////////////////////////////////////////////////////////\n+// Methods of class FullAlignment\n+//////////////////////////////////////////////////////////////////////////////\n+//////////////////////////////////////////////////////////////////////////////\n+ \n+\n+//////////////////////////////////////////////////////////////////////////////\n+// Output Results: use classes HalfAlignment and FullAlignment\n+//\n+// Example:\n+// Each column list contains at least a match state \n+// Insert states between the match states are omitted\n+//\n+// step 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1\n+// i 0 0 1 2 3 4 5 6 7 8 9 9 9 9 10 11 12 13 14\n+// \n+// Q ~ ~ X X X X X X X X X ~ ~ ~ X X X X X\n+// T Y Y Y Y Y Y Y Y ~ Y Y Y Y Y Y Y Y ~ ~\n+//\n+// j 7 8 9 10 11 12 13 14 14 15 16 17 18 19 20 21 22 22 22\n+// state IM IM MM MM MM MM MM MM DG MM MM GD GD GD MM MM MM MI MI\n+//\n+// nsteps=19\n+//\n+\n+\n+//////////////////////////////////////////////////////////////////////////////\n+// Constructor\n+FullAlignment::FullAlignment(int maxseqdis) \n+{\n+ qa = new HalfAlignment(maxseqdis);\n+ ta = new HalfAlignment(maxseqdis);\n+ for (int h=0; h<LINELEN-1; h++) symbol[h]=\' \';\n+}\n+\n+//////////////////////////////////////////////////////////////////////////////\n+// Destructor\n+FullAlignment::~FullAlignment() \n+{\n+ delete qa; qa = NULL;\n+ delete ta; ta = NULL;\n+}\n+\n+//////////////////////////////////////////////////////////////////////////////\n+// Free memory of arrays s[][], l[][], and m[][] in HalfAlignment\n+void FullAlignment::FreeMemory()\n+{\n+ qa->Unset();\n+ ta->Unset();\n+}\n+\n+//////////////////////////////////////////////////////////////////////////////\n+/**\n+ * @brief Add columns for match (and delete) states. \n+ */\n+void \n+FullAlignment::AddColumns(int i, int j, char prev_state, char state, float S)\n+{\n+ switch(state)\n+ {\n+ case MM: //MM pair state (both query and template in Match state)\n+ AddGaps(); //fill up gaps until query and template parts have same length\n+ symbol'..b'>nss_pred || k==qa->nss_conf) && !par.showpred) continue;\n+ if (k==qa->ncons && !par.showcons) continue;\n+ fprintf(outf,">%s\\n",qa->sname[k]);\n+#if TELOMER_PRINT\n+ /* @<print left cut-off@> */\n+ if (iTelomerLeft > 0){\n+\tfor (int iI = 1; iI <= iTelomerLeft; iI++){\n+\t fprintf(outf, "%1c", qa->seq[k][iI]);\n+\t}\n+\t/* this may be unnecessary */\n+\tfor (int iI = iTelomerLeft+1; iI < hit.i1; iI++){\n+\t fprintf(outf, "%1c", qa->seq[k][iI]);\n+\t}\n+ }\n+ else {\n+\tfor (int iI = iTelomerLeft; iI < 0; iI++){\n+\t fprintf(outf, "%1c", \'-\');\n+\t}\n+\t/* this may be unnecessary */\n+\t/* think about it */\n+ }\n+ /* @<print consensus@> */\n+ for (h = 0; qa->s[k][h] > 0; h++){\n+\tfprintf(outf, "%1c", qa->s[k][h]);\n+ }\n+ /* @<print out rght cut-off@> */\n+ for (int iI = hit.i2+1; iI <= qa->L; iI++){\n+\tfprintf(outf, "%1c", qa->seq[k][iI]);\n+ }\n+ for (int iI = 0; iI > iTelomerRght; iI--){\n+\tfprintf(outf, "%1c", \'-\');\n+ }\n+#else\n+ for (h=0,hh=-par.aliwidth; qa->s[k][h]>0; h++,hh++) \n+\t{\n+\t if (!hh) {fprintf(outf,"\\n"); hh-=par.aliwidth;}\n+\t fprintf(outf,"%1c",qa->s[k][h]); \n+\t}\n+#endif\n+ fprintf(outf,"\\n");\n+ }\n+ \n+ // Print template sequences\n+ for (k=0; k<ta->n; k++)\n+ {\n+ if (k==ta->nsa_dssp) continue;\n+ if (k==ta->nss_dssp && !par.showdssp) continue;\n+ if ((k==ta->nss_pred || k==ta->nss_conf) && !par.showpred) continue;\n+ if (k==ta->ncons && !par.showcons) continue;\n+ fprintf(outf,">%s\\n",ta->sname[k]);\n+#if TELOMER_PRINT\n+ /* @<print left cut-off@> */\n+ if (iTelomerLeft > 0){\n+\tfor (int iI = 1; iI <= iTelomerLeft; iI++){\n+\t fprintf(outf, "%1c", \'-\');\n+\t}\n+\t/* this may be unnecessary */\n+\tfor (int iI = iTelomerLeft+1; iI < hit.j1; iI++){\n+\t fprintf(outf, "%1c", ta->seq[k][iI]);\n+\t}\n+ }\n+ else{\n+\tfor (int iI = 1; iI <= -iTelomerLeft; iI++){\n+ fprintf(outf, "%1c", ta->seq[k][iI]);\n+ }\n+\t/* this may be unnecessary */\n+\t/* think about it */\n+ }\n+ /* @<print consensus@> */\n+ for (h = 0; ta->s[k][h] > 0; h++){\n+ fprintf(outf, "%1c", ta->s[k][h]);\n+ }\n+\n+ /* @<print out rght cut-off@> */\n+ for (int iI = hit.j2+1; iI <= ta->L; iI++){\n+ fprintf(outf, "%1c", ta->seq[k][iI]);\n+ }\n+ for (int iI = 0; iI < iTelomerRght; iI++){\n+ fprintf(outf, "%1c", \'-\');\n+ }\n+\n+#else\n+ for (h=0,hh=-par.aliwidth; ta->s[k][h]>0; h++,hh++) \n+\t{\n+\t if (!hh) {fprintf(outf,"\\n"); hh-=par.aliwidth;}\n+\t fprintf(outf,"%1c",ta->s[k][h]); \n+\t}\n+#endif \n+ fprintf(outf,"\\n");\n+ }\n+ fprintf(outf,"\\n");\n+\n+} /* this is the end of PrintA2M() */\n+\n+////////////////////////////////////////////////////////////////////////////\n+/**\n+ * @brief Print out full alignment in A2M format\n+ */\n+void \n+FullAlignment::PrintFASTA(FILE* outf, Hit& hit)\n+{\n+ // Transform sequences to uppercase and \'.\' to \'-\'\n+ qa->ToFASTA();\n+ ta->ToFASTA();\n+ PrintA2M(outf,hit);\n+}\n+\n+//////////////////////////////////////////////////////////////////////////////\n+/**\n+ * @brief Print out full alignment in A2M format\n+ */\n+void \n+FullAlignment::PrintA3M(FILE* outf, Hit& hit)\n+{\n+ // Remove all \'.\' from sequences\n+ qa->RemoveChars(\'.\');\n+ ta->RemoveChars(\'.\');\n+ PrintA2M(outf,hit);\n+}\n+\n+\n+/* \n+ * @* OverWriteSeqs()\n+ */\n+void \n+FullAlignment::OverWriteSeqs(char **ppcFirstProf, char **ppcSecndProf){\n+\n+ int iS, iR;\n+ char cRes;\n+\n+ for (iS = 0; iS < qa->n; iS++){\n+ for (iR = 0; iR < qa->pos; iR++){\n+ cRes = qa->s[iS][iR];\n+ ppcFirstProf[iS][iR] = (\'.\' == cRes) ? \'-\' : cRes;\n+ \n+ } /* 0 <= iR < qa.L */\n+ ppcFirstProf[iS][iR] = \'\\0\';\n+ } /* 0 <= iS < qa.n */\n+ \n+ for (iS = 0; iS < ta->n; iS++){\n+ for (iR = 0; iR < ta->pos; iR++){\n+ cRes = ta->s[iS][iR];\n+ ppcSecndProf[iS][iR] = (\'.\' == cRes) ? \'-\' : cRes;\n+ \n+ } /* 0 <= iR < ta.L */\n+ ppcSecndProf[iS][iR] = \'\\0\';\n+ } /* 0 <= iS < ta.n */\n+ \n+} /* this is the end of OverWriteSeqs() */\n+\n+\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/hhalign/hhfullalignment.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/hhalign/hhfullalignment.h Thu Jul 21 13:35:08 2011 -0400 |
[ |
@@ -0,0 +1,49 @@ +/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ + +/********************************************************************* + * Clustal Omega - Multiple sequence alignment + * + * Copyright (C) 2010 University College Dublin + * + * Clustal-Omega is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This file is part of Clustal-Omega. + * + ********************************************************************/ + +/* + * RCS $Id: hhfullalignment.h 243 2011-05-31 13:49:19Z fabian $ + */ + +////////////////////////////////////////////////////////////////////////////// +// Class for output alignment of query against template sequences +////////////////////////////////////////////////////////////////////////////// + +class FullAlignment +{ +public: + FullAlignment(int maxseqdis=MAXSEQDIS); + ~FullAlignment(); + void FreeMemory(); + int Build(HMM& q, Hit& hit); + void PrintHeader(FILE* outf, HMM& q, Hit& hit); + void PrintHHR(FILE* outf, Hit& hit); + void PrintA2M(FILE* outf, Hit& hit); + void PrintFASTA(FILE* outf, Hit& hit); + void PrintA3M(FILE* outf, Hit& hit); + void OverWriteSeqs(char **ppcFirstProf, char **ppcSecndProf); + int identities; // number of identical residues in query and template sequence + float score_sim; // substitution matrix similarity score between query and template + +private: + HalfAlignment* qa; //query and template parts of the alignment + HalfAlignment* ta; //query and template parts of the alignment + char symbol[LINELEN]; //symbol[h] = symbol (= - . + |) indicating match score for col h of alignment + void ClearSymbols() {for (int h=0; h<LINELEN-1; h++) symbol[h]=' ';} + void AddColumns(int i, int j, char prev_state, char state, float S); + void AddGaps(); + int ScoreChr(float S) {return (S<-1.5?'=':(S<-0.5?'-':(S<0.5?'.':(S<1.5?'+':'|'))));} +}; |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/hhalign/hhfunc-C.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/hhalign/hhfunc-C.h Thu Jul 21 13:35:08 2011 -0400 |
[ |
b'@@ -0,0 +1,1216 @@\n+/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n+\n+/*********************************************************************\n+ * Clustal Omega - Multiple sequence alignment\n+ *\n+ * Copyright (C) 2010 University College Dublin\n+ *\n+ * Clustal-Omega is free software; you can redistribute it and/or\n+ * modify it under the terms of the GNU General Public License as\n+ * published by the Free Software Foundation; either version 2 of the\n+ * License, or (at your option) any later version.\n+ *\n+ * This file is part of Clustal-Omega.\n+ *\n+ ********************************************************************/\n+\n+/*\n+ * RCS $Id: hhfunc-C.h 256 2011-06-23 13:57:28Z fabian $\n+ */\n+\n+/*\n+ * Changelog: Michael Remmert made changes to hhalign stand-alone code \n+ * FS implemented some of the changes on 2010-11-11 -> MR1\n+ *\n+ * did not incorporate SS prediction PSIpred (yet); functions are: \n+ * CalculateSS(3), \n+ */\n+\n+\n+// hhfunc.C\n+\n+\n+/**\n+ * AddBackgroundFrequencies()\n+ *\n+ * @brief add background frequencies (derived from HMM) to \n+ * sequence/profile\n+ *\n+ * @param[in,out] ppfFreq,\n+ * [in] residue frequencies of sequence/profile, \n+ * [out] overlayed with HMM background frequencies\n+ * @param[in,out] ppfPseudoF,\n+ * [in] residue frequencies+pseudocounts of sequence/profile, \n+ * [out] overlayed with HMM background frequencies+pseudocounts\n+ * @param[in] iSeqLen,\n+ * length of sequence/profile (not aligned to HMM)\n+ * @pram[in] prHMM, \n+ * background HMM\n+ * @param[in] ppcSeq,\n+ * sequences/profile to be \'softened\'\n+ * @param[in] pcPrealigned,\n+ * sequence aligned to HMM, this is not quite a consensus,\n+ * it is identical to 1st sequence but over-writes gap information, \n+ * if other sequences in profile have (non-gap) residues\n+ * @param[in] iPreCnt\n+ * number of sequences pre-aligned (pcPrealigned is \'consensus\' of these sequences) \n+ * @param[in] pcRepresent\n+ * sequence representative of HMM, aligned to pcSeq0\n+ */\n+void \n+AddBackgroundFrequencies(float **ppfFreq, float **ppfPseudoF, float **ppfPseudoTr, \n+ int iSeqLen, hmm_light *prHMM,\n+ char **ppcSeq, char *pcPrealigned, int iPreCnt, char *pcRepresent)\n+{\n+\n+ char *pcS = pcPrealigned; /* current residue in pre-aligned sequence */\n+ char *pcH = pcRepresent; /* current residue in pre-aligned HMM */\n+ int iS = 0; /* position in un-aligned sequence (corresponds to pcS) */\n+ int iH = 0; /* position in un-aligned HMM (corresponds to pcH) */\n+ int iA; /* residue iterator */\n+ int iT; /* transition state iterator */\n+ float fFWeight = 0.50 / sqrt((float)(iPreCnt)); /* weight of backgroud frequencies */ /* FIXME: tune value, 0.50 default */\n+ //float fFWeight = 0.75;\n+ float fFThgiew = UNITY - fFWeight; /* weight of \'true\' frequencies */\n+ float fGWeight = 0.50 / sqrt((float)(iPreCnt)); /* weight of backgroud transitions */ /* FIXME: tune value, 0.50 default */\n+ //float fGWeight = 0.50 /*/ (float)(iPreCnt)*/; /* weight of backgroud transitions */ /* FIXME: tune value, 0.50 default */\n+ float fGThgiew = UNITY - fGWeight; /* weight of \'true\' transitions */\n+ float fAux; \n+ /* zf1SeqTrans[] are the (phenomenological) transition probabilities (+ pseudo-counts)\n+ for a single sequence. It is almost certain (0.99) to stay in a match state, and very \n+ unlikely (0.05) to go from match to insertion/deletion */\n+ float zf1SeqTrans[] = {0.98, 0.01, 0.01, 0.25, 0.75, 0.25, 0.75};\n+ float zf1SeqInit[] = {0.98, 0.01, 0.01, 0.99, 0.01, 0.99, 0.01};\n+ float zf1SeqDel[] = {0.24, 0.01, 0.75, 0.01, 0.01, 0.01, 0.01};\n+ float zf1SeqRevrt[] = {0.98, 0.01, 0.01, 0.01, 0.01, 0.99, 0.01};\n+\n+ if ( (NULL == pcPrealigned) || (NULL == pcRepresent) ){\n+ /*printf("%s/%s:%d: WARNING HMM=NULL -- didn\'t think I would get here (carry on, no danger)\\n",\n+ __FUNCTION__, __FILE__, __LINE__);*/\n+ return;\n+ }\n+\n+ if (NULL == prHMM-'..b' *\n+ */\n+extern "C" int\n+readHMMWrapper(hmm_light *rHMM_p, \n+ char *pcHMM_input)\n+{\n+ par.maxResLen = 15002;\n+ HMM rTemp(1000,par.maxResLen); /* temporary template */\n+ Alignment rTempAli; /* temporary alignment */\n+ /* AW changed init from {0} to 0 because it failed to compile with\n+ * gcc 4.3.3 with the following error:\n+ * error: braces around initializer for non-aggregate type \n+ */\n+ /* FS taken out initialiser alltogether */ \n+\n+ /* 0th arg of RnP is the type of RnP, ie, \n+ enum {INTERN_ALN_2_HMM = 0, READ_ALN_2_HMM, READ_HMM_2_HMM};*/\n+ /* 1st arg of ReadAndPrepare() is ppcSeqs, 2nd is #seq */\n+ /* FIXME: at this stage the 3rd arg, rHMM_p, only acts as a dummy.\n+ this is rather silly, as it is the actual struct that will \n+ carry the HMM info at the end. \n+ If we write it already in ReadAndPrepare() then we could \n+ dispense with all this friend-class nonsense */\n+ if (OK != ReadAndPrepare(READ_HMM_2_HMM, \n+ NULL, 0, rHMM_p, NULL, NULL, NULL, \n+ pcHMM_input, rTemp, &rTempAli)) {\n+ return FAILURE;\n+ }\n+\n+ /* an important piece of information I want to get out of here \n+ is the consenssus sequence. there are however certain \n+ Pfam HMMs that don\'t trigger consensus calculation.\n+ at the moment I (FS) don\'t understand why this is \n+ (or rather why this is not). The proper place to do this \n+ should be inside ReadAndPrepare():ReadHMMer(), but \n+ I have not quite penetrated the logic there. \n+ Therefore I try to catch this condition at this point (here) \n+ and rectify it. \n+ */\n+ if (-1 == rHMM_p->ncons){\n+ int i, iA;\n+ rHMM_p->ncons = rHMM_p->nfirst;\n+\n+ for (i = 0; i < rHMM_p->L; i++){\n+ double dPmax = 0.00;\n+ int iAmax = -1;\n+ for (iA = 0; iA < AMINOACIDS; iA++){\n+ if (rHMM_p->f[i][iA] > dPmax){\n+ iAmax = iA;\n+ dPmax = rHMM_p->f[i][iA];\n+ }\n+ } /* (0 <= iA < AMINOACIDS) */\n+ rHMM_p->seq[rHMM_p->ncons][i] = i2aa(iAmax);\n+ } /* (0 <= i < rHMM_p->L) */\n+\n+ } /* ncons not set */\n+\n+\n+ rTemp.ClobberGlobal();\n+ rTempAli.ClobberGlobal();\n+\n+ return OK;\n+\n+} /*** end: readHMMWrapper() ***/\n+\n+\n+\n+\n+\n+\n+/////////////////////////////////////////////////////////////////////////////\n+/**\n+ * @brief Do precalculations for q and t to prepare comparison\n+ */\n+void \n+PrepareTemplate(HMM& q, HMM& t, int format)\n+{\n+ if (format==0) // HHM format\n+ {\n+ // Add transition pseudocounts to template\n+ t.AddTransitionPseudocounts();\n+\n+ // Generate an amino acid frequency matrix from t.f[i][a] with max pseudocounts (tau=1) -> t.g[i][a] \n+ t.PreparePseudocounts();\n+\n+ // Add amino acid pseudocounts to template: t.p[i][a] = (1-tau)*f[i][a] + tau*g[i][a]\n+ t.AddAminoAcidPseudocounts();\n+ }\n+ else // HHMER format\n+ {\n+ // Don\'t add transition pseudocounts to template\n+ // t.AddTransitionPseudocounts(par.gapd, par.gape, par.gapf, par.gapg, par.gaph, par.gapi, 0.0);\n+ \n+ // Generate an amino acid frequency matrix from f[i][a] with full pseudocount admixture (tau=1) -> g[i][a] \n+ t.PreparePseudocounts();\n+\n+ // DON\'T ADD amino acid pseudocounts to temlate: pcm=0! t.p[i][a] = t.f[i][a]\n+ t.AddAminoAcidPseudocounts(0, par.pca, par.pcb, par.pcc);\n+ }\n+\n+ // Modify transition probabilities to include SS-dependent penalties\n+ if (par.ssgap) t.UseSecStrucDependentGapPenalties();\n+\n+ if (par.forward>=1) t.Log2LinTransitionProbs(1.0); \n+\n+ // Factor Null model into HMM t\n+ // ATTENTION! t.p[i][a] is divided by pnul[a] (for reasons of efficiency) => do not reuse t.p\n+ t.IncludeNullModelInHMM(q,t); // Can go BEFORE the loop if not dependent on template\n+ \n+ return;\n+}\n+\n+\n+/*** end of hhfunc-C.h ***/\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/hhalign/hhfunc.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/hhalign/hhfunc.h Thu Jul 21 13:35:08 2011 -0400 |
b |
@@ -0,0 +1,25 @@ +/********************************************************************* + * Clustal Omega - Multiple sequence alignment + * + * Copyright (C) 2010 University College Dublin + * + * Clustal-Omega is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This file is part of Clustal-Omega. + * + ********************************************************************/ + +/* + * RCS $Id: hhfunc.h 143 2010-10-14 13:11:14Z andreas $ + */ + + +int readHMMWrapper(hmm_light *rHMM_p, + char *pcHMM_input); +void FreeHMMstruct(hmm_light *prHMM); +int AlnToHMM2(hmm_light *rHMM_p, + char **ppcSeq, int iN); +int HHMake_Wrapper(char *tmp_aln, char *hmm_out); |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/hhalign/hhhalfalignment-C.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/hhalign/hhhalfalignment-C.h Thu Jul 21 13:35:08 2011 -0400 |
[ |
b'@@ -0,0 +1,450 @@\n+/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n+\n+/*********************************************************************\n+ * Clustal Omega - Multiple sequence alignment\n+ *\n+ * Copyright (C) 2010 University College Dublin\n+ *\n+ * Clustal-Omega is free software; you can redistribute it and/or\n+ * modify it under the terms of the GNU General Public License as\n+ * published by the Free Software Foundation; either version 2 of the\n+ * License, or (at your option) any later version.\n+ *\n+ * This file is part of Clustal-Omega.\n+ *\n+ ********************************************************************/\n+\n+/*\n+ * RCS $Id: hhhalfalignment-C.h 227 2011-03-28 17:03:09Z fabian $\n+ */\n+\n+// hhfullalignment.C\n+\n+#ifndef MAIN\n+#define MAIN\n+#include <iostream> // cin, cout, cerr\n+#include <fstream> // ofstream, ifstream \n+#include <stdio.h> // printf\n+#include <stdlib.h> // exit\n+#include <string> // strcmp, strstr\n+#include <math.h> // sqrt, pow\n+#include <limits.h> // INT_MIN\n+#include <float.h> // FLT_MIN\n+#include <time.h> // clock\n+#include <ctype.h> // islower, isdigit etc\n+using std::ios;\n+using std::ifstream;\n+using std::ofstream;\n+using std::cout;\n+using std::cerr;\n+using std::endl;\n+#include "util-C.h" // imax, fmax, iround, iceil, ifloor, strint, strscn, strcut, substr, uprstr, uprchr, Basename etc.\n+#include "list.h" // list data structure\n+#include "hash.h" // hash data structure\n+#include "hhdecl-C.h" // constants, class \n+#include "hhutil-C.h" // imax, fmax, iround, iceil, ifloor, strint, strscn, strcut, substr, uprstr, uprchr, Basename etc.\n+#include "hhhmm.h" // class HMM\n+#include "hhalignment.h" // class Alignment\n+#include "hhhit.h"\n+#endif\n+\n+/////////////////////////////////////////////////////////////////////////////\n+/////////////////////////////////////////////////////////////////////////////\n+// Methods of class HalfAlignment\n+/////////////////////////////////////////////////////////////////////////////\n+/////////////////////////////////////////////////////////////////////////////\n+ \n+\n+\n+/////////////////////////////////////////////////////////////////////////////\n+// Constructor\n+HalfAlignment::HalfAlignment(int maxseqdis)\n+{\n+ n=0; \n+ sname=seq=NULL; \n+ nss_dssp = nss_pred = nss_conf = nsa_dssp = ncons= -1;\n+ h = new(int[maxseqdis]); //h[k] = next position of sequence k to be written\n+ s = new(char*[maxseqdis]); //s[k][h] = character in column h, sequence k of output alignment\n+ l = new(int*[maxseqdis]); //counts non-gap residues: l[k][i] = index of last residue AT OR BEFORE match state i in seq k\n+ m = new(int*[maxseqdis]); //counts positions: m[k][i] = position of match state i in string seq[k] \n+}\n+\n+/////////////////////////////////////////////////////////////////////////////////////\n+// Destructor\n+HalfAlignment::~HalfAlignment()\n+{\n+ Unset();\n+ delete[] h; h = NULL;\n+ delete[] s; s = NULL;\n+ delete[] l; l = NULL;\n+ delete[] m; m = NULL;\n+}\n+\n+\n+\n+/////////////////////////////////////////////////////////////////////////////////////\n+/**\n+ * @brief Free memory in HalfAlignment arrays s[][], l[][], and m[][]\n+ */\n+void \n+HalfAlignment::Unset()\n+{\n+ // Free memory for alignment characters and residue counts\n+ for (int k=0; k<n; k++) \n+ {\n+ delete[] s[k]; s[k] = NULL;\n+ delete[] l[k]; l[k] = NULL;\n+ delete[] m[k]; m[k] = NULL;\n+ }\n+ n=0; \n+ sname=seq=NULL; \n+ nss_dssp = nss_pred = nss_conf = nsa_dssp = ncons= -1;\n+}\n+\n+\n+//////////////////////////////////////////////////////////////////////////////\n+/**\n+ * @brief Prepare a2m/a3m alignment: \n+ * Calculate l[k][i] (residue indices) and m[k][i] (position in seq[k]) \n+*/\n+void \n+HalfAlignment::Set(char* name, char** seq_in, char** sname_in, int n_in, int L_in, int n1, int n2, int n3, int n4, int nc, int L_in2/*<--FS*/)\n+{\n+ int i; /* counts match states in seq[k] */\n+ int ll; /* counts resi'..b'////////////////////////////////////////////////////////////\n+/**\n+ * @brief Transform alignment sequences from A3M to A2M (insert ".")\n+ */\n+void \n+HalfAlignment::BuildA2M()\n+{\n+ AddInserts(0); \n+ FillUpGaps();\n+ for (int i=1; i<=L; i++)\n+ {\n+ AddColumn(i); \n+ AddInserts(i); \n+ FillUpGaps();\n+ }\n+ AddChar(\'\\0\');\n+}\n+\n+/////////////////////////////////////////////////////////////////////////////////////\n+/**\n+ * @brief Transform alignment sequences from A3M to A2M (insert ".")\n+ */\n+void \n+HalfAlignment::BuildA3M()\n+{\n+ AddInserts(0); \n+ for (int i=1; i<=L; i++)\n+ {\n+ AddColumn(i); \n+ AddInserts(i); \n+ }\n+ AddChar(\'\\0\');\n+}\n+\n+/////////////////////////////////////////////////////////////////////////////////////\n+/**\n+ * @brief Transform alignment sequences from A2M to FASTA ( lowercase to uppercase and \'.\' to \'-\')\n+ */\n+void \n+HalfAlignment::ToFASTA()\n+{\n+ for (int k=0; k<n; k++)\n+ {\n+ uprstr(s[k]);\n+ strtr(s[k],".","-");\n+ }\n+}\n+\n+/////////////////////////////////////////////////////////////////////////////////////\n+/**\n+ * @brief Align query (HalfAlignment) to template (i.e. hit) match state structure\n+ */\n+void \n+HalfAlignment::AlignToTemplate(Hit& hit)\n+{\n+ int i,j;\n+ int step; // column of the HMM-HMM alignment (first:nstep, last:1)\n+ char state;\n+\n+ if(0) { //par.loc==0) { //////////////////////////////////////////// STILL NEEDED??\n+ // If in global mode: Add part of alignment before first MM state\n+ AddInserts(0); // Fill in insert states before first match state\n+ for (i=1; i<hit.i[hit.nsteps]; i++)\n+ {\n+\tAddColumnAsInsert(i);\n+\tAddInserts(i);\n+\tif (par.outformat<=2) FillUpGaps();\n+ }\n+ }\n+\n+ // Add endgaps (First state must be an MM state!!)\n+ for (j=1; j<hit.j[hit.nsteps]; j++) \n+ {\n+ AddChar(\'-\');\n+ }\n+\n+ // Add alignment between first and last MM state\n+ for (step=hit.nsteps; step>=1; step--) \n+ {\n+ state = hit.states[step];\n+ i = hit.i[step];\n+\n+ switch(state)\n+ {\n+ case MM: //MM pair state (both query and template in Match state)\n+\tAddColumn(i);\n+\tAddInserts(i);\n+\tbreak;\n+ case DG: //D- state\n+ case MI: //MI state\n+\tAddColumnAsInsert(i);\n+\tAddInserts(i);\n+\tbreak;\n+ case GD: //-D state\n+ case IM: //IM state\n+\tAddChar(\'-\');\n+\tbreak;\n+ }\n+ if (par.outformat<=2) FillUpGaps();\n+\n+ }\n+\n+ if(0) { //par.loc==0) { //////////////////////////////////////////// STILL NEEDED??\n+\n+ // If in global mode: Add part of alignment after last MM state\n+ for (i=hit.i[1]+1; i<=L; i++) \n+ {\n+\tAddColumnAsInsert(i);\n+\tAddInserts(i);\n+\tif (par.outformat==2) FillUpGaps();\n+ }\n+ }\n+\n+ // Add endgaps \n+ for (j=hit.j[1]+1; j<=hit.L; j++) \n+ {\n+ AddChar(\'-\');\n+ }\n+\n+ // Add end-of-string character\n+ AddChar(\'\\0\');\n+}\n+\n+\n+/////////////////////////////////////////////////////////////////////////////////////\n+/**\n+ * @brief Write the a2m/a3m alignment into alnfile \n+ */\n+void \n+HalfAlignment::Print(char* alnfile)\n+{\n+ int k; //counts sequences\n+ int omitted=0; // counts number of sequences with no residues in match states\n+ FILE *outf;\n+ if (strcmp(alnfile,"stdout"))\n+ {\n+ if (par.append) outf=fopen(alnfile,"a"); else outf=fopen(alnfile,"w");\n+ if (!outf) OpenFileError(alnfile);\n+ } \n+ else\n+ outf = stdout;\n+ if (v>=3) cout<<"Writing alignment to "<<alnfile<<"\\n";\n+\n+ for (k=0; k<n; k++)\n+ {\n+ // Print sequence only if it contains at least one residue in a match state\n+ if (1) //strpbrk(s[k],"ABCDEFGHIKLMNPQRSTUVWXYZ1234567890")) \n+\t{\n+\t fprintf(outf,">%s\\n",sname[k]);\n+\t fprintf(outf,"%s\\n",s[k]);\n+\t} else {\n+\t omitted++;\n+\t if (v>=3) printf("%-14.14s contains no residue in match state. Omitting sequence\\n",sname[k]);\n+\t}\n+ }\n+ if (v>=2 && omitted) printf("Omitted %i sequences in %s which contained no residue in match state\\n",omitted,alnfile);\n+ fclose(outf);\n+}\n+\n+\n+/** EOF hhhalfalignment-C.h **/\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/hhalign/hhhalfalignment.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/hhalign/hhhalfalignment.h Thu Jul 21 13:35:08 2011 -0400 |
[ |
@@ -0,0 +1,101 @@ +/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ + +/********************************************************************* + * Clustal Omega - Multiple sequence alignment + * + * Copyright (C) 2010 University College Dublin + * + * Clustal-Omega is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This file is part of Clustal-Omega. + * + ********************************************************************/ + +/* + * RCS $Id: hhhalfalignment.h 143 2010-10-14 13:11:14Z andreas $ + */ + +///////////////////////////////////////////////////////////////////////////////////// +// Class representing a2m/a3m-formatted alignment corresponding to one HMM +///////////////////////////////////////////////////////////////////////////////////// + + +class HalfAlignment +{ +public: + HalfAlignment(int maxseqdis=MAXSEQDIS); + ~HalfAlignment(); + + // Initialize HalfAlignment; create index arrays s [],l[], m[] + void Set(char* name, char** seq_in, char** sname_in, int n_in, int L_in, int n1, int n2, int n3, int n4, int nc, int L_in2/*<--FS*/); + + // Free memory in HalfAlignment arrays s[][], l[][], and m[][] + void Unset(); + + // Align query (HalfAlignment) to template (i.e. hit) match state structure + void AlignToTemplate(Hit& hit); + + // Write the a2m/a3m query alignment into alnfile + void Print(char* outfile); + + // Fill in insert states following match state i + void AddInserts(int i); + + // Fill up alignment with gaps '.' to generate flush end (all h[k] equal) + void FillUpGaps(); + + // Fill in insert states following match state i and fill up gaps with '.' + void AddInsertsAndFillUpGaps(int i); + + // Add gap column '.' or character column + void AddChar(char c); + + // Add match state column i as is + void AddColumn(int i); + + // Add match state column i as insert state + void AddColumnAsInsert(int i); + + // Build alignment in FASTA format + void BuildFASTA(); + + // Build alignment in A2M format + void BuildA2M(); + + // Build alignment in A3M format + void BuildA3M(); + + // Transform alignment sequences from A2M to FASTA ( lowercase to uppercase and '.' to '-') + void ToFASTA(); + + // Remove all characters c from template sequences + void RemoveChars(char c); + +private: + friend class FullAlignment; + + int n; //number of sequences in half-alignment + char** seq; //sequences (in ASCII) in alignment + char** sname; //names of sequences in alignment + int nss_dssp; //index of sequence with dssp sec structure states + int nsa_dssp; //index of sequence with dssp solvent accessiblity states + int nss_pred; //index of sequence with predicted sec structure states + int nss_conf; //index of sequence with prediction confidence values + int ncons; //index of consensus sequence + + int pos; //After FillUpGaps() all h[k] have value pos + int L; //number of match states in corresponding profile + int* h; //h[k] = next position of sequence k to be written + char** s; //s[k][h] = column h, sequence k of output alignment + int** l; //counts non-gap residues: l[k][i] = index of last residue AT OR BEFORE match state i in seq k + int** m; //counts positions: m[k][i] = position of match state i in string seq[k] +/* int h[MAXSEQ]; //h[k] = next position of sequence k to be written */ +/* char* s[MAXSEQ]; //s[k][h] = column h, sequence k of output alignment */ +/* int* l[MAXSEQ]; //counts non-gap residues: l[k][i] = index of last residue AT OR BEFORE match state i in seq k */ +/* int* m[MAXSEQ]; //counts positions: m[k][i] = position of match state i in string seq[k] */ +}; + + |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/hhalign/hhhit-C.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/hhalign/hhhit-C.h Thu Jul 21 13:35:08 2011 -0400 |
[ |
b'@@ -0,0 +1,2236 @@\n+/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n+\n+/*********************************************************************\n+ * Clustal Omega - Multiple sequence alignment\n+ *\n+ * Copyright (C) 2010 University College Dublin\n+ *\n+ * Clustal-Omega is free software; you can redistribute it and/or\n+ * modify it under the terms of the GNU General Public License as\n+ * published by the Free Software Foundation; either version 2 of the\n+ * License, or (at your option) any later version.\n+ *\n+ * This file is part of Clustal-Omega.\n+ *\n+ ********************************************************************/\n+\n+/*\n+ * RCS $Id: hhhit-C.h 245 2011-06-15 12:38:53Z fabian $\n+ */\n+\n+// hhhit.C\n+\n+#ifndef MAIN\n+#define MAIN\n+#include <iostream> // cin, cout, cerr\n+#include <fstream> // ofstream, ifstream \n+#include <stdio.h> // printf\n+using std::cout;\n+using std::cerr;\n+using std::endl;\n+using std::ios;\n+using std::ifstream;\n+using std::ofstream;\n+#include <stdlib.h> // exit\n+#include <string> // strcmp, strstr\n+#include <math.h> // sqrt, pow\n+#include <limits.h> // INT_MIN\n+#include <float.h> // FLT_MIN\n+#include <time.h> // clock\n+#include <ctype.h> // islower, isdigit etc\n+#include "util-C.h" // imax, fmax, iround, iceil, ifloor, strint, strscn, strcut, substr, uprstr, uprchr, Basename etc.\n+#include "list.h" // list data structure\n+#include "hash.h" // hash data structure\n+#include "hhdecl-C.h" // constants, class \n+#include "hhutil-C.h" // imax, fmax, iround, iceil, ifloor, strint, strscn, strcut, substr, uprstr, uprchr, Basename etc.\n+#include "hhhmm.h" // class HMM\n+#include "hhalignment.h" // class Alignment\n+#include "hhhitlist.h" // class HitList\n+#endif\n+\n+#define CALCULATE_MAX6(max, var1, var2, var3, var4, var5, var6, varb) \\\n+if (var1>var2) { max=var1; varb=STOP;} \\\n+else { max=var2; varb=MM;}; \\\n+if (var3>max) { max=var3; varb=GD;}; \\\n+if (var4>max) { max=var4; varb=IM;}; \\\n+if (var5>max) { max=var5; varb=DG;}; \\\n+if (var6>max) { max=var6; varb=MI;}; \n+\n+#define CALCULATE_SUM6(sum, var1, var2, var3, var4, var5, var6, varb) \\\n+if (var1>var2) { sum=var1; varb=STOP;} \\\n+else { sum=var2; varb=MM;}; \\\n+if (var3>sum) { sum=var3; varb=GD;}; \\\n+if (var4>sum) { sum=var4; varb=IM;}; \\\n+if (var5>sum) { sum=var5; varb=DG;}; \\\n+if (var6>sum) { sum=var6; varb=MI;}; \\\n+sum = var1 + var2 + var3 + var4 + var5 + var6;\n+\n+#define CALCULATE_MAX4(max, var1, var2, var3, var4, varb) \\\n+if (var1>var2) { max=var1; varb=STOP;} \\\n+else { max=var2; varb=MM;}; \\\n+if (var3>max) { max=var3; varb=MI;}; \\\n+if (var4>max) { max=var4; varb=IM;}; \n+\n+// Generate random number in [0,1[\n+#define frand() ((float) rand()/(RAND_MAX+1.0))\n+\n+\n+// Function declarations\n+inline float Score(float* qi, float* tj);\n+inline float ProbFwd(float* qi, float* tj);\n+inline float max2(const float& xMM, const float& xX, char& b); \n+inline int pickprob2(const double& xMM, const double& xX, const int& state); \n+inline int pickprob3_GD(const double& xMM, const double& xDG, const double& xGD); \n+inline int pickprob3_IM(const double& xMM, const double& xMI, const double& xIM); \n+inline int pickprob6(const double& x0, const double& xMM, const double& xGD, const double& xIM, const double& xDG, const double& xMI); \n+inline int pickmax2(const double& xMM, const double& xX, const int& state); \n+inline int pickmax3_GD(const double& xMM, const double& xDG, const double& xGD); \n+inline int pickmax3_IM(const double& xMM, const double& xMI, const double& xIM); \n+inline int pickmax6(const double& x0, const double& xMM, const double& xGD, const double& xIM, const double& xDG, const double& xMI); \n+inline double Pvalue(double x, double a[]);\n+inline double Pvalue(float x, float lamda, float mu);\n+inline double logPvalue(float x, float lamda, float mu);\n+inline double logPvalue(float x, double a[]);\n+inline double Probab(Hit& hit);\n+\n+////////////////////'..b'k[j]*Weff_M;\n+// \t Q.tr_lin[i][D2M]+= t.tr_lin[j][D2M]*wk[j]*Weff_D;\n+// \t Q.tr_lin[i][D2D]+= t.tr_lin[j][D2D]*wk[j]*Weff_D;\n+// \t Q.tr_lin[i][I2I]+= t.tr_lin[j][I2I]*wk[j]*Weff_I;\n+// \t Q.tr_lin[i][M2M]+= t.tr_lin[j][I2M]*wk[j]*Weff_I;\n+// \t break;\n+// \t }\n+// \t break;\n+\t \n+// \tcase IM: // if gap in query \n+// \t Weff_M = Weff(t.Neff_M[j]-1.0);\n+// \t switch(states[step-1])\n+// \t {\n+// \t case IM: // IM->IM\n+// \t Q.tr_lin[i][I2I]+= t.tr_lin[j][M2M]*wk[j]*Weff_M;\n+// \t Q.tr_lin[i][I2M]+= t.tr_lin[j][M2D]*wk[j]*Weff_M;\n+// \t Q.tr_lin[i][I2I]+= t.tr_lin[j][M2I]*wk[j]*Weff_M;\n+// \t break;\n+// \t case MM: // IM->MM\n+// \t Weff_D = Weff(t.Neff_D[j]-1.0);\n+// \t Weff_I = Weff(t.Neff_I[j]-1.0);\n+// \t Q.tr_lin[i][I2M]+= t.tr_lin[j][M2M]*wk[j]*Weff_M;\n+// \t Q.tr_lin[i][I2M]+= t.tr_lin[j][M2D]*wk[j]*Weff_M;\n+// \t Q.tr_lin[i][I2I]+= t.tr_lin[j][M2I]*wk[j]*Weff_M;\n+// \t Q.tr_lin[i][I2M]+= t.tr_lin[j][D2M]*wk[j]*Weff_D;\n+// \t Q.tr_lin[i][D2D]+= t.tr_lin[j][D2D]*wk[j]*Weff_D;\n+// \t Q.tr_lin[i][I2M]+= t.tr_lin[j][I2M]*wk[j]*Weff_I;\n+// \t Q.tr_lin[i][I2I]+= t.tr_lin[j][I2I]*wk[j]*Weff_I;\n+// \t break;\n+// \t }\n+// \t break;\n+\t \n+// \tcase GD: \n+// \t Weff_M = Weff(t.Neff_M[j]-1.0);\n+// \t switch(states[step-1])\n+// \t {\n+// \t case GD: // GD->GD\n+// \t Weff_I = Weff(t.Neff_I[j]-1.0);\n+// \t Q.tr_lin[i][I2I]+= t.tr_lin[j][M2M]*wk[j]*Weff_M;\n+// \t Q.tr_lin[i][I2M]+= t.tr_lin[j][M2D]*wk[j]*Weff_M;\n+// \t Q.tr_lin[i][I2I]+= t.tr_lin[j][M2I]*wk[j]*Weff_M;\n+// \t Q.tr_lin[i][I2I]+= t.tr_lin[j][I2M]*wk[j]*Weff_I;\n+// \t Q.tr_lin[i][I2I]+= t.tr_lin[j][I2I]*wk[j]*Weff_I;\n+// \t break;\n+// \t case MM: // GD->MM\n+// \t Weff_D = Weff(t.Neff_D[j]-1.0);\n+// \t Weff_I = Weff(t.Neff_I[j]-1.0);\n+// \t Q.tr_lin[i][I2M]+= t.tr_lin[j][M2M]*wk[j]*Weff_M;\n+// \t Q.tr_lin[i][I2M]+= t.tr_lin[j][M2D]*wk[j]*Weff_M;\n+// \t Q.tr_lin[i][I2I]+= t.tr_lin[j][M2I]*wk[j]*Weff_M;\n+// \t Q.tr_lin[i][D2D]+= t.tr_lin[j][D2D]*wk[j]*Weff_D;\n+// \t Q.tr_lin[i][I2M]+= t.tr_lin[j][I2M]*wk[j]*Weff_I;\n+// \t Q.tr_lin[i][I2I]+= t.tr_lin[j][I2I]*wk[j]*Weff_I;\n+// \t break;\n+// \t }\n+// \t break;\n+\n+// \t}\n+// }\n+// i = this->i[step];\n+// j = this->j[step];\n+// Weff_M = Weff(t.Neff_M[j]-1.0);\n+// for (a=0; a<20; a++) Q.f[i][a] += t.f[j][a]*wk[j]*Weff_M;\n+// }\n+\n+\n+#ifdef CLUSTALO\n+/* @* Hit::ClobberGlobal (eg, hit)\n+ *\n+ */\n+void \n+Hit::ClobberGlobal(void){\n+\n+ if (i){\n+ //delete[] i; \n+ i = NULL;\n+ }\n+ if (j){\n+ //delete[] j; \n+ j = NULL;\n+ }\n+ if (states){\n+ //delete[] states; \n+ states = NULL;\n+ }\n+ if (S){\n+ //delete[] S; \n+ S = NULL;\n+ }\n+ if (S_ss){\n+ //delete[] S_ss; \n+ S_ss = NULL;\n+ }\n+ if (P_posterior){\n+ //delete[] P_posterior; \n+ P_posterior = NULL;\n+ }\n+ if (Xcons){\n+ //delete[] Xcons; \n+ Xcons = NULL;\n+ }\n+ // delete[] l; l = NULL;\n+ i = j = NULL;\n+ states = NULL;\n+ S = S_ss = P_posterior = NULL;\n+ Xcons = NULL;\n+ if (irep==1) // if irep>1 then longname etc point to the same memory locations as the first repeat. \n+ { // but these have already been deleted.\n+\t// \tprintf("Delete name = %s\\n",name);//////////////////////////\n+\t//delete[] longname; \n+\tlongname = NULL;\n+\t//delete[] name; \n+\tname = NULL;\n+\t//delete[] file; \n+\tfile = NULL;\n+\t//delete[] dbfile; \n+\tdbfile = NULL;\n+\t/*for (int k=0; k<n_display; k++) \n+\t {\n+\t delete[] sname[k]; sname[k] = NULL;\n+\t delete[] seq[k]; seq[k] = NULL;\n+\t }*/\n+\t//delete[] sname; \n+\tsname = NULL;\n+\t//delete[] seq; \n+\tseq = NULL;\n+ }\n+\n+ score = score_sort = score_aass = 0.0;\n+ Pval = Pvalt = Eval = Probab = 0;\n+ Pforward = sum_of_probs = 0.00;\n+ L = irep = nrep = n_display = nsteps = 0;\n+ i1 = i2 = j1 = j2 = matched_cols = min_overlap = 0;\n+}\n+#endif\n+\n+\n+/*\n+ * EOF hhhit-C.h\n+ */\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/hhalign/hhhit.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/hhalign/hhhit.h Thu Jul 21 13:35:08 2011 -0400 |
[ |
b'@@ -0,0 +1,192 @@\n+/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n+\n+/*********************************************************************\n+ * Clustal Omega - Multiple sequence alignment\n+ *\n+ * Copyright (C) 2010 University College Dublin\n+ *\n+ * Clustal-Omega is free software; you can redistribute it and/or\n+ * modify it under the terms of the GNU General Public License as\n+ * published by the Free Software Foundation; either version 2 of the\n+ * License, or (at your option) any later version.\n+ *\n+ * This file is part of Clustal-Omega.\n+ *\n+ ********************************************************************/\n+\n+/*\n+ * RCS $Id: hhhit.h 243 2011-05-31 13:49:19Z fabian $\n+ */\n+\n+// hhhit.h\n+\n+//////////////////////////////////////////////////////////////////////////////\n+/* Describes an alignment of two profiles. \n+ Used as list element in Hits : List<Hit> */\n+//////////////////////////////////////////////////////////////////////////////\n+class Hit\n+{\n+ public: \n+ char* longname; // Name of HMM\n+ char* name; // One-word name of HMM\n+ char* file; // Basename (with path, without extension) of alignment file that was used to construct the HMM\n+ // (path from db-file is prepended to FILE record in HMM file!)\n+ char fam[IDLEN]; // family ID (derived from name) (FAM field)\n+ char sfam[IDLEN]; // superfamily ID (derived from name) \n+ char fold[IDLEN]; // fold ID (derived from name)\n+ char cl[IDLEN]; // class ID (derived from name)\n+ int index; // index of HMM in order of reading in (first=0)\n+ char* dbfile; // full database file name from which HMM was read\n+ long ftellpos; // start position of HMM in database file\n+\n+ float score; // Score of alignment (i.e. of Viterbi path)\n+ float score_sort; // score to sort hits in output list (negative means first/best!)\n+ float score_aass; // first: just hit.score, then hit.logPval-SSSCORE2NATLOG*hit.score_ss;(negative means best!)\n+ float score_ss; // Part of score due to secondary structure\n+ float Pval; // P-value for whole protein based on score distribution of query\n+ float Pvalt; // P-value for whole protein based on score distribution of template\n+ float logPval; // natural logarithm of Pval\n+ float logPvalt; // natural logarithm of Pvalt\n+ float Eval; // E-value for whole protein\n+ float Probab; // probability in % for a positive (depends only on score)\n+ float weight; // weight of hit for P-value calculation (= 1/#HMMs-in-family/#families-in-superfamily)\n+ double Pforward; // scaled total forward probability : Pforward * Product_{i=1}^{Lq+1}(scale[i])\n+ \n+/* float score_comp; // compositional similarity score */\n+/* float logPcomp; // natural logarithm of Pvalue for compositional similarity score */\n+/* float Prep; // P-value for single-repeat hit */\n+/* float Erep; // E-value for single-repeat hit */\n+/* float logPrep; // natural logarithm of P-value for single-repeat hit */\n+ float E1val; // E-value for whole protein from transitive scoring\n+ float logP1val; // natural logarithm of P1val, the transitive P-value\n+\n+ int L; // Number of match states in template\n+ int irep; // Index of single-repeat hit (1: highest scoring repeat hit)\n+ int nrep; // Number of single-repeat hits with one template\n+ \n+ int n_display; // number of sequences stored for display of alignment \n+ char** sname; // names of stored sequences \n+ char** seq; // residues of stored sequences (first at pos 1)\n+ int nss_dssp; // index of dssp secondary structure sequence in seq[]\n+ int nsa_dssp; // index of of dssp solvent accessibility in seq[]\n+ int nss_pred; // index of dssp secondary structure sequence in seq[]\n+ int '..b'\n+ int min_overlap; // Minimum overlap between query and template\n+ float sum_of_probs; // sum of probabilities for Maximum ACcuracy alignment (if dssp states defined, only aligned pairs with defined dssp state contribute to sum)\n+ float Neff_HMM; // Diversity of underlying alignment\n+\n+ // Constructor (only set pointers to NULL)\n+ Hit();\n+ ~Hit(){};\n+ \n+ // Free all allocated memory (to delete list of hits)\n+ void Delete();\n+\n+ // Allocate/delete memory for dynamic programming matrix\n+ void AllocateBacktraceMatrix(int Nq, int Nt);\n+ void DeleteBacktraceMatrix(int Nq);\n+ void AllocateForwardMatrix(int Nq, int Nt);\n+ void DeleteForwardMatrix(int Nq);\n+ void AllocateBackwardMatrix(int Nq, int Nt);\n+ void DeleteBackwardMatrix(int Nq);\n+ \n+ // Compare an HMM with overlapping subalignments\n+ void Viterbi(HMM& q, HMM& t, float** Sstruc=NULL);\n+\n+ // Compare two HMMs with each other in lin space\n+ int Forward(HMM& q, HMM& t, float** Pstruc=NULL);\n+\n+ // Compare two HMMs with each other in lin space\n+ int Backward(HMM& q, HMM& t);\n+\n+ // Find maximum accuracy alignment (after running Forward and Backward algorithms)\n+ void MACAlignment(HMM& q, HMM& t);\n+\n+ // Trace back alignment of two profiles based on matrices bXX[][]\n+ void Backtrace(HMM& q, HMM& t);\n+\n+ // Trace back alignment of two profiles based on matrices bXX[][]\n+ void StochasticBacktrace(HMM& q, HMM& t, char maximize=0);\n+\n+ // Trace back MAC alignment of two profiles based on matrix bMM[][]\n+ void BacktraceMAC(HMM& q, HMM& t);\n+\n+ // Calculate secondary structure score between columns i and j of two HMMs (query and template)\n+ inline float ScoreSS(HMM& q, HMM& t, int i, int j, int ssm);\n+\n+ // Calculate secondary structure score between columns i and j of two HMMs (query and template)\n+ inline float ScoreSS(HMM& q, HMM& t, int i, int j);\n+\n+ // Calculate total score (including secondary structure score and compositional bias correction\n+ inline float ScoreTot(HMM& q, HMM& t, int i, int j);\n+\n+ // Calculate score (excluding secondary structure score and compositional bias correction\n+ inline float ScoreAA(HMM& q, HMM& t, int i, int j);\n+\n+ // Comparison (used to sort list of hits)\n+ int operator<(const Hit& hit2) {return score_sort<hit2.score_sort;}\n+\n+ // Merge HMM with next aligned HMM \n+ void MergeHMM(HMM& Q, HMM& t, float wk[]);\n+\n+#ifdef CLUSTALO\n+ void ClobberGlobal(void);\n+#endif \n+\n+\n+ double** B_MM; // Backward matrices\n+ \n+private:\n+ char state; // 0: Start/STOP state 1: MM state 2: GD state (-D) 3: IM state 4: DG state (D-) 5 MI state\n+ char** bMM; // (backtracing) bMM[i][j] = STOP:start of alignment MM:prev was MM GD:prev was GD etc\n+ char** bGD; // (backtracing) bMM[i][j] = STOP:start of alignment MM:prev was MM SAME:prev was GD\n+ char** bDG; // (backtracing)\n+ char** bIM; // (backtracing)\n+ char** bMI; // (backtracing)\n+ char** cell_off; // cell_off[i][j]=1 means this cell will get score -infinity\n+\n+ double** F_MM; // Forward matrices \n+ double** F_GD; // F_XY[i][j] * Prod_1^i(scale[i]) \n+ double** F_DG; // = Sum_x1..xl{ P(HMMs aligned up to Xi||Yj co-emmitted x1..xl ) / (Prod_k=1^l f(x_k)) } \n+ double** F_IM; // end gaps are not penalized!\n+ double** F_MI; // \n+ double* scale; // \n+\n+ double** B_GD; // B_XY[i][j] * Prod_i+1^(L+1) (scale[i])\n+ double** B_DG; // = Sum_x2..xl{ P(HMMs aligned from Xi||Yj to end co-emmitted x2..xl ) / (Prod_k=2^l f(x_k)) } \n+ double** B_IM; // end gaps are not penalized!\n+ double** B_MI; // \n+\n+ void InitializeBacktrace(HMM& q, HMM& t);\n+ void InitializeForAlignment(HMM& q, HMM& t);\n+};\n+\n+\n+double Pvalue(double x, double a[]);\n+double Pvalue(float x, float lamda, float mu);\n+double logPvalue(float x, float lamda, float mu);\n+double logPvalue(float x, double a[]);\n+double Probab(Hit& hit);\n+\n+\n+\n+\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/hhalign/hhhitlist-C.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/hhalign/hhhitlist-C.h Thu Jul 21 13:35:08 2011 -0400 |
[ |
b'@@ -0,0 +1,3206 @@\n+/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n+\n+/*********************************************************************\n+ * Clustal Omega - Multiple sequence alignment\n+ *\n+ * Copyright (C) 2010 University College Dublin\n+ *\n+ * Clustal-Omega is free software; you can redistribute it and/or\n+ * modify it under the terms of the GNU General Public License as\n+ * published by the Free Software Foundation; either version 2 of the\n+ * License, or (at your option) any later version.\n+ *\n+ * This file is part of Clustal-Omega.\n+ *\n+ ********************************************************************/\n+\n+/*\n+ * RCS $Id: hhhitlist-C.h 243 2011-05-31 13:49:19Z fabian $\n+ */\n+\n+// hhhitlist.C\n+\n+#ifndef MAIN\n+#define MAIN\n+#include <iostream> // cin, cout, cerr\n+#include <fstream> // ofstream, ifstream \n+#include <stdio.h> // printf\n+#include <stdlib.h> // exit\n+#include <string> // strcmp, strstr\n+#include <math.h> // sqrt, pow\n+#include <limits.h> // INT_MIN\n+#include <float.h> // FLT_MIN\n+#include <time.h> // clock\n+#include <ctype.h> // islower, isdigit etc\n+using std::ios;\n+using std::ifstream;\n+using std::ofstream;\n+using std::cout;\n+using std::cerr;\n+using std::endl;\n+#include "util-C.h" // imax, fmax, iround, iceil, ifloor, strint, strscn, strcut, substr, uprstr, uprchr, Basename etc.\n+#include "list.h" // list data structure\n+#include "hash.h" // hash data structure\n+#include "hhdecl-C.h" // constants, class \n+#include "hhutil-C.h" // imax, fmax, iround, iceil, ifloor, strint, strscn, strcut, substr, uprstr, uprchr, Basename etc.\n+#include "hhhmm.h" // class HMM\n+#include "hhalignment.h" // class Alignment\n+#include "hhhit.h"\n+#include "hhhalfalignment.h"\n+#include "hhfullalignment.h"\n+#endif\n+\n+\n+//////////////////////////////////////////////////////////////////////////////\n+//////////////////////////////////////////////////////////////////////////////\n+//// Methods of class HitList\n+//////////////////////////////////////////////////////////////////////////////\n+//////////////////////////////////////////////////////////////////////////////\n+\n+\n+\n+//////////////////////////////////////////////////////////////////////////////\n+/**\n+ * @brief Print summary listing of hits\n+ */\n+void \n+HitList::PrintHitList(HMM& q, char* outfile)\n+{\n+ Hit hit;\n+ int nhits=0;\n+ char str[NAMELEN]="";\n+\n+ FILE* outf=NULL;\n+ if (strcmp(outfile,"stdout"))\n+ {\n+ outf=fopen(outfile,"w");\n+ if (!outf) OpenFileError(outfile);\n+ }\n+ else\n+ outf = stdout;\n+\n+\n+ fprintf(outf,"Query %s\\n",q.longname); \n+// fprintf(outf,"Family %s\\n",q.fam); \n+ fprintf(outf,"Match_columns %i\\n",q.L);\n+ fprintf(outf,"No_of_seqs %i out of %i\\n",q.N_filtered,q.N_in);\n+ fprintf(outf,"Neff %-4.1f\\n",q.Neff_HMM);\n+ fprintf(outf,"Searched_HMMs %i\\n",N_searched);\n+ \n+ // Print date stamp\n+ time_t* tp=new(time_t);\n+ *tp=time(NULL);\n+ fprintf(outf,"Date %s",ctime(tp));\n+ delete (tp); (tp) = NULL;\n+ \n+ // Print command line\n+ fprintf(outf,"Command "); \n+ for (int i=0; i<par.argc; i++) \n+ if (strlen(par.argv[i])<=par.maxdbstrlen)\n+ fprintf(outf,"%s ",par.argv[i]);\n+ else\n+ fprintf(outf,"<%i characters> ",(int)strlen(par.argv[i]));\n+ fprintf(outf,"\\n\\n"); \n+ \n+#ifdef WINDOWS \n+ if (par.trans) \n+ fprintf(outf," No Hit Prob E-trans E-value Score SS Cols Query HMM Template HMM\\n");\n+ else \n+ fprintf(outf," No Hit Prob E-value P-value Score SS Cols Query HMM Template HMM\\n");\n+#else\n+ if (par.trans) \n+ fprintf(outf," No Hit Prob E-trans E-value Score SS Cols Query HMM Template HMM\\n");\n+ else \n+ fprintf(outf," No Hit Prob E-value P-value Score SS Cols Query HMM Template HMM\\n");\n+#endif\n+\n+ Reset();\n+ while (!End()) // print hit lis'..b'[l])+anorm) == anorm) {\n+\t flag=0;\n+\t break;\n+\t}\n+\tif ((double)(fabs(w[nm])+anorm) == anorm) break;\n+ }\n+ if (flag) {\n+\t// Cancellation of rv1[l], if l > 1.\n+\tc=0.0;\n+\ts=1.0;\n+\tfor (i=l;i<=k;i++) {\n+\t f=s*rv1[i];\n+\t rv1[i]=c*rv1[i];\n+\t if ((double)(fabs(f)+anorm) == anorm) break;\n+\t g=w[i];\n+\t h=pythag(f,g);\n+\t w[i]=h;\n+\t h=1.0/h;\n+\t c=g*h;\n+\t s = -f*h;\n+\t for (j=0;j<m;j++) {\n+\t y=A[nm][j];\n+\t z=A[i][j];\n+\t A[nm][j]=y*c+z*s;\n+\t A[i][j]=z*c-y*s;\n+\t }\n+\t}\n+ }\n+ z=w[k];\n+ // Convergence.\n+ if (l == k) {\n+\t// Singular value is made nonnegative.\n+\tif (z < 0.0) {\n+\t w[k] = -z;\n+\t for (j=0;j<n;j++) V[k][j] = -V[k][j];\n+\t}\n+\tbreak;\n+ }\n+ if (its == 30) {printf("Error in SVD: no convergence in 30 iterations\\n"); exit(7);}\n+ // Shift from bottom 2-by-2 minor.\n+ x=w[l];\n+ nm=k-1;\n+ y=w[nm];\n+ g=rv1[nm];\n+ h=rv1[k];\n+ f=((y-z)*(y+z)+(g-h)*(g+h))/(2.0*h*y);\n+ g=pythag(f,1.0);\n+ f=((x-z)*(x+z)+h*((y/(f+SIGN(g,f)))-h))/x;\n+ // Next QR transformation:\n+ c=s=1.0;\n+ for (j=l;j<=nm;j++) {\n+\ti=j+1;\n+\tg=rv1[i];\n+\ty=w[i];\n+\th=s*g;\n+\tg=c*g;\n+\tz=pythag(f,h);\n+\trv1[j]=z;\n+\tc=f/z;\n+\ts=h/z;\n+\tf=x*c+g*s;\n+\tg = g*c-x*s;\n+\th=y*s;\n+\ty *= c;\n+\tfor (jj=0;jj<n;jj++) {\n+\t x=V[j][jj];\n+\t z=V[i][jj];\n+\t V[j][jj]=x*c+z*s;\n+\t V[i][jj]=z*c-x*s;\n+\t}\n+\tz=pythag(f,h);\n+\t// Rotation can be arbitrary if z = 0.\n+\tw[j]=z;\n+\tif (z) {\n+\t z=1.0/z;\n+\t c=f*z;\n+\t s=h*z;\n+\t}\n+\tf=c*g+s*y;\n+\tx=c*y-s*g;\n+\t\n+\tfor (jj=0;jj<m;jj++) {\n+\t y=A[j][jj];\n+\t z=A[i][jj];\n+\t A[j][jj]=y*c+z*s;\n+\t A[i][jj]=z*c-y*s;\n+\t}\n+ }\n+ rv1[l]=0.0;\n+ rv1[k]=f;\n+ w[k]=x;\n+ }\n+ }\n+ TransposeMatrix(V,n);\n+ TransposeMatrix(A,n);\n+ delete[](rv1); (rv1) = NULL;\n+}\n+\n+/**\n+ * @brief Computes (a2 + b2 )^1/2 without destructive underflow or overflow.\n+ */\n+double \n+pythag(double a, double b)\n+{\n+ double absa,absb;\n+ absa=fabs(a);\n+ absb=fabs(b);\n+ if (absa > absb) \n+ return absa*sqrt(1.0+SQR(absb/absa));\n+ else \n+ return (absb == 0.0 ? 0.0 : absb*sqrt(1.0+SQR(absa/absb)));\n+}\n+\n+\n+/* @* HitList::ClobberGlobal(void)\n+ */\n+void \n+HitList::ClobberGlobal(void){\n+\n+\n+ /* @<variables local to HitList::ClobberGlobal@> */\n+ class List<Hit>::ListEl<Hit> *pvIter = head;\n+\n+ /* NOTE: no free/delete-ing of data to be done here \n+ hitlist only holds a shallow copy of hit; \n+ hit is being cleared off properly.\n+ just reset everything to 0/0.0/NULL.\n+ The only important thing to do at this stage \n+ is to attach head and tail and set size = 0\n+ (FS, 2010-02-18)\n+\n+ NOTE: I only ever saw 1 (one) in-between element, \n+ but there may ctually be a real linked list \n+ of more than 1 element (FS, 2010-02-18)\n+ */\n+\n+ // printf("POINTER:\\t%p\\t=HEAD\\n", head);\n+ while (pvIter->next != tail){\n+\n+ // printf("POINTER:\\t%p->\\t%p\\n", pvIter, pvIter->next);\n+ pvIter = pvIter->next;\n+\n+#if 1\n+ pvIter->data.longname = pvIter->data.name = \n+ pvIter->data.file = pvIter->data.dbfile = NULL;\n+ pvIter->data.sname = NULL;\n+ pvIter->data.seq = NULL;\n+ pvIter->data.self = 0;\n+ pvIter->data.i = pvIter->data.j = NULL;\n+ pvIter->data.states = NULL;\n+ pvIter->data.S = pvIter->data.S_ss = pvIter->data.P_posterior = NULL;\n+ pvIter->data.Xcons = NULL;\n+ pvIter->data.sum_of_probs = 0.0;\n+ pvIter->data.Neff_HMM = 0.0;\n+ pvIter->data.score_ss = pvIter->data.Pval = pvIter->data.logPval = \n+ pvIter->data.Eval = pvIter->data.Probab = pvIter->data.Pforward = 0.0;\n+ pvIter->data.nss_conf = pvIter->data.nfirst = \n+ pvIter->data.i1 = pvIter->data.i2 = pvIter->data.j1 = pvIter->data.j2 = \n+ pvIter->data.matched_cols = pvIter->data.ssm1 = pvIter->data.ssm2 = 0;\n+#endif\n+ }\n+ // printf("POINTER:\\t\\t\\t%p=TAIL\\n", tail);\n+\n+\n+ head->next = tail;\n+ tail->prev = head;\n+ size = 0;\n+\n+ /* @= */\n+ return;\n+\n+} /* this is the end of HitList::ClobberGlobal() */\n+\n+\n+/*\n+ * EOF hhhitlist-C.h\n+ */\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/hhalign/hhhitlist.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/hhalign/hhhitlist.h Thu Jul 21 13:35:08 2011 -0400 |
[ |
@@ -0,0 +1,140 @@ +/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ + +/********************************************************************* + * Clustal Omega - Multiple sequence alignment + * + * Copyright (C) 2010 University College Dublin + * + * Clustal-Omega is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This file is part of Clustal-Omega. + * + ********************************************************************/ + +/* + * RCS $Id: hhhitlist.h 243 2011-05-31 13:49:19Z fabian $ + */ + +// hhhitlist.h + +////////////////////////////////////////////////////////////////////////////// +// HitList is a list of hits of type Hit +// which can be operated upon by several anaylsis methods +////////////////////////////////////////////////////////////////////////////// +class HitList : public List<Hit> +{ +private: + double score[MAXPROF]; // HHsearch score of each HMM for ML fit + double weight[MAXPROF]; // weight of each HMM = 1/(size_fam[tfam]*size_sfam[hit.sfam]) for ML fit + int Nprof; // Number of HMMs for ML fit + +public: + int fams; // number of families found found in hitlist + int sfams; // number of superfamilies found in hitlist + int N_searched; // number of sequences searched from HMM database + Hash<float>* blast_logPvals;/* Hash containing names and log(P-values) + read from BLAST file (needed for HHblast) */ + + HitList() {blast_logPvals=NULL;} + ~HitList() {if (blast_logPvals) delete blast_logPvals;} + + // Print summary listing of hits + void PrintHitList(HMM& q, char* outfile); + +#ifdef CLUSTALO + void ClobberGlobal(void); +#endif + + // Print alignments of query sequences against hit sequences + int PrintAlignments( +#ifdef CLUSTALO + char **ppcFirstProf, char **ppcSecndProf, +#endif + HMM& q, char* outfile, char outformat=0); + + // Return a figure of merit for distinction of the score with positive from the scores with negatives + void Optimize(HMM& q, char* buffer); + + // Print score distribution into file score_dist + void PrintScoreFile(HMM& q); + + // Log likelihood for fitting the EVD to the score distribution + double RankOrderFitCorr(double* v); + // Static wrapper-function for calling the nonstatic member function RankOrderFitCorr() + static double RankOrderFitCorr_static(void* pt2hitlist, double* v); + + // Log likelihood for fitting the EVD to the score distribution + double LogLikelihoodCorr(double* v); + // Static wrapper-function for calling the nonstatic member function LogLikelihoodCorr() + static double LogLikelihoodCorr_static(void* pt2hitlist, double* v); + + // Log likelihood for fitting the EVD to the score distribution + double LogLikelihoodEVD(double* v); + // Static wrapper-function for calling the nonstatic member function LogLikelihoodEVD() + static double LogLikelihoodEVD_static(void* pt2hitlist, double* v); + + + // Subroutine to FindMin: new point given by highest point ihigh, fac and replaces ihigh if it is lower + double TryPoint(int ndim, double* p, double* y, double* psum, int ihigh, double fac, double (*Func)(void* pt2hitlist, double* v)); + + // Find minimum with simplex method of Nelder and Mead (1965) + float FindMin(int ndim, double* p, double* y, double tol, int& nfunc, double (*Func)(void* pt2hitlist, double* v)); + + // Do a maximum likelihood fit of the scores with an EV distribution with parameters lamda and mu + void MaxLikelihoodEVD(HMM& q, int nbest); + + // Calculate correlation and score offset for HHblast composite E-values + void CalculateHHblastCorrelation(HMM& q); + + // Calculate HHblast composite E-values + void CalculateHHblastEvalues(HMM& q); + + // Calculate Pvalues as a function of query and template lengths and diversities + void CalculatePvalues(HMM& q); + + // Set P-values, E-values and scores according to q.lamda and q.mu (if calibration from database scan is impossible) + void GetPvalsFromCalibration(HMM& q); + + // HHblast: read PSI-BLAST E-values to determine correlation + void ReadBlastFile(HMM& q); + + // Print first 20 hits of hitlist + void Debug() + { + Hit hit; + int i=0; + Reset(); + printf("TARGET FAMILY LEN COL LOG-PVA S-AASS PROBAB SCORE_SORT\n"); + while (++i<=20 && !End()) + { + hit = ReadNext(); + printf("%-10.10s %-10.10s %3i %3i %s %7.2f %6.2f %6.2f\n",hit.name,hit.fam,hit.L,hit.matched_cols,sprintg(-1.443*hit.logPval,7),-hit.score_aass,hit.Probab,hit.score_sort); + } + } + + // Calculate P-values and Probabilities from transitive scoring over whole database + void TransitiveScoring(); + void TransitiveScoring2(); + void TransitiveScoring3(); + void TransitiveScoring4(); + + // Score2Z transforms the -log(P-value) score into a Z-score for 0 < S + double Score2Z(double S); + + // Z2Score transforms the Z-score into a -log(P-value) value + double Z2Score(double Z); + + // Matrix manipulation + void PrintMatrix(float** V, int N); + void PrintMatrix(double** V, int N); + float NormalizationFactor(double** Csub,float* w, int M); + void Normalize(float* Ztq, char** fold, Hash<int>& excluded); + void InvertMatrix(double** B, double** A, int N); + void TransposeMatrix(double** V, int N); + void SVD(double **A, int n, double w[], double **V); + +}; + |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/hhalign/hhhmm-C.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/hhalign/hhhmm-C.h Thu Jul 21 13:35:08 2011 -0400 |
[ |
b'@@ -0,0 +1,2637 @@\n+/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n+\n+/*********************************************************************\n+ * Clustal Omega - Multiple sequence alignment\n+ *\n+ * Copyright (C) 2010 University College Dublin\n+ *\n+ * Clustal-Omega is free software; you can redistribute it and/or\n+ * modify it under the terms of the GNU General Public License as\n+ * published by the Free Software Foundation; either version 2 of the\n+ * License, or (at your option) any later version.\n+ *\n+ * This file is part of Clustal-Omega.\n+ *\n+ ********************************************************************/\n+\n+/*\n+ * RCS $Id: hhhmm-C.h 224 2011-03-23 12:13:33Z fabian $\n+ */\n+\n+\n+// hhhmm.C\n+\n+#ifndef MAIN\n+#define MAIN\n+#include <iostream> // cin, cout, cerr\n+#include <fstream> // ofstream, ifstream \n+#include <stdio.h> // printf\n+using std::cout;\n+using std::cerr;\n+using std::endl;\n+using std::ios;\n+using std::ifstream;\n+using std::ofstream;\n+#include <stdlib.h> // exit\n+#include <string> // strcmp, strstr\n+#include <math.h> // sqrt, pow\n+#include <limits.h> // INT_MIN\n+#include <float.h> // FLT_MIN\n+#include <time.h> // clock\n+#include <ctype.h> // islower, isdigit etc\n+#include "util-C.h" // imax, fmax, iround, iceil, ifloor, strint, strscn, strcut, substr, uprstr, uprchr, Basename etc.\n+#include "list.h" // list data structure\n+#include "hash.h" // hash data structure\n+#include "hhdecl-C.h"\n+#include "hhutil-C.h" // imax, fmax, iround, iceil, ifloor, strint, strscn, strcut, substr, uprstr, uprchr, Basename etc.\n+#endif\n+\n+// #ifndef WNLIB\n+// #define WNLIB\n+// #include "wnconj.h" // Will Naylor\'s wnlib for optimization in C \n+// #endif\n+\n+//////////////////////////////////////////////////////////////////////////////\n+//// Class HMM\n+//////////////////////////////////////////////////////////////////////////////\n+\n+//////////////////////////////////////////////////////////////////////////////\n+// Object constructor\n+//////////////////////////////////////////////////////////////////////////////\n+HMM::HMM(int maxseqdis, int maxres)\n+{\n+ sname = new char*[maxseqdis]; // names of stored sequences \n+ for (int i = 0; i < maxseqdis; i++){ sname[i] = NULL;}\n+ seq = new char*[maxseqdis]; // residues of stored sequences (first at pos 1!)\n+ for (int i = 0; i < maxseqdis; i++){ seq[i] = NULL;}\n+ Neff_M = new float[maxres]; // Neff_M[i] = diversity of subalignment of seqs that have residue in col i\n+ Neff_I = new float[maxres]; // Neff_I[i] = diversity of subalignment of seqs that have insert in col i\n+ Neff_D = new float[maxres]; // Neff_D[i] = diversity of subalignment of seqs that have delete in col i\n+ longname = new char[DESCLEN]; // Full name of first sequence of original alignment (NAME field)\n+ ss_dssp = new char[maxres]; // secondary structure determined by dssp 0:- 1:H 2:E 3:C 4:S 5:T 6:G 7:B\n+ sa_dssp = new char[maxres]; // solvent accessibility state determined by dssp 0:- 1:A (absolutely buried) 2:B 3:C 4:D 5:E (exposed)\n+ ss_pred = new char[maxres]; // predicted secondary structure 0:- 1:H 2:E 3:C\n+ ss_conf = new char[maxres]; // confidence value of prediction 0:- 1:0 ... 10:9\n+ Xcons = NULL; // create only when needed: consensus sequence in internal representation (A=0 R=1 N=2 D=3 ...)\n+ l = new int[maxres]; // l[i] = pos. of j\'th match state in aligment\n+ /* FS introduced sentinel, NULL terminates loop in destructor, FS, r221->222 */\n+ f = new float*[maxres+1]; f[maxres] = NULL; // f[i][a] = prob of finding amino acid a in column i WITHOUT pseudocounts\n+ g = new float*[maxres+1]; g[maxres] = NULL; // f[i][a] = prob of finding amino acid a in column i WITH pseudocounts\n+ p = new float*[maxres+1]; p[maxres] = NULL; // p[i][a] = prob of finding amino acid a in column i WITH OPTIMUM pseudocounts\n+ tr = new float*[maxre'..b']*x[b];\n+ \n+// for (int a=0; a<20; ++a) w[a] = x[a]*z[a]-qav[a];\n+// for (int a=0; a<20; ++a)\n+// {\n+// tmp = w[a]*z[a];\n+// for (int b=0; b<20; ++b) tmp += P[a][b]*x[b]*w[b];\n+// grad[a] = 2.0*tmp;\n+// }\n+// return;\n+// }\n+\n+\n+// /////////////////////////////////////////////////////////////////////////////////////\n+// //// Rescale a substitution matrix to biased aa frequencies in global vector qav[a]\n+// /////////////////////////////////////////////////////////////////////////////////////\n+// void HMM::RescaleMatrix() \n+// {\n+// int a,b;\n+// int code;\n+// double x[21]; // scaling factor\n+// double val_min;\n+// const int len=20;\n+// const int max_iterations=50;\n+\n+// if (v>=2) printf("Adjusting rate matrix to query amino acid composition ...\\n");\n+\n+// // Put amino acid frequencies into global array (needed to call WNLIB\'s conjugate gradient method)\n+// for (a=0; a<20; ++a) qav[a] = pav[a];\n+\n+// // Initialize scaling factors x[a]\n+// for (a=0; a<20; ++a) x[a]=pow(qav[a]/pb[a],0.73); // Initialize \n+\n+// // Call conjugate gradient minimization method from WNLIB\n+// wn_conj_gradient_method(&code,&val_min,x,len,&RescaleMatrixFunc,&RescaleMatrixFuncGrad,max_iterations);\n+\n+\n+// // Calculate z[a] = sum_b Pab*xb\n+// float sum_err=0.0f; \n+// float sum = 0.0f;\n+// for (a=0; a<20; ++a) \n+// {\n+// float za=0.0f; // za = sum_b Pab*xb\n+// for (b=0; b<20; ++b) za+=P[a][b]*x[b];\n+// sum_err += (x[a]*za/qav[a]-1)*(x[a]*za/qav[a]-1);\n+// sum += x[a]*za;\n+// }\n+// if (sum_err>1e-3 & v>=1) fprintf(stderr,"WARNING: adjusting rate matrix by CG resulted in residual error of %5.3f.\\n",sum_err);\n+ \n+// // Rescale rate matrix\n+// for (a=0; a<20; ++a) \n+// for (b=0; b<20; ++b) \n+// {\n+// \tP[a][b] *= x[a]*x[b]/sum;\n+// \tR[a][b] = P[a][b]/qav[b];\n+// }\n+\n+// // How well approximated?\n+// if (v>=3) \n+// {\n+// // Calculate z[a] = sum_b Pab*xb\n+// float z[21]; \n+// for (a=0; a<20; ++a) \n+// \tfor (z[a]=0.0, b=0; b<20; ++b) z[a]+=P[a][b];\n+// printf("Adjust A R N D C Q E G H I L K M F P S T W Y V\\nErr? ");\n+// for (a=0; a<20; ++a) printf("%4.0f ",1000*z[a]/qav[a]);\n+// cout<<endl<<"xa ";\n+// for (a=0; a<20; ++a) fprintf(stdout,"%4.2f ",x[a]);\n+// cout<<endl;\n+// }\n+\n+// // Evaluate sequence identity underlying substitution matrix\n+// if (v>=3)\n+// {\n+// float id=0.0f;\n+// float entropy=0.0f; \n+// float entropy_qav=0.0f;\n+// float mut_info=0.0f;\n+// for (a=0; a<20; ++a) id += P[a][a];\n+// for (a=0; a<20; ++a) entropy_qav-=qav[a]*fast_log2(qav[a]);\n+// for (a=0; a<20; ++a) \n+// \t for (b=0; b<20; ++b) \n+// \t {\n+// \t entropy-=P[a][b]*fast_log2(R[a][b]);\n+// \t mut_info += P[a][b]*fast_log2(P[a][b]/qav[a]/qav[b]);\n+// \t }\n+\n+// fprintf(stdout,"Rescaling rate matrix: sequence identity = %2.0f%%; entropy per column = %4.2f bits (out of %4.2f); mutual information = %4.2f bits\\n",100*id,entropy,entropy_qav,mut_info);\n+// }\n+// return;\n+// }\n+\n+\n+/* @* HMM::ClobberGlobal (eg, q,t)\n+ */\n+void \n+HMM::ClobberGlobal(void){\n+\n+ for (int i = 0; i < n_display; i++){\n+ if (sname[i]){\n+ delete[] sname[i]; sname[i] = NULL;\n+ }\n+ if (seq[i]){\n+ delete[] seq[i]; seq[i] = NULL;\n+ }\n+ } \n+ Neff_M[0] = Neff_I[0] = Neff_D[0] = 0.0;\n+ longname[0] = \'\\0\'; file[0] = \'\\0\';\n+ ss_dssp[0] = sa_dssp[0] = ss_pred[0] = ss_conf[0] = \'\\0\';\n+ Xcons = NULL;\n+ l[0] = 0;\n+ L = 0;\n+ Neff_HMM = 0;\n+ n_display = N_in = N_filtered = 0;\n+ nss_dssp = nsa_dssp = nss_pred = nss_conf = nfirst = ncons = -1;\n+ lamda = 0.0; mu = 0.0;\n+ name[0] = longname[0] = fam[0] = \'\\0\';\n+\n+ for (int i = 0; i < NAA; i++){\n+ pav[i] = 0;\n+ }\n+\n+ /* @= */\n+ return;\n+\n+} /* this is the end of ClobberGlobal() */\n+\n+\n+/* \n+ * EOF hhhmm-C.h\n+ */\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/hhalign/hhhmm.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/hhalign/hhhmm.h Thu Jul 21 13:35:08 2011 -0400 |
[ |
b"@@ -0,0 +1,204 @@\n+/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n+\n+/*********************************************************************\n+ * Clustal Omega - Multiple sequence alignment\n+ *\n+ * Copyright (C) 2010 University College Dublin\n+ *\n+ * Clustal-Omega is free software; you can redistribute it and/or\n+ * modify it under the terms of the GNU General Public License as\n+ * published by the Free Software Foundation; either version 2 of the\n+ * License, or (at your option) any later version.\n+ *\n+ * This file is part of Clustal-Omega.\n+ *\n+ ********************************************************************/\n+\n+/*\n+ * RCS $Id: hhhmm.h 165 2010-12-22 16:24:48Z fabian $\n+ */\n+\n+// hhhmm.h\n+\n+\n+class HMM\n+{\n+ public:\n+ HMM(int maxseqdis=MAXSEQDIS, int maxres=/*MAXRES*/par.maxResLen);\n+ ~HMM();\n+ HMM& operator=(HMM&);\n+ \n+ int n_display; // number of sequences stored for display of alignment (INCLUDING >ss_ and >cf_ sequences)\n+ int n_seqs; // number of sequences read in (INCLUDING >ss_ and >cf_ sequences)\n+ char** sname; // names of stored sequences \n+ char** seq; // residues of stored sequences (first at pos 1!)\n+ int ncons; // index of consensus sequence\n+ int nfirst; // index of first sequence (query sequence of HMM)\n+ int nss_dssp; // index of seq[] with secondary structure by dssp\n+ int nsa_dssp; // index of seq[] with solvent accessibility by dssp\n+ int nss_pred; // index of seq[] with predicted secondary structure\n+ int nss_conf; // index of seq[] with confidence values for secondary structure prediction\n+ \n+ int L; // length of HMM = number of match states; set in declaration of HMM object\n+ int N_in; // number of sequences in alignment\n+ int N_filtered; // number of sequences after filtering\n+ float* Neff_M; // Neff_M[i] = diversity of subalignment of seqs that have residue in col i\n+ float* Neff_I; // Neff_I[i] = diversity of subalignment of seqs that have insert in col i\n+ float* Neff_D; // Neff_D[i] = diversity of subalignment of seqs that have delete in col i\n+ float Neff_HMM; // average number of Neff over total length of HMM\n+ \n+ char* longname; // Full name of first sequence of original alignment (NAME field)\n+ char name[NAMELEN]; // HMM name = first word in longname in lower case\n+ char file[NAMELEN]; // Basename (with path, without extension) of alignment file that was used to construct the HMM\n+ char fam[NAMELEN]; // family ID (derived from name) (FAM field)\n+ char sfam[NAMELEN]; // superfamily ID (derived from name) \n+ char fold[NAMELEN]; // fold ID (derived from name)\n+ char cl[NAMELEN]; // class ID (derived from name)\n+\n+ float lamda, mu; // coefficients for aa score distribution of HMM using parameters in 'Parameters par'\n+ bool has_pseudocounts; // set to true if HMM contains pseudocounts\n+\n+ // Make a flat copy of q \n+ void FlatCopyTo(HMM& t);\n+\n+ // Read an HMM from a HHsearch .hhm file and return 0 at end of file\n+ int Read(FILE* dbf, char* path=NULL);\n+\n+ // Read an HMM from a HMMer .hmm file; return 0 at end of file\n+ int ReadHMMer(FILE* dbf, char* filestr=NULL);\n+\n+ // Read an HMM from a HMMer3 .hmm file; return 0 at end of file \n+ int ReadHMMer3(FILE* dbf, char* filestr=NULL);\n+\n+ // Add transition pseudocounts to HMM\n+ void AddTransitionPseudocounts(float gapd=par.gapd, float gape=par.gape, float gapf=par.gapf, float gapg=par.gapg, float gaph=par.gaph, float gapi=par.gapi, float gapb=par.gapb);\n+\n+ // Use secondary structure-dependent gap penalties on top of the HMM transition penalties\n+ void UseSecStrucDependentGapPenalties();\n+\n+ // Generate an amino acid frequency matrix g[][] with fu"..b' to Null model distribution\n+ void NeutralizeTags();\n+ \n+ // Calculate effective number of sequences using profiles INCLUDING pseudocounts\n+ float CalcNeff();\n+\n+ // Calculate consensus of HMM (needed to merge HMMs later)\n+ void CalculateConsensus();\n+\n+ // Store linear transition probabilities\n+ void StoreLinearTransitionProbs();\n+\n+ // Initialize f[i][a] with query HMM\n+ void MergeQueryHMM(HMM& q, float wk[]);\n+ \n+ // Normalize probabilities in total merged super-HMM \n+ void NormalizeHMMandTransitionsLin2Log();\n+\n+ // Rescale rate matrices P[a][b], R[a][b] according to HMM av. aa composition in pav[a]\n+ void RescaleMatrix();\n+\n+#ifdef CLUSTALO\n+ void ClobberGlobal(void);\n+ char cQT; /* query or template */\n+#endif\n+\n+private:\n+ float** f; // f[i][a] = prob of finding amino acid a in column i WITHOUT pseudocounts\n+ float** g; // f[i][a] = prob of finding amino acid a in column i WITH pseudocounts\n+ float** p; // p[i][a] = prob of finding amino acid a in column i WITH OPTIMUM pseudocounts\n+ float** tr; // log2 of transition probabilities M2M M2I M2D I2M I2I D2M D2D M2M_GAPOPEN GAPOPEN GAPEXTD\n+/* float** tr_lin; // transition probs in log space */\n+ char trans_lin; // transition probs are given in log or lin space? (0: p_tr 1: log(p_tr) \n+\n+ char* ss_dssp; // secondary structure determined by dssp 0:- 1:H 2:E 3:C 4:S 5:T 6:G 7:B\n+ char* sa_dssp; // solvent accessibility state determined by dssp 0:- 1:A (absolutely buried) 2:B 3:C 4:D 5:E (exposed)\n+ char* ss_pred; // predicted secondary structure 0:- 1:H 2:E 3:C\n+ char* ss_conf; // confidence value of prediction 0:- 1:0 ... 10:9\n+ char* Xcons; // consensus sequence in internal representation (A=0 R=1 N=2 D=3 ...)\n+ float pav[NAA]; // pav[a] = average freq of amino acids in HMM (including subst matrix pseudocounts)\n+ float pnul[NAA]; // null model probabilities used in comparison (only set in template/db HMMs)\n+ int* l; // l[i] = pos. of j\'th match state in aligment\n+/* char trans_lin; // transition probs are given in log or lin space? (0: p_tr 1: log(p_tr) */\n+\n+ // Utility for Read()\n+ int Warning(FILE* dbf, char line[], char name[])\n+ {\n+ if (v) cerr<<"\\nWARNING: could not read line\\n\\\'"<<line<<"\\\'\\nin HMM "<<name<<" in "<<file<<"\\n";\n+ while (fgetline(line,LINELEN,dbf) && !(line[0]==\'/\' && line[1]==\'/\'));\n+ if (line) return 2; //return status: skip HMM\n+ return 0; //return status: end of database file\n+ }\n+\n+ friend class Hit;\n+ friend class Alignment;\n+ friend class HMMshadow;\n+};\n+\n+class HMMshadow {\n+\n+ public: \n+ float *Neff_M;\n+ float *Neff_I;\n+ float *Neff_D;\n+ float **f;\n+ float **g;\n+ float **p;\n+ float **tr;\n+ float pav[20];\n+ \n+ void copyHMMtoShadow(const HMM &hmm) { \n+ Neff_M = hmm.Neff_M;\n+ Neff_I = hmm.Neff_I;\n+ Neff_D = hmm.Neff_D;\n+ f = hmm.f; \n+ g = hmm.g; \n+ p = hmm.p;\n+ tr = hmm.tr;\n+ memcpy(pav, hmm.pav, 20*sizeof(float));\n+ } \n+ \n+ void copyShadowToHMM(const HMM &hmm, const hmm_light rShadow) {\n+ \n+ int i, j;\n+ \n+ for (i = 0; i < rShadow.L+1; i++){\n+ hmm.Neff_M[i] = rShadow.Neff_M[i];\n+ hmm.Neff_I[i] = rShadow.Neff_I[i];\n+ hmm.Neff_D[i] = rShadow.Neff_D[i];\n+ for (j = 0; j < 20; j++){\n+ hmm.f[i][j] = rShadow.f[i][j];\n+ hmm.g[i][j] = rShadow.g[i][j];\n+ hmm.p[i][j] = rShadow.p[i][j];\n+ }\n+ for (j = 0; j < 7; j++){\n+ hmm.tr[i][j] = rShadow.tr[i][j];\n+ }\n+ memcpy((void *)hmm.pav, rShadow.pav, 20*sizeof(float));\n+ }\n+ } /* this is the end of copyShadowToHMM() */\n+\n+} /* class HMMshadow */;\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/hhalign/hhmatrices-C.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/hhalign/hhmatrices-C.h Thu Jul 21 13:35:08 2011 -0400 |
[ |
b'@@ -0,0 +1,474 @@\n+/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n+\n+/*********************************************************************\n+ * Clustal Omega - Multiple sequence alignment\n+ *\n+ * Copyright (C) 2010 University College Dublin\n+ *\n+ * Clustal-Omega is free software; you can redistribute it and/or\n+ * modify it under the terms of the GNU General Public License as\n+ * published by the Free Software Foundation; either version 2 of the\n+ * License, or (at your option) any later version.\n+ *\n+ * This file is part of Clustal-Omega.\n+ *\n+ ********************************************************************/\n+\n+/*\n+ * RCS $Id: hhmatrices-C.h 199 2011-02-21 18:24:49Z fabian $\n+ */\n+\n+// Substitution matrices and their background frequencies\n+\n+// The following background frequencies were calculated by the formula pa = (P[a,b]/(pa*pb))^(-1) * (1,...,1)\n+// For the Blousum50-matrix this becomes pb[a]= SUM_(b=1,20) (2^(BLOSUM50[a,b]/3))^(-1) \n+// A R N D C Q E G H I L K M F P S T W Y V \n+// Gonnet 7.68,5.14,4.02,5.41,1.89,3.27,5.99,7.56,3.69,5.06,10.01,5.97,2.20,3.50,4.54,4.67,7.12,1.25,3.95,7.28\n+// BLOSUM50 8.24,6.24,4.46,4.77,2.03,2.90,6.78,6.69,2.53,6.89,10.7 ,5.04,1.49,4.93,3.97,5.95,6.13,1.34,3.45,6.28\n+\n+const float Gonnet[]={\n+// A R N D C Q E G H I L K M F P S T W Y V \n+ 10227, 3430, 2875, 3869, 1625, 2393, 4590, 6500, 2352, 3225, 5819, 4172, 1435, 1579, 3728, 4610, 6264, 418, 1824, 5709, // A\n+ 3430, 7780, 2209, 2589, 584, 2369, 3368, 3080, 2173, 1493, 3093, 5701, 763, 859, 1893, 2287, 3487, 444, 1338, 2356, // R \n+ 2875, 2209, 3868, 3601, 501, 1541, 2956, 3325, 1951, 1065, 2012, 2879, 532, 688, 1480, 2304, 3204, 219, 1148, 1759, // N\n+ 3869, 2589, 3601, 8618, 488, 2172, 6021, 4176, 2184, 1139, 2151, 3616, 595, 670, 2086, 2828, 3843, 204, 1119, 2015, // D\n+ 1625, 584, 501, 488, 5034, 355, 566, 900, 516, 741, 1336, 591, 337, 549, 419, 901, 1197, 187, 664, 1373, // C\n+ 2393, 2369, 1541, 2172, 355, 1987, 2891, 1959, 1587, 1066, 2260, 2751, 570, 628, 1415, 1595, 2323, 219, 871, 1682, // Q\n+ 4590, 3368, 2956, 6021, 566, 2891, 8201, 3758, 2418, 1624, 3140, 4704, 830, 852, 2418, 2923, 4159, 278, 1268, 2809, // E\n+ 6500, 3080, 3325, 4176, 900, 1959, 3758,26066, 2016, 1354, 2741, 3496, 741, 797, 2369, 3863, 4169, 375, 1186, 2569, // G\n+ 2352, 2173, 1951, 2184, 516, 1587, 2418, 2016, 5409, 1123, 2380, 2524, 600, 1259, 1298, 1642, 2446, 383, 876, 1691, // H\n+ 3225, 1493, 1065, 1139, 741, 1066, 1624, 1354, 1123, 6417, 9630, 1858, 1975, 2225, 1260, 1558, 3131, 417, 1697, 7504, // I\n+ 5819, 3093, 2012, 2151, 1336, 2260, 3140, 2741, 2380, 9630,25113, 3677, 4187, 5540, 2670, 2876, 5272, 1063, 3945,11005, // L\n+ 4172, 5701, 2879, 3616, 591, 2751, 4704, 3496, 2524, 1858, 3677, 7430, 949, 975, 2355, 2847, 4340, 333, 1451, 2932, // K\n+ 1435, 763, 532, 595, 337, 570, 830, 741, 600, 1975, 4187, 949, 1300, 1111, 573, 743, 1361, 218, 828, 2310, // M\n+ 1579, 859, 688, 670, 549, 628, 852, 797, 1259, 2225, 5540, 975, 1111, 6126, 661, 856, 1498, 1000, 4464, 2602, // F\n+ 3728, 1893, 1480, 2086, 419, 1415, 2418, 2369, 1298, 1260, 2670, 2355, 573, 661,11834, 2320, 3300, 179, 876, 2179, // P\n+ 4610, 2287, 2304, 2828, 901, 1595, 2923, 3863, 1642, 1558, 2876, 2847, 743, 856, 2320, 3611, 4686, 272, 1188, 2695, // S\n+ 6264, 3487, 3204, 3843, 1197, 2323, 4159, 4169, 2446, 3131, 5272, 4340, 1361, 1498, 3300, 4686, 8995, 397, 1812, 5172, // T\n+ 418, 444, 219, 204, 187, 219, 278, 375, 383, 417, 1063, 333, 218, 1000, 179, 272, 397, 4101, 1266, 499, // W\n+ 1824, 1338, 1148, 1119, 664, 871, 1268, 1186, 876, 1697, 3945, 1451, 828, 4464, 876, 1188, 1812, 1266, 9380, 2227, // Y\n+ 5709, 2356, 1759, 2015, 1373, 1682, 2809, 2569, 1691, 7'..b'[a]); // S[a][b] = log2(P(a,b)/P(a)/P(b))\n+ \n+ // Evaluate sequence identity underlying substitution matrix\n+ if (v>=3)\n+ {\n+ float id=0.0f;\n+ float entropy=0.0f; \n+ float entropy_pb=0.0f;\n+ float mut_info=0.0f;\n+ for (a=0; a<20; ++a) id+=P[a][a];\n+ for (a=0; a<20; ++a) entropy_pb-=pb[a]*log2(pb[a]);\n+ for (a=0; a<20; ++a) \n+\t for (b=0; b<20; ++b) \n+\t {\n+\t entropy-=P[a][b]*log2(R[a][b]);\n+\t mut_info += P[a][b]*S[a][b];\n+\t }\n+ \n+ printf(": sequence identity = %2.0f%%; entropy per column = %4.2f bits (out of %4.2f); mutual information = %4.2f bits\\n",100*id,entropy,entropy_pb,mut_info);\n+ }\n+\n+ if (v>=4) //Debugging: probability matrix and dissimilarity matrix \n+ {\n+ cout<<"Check matrix: before renormalization sum P(a,b)= "<<sumab<<"...\\n";//PRINT\n+ cout<<" A R N D C Q E G H I L K M F P S T W Y V\\n";\n+ cout<<"p[] ";\n+ for (a=0; a<20; a++) printf("%4.1f ",100*pb[a]);\n+ cout<<endl<<"\\nSubstitution matrix log2( P(a,b)/p(a)/p(b) ) (in bits):\\n";\n+ cout<<" A R N D C Q E G H I L K M F P S T W Y V\\n";\n+ for (b=0; b<20; b++)\n+\t{\n+\t cout<<i2aa(b)<<" ";\n+\t for (a=0; a<20; a++) printf("%4.1f ",S[a][b]);\n+\t cout<<endl;\n+\t}\n+ cout<<endl<<"\\nOdds matrix P(a,b)/p(a)/p(b):\\n";\n+ cout<<" A R N D C Q E G H I L K M F P S T W Y V\\n";\n+ for (b=0; b<20; b++)\n+\t{\n+\t cout<<i2aa(b)<<" ";\n+\t for (a=0; a<20; a++) printf("%4.1f ",P[b][a]/pb[a]/pb[b]);\n+\t cout<<endl;\n+\t}\n+ cout<<endl<<"\\nMatrix of conditional probabilities P(a|b) = P(a,b)/p(b) (in %):\\n";\n+ cout<<" A R N D C Q E G H I L K M F P S T W Y V\\n";\n+ for (b=0; b<20; b++)\n+\t{\n+\t cout<<i2aa(b)<<" ";\n+\t for (a=0; a<20; a++) printf("%4.1f ",100*R[b][a]);\n+\t cout<<endl;\n+\t}\n+ cout<<endl<<"\\nProbability matrix P(a,b) (in %):\\n";\n+ cout<<" A R N D C Q E G H I L K M F P S T W Y V\\n";\n+ for (b=0; b<20; b++)\n+\t{\n+\t cout<<i2aa(b)<<" ";\n+\t for (a=0; a<20; a++) printf("%5.0f ",1000000*P[b][a]);\n+\t cout<<endl;\n+\t}\n+ cout<<endl<<"Similarity matrix P(a,b)^2/P(a,a,)/P(b,b) (in %):\\n";\n+ cout<<" A R N D C Q E G H I L K M F P S T W Y V\\n";\n+ for (b=0; b<20; b++)\n+\t{\n+\t cout<<i2aa(b)<<" ";\n+\t for (a=0; a<20; a++) printf("%4.0f ",100*Sim[b][a]);\n+\t cout<<endl;\n+\t}\n+ cout<<endl;\n+\n+\n+ }\n+}\n+ \n+\n+/////////////////////////////////////////////////////////////////////////////////////\n+/**\n+ * @brief Set secondary structure substitution matrix\n+ */\n+void \n+SetSecStrucSubstitutionMatrix()\n+{\n+ int A; //observed ss state (determined dssp)\n+ int B,BB; //predicted ss states (by psipred)\n+ int cf,ccf; //confidence value of prediction\n+ float P73[NDSSP][NSSPRED][MAXCF]; //P73[cf][B][A] = P(A,B,cf)/P(A)/P(B,cf) = P(A|B,cf)/P(A)\n+ float sum;\n+\n+ // S73[A][B][cf][b] = score for matching observed ss state A in query with state B in template\n+ // predicted with confidence cf, when query and template columns are diverged by b units \n+ for (cf=0; cf<MAXCF; cf++)\n+ for (A=0; A<NDSSP; A++)\n+ for (B=0; B<NSSPRED; B++)\n+\t{\n+\t P73[A][B][cf] = 1.-par.ssa + par.ssa*Ppred[cf*NSSPRED*NDSSP + B*NDSSP + A];\n+\t S73[A][B][cf] = log2(P73[A][B][cf]);\n+\t}\n+\n+ for (B=0; B<NSSPRED; B++)\n+ for (cf=0; cf<MAXCF; cf++)\n+ for (BB=0; BB<NSSPRED; BB++)\n+\tfor (ccf=0; ccf<MAXCF; ccf++)\n+\t {\n+\t sum=0;\n+\t for (A=1; A<NDSSP; A++)\n+\t sum += P73[A][B][cf] * P73[A][BB][ccf] * Pobs[A];\n+\t S33[B][cf][BB][ccf] = log2(sum);\n+\t } \n+} /* this is the end of SetSecStrucSubstitutionMatrix() */\n+\n+\n+\n+/*\n+ * EOF hhmatrices-C.h\n+ */\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/hhalign/hhutil-C.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/hhalign/hhutil-C.h Thu Jul 21 13:35:08 2011 -0400 |
[ |
b"@@ -0,0 +1,674 @@\n+/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n+\n+/*********************************************************************\n+ * Clustal Omega - Multiple sequence alignment\n+ *\n+ * Copyright (C) 2010 University College Dublin\n+ *\n+ * Clustal-Omega is free software; you can redistribute it and/or\n+ * modify it under the terms of the GNU General Public License as\n+ * published by the Free Software Foundation; either version 2 of the\n+ * License, or (at your option) any later version.\n+ *\n+ * This file is part of Clustal-Omega.\n+ *\n+ ********************************************************************/\n+\n+/*\n+ * RCS $Id: hhutil-C.h 246 2011-06-15 12:41:04Z fabian $\n+ */\n+\n+//////////////////////////////////////////////////////////////////////////////\n+// Transform a character to lower case and '.' to '-' and vice versa\n+//////////////////////////////////////////////////////////////////////////////\n+\n+\n+inline char \n+MatchChr(char c) {return ((c>='a' && c<='z')? c-'a'+'A' : (c=='.'? '-':c) );}\n+\n+inline char \n+InsertChr(char c) {return ((c>='A' && c<='Z')? c+'a'-'A' : ((c>='0' && c<='9') || c=='-')? '.':c );}\n+\n+inline int \n+WordChr(char c) {return (int)((c>='A' && c<='Z') || (c>='a' && c<='z'));}\n+\n+\n+//////////////////////////////////////////////////////////////////////////////\n+/**\n+ * @brief Transforms the one-letter amino acid code into an integer between 0 and 22\n+ */\n+inline char \n+aa2i(char c)\n+{\n+ //A R N D C Q E G H I L K M F P S T W Y V\n+ if (c>='a' && c<='z') c+='A'-'a';\n+ switch (c)\n+ {\n+ case 'A': return 0;\n+ case 'R': return 1;\n+ case 'N': return 2;\n+ case 'D': return 3;\n+ case 'C': return 4;\n+ case 'Q': return 5;\n+ case 'E': return 6;\n+ case 'G': return 7;\n+ case 'H': return 8;\n+ case 'I': return 9;\n+ case 'L': return 10;\n+ case 'K': return 11;\n+ case 'M': return 12;\n+ case 'F': return 13;\n+ case 'P': return 14;\n+ case 'S': return 15;\n+ case 'T': return 16;\n+ case 'W': return 17;\n+ case 'Y': return 18;\n+ case 'V': return 19;\n+ case 'X': return ANY;\n+ case 'J': return ANY;\n+ case 'O': return ANY;\n+ case 'U': return 4; //Selenocystein -> Cystein\n+ case 'B': return 3; //D (or N)\n+ case 'Z': return 6; //E (or Q)\n+ case '-': return GAP;\n+ case '.': return GAP;\n+ case '_': return GAP;\n+ }\n+ if (c>=0 && c<=32) return -1; // white space and control characters\n+ return -2;\n+}\n+\n+///////////////////////////////////////////////////////////////////////////////\n+/**\n+ * @brief Transforms integers between 0 and 22 into the one-letter amino acid code\n+ */\n+inline char \n+i2aa(char c)\n+{\n+ //A R N D C Q E G H I L K M F P S T W Y V\n+ switch (c)\n+ {\n+ case 0: return 'A';\n+ case 1: return 'R';\n+ case 2: return 'N';\n+ case 3: return 'D';\n+ case 4: return 'C';\n+ case 5: return 'Q';\n+ case 6: return 'E';\n+ case 7: return 'G';\n+ case 8: return 'H';\n+ case 9: return 'I';\n+ case 10: return 'L';\n+ case 11: return 'K';\n+ case 12: return 'M';\n+ case 13: return 'F';\n+ case 14: return 'P';\n+ case 15: return 'S';\n+ case 16: return 'T';\n+ case 17: return 'W';\n+ case 18: return 'Y';\n+ case 19: return 'V';\n+ case ANY: return 'X';\n+ case GAP: return '-';\n+ case ENDGAP: return '-';\n+ }\n+ return '?';\n+}\n+\n+//////////////////////////////////////////////////////////////////////////////\n+/**\n+ * @brief Transforms the dssp/psipred secondary structure code into an integer number\n+ */\n+inline char \n+ss2i(char c)\n+{\n+ //- H E C S T G B\n+ if (c>='a' && c<='z') c+='A'-'a';\n+ switch (c)\n+ {\n+ case '.': return 0;\n+ case '-': return 0;\n+ case 'X': return 0;\n+ case 'H': return 1;\n+ case 'E': return 2;\n+ case 'C': return 3;\n+ case '~': return 3;\n+ case 'S': return 4;\n+ case 'T': return 5;\n+ case 'G': return 6;\n+ case 'B': return 7;\n+ case 'I': return 3;\n+ case "..b'=1.0f; // default values for substitution matrix pseudocounts \n+ par.pcbV=1.5f; // significant reduction of pcs by Neff_M starts around Neff_M-1=pcb\n+ par.pccV=1.0f; // pcs are reduced prop. to 1/Neff^pcc\n+ par.pcwV=0.0f; // wc>0 weighs columns according to their intra-clomun similarity\n+\n+ par.gapbV=1.0; // default values for transition pseudocounts\n+ par.gapdV=0.15; // gap open penalty pseudocount; 0.25 corresponds to 7.1*gapf bits\n+ par.gapeV=1.0; // gap extension penalty pseudocount\n+ par.gapfV=0.6; // factor for increasing gap open penalty for deletes\n+ par.gapgV=0.6; // factor for increasing gap open penalty for inserts\n+ par.gaphV=0.6; // factor for increasing gap extension penalty for deletes\n+ par.gapiV=0.6; // factor for increasing gap extension penalty for inserts\n+#endif\n+\n+ par.ssm=2; // ss scoring mode: 0:no ss score 1:score after alignment 2:score during alignment\n+ par.ssw=0.11f; // weight of ss scoring\n+ par.ssa=1.0f; // weight of ss evolution matrix\n+ par.shift=-0.01f; // Shift match score up \n+ par.mact=0.3001f; // Score threshold for MAC alignment in local mode (set to 0.5001 to track user modification)\n+ par.corr=0.1f; // Weight of correlations of scores for |i-j|<=4\n+ par.wstruc=1.0f; // Weight of structure scores\n+\n+ par.egq=0.0f; // no charge for end gaps as default\n+ par.egt=0.0f; // no charge for end gaps as default\n+\n+ par.trans=0; // no transitive scoring as default\n+ par.Emax_trans=100.0f; // use intermediate HMMs with E-values up to 100 between query and database HMM\n+ par.Emax_trans=100.0f; // use intermediate HMMs with E-values up to 100 between query and database HMM\n+ par.wtrans=1.0f; // Ztot[k] = Zq[k] + wtrans * (Zforward[k]+Zreverse[k])\n+ par.ssgap=0; // 1: add secondary structure-dependent gap penalties 0:off\n+ par.ssgapd=1.0f; // secondary structure-dependent gap-opening penalty (per residue)\n+ par.ssgape=0.0f; // secondary structure-dependent gap-extension penalty (per residue)\n+ par.ssgapi=4; // max. number of inside-integer(ii); gap-open-penalty= -ii*ssgapd\n+\n+ par.loc=1; // local vs. global alignment as default\n+ par.altali=2; // find up to two (possibly overlapping) subalignments \n+ par.forward=0; // 0: Viterbi algorithm; 1: Viterbi+stochastic sampling; 3:Maximum Accuracy (MAC) algorithm\n+ par.realign=1; // realign with MAC algorithm\n+\n+ par.repmode=0; // repeats score independently of one another\n+ par.columnscore=1; // Default column score is 1: null model pnul = 1/2 * (q_av(a)+p_av(a))\n+ par.min_overlap=0; // automatic minimum overlap used\n+ par.opt=0; // Default = optimization mode off\n+ par.readdefaultsfile=0; // Default = do not read a defaults file ./.hhdefaults or HOME/.hhdefaults\n+ par.maxdbstrlen=200; // maximum length of database string to be printed in \'Command\' line of hhr file\n+ par.mode=0;\n+ par.idummy=par.jdummy=0; //\n+\n+ par.notags=1; // neutralize His-tags, FLAG-tags, C-myc-tags\n+\n+ // Initialize strings\n+ strcpy(par.infile,"stdin");\n+ strcpy(par.outfile,"");\n+ strcpy(par. pairwisealisfile,"");\n+ strcpy(par.buffer,"buffer.txt"); \n+ strcpy(par.scorefile,""); \n+ strcpy(par.wfile,""); \n+ strcpy(par.alnfile,""); \n+ strcpy(par.hhmfile,""); \n+ strcpy(par.psifile,""); \n+ par.exclstr=NULL; \n+\n+#if 0 /* read parameter file from home-dir */\n+#include "hhutil-C-help.h"\n+#endif /* read parameter file from home-dir */\n+\n+ return;\n+} /** this is the end of SetDefaults() **/\n+\n+/*\n+ * EOF hhutil-C.h\n+ */\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/hhalign/list-C.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/hhalign/list-C.h Thu Jul 21 13:35:08 2011 -0400 |
b |
b'@@ -0,0 +1,600 @@\n+/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n+\n+/*********************************************************************\n+ * Clustal Omega - Multiple sequence alignment\n+ *\n+ * Copyright (C) 2010 University College Dublin\n+ *\n+ * Clustal-Omega is free software; you can redistribute it and/or\n+ * modify it under the terms of the GNU General Public License as\n+ * published by the Free Software Foundation; either version 2 of the\n+ * License, or (at your option) any later version.\n+ *\n+ * This file is part of Clustal-Omega.\n+ *\n+ ********************************************************************/\n+\n+/*\n+ * RCS $Id: list-C.h 143 2010-10-14 13:11:14Z andreas $\n+ */\n+\n+// list.C\n+// Class for double-linked list \n+\n+\n+\n+#ifndef JLIST\n+#define JLIST\n+\n+#ifndef MAIN\n+#include <iostream> // cin, cout\n+#include <stdlib.h> // \n+#include <stdio.h> // \n+using std::cout;\n+using std::cerr;\n+#endif\n+\n+#include "list.h"\n+\n+////////////////////////////////////////////////////////////////////////////\n+// Double-linked list implementation with head and tail dummy elements\n+// We set head->prev=head and tail->next=tail.\n+// This makes sure that repeated current=current->next; ends up in tail\n+// and repeated current=current->prev; ends up in head.\n+// head and tail optionally contain a NULL element of Typ defined by method Null(Typ)\n+////////////////////////////////////////////////////////////////////////////\n+\n+\n+\n+////////////////////////////////////////////////////////////////////////////\n+// Constructors and destructor\n+\n+////////////////////////////////////////////////////////////////////////////\n+// Creates empty List with two dummy elements\n+////////////////////////////////////////////////////////////////////////////\n+template <class Typ> \n+List<Typ>::List()\n+{\n+ head=new ListEl<Typ>();\n+ if (!head) { cerr<<"Could not create new element\\n"; return; }\n+ tail=new ListEl<Typ>(head,NULL);\n+ if (!tail) { cerr<<"Could not create new element\\n"; return; }\n+ tail->next = tail;\n+ head->prev = head;\n+ head->next = tail;\n+ current = head;\n+ size=0;\n+}\n+\n+////////////////////////////////////////////////////////////////////////////\n+// Creates List with one element \n+////////////////////////////////////////////////////////////////////////////\n+template <class Typ> \n+List<Typ>::List(Typ d)\n+{\n+ head=new ListEl<Typ>();\n+ if (!head) { cerr<<"Could not create new element\\n"; return; }\n+ tail=new ListEl<Typ>();\n+ if (!tail) { cerr<<"Could not create new element\\n"; return; }\n+ ListEl<Typ>* el = new ListEl<Typ>(d,head,tail);\n+ if (!el) { cerr<<"Could not create new element\\n"; return; }\n+ head->prev = head;\n+ head->next = el;\n+ tail->prev = el;\n+ tail->next = tail;\n+ current = head;\n+ size=1;\n+}\n+\n+////////////////////////////////////////////////////////////////////////////\n+// Destructor deletes List object\n+////////////////////////////////////////////////////////////////////////////\n+template <class Typ> \n+List<Typ>::~List()\n+{\n+ ListEl<Typ>* n=head->next;\n+ while(head!=n)\n+ {\n+ delete(head); head = NULL;\n+ head=n;\n+ n=head->next;\n+ }\n+ delete(head); head = NULL;\n+}\n+\n+////////////////////////////////////////////////////////////////////////////\n+// Flat copy\n+////////////////////////////////////////////////////////////////////////////\n+template <class Typ> \n+List<Typ>& List<Typ>::operator=(List<Typ>& l)\n+{\n+ head = l.head;\n+ tail = l.tail;\n+ current = l.current;\n+ size = l.size;\n+}\n+\n+\n+////////////////////////////////////////////////////////////////////////////\n+// Reverse order of list\n+////////////////////////////////////////////////////////////////////////////\n+template <class Typ> \n+void List<Typ>::Reverse()\n+{\n+ ListEl<Typ> *n; // next list element; also for swapping\n+ ListEl<Typ> *c; // current element to be sorted in. Everything to the left is already sorted\n+ if (Size()<=1) return;\n+ for (c=head; c!=tail; c=n)\n+ {\n+ // Swap prev a'..b'ot < r->data); \n+ do l=l->next; while (l->data < pivot);\n+ if (l==r || l->prev==r) break;\n+ SwapContent(l,r);\n+ }\n+ SortList(left,r,sz0);\n+ SortList(r->next,right,sz-sz0);\n+ pivot = tail->data; // to avoid calling the destructor of Typ on some real data element\n+ }\n+\n+////////////////////////////////////////////////////////////////////////////\n+// Use QUICKSORT to sort list of POINTERS by comparing the objects the pointers point to\n+////////////////////////////////////////////////////////////////////////////\n+template <class Typ> \n+void List<Typ>::SortPointerList(ListEl<Typ>* left, ListEl<Typ>* right) \n+{\n+ if (right==left || right->next==left) return;\n+ ListEl<Typ> *l=left->prev, *r=right->next;\n+ Typ pivot=left->data;\n+// cout<<"Sorting between "<<left->data<<" and "<<right->data<<". Pivot="<<pivot<<endl;\n+ while(1)\n+ {\n+// PrintList();\n+ do\n+\t{\n+\t r=r->prev;\n+// \t cout<<"r=r->prev. r->data="<<r->data<<endl;\n+\t} while(*pivot < *(r->data)); \n+ do\n+\t{\n+\t l=l->next;\n+// \t cout<<"l=l->next l->data="<<l->data<<endl;\n+\t} while (*(l->data) < *pivot);\n+ if (l==r || l->prev==r) break;\n+ SwapContent(l,r);\n+ }\n+ SortPointerList(left,r);\n+ SortPointerList(r->next,right);\n+}\n+\n+// Use INSERTSORT to sort list in asscending order between two list elements. Use only for presorted lists, otherwise time O(N^2)!\n+template <class Typ> \n+void List<Typ>::ResortList() \n+{\n+ ListEl<Typ> *c; // current element to be sorted in. Everything to the left is already sorted\n+ ListEl<Typ> *n; // next element to be sorted in\n+ ListEl<Typ> *p; // pointer for looping through sorted part of list\n+ ListEl<Typ> *pnext; // for swapping\n+ if (Size()<=1) return;\n+ c=head->next->next;\n+ while (c!=tail) \n+ {\n+ p=c->prev;\n+ n=c->next;\n+ if (c->data < p->data)\n+\t{\n+\t do {p=p->prev;} while (p!=head && c->data < p->data);\n+\t // Connect c->prev to c->next ...\n+\t c->next->prev=c->prev;\n+\t c->prev->next=c->next;\n+\t // ... and insert c between p and p->next ...\n+\t pnext=p->next;\n+\t p->next=c;\n+\t c->next=pnext;\n+\t pnext->prev=c;\n+\t c->prev=p;\n+\t}\n+ c=n;\n+ }\n+}\n+\n+\n+#endif /* JLIST */\n+\n+\n+// //Main program: test class List\n+\n+// int main()\n+// {\n+// int p;\n+// List<int>* plist=new List<int>(11);\n+// List<int> list(22);\n+\n+// plist->Push(24);\n+// plist->Push(18);\n+// plist->Push(3);\n+// plist->Enqueue(17);\n+// plist->Enqueue(29);\n+// printf("List 1 with pushed and enqueued elements:\\n");\n+// plist->PrintList();\n+\n+// list.Push(222);\n+// printf("List 1 with list 2 appended:\\n");\n+// plist->Append(&list);\n+// plist->PrintList();\n+\n+// printf("Pushing one element three times into list 2:\\n");\n+// list.Push(333);\n+// list.Push(444);\n+// list.Push(555);\n+// printf("Printing plist and list with three elements:\\n");\n+// list.PrintList();\n+// plist->PrintList();\n+ \n+// printf("list.Copy(plist). Printing list 1 and 2:\\n");\n+// list.Copy(plist);\n+// plist->PrintList(); \n+// list.PrintList();\n+\n+// printf("Appending list 1 to itself:\\n");\n+// plist->Append(plist);\n+// plist->PrintList();\n+\n+// cout<<"Popping "<<plist->Pop()<<"\\n";\n+// cout<<"Popping "<<plist->Pop()<<"\\n";\n+// plist->PrintList();\n+\n+// cout<<"Dequeing "<<plist->Dequeue()<<"\\n";\n+// cout<<"Dequeing "<<plist->Dequeue()<<"\\n";\n+// plist->PrintList();\n+\n+// cout<<"Reversing list\\n";\n+// plist->Reverse();\n+// plist->PrintList();\n+\n+// cout<<"Reversing to original list\\n";\n+// plist->Reverse();\n+// plist->PrintList();\n+\n+// for (p=plist->Reset(); p>=5;p--)\n+// {cout<<plist->GetPos()<<": "<<plist->Read(p)<<"\\n";}\n+ \n+// cout<<"Deleting "<<plist->Delete()<<"\\n";\n+// cout<<"Deleting "<<plist->Delete()<<"\\n";\n+// plist->PrintList();\n+\n+// plist->Append(plist);\n+// plist->PrintList();\n+// cout<<"List 1 sorted:\\n";\n+// plist->SortList();\n+// plist->PrintList();\n+\n+// }\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/hhalign/list.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/hhalign/list.h Thu Jul 21 13:35:08 2011 -0400 |
b |
@@ -0,0 +1,193 @@ +/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ + +/********************************************************************* + * Clustal Omega - Multiple sequence alignment + * + * Copyright (C) 2010 University College Dublin + * + * Clustal-Omega is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This file is part of Clustal-Omega. + * + ********************************************************************/ + +/* + * RCS $Id: list.h 143 2010-10-14 13:11:14Z andreas $ + */ + +// list.h + + +////////////////////////////////////////////////////////////////////////////// +// Double-linked list implementation with head and tail dummy elements +// We set head->prev=head and tail->next=tail. +// This makes sure that repeated current=current->next; ends up in tail +// and repeated current=current->prev; ends up in head. +// head and tail optionally contain a NULL element of Typ defined by method Null(Typ) +////////////////////////////////////////////////////////////////////////////// + +template<class Typ> +class List +{ +protected: +template<class Typ1> +class ListEl //elements of List; essentially a data structure + { + public: + Typ1 data; //Typ is type of data to be stored in list + ListEl* prev; //points to previous list element + ListEl* next; //points to next list element + ListEl() : prev(0), next(0) {} + ListEl(Typ1 d) : data(d), prev(0), next(0) {} + ListEl(ListEl* p, ListEl* n) : prev(p), next(n) {} + ListEl(Typ1 d, ListEl* p, ListEl* n) : data(d), prev(p), next(n) {} + }; + + ListEl<Typ>* head; //points to dummy element at beginning of list + ListEl<Typ>* tail; //points to dummy element at end of list + ListEl<Typ>* current; //current element position within list + int size; //Number of elements in list + + // Use QUICKSORT to sort list in asscending order between two list elements + void SortList(ListEl<Typ>*, ListEl<Typ>*, int); + // Use QUICKSORT to sort list of pointers by comparing elements they point to + void SortPointerList(ListEl<Typ>*, ListEl<Typ>*); + + // Swap two list elements by making a flat copy (don't need two copies of data) + // Warning: Gets slow if Typ is composite type with many variables (>=5) + void SwapContent(ListEl<Typ>* e1, ListEl<Typ>* e2) + { Typ d; if (e1!=e2) {d=e1->data; e1->data=e2->data; e2->data=d;} } + +public: +////////////////////////////////////////////////////////////////////////////// +// General methods + List(); + List(Typ d); + ~List(); + List<Typ>& operator=(List<Typ>&); + + // Set Null element that will be returned when trying to read from an empty list + void Null(Typ null) {head->data = tail->data = null;} + + +////////////////////////////////////////////////////////////////////////////// +// Methods that act at the end of the list + + // Insert Element after LAST element of list (and return address of data element) + Typ* Push(Typ); + + // Remove and return LAST element of list. Returns head->data if list empty + Typ Pop(); + + // return LAST element of list. Returns null element in head->data if list empty + Typ ReadLast() {return tail->prev->data;} + + +////////////////////////////////////////////////////////////////////////////// +// Methods that act at the beginning of the list + + // Insert element as FIRST element of list (and return address of data element) + Typ* Enqueue(Typ); + + // Remove and return element at BEGINNING of list. Returns head->data if list empty + Typ Dequeue(); + + // return FIRST element of list. Returns null element in head->data if list empty + Typ ReadFirst() {if (size) return head->next->data; else return head->data;} + + +////////////////////////////////////////////////////////////////////////////// +// Methods that work with 'current' position in the list + + // Advances current position by 1 and reads next element; returns head->data if at end of list. + Typ ReadNext(); + + // Reads current element again + Typ ReadCurrent(); + + // Moves current position back by 1 and reads previous element; returns head->data if at beginning of list. + Typ ReadPrevious(); + + // Advances current position by 1 and reads address of next element; returns NULL if at end of list. + Typ* ReadNextAddress(); + + // Reads address of current element again, returns NULL if at end of list + Typ* ReadCurrentAddress(); + + // Sets current position to k and reads k'th element (first=1). Returns head->data if current points to no data element + Typ Read(int); + + // Inserts element AFTER CURRENT element; current element will be set to inserted element + void Insert(Typ); + + // Removes and returns element at CURRENT position. New position is one BEFORE current position. + // Returns head->data if current points to no data element. After Reset() delete first element (not 0'th) + Typ Delete(); + + // Overwrites data at current position with new data + void Overwrite(Typ d) {current->data=d;} + + // Reset current position to 0 (one BEFORE the first) + int Reset() {current = head; return size;} + + // Reset current position to End (one AFTER the last) + int SetToEnd() {current = tail; return size;} + + +////////////////////////////////////////////////////////////////////////////// +// Methods that return information about the list + + // Return number of list elements (size>=0) + int Size() {return size;} + + // return true if end of list, i.e. ReadNext would give tail->data (i.e. current position >= Size) + char End() {return (current==tail || current==tail->prev);} + char End(void* curr) {return ( curr == tail || curr == tail->prev);} + + // return true if start of list, i.e. ReadPrevious would give head->data (i.e. current position <=1) + char Start() {return (current==head || current==head->next);} + + // Get current position within list (0 <= pos <= Size+1) + int GetPos(); + + //print out list (elements assumed int) + void PrintList(); + + // Get largest data element (Null element for empty list) + Typ Largest(); + + // Get smallest data element (Null element for empty list) + Typ Smallest(); + +////////////////////////////////////////////////////////////////////////////// +// Methods that manipulate the list as a whole + + // Reverse list + void Reverse(); + + // Copies list into list object + void Copy(List<Typ>* list); + + // Appends a copy of list to class object + void AppendCopy(List<Typ>* list); + + // Appends list to class object list + void Append(List<Typ>* list); + + // Use QUICKSORT to sort list in ascending order. Use only for UNSORTED lists, otherwise time O(N^2) instead of O(N*log(N)) +/* void SortList() {if (size>1) SortList(head->next, tail->prev);} */ + void SortList() {if (size>1) SortList(head->next, tail->prev, size);} + void QuickSort() {if (size>1) SortList(head->next, tail->prev, size);} + + // Use QUICKSORT to sort list of pointers in ascending order. Use only for UNSORTED lists, otherwwise time O(N^2)! + void SortPointerList() {if (size>1) SortPointerList(head->next, tail->prev);} + void QuickSortPointer() {if (size>1) SortPointerList(head->next, tail->prev);} + + // Use INSERTSORT to sort list in asscending order. Use only for PRESORTED lists, otherwise time O(N^2)! + void ResortList(); +}; + + |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/hhalign/util-C.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/hhalign/util-C.h Thu Jul 21 13:35:08 2011 -0400 |
[ |
b'@@ -0,0 +1,879 @@\n+/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n+\n+/*********************************************************************\n+ * Clustal Omega - Multiple sequence alignment\n+ *\n+ * Copyright (C) 2010 University College Dublin\n+ *\n+ * Clustal-Omega is free software; you can redistribute it and/or\n+ * modify it under the terms of the GNU General Public License as\n+ * published by the Free Software Foundation; either version 2 of the\n+ * License, or (at your option) any later version.\n+ *\n+ * This file is part of Clustal-Omega.\n+ *\n+ ********************************************************************/\n+\n+/*\n+ * RCS $Id: util-C.h 155 2010-11-17 12:18:47Z fabian $\n+ */\n+\n+// Utility subroutines\n+\n+\n+#ifndef MAIN\n+#include <iostream> // cin, cout, cerr\n+#include <fstream> // ofstream, ifstream \n+#include <cstdio> // printf\n+#include <stdlib.h> // exit\n+#include <time.h> // clock\n+#endif\n+#include <sys/time.h>\n+\n+/////////////////////////////////////////////////////////////////////////////////////\n+// Arithmetics\n+/////////////////////////////////////////////////////////////////////////////////////\n+\n+//// max and min\n+inline double dmax(double x, double y) { return (x>y? x : y);}\n+inline double dmin(double x, double y) { return (x<y? x : y);}\n+inline int imax(int x, int y) { return (x>y? x : y);}\n+inline int imin(int x, int y) { return (x<y? x : y);}\n+inline int iabs(int x) { return (x>=0? x : -x);}\n+\n+// Rounding up, rounding down and rounding to nearest integer\n+inline int iceil(double x) {return int(ceil(x));}\n+inline int ifloor(double x) {return int(floor(x));}\n+inline int iround(double x) {return int(floor(x+0.5));}\n+\n+//// Generalized mean: d=0: sqrt(x*y) d=1: (x+y)/2 d->-inf: min(x,y) d->+inf: max(x,y) \n+inline double fmean(double x, double y, double d) { return pow( (pow(x,d)+pow(y,d))/2 ,1./d);}\n+\n+// log base 2\n+inline float log2(float x) {return (x<=0? (float)(-100000):1.442695041*log(x));}\n+inline float log10(float x) {return (x<=0? (float)(-100000):0.434294481*log(x));}\n+\n+\n+/////////////////////////////////////////////////////////////////////////////////////\n+// fast log base 2\n+/////////////////////////////////////////////////////////////////////////////////////\n+\n+// This function returns log2 with a max abolute deviation of +/- 1.5E-5 (typically 0.8E-5). \n+// It takes 1.42E-8 s whereas log2(x) takes 9.5E-7 s. It is hence 9.4 times faster. \n+// It makes use of the representation of 4-byte floating point numbers:\n+// seee eeee emmm mmmm mmmm mmmm mmmm mmmm\n+// s is the sign, \n+// the following 8 bits, eee eee e, give the exponent + 127 (in hex: 0x7f).\n+// The following 23 bits, m, give the mantisse, the binary digits behind the decimal point.\n+// In summary: x = (-1)^s * 1.mmmmmmmmmmmmmmmmmmmmmm * 2^(eeeeeee-127) \n+// The expression (((*(int *)&x) & 0x7f800000 ) >>23 )-0x7f is the exponent eeeeeeee, i.e. \n+// the largest integer that is smaller than log2(x) (e.g. -1 for 0.9). *(int *)&x is an integer which \n+// contains the bytes as the floating point variable x is represented in memory.\n+// Check: assert( sizeof(f) == sizeof(int) );\n+// Check: assert( sizeof(f) == 4 );\n+inline float fast_log2(float x) \n+{\n+ static float lg2[1025]; // lg2[i] = log2[1+x/1024]\n+ static float diff[1025]; // diff[i]= (lg2[i+1]-lg2[i])/8096 (for interpolation)\n+ static char initialized;\n+ if (x<=0) return -100000;\n+ if (!initialized) //First fill in the arrays lg2[i] and diff[i]\n+ {\n+ float prev = 0.0f;\n+ lg2[0] = 0.0f;\n+ for (int i=1; i<=1024; ++i) \n+\t{\n+\t lg2[i] = log(float(1024+i))*1.442695041-10.0f;\n+\t diff[i-1] = (lg2[i]-prev)*1.2352E-4;\n+\t prev = lg2[i];\n+\t}\n+ initialized=1;\n+ } \n+ int a = (((*((int *)&x)) & 0x7F800000) >>23 )-0x7f;\n+ int b = ((*((int *)&x)) & 0x007FE000) >>13;\n+ int c = ((*((int *)&x)) & 0x00001FFF);\n+ return a + lg2[b] + diff[b]*(float)(c);\n+}\n+\n+/////////////////////////////////////////'..b' char* ptr;\n+ char chr;\n+#ifdef WINDOWS\n+ ptr=strrchr(filename,92); //return adress for LAST \\ (backslash) in name\n+#else\n+ ptr=strrchr(filename,\'/\'); //return adress for LAST / in name\n+#endif\n+ if (ptr) {chr=*(++ptr); *ptr=\'\\0\'; strcpy(pathname,filename); *ptr=chr;} else *pathname=\'\\0\';\n+ return pathname;\n+}\n+\n+// Swaps two integer elements in array k\n+inline void swapi(int k[], int i, int j)\n+{\n+ int temp;\n+ temp=k[i]; k[i]=k[j]; k[j]=temp;\n+}\n+\n+// QSort sorting routine. time complexity of O(N ln(N)) on average\n+// Sorts the index array k between elements i=\'left\' and i=\'right\' in such a way that afterwards \n+// v[k[i]] is sorted downwards (up=-1) or upwards (up=+1)\n+void QSortInt(int v[], int k[], int left, int right, int up=+1)\n+{\n+ int i; \n+ int last; // last element to have been swapped\n+ \n+ if (left>=right) return; // do nothing if less then 2 elements to sort\n+ // Put pivot element in the middle of the sort range to the side (to position \'left\') ...\n+ swapi(k,left,(left+right)/2); \n+ last=left; \n+ // ... and swap all elements i SMALLER than the pivot \n+ // with an element that is LARGER than the pivot (element last+1):\n+ if (up==1)\n+ {\n+ for (i=left+1; i<=right; i++)\n+\tif (v[k[i]]<v[k[left]]) swapi(k,++last,i);\n+ }\n+ else\n+ for (i=left+1; i<=right; i++)\n+ if (v[k[i]]>v[k[left]]) swapi(k,++last,i);\n+\n+ // Put the pivot to the right of the elements which are SMALLER, left to elements which are LARGER\n+ swapi(k,left,last);\n+\n+ // Sort the elements left from the pivot and right from the pivot\n+ QSortInt(v,k,left,last-1,up);\n+ QSortInt(v,k,last+1,right,up);\n+}\n+\n+// QSort sorting routine. time complexity of O(N ln(N)) on average\n+// Sorts the index array k between elements i=\'left\' and i=\'right\' in such a way that afterwards \n+// v[k[i]] is sorted downwards (up=-1) or upwards (up=+1)\n+void QSortFloat(float v[], int k[], int left, int right, int up=+1)\n+{\n+ int i; \n+ int last; // last element to have been swapped\n+ void swapi(int k[], int i, int j);\n+ \n+ if (left>=right) return; // do nothing if less then 2 elements to sort\n+ // Put pivot element in the middle of the sort range to the side (to position \'left\') ...\n+ swapi(k,left,(left+right)/2); \n+ last=left; \n+ // ... and swap all elements i SMALLER than the pivot \n+ // with an element that is LARGER than the pivot (element last+1):\n+ if (up==1)\n+ {\n+ for (i=left+1; i<=right; i++)\n+ if (v[k[i]]<v[k[left]]) swapi(k,++last,i);\n+ }\n+ else\n+ for (i=left+1; i<=right; i++)\n+ if (v[k[i]]>v[k[left]]) swapi(k,++last,i);\n+\n+ // Put the pivot to the right of the elements which are SMALLER, left to elements which are LARGER\n+ swapi(k,left,last);\n+\n+ // Sort the elements left from the pivot and right from the pivot\n+ QSortFloat(v,k,left,last-1,up);\n+ QSortFloat(v,k,last+1,right,up);\n+}\n+\n+/**\n+ * @brief comparison function for qsort,\n+ * sorts floating point numbers ascendingly\n+ *\n+ * @param cv1 ponter to 1st entry to be sorted\n+ * @param cv2 ponter to 2nd entry to be sorted\n+ *\n+ * @return 0 if entries are equal,\n+ * +/-1 if 1st greater/smaller than 2nd\n+ */\n+int CompFltAsc(const void *cv1, const void *cv2){\n+\n+ float f1 = *(float *)cv1;\n+ float f2 = *(float *)cv2;\n+\n+ if (f1 > f2) { return +1; }\n+ else if (f1 < f2) { return -1; }\n+ else { return 0; }\n+\n+} /* this is the end of CompFltAsc() */\n+\n+//Return random number in the range [0,1]\n+inline float frand() { return rand()/(RAND_MAX+1.0); }\n+\n+\n+/////////////////////////////////////////////////////////////////////////////////////\n+//// Execute system command\n+/////////////////////////////////////////////////////////////////////////////////////\n+void runSystem(std::string cmd, int v = 2)\n+{\n+ if (v>2)\n+ cout << "Command: " << cmd << "!\\n";\n+ int res = system(cmd.c_str());\n+ if (res!=0) \n+ {\n+ cerr << endl << "ERROR when executing: " << cmd << "!\\n";\n+ exit(1);\n+ }\n+ \n+}\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/kmpp/KMeans.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/kmpp/KMeans.cpp Thu Jul 21 13:35:08 2011 -0400 |
[ |
b'@@ -0,0 +1,214 @@\n+// See KMeans.h\r\n+//\r\n+// Author: David Arthur (darthur@gmail.com), 2009\r\n+\r\n+// Includes\r\n+\r\n+#ifdef CLUSTALO\r\n+/* previously in KMeans.h */\r\n+#include "KmUtils.h"\r\n+#include <iostream>\r\n+#include <stdio.h>\r\n+\r\n+// Sets preferences for how much logging is done and where it is outputted, when k-means is run.\r\n+void ClearKMeansLogging();\r\n+void AddKMeansLogging(std::ostream *out, bool verbose);\r\n+\r\n+/*\r\n+// Runs k-means++ on the given set of points. Set RunKMeans for info on the parameters.\r\n+*/\r\n+Scalar\r\n+RunKMeansPlusPlus(int n, int k, int d, Scalar *points, int attempts,\r\n+ Scalar *centers, int *assignments);\r\n+\r\n+Scalar\r\n+RunKMeans(int n, int k, int d, Scalar *points, int attempts,\r\n+ Scalar *centers, int *assignments);\r\n+#else\r\n+#include "KMeans.h"\r\n+#endif\r\n+#include "KmTree.h"\r\n+#include <sstream>\r\n+#include <time.h>\r\n+#include <vector>\r\n+\r\n+#ifdef CLUSTALO\r\n+extern "C" double\r\n+KMeans(int n, int k, int d, Scalar *points, int attempts, int use_lloyds_method,\r\n+ double *centers, int *assignments)\r\n+{\r\n+ if (use_lloyds_method) {\r\n+ /*fprintf(stderr, "FIXME using LLoyd\'s method\\n");*/\r\n+ return RunKMeans(n, k, d, points, attempts,\r\n+ centers, assignments);\r\n+ } else {\r\n+ /*fprintf(stderr, "FIXME using KMeansPP method\\n");*/\r\n+ return RunKMeansPlusPlus(n, k, d, points, attempts,\r\n+ centers, assignments);\r\n+ }\r\n+}\r\n+#endif\r\n+\r\n+using namespace std;\r\n+\r\n+// Logging\r\n+static vector<ostream*> gLogOutputs;\r\n+static vector<ostream*> gVerboseLogOutputs;\r\n+#define LOG(verbose, text) { \\\r\n+ vector<ostream*> &outputs = (verbose? gVerboseLogOutputs : gLogOutputs); \\\r\n+ if (outputs.size() > 0) { \\\r\n+ ostringstream string_stream; \\\r\n+ string_stream << text; \\\r\n+ for (int i = 0; i < (int)outputs.size(); i++) \\\r\n+ *(outputs[i]) << string_stream.str(); \\\r\n+ } \\\r\n+}\r\n+void AddKMeansLogging(std::ostream *out, bool verbose) {\r\n+ if (verbose)\r\n+ gVerboseLogOutputs.push_back(out);\r\n+ gLogOutputs.push_back(out);\r\n+}\r\n+void ClearKMeansLogging() {\r\n+ gLogOutputs.clear();\r\n+ gVerboseLogOutputs.clear();\r\n+}\r\n+\r\n+// Returns the number of seconds since the program began execution.\r\n+static double GetSeconds() {\r\n+ return double(clock()) / CLOCKS_PER_SEC;\r\n+}\r\n+\r\n+// See KMeans.h\r\n+// Performs one full execution of k-means, logging any relevant information, and tracking meta\r\n+// statistics for the run. If min or max values are negative, they are treated as unset.\r\n+// best_centers and best_assignment can be 0, in which case they are not set.\r\n+static void RunKMeansOnce(const KmTree &tree, int n, int k, int d, Scalar *points, Scalar *centers,\r\n+ Scalar *min_cost, Scalar *max_cost, Scalar *total_cost,\r\n+ double start_time, double *min_time, double *max_time,\r\n+ double *total_time, Scalar *best_centers, int *best_assignment) {\r\n+ const Scalar kEpsilon = Scalar(1e-8); // Used to determine when to terminate k-means\r\n+\r\n+ // Do iterations of k-means until the cost stabilizes\r\n+ Scalar old_cost = 0;\r\n+ bool is_done = false;\r\n+ for (int iteration = 0; !is_done; iteration++) {\r\n+ Scalar new_cost = tree.DoKMeansStep(k, centers, 0);\r\n+ is_done = (iteration > 0 && new_cost >= (1 - kEpsilon) * old_cost);\r\n+ old_cost = new_cost;\r\n+ LOG(true, "Completed iteration #" << (iteration+1) << ", cost=" << new_cost << "..." << endl);\r\n+ }\r\n+ double this_time = GetSeconds() - start_time;\r\n+\r\n+ // Log the clustering we found\r\n+ LOG(false, "Completed run: cost=" << old_cost << " (" << this_time <'..b'cost < 0 || old_cost < *min_cost) {\r\n+ *min_cost = old_cost;\r\n+ if (best_assignment != 0)\r\n+ tree.DoKMeansStep(k, centers, best_assignment);\r\n+ if (best_centers != 0)\r\n+ memcpy(best_centers, centers, sizeof(Scalar)*k*d);\r\n+ }\r\n+\r\n+ // Update all other aggregate stats\r\n+ if (*max_cost < old_cost) *max_cost = old_cost;\r\n+ *total_cost += old_cost;\r\n+ if (*min_time < 0 || *min_time > this_time)\r\n+ *min_time = this_time;\r\n+ if (*max_time < this_time) *max_time = this_time;\r\n+ *total_time += this_time;\r\n+}\r\n+\r\n+// Outputs all meta-stats for a set of k-means or k-means++ runs.\r\n+void LogMetaStats(Scalar min_cost, Scalar max_cost, Scalar total_cost,\r\n+ double min_time, double max_time, double total_time, int num_attempts) {\r\n+ LOG(false, "Aggregate info over " << num_attempts << " runs:" << endl);\r\n+ LOG(false, " Cost: min=" << min_cost << " average=" << (total_cost / num_attempts)\r\n+ << " max=" << max_cost << endl);\r\n+ LOG(false, " Time: min=" << min_time << " average=" << (total_time / num_attempts)\r\n+ << " max=" << max_time << endl << endl);\r\n+}\r\n+\r\n+// See KMeans.h\r\n+Scalar RunKMeans(int n, int k, int d, Scalar *points, int attempts,\r\n+ Scalar *ret_centers, int *ret_assignment) {\r\n+ KM_ASSERT(k >= 1);\r\n+ \r\n+ // Create the tree and log\r\n+ LOG(false, "Running k-means..." << endl);\r\n+ KmTree tree(n, d, points);\r\n+ LOG(false, "Done preprocessing..." << endl);\r\n+\r\n+ // Initialization\r\n+ Scalar *centers = (Scalar*)malloc(sizeof(Scalar)*k*d);\r\n+ int *unused_centers = (int*)malloc(sizeof(int)*n);\r\n+ KM_ASSERT(centers != 0 && unused_centers != 0);\r\n+ Scalar min_cost = -1, max_cost = -1, total_cost = 0;\r\n+ double min_time = -1, max_time = -1, total_time = 0;\r\n+ \r\n+ // Handle k > n\r\n+ if (k > n) {\r\n+ memset(centers + n*d, -1, (k-d)*sizeof(Scalar));\r\n+ k = n;\r\n+ }\r\n+\r\n+ // Run all the attempts\r\n+ for (int attempt = 0; attempt < attempts; attempt++) {\r\n+ double start_time = GetSeconds();\r\n+\r\n+ // Choose centers uniformly at random\r\n+ for (int i = 0; i < n; i++)\r\n+ unused_centers[i] = i;\r\n+ int num_unused_centers = n;\r\n+ for (int i = 0; i < k; i++) {\r\n+ int j = GetRandom(num_unused_centers--);\r\n+ memcpy(centers + i*d, points + unused_centers[j]*d, d*sizeof(Scalar));\r\n+ unused_centers[j] = unused_centers[num_unused_centers];\r\n+ }\r\n+ \r\n+ // Run k-means\r\n+ RunKMeansOnce(tree, n, k, d, points, centers, &min_cost, &max_cost, &total_cost, start_time,\r\n+ &min_time, &max_time, &total_time, ret_centers, ret_assignment);\r\n+ }\r\n+ LogMetaStats(min_cost, max_cost, total_cost, min_time, max_time, total_time, attempts);\r\n+\r\n+ // Clean up and return\r\n+ free(unused_centers);\r\n+ free(centers);\r\n+ return min_cost;\r\n+}\r\n+\r\n+// See KMeans.h\r\n+Scalar RunKMeansPlusPlus(int n, int k, int d, Scalar *points, int attempts,\r\n+ Scalar *ret_centers, int *ret_assignment) {\r\n+ KM_ASSERT(k >= 1);\r\n+\r\n+ // Create the tree and log\r\n+ LOG(false, "Running k-means++..." << endl);\r\n+ KmTree tree(n, d, points);\r\n+ LOG(false, "Done preprocessing..." << endl);\r\n+\r\n+ // Initialization\r\n+ Scalar *centers = (Scalar*)malloc(sizeof(Scalar)*k*d);\r\n+ KM_ASSERT(centers != 0);\r\n+ Scalar min_cost = -1, max_cost = -1, total_cost = 0;\r\n+ double min_time = -1, max_time = -1, total_time = 0;\r\n+\r\n+ // Run all the attempts\r\n+ for (int attempt = 0; attempt < attempts; attempt++) {\r\n+ double start_time = GetSeconds();\r\n+\r\n+ // Choose centers using k-means++ seeding\r\n+ tree.SeedKMeansPlusPlus(k, centers);\r\n+ \r\n+ // Run k-means\r\n+ RunKMeansOnce(tree, n, k, d, points, centers, &min_cost, &max_cost, &total_cost, start_time,\r\n+ &min_time, &max_time, &total_time, ret_centers, ret_assignment);\r\n+ }\r\n+ LogMetaStats(min_cost, max_cost, total_cost, min_time, max_time, total_time, attempts);\r\n+\r\n+ // Clean up and return\r\n+ free(centers);\r\n+ return min_cost;\r\n+}\r\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/kmpp/KMeans.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/kmpp/KMeans.h Thu Jul 21 13:35:08 2011 -0400 |
[ |
@@ -0,0 +1,56 @@ +#ifndef CLUSTALO +// BEWARE: BETA VERSION +// -------------------- +// +// The main set of utilities for runnning k-means and k-means++ on arbitrary data sets. +// +// Author: David Arthur (darthur@gmail.com), 2009 +#endif + +#ifndef KMEANS_H__ +#define KMEANS_H__ + +#ifndef CLUSTALO +// Includes +#include "KmUtils.h" +#include <iostream> + +// Sets preferences for how much logging is done and where it is outputted, when k-means is run. +void ClearKMeansLogging(); +void AddKMeansLogging(std::ostream *out, bool verbose); + +// Runs k-means on the given set of points. +// - n: The number of points in the data set +// - k: The number of clusters to look for +// - d: The number of dimensions that the data set lives in +// - points: An array of size n*d where points[d*i + j] gives coordinate j of point i +// - attempts: The number of times to independently run k-means with different starting centers. +// The best result is always returned (as measured by the cost function). +// - centers: This can either be null or an array of size k*d. In the latter case, it will be +// filled with the locations of all final cluster centers. Specifically +// centers[d*i + j] will give coordinate j of center i. If the cluster is unused, it +// will contain NaN instead. +// - assignments: This can either be null or an array of size n. In the latter case, it will be +// filled with the cluster that each point is assigned to (an integer between 0 +// and k-1 inclusive). +// The final cost of the clustering is also returned. +// The final cost of the clustering is also returned. +Scalar RunKMeans(int n, int k, int d, Scalar *points, int attempts, + Scalar *centers, int *assignments); + +// Runs k-means++ on the given set of points. Set RunKMeans for info on the parameters. +Scalar RunKMeansPlusPlus(int n, int k, int d, Scalar *points, int attempts, + Scalar *centers, int *assignments); + +#else + +/* CLUSTALO PATCH: + * same as above, with one addition: if use_lloyds_method is false, kmpp will be used + * otherwise the 'classical' i.e. Looyd's method will be used + */ +extern double +KMeans(int n, int k, int d, double *points, int attempts, int use_lloyds_method, + double *centers, int *assignments); + +#endif +#endif |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/kmpp/KmTree.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/kmpp/KmTree.cpp Thu Jul 21 13:35:08 2011 -0400 |
[ |
b'@@ -0,0 +1,363 @@\n+// See KmTree.cpp\n+//\n+// Author: David Arthur (darthur@gmail.com), 2009\n+\n+// Includes\n+#include "KmTree.h"\n+#include <iostream>\n+#include <stdlib.h>\n+#include <stdio.h>\n+using namespace std;\n+\n+KmTree::KmTree(int n, int d, Scalar *points): n_(n), d_(d), points_(points) {\n+ // Initialize memory\n+ // DD: need to cast to long otherwise malloc will fail\n+ // if we need more than 2 gigabytes or so\n+ int node_size = sizeof(Node) + d_ * 3 * sizeof(Scalar);\n+ node_data_ = (char*)malloc((2*(long unsigned int)n-1) * node_size);\n+ point_indices_ = (int*)malloc(n * sizeof(int));\n+ for (int i = 0; i < n; i++)\n+ point_indices_[i] = i;\n+ KM_ASSERT(node_data_ != 0 && point_indices_ != 0);\n+\n+ // Calculate the bounding box for the points\n+ Scalar *bound_v1 = PointAllocate(d_);\n+ Scalar *bound_v2 = PointAllocate(d_);\n+ KM_ASSERT(bound_v1 != 0 && bound_v2 != 0);\n+ PointCopy(bound_v1, points, d_);\n+ PointCopy(bound_v2, points, d_);\n+ for (int i = 1; i < n; i++)\n+ for (int j = 0; j < d; j++) {\n+ if (bound_v1[j] > points[i*d_ + j]) bound_v1[j] = points[i*d_ + j];\n+ if (bound_v2[j] < points[i*d_ + j]) bound_v1[j] = points[i*d_ + j];\n+ }\n+\n+ // Build the tree\n+ char *temp_node_data = node_data_;\n+ top_node_ = BuildNodes(points, 0, n-1, &temp_node_data);\n+\n+ // Cleanup\n+ PointFree(bound_v1);\n+ PointFree(bound_v2);\n+}\n+\n+KmTree::~KmTree() {\n+ free(point_indices_);\n+ free(node_data_);\n+}\n+\n+Scalar KmTree::DoKMeansStep(int k, Scalar *centers, int *assignment) const {\n+ // Create an invalid center for comparison purposes\n+ Scalar *bad_center = PointAllocate(d_);\n+ KM_ASSERT(bad_center != 0);\n+ memset(bad_center, 0xff, d_ * sizeof(Scalar));\n+\n+ // Allocate data\n+ Scalar *sums = (Scalar*)calloc(k * d_, sizeof(Scalar));\n+ int *counts = (int*)calloc(k, sizeof(int));\n+ int num_candidates = 0;\n+ int *candidates = (int*)malloc(k * sizeof(int));\n+ KM_ASSERT(sums != 0 && counts != 0 && candidates != 0);\n+ for (int i = 0; i < k; i++)\n+ if (memcmp(centers + i*d_, bad_center, d_ * sizeof(Scalar)) != 0)\n+ candidates[num_candidates++] = i;\n+\n+ // Find nodes\n+ Scalar result = DoKMeansStepAtNode(top_node_, num_candidates, candidates, centers, sums,\n+ counts, assignment);\n+\n+ // Set the new centers\n+ for (int i = 0; i < k; i++) {\n+ if (counts[i] > 0) {\n+ PointScale(sums + i*d_, Scalar(1) / counts[i], d_);\n+ PointCopy(centers + i*d_, sums + i*d_, d_);\n+ } else {\n+ memcpy(centers + i*d_, bad_center, d_ * sizeof(Scalar));\n+ }\n+ }\n+\n+ // Cleanup memory\n+ PointFree(bad_center);\n+ free(candidates);\n+ free(counts);\n+ free(sums);\n+ return result;\n+}\n+\n+// Helper functions for constructor\n+// ================================\n+\n+// Build a kd tree from the given set of points\n+KmTree::Node *KmTree::BuildNodes(Scalar *points, int first_index, int last_index,\n+ char **next_node_data) {\n+ // Allocate the node\n+ Node *node = (Node*)(*next_node_data);\n+ (*next_node_data) += sizeof(Node);\n+ node->sum = (Scalar*)(*next_node_data);\n+ (*next_node_data) += sizeof(Scalar) * d_;\n+ node->median = (Scalar*)(*next_node_data);\n+ (*next_node_data) += sizeof(Scalar) * d_;\n+ node->radius = (Scalar*)(*next_node_data);\n+ (*next_node_data) += sizeof(Scalar) * d_;\n+\n+ // Fill in basic info\n+ node->num_points = (last_index - first_index + 1);\n+ node->first_point_index = first_index;\n+\n+ // Calculate the bounding box\n+ Scalar *first_point = points + point_indices_[first_index] * d_;\n+ Scalar *bound_p1 = PointAllocate(d_);\n+ Scalar *bound_p2 = PointAllocate(d_);\n+ KM_ASSERT(bound_p1 != 0 && bound_p2 != 0);\n+ PointCopy(bound_p1, first_point, d_);\n+ PointCopy(bound_p2, first_point, d_);\n+ for (int i = first_index+1; i <= last_index; i++)\n+ for (int j = 0; j < d_; j++) {\n+ Scalar c = points[point_indices_[i]*d_ + j];\n+ if (bound_p1[j] > c) bound_p1[j] = c;\n+ if (bound_p2[j] < c) bound_p2[j] = c;\n+ }\n+\n+ // C'..b't_index], c = centers[test_index], then:\n+// (x-c).(x-c) < (x-c_0).(x-c_0)\n+// <=> (c-c_0).(c-c_0) < 2(x-c_0).(c-c_0)\n+//\n+// The right-hand side is maximized for a vertex of the box where for each dimension, we choose\n+// the low or high value based on the sign of x-c_0 in that dimension.\n+bool KmTree::ShouldBePruned(Scalar *box_median, Scalar *box_radius, Scalar *centers,\n+ int best_index, int test_index) const {\n+ if (best_index == test_index)\n+ return false;\n+ \n+ Scalar *best = centers + best_index*d_;\n+ Scalar *test = centers + test_index*d_;\n+ Scalar lhs = 0, rhs = 0;\n+ for (int i = 0; i < d_; i++) {\n+ Scalar component = test[i] - best[i];\n+ lhs += component * component;\n+ if (component > 0)\n+ rhs += (box_median[i] + box_radius[i] - best[i]) * component;\n+ else\n+ rhs += (box_median[i] - box_radius[i] - best[i]) * component;\n+ }\n+ return (lhs >= 2*rhs);\n+}\n+\n+Scalar KmTree::SeedKMeansPlusPlus(int k, Scalar *centers) const {\n+ Scalar *dist_sq = (Scalar*)malloc(n_ * sizeof(Scalar));\n+ KM_ASSERT(dist_sq != 0);\n+\n+ // Choose an initial center uniformly at random\n+ SeedKmppSetClusterIndex(top_node_, 0);\n+ int i = GetRandom(n_);\n+ memcpy(centers, points_ + point_indices_[i]*d_, d_*sizeof(Scalar));\n+ Scalar total_cost = 0;\n+ for (int j = 0; j < n_; j++) {\n+ dist_sq[j] = PointDistSq(points_ + point_indices_[j]*d_, centers, d_);\n+ total_cost += dist_sq[j];\n+ }\n+\n+ // Repeatedly choose more centers\n+ for (int new_cluster = 1; new_cluster < k; new_cluster++) {\n+ while (1) {\n+ Scalar cutoff = (rand() / Scalar(RAND_MAX)) * total_cost;\n+ Scalar cur_cost = 0;\n+ for (i = 0; i < n_; i++) {\n+ cur_cost += dist_sq[i];\n+ if (cur_cost >= cutoff)\n+ break;\n+ }\n+ if (i < n_)\n+ break;\n+ }\n+ memcpy(centers + new_cluster*d_, points_ + point_indices_[i]*d_, d_*sizeof(Scalar));\n+ total_cost = SeedKmppUpdateAssignment(top_node_, new_cluster, centers, dist_sq);\n+ }\n+\n+ // Clean up and return\n+ free(dist_sq);\n+ return total_cost;\n+}\n+\n+// Helper functions for SeedKMeansPlusPlus\n+// =======================================\n+\n+// Sets kmpp_cluster_index to 0 for all nodes\n+void KmTree::SeedKmppSetClusterIndex(const Node *node, int value) const {\n+ node->kmpp_cluster_index = value;\n+ if (node->lower_node != 0) {\n+ SeedKmppSetClusterIndex(node->lower_node, value);\n+ SeedKmppSetClusterIndex(node->upper_node, value);\n+ }\n+}\n+\n+Scalar KmTree::SeedKmppUpdateAssignment(const Node *node, int new_cluster, Scalar *centers,\n+ Scalar *dist_sq) const {\n+ // See if we can assign all points in this node to one cluster\n+ if (node->kmpp_cluster_index >= 0) {\n+ if (ShouldBePruned(node->median, node->radius, centers, node->kmpp_cluster_index, new_cluster))\n+ return GetNodeCost(node, centers + node->kmpp_cluster_index*d_);\n+ if (ShouldBePruned(node->median, node->radius, centers, new_cluster,\n+ node->kmpp_cluster_index)) {\n+ SeedKmppSetClusterIndex(node, new_cluster);\n+ for (int i = node->first_point_index; i < node->first_point_index + node->num_points; i++)\n+ dist_sq[i] = PointDistSq(points_ + point_indices_[i]*d_, centers + new_cluster*d_, d_);\n+ return GetNodeCost(node, centers + new_cluster*d_);\n+ }\n+ \n+ // It may be that the a leaf-node point is equidistant from the new center or old\n+ if (node->lower_node == 0)\n+ return GetNodeCost(node, centers + node->kmpp_cluster_index*d_);\n+ }\n+\n+ // Recurse\n+ Scalar cost = SeedKmppUpdateAssignment(node->lower_node, new_cluster, centers, dist_sq) +\n+ SeedKmppUpdateAssignment(node->upper_node, new_cluster, centers, dist_sq);\n+ int i1 = node->lower_node->kmpp_cluster_index, i2 = node->upper_node->kmpp_cluster_index;\n+ if (i1 == i2 && i1 != -1)\n+ node->kmpp_cluster_index = i1;\n+ else\n+ node->kmpp_cluster_index = -1;\n+ return cost;\n+}\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/kmpp/KmTree.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/kmpp/KmTree.h Thu Jul 21 13:35:08 2011 -0400 |
b |
@@ -0,0 +1,77 @@ +// BEWARE: BETA VERSION +// -------------------- +// +// A k-d tree that vastly speeds up an iteration of k-means (in any number of dimensions). The main +// idea for this data structure is from Kanungo/Mount. This is used internally by Kmeans.cpp, and +// will most likely not need to be used directly. +// +// The stucture works as follows: +// - All data points are placed into a tree where we choose child nodes by partitioning all data +// points along a plane parallel to the axis. +// - We maintain for each node, the bounding box of all data points stored at that node. +// - To do a k-means iteration, we need to assign points to clusters and calculate the sum and +// the number of points assigned to each cluster. For each node in the tree, we can rule out +// some cluster centers as being too far away from every single point in that bounding box. +// Once only one cluster is left, all points in the node can be assigned to that cluster in +// batch. +// +// Author: David Arthur (darthur@gmail.com), 2009 + +#ifndef KM_TREE_H__ +#define KM_TREE_H__ + +// Includes +#include "KmUtils.h" + +// KmTree class definition +class KmTree { + public: + // Constructs a tree out of the given n data points living in R^d. + KmTree(int n, int d, Scalar *points); + ~KmTree(); + + // Given k cluster centers, this runs a full k-means iterations, choosing the next set of + // centers and returning the cost function for this set of centers. If assignment is not null, + // it should be an array of size n that will be filled with the index of the cluster (0 - k-1) + // that each data point is assigned to. The new center values will overwrite the old ones. + Scalar DoKMeansStep(int k, Scalar *centers, int *assignment) const; + + // Choose k initial centers for k-means using the kmeans++ seeding procedure. The resulting + // centers are returned via the centers variable, which should be pre-allocated to size k*d. + // The cost of the initial clustering is returned. + Scalar SeedKMeansPlusPlus(int k, Scalar *centers) const; + + private: + struct Node { + int num_points; // Number of points stored in this node + int first_point_index; // The smallest point index stored in this node + Scalar *median, *radius; // Bounding box center and half side-lengths + Scalar *sum; // Sum of the points stored in this node + Scalar opt_cost; // Min cost for putting all points in this node in 1 cluster + Node *lower_node, *upper_node; // Child nodes + mutable int kmpp_cluster_index; // The cluster these points are assigned to or -1 if variable + }; + + // Helper functions for constructor + Node *BuildNodes(Scalar *points, int first_index, int last_index, char **next_node_data); + Scalar GetNodeCost(const Node *node, Scalar *center) const; + + // Helper functions for DoKMeans step + Scalar DoKMeansStepAtNode(const Node *node, int k, int *candidates, Scalar *centers, + Scalar *sums, int *counts, int *assignment) const; + bool ShouldBePruned(Scalar *box_median, Scalar *box_radius, Scalar *centers, int best_index, + int test_index) const; + + // Helper functions for SeedKMeansPlusPlus + void SeedKmppSetClusterIndex(const Node *node, int index) const; + Scalar SeedKmppUpdateAssignment(const Node *node, int new_cluster, Scalar *centers, + Scalar *dist_sq) const; + + int n_, d_; + Scalar *points_; + Node *top_node_; + char *node_data_; + int *point_indices_; +}; + +#endif |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/kmpp/KmUtils.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/kmpp/KmUtils.cpp Thu Jul 21 13:35:08 2011 -0400 |
b |
@@ -0,0 +1,13 @@ +// See KmUtils.h +// +// Author: David Arthur (darthur@gmail.com), 2009 + +#include "KmUtils.h" +#include <iostream> +using namespace std; + +int __KMeansAssertionFailure(const char *file, int line, const char *expression) { + cout << "ASSERTION FAILURE, " << file << " line " << line << ":" << endl; + cout << " " << expression << endl; + exit(-1); +} |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/kmpp/KmUtils.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/kmpp/KmUtils.h Thu Jul 21 13:35:08 2011 -0400 |
[ |
@@ -0,0 +1,85 @@ +// BEWARE: BETA VERSION +// -------------------- +// +// Utilities for arbitrary dimensional points in space. All points are treated as simple value +// arrays. This is done for two reasons: +// - Using value arrays instead of a point class makes all point operations very explicit, which +// makes their usage easier to optimize. +// - A value array is about as universal a format as possible, which makes it easier for +// people to use the k-means code in any project. +// Also contains assertion code that can be disabled if desired. +// +// Author: David Arthur (darthur@gmail.com), 2009 + +#ifndef KM_UTILS_H__ +#define KM_UTILS_H__ + +// Includes +#ifndef CLUSTALO +#include <malloc.h> +#endif +#include <memory.h> +#include <stdlib.h> + +// The data-type used for a single coordinate for points +typedef double Scalar; + +// Point utilities +// =============== + +// Point creation and deletion +inline Scalar *PointAllocate(int d) { + return (Scalar*)malloc(d * sizeof(Scalar)); +} + +inline void PointFree(Scalar *p) { + free(p); +} + +inline void PointCopy(Scalar *p1, const Scalar *p2, int d) { + memcpy(p1, p2, d * sizeof(Scalar)); +} + +// Point vector tools +inline void PointAdd(Scalar *p1, const Scalar *p2, int d) { + for (int i = 0; i < d; i++) + p1[i] += p2[i]; +} + +inline void PointScale(Scalar *p, Scalar scale, int d) { + for (int i = 0; i < d; i++) + p[i] *= scale; +} + +inline Scalar PointDistSq(const Scalar *p1, const Scalar *p2, int d) { + Scalar result = 0; + for (int i = 0; i < d; i++) + result += (p1[i] - p2[i]) * (p1[i] - p2[i]); + return result; +} + +// Assertions +// ========== + +// Comment out ENABLE_KMEANS_ASSERTS to turn off ASSERTS for added speed. +#define ENABLE_KMEANS_ASSERTS +#ifdef ENABLE_KMEANS_ASSERTS +int __KMeansAssertionFailure(const char *file, int line, const char *expression); +#define KM_ASSERT(expression) \ + (void)((expression) != 0? 0 : __KMeansAssertionFailure(__FILE__, __LINE__, #expression)) +#else +#define KM_ASSERT(expression) +#endif + +// Miscellaneous utilities +// ======================= + +// Returns a random integer chosen uniformly from the range [0, n-1]. Note that RAND_MAX could be +// less than n. On Visual Studio, it is only 32767. For larger values of RAND_MAX, we need to be +// careful of overflow. +inline int GetRandom(int n) { + int u = rand() * RAND_MAX + rand(); + return ((u % n) + n) % n; +} + +#endif |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/kmpp/Makefile.am --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/kmpp/Makefile.am Thu Jul 21 13:35:08 2011 -0400 |
b |
@@ -0,0 +1,18 @@ +# Replaces squids own automake files +# +# Some useful automake documentation: +# http://www.openismus.com/documents/linux/automake/automake.shtml +# http://www.bioinf.uni-freiburg.de/~mmann/HowTo/automake.html + +#SUBDIRS = +#EXTRA_DIST = +#LDADD = + +# need DCLUSTALO here to enable Clustal specific squid patches +AM_CXXFLAGS = -DCLUSTALO @AM_CXXFLAGS@ + +noinst_LTLIBRARIES = libkmpp.la + +libkmpp_la_SOURCES = KMeans.cpp KMeans.h \ + KmTree.cpp KmTree.h \ + KmUtils.cpp KmUtils.h |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/kmpp/Makefile.in --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/kmpp/Makefile.in Thu Jul 21 13:35:08 2011 -0400 |
[ |
b'@@ -0,0 +1,504 @@\n+# Makefile.in generated by automake 1.11.1 from Makefile.am.\n+# @configure_input@\n+\n+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,\n+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,\n+# Inc.\n+# This Makefile.in is free software; the Free Software Foundation\n+# gives unlimited permission to copy and/or distribute it,\n+# with or without modifications, as long as this notice is preserved.\n+\n+# This program is distributed in the hope that it will be useful,\n+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without\n+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A\n+# PARTICULAR PURPOSE.\n+\n+@SET_MAKE@\n+\n+# Replaces squids own automake files\n+#\n+# Some useful automake documentation:\n+# http://www.openismus.com/documents/linux/automake/automake.shtml\n+# http://www.bioinf.uni-freiburg.de/~mmann/HowTo/automake.html\n+\n+#SUBDIRS =\n+#EXTRA_DIST = \n+#LDADD =\n+\n+VPATH = @srcdir@\n+pkgdatadir = $(datadir)/@PACKAGE@\n+pkgincludedir = $(includedir)/@PACKAGE@\n+pkglibdir = $(libdir)/@PACKAGE@\n+pkglibexecdir = $(libexecdir)/@PACKAGE@\n+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd\n+install_sh_DATA = $(install_sh) -c -m 644\n+install_sh_PROGRAM = $(install_sh) -c\n+install_sh_SCRIPT = $(install_sh) -c\n+INSTALL_HEADER = $(INSTALL_DATA)\n+transform = $(program_transform_name)\n+NORMAL_INSTALL = :\n+PRE_INSTALL = :\n+POST_INSTALL = :\n+NORMAL_UNINSTALL = :\n+PRE_UNINSTALL = :\n+POST_UNINSTALL = :\n+build_triplet = @build@\n+host_triplet = @host@\n+subdir = src/kmpp\n+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in\n+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4\n+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_prefix_config_h.m4 \\\n+\t$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \\\n+\t$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \\\n+\t$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/ax_openmp.m4 \\\n+\t$(top_srcdir)/configure.ac\n+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \\\n+\t$(ACLOCAL_M4)\n+mkinstalldirs = $(install_sh) -d\n+CONFIG_HEADER = $(top_builddir)/src/config.h\n+CONFIG_CLEAN_FILES =\n+CONFIG_CLEAN_VPATH_FILES =\n+LTLIBRARIES = $(noinst_LTLIBRARIES)\n+libkmpp_la_LIBADD =\n+am_libkmpp_la_OBJECTS = KMeans.lo KmTree.lo KmUtils.lo\n+libkmpp_la_OBJECTS = $(am_libkmpp_la_OBJECTS)\n+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src\n+depcomp = $(SHELL) $(top_srcdir)/depcomp\n+am__depfiles_maybe = depfiles\n+am__mv = mv -f\n+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \\\n+\t$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)\n+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \\\n+\t--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \\\n+\t$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)\n+CXXLD = $(CXX)\n+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \\\n+\t--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \\\n+\t$(LDFLAGS) -o $@\n+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \\\n+\t$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)\n+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \\\n+\t--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \\\n+\t$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)\n+CCLD = $(CC)\n+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \\\n+\t--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \\\n+\t$(LDFLAGS) -o $@\n+SOURCES = $(libkmpp_la_SOURCES)\n+DIST_SOURCES = $(libkmpp_la_SOURCES)\n+ETAGS = etags\n+CTAGS = ctags\n+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)\n+ACLOCAL = @ACLOCAL@\n+AMTAR = @AMTAR@\n+AM_CFLAGS = @AM_CFLAGS@\n+\n+# need DCLUSTALO here to enable Clustal specific squid patches\n+AM_CXXFLAGS = -DCLUSTALO @AM_CXXFLAGS@ \n+AM_LDFLAGS = @AM_LDFLAGS@\n+AR = @AR@\n+AUTOCONF = @AUTOCONF@\n+AUTOHEADER = @AUTOHEADER@\n+AUTOMAKE = @AUTOMAKE@\n+AWK = @AWK@\n+CC = @CC@\n+CCDEPMODE = @CCDEPMODE@\n+CFLAGS = @CFLAGS@\n+CPP = @CPP@\n+CPPFLAGS = @CPPFLAGS@\n+CXX = @CXX@\n+CXXCPP = @CXXCPP@\n+CXXDEPMODE '..b'\\&/g\'`; \\\n+\ttopsrcdirstrip=`echo "$(top_srcdir)" | sed \'s/[].[^$$\\\\*]/\\\\\\\\&/g\'`; \\\n+\tlist=\'$(DISTFILES)\'; \\\n+\t dist_files=`for file in $$list; do echo $$file; done | \\\n+\t sed -e "s|^$$srcdirstrip/||;t" \\\n+\t -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \\\n+\tcase $$dist_files in \\\n+\t */*) $(MKDIR_P) `echo "$$dist_files" | \\\n+\t\t\t sed \'/\\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,\' | \\\n+\t\t\t sort -u` ;; \\\n+\tesac; \\\n+\tfor file in $$dist_files; do \\\n+\t if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \\\n+\t if test -d $$d/$$file; then \\\n+\t dir=`echo "/$$file" | sed -e \'s,/[^/]*$$,,\'`; \\\n+\t if test -d "$(distdir)/$$file"; then \\\n+\t find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \\;; \\\n+\t fi; \\\n+\t if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \\\n+\t cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \\\n+\t find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \\;; \\\n+\t fi; \\\n+\t cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \\\n+\t else \\\n+\t test -f "$(distdir)/$$file" \\\n+\t || cp -p $$d/$$file "$(distdir)/$$file" \\\n+\t || exit 1; \\\n+\t fi; \\\n+\tdone\n+check-am: all-am\n+check: check-am\n+all-am: Makefile $(LTLIBRARIES)\n+installdirs:\n+install: install-am\n+install-exec: install-exec-am\n+install-data: install-data-am\n+uninstall: uninstall-am\n+\n+install-am: all-am\n+\t@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am\n+\n+installcheck: installcheck-am\n+install-strip:\n+\t$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \\\n+\t install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \\\n+\t `test -z \'$(STRIP)\' || \\\n+\t echo "INSTALL_PROGRAM_ENV=STRIPPROG=\'$(STRIP)\'"` install\n+mostlyclean-generic:\n+\n+clean-generic:\n+\n+distclean-generic:\n+\t-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)\n+\t-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)\n+\n+maintainer-clean-generic:\n+\t@echo "This command is intended for maintainers to use"\n+\t@echo "it deletes files that may require special tools to rebuild."\n+clean: clean-am\n+\n+clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \\\n+\tmostlyclean-am\n+\n+distclean: distclean-am\n+\t-rm -rf ./$(DEPDIR)\n+\t-rm -f Makefile\n+distclean-am: clean-am distclean-compile distclean-generic \\\n+\tdistclean-tags\n+\n+dvi: dvi-am\n+\n+dvi-am:\n+\n+html: html-am\n+\n+html-am:\n+\n+info: info-am\n+\n+info-am:\n+\n+install-data-am:\n+\n+install-dvi: install-dvi-am\n+\n+install-dvi-am:\n+\n+install-exec-am:\n+\n+install-html: install-html-am\n+\n+install-html-am:\n+\n+install-info: install-info-am\n+\n+install-info-am:\n+\n+install-man:\n+\n+install-pdf: install-pdf-am\n+\n+install-pdf-am:\n+\n+install-ps: install-ps-am\n+\n+install-ps-am:\n+\n+installcheck-am:\n+\n+maintainer-clean: maintainer-clean-am\n+\t-rm -rf ./$(DEPDIR)\n+\t-rm -f Makefile\n+maintainer-clean-am: distclean-am maintainer-clean-generic\n+\n+mostlyclean: mostlyclean-am\n+\n+mostlyclean-am: mostlyclean-compile mostlyclean-generic \\\n+\tmostlyclean-libtool\n+\n+pdf: pdf-am\n+\n+pdf-am:\n+\n+ps: ps-am\n+\n+ps-am:\n+\n+uninstall-am:\n+\n+.MAKE: install-am install-strip\n+\n+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \\\n+\tclean-libtool clean-noinstLTLIBRARIES ctags distclean \\\n+\tdistclean-compile distclean-generic distclean-libtool \\\n+\tdistclean-tags distdir dvi dvi-am html html-am info info-am \\\n+\tinstall install-am install-data install-data-am install-dvi \\\n+\tinstall-dvi-am install-exec install-exec-am install-html \\\n+\tinstall-html-am install-info install-info-am install-man \\\n+\tinstall-pdf install-pdf-am install-ps install-ps-am \\\n+\tinstall-strip installcheck installcheck-am installdirs \\\n+\tmaintainer-clean maintainer-clean-generic mostlyclean \\\n+\tmostlyclean-compile mostlyclean-generic mostlyclean-libtool \\\n+\tpdf pdf-am ps ps-am tags uninstall uninstall-am\n+\n+\n+# Tell versions [3.59,3.63) of GNU make to not export all variables.\n+# Otherwise a system limit (for SysV at least) may be exceeded.\n+.NOEXPORT:\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/main.cpp Thu Jul 21 13:35:08 2011 -0400 |
[ |
b'@@ -0,0 +1,477 @@\n+/*********************************************************************\n+ * Clustal Omage - Multiple sequence alignment\n+ *\n+ * Copyright (C) 2010 University College Dublin\n+ *\n+ * Clustal-Omega is free software; you can redistribute it and/or\n+ * modify it under the terms of the GNU General Public License as\n+ * published by the Free Software Foundation; either version 2 of the\n+ * License, or (at your option) any later version.\n+ *\n+ * This file is part of Clustal-Omega.\n+ *\n+ ********************************************************************/\n+\n+/*\n+ * RCS $Id: main.cpp 234 2011-04-13 05:26:16Z andreas $\n+ */\n+\n+/*\n+ * We are using a mix of C and C++, which means that linking has to be\n+ * done with a C++ compiler. By using this "fake" main c++ function,\n+ * automake is convinced to use a C++ compiler for linking.\n+ *\n+ */\n+\n+#ifdef HAVE_CONFIG_H\n+ #include "config.h"\n+#endif\n+\n+#include <stdio.h>\n+#include <stdlib.h>\n+#include <string.h>\n+\n+extern "C" {\n+#include "mymain.h"\n+#include "clustal/util.h"\n+#include "squid/squid.h"\n+}\n+\n+\n+/**\n+ * @brief Convert an old Clustal command line parameter in the form of\n+ * [-/]param[=value] to new parameter if possible\n+ *\n+ * @param[out] iNewArgC_p\n+ * "argc" which will be incremented for each successfully converted option\n+ * @param[out] ppcNewArgV_p\n+ * "argv" to which each successfully converted options will be added\n+ * (caller has to free)\n+ * @param[in] pcOldArg\n+ * The old parameter and value command line option\n+ *\n+ */\n+void\n+ConvertOldCmdLineArg(int *iNewArgC_p, char ***ppcNewArgV_p, char *pcOldArg)\n+{\n+ char *pcOldParam, *pcOldValue, *pcOldArgCopy;\n+ char zcNotImplementedMsg[] = "WARNING: Invalid old command line option";\n+ \n+ pcOldArgCopy = CkStrdup(pcOldArg); \n+ pcOldParam = strtok(pcOldArgCopy, "=");\n+ pcOldValue = strtok(NULL, "=");\n+\n+\n+ /* go through all options in order of appearance in clustalw2 -help\n+ *\n+ */\n+ \n+ /* data\n+ *\n+ */\n+ if (STR_NC_EQ("INFILE", &pcOldParam[1])) {\n+ (*ppcNewArgV_p)[(*iNewArgC_p)++] = CkStrdup("-i");\n+ if (NULL != pcOldValue)\n+ (*ppcNewArgV_p)[(*iNewArgC_p)++] = CkStrdup(pcOldValue);\n+\n+ } else if (STR_NC_EQ("PROFILE1", &pcOldParam[1])) {\n+ (*ppcNewArgV_p)[(*iNewArgC_p)++] = CkStrdup("--profile1");\n+ if (NULL != pcOldValue)\n+ (*ppcNewArgV_p)[(*iNewArgC_p)++] = CkStrdup(pcOldValue);\n+\n+ } else if (STR_NC_EQ("PROFILE2", &pcOldParam[1])) {\n+ (*ppcNewArgV_p)[(*iNewArgC_p)++] = CkStrdup("--profile2");\n+ if (NULL != pcOldValue)\n+ (*ppcNewArgV_p)[(*iNewArgC_p)++] = CkStrdup(pcOldValue);\n+\n+ /* verbs\n+ *\n+ */\n+\n+ /* missing:\n+ * OPTIONS\n+ */\n+ \n+ } else if (STR_NC_EQ("HELP", &pcOldParam[1])\n+ || STR_NC_EQ("CHECK", &pcOldParam[1])) {\n+ (*ppcNewArgV_p)[(*iNewArgC_p)++] = CkStrdup("-h");\n+ \n+ } else if (STR_NC_EQ("FULLHELP", &pcOldParam[1])) {\n+ (*ppcNewArgV_p)[(*iNewArgC_p)++] = CkStrdup("-h");\n+ \n+ } else if (STR_NC_EQ("ALIGN", &pcOldParam[1])) {\n+ char msg[] = "WARNING: The ALIGN option is default in Clustal Omega";\n+ fprintf(stderr, "%s\\n", msg);\n+\n+ /* missing:\n+ * TREE\n+ * PIM\n+ * BOOTSTRAP\n+ * CONVERT\n+ */\n+ \n+ /* parameters\n+ *\n+ */\n+ } else if (STR_NC_EQ("INTERACTIVE", &pcOldParam[1])) {\n+ char msg[] = "WARNING: There is no interactive command-line menu in Clustal Omega";\n+ fprintf(stderr, "%s\\n", msg);\n+ /* trigger help */\n+ (*ppcNewArgV_p)[(*iNewArgC_p)++] = CkStrdup("-h");\n+ \n+ } else if (STR_NC_EQ("QUICKTREE", &pcOldParam[1])) {\n+ char msg[] = "WARNING: The QUICKTREE (i.e. k-tuple distance) option is default in Clustal Omega";\n+ fprintf(stderr, "%s\\n", msg);\n+ \n+ } else if (STR_NC_EQ("TYPE", &pcOldParam[1])) {\n+ '..b'+ (*ppcNewArgV_p)[(*iNewArgC_p)++] = CkStrdup(argv[i]);\n+ } else {\n+ ConvertOldCmdLineArg(iNewArgC_p, ppcNewArgV_p, argv[i]);\n+ /*LOG_DEBUG("old command line arg: %s", argv[i]);*/\n+ bOldCmdlineDetected = true;\n+ }\n+ }\n+ \n+ if (bOldCmdlineDetected) {\n+ bool bOutfileOptSet = FALSE;\n+ bool bOutFormatOptSet = FALSE;\n+ \n+ \n+ /* old clustal used to write to a file called in.aln by\n+ * default. set if not\n+ * explicitely requested otherwisee\n+ */\n+ for (i=0; i<*iNewArgC_p; i++) {\n+ const char *pcOpt = "-o";\n+ if (strlen(pcOpt) <= strlen((*ppcNewArgV_p)[i])) {\n+ if (0 == strncmp((*ppcNewArgV_p)[i], pcOpt, strlen(pcOpt))) {\n+ bOutfileOptSet = TRUE;\n+ break;\n+ }\n+ }\n+ }\n+ if (FALSE == bOutfileOptSet) {\n+#ifdef TOO_LAZY_TO_IMPLEMENT_JUST_USING_DEFAULT_NAME_INSTEAD\n+ char *pcDotPos = NULL;\n+ char *pcInfileOpt = NULL;\n+\n+ /* get infile arg and find last dot in it. if found replace\n+ * everything after with "aln", otherwise just add "aln"\n+ */\n+ for (i=0; i<*iNewArgC_p; i++) {\n+ const char *pcOpt = "-i";\n+ if (strlen(pcOpt) <= strlen((*ppcNewArgV_p)[i])) {\n+ if (0 == strncmp((*ppcNewArgV_p)[i], pcOpt, strlen(pcOpt))) {\n+ if (*iNewArgC_p<= i+1) {\n+ fprintf(stderr,\n+ "Oups...error while trying to convert old commandline (%s).\\n",\n+ "No more arguments left after -i");\n+ exit(1);\n+ }\n+ pcInfileOpt = (*ppcNewArgV_p)[i+1];\n+ break;\n+ }\n+ }\n+ }\n+ if (NULL == pcInfileOpt) {\n+ fprintf(stderr,\n+ "Oups...error while trying to convert old commandline (%s)\\n",\n+ "No infile opt found");\n+ exit(1);\n+ }\n+\n+ fprintf(stderr, "FIXME: unfinished\\n");\n+ exit(1);\n+#endif\n+ (*ppcNewArgV_p)[(*iNewArgC_p)++] = CkStrdup("-o");\n+ (*ppcNewArgV_p)[(*iNewArgC_p)++] = CkStrdup("clustal.aln");\n+ }\n+\n+ \n+ /* old clustal used the clustal format by default. set if not\n+ * explicitely requested otherwisee\n+ */\n+ for (i=0; i<*iNewArgC_p; i++) {\n+ const char *pcOpt = "--outfmt";\n+ if (strlen(pcOpt) <= strlen((*ppcNewArgV_p)[i])) {\n+ if (0 == strncmp((*ppcNewArgV_p)[i], pcOpt, strlen(pcOpt))) {\n+ bOutFormatOptSet = TRUE;\n+ break;\n+ }\n+ }\n+ }\n+ if (FALSE == bOutFormatOptSet) {\n+ (*ppcNewArgV_p)[(*iNewArgC_p)++] = CkStrdup("--outfmt=clustal");\n+ }\n+\n+ \n+ /* old clustal was verbose by default\n+ */\n+ (*ppcNewArgV_p)[(*iNewArgC_p)++] = CkStrdup("-v");\n+ \n+ /* old clustal used to overwrite files by default\n+ */\n+ (*ppcNewArgV_p)[(*iNewArgC_p)++] = CkStrdup("--force");\n+ \n+ fprintf(stderr,\n+ "WARNING: Your old-style command-line options were converted to: ");\n+ for (i=0; i<*iNewArgC_p; i++) {\n+ fprintf(stderr, " %s", (*ppcNewArgV_p)[i]);\n+ }\n+ fprintf(stderr, "\\n");\n+ }\n+\n+}\n+/* end ConvertOldCmdline */\n+\n+\n+\n+int\n+main(int argc, char **argv)\n+{\n+ int new_argc = 0;\n+ char **new_argv = NULL;\n+ int i; /* aux */\n+ \n+ ConvertOldCmdline(&new_argc, &new_argv, argc, argv);\n+ \n+ MyMain(new_argc, new_argv);\n+ \n+ for (i=0; i<new_argc; i++) {\n+ free(new_argv[i]);\n+ }\n+ free(new_argv);\n+ \n+ return 0;\n+}\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/mymain.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/mymain.c Thu Jul 21 13:35:08 2011 -0400 |
[ |
b'@@ -0,0 +1,1019 @@\n+/* -*- mode: c; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n+\n+/*********************************************************************\n+ * Clustal Omega - Multiple sequence alignment\n+ *\n+ * Copyright (C) 2010 University College Dublin\n+ *\n+ * Clustal-Omega is free software; you can redistribute it and/or\n+ * modify it under the terms of the GNU General Public License as\n+ * published by the Free Software Foundation; either version 2 of the\n+ * License, or (at your option) any later version.\n+ *\n+ * This file is part of Clustal-Omega.\n+ *\n+ ********************************************************************/\n+\n+/*\n+ * RCS $Id: mymain.c 255 2011-06-22 15:59:07Z fabian $\n+ */\n+\n+#ifdef HAVE_CONFIG_H\n+#include "config.h"\n+#endif\n+\n+#include <stdio.h>\n+#include <string.h>\n+#include <assert.h>\n+#include <unistd.h>\n+#include <argtable2.h>\n+#include <ctype.h>\n+#include <limits.h>\n+#include <libgen.h> /* for basename only */\n+\n+/* clustal */\n+#include "clustal-omega.h"\n+\n+#include "mymain.h"\n+\n+/* hhalign (parameters) */\n+#include "hhalign/general.h"\n+\n+typedef struct {\n+\n+ /* Sequence input\n+ */\n+ /** sequence type (from cmdline arg) */\n+ int iSeqType;\n+ /** sequence input file. not directly used by Align() */\n+ char *pcSeqInfile;\n+ /** Dealign sequences on input. Otherwise we use the alignment\n+ * info for background-HMM creation */\n+ bool bDealignInputSeqs;\n+\n+ /* profiles: : pre-aligned sequences, whose alignment will not be changed \n+ */\n+ /** profile 1: pre-aligned sequence input. not directly used by Align() */\n+ char *pcProfile1Infile ;\n+ /** profile 2: pre-aligned sequence input. not directly used by Align() */\n+ char *pcProfile2Infile; \n+ \n+ /** Input limitations\n+ */\n+ /** maximum allowed number of input sequences */\n+ int iMaxNumSeq;\n+ /** maximum allowed input sequence length */\n+ int iMaxSeqLen;\n+\n+ /* Alignment output\n+ */\n+ /** alignment output file */\n+ char *pcAlnOutfile;\n+ /** alignment output format */\n+ int iAlnOutFormat;\n+ /** force overwriting of files */\n+ bool bForceFileOverwrite;\n+\n+ /* multithreading\n+ */\n+ /** number of threads */\n+ int iThreads;\n+\n+ /* logging \n+ */\n+ char *pcLogFile;\n+\n+ opts_t aln_opts;\n+\n+ /* changes here will have to be reflected in SetDefaultUserOpts(),\n+ * FreeUserOpts(), PrintUserOpts() and UserOptsLogicCheck() etc\n+ */\n+} cmdline_opts_t;\n+\n+\n+\n+/* log-file used for non-essential logging in prLog */\n+FILE *prLogFile = NULL;\n+\n+\n+\n+/**\n+ * @brief Sets default user/commandline options\n+ *\n+ * @param[out] opts\n+ * The option structure to initialise\n+ *\n+ */\n+void\n+SetDefaultUserOpts(cmdline_opts_t *opts)\n+{\n+\n+ assert(NULL != opts);\n+\n+ opts->iSeqType = SEQTYPE_UNKNOWN;\n+ opts->pcSeqInfile = NULL;\n+ opts->bDealignInputSeqs = FALSE; \n+ opts->pcProfile1Infile = NULL;\n+ opts->pcProfile2Infile = NULL;\n+\t\n+ opts->iMaxNumSeq = INT_MAX;\n+ opts->iMaxSeqLen = INT_MAX;\n+ \n+ opts->pcAlnOutfile = NULL;\n+ opts->iAlnOutFormat = MSAFILE_A2M;\n+ opts->bForceFileOverwrite = FALSE;\n+\n+#ifdef HAVE_OPENMP\n+ /* defaults to # of CPUs */\n+ opts->iThreads = omp_get_max_threads();\n+#else\n+ opts->iThreads = 1;\n+#endif\n+ \n+ opts->pcLogFile = NULL;\n+\n+ SetDefaultAlnOpts(& opts->aln_opts);\n+}\n+/* end of SetDefaultAlnOpts() */\n+\n+\n+\n+\n+/**\n+ * @brief FIXME add doc\n+ *\n+ */\n+void\n+PrintUserOpts(FILE *prFile, cmdline_opts_t *opts) {\n+ \n+ /* keep in same order as in struct. FIXME could this be derived from argtable?\n+ */\n+ /* we only allow protein anyway: fprintf(prFile, "seq-type = %s\\n", SeqTypeToStr(opts->iSeqType)); */\n+ fprintf(prFile, "option: seq-in = %s\\n", \n+ NULL != opts->pcSeqInfile? opts->pcSeqInfile: "(null)");\n+ fprintf(prFile, "option: dealign = %d\\n", opts->bDealignInputSeqs);\n+ fprintf(prFile, "option: profile1 = %s\\n", \n+ '..b'.pcProfile1Infile) {\n+ NewMSeq(&prMSeqProfile1);\n+ if (ReadSequences(prMSeqProfile1, cmdline_opts.pcProfile1Infile,\n+ cmdline_opts.iSeqType,\n+ cmdline_opts.iMaxNumSeq, cmdline_opts.iMaxSeqLen)) {\n+ Log(&rLog, LOG_FATAL, "Reading sequences from profile file \'%s\' failed",\n+ cmdline_opts.pcProfile1Infile);\n+ }\n+ /* FIXME: commented out. FS, r240 -> r241 \n+ * for explanation see below */\n+ /*if (1==prMSeqProfile1->nseqs) {\n+ Log(&rLog, LOG_FATAL, "\'%s\' contains only one sequence and can therefore not be used as a profile",\n+ cmdline_opts.pcProfile1Infile);\n+ }*/\n+ if (FALSE == prMSeqProfile1->aligned) {\n+ Log(&rLog, LOG_FATAL, "Sequences in \'%s\' are not aligned, i.e. this is not a profile",\n+ cmdline_opts.pcProfile1Infile);\n+ }\n+ }\n+\n+ \n+\n+ /* Read profile2\n+ *\n+ */\n+ if (NULL != cmdline_opts.pcProfile2Infile) {\n+ NewMSeq(&prMSeqProfile2);\n+ if (ReadSequences(prMSeqProfile2, cmdline_opts.pcProfile2Infile,\n+ cmdline_opts.iSeqType,\n+ cmdline_opts.iMaxNumSeq, cmdline_opts.iMaxSeqLen)) {\n+ Log(&rLog, LOG_FATAL, "Reading sequences from profile file \'%s\' failed",\n+ cmdline_opts.pcProfile2Infile);\n+ }\n+ /* FIXME: there is no (clean) way to align a single sequence to a profile. \n+ * if we go down the -i route, it causes a seg-fault in the pair-wise \n+ * k-tuple distance calculation. However, single sequences can be \n+ * understood as 1-profiles. Therefore we have to allow for 1-profiles.\n+ * FS, r240 -> r241 \n+ */\n+ /*if (1==prMSeqProfile2->nseqs) {\n+ Log(&rLog, LOG_FATAL, "\'%s\' contains only one sequence and can therefore not be used as a profile",\n+ cmdline_opts.pcProfile2Infile);\n+ }*/\n+ if (FALSE == prMSeqProfile1->aligned) {\n+ Log(&rLog, LOG_FATAL, "Sequences in \'%s\' are not aligned, i.e. this is not a profile",\n+ cmdline_opts.pcProfile2Infile);\n+ }\n+ }\n+\n+\n+ /* Depending on the input we got perform\n+ *\n+ * (i) normal alignment: seq + optional profile\n+ * or\n+ * (ii) profile profile alignment\n+ *\n+ */\n+ if (NULL != prMSeq) {\n+ if (Align(prMSeq, prMSeqProfile1, & cmdline_opts.aln_opts, rHhalignPara)) {\n+ Log(&rLog, LOG_FATAL, "An error occured during the alignment");\n+ }\n+\n+ if (WriteAlignment(prMSeq, cmdline_opts.pcAlnOutfile, \n+ cmdline_opts.iAlnOutFormat)) {\n+ Log(&rLog, LOG_FATAL, "Could not save alignment to %s", cmdline_opts.pcAlnOutfile);\n+ }\n+#if 0\n+ {\n+ bool bSampling = FALSE; /* better set to TRUE for many sequences */\n+ bool bReportAll = TRUE;\n+ AliStat(prMSeq, bSampling, bReportAll);\n+ }\n+#endif\n+ \n+\n+ } else if (NULL != prMSeqProfile1 && NULL != prMSeqProfile2) {\n+ if (AlignProfiles(prMSeqProfile1, prMSeqProfile2, rHhalignPara)) {\n+ Log(&rLog, LOG_FATAL, "An error occured during the alignment");\n+ }\n+ if (WriteAlignment(prMSeqProfile1, cmdline_opts.pcAlnOutfile, \n+ cmdline_opts.iAlnOutFormat)) {\n+ Log(&rLog, LOG_FATAL, "Could not save alignment to %s", cmdline_opts.pcAlnOutfile);\n+ }\n+ }\n+\n+\n+ /* cleanup\n+ */\n+ if (NULL != prMSeq) {\n+ FreeMSeq(&prMSeq);\n+ }\n+ if (NULL != prMSeqProfile1) {\n+ FreeMSeq(&prMSeqProfile1);\n+ }\n+ if (NULL != prMSeqProfile2) {\n+ FreeMSeq(&prMSeqProfile2);\n+ }\n+\n+ FreeUserOpts(&cmdline_opts);\n+\n+ Log(&rLog, LOG_DEBUG, "Successful program exit");\n+\n+ if (NULL != cmdline_opts.pcLogFile) {\n+ fclose(prLogFile);\n+ }\n+ return EXIT_SUCCESS;\n+}\n+/* end of MyMain() */\n+\n+\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/mymain.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/mymain.h Thu Jul 21 13:35:08 2011 -0400 |
b |
@@ -0,0 +1,23 @@ +/********************************************************************* + * Clustal Omega - Multiple sequence alignment + * + * Copyright (C) 2010 University College Dublin + * + * Clustal-Omega is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This file is part of Clustal-Omega. + * + ********************************************************************/ + +/* + * RCS $Id: mymain.h 97 2010-07-12 15:30:26Z andreas $ + */ + + +extern int +MyMain(int argc, char **argv); + + |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/squid/00README --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/squid/00README Thu Jul 21 13:35:08 2011 -0400 |
b |
@@ -0,0 +1,39 @@ +SQUID - library of functions for biological sequence analysis +Copyright (C) 1992-2002 Washington University School of Medicine + +SQUID is a freely redistributable library of C code functions for +sequence analysis. SQUID also includes a number of small utility +programs. + +To install squid, see the file: + INSTALL -- instructions for installing the programs + +If you have any questions about redistributing squid or using +squid code in your own work, see the files: + COPYRIGHT -- copyright notice, and information on my distribution policy + LICENSE -- version 2 of the GNU Public License (see COPYRIGHT) + +For a web page with more information on squid, see: + http://www.genetics.wustl.edu/eddy/software/#squid + +You can always download the latest stable release of squid from: + ftp://ftp.genetics.wustl.edu/pub/eddy/software/squid.tar.gz + +The development codebase is available by anonymous CVS: + cvs -d :pserver:anonymous@skynet.wustl.edu:/repository/sre login + (password "anonymous") + cvs -d :pserver:anonymous@skynet.wustl.edu:/repository/sre checkout squid + +If you encounter any bugs in this library, or you have any questions +or comments, please e-mail me at the address below. Due to limited +personal time, I may not respond, but I do read all my mail. + + Sean Eddy + eddy@genetics.wustl.edu + + HHMI/Dept. of Genetics + Washington University School of Medicine + 660 South Euclid Box 8232 + Saint Louis Missouri 63110 + USA + |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/squid/COPYRIGHT --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/squid/COPYRIGHT Thu Jul 21 13:35:08 2011 -0400 |
b |
@@ -0,0 +1,41 @@ +SQUID - a library of functions for biological sequence analysis +Copyright (C) 1992-2002 Washington University School of Medicine +All Rights Reserved + +This suite of programs is free software. You can redistribute it +and/or modify it under the terms of the GNU General Public License as +published by the Free Software Foundation; either version 2 of the +License, or (at your option) any later version. + +In other words, you are free to modify, copy, or redistribute this +source code and its documentation in any way you like, but you must +distribute all derivative versions as free software under the same +terms that I've provided my code to you (i.e. the GNU General Public +License). This precludes any use of the code in proprietary or +commercial software unless your source code is made freely available. + +If you wish to use SQUID code under a different Open Source license +that's not compatible with the GPL (like the Artistic License, BSD +license, or the Netscape Public License), please contact me +(eddy@genetics.wustl.edu) for permission. + +Incorporation into commercial software under non-GPL terms is +possible, by arranging a license with the Washington University School +of Medicine Center for Technology Management (CTM). For this purpose, +the CTM is authorized to negotiate on behalf of the Howard Hughes +Medical Institute, the other copyright holder on the code. Certain +third party code modules may have to be removed from a non-GPL +distribution. Contact Jack Pincus (jhpincus@cris.com) to arrange +non-GPL licensing terms. + +This software is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this HMMER release, in the file LICENSE; if not, write to +the Free Software Foundation, Inc., 675 Mass. Ave, Cambridge, MA 02139 +USA. + + |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/squid/LICENSE --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/squid/LICENSE Thu Jul 21 13:35:08 2011 -0400 |
b |
b'@@ -0,0 +1,339 @@\n+\t\t GNU GENERAL PUBLIC LICENSE\n+\t\t Version 2, June 1991\n+\n+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.\n+ 675 Mass Ave, Cambridge, MA 02139, USA\n+ Everyone is permitted to copy and distribute verbatim copies\n+ of this license document, but changing it is not allowed.\n+\n+\t\t\t Preamble\n+\n+ The licenses for most software are designed to take away your\n+freedom to share and change it. By contrast, the GNU General Public\n+License is intended to guarantee your freedom to share and change free\n+software--to make sure the software is free for all its users. This\n+General Public License applies to most of the Free Software\n+Foundation\'s software and to any other program whose authors commit to\n+using it. (Some other Free Software Foundation software is covered by\n+the GNU Library General Public License instead.) You can apply it to\n+your programs, too.\n+\n+ When we speak of free software, we are referring to freedom, not\n+price. Our General Public Licenses are designed to make sure that you\n+have the freedom to distribute copies of free software (and charge for\n+this service if you wish), that you receive source code or can get it\n+if you want it, that you can change the software or use pieces of it\n+in new free programs; and that you know you can do these things.\n+\n+ To protect your rights, we need to make restrictions that forbid\n+anyone to deny you these rights or to ask you to surrender the rights.\n+These restrictions translate to certain responsibilities for you if you\n+distribute copies of the software, or if you modify it.\n+\n+ For example, if you distribute copies of such a program, whether\n+gratis or for a fee, you must give the recipients all the rights that\n+you have. You must make sure that they, too, receive or can get the\n+source code. And you must show them these terms so they know their\n+rights.\n+\n+ We protect your rights with two steps: (1) copyright the software, and\n+(2) offer you this license which gives you legal permission to copy,\n+distribute and/or modify the software.\n+\n+ Also, for each author\'s protection and ours, we want to make certain\n+that everyone understands that there is no warranty for this free\n+software. If the software is modified by someone else and passed on, we\n+want its recipients to know that what they have is not the original, so\n+that any problems introduced by others will not reflect on the original\n+authors\' reputations.\n+\n+ Finally, any free program is threatened constantly by software\n+patents. We wish to avoid the danger that redistributors of a free\n+program will individually obtain patent licenses, in effect making the\n+program proprietary. To prevent this, we have made it clear that any\n+patent must be licensed for everyone\'s free use or not licensed at all.\n+\n+ The precise terms and conditions for copying, distribution and\n+modification follow.\n+\x0c\n+\t\t GNU GENERAL PUBLIC LICENSE\n+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\n+\n+ 0. This License applies to any program or other work which contains\n+a notice placed by the copyright holder saying it may be distributed\n+under the terms of this General Public License. The "Program", below,\n+refers to any such program or work, and a "work based on the Program"\n+means either the Program or any derivative work under copyright law:\n+that is to say, a work containing the Program or a portion of it,\n+either verbatim or with modifications and/or translated into another\n+language. (Hereinafter, translation is included without limitation in\n+the term "modification".) Each licensee is addressed as "you".\n+\n+Activities other than copying, distribution and modification are not\n+covered by this License; they are outside its scope. The act of\n+running the Program is not restricted, and the output from the Program\n+is covered only if its contents constitute a work based on the\n+Program (independent of having been made by running the Program).\n+'..b'IGHT HOLDERS AND/OR OTHER PARTIES\n+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED\n+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS\n+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE\n+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,\n+REPAIR OR CORRECTION.\n+\n+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\n+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR\n+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,\n+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING\n+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED\n+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY\n+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER\n+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE\n+POSSIBILITY OF SUCH DAMAGES.\n+\n+\t\t END OF TERMS AND CONDITIONS\n+\x0c\n+\tAppendix: How to Apply These Terms to Your New Programs\n+\n+ If you develop a new program, and you want it to be of the greatest\n+possible use to the public, the best way to achieve this is to make it\n+free software which everyone can redistribute and change under these terms.\n+\n+ To do so, attach the following notices to the program. It is safest\n+to attach them to the start of each source file to most effectively\n+convey the exclusion of warranty; and each file should have at least\n+the "copyright" line and a pointer to where the full notice is found.\n+\n+ <one line to give the program\'s name and a brief idea of what it does.>\n+ Copyright (C) 19yy <name of author>\n+\n+ This program is free software; you can redistribute it and/or modify\n+ it under the terms of the GNU General Public License as published by\n+ the Free Software Foundation; either version 2 of the License, or\n+ (at your option) any later version.\n+\n+ This program is distributed in the hope that it will be useful,\n+ but WITHOUT ANY WARRANTY; without even the implied warranty of\n+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n+ GNU General Public License for more details.\n+\n+ You should have received a copy of the GNU General Public License\n+ along with this program; if not, write to the Free Software\n+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\n+\n+Also add information on how to contact you by electronic and paper mail.\n+\n+If the program is interactive, make it output a short notice like this\n+when it starts in an interactive mode:\n+\n+ Gnomovision version 69, Copyright (C) 19yy name of author\n+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w\'.\n+ This is free software, and you are welcome to redistribute it\n+ under certain conditions; type `show c\' for details.\n+\n+The hypothetical commands `show w\' and `show c\' should show the appropriate\n+parts of the General Public License. Of course, the commands you use may\n+be called something other than `show w\' and `show c\'; they could even be\n+mouse-clicks or menu items--whatever suits your program.\n+\n+You should also get your employer (if you work as a programmer) or your\n+school, if any, to sign a "copyright disclaimer" for the program, if\n+necessary. Here is a sample; alter the names:\n+\n+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program\n+ `Gnomovision\' (which makes passes at compilers) written by James Hacker.\n+\n+ <signature of Ty Coon>, 1 April 1989\n+ Ty Coon, President of Vice\n+\n+This General Public License does not permit incorporating your program into\n+proprietary programs. If your program is a subroutine library, you may\n+consider it more useful to permit linking proprietary applications with the\n+library. If this is what you want to do, use the GNU Library General\n+Public License instead of this License.\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/squid/Makefile.am --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/squid/Makefile.am Thu Jul 21 13:35:08 2011 -0400 |
b |
@@ -0,0 +1,43 @@ +# Replaces squids own automake files +# +# Some useful automake documentation: +# http://www.openismus.com/documents/linux/automake/automake.shtml +# http://www.bioinf.uni-freiburg.de/~mmann/HowTo/automake.html + +#SUBDIRS = +EXTRA_DIST = COPYRIGHT LICENSE 00README clustalo.README squid-1.9g.tar.gz +#LDADD = + +# need DCLUSTALO here to enable Clustal specific squid patches +# CLUSTALO is also defined in ../config.h which is included by squid.h +# but some files do not include squid.h +AM_CFLAGS = -DCLUSTALO -DSRE_STRICT_ANSI @AM_CFLAGS@ + +noinst_LTLIBRARIES = libsquid.la + +libsquid_la_SOURCES = a2m.c aligneval.c alignio.c \ + clustal.c cluster.c \ + dayhoff.c \ + eps.c \ + file.c \ + getopt.c gki.c gki.h gsi.c gsi.h gsi64.c gsi64.h \ + hsregex.c \ + iupac.c \ + msa.c msa.h msf.c \ + phylip.c \ + revcomp.c rk.c rk.h \ + selex.c seqencode.c shuffle.c sqerror.c sqfuncs.h sqio.c squid.h squidcore.c \ + sre_ctype.c sre_math.c sre_random.c sre_random.h sre_string.c \ + ssi.c ssi.h stack.c stockholm.c stockholm.h stopwatch.c stopwatch.h \ + translate.c types.c vectorops.c \ + vectorops.h version.h \ + weight.c + +library_includedir=$(includedir)/clustalo/squid + +library_include_HEADERS = gki.h gsi64.h msa.h rk.h \ + squid.h stopwatch.h sqfuncs.h \ + sre_random.h ssi.h stockholm.h \ + vectorops.h version.h + + |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/squid/Makefile.in --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/squid/Makefile.in Thu Jul 21 13:35:08 2011 -0400 |
[ |
b'@@ -0,0 +1,606 @@\n+# Makefile.in generated by automake 1.11.1 from Makefile.am.\n+# @configure_input@\n+\n+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,\n+# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,\n+# Inc.\n+# This Makefile.in is free software; the Free Software Foundation\n+# gives unlimited permission to copy and/or distribute it,\n+# with or without modifications, as long as this notice is preserved.\n+\n+# This program is distributed in the hope that it will be useful,\n+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without\n+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A\n+# PARTICULAR PURPOSE.\n+\n+@SET_MAKE@\n+\n+# Replaces squids own automake files\n+#\n+# Some useful automake documentation:\n+# http://www.openismus.com/documents/linux/automake/automake.shtml\n+# http://www.bioinf.uni-freiburg.de/~mmann/HowTo/automake.html\n+\n+\n+VPATH = @srcdir@\n+pkgdatadir = $(datadir)/@PACKAGE@\n+pkgincludedir = $(includedir)/@PACKAGE@\n+pkglibdir = $(libdir)/@PACKAGE@\n+pkglibexecdir = $(libexecdir)/@PACKAGE@\n+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd\n+install_sh_DATA = $(install_sh) -c -m 644\n+install_sh_PROGRAM = $(install_sh) -c\n+install_sh_SCRIPT = $(install_sh) -c\n+INSTALL_HEADER = $(INSTALL_DATA)\n+transform = $(program_transform_name)\n+NORMAL_INSTALL = :\n+PRE_INSTALL = :\n+POST_INSTALL = :\n+NORMAL_UNINSTALL = :\n+PRE_UNINSTALL = :\n+POST_UNINSTALL = :\n+build_triplet = @build@\n+host_triplet = @host@\n+subdir = src/squid\n+DIST_COMMON = $(library_include_HEADERS) $(srcdir)/Makefile.am \\\n+\t$(srcdir)/Makefile.in\n+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4\n+am__aclocal_m4_deps = $(top_srcdir)/m4/ax_prefix_config_h.m4 \\\n+\t$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \\\n+\t$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \\\n+\t$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/ax_openmp.m4 \\\n+\t$(top_srcdir)/configure.ac\n+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \\\n+\t$(ACLOCAL_M4)\n+mkinstalldirs = $(install_sh) -d\n+CONFIG_HEADER = $(top_builddir)/src/config.h\n+CONFIG_CLEAN_FILES =\n+CONFIG_CLEAN_VPATH_FILES =\n+LTLIBRARIES = $(noinst_LTLIBRARIES)\n+libsquid_la_LIBADD =\n+am_libsquid_la_OBJECTS = a2m.lo aligneval.lo alignio.lo clustal.lo \\\n+\tcluster.lo dayhoff.lo eps.lo file.lo getopt.lo gki.lo gsi.lo \\\n+\tgsi64.lo hsregex.lo iupac.lo msa.lo msf.lo phylip.lo \\\n+\trevcomp.lo rk.lo selex.lo seqencode.lo shuffle.lo sqerror.lo \\\n+\tsqio.lo squidcore.lo sre_ctype.lo sre_math.lo sre_random.lo \\\n+\tsre_string.lo ssi.lo stack.lo stockholm.lo stopwatch.lo \\\n+\ttranslate.lo types.lo vectorops.lo weight.lo\n+libsquid_la_OBJECTS = $(am_libsquid_la_OBJECTS)\n+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src\n+depcomp = $(SHELL) $(top_srcdir)/depcomp\n+am__depfiles_maybe = depfiles\n+am__mv = mv -f\n+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \\\n+\t$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)\n+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \\\n+\t--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \\\n+\t$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)\n+CCLD = $(CC)\n+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \\\n+\t--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \\\n+\t$(LDFLAGS) -o $@\n+SOURCES = $(libsquid_la_SOURCES)\n+DIST_SOURCES = $(libsquid_la_SOURCES)\n+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed \'s|.|.|g\'`;\n+am__vpath_adj = case $$p in \\\n+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \\\n+ *) f=$$p;; \\\n+ esac;\n+am__strip_dir = f=`echo $$p | sed -e \'s|^.*/||\'`;\n+am__install_max = 40\n+am__nobase_strip_setup = \\\n+ srcdirstrip=`echo "$(srcdir)" | sed \'s/[].[^$$\\\\*|]/\\\\\\\\&/g\'`\n+am__nobase_strip = \\\n+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"\n+am__nobase_list = $(am__nobase_strip_setup); \\\n+ for p in $$list; do echo "$$p $$p"; done | \\\n+ sed "s| $$srcdirstrip/| |;"\' / .*\\//!s/ .*/ ./; s,\\( .*\\)/[^/]*$$,\\1,\' | \\\n+ $(AWK) \'BEGIN '..b'lddir)/|;t"`; \\\n+\tcase $$dist_files in \\\n+\t */*) $(MKDIR_P) `echo "$$dist_files" | \\\n+\t\t\t sed \'/\\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,\' | \\\n+\t\t\t sort -u` ;; \\\n+\tesac; \\\n+\tfor file in $$dist_files; do \\\n+\t if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \\\n+\t if test -d $$d/$$file; then \\\n+\t dir=`echo "/$$file" | sed -e \'s,/[^/]*$$,,\'`; \\\n+\t if test -d "$(distdir)/$$file"; then \\\n+\t find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \\;; \\\n+\t fi; \\\n+\t if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \\\n+\t cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \\\n+\t find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \\;; \\\n+\t fi; \\\n+\t cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \\\n+\t else \\\n+\t test -f "$(distdir)/$$file" \\\n+\t || cp -p $$d/$$file "$(distdir)/$$file" \\\n+\t || exit 1; \\\n+\t fi; \\\n+\tdone\n+check-am: all-am\n+check: check-am\n+all-am: Makefile $(LTLIBRARIES) $(HEADERS)\n+installdirs:\n+\tfor dir in "$(DESTDIR)$(library_includedir)"; do \\\n+\t test -z "$$dir" || $(MKDIR_P) "$$dir"; \\\n+\tdone\n+install: install-am\n+install-exec: install-exec-am\n+install-data: install-data-am\n+uninstall: uninstall-am\n+\n+install-am: all-am\n+\t@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am\n+\n+installcheck: installcheck-am\n+install-strip:\n+\t$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \\\n+\t install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \\\n+\t `test -z \'$(STRIP)\' || \\\n+\t echo "INSTALL_PROGRAM_ENV=STRIPPROG=\'$(STRIP)\'"` install\n+mostlyclean-generic:\n+\n+clean-generic:\n+\n+distclean-generic:\n+\t-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)\n+\t-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)\n+\n+maintainer-clean-generic:\n+\t@echo "This command is intended for maintainers to use"\n+\t@echo "it deletes files that may require special tools to rebuild."\n+clean: clean-am\n+\n+clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \\\n+\tmostlyclean-am\n+\n+distclean: distclean-am\n+\t-rm -rf ./$(DEPDIR)\n+\t-rm -f Makefile\n+distclean-am: clean-am distclean-compile distclean-generic \\\n+\tdistclean-tags\n+\n+dvi: dvi-am\n+\n+dvi-am:\n+\n+html: html-am\n+\n+html-am:\n+\n+info: info-am\n+\n+info-am:\n+\n+install-data-am: install-library_includeHEADERS\n+\n+install-dvi: install-dvi-am\n+\n+install-dvi-am:\n+\n+install-exec-am:\n+\n+install-html: install-html-am\n+\n+install-html-am:\n+\n+install-info: install-info-am\n+\n+install-info-am:\n+\n+install-man:\n+\n+install-pdf: install-pdf-am\n+\n+install-pdf-am:\n+\n+install-ps: install-ps-am\n+\n+install-ps-am:\n+\n+installcheck-am:\n+\n+maintainer-clean: maintainer-clean-am\n+\t-rm -rf ./$(DEPDIR)\n+\t-rm -f Makefile\n+maintainer-clean-am: distclean-am maintainer-clean-generic\n+\n+mostlyclean: mostlyclean-am\n+\n+mostlyclean-am: mostlyclean-compile mostlyclean-generic \\\n+\tmostlyclean-libtool\n+\n+pdf: pdf-am\n+\n+pdf-am:\n+\n+ps: ps-am\n+\n+ps-am:\n+\n+uninstall-am: uninstall-library_includeHEADERS\n+\n+.MAKE: install-am install-strip\n+\n+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \\\n+\tclean-libtool clean-noinstLTLIBRARIES ctags distclean \\\n+\tdistclean-compile distclean-generic distclean-libtool \\\n+\tdistclean-tags distdir dvi dvi-am html html-am info info-am \\\n+\tinstall install-am install-data install-data-am install-dvi \\\n+\tinstall-dvi-am install-exec install-exec-am install-html \\\n+\tinstall-html-am install-info install-info-am \\\n+\tinstall-library_includeHEADERS install-man install-pdf \\\n+\tinstall-pdf-am install-ps install-ps-am install-strip \\\n+\tinstallcheck installcheck-am installdirs maintainer-clean \\\n+\tmaintainer-clean-generic mostlyclean mostlyclean-compile \\\n+\tmostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \\\n+\ttags uninstall uninstall-am uninstall-library_includeHEADERS\n+\n+\n+# Tell versions [3.59,3.63) of GNU make to not export all variables.\n+# Otherwise a system limit (for SysV at least) may be exceeded.\n+.NOEXPORT:\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/squid/a2m.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/squid/a2m.c Thu Jul 21 13:35:08 2011 -0400 |
[ |
@@ -0,0 +1,134 @@ +/***************************************************************** + * SQUID - a library of functions for biological sequence analysis + * Copyright (C) 1992-2002 Washington University School of Medicine + * + * This source code is freely distributed under the terms of the + * GNU General Public License. See the files COPYRIGHT and LICENSE + * for details. + *****************************************************************/ + +/* a2m.c + * + * reading/writing A2M (aligned FASTA) files. + * + * RCS $Id: a2m.c 242 2011-05-27 14:04:21Z andreas $ (Original squid RCS Id: a2m.c,v 1.1 1999/07/15 22:26:40 eddy Exp) + */ + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include "squid.h" +#include "msa.h" + +/* Function: ReadA2M() + * Date: SRE, Sun Jun 6 17:11:29 1999 [bus from Madison 1999 worm mtg] + * + * Purpose: Parse an alignment read from an open A2M format + * alignment file. A2M is a single alignment format. + * Return the alignment, or NULL if we've already + * read the alignment. + * + * Args: afp - open alignment file + * + * Returns: MSA * - an alignment object. + * Caller responsible for an MSAFree() + */ +MSA * +ReadA2M(MSAFILE *afp) +{ + MSA *msa; + char *buf; + char *name; + char *desc; + char *seq; + int idx; + int len1, len2; + + if (feof(afp->f)) return NULL; + + name = NULL; + msa = MSAAlloc(10, 0); + idx = 0; + while ((buf = MSAFileGetLine(afp)) != NULL) + { + if (*buf == '>') + { + buf++; /* skip the '>' */ + if ((name = sre_strtok(&buf, WHITESPACE, &len1)) == NULL) + Die("Blank name in A2M file %s (line %d)\n", afp->fname, afp->linenumber); + desc = sre_strtok(&buf, "\n", &len2); + + idx = GKIStoreKey(msa->index, name); + if (idx >= msa->nseqalloc) MSAExpand(msa); + + msa->sqname[idx] = sre_strdup(name, len1); + if (desc != NULL) MSASetSeqDescription(msa, idx, desc); + msa->nseq++; + } + else if (name != NULL) + { + if ((seq = sre_strtok(&buf, WHITESPACE, &len1)) == NULL) continue; + msa->sqlen[idx] = sre_strcat(&(msa->aseq[idx]), msa->sqlen[idx], seq, len1); + } + } + if (name == NULL) { MSAFree(msa); return NULL; } + + MSAVerifyParse(msa); + return msa; +} + + +/* Function: WriteA2M() + * Date: SRE, Sun Jun 6 17:40:35 1999 [bus from Madison, 1999 worm mtg] + * + * Purpose: Write an "aligned FASTA" (aka a2m, to UCSC) formatted + * alignment. + * + * Args: fp - open FILE to write to. + * msa - alignment to write + * + * Returns: void + */ +void +#ifdef CLUSTALO +WriteA2M(FILE *fp, MSA *msa, int vienna) +#else +WriteA2M(FILE *fp, MSA *msa) +#endif +{ + int idx; /* sequence index */ + int pos; /* position in sequence */ + char buf[64]; /* buffer for individual lines */ + int cpl = 60; /* char per line; must be < 64 unless buf is bigger */ + + buf[cpl] = '\0'; + for (idx = 0; idx < msa->nseq; idx++) + { +#ifdef CLUSTALO + /* most fasta sequences don't have a description, which + * leads to a trailing white space in the original code + */ + fprintf(fp, ">%s", msa->sqname[idx]); + + if (msa->sqdesc != NULL && msa->sqdesc[idx] != NULL && !vienna) { + fprintf(fp, " %s", msa->sqdesc[idx]); + } + fprintf(fp, "\n"); +#else + fprintf(fp, ">%s %s\n", + msa->sqname[idx], + (msa->sqdesc != NULL && msa->sqdesc[idx] != NULL) ? msa->sqdesc[idx] : ""); +#endif + for (pos = 0; pos < msa->alen; pos+=cpl) + { + strncpy(buf, &(msa->aseq[idx][pos]), cpl); + if (vienna) + fprintf(fp, "%s", buf); + else + fprintf(fp, "%s\n", buf); + } + if (vienna) + fprintf(fp, "\n"); + + } +} |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/squid/aligneval.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/squid/aligneval.c Thu Jul 21 13:35:08 2011 -0400 |
[ |
b'@@ -0,0 +1,527 @@\n+/*****************************************************************\n+ * SQUID - a library of functions for biological sequence analysis\n+ * Copyright (C) 1992-2002 Washington University School of Medicine\n+ * \n+ * This source code is freely distributed under the terms of the\n+ * GNU General Public License. See the files COPYRIGHT and LICENSE\n+ * for details.\n+ *****************************************************************/\n+\n+/* aligneval.c\n+ * \n+ * Comparison of multiple alignments. Three functions are\n+ * provided, using subtly different scoring schemes:\n+ * CompareMultAlignments() - basic scoring scheme\n+ * CompareRefMultAlignments() - only certain "canonical" columns \n+ * are scored\n+ * \n+ * The similarity measure is a fractional alignment identity averaged\n+ * over all sequence pairs. The score for all pairs is:\n+ * (identically aligned symbols) / (total aligned columns in \n+ * known alignment)\n+ * \n+ * A column c is identically aligned for sequences i, j if:\n+ * 1) both i,j have a symbol aligned in column c, and the\n+ * same pair of symbols is aligned somewhere in the test\n+ * alignment\n+ * 2) S[i][c] is aligned to a gap in sequence j, and that symbol\n+ * is aligned to a gap in the test alignment\n+ * 3) converse of 2)\n+ * \n+ * \n+ * The algorithm is as follows:\n+ * 1) For each known/test aligned pair of sequences (k1,k2 and t1,t2)\n+ * construct a list for each sequence, in which for every\n+ * counted symbol we record the raw index of the symbol in\n+ * the other sequence that it aligns to, or -1 if it aligns\n+ * to a gap or uncounted symbol.\n+ * \n+ * 2) Compare the list for k1 to the list for t1 and count an identity \n+ * for each correct alignment.\n+ * \n+ * 3) Repeat 2) for comparing k2 to t2. Note that this means correct sym/sym\n+ * alignments count for 2; correct sym/gap alignments count for 1.\n+ * \n+ * 4) The score is (identities from 2 + identities from 3) / \n+ * (totals from 2 + totals from 3).\n+ *\n+ * Written originally for koala\'s ss2 pairwise alignment package.\n+ * \n+ * Sean Eddy, Sun Nov 1 12:45:11 1992\n+ * SRE, Thu Jul 29 16:47:18 1993: major revision: all functions replaced by new algorithm\n+ * CVS $Id: aligneval.c,v 1.7 2002/10/09 14:26:09 eddy Exp)\n+ */\n+\n+\n+#include <stdio.h>\n+#include <string.h>\n+#include <ctype.h>\n+#include "squid.h"\n+#include "sre_random.h"\n+\n+static int make_alilist(char *s1, char *s2, int **ret_s1_list, int *ret_listlen);\n+static int make_ref_alilist(int *refcoords, char *k1, char *k2, char *s1, char *s2, \n+\t\t\t int **ret_s1_list, int *ret_listlen);\n+static int compare_lists(int *k1, int *k2, int *t1, int *t2, int len1, int len2, float *ret_sc);\n+\n+\n+/* Function: ComparePairAlignments\n+ * \n+ * Purpose: Calculate and return a number representing how well two different alignments\n+ * of a pair of sequences compare. The number is, roughly speaking,\n+ * the fraction of columns which are identically aligned.\n+ * \n+ * For all columns c in which either known1[c] or known2[c] \n+ * is a non-gap, count an identity if those same symbols are\n+ * aligned somewhere in calc1/calc2. The score is identities/total\n+ * columns examined. (i.e. fully gapped columns don\'t count)\n+ * \n+ * more explicitly, identities come from:\n+ * both known and test aligned pairs have the same symbol in the first sequence aligned to\n+ * a gap in the second sequence;\n+ * both known and test aligned pairs have the same symbol in the second sequence\n+ * aligned to a gap in the first sequence;\n+ * the known alignment has symbols aligned at this column, and the test\n+ * alignment aligns the same two symbols.\n+ * \n+ * Args: known1, known2: trusted al'..b'ctual\n+ * gappy alignments would have high "identities".\n+ * idents/(AVG|MAX)(len1,len2) both have the disadvantage that \n+ * alignments of fragments to longer sequences would have\n+ * artifactually low "identities".\n+ * \n+ * Original Case sensitive; also, watch out in nucleic acid alignments; \n+ * U/T RNA/DNA alignments will be counted as mismatches!\n+ *\n+ * Clustal Omega patch: Case insensitive and T and U are treated the same\n+ */\n+float\n+PairwiseIdentity(char *s1, char *s2)\n+{\n+ int idents;\t\t/* total identical positions */\n+ int len1, len2;\t\t/* lengths of seqs */\n+ int x;\t\t\t/* position in aligned seqs */\n+\n+ idents = len1 = len2 = 0;\n+ for (x = 0; s1[x] != \'\\0\' && s2[x] != \'\\0\'; x++) \n+ {\n+#ifdef CLUSTALO\n+ char c1 = toupper(s1[x]);\n+ char c2 = toupper(s2[x]);\n+ if (c1==\'U\')\n+ c1 = \'T\';\n+ if (c2==\'U\')\n+ c2 = \'T\';\n+ \n+ if (!isgap(c1)) {\n+ len1++;\n+ if (c1 == c2)\n+ idents++;\n+ }\n+ if (!isgap(c2))\n+ len2++; \n+#else \n+ if (!isgap(s1[x])) {\n+\tlen1++;\n+\tif (s1[x] == s2[x]) idents++; \n+ }\n+ if (!isgap(s2[x])) len2++;\n+#endif\n+ }\n+ if (len2 < len1) len1 = len2;\n+ return (len1 == 0 ? 0.0 : (float) idents / (float) len1);\n+}\n+\n+\n+\n+/* Function: AlignmentIdentityBySampling()\n+ * Date: SRE, Mon Oct 19 14:29:01 1998 [St. Louis]\n+ *\n+ * Purpose: Estimate and return the average pairwise\n+ * fractional identity of an alignment,\n+ * using sampling.\n+ * \n+ * For use when there\'s so many sequences that\n+ * an all vs. all rigorous calculation will\n+ * take too long.\n+ * \n+ * Case sensitive!\n+ *\n+ * Args: aseq - aligned sequences\n+ * L - length of alignment\n+ * N - number of seqs in alignment\n+ * nsample - number of samples \n+ *\n+ * Returns: average fractional identity, 0..1.\n+ */\n+float\n+AlignmentIdentityBySampling(char **aseq, int L, int N, int nsample)\n+{\n+ int x, i, j;\t\t\t/* counters */\n+ float sum;\n+\n+ if (N < 2) return 1.0;\n+\n+ sum = 0.;\n+ for (x = 0; x < nsample; x++)\n+ {\n+ i = CHOOSE(N);\n+ do { j = CHOOSE(N); } while (j == i); /* make sure j != i */\n+ sum += PairwiseIdentity(aseq[i], aseq[j]);\n+ }\n+ return sum / (float) nsample;\n+}\n+\n+/* Function: MajorityRuleConsensus()\n+ * Date: SRE, Tue Mar 7 15:30:30 2000 [St. Louis]\n+ *\n+ * Purpose: Given a set of aligned sequences, produce a\n+ * majority rule consensus sequence. If >50% nonalphabetic\n+ * (usually meaning gaps) in the column, ignore the column.\n+ *\n+ * Args: aseq - aligned sequences, [0..nseq-1][0..alen-1]\n+ * nseq - number of sequences\n+ * alen - length of alignment \n+ *\n+ * Returns: ptr to allocated consensus sequence.\n+ * Caller is responsible for free\'ing this.\n+ */\n+char *\n+MajorityRuleConsensus(char **aseq, int nseq, int alen)\n+{\n+ char *cs; /* RETURN: consensus sequence */\n+ int count[27];\t\t/* counts for a..z and gaps in a column */\n+ int idx,apos;\t\t\t/* counters for seq, column */\n+ int spos;\t\t\t/* position in cs */\n+ int x;\t\t\t/* counter for characters */\n+ int sym;\n+ int max, bestx;\n+ \n+ cs = MallocOrDie(sizeof(char) * (alen+1));\n+ \n+ for (spos=0,apos=0; apos < alen; apos++)\n+ {\n+ for (x = 0; x < 27; x++) count[x] = 0;\n+\n+ for (idx = 0; idx < nseq; idx++)\n+\t{\n+\t if (isalpha(aseq[idx][apos])) {\n+\t sym = toupper(aseq[idx][apos]);\n+\t count[sym-\'A\']++;\n+\t } else {\n+\t count[26]++;\n+\t }\n+\t}\n+\n+ if ((float) count[26] / (float) nseq <= 0.5) {\n+\tmax = bestx = -1;\n+\tfor (x = 0; x < 26; x++) \n+\t if (count[x] > max) { max = count[x]; bestx = x; }\n+\tcs[spos++] = (char) (\'A\' + bestx);\n+ }\n+ }\n+ cs[spos] = \'\\0\';\n+ return cs;\n+}\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/squid/alignio.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/squid/alignio.c Thu Jul 21 13:35:08 2011 -0400 |
[ |
b'@@ -0,0 +1,639 @@\n+/*****************************************************************\n+ * SQUID - a library of functions for biological sequence analysis\n+ * Copyright (C) 1992-2002 Washington University School of Medicine\n+ * \n+ * This source code is freely distributed under the terms of the\n+ * GNU General Public License. See the files COPYRIGHT and LICENSE\n+ * for details.\n+ *****************************************************************/\n+\n+/* alignio.c\n+ * SRE, Mon Jul 12 11:57:37 1993\n+ * RCS $Id: alignio.c 217 2011-03-19 10:27:10Z andreas $ (Original squid RCS Id: alignio.c,v 1.11 2002/10/09 14:26:09 eddy Exp)\n+ * \n+ * Input/output of sequence alignments.\n+ */\n+\n+#include <stdio.h>\n+#include <stdlib.h>\n+#include <string.h>\n+#include <ctype.h>\n+#include "squid.h"\n+#include "sre_random.h"\n+\n+/* Function: AllocAlignment()\n+ * \n+ * Purpose: Allocate space for an alignment, given the number\n+ * of sequences and the alignment length in columns.\n+ * \n+ * Args: nseq - number of sequences\n+ * alen - width of alignment\n+ * ret_aseq - RETURN: alignment itself\n+ * ainfo - RETURN: other info associated with alignment\n+ * \n+ * Return: (void)\n+ * aseq, ainfo free\'d by caller: FreeAlignment(aseq, &ainfo).\n+ * note that ainfo itself is alloc\'ed in caller, usually\n+ * just by a "AINFO ainfo" definition.\n+ */\n+void\n+AllocAlignment(int nseq, int alen, char ***ret_aseq, AINFO *ainfo)\n+{\n+ char **aseq;\n+ int idx;\n+\n+ InitAinfo(ainfo);\n+\n+ aseq = (char **) MallocOrDie (sizeof(char *) * nseq);\n+ for (idx = 0; idx < nseq; idx++)\n+ aseq[idx] = (char *) MallocOrDie (sizeof(char) * (alen+1));\n+\n+ ainfo->alen = alen;\n+ ainfo->nseq = nseq;\n+\n+ ainfo->wgt = (float *) MallocOrDie (sizeof(float) * nseq);\n+ FSet(ainfo->wgt, nseq, 1.0);\n+\n+ ainfo->sqinfo = (SQINFO *) MallocOrDie (sizeof(SQINFO) * nseq);\n+ for (idx = 0; idx < nseq; idx++)\n+ ainfo->sqinfo[idx].flags = 0;\n+\n+ *ret_aseq = aseq;\n+}\n+ \n+\n+/* Function: InitAinfo()\n+ * Date: SRE, Tue Jan 19 10:16:02 1999 [St. Louis]\n+ *\n+ * Purpose: Initialize the fields in ainfo structure to\n+ * default (null) values. Does nothing with \n+ * fields that are dependent on nseq or alen.\n+ *\n+ * Args: ainfo - optional info structure for an alignment\n+ *\n+ * Returns: (void). ainfo is modified.\n+ */\n+void\n+InitAinfo(AINFO *ainfo)\n+{\n+ ainfo->name = NULL;\n+ ainfo->desc = NULL;\n+ ainfo->cs = NULL;\n+ ainfo->rf = NULL;\n+ ainfo->acc = NULL;\n+ ainfo->au = NULL;\n+ ainfo->flags = 0;\n+\n+ ainfo->tc1 = ainfo->tc2 = 0.0;\n+ ainfo->nc1 = ainfo->nc2 = 0.0;\n+ ainfo->ga1 = ainfo->ga2 = 0.0;\n+}\n+\n+\n+/* Function: FreeAlignment()\n+ * \n+ * Purpose: Free the space allocated to alignment, names, and optional\n+ * information. \n+ * \n+ * Args: aseqs - sequence alignment\n+ * ainfo - associated alignment data.\n+ */ \n+void\n+FreeAlignment(char **aseqs, AINFO *ainfo)\n+{\n+ int i;\n+\n+ for (i = 0; i < ainfo->nseq; i++)\n+ {\n+ if (ainfo->sqinfo[i].flags & SQINFO_SS) free(ainfo->sqinfo[i].ss);\n+ if (ainfo->sqinfo[i].flags & SQINFO_SA) free(ainfo->sqinfo[i].sa);\n+ }\n+ if (ainfo->cs != NULL) free(ainfo->cs);\n+ if (ainfo->rf != NULL) free(ainfo->rf);\n+ if (ainfo->name != NULL) free(ainfo->name);\n+ if (ainfo->desc != NULL) free(ainfo->desc);\n+ if (ainfo->acc != NULL) free(ainfo->acc);\n+ if (ainfo->au != NULL) free(ainfo->au);\n+\n+ free(ainfo->sqinfo);\n+ free(ainfo->wgt);\n+ Free2DArray((void **) aseqs, ainfo->nseq);\n+}\n+\n+\n+\n+/* Function: SAMizeAlignment()\n+ * Date: SRE, Tue Jun 30 09:49:40 1998 [St. Louis]\n+ *\n+ * Purpose: Make a "best effort" attempt to convert an alignment\n+ * to SAM gap format: - in delete col, . in insert col.\n+ * Only works if alignment adheres to SAM\'s upper/lower\n+ * case convention, which is true for instance of old\n+'..b', SQINFO *sqinfo, int nseq, float pop, float pex,\n+\t\tchar ***ret_aseqs, AINFO *ainfo)\n+{\n+ char **aseqs; /* RETURN: alignment */\n+ int alen;\t\t\t/* length of alignment */\n+ int *rlen; /* lengths of each raw sequence */\n+ int M;\t\t\t/* length of "model" */\n+ int **ins; /* insertion counts, 0..nseq-1 by 0..M */\n+ int *master_ins; /* max insertion counts, 0..M */\n+ int apos, rpos, idx;\n+ int statepos;\n+ int count;\n+ int minlen;\n+\n+ /* calculate expected length of model, M\n+ */\n+ rlen = (int *) MallocOrDie (sizeof(int) * nseq);\n+ M = 0;\n+ minlen = 9999999;\n+ for (idx = 0; idx < nseq; idx++)\n+ {\n+ rlen[idx] = strlen(rseqs[idx]);\n+ M += rlen[idx];\n+ minlen = (rlen[idx] < minlen) ? rlen[idx] : minlen;\n+ }\n+ M = (int) ((float) M / (1.0 + pop * (1.0 + 1.0 / (1.0 - pex))));\n+ M /= nseq;\n+ if (M > minlen) M = minlen;\n+\n+ /* make arrays that count insertions in M+1 possible insert states\n+ */\n+ ins = (int **) MallocOrDie (sizeof(int *) * nseq);\n+ master_ins = (int *) MallocOrDie (sizeof(int) * (M+1));\n+ for (idx = 0; idx < nseq; idx++)\n+ {\n+ ins[idx] = (int *) MallocOrDie (sizeof(int) * (M+1));\n+ for (rpos = 0; rpos <= M; rpos++)\n+\tins[idx][rpos] = 0;\n+ }\n+\t\t\t\t/* normalize */\n+ pop = pop / (pop+pex);\n+ pex = 1.0 - pop;\n+\t\t\t\t/* make insertions for individual sequences */\n+ for (idx = 0; idx < nseq; idx++)\n+ {\n+ apos = -1;\n+ for (rpos = 0; rpos < rlen[idx]-M; rpos++)\n+\t{\n+\t if (sre_random() < pop || apos == -1)\t/* open insertion */\n+\t apos = CHOOSE(M+1); /* choose 0..M */\n+\t ins[idx][apos]++;\n+\t}\n+ }\n+\t\t\t\t/* calculate master_ins, max inserts */\n+ alen = M;\n+ for (apos = 0; apos <= M; apos++)\n+ {\n+ master_ins[apos] = 0;\n+ for (idx = 0; idx < nseq; idx++)\n+\tif (ins[idx][apos] > master_ins[apos])\n+\t master_ins[apos] = ins[idx][apos];\n+ alen += master_ins[apos];\n+ }\n+\n+\n+ /* Now, construct alignment\n+ */\n+ aseqs = (char **) MallocOrDie (sizeof (char *) * nseq);\n+ for (idx = 0; idx < nseq; idx++)\n+ aseqs[idx] = (char *) MallocOrDie (sizeof(char) * (alen+1));\n+ for (idx = 0; idx < nseq; idx++)\n+ {\n+ apos = rpos = 0;\n+\n+ for (statepos = 0; statepos <= M; statepos++)\n+\t{\n+\t for (count = 0; count < ins[idx][statepos]; count++)\n+\t aseqs[idx][apos++] = rseqs[idx][rpos++];\n+\t for (; count < master_ins[statepos]; count++)\n+\t aseqs[idx][apos++] = \' \';\n+\n+\t if (statepos != M)\n+\t aseqs[idx][apos++] = rseqs[idx][rpos++];\n+\t}\n+ aseqs[idx][alen] = \'\\0\';\n+ }\n+ ainfo->flags = 0;\n+ ainfo->alen = alen; \n+ ainfo->nseq = nseq;\n+ ainfo->sqinfo = (SQINFO *) MallocOrDie (sizeof(SQINFO) * nseq);\n+ for (idx = 0; idx < nseq; idx++)\n+ SeqinfoCopy(&(ainfo->sqinfo[idx]), &(sqinfo[idx]));\n+\n+ free(rlen);\n+ free(master_ins);\n+ Free2DArray((void **) ins, nseq);\n+ *ret_aseqs = aseqs;\n+ return 1;\n+}\n+\n+/* Function: AlignmentHomogenousGapsym()\n+ * Date: SRE, Sun Mar 19 19:37:12 2000 [wren, St. Louis]\n+ *\n+ * Purpose: Sometimes we\'ve got to convert alignments to \n+ * a lowest common denominator, and we need\n+ * a single specific gap character -- for example,\n+ * PSI-BLAST blastpgp -B takes a very simplistic\n+ * alignment input format which appears to only\n+ * allow \'-\' as a gap symbol.\n+ * \n+ * Anything matching the isgap() macro is\n+ * converted.\n+ *\n+ * Args: aseq - aligned character strings, [0..nseq-1][0..alen-1]\n+ * nseq - number of aligned strings\n+ * alen - length of alignment\n+ * gapsym - character to use for gaps. \n+ *\n+ * Returns: void ("never fails")\n+ */\n+void\n+AlignmentHomogenousGapsym(char **aseq, int nseq, int alen, char gapsym)\n+{\n+ int i, apos;\n+\n+ for (i = 0; i < nseq; i++)\n+ for (apos = 0; apos < alen; apos++)\n+ if (isgap(aseq[i][apos])) aseq[i][apos] = gapsym;\n+}\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/squid/clustal.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/squid/clustal.c Thu Jul 21 13:35:08 2011 -0400 |
[ |
b'@@ -0,0 +1,329 @@\n+/*****************************************************************\n+ * SQUID - a library of functions for biological sequence analysis\n+ * Copyright (C) 1992-2002 Washington University School of Medicine\n+ * \n+ * This source code is freely distributed under the terms of the\n+ * GNU General Public License. See the files COPYRIGHT and LICENSE\n+ * for details.\n+ *****************************************************************/\n+\n+/* clustal.c\n+ * SRE, Sun Jun 6 17:50:45 1999 [bus from Madison, 1999 worm mtg]\n+ * \n+ * Import/export of ClustalV/W multiple sequence alignment\n+ * formatted files. Derivative of msf.c; MSF is a pretty\n+ * generic interleaved format. \n+ * \n+ * RCS $Id: clustal.c 228 2011-03-29 14:05:27Z dave $ (Original squid RCS Id: clustal.c,v 1.1 1999/07/15 22:26:53 eddy Exp)\n+ */\n+\n+#include <stdio.h>\n+#include <stdlib.h>\n+#include <string.h>\n+#include <ctype.h>\n+#include "squid.h"\n+#include "msa.h"\n+\n+#ifdef CLUSTALO\n+/* needed for PACKAGE_VERSION */\n+#include "../config.h"\n+\n+#ifndef min\n+\t#define min( a, b ) ( ((a) < (b)) ? (a) : (b) )\n+#endif\n+\n+/*These are all the positively scoring groups that occur in the Gonnet Pam250\n+matrix. There are strong and weak groups, defined as strong score >0.5 and\n+weak score =<0.5. Strong matching columns to be assigned \':\' and weak matches\n+assigned \'.\' in the clustal output format.\n+amino_strong = res_cat1\n+amino_weak = res_cat2\n+*/\n+\n+char *amino_strong[] = {"STA", "NEQK", "NHQK", "NDEQ", "QHRK", "MILV",\n+ "MILF", "HY", "FYW", NULL};\n+\n+char *amino_weak[] = {"CSA", "ATV", "SAG", "STNK", "STPA", "SGND",\n+ "SNDEQK", "NDEQHK", "NEQHRK", "FVLIM", "HFY", NULL};\n+\n+#endif\n+\n+#ifdef TESTDRIVE_CLUSTAL\n+/*****************************************************************\n+ * msf.c test driver: \n+ * cc -DTESTDRIVE_CLUSTAL -g -O2 -Wall -o test clustal.c msa.c gki.c sqerror.c sre_string.c file.c hsregex.c sre_math.c sre_ctype.c -lm\n+ * \n+ */\n+int\n+main(int argc, char **argv)\n+{\n+ MSAFILE *afp;\n+ MSA *msa;\n+ char *file;\n+ \n+ file = argv[1];\n+\n+ if ((afp = MSAFileOpen(file, MSAFILE_CLUSTAL, NULL)) == NULL)\n+ Die("Couldn\'t open %s\\n", file);\n+\n+ while ((msa = ReadClustal(afp)) != NULL)\n+ {\n+ WriteClustal(stdout, msa);\n+ MSAFree(msa); \n+ }\n+ \n+ MSAFileClose(afp);\n+ exit(0);\n+}\n+/******************************************************************/\n+#endif /* testdrive_clustal */\n+\n+\n+/* Function: ReadClustal()\n+ * Date: SRE, Sun Jun 6 17:53:49 1999 [bus from Madison, 1999 worm mtg]\n+ *\n+ * Purpose: Parse an alignment read from an open Clustal format\n+ * alignment file. Clustal is a single-alignment format.\n+ * Return the alignment, or NULL if we have no data.\n+ * \n+ * Args: afp - open alignment file\n+ *\n+ * Returns: MSA * - an alignment object\n+ * caller responsible for an MSAFree()\n+ * NULL if no more alignments\n+ *\n+ * Diagnostics: \n+ * Will Die() here with a (potentially) useful message\n+ * if a parsing error occurs.\n+ */\n+MSA *\n+ReadClustal(MSAFILE *afp)\n+{\n+ MSA *msa;\n+ char *s;\n+ int slen;\n+ int sqidx;\n+ char *name;\n+ char *seq;\n+ char *s2;\n+\n+ if (feof(afp->f)) return NULL;\n+\n+ /* Skip until we see the CLUSTAL header\n+ */\n+ while ((s = MSAFileGetLine(afp)) != NULL)\n+ {\n+ if (strncmp(s, "CLUSTAL", 7) == 0 &&\n+\t strstr(s, "multiple sequence alignment") != NULL)\n+\tbreak;\n+ }\n+ if (s == NULL) return NULL;\n+\n+ msa = MSAAlloc(10, 0);\n+\n+ /* Now we\'re in the sequence section. \n+ * As discussed above, if we haven\'t seen a sequence name, then we\n+ * don\'t include the sequence in the alignment.\n+ * Watch out for conservation markup lines that contain *.: chars\n+ */\n+ while ((s = MSAFileGetLine(afp)) != NULL) \n+ {\n+ if ((name = sre_strtok(&s, WHITESPACE, NULL)) == NULL) continue;\n+ if ((seq = sre_strtok(&s, WHITESPACE, &slen)) == NULL) continue;\n+ s2 = sre_strt'..b'\n+ bail = 1;\n+ break;\n+ }\n+ }\n+ if(!bail)\n+ fprintf(fp, "*");\n+ else\n+ {\n+ /* if not then check strong */\n+ for(bin = 0; bin < 9; bin++)\n+ strong_bins[bin] = 0; /* clear the bins */\n+\n+ for(idx = 0; idx < msa->nseq; idx++)\n+ {\n+ switch(msa->aseq[idx][subpos])\n+ {\n+ case \'S\': strong_bins[0]++; break;\n+ case \'T\': strong_bins[0]++; break;\n+ case \'A\': strong_bins[0]++; break;\n+ case \'N\': strong_bins[1]++; strong_bins[2]++; strong_bins[3]++; break;\n+ case \'E\': strong_bins[1]++; strong_bins[3]++; break;\n+ case \'Q\': strong_bins[1]++; strong_bins[2]++; strong_bins[3]++; strong_bins[4]++; break;\n+ case \'K\': strong_bins[1]++; strong_bins[2]++; strong_bins[4]++; break;\n+ case \'D\': strong_bins[3]++; break;\n+ case \'R\': strong_bins[4]++; break;\n+ case \'H\': strong_bins[4]++; strong_bins[7]++; break;\n+ case \'M\': strong_bins[5]++; strong_bins[6]++; break;\n+ case \'I\': strong_bins[5]++; strong_bins[6]++; break;\n+ case \'L\': strong_bins[5]++; strong_bins[6]++; break;\n+ case \'V\': strong_bins[5]++; break;\n+ case \'F\': strong_bins[6]++; strong_bins[8]++; break;\n+ case \'Y\': strong_bins[7]++; strong_bins[8]++; break;\n+ case \'W\': strong_bins[8]++; break;\n+ }\n+ }\n+ bail = 0;\n+ for(bin = 0; bin < 9; bin++)\n+ if(strong_bins[bin] == msa->nseq)\n+ {\n+ bail = 1;\n+ break;\n+ }\n+ if(bail)\n+ fprintf(fp, ":");\n+ else\n+ {\n+ /* check weak */\n+ for(bin = 0; bin < 11; bin++)\n+ weak_bins[bin] = 0; /* clear the bins */\n+\n+ for(idx = 0; idx < msa->nseq; idx++)\n+ {\n+ switch(msa->aseq[idx][subpos])\n+ {\n+ case \'C\': weak_bins[0]++; break;\n+ case \'S\': weak_bins[0]++; weak_bins[2]++; weak_bins[3]++; weak_bins[4]++; weak_bins[5]++; weak_bins[6]++; break;\n+ case \'A\': weak_bins[0]++; weak_bins[1]++; weak_bins[2]++; weak_bins[4]++; break;\n+ case \'T\': weak_bins[1]++; weak_bins[3]++; weak_bins[4]++; break;\n+ case \'V\': weak_bins[1]++; weak_bins[9]++; break;\n+ case \'G\': weak_bins[2]++; break;\n+ case \'N\': weak_bins[3]++; weak_bins[5]++; weak_bins[6]++; weak_bins[7]++; weak_bins[8]++; break;\n+ case \'K\': weak_bins[3]++; weak_bins[6]++; weak_bins[7]++; weak_bins[8]++; break;\n+ case \'D\': weak_bins[5]++; weak_bins[6]++; weak_bins[7]++; break;\n+ case \'E\': weak_bins[6]++; weak_bins[7]++; weak_bins[8]++; break;\n+ case \'Q\': weak_bins[6]++; weak_bins[7]++; weak_bins[8]++; break;\n+ case \'H\': weak_bins[7]++; weak_bins[8]++; weak_bins[10]++; break;\n+ case \'R\': weak_bins[8]++; break;\n+ case \'F\': weak_bins[9]++; weak_bins[10]++; break;\n+ case \'L\': weak_bins[9]++; break;\n+ case \'I\': weak_bins[9]++; break;\n+ case \'M\': weak_bins[9]++; break;\n+ case \'Y\': weak_bins[10]++; break;\n+ }\n+ }\n+ bail = 0;\n+ for(bin = 0; bin < 11; bin++)\n+ if(weak_bins[bin] == msa->nseq)\n+ {\n+ bail = 1;\n+ break;\n+ }\n+ if(bail)\n+ fprintf(fp, ".");\n+ else\n+ fprintf(fp, " ");\n+ }\n+ }\n+ }\n+ fprintf(fp,"\\n");\n+#endif\n+ }\n+\n+ return;\n+}\n+\n+\n+\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/squid/clustalo.README --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/squid/clustalo.README Thu Jul 21 13:35:08 2011 -0400 |
b |
@@ -0,0 +1,9 @@ +This is a trimmed down and patched version of Sean Eddy's squid library version 1.9 +See squid-1.9g.tar.gz for the original files. +Downloaded from ftp://selab.janelia.org/pub/software/squid/ + +changes in source code are all done via #ifdef CLUSTALO, which is set via Makefile + +We use our own config header instead of squidconf (see squid.h) + + |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/squid/cluster.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/squid/cluster.c Thu Jul 21 13:35:08 2011 -0400 |
[ |
b'@@ -0,0 +1,543 @@\n+/*****************************************************************\n+ * SQUID - a library of functions for biological sequence analysis\n+ * Copyright (C) 1992-2002 Washington University School of Medicine\n+ * \n+ * This source code is freely distributed under the terms of the\n+ * GNU General Public License. See the files COPYRIGHT and LICENSE\n+ * for details.\n+ *****************************************************************/\n+\n+/* cluster.c\n+ * SRE, Sun Jul 18 09:49:47 1993\n+ * moved to squid Thu Mar 3 08:42:57 1994\n+ * RCS $Id: cluster.c 217 2011-03-19 10:27:10Z andreas $ (Original squid RCS Id: cluster.c,v 1.3 1999/07/15 22:32:16 eddy Exp)\n+ *\n+ * almost identical to bord.c, from fd\n+ * also now contains routines for constructing difference matrices\n+ * from alignments\n+ * \n+ * "branch ordering": Input a symmetric or upper-right-diagonal \n+ * NxN difference matrix (usually constructed by pairwise alignment \n+ * and similarity calculations for N sequences). Use the simple \n+ * cluster analysis part of the Fitch/Margoliash tree-building algorithm\n+ * (as described by Fitch and Margoliash 1967 as well as Feng\n+ * and Doolittle 1987) to calculate the topology of an "evolutionary\n+ * tree" consistent with the difference matrix. Returns an array\n+ * which represents the tree.\n+ * \n+ * The input difference matrix is just an NxN matrix of floats.\n+ * A good match is a small difference score (the algorithm is going\n+ * to search for minima among the difference scores). The original difference\n+ * matrix remains unchanged by the calculations.\n+ * \n+ * The output requires some explanation. A phylogenetic\n+ * tree is a binary tree, with N "leaves" and N-1 "nodes". The\n+ * topology of the tree may be completely described by N-1 structures\n+ * containing two pointers; each pointer points to either a leaf\n+ * or another node. Here, this is implemented with integer indices\n+ * rather than pointers. An array of N-1 pairs of ints is returned.\n+ * If the index is in the range (0..N-1), it is a "leaf" -- the\n+ * number of one of the sequences. If the index is in the range\n+ * (N..2N-2), it is another "node" -- (index-N) is the index\n+ * of the node in the returned array.\n+ * \n+ * If both indices of a member of the returned array point to\n+ * nodes, the tree is "compound": composed of more than one\n+ * cluster of related sequences.\n+ * \n+ * The higher-numbered elements of the returned array were the\n+ * first constructed, and hence represent the distal tips\n+ * of the tree -- the most similar sequences. The root\n+ * is node 0.\n+ ******************************************************************\n+ *\n+ * Algorithm\n+ * \n+ * INITIALIZATIONS:\n+ * - copy the difference matrix (otherwise the caller\'s copy would\n+ * get destroyed by the operations of this algorithm). If\n+ * it\'s asymmetric, make it symmetric.\n+ * - make a (0..N-1) array of ints to keep track of the indices in\n+ * the difference matrix as they get swapped around. Initialize\n+ * this matrix to 0..N-1.\n+ * - make a (0..N-2) array of int[2] to store the results (the tree\n+ * topology). Doesn\'t need to be initialized.\n+ * - keep track of a "N\'", the current size of the difference\n+ * matrix being operated on.\n+ *\n+ * PROCESSING THE DIFFERENCE MATRIX:\n+ * - for N\' = N down to N\' = 2 (N-1 steps):\n+ * - in the half-diagonal N\'xN\' matrix, find the indices i,j at which\n+ * there\'s the minimum difference score\n+ * \n+ * Store the results:\n+ * - at position N\'-2 of the result array, store coords[i] and \n+ * coords[j].\n+ * \n+ * Move i,j rows, cols to the outside edges of the matrix:\n+ * - swap row i and row N\'-2\n+ * - swap row j and row N\'-1 \n+ * - swap column i and column N\'-2\n+ * - swap column j and column N\'-1\n+ * - swap indices i, N\'-2 in the index array\n+ * - swap indices j, N\'-1 in the index array\n+ * \n+ * Build a average difference score for differences to i,'..b's\n+ * less confusing to have two distinct functions, I find.\n+ * \n+ * Args: aseqs - flushed, aligned sequences\n+ * num - number of aseqs\n+ * ret_imx - RETURN: identity matrix (caller must free)\n+ * \n+ * Return: 1 on success, 0 on failure.\n+ * Caller must free imx using FMX2Free(imx)\n+ */\n+void\n+MakeIdentityMx(char **aseqs, int num, float ***ret_imx)\n+{\n+ float **imx; /* RETURN: identity matrix */\n+ int i,j;\t\t/* counters over sequences */\n+\n+ /* Allocate 2D float matrix\n+ */\n+ imx = FMX2Alloc(num, num);\n+\n+ /* Calculate distances, symmetric matrix\n+ */\n+ for (i = 0; i < num; i++)\n+ for (j = i; j < num; j++)\n+ imx[i][j] = imx[j][i] = PairwiseIdentity(aseqs[i], aseqs[j]);\n+\n+ *ret_imx = imx;\n+ return;\n+}\n+\n+\n+\n+/* Function: PrintNewHampshireTree()\n+ * \n+ * Purpose: Print out a tree in the "New Hampshire" standard\n+ * format. See PHYLIP\'s draw.doc for a definition of\n+ * the New Hampshire format.\n+ *\n+ * Like a CFG, we generate the format string left to\n+ * right by a preorder tree traversal.\n+ * \n+ * Args: fp - file to print to\n+ * ainfo- alignment info, including sequence names \n+ * tree - tree to print\n+ * N - number of leaves\n+ * \n+ */\n+void\n+PrintNewHampshireTree(FILE *fp, AINFO *ainfo, struct phylo_s *tree, int N)\n+{ \n+ struct intstack_s *stack;\n+ int code;\n+ float *blen;\n+ int docomma; \n+\n+ blen = (float *) MallocOrDie (sizeof(float) * (2*N-1));\n+ stack = InitIntStack();\n+ PushIntStack(stack, N);\t/* push root on stack */\n+ docomma = FALSE;\n+ \n+ /* node index code:\n+ * 0..N-1 = leaves; indexes of sequences.\n+ * N..2N-2 = interior nodes; node-N = index of node in tree structure.\n+ * code N is the root. \n+ * 2N..3N-2 = special flags for closing interior nodes; node-2N = index in tree\n+ */\n+ while (PopIntStack(stack, &code))\n+ {\n+ if (code < N)\t\t/* we\'re a leaf. */\n+\t{\n+\t\t\t\t/* 1) print name:branchlength */\n+\t if (docomma) fputs(",", fp);\n+\t fprintf(fp, "%s:%.5f", ainfo->sqinfo[code].name, blen[code]);\n+\t docomma = TRUE;\n+\t}\n+\n+ else if (code < 2*N) /* we\'re an interior node */\n+\t{\n+\t\t\t\t/* 1) print a \'(\' */\n+\t if (docomma) fputs(",\\n", fp);\n+\t fputs("(", fp);\n+\t\t\t\t/* 2) push on stack: ), rchild, lchild */\n+\t PushIntStack(stack, code+N);\n+\t PushIntStack(stack, tree[code-N].right);\n+\t PushIntStack(stack, tree[code-N].left);\n+\t\t\t\t/* 3) record branch lengths */\n+\t blen[tree[code-N].right] = tree[code-N].rblen;\n+\t blen[tree[code-N].left] = tree[code-N].lblen;\n+\t docomma = FALSE;\n+\t}\n+\n+ else\t\t\t/* we\'re closing an interior node */\n+\t{\n+\t\t\t\t/* print a ):branchlength */\n+\t if (code == 2*N) fprintf(fp, ");\\n");\n+\t else fprintf(fp, "):%.5f", blen[code-N]);\n+\t docomma = TRUE;\n+\t}\n+ }\n+\n+ FreeIntStack(stack);\n+ free(blen);\n+ return;\n+}\n+\n+\n+/* Function: PrintPhylo()\n+ * \n+ * Purpose: Debugging output of a phylogenetic tree structure.\n+ */\n+void\n+PrintPhylo(FILE *fp, AINFO *ainfo, struct phylo_s *tree, int N)\n+{\n+ int idx;\n+\n+ for (idx = 0; idx < N-1; idx++)\n+ {\n+ fprintf(fp, "Interior node %d (code %d)\\n", idx, idx+N);\n+ fprintf(fp, "\\tParent: %d (code %d)\\n", tree[idx].parent-N, tree[idx].parent);\n+ fprintf(fp, "\\tLeft: %d (%s) %f\\n", \n+\t tree[idx].left < N ? tree[idx].left-N : tree[idx].left,\n+\t tree[idx].left < N ? ainfo->sqinfo[tree[idx].left].name : "interior",\n+\t tree[idx].lblen);\n+ fprintf(fp, "\\tRight: %d (%s) %f\\n", \n+\t tree[idx].right < N ? tree[idx].right-N : tree[idx].right,\n+\t tree[idx].right < N ? ainfo->sqinfo[tree[idx].right].name : "interior",\n+\t tree[idx].rblen);\n+ fprintf(fp, "\\tHeight: %f\\n", tree[idx].diff);\n+ fprintf(fp, "\\tIncludes:%d seqs\\n", tree[idx].incnum);\n+ }\n+}\n+ \n+\n+\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/squid/dayhoff.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/squid/dayhoff.c Thu Jul 21 13:35:08 2011 -0400 |
[ |
@@ -0,0 +1,174 @@ +/***************************************************************** + * SQUID - a library of functions for biological sequence analysis + * Copyright (C) 1992-2002 Washington University School of Medicine + * + * This source code is freely distributed under the terms of the + * GNU General Public License. See the files COPYRIGHT and LICENSE + * for details. + *****************************************************************/ + +/* dayhoff.c + * + * Routines for dealing with PAM matrices. + * + * Includes: + * ParsePAMFile() -- read a PAM matrix from disk. + * + * + * SRE - Fri Apr 2 11:23:45 1993 + * RCS $Id: dayhoff.c 217 2011-03-19 10:27:10Z andreas $ (Original squid RCS Id: dayhoff.c,v 1.5 2002/07/03 15:03:39 eddy Exp) + */ + + +#include <stdlib.h> +#include <stdio.h> +#include <string.h> +#include <math.h> +#include <ctype.h> +#include "squid.h" + +/* Function: ParsePAMFile() + * + * Purpose: Given a pointer to an open file containing a PAM matrix, + * parse the file and allocate and fill a 2D array of + * floats containing the matrix. The PAM file is + * assumed to be in the format that NCBI distributes + * with BLAST. BLOSUM matrices also work fine, as + * produced by Henikoff's program "MATBLAS". + * + * Parses both old format and new format BLAST matrices. + * Old format just had rows of integers. + * New format includes a leading character on each row. + * + * The PAM matrix is a 27x27 matrix, 0=A..25=Z,26=*. + * Note that it's not a 20x20 matrix as you might expect; + * this is for speed of indexing as well as the ability + * to deal with ambiguous characters. + * + * Args: fp - open PAM file + * ret_pam - RETURN: pam matrix, integers + * ret_scale - RETURN: scale factor for converting + * to real Sij. For instance, PAM120 is + * given in units of ln(2)/2. This may + * be passed as NULL if the caller + * doesn't care. + * + * Returns: 1 on success; 0 on failure and sets squid_errno to + * indicate the cause. ret_pam is allocated here and + * must be freed by the caller (use FreePAM). + */ +int +ParsePAMFile(FILE *fp, int ***ret_pam, float *ret_scale) +{ + int **pam; + char buffer[512]; /* input buffer from fp */ + int order[27]; /* order of fields, obtained from header */ + int nsymbols; /* total number of symbols in matrix */ + char *sptr; + int idx; + int row, col; + float scale; + int gotscale = FALSE; + + scale = 0.0; /* just to silence gcc uninit warnings */ + if (fp == NULL) { squid_errno = SQERR_NODATA; return 0; } + + /* Look at the first non-blank, non-comment line in the file. + * It gives single-letter codes in the order the PAM matrix + * is arrayed in the file. + */ + do { + if (fgets(buffer, 512, fp) == NULL) + { squid_errno = SQERR_NODATA; return 0; } + + /* Get the scale factor from the header. + * For BLOSUM files, we assume the line looks like: + * BLOSUM Clustered Scoring Matrix in 1/2 Bit Units + * and we assume that the fraction is always 1/x; + * + * For PAM files, we assume the line looks like: + * PAM 120 substitution matrix, scale = ln(2)/2 = 0.346574 + * and we assume that the number following the final '=' is our scale + */ + if (strstr(buffer, "BLOSUM Clustered Scoring Matrix") != NULL && + (sptr = strchr(buffer, '/')) != NULL) + { + sptr++; + if (! isdigit((int) (*sptr))) { squid_errno = SQERR_FORMAT; return 0; } + scale = (float) (log(2.0) / atof(sptr)); + gotscale = TRUE; + } + else if (strstr(buffer, "substitution matrix,") != NULL) + { + while ((sptr = strrchr(buffer, '=')) != NULL) { + sptr += 2; + if (IsReal(sptr)) { + scale = atof(sptr); + gotscale = TRUE; + break; + } + } + } + } while ((sptr = strtok(buffer, " \t\n")) == NULL || *sptr == '#'); + + idx = 0; + do { + order[idx] = (int) *sptr - (int) 'A'; + if (order[idx] < 0 || order[idx] > 25) order[idx] = 26; + idx++; + } while ((sptr = strtok(NULL, " \t\n")) != NULL); + nsymbols = idx; + + /* Allocate a pam matrix. For speed of indexing, we use + * a 27x27 matrix so we can do lookups using the ASCII codes + * of amino acid single-letter representations, plus one + * extra field to deal with the "*" (terminators). + */ + if ((pam = (int **) calloc (27, sizeof(int *))) == NULL) + Die("calloc failed"); + for (idx = 0; idx < 27; idx++) + if ((pam[idx] = (int *) calloc (27, sizeof(int))) == NULL) + Die("calloc failed"); + + /* Parse the rest of the file. + */ + for (row = 0; row < nsymbols; row++) + { + if (fgets(buffer, 512, fp) == NULL) + { squid_errno = SQERR_NODATA; return 0; } + + if ((sptr = strtok(buffer, " \t\n")) == NULL) + { squid_errno = SQERR_NODATA; return 0; } + for (col = 0; col < nsymbols; col++) + { + if (sptr == NULL) { squid_errno = SQERR_NODATA; return 0; } + + /* Watch out for new BLAST format, with leading characters + */ + if (*sptr == '*' || isalpha((int) *sptr)) + col--; /* hack hack */ + else + pam [order[row]] [order[col]] = atoi(sptr); + + sptr = strtok(NULL, " \t\n"); + } + } + + /* Return + */ + if (ret_scale != NULL) + { + if (gotscale) *ret_scale = scale; + else + { +#ifdef CLUSTALO + Warning("Failed to parse PAM matrix scale factor. Defaulting to ln(2)/2!"); +#else + Warn("Failed to parse PAM matrix scale factor. Defaulting to ln(2)/2!"); +#endif + *ret_scale = log(2.0) / 2.0; + } + } + *ret_pam = pam; + return 1; +} |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/squid/eps.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/squid/eps.c Thu Jul 21 13:35:08 2011 -0400 |
[ |
@@ -0,0 +1,115 @@ +/***************************************************************** + * SQUID - a library of functions for biological sequence analysis + * Copyright (C) 1992-2002 Washington University School of Medicine + * + * This source code is freely distributed under the terms of the + * GNU General Public License. See the files COPYRIGHT and LICENSE + * for details. + *****************************************************************/ + +/* eps.c + * SRE, Thu Jun 21 18:02:31 2001 [St. Louis] + * + * Some crude support for Encapsulated PostScript (EPS) output, + * DSC compliant. + * + * CVS $Id: eps.c,v 1.4 2002/02/24 19:39:27 eddy Exp) + */ + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#include "squid.h" +#include "msa.h" + +/* Function: EPSWriteSmallMSA() + * Date: SRE, Thu Jun 21 18:15:21 2001 [St. Louis] + * + * Purpose: Write an alignment in singleblock, Stockholm/SELEX like + * format to an open file. Very crude. + * Currently fails if the alignment is >50 columns long, because + * it doesn't think it will fit on a single page. + * + * Args: fp - open file for writing + * msa - alignment to write + * + * Returns: (void) + */ +void +EPSWriteSmallMSA(FILE *fp, MSA *msa) +{ + int namewidth; /* namewidth in PostScript units */ + int fontwidth; /* width of a character in this font */ + int hspace; /* horizontal space between aligned chars */ + int vspace; /* vertical space between sequences */ + char *font; /* font name, e.g. "Courier" */ + int fontsize; /* font size in pts */ + int i,j; /* counter over sequences, columns */ + int len; /* tmp var holding length of something */ + int width, height; /* width and height of bounding box */ + int xpos, ypos; /* x,y position */ + + /* Set some font characteristics; done here, so it'll + * be easy to change. Magic numbers for Courier 12 determined + * by trial and error. + */ + fontwidth = 8; + hspace = 9; + vspace = 15; + font = sre_strdup("Courier", -1); + fontsize = 12; + + /* Find the width of the longest sequence name in characters. + */ + namewidth = 0; + for (i = 0; i < msa->nseq; i++) + if ((len = (int) strlen(msa->sqname[i])) > namewidth) + namewidth = len; + namewidth += 1; /* add a space to separate name & aligned seq */ + namewidth *= fontwidth; + + /* Determine bounding box + */ + if (msa->alen > 50) Die("No EPS fmt if alignment is >50 columns"); + width = namewidth + hspace*msa->alen; + if (width > 612) Die("Alignment too wide to write in EPS"); + height = vspace*msa->nseq; + if (height > 792) Die("Too many seqs to write in EPS"); + + /* Magic EPS header, bare-bones DSC-compliant. + */ + fprintf(fp, "%%!PS-Adobe-3.0 EPSF-3.0\n"); + fprintf(fp, "%%%%BoundingBox: %d %d %d %d\n", 0, 0, width, height); + fprintf(fp, "%%%%Pages: 1\n"); + fprintf(fp, "%%%%EndComments\n"); + + /* More postscript magic before we start the alignment + */ + fprintf(fp, "/%s findfont\n", font); + fprintf(fp, "%d scalefont\n", fontsize); + fprintf(fp, "setfont\n"); + fprintf(fp, "newpath\n"); + + /* Write the alignment in PostScript in a single block + */ + for (i = 0; i < msa->nseq; i++) + { + ypos = (msa->nseq-i-1)*vspace; + /* name first */ + fprintf(fp, "%d %d moveto\n", 0, ypos); + fprintf(fp, "(%s) show\n", msa->sqname[i]); + /* now seq */ + xpos = namewidth; + for (j = 0; j < msa->alen; j++) + { + fprintf(fp, "%d %d moveto\n", xpos, ypos); + fprintf(fp, "(%c) show\n", msa->aseq[i][j]); + xpos+= hspace; + } + } + + free(font); +} + + |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/squid/file.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/squid/file.c Thu Jul 21 13:35:08 2011 -0400 |
[ |
b'@@ -0,0 +1,271 @@\n+/*****************************************************************\n+ * SQUID - a library of functions for biological sequence analysis\n+ * Copyright (C) 1992-2002 Washington University School of Medicine\n+ * \n+ * This source code is freely distributed under the terms of the\n+ * GNU General Public License. See the files COPYRIGHT and LICENSE\n+ * for details.\n+ *****************************************************************/\n+\n+\n+/* file.c\n+ * SRE, Wed Jun 19 11:19:22 1996\n+ * \n+ * File operation utilities, dealing with pathnames, directories,\n+ * and environment variables.\n+ * \n+ * The goal is to have these be platform-independent but they\n+ * currently are UNIX-specific: i.e. this file is currently POSIX compliant\n+ * but it is NOT ANSI C compliant. (The sole offender is getenv().)\n+ *\n+ * RCS $Id: file.c 217 2011-03-19 10:27:10Z andreas $ (Original squid RCS Id: file.c,v 1.8 2002/03/07 03:18:02 eddy Exp)\n+ */\n+\n+#include <stdio.h>\n+#include <stdlib.h>\n+#include <string.h>\n+\n+#include "squid.h"\n+#include "sqfuncs.h"\n+\n+/* \n+ * VMS: #define DIRSLASH \']\'\n+ * MacOS: #define DIRSLASH \':\'\n+ * DOS: #define DIRSLASH \'\\\\\'\n+ * \n+ * The code assumes that \'.\' is used for file name extensions,\n+ * such as "foo.bar".\n+ */\n+#define DIRSLASH \'/\' /* UNIX directory paths have /foo/bar */\n+\n+\n+\n+/* Function: FileDirname()\n+ * \n+ * Purpose: Returns the path from a filename:\n+ * "/foo/bar/baz" -> "/foo/bar"\n+ * "foo/bar" -> "foo" \n+ * "foo" -> "."\n+ * "/" -> "/" \n+ * i.e. the string will be non-NULL; it will\n+ * contain the string up to but not including the\n+ * last \'/\' character; returns "." if\n+ * there are no \'/\' characters, and returns "/"\n+ * if the last slash is the first character.\n+ * Modeled on Tcl\'s "file dirname" command.\n+ *\n+ * Args: file - name of file "/foo/bar/baz".\n+ * \n+ * Return: ptr to malloc\'ed string "/foo/bar". \n+ */\n+char *\n+FileDirname(char *file)\n+{\n+ char *dirname;\n+ char *lastslash;\n+ int len;\n+ \n+ lastslash = strrchr(file, DIRSLASH);\n+ len = (lastslash == NULL) ? 0 : (int) (lastslash - file);\n+ dirname = (char *) MallocOrDie (sizeof(char) * (len+2));\n+ if (len > 0) strncpy(dirname, file, len);\n+ else if (*file != DIRSLASH) { *dirname = \'.\'; len = 1; }\n+ else { *dirname = DIRSLASH; len = 1; }\n+ dirname[len] = \'\\0\';\n+ return dirname;\n+}\n+\n+\n+/* Function: FileTail()\n+ * \n+ * Purpose: Return everything after the DIRSLASH:\n+ * "/foo/bar/baz.1" -> "baz.1"\n+ * "foo/bar" -> "bar" \n+ * "foo" -> "foo"\n+ * "/" -> "" \n+ * If noextension is TRUE, removes a trailing ".foo" extension\n+ * too.\n+ * \n+ * Args: file - name of file "/foo/bar/baz.1" \n+ * noextension - TRUE to also remove extensions\n+ * \n+ * Return: ptr to malloc\'ed string "baz.1" \n+ */ \n+char * \n+FileTail(char *file, int noextension)\n+{\n+ char *tail;\n+ char *lastslash;\n+ char *lastdot;\n+\t\t\t\t/* remove directory prefix */\n+ lastslash = strrchr(file, DIRSLASH);\n+ tail = (char *) MallocOrDie (sizeof(char) * (strlen(file)+1));\n+ if (lastslash == NULL) strcpy(tail, file);\n+ else strcpy(tail, lastslash+1);\n+\t\t\t\t/* remove trailing suffix */\n+ if (noextension) {\n+ if ((lastdot = strrchr(tail, \'.\')) != NULL)\n+ *lastdot = \'\\0\';\n+ }\n+\n+ return tail;\n+}\n+\n+\n+/* Function: FileSameDirectory()\n+ * Date: SRE, Wed Mar 6 20:03:23 2002 [St. Louis]\n+ *\n+ * Purpose: Given a path to one file, and the \n+ * name of another file in the same directory,\n+ * concat the path from file1 onto file2, and\n+ * return the result. Caller must free the ptr\n+ * that\'s returned. \n+ * \n+ '..b'ncat(path, tail);\n+ if (! seems_ok && strcmp(result, file2) != 0) {\n+ free(result); result = NULL; \n+ }\n+ free(path);\n+ free(tail);\n+ return result;\n+}\n+\n+/* Function: FileConcat()\n+ * \n+ * Purpose: Concatenate a directory path and a file name,\n+ * returning a pointer to a malloc\'ed string with the\n+ * full filename. This isn\'t just a string concat,\n+ * because we\'re careful about the dir slash.\n+ */\n+char *\n+FileConcat(char *dir, char *file)\n+{\n+ char *full;\n+\n+ full = (char *) MallocOrDie (sizeof(char) * (strlen(dir)+strlen(file)+2));\n+ if (*file == DIRSLASH) strcpy(full, file); /* file = "/foo", ignore directory. */\n+ else sprintf(full, "%s%c%s", dir, DIRSLASH, file);\n+ return full;\n+}\n+\n+\n+/* Function: FileAddSuffix()\n+ * Date: SRE, Wed Aug 1 11:19:33 2001 [Pasadena]\n+ *\n+ * Purpose: Add a suffix to a filename, return a malloc\'ed\n+ * string containing the new filename.sfx name.\n+ * Example:\n+ * FileAddSuffix("genbank", "ssi")\n+ * returns "genbank.ssi". \n+ */\n+char *\n+FileAddSuffix(char *filename, char *sfx)\n+{\n+ char *new;\n+ new = MallocOrDie(strlen(filename) + strlen(sfx) + 2);\n+ sprintf(new, "%s.%s", filename, sfx);\n+ return new;\n+}\n+\n+/* Function: EnvFileOpen()\n+ * Date: Sun Feb 12 10:55:29 1995 \n+ * \n+ * Purpose: Open a file, given a file name and an environment\n+ * variable that contains a directory path. Files\n+ * are opened read-only. Does not look at current directory\n+ * unless "." is explicitly in the path specified by env.\n+ * \n+ * For instance: \n+ * fp = EnvFileOpen("BLOSUM45", "BLASTMAT", NULL);\n+ * or:\n+ * fp = EnvFileOpen("swiss", "BLASTDB", NULL); \n+ * \n+ * Environment variables may contain a colon-delimited\n+ * list of more than one path; e.g.\n+ * setenv BLASTDB /nfs/databases/foo:/nfs/databases/bar\n+ * \n+ * Sometimes a group of files may be found in\n+ * one directory; for instance, an index file with a\n+ * database. The caller can EnvFileOpen() the main\n+ * file, and ask to get the name of the\n+ * directory back in ret_dir, so it can construct\n+ * the other auxiliary file names and fopen() them. (If it called\n+ * EnvFileOpen(), it might get confused by \n+ * file name clashes and open files in different\n+ * directories.\n+ * \n+ * Args: fname - name of file to open\n+ * env - name of environment variable containing path\n+ * ret_dir - if non-NULL, RETURN: name of dir that was used.\n+ * \n+ * Return: FILE * to open file, or NULL on failure -- same as fopen()\n+ * Caller must free ret_dir if it passed a non-NULL address.\n+ */\n+FILE *\n+EnvFileOpen(char *fname, char *env, char **ret_dir)\n+{\n+ FILE *fp;\n+ char *path;\n+ char *s; /* ptr to indiv element in env list */\n+ char full[1024]; /* constructed file name */\n+\n+ if (env == NULL) return NULL;\n+ if ((path = Strdup(getenv(env))) == NULL) return NULL;\n+ \n+ fp = NULL;\n+ s = strtok(path, ":");\n+ while (s != NULL)\n+ {\n+ if (((int) strlen(fname) + (int) strlen(s) + 2) > 1024) \n+\t{ free(path); return NULL; }\n+ sprintf(full, "%s%c%s", s, DIRSLASH, fname);\n+ if ((fp = fopen(full, "r")) != NULL) break;\n+ s = strtok(NULL, ":");\n+ }\n+\n+ /* Return the path we used, if caller wants it\n+ */\n+ if (ret_dir != NULL) *ret_dir = Strdup(s);\n+ free(path);\n+ \n+ return fp;\n+}\n+\n+\n+/* Function: FileExists()\n+ * \n+ * Purpose: Return TRUE if filename exists.\n+ * Testing fopen() is the only possible platform-independent test\n+ * I\'m aware of. \n+ */\n+int\n+FileExists(char *filename)\n+{\n+ FILE *fp;\n+ if ((fp = fopen(filename, "r"))) { fclose(fp); return TRUE; }\n+ return FALSE;\n+}\n+\n+\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/squid/getopt.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/squid/getopt.c Thu Jul 21 13:35:08 2011 -0400 |
[ |
b'@@ -0,0 +1,250 @@\n+/*****************************************************************\n+ * SQUID - a library of functions for biological sequence analysis\n+ * Copyright (C) 1992-2002 Washington University School of Medicine\n+ * \n+ * This source code is freely distributed under the terms of the\n+ * GNU General Public License. See the files COPYRIGHT and LICENSE\n+ * for details.\n+ *****************************************************************/\n+\n+/* RCS $Id: getopt.c 217 2011-03-19 10:27:10Z andreas $ (Original squid RCS Id: getopt.c,v 1.7 2001/02/21 21:09:10 eddy Exp)\n+ */\n+\n+#include <stdio.h>\n+#include <string.h>\n+#include <stdlib.h>\n+\n+#include "squid.h"\n+\n+/* Function: Getopt()\n+ * \n+ * Purpose: Portable command line option parsing with abbreviated\n+ * option switches. Replaces UNIX getopt(). Using UNIX getopt()\n+ * hinders portability to non-UNIX platforms, and getopt()\n+ * is also limited to single letter options.\n+ *\n+ * Getopt() implements a superset of UNIX getopt().\n+ * All of getopt()\'s single-character switch behavior\n+ * is emulated, and "--" by itself terminates the options.\n+ * Additionally, Getopt() provides extended switches\n+ * like "--youroptionhere", and Getopt() type checks\n+ * arguments. \n+ * \n+ * Extended options must start with "--", as in "--option1".\n+ * Normal options must start with "-", as in "-o".\n+ * Normal options may be concatenated, as in "-a -b" == "-ab".\n+ * \n+ * See bottom of this .c file after #fdef GETOPT_TESTDRIVER\n+ * for an example of calling Getopt().\n+ * \n+ * Args: argc - from main(). number of elems in argv.\n+ * argv - from main(). argv[0] is the name of the command.\n+ * opt - array of opt_s structures, defining option switches\n+ * nopts - number of switches in opt\n+ * usage - a (possibly long) string to print if usage error.\n+ * ret_optind - RETURN: the index in argv[] of the next \n+ * valid command-line token.\n+ * ret_optname- RETURN: ptr to the name of option switch \n+ * seen, or NULL if no option was seen.\n+ * ret_optarg - RETURN: ptr to the optional argument, if any;\n+ * NULL if option takes no argument.\n+ * \n+ * Return: 1 if a valid option was parsed.\n+ * 0 if no option was found, and command-line parsing is complete.\n+ * Die()\'s here if an error is detected.\n+ */\n+int\n+Getopt(int argc, char **argv, struct opt_s *opt, int nopts, char *usage,\n+ int *ret_optind, char **ret_optname, char **ret_optarg)\n+{\n+ int i;\n+ int arglen;\n+ int nmatch;\n+ static int optind = 1; /* init to 1 on first call */\n+ static char *optptr = NULL; /* ptr to next valid switch */\n+ int opti = 0;\t\t\t /* init only to silence gcc uninit warnings */\n+\n+ /* Check to see if we\'ve run out of options.\n+ * A \'-\' by itself is an argument (e.g. "read from stdin")\n+ * not an option.\n+ */\n+ if (optind >= argc || argv[optind][0] != \'-\' || strcmp(argv[optind], "-") == 0)\n+ { \n+ *ret_optind = optind; \n+ *ret_optarg = NULL; \n+ *ret_optname = NULL; \n+ return 0; \n+ }\n+\n+ /* Check to see if we\'re being told that this is the end\n+ * of the options with the special "--" flag.\n+ */\n+ if (strcmp(argv[optind], "--") == 0)\n+ { \n+ optind++;\n+ *ret_optind = optind; \n+ *ret_optname = NULL;\n+ *ret_optarg = NULL; \n+ return 0; \n+ }\n+\n+ /* We have a real option. Find which one it is.\n+ * We handle single letter switches "-o" separately\n+ * from full switches "--option", based on the "-" vs. "--"\n+ * prefix -- single letter switches can be concatenated\n+ * as long as they don\'t have arguments.\n+ */\n+\t\t\t\t/* full option */\n+ if (optptr == NULL && strncmp(argv[optind], '..b'd], \'=\')) != NULL)\n+\t{ *optptr = \'\\0\'; optptr++; }\n+\n+ arglen = strlen(argv[optind]);\n+ nmatch = 0;\n+ for (i = 0; i < nopts; i++)\n+\tif (opt[i].single == FALSE && \n+\t strncmp(opt[i].name, argv[optind], arglen) == 0)\n+\t { \n+\t nmatch++;\n+\t opti = i;\n+\t if (arglen == strlen(opt[i].name)) break; /* exact match, stop now */\n+\t }\n+ if (nmatch > 1 && arglen != strlen(opt[i].name)) \n+\tDie("Option \\"%s\\" is ambiguous; please be more specific.\\n%s",\n+\t argv[optind], usage);\n+ if (nmatch == 0)\n+\tDie("No such option \\"%s\\".\\n%s", argv[optind], usage);\n+\n+ *ret_optname = opt[opti].name;\n+\n+ /* Set the argument, if there is one\n+ */\n+ if (opt[opti].argtype != sqdARG_NONE) \n+\t{\n+\t if (optptr != NULL)\n+\t {\t\t\t/* --foo=666 style */\n+\t *ret_optarg = optptr;\n+\t optptr = NULL;\n+\t optind++;\n+\t }\n+\t else if (optind+1 >= argc)\n+\t Die("Option %s requires an argument\\n%s", opt[opti].name, usage);\n+\t else\t\t\t/* "--foo 666" style */\n+\t {\n+\t *ret_optarg = argv[optind+1];\n+\t optind+=2;\n+\t }\n+\t}\n+ else /* sqdARG_NONE */\n+\t{\n+\t if (optptr != NULL) \n+\t Die("Option %s does not take an argument\\n%s", opt[opti].name, usage);\n+\t *ret_optarg = NULL;\n+\t optind++;\n+\t}\n+ }\n+ else\t\t\t\t/* else, a single letter option "-o" */\n+ {\n+\t\t\t\t/* find the option */\n+ if (optptr == NULL) \n+\toptptr = argv[optind]+1;\n+ for (opti = -1, i = 0; i < nopts; i++)\n+\tif (opt[i].single == TRUE && *optptr == opt[i].name[1])\n+\t { opti = i; break; }\n+ if (opti == -1)\n+\tDie("No such option \\"%c\\".\\n%s", *optptr, usage);\n+ *ret_optname = opt[opti].name;\n+\n+\t\t\t\t/* set the argument, if there is one */\n+ if (opt[opti].argtype != sqdARG_NONE) \n+\t{\n+\t if (*(optptr+1) != \'\\0\') /* attached argument */\n+\t {\n+\t *ret_optarg = optptr+1;\n+\t optind++;\n+\t }\n+\t else if (optind+1 < argc) /* unattached argument */\n+\t {\n+\t *ret_optarg = argv[optind+1];\n+\t optind+=2;\t \n+\t }\n+\t else Die("Option %s requires an argument\\n%s", opt[opti].name, usage);\n+\n+\t optptr = NULL;\t/* can\'t concatenate after an argument */\n+\t}\n+ else /* sqdARG_NONE */\n+\t{\n+\t *ret_optarg = NULL;\n+\t if (*(optptr+1) != \'\\0\') /* concatenation */\n+\t optptr++; \n+\t else\n+\t {\n+\t optind++; /* move to next field */\n+\t optptr = NULL;\n+\t }\n+\t}\n+\n+ }\n+\n+ /* Type check the argument, if there is one\n+ */\n+ if (opt[opti].argtype != sqdARG_NONE) \n+ {\n+ if (opt[opti].argtype == sqdARG_INT && ! IsInt(*ret_optarg))\n+\tDie("Option %s requires an integer argument\\n%s",\n+\t opt[opti].name, usage);\n+ else if (opt[opti].argtype == sqdARG_FLOAT && ! IsReal(*ret_optarg))\n+\tDie("Option %s requires a numerical argument\\n%s",\n+\t opt[opti].name, usage);\n+ else if (opt[opti].argtype == sqdARG_CHAR && strlen(*ret_optarg) != 1)\n+\tDie("Option %s requires a single-character argument\\n%s",\n+\t opt[opti].name, usage);\n+ /* sqdARG_STRING is always ok, no type check necessary */\n+ }\n+\n+ *ret_optind = optind;\n+ return 1;\n+}\n+\n+\n+\n+#ifdef GETOPT_TESTDRIVER \n+/* cc -DGETOPT_TESTDRIVER -L ~/lib/squid.linux/ getopt.c -lsquid\n+ */\n+struct opt_s OPTIONS[] = {\n+ { "--test1", FALSE, sqdARG_INT },\n+ { "--test2", FALSE, sqdARG_FLOAT },\n+ { "--test3", FALSE, sqdARG_STRING },\n+ { "--test4", FALSE, sqdARG_CHAR },\n+ { "-a", TRUE, sqdARG_NONE },\n+ { "-b", TRUE, sqdARG_INT },\n+};\n+#define NOPTIONS (sizeof(OPTIONS) / sizeof(struct opt_s))\n+ \n+int\n+main(int argc, char **argv)\n+{\n+ int optind;\n+ char *optarg;\n+ char *optname;\n+\n+ while (Getopt(argc, argv, OPTIONS, NOPTIONS, "Usage/help here",\n+\t\t&optind, &optname, &optarg))\n+ {\n+ printf("Option: index: %d name: %s argument: %s\\n",\n+\t optind, optname, optarg);\n+ }\n+ while (optind < argc)\n+ {\n+ printf("Argument: index: %d name: %s\\n", optind, argv[optind]);\n+ optind++;\n+ }\n+\n+\n+}\n+\n+\n+#endif /*GETOPT_TESTDRIVER*/\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/squid/gki.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/squid/gki.c Thu Jul 21 13:35:08 2011 -0400 |
[ |
b'@@ -0,0 +1,389 @@\n+/*****************************************************************\n+ * SQUID - a library of functions for biological sequence analysis\n+ * Copyright (C) 1992-2002 Washington University School of Medicine\n+ * \n+ * This source code is freely distributed under the terms of the\n+ * GNU General Public License. See the files COPYRIGHT and LICENSE\n+ * for details.\n+ *****************************************************************/\n+\n+/* gki.c\n+ * SRE, Sat May 1 14:49:08 1999\n+ * \n+ * "generic key index" module: emulation of Perl hashes.\n+ * Maps keys (ASCII char strings) to array index. Dynamically\n+ * resizes the hash table. \n+ * \n+ * Limitations:\n+ * - hash table can only grow; no provision for deleting keys\n+ * or downsizing the hash table.\n+ * - Maximum hash table size set at 100003. Performance \n+ * will degrade for key sets much larger than this.\n+ * - Assumes that integers are 32 bits (or greater). \n+ * \n+ * Defines a typedef\'d structure:\n+ * gki - a key index hash table.\n+ * Provides functions:\n+ * GKIInit() - start a hash table.\n+ * GKIStoreKey() - store a new key, get a unique index. \n+ * GKIKeyIndex() - retrieve an existing key\'s index.\n+ * GKIFree() - free a hash table.\n+ * GKIStatus() - Debugging: prints internal status of a hash struct\n+ * \n+ *\n+ * Note that there are no dependencies on squid; the gki.c/gki.h\n+ * pair are base ANSI C and can be reused anywhere.\n+ *****************************************************************\n+ * \n+ * API for storing/reading stuff: \n+ * moral equivalent of Perl\'s $foo{$key} = whatever, $bar{$key} = whatever:\n+ * #include "gki.h"\n+ * \n+ * gki *hash;\n+ * int idx;\n+ * char *key;\n+ * \n+ * hash = GKIInit();\n+ * (Storing:) \n+ * (foreach key) {\n+ * idx = GKIStoreKey(hash, key); \n+ * (reallocate foo, bar as needed)\n+ * foo[idx] = whatever;\n+ * bar[idx] = whatever;\n+ * } \n+ * (Reading:)\n+ * (foreach key) {\n+ * idx = GKIKeyIndex(hash, key);\n+ * if (idx == -1) {no_such_key; }\n+ * (do something with) foo[idx];\n+ * (do something with) bar[idx];\n+ * } \n+ * GKIFree();\n+ * \n+ *****************************************************************\n+ *\n+ * Timings on wrasse for 45402 keys in /usr/dict/words using\n+ * Tests/test_gki: \n+ * 250 msec store (6 usec/store)\n+ * 140 msec retrieve (3 usec/retrieve)\n+ * and using the 13408 names of Pfam\'s GP120.full alignment:\n+ * 70 msec store (5 usec/store)\n+ * 50 msec retrieve (4 usec/retrieve) \n+ * \n+ * RCS $Id: gki.c 217 2011-03-19 10:27:10Z andreas $ (Original squid RCS Id: gki.c,v 1.3 2000/12/21 23:42:59 eddy Exp)\n+ */\n+\n+\n+\n+#include <stdio.h>\n+#include <stdlib.h>\n+#include <string.h>\n+#include <limits.h>\n+#include "squid.h"\n+#include "gki.h"\n+\n+/* \n+ * Best hash table sizes are prime numbers (see Knuth vol 3, Sorting\n+ * and Searching). \n+ * gki_primes[] defines the ascending order of hash table sizes\n+ * that we use in upsizing the hash table dynamically.\n+ * useful site for testing primes:\n+ * http://www.idbsu.edu/people/jbrennan/algebra/numbers/sieve.html\n+ * Because of the way gki_hashvalue works, the largest number\n+ * must be < INT_MAX / 128 / 128 : 131072 on a 32 bit machine.\n+ */\n+static int gki_primes[] = { 101, 1009, 10007, 100003 };\n+#define GKI_NPRIMES 4\n+#define GKI_ALPHABETSIZE 128\n+\n+static GKI *gki_alloc(int primelevel);\n+static int gki_hashvalue(GKI *hash, char *key);\n+static int gki_upsize(GKI *old);\n+\n+\n+/* Function: GKIInit()\n+ * Date: SRE, Sat May 1 11:12:24 1999 [May Day geek-out]\n+ *\n+ * Purpose: Initialize a hash table for key indexing. \n+ * Simply a wrapper around a level 0 gki_alloc().\n+ *\n+ * Args: (void)\n+ *\n+ * Returns: An allocated hash table structure.\n+ * '..b'->nxt)\n+\tnkeys++;\n+\n+ if (nkeys == 0) nempty++;\n+ if (nkeys > maxkeys) maxkeys = nkeys;\n+ if (nkeys < minkeys) minkeys = nkeys;\n+ }\n+\n+ printf("Total keys: %d\\n", hash->nkeys);\n+ printf("Hash table size: %d\\n", hash->nhash);\n+ printf("Average occupancy: %.1f\\n", (float) hash->nkeys / (float) hash->nhash);\n+ printf("Unoccupied slots: %d\\n", nempty);\n+ printf("Most in one slot: %d\\n", maxkeys);\n+ printf("Least in one slot: %d\\n", minkeys);\n+ \n+}\n+\n+\n+/* Function: gki_alloc()\n+ * Date: SRE, Sat May 1 11:55:47 1999 [May Day geek-out]\n+ *\n+ * Purpose: Allocate a hash table structure with the\n+ * size given by primelevel.\n+ *\n+ * Args: primelevel - level 0..GKI_NPRIMES-1, specifying\n+ * the size of the table; see gki_primes[]\n+ * array.\n+ *\n+ * Returns: An allocated hash table structure. \n+ * Caller frees with GKIFree().\n+ */\n+static GKI *\n+gki_alloc(int primelevel)\n+{\n+ GKI *hash;\n+ int i;\n+\n+ if (primelevel < 0 || primelevel >= GKI_NPRIMES) \n+ Die("bad primelevel in gki_alloc()");\n+ hash = MallocOrDie(sizeof(GKI));\n+\n+ hash->primelevel = primelevel;\n+ hash->nhash = gki_primes[hash->primelevel];\n+ hash->table = MallocOrDie(sizeof(struct gki_elem) * hash->nhash);\n+ for (i = 0; i < hash->nhash; i++)\n+ hash->table[i] = NULL;\n+ hash->nkeys = 0;\n+ return hash;\n+} \n+\n+\n+/* Function: gki_hashvalue()\n+ * Date: SRE, Sat May 1 11:14:10 1999 [May Day geek-out]\n+ *\n+ * Purpose: Calculate the hash value for a key. Usually\n+ * we expect a one-word key, but the function will\n+ * hash any ASCII string effectively. The hash function\n+ * is a simple one (see p. 233 of Sedgewick,\n+ * Algorithms in C).\n+ * Slightly optimized: does two characters at a time\n+ * before doing the modulo; this gives us a significant\n+ * speedup. \n+ *\n+ * Args: hash - the gki structure (we need to know the hash table size)\n+ * key - a string to calculate the hash value for \n+ *\n+ * Returns: a hash value, in the range 0..hash->nhash-1.\n+ * hash table is unmodified.\n+ */\n+static int\n+gki_hashvalue(GKI *hash, char *key)\n+{\n+ int val = 0;\n+\n+ for (; *key != \'\\0\'; key++)\n+ {\n+ val = GKI_ALPHABETSIZE*val + *key; \n+ if (*(++key) == \'\\0\') { val = val % hash->nhash; break; }\n+ val = (GKI_ALPHABETSIZE*val + *key) % hash->nhash;\n+ }\n+ return val;\n+}\n+\n+/* Function: gki_upsize()\n+ * Date: SRE, Sat May 1 11:46:07 1999 [May Day geek-out]\n+ *\n+ * Purpose: Grow the hash table to the next available size.\n+ *\n+ * Args: old - the GKI hash table to reallocate.\n+ *\n+ * Returns: 1 on success (the hash table is changed);\n+ * 0 on failure; the table is already at its maximum size,\n+ * and the hash table is returned unchanged.\n+ */\n+static int\n+gki_upsize(GKI *old)\n+{\n+ GKI *new;\n+ int i;\n+ struct gki_elem *optr;\n+ struct gki_elem *nptr;\n+ int val;\n+\n+ if (old->primelevel >= GKI_NPRIMES-1) return 0;\n+ new = gki_alloc(old->primelevel+1);\n+\n+ /* Read the old, store in the new, while *not changing*\n+ * any key indices. Because of the way the lists are\n+ * treated as LIFO stacks, all the lists are reversed \n+ * in the new structure.\n+ */\n+ for (i = 0; i < old->nhash; i++)\n+ {\n+ optr = old->table[i];\n+ while (optr != NULL)\n+\t{\n+\t val = gki_hashvalue(new, optr->key);\n+\n+\t nptr = new->table[val];\n+\t new->table[val] = optr;\n+\t optr = optr->nxt;\n+\t new->table[val]->nxt = nptr;\n+\t}\n+ }\n+ free(old->table);\n+\n+ /* Now swap within the interior of the structures, so the old\n+ * structure is updated to the new structure.\n+ * (nkeys is identical, so we don\'t need to swap that element.)\n+ */\n+ old->primelevel = new->primelevel;\n+ old->nhash = new->nhash;\n+ old->table = new->table;\n+ free(new);\n+ return 1;\n+}\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/squid/gki.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/squid/gki.h Thu Jul 21 13:35:08 2011 -0400 |
b |
@@ -0,0 +1,50 @@ +/***************************************************************** + * SQUID - a library of functions for biological sequence analysis + * Copyright (C) 1992-2002 Washington University School of Medicine + * + * This source code is freely distributed under the terms of the + * GNU General Public License. See the files COPYRIGHT and LICENSE + * for details. + *****************************************************************/ + +#ifndef SQUID_GKI_INCLUDED +#define SQUID_GKI_INCLUDED + +/* gki.h + * SRE, Sat May 1 15:07:22 1999 + * + * Declarations of structures, functions for generic key index + * module: emulation of Perl hashes. See gki.c. + * + * RCS $Id: gki.h 217 2011-03-19 10:27:10Z andreas $ (Original squid RCS Id: gki.h,v 1.2 1999/07/15 22:30:45 eddy Exp) + */ + +/* gki_elem: + * key, array index pairs are kept in linked list structures. + */ +struct gki_elem { + char *key; + int idx; + struct gki_elem *nxt; +}; + +/* gki: + * a dynamically resized hash structure; + * contains a hash table and associated data + */ +typedef struct { + struct gki_elem **table; + + int primelevel; + int nhash; + int nkeys; +} GKI; + +GKI *GKIInit(void); +void GKIFree(GKI *hash); +int GKIHashValue(GKI *hash, char *key); +int GKIStoreKey(GKI *hash, char *key); +int GKIKeyIndex(GKI *hash, char *key); +void GKIStatus(GKI *hash); + +#endif /* SQUID_GKI_INCLUDED */ |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/squid/gsi.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/squid/gsi.c Thu Jul 21 13:35:08 2011 -0400 |
[ |
b'@@ -0,0 +1,387 @@\n+/*****************************************************************\n+ * SQUID - a library of functions for biological sequence analysis\n+ * Copyright (C) 1992-2002 Washington University School of Medicine\n+ * \n+ * This source code is freely distributed under the terms of the\n+ * GNU General Public License. See the files COPYRIGHT and LICENSE\n+ * for details.\n+ *****************************************************************/\n+\n+/* gsi.c\n+ * Interfaces for GSI "generic sequence index" files.\n+ * broken away from sqio.c and extended: SRE, Wed Aug 5 10:32:53 1998\n+ * \n+ * \n+ * GSI definition: \n+ * 1 + <nfiles> + <nkeys> total records.\n+ * Each record = 38 bytes.\n+ *\n+ * one header record : <"GSI" (32)> <nfiles (2)> <nkeys (4)> \n+ * <nfiles> file records : <filename (32)> <fileno (2)> <fmt (4)> \n+ * <nkeys> key records : <key (32)> <fileno (2)> <offset(4)> \n+ *\n+ * Matches up with my Perl scripts that create GSI files.\n+ * \n+ * RCS $Id: gsi.c 217 2011-03-19 10:27:10Z andreas $ (Original squid RCS Id: gsi.c,v 1.5 2001/08/04 20:15:42 eddy Exp)\n+ */\n+\n+#include <stdio.h>\n+#include <stdlib.h>\n+#include <string.h>\n+#ifndef SEEK_SET\n+#include <unistd.h>\t/* needed for poor crippled SunOS */\n+#endif\n+\n+#include "squid.h"\n+#include "gsi.h"\n+\n+\n+/*****************************************************************\n+ * GSI index file access routines\n+ *****************************************************************/\n+\n+/* Function: GSIOpen()\n+ * \n+ * Purpose: Open a GSI file. Returns the number of records in\n+ * the file and a file pointer. Returns NULL on failure.\n+ * The file pointer should be fclose()\'d normally.\n+ */\n+GSIFILE *\n+GSIOpen(char *gsifile)\n+{\n+ GSIFILE *gsi;\n+ char magic[GSI_KEYSIZE];\n+\n+ gsi = (GSIFILE *) MallocOrDie (sizeof(GSIFILE));\n+ if ((gsi->gsifp = fopen(gsifile, "r")) == NULL)\n+ { free(gsi); squid_errno = SQERR_NOFILE; return NULL; }\n+\n+ if (! fread(magic, sizeof(char), GSI_KEYSIZE, gsi->gsifp))\n+ { free(gsi); squid_errno = SQERR_NODATA; return NULL; }\n+ if (strcmp(magic, "GSI") != 0) \n+ { free(gsi); squid_errno = SQERR_FORMAT; return NULL; }\n+\n+ if (! fread(&(gsi->nfiles), sizeof(sqd_uint16), 1, gsi->gsifp))\n+ { free(gsi); squid_errno = SQERR_NODATA; return NULL; }\n+ if (! fread(&(gsi->recnum), sizeof(sqd_uint32), 1, gsi->gsifp))\n+ { free(gsi); squid_errno = SQERR_NODATA; return NULL; }\n+\n+ gsi->nfiles = sre_ntoh16(gsi->nfiles); /* convert from network short */\n+ gsi->recnum = sre_ntoh32(gsi->recnum); /* convert from network long */\n+\n+ return gsi;\n+}\n+\n+/* Function: GSIGetRecord()\n+ * \n+ * Purpose: Each non-header record of a GSI index files consists\n+ * of 38 bytes: 32 bytes of character string, a 2 byte\n+ * short, and a 4 byte long. This function returns the\n+ * three values.\n+ * \n+ * Args: gsi - open GSI index file, correctly positioned at a record\n+ * f1 - char[32], allocated by caller (or NULL if unwanted)\n+ * f2 - pointer to short (or NULL if unwanted)\n+ * f3 - pointer to long (or NULL if unwanted)\n+ * \n+ * Return: 0 on failure and sets squid_errno. \n+ */\n+int\n+GSIGetRecord(GSIFILE *gsi, char *f1, sqd_uint16 *f2, sqd_uint32 *f3)\n+{\n+ if (f1 == NULL) fseek(gsi->gsifp, GSI_KEYSIZE, SEEK_CUR);\n+ else if (! fread(f1, GSI_KEYSIZE, 1, gsi->gsifp))\n+ { squid_errno = SQERR_NODATA; return 0; }\n+\n+ if (f2 == NULL) fseek(gsi->gsifp, sizeof(sqd_uint16), SEEK_CUR);\n+ else if (! fread(f2, sizeof(sqd_uint16), 1, gsi->gsifp))\n+ { squid_errno = SQERR_NODATA; return 0; }\n+\n+ if (f3 == NULL) fseek(gsi->gsifp, sizeof(sqd_uint32), SEEK_CUR);\n+ else if (! fread(f3, sizeof(sqd_uint32), 1, gsi->gsifp))\n+ { squid_errno = SQERR_NODATA; return 0; }\n+\n+ if (f2 != NULL) *f2 = sre_ntoh16(*f2);\n+ if (f3 != NULL) *f3 = sre_ntoh32(*f3);\n+\n+ return 1;\n+}\n+\n+\n+/* Function: GSIGetOffset()\n+ * \n+'..b'ms = ReallocOrDie(g->elems, sizeof(struct gsikey_s) * (g->nkeys + 100));\n+}\n+static int \n+gsi_keysorter(const void *k1, const void *k2)\n+{\n+ struct gsikey_s *key1;\n+ struct gsikey_s *key2;\n+ key1 = (struct gsikey_s *) k1;\n+ key2 = (struct gsikey_s *) k2;\n+ return strcmp(key1->key, key2->key);\n+}\n+void\n+GSISortIndex(struct gsiindex_s *g)\n+{\n+ qsort((void *) g->elems, g->nkeys, sizeof(struct gsikey_s), gsi_keysorter); \n+}\n+void\n+GSIWriteIndex(FILE *fp, struct gsiindex_s *g)\n+{\n+ sqd_uint32 i;\n+\n+ /* Range checking.\n+ */\n+ /* AW: gcc says: comparison always false die to limited range of data type */\n+#ifndef CLUSTALO\n+ if (g->nfiles > SQD_UINT16_MAX) Die("Too many files in GSI index.");\n+#endif\n+ if (g->nkeys > SQD_UINT32_MAX) Die("Too many keys in GSI index.");\n+\n+ GSIWriteHeader(fp, g->nfiles, g->nkeys);\n+ for (i = 0; i < g->nfiles; i++)\n+ GSIWriteFileRecord(fp, g->filenames[i], i+1, g->fmt[i]);\n+ for (i = 0; i < g->nkeys; i++)\n+ GSIWriteKeyRecord(fp, g->elems[i].key, g->elems[i].filenum, g->elems[i].offset);\n+}\n+\n+\n+\n+\n+\n+/* Function: GSIWriteHeader()\n+ * Date: SRE, Wed Aug 5 10:36:02 1998 [St. Louis]\n+ *\n+ * Purpose: Write the first record to an open GSI file:\n+ * "GSI" <nfiles> <nkeys>\n+ *\n+ * Args: fp - open file to write to.\n+ * nfiles - number of files indexed\n+ * nkeys - number of keys indexed \n+ *\n+ * Returns: void\n+ */\n+void\n+GSIWriteHeader(FILE *fp, int nfiles, long nkeys)\n+{\n+ char key[GSI_KEYSIZE];\n+ sqd_uint16 f1;\n+ sqd_uint32 f2;\n+\n+ /* beware potential range errors!\n+ */\n+ if (nfiles > SQD_UINT16_MAX) Die("GSI: nfiles out of range");\n+ if (nkeys > SQD_UINT32_MAX) Die("GSI: nkeys out of range");\n+\n+ f1 = (sqd_uint16) nfiles;\n+ f2 = (sqd_uint32) nkeys;\n+ f1 = sre_hton16(f1);\n+ f2 = sre_hton32(f2);\n+ strcpy(key, "GSI");\n+\n+ if (fwrite(key, 1, GSI_KEYSIZE, fp) < GSI_KEYSIZE) PANIC;\n+ if (fwrite(&f1, 2, 1, fp) < 1) PANIC;\n+ if (fwrite(&f2, 4, 1, fp) < 1) PANIC;\n+}\n+\n+\n+/* Function: GSIWriteFileRecord()\n+ * Date: SRE, Wed Aug 5 10:45:51 1998 [St. Louis]\n+ *\n+ * Purpose: Write a file record to an open GSI file.\n+ *\n+ * Args: fp - open GSI file\n+ * fname - file name (max 31 characters)\n+ * idx - file number\n+ * fmt - file format (e.g. kPearson, etc.)\n+ *\n+ * Returns: 0 on failure. 1 on success.\n+ */\n+int\n+GSIWriteFileRecord(FILE *fp, char *fname, int idx, int fmt)\n+{\n+ sqd_uint16 f1;\n+ sqd_uint32 f2;\n+\n+ if (strlen(fname) >= GSI_KEYSIZE) return 0;\n+ if (idx > SQD_UINT16_MAX) Die("GSI: file index out of range");\n+ if (fmt > SQD_UINT32_MAX) Die("GSI: format index out of range");\n+\n+ f1 = (sqd_uint16) idx;\n+ f2 = (sqd_uint32) fmt;\n+ f1 = sre_hton16(f1);\n+ f2 = sre_hton32(f2);\n+\n+ if (fwrite(fname, 1, GSI_KEYSIZE, fp) < GSI_KEYSIZE) PANIC;\n+ if (fwrite(&f1, 2, 1, fp) < 1) PANIC;\n+ if (fwrite(&f2, 4, 1, fp) < 1) PANIC;\n+ return 1;\n+}\n+\n+\n+/* Function: GSIWriteKeyRecord()\n+ * Date: SRE, Wed Aug 5 10:52:30 1998 [St. Louis]\n+ *\n+ * Purpose: Write a key record to a GSI file.\n+ *\n+ * Args: fp - open GSI file for writing\n+ * key - key (max 31 char + \\0)\n+ * fileidx - which file number to find this key in\n+ * offset - offset for this key \n+ * \n+ * Returns: 1 on success, else 0.\n+ * will fail if key >= 32 chars, for instance.\n+ */\n+int\n+GSIWriteKeyRecord(FILE *fp, char *key, int fileidx, long offset)\n+{\n+ sqd_uint16 f1;\n+ sqd_uint32 f2;\n+\n+ if (strlen(key) >= GSI_KEYSIZE) return 0;\n+ if (fileidx > SQD_UINT16_MAX) Die("GSI: file index out of range");\n+ if (offset > SQD_UINT32_MAX) Die("GSI: offset out of range");\n+\n+ f1 = (sqd_uint16) fileidx;\n+ f2 = (sqd_uint32) offset;\n+ f1 = sre_hton16(f1);\n+ f2 = sre_hton32(f2);\n+ \n+ if (fwrite(key, 1, GSI_KEYSIZE, fp) < GSI_KEYSIZE) PANIC;\n+ if (fwrite(&f1, 2, 1, fp) < 1) PANIC;\n+ if (fwrite(&f2, 4, 1, fp) < 1) PANIC;\n+ return 1;\n+}\n+\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/squid/gsi.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/squid/gsi.h Thu Jul 21 13:35:08 2011 -0400 |
[ |
@@ -0,0 +1,84 @@ +/***************************************************************** + * SQUID - a library of functions for biological sequence analysis + * Copyright (C) 1992-2002 Washington University School of Medicine + * + * This source code is freely distributed under the terms of the + * GNU General Public License. See the files COPYRIGHT and LICENSE + * for details. + *****************************************************************/ + +#ifndef GSIH_INCLUDED +#define GSIH_INCLUDED + +/* gsi.h + * Database indexing (GSI format support) + * RCS $Id: gsi.h 217 2011-03-19 10:27:10Z andreas $ (Original squid RCS Id: gsi.h,v 1.3 2001/08/04 20:15:42 eddy Exp) + * + * A GSI (generic sequence index) file is composed of + * recnum + nfiles + 1 records. Each record contains + * three fields; key, file number, and disk offset. + * Record 0 contains: + * [ "GSI" ] [ nfiles ] [ recnum ] + * Records 1..nfiles map file names to file numbers, and contain: + * [ filename ] [ file number, 1..nfiles ] [ 0 (unused) ] + * Records nfiles+1 to recnum+nfiles+1 provide disk offset + * and file number indices for every key: + * [ key ] [ file number ] [ offset] + * + * Because the file is binary, we take some (but not + * complete) care to improve portability amongst platforms. + * This means using network order integers (see ntohl()) + * and defining types for 16 and 32 bit integers. + * + * Because we use 32-bit offsets, ftell(), and fseek(), + * there is an implicit 2 Gb file size maximum. + * AFAIK neither ANSI C nor POSIX provide a portable solution + * to this problem. fsetpos(), fgetpos() use an + * opaque fpos_t datatype that we can't write portably + * to a disk file. Suggestions welcomed. + */ +#define GSI_KEYSIZE 32 /* keys are 32 bytes long */ +#define GSI_RECSIZE 38 /* 32 + 2 + 4 bytes */ +#define SQD_UINT16_MAX 65535 /* 2^16-1 */ +#define SQD_UINT32_MAX 4294967295U/* 2^32-1 */ + +struct gsi_s { + FILE *gsifp; /* open GSI index file */ + sqd_uint16 nfiles; /* number of files = 16 bit int */ + sqd_uint32 recnum; /* number of records = 32 bit int */ +}; +typedef struct gsi_s GSIFILE; + +struct gsikey_s { + char key[GSI_KEYSIZE]; + sqd_uint16 filenum; + sqd_uint32 offset; +}; +struct gsiindex_s { + char **filenames; + int *fmt; + sqd_uint16 nfiles; + + struct gsikey_s *elems; + int nkeys; +}; + + +/* from gsi.c + */ +extern GSIFILE *GSIOpen(char *gsifile); +extern int GSIGetRecord(GSIFILE *gsi, char *f1, sqd_uint16 *f2, sqd_uint32 *f3); +extern int GSIGetOffset(GSIFILE *gsi, char *key, char *sqfile, + int *fmt, long *ret_offset); +extern void GSIClose(GSIFILE *gsi); +extern struct gsiindex_s *GSIAllocIndex(void); +extern void GSIFreeIndex(struct gsiindex_s *g); +extern void GSIAddFileToIndex(struct gsiindex_s *g, char *filename, int fmt); +extern void GSIAddKeyToIndex(struct gsiindex_s *g, char *key, int filenum, long offset); +extern void GSISortIndex(struct gsiindex_s *g); +extern void GSIWriteIndex(FILE *fp, struct gsiindex_s *g); +extern void GSIWriteHeader(FILE *fp, int nfiles, long nkeys); +extern int GSIWriteFileRecord(FILE *fp, char *fname, int idx, int fmt); +extern int GSIWriteKeyRecord(FILE *fp, char *key, int fileidx, long offset); + +#endif /*GSIH_INCLUDED*/ |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/squid/gsi64.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/squid/gsi64.c Thu Jul 21 13:35:08 2011 -0400 |
[ |
b'@@ -0,0 +1,394 @@\n+/*****************************************************************\n+ * SQUID - a library of functions for biological sequence analysis\n+ * Copyright (C) 1992-2002 Washington University School of Medicine\n+ * \n+ * This source code is freely distributed under the terms of the\n+ * GNU General Public License. See the files COPYRIGHT and LICENSE\n+ * for details.\n+ *****************************************************************/ \n+#ifdef USE_GSI64\n+\n+/* gsi64.c\n+ * Updated interfaces for GSI64 64-bit "generic sequence index" files.\n+ * See gsi.c for old interfaces.\n+ * This is a temporary hack! Needed for human genome project.\n+ */\n+\n+/* 1 + <nfiles> + <nkeys> total records.\n+ * Each record = 42 bytes.\n+ *\n+ * one header record : <"GSI64" (32)> <nfiles (2)> <nkeys (8)> \n+ * <nfiles> file records : <filename (32)> <fileno (2)> <fmt (8)> \n+ * <nkeys> key records : <key (32)> <fileno (2)> <offset(8)> \n+ * \n+ * CVS $Id: gsi64.c,v 1.2 2000/12/21 23:42:59 eddy Exp)\n+ */\n+\n+#include <stdio.h>\n+#include <stdlib.h>\n+#include <string.h>\n+#ifndef SEEK_SET\n+#include <unistd.h>\t/* needed for poor crippled SunOS */\n+#endif\n+\n+#include "squid.h"\n+#include "gsi64.h"\n+\n+/*****************************************************************\n+ * GSI64 index file access routines\n+ *****************************************************************/\n+\n+/* Function: GSI64Open()\n+ * \n+ * Purpose: Open a GSI64 file. Returns the number of records in\n+ * the file and a file pointer. Returns NULL on failure.\n+ * The file pointer should be fclose()\'d normally.\n+ */\n+GSI64FILE *\n+GSI64Open(char *gsifile)\n+{\n+ GSI64FILE *gsi;\n+ char magic[GSI64_KEYSIZE];\n+\n+ gsi = (GSI64FILE *) MallocOrDie (sizeof(GSI64FILE));\n+ if ((gsi->gsifp = fopen(gsifile, "r")) == NULL)\n+ { free(gsi); squid_errno = SQERR_NOFILE; return NULL; }\n+\n+ if (! fread(magic, sizeof(char), GSI64_KEYSIZE, gsi->gsifp))\n+ { free(gsi); squid_errno = SQERR_NODATA; return NULL; }\n+ if (strcmp(magic, "GSI64") != 0) \n+ { free(gsi); squid_errno = SQERR_FORMAT; return NULL; }\n+\n+ if (! fread(&(gsi->nfiles), sizeof(sqd_uint16), 1, gsi->gsifp))\n+ { free(gsi); squid_errno = SQERR_NODATA; return NULL; }\n+ if (! fread(&(gsi->recnum), sizeof(sqd_uint64), 1, gsi->gsifp))\n+ { free(gsi); squid_errno = SQERR_NODATA; return NULL; }\n+\n+#if 0\t\t\t/* HACK! we don\'t byteswap */\n+ gsi->nfiles = sre_ntohs(gsi->nfiles); /* convert from network short */\n+ gsi->recnum = sre_ntohl(gsi->recnum); /* convert from network long */\n+#endif\n+\n+ return gsi;\n+}\n+\n+/* Function: GSI64GetRecord()\n+ * \n+ * Purpose: Each non-header record of a GSI64 index file consists\n+ * of 42 bytes: 32 bytes of character string, a 2 byte\n+ * short, and an 8 byte long long. This function returns the\n+ * three values.\n+ * \n+ * Args: gsi - open GSI64 index file, correctly positioned at a record\n+ * f1 - char[32], allocated by caller (or NULL if unwanted)\n+ * f2 - pointer to short (or NULL if unwanted)\n+ * f3 - pointer to long long (or NULL if unwanted)\n+ * \n+ * Return: 0 on failure and sets squid_errno. \n+ */\n+int\n+GSI64GetRecord(GSI64FILE *gsi, char *f1, sqd_uint16 *f2, sqd_uint64 *f3)\n+{\n+ if (f1 == NULL) fseek64(gsi->gsifp, GSI64_KEYSIZE, SEEK_CUR);\n+ else if (! fread(f1, GSI64_KEYSIZE, 1, gsi->gsifp))\n+ { squid_errno = SQERR_NODATA; return 0; }\n+\n+ if (f2 == NULL) fseek64(gsi->gsifp, sizeof(sqd_uint16), SEEK_CUR);\n+ else if (! fread(f2, sizeof(sqd_uint16), 1, gsi->gsifp))\n+ { squid_errno = SQERR_NODATA; return 0; }\n+\n+ if (f3 == NULL) fseek64(gsi->gsifp, sizeof(sqd_uint64), SEEK_CUR);\n+ else if (! fread(f3, sizeof(sqd_uint64), 1, gsi->gsifp))\n+ { squid_errno = SQERR_NODATA; return 0; }\n+\n+#if 0 /* no byteswap yet! HACK! */\n+ if (f2 != NULL) *f2 = sre_ntohs(*f2);\n+ if (f3 != NULL) *f3 = sre_ntohl(*f3);\n+#endif \n+\n+ r'..b'oid *k2)\n+{\n+ struct gsi64key_s *key1;\n+ struct gsi64key_s *key2;\n+ key1 = (struct gsi64key_s *) k1;\n+ key2 = (struct gsi64key_s *) k2;\n+ return strcmp(key1->key, key2->key);\n+}\n+void\n+GSI64SortIndex(struct gsi64index_s *g)\n+{\n+ qsort((void *) g->elems, g->nkeys, sizeof(struct gsi64key_s), gsi_keysorter); \n+}\n+void\n+GSI64WriteIndex(FILE *fp, struct gsi64index_s *g)\n+{\n+ sqd_uint16 i;\n+ sqd_uint64 j;\n+\n+ /* Range checking.\n+ */\n+ if (g->nfiles > SQD_UINT16_MAX) Die("Too many files in GSI64 index.");\n+ if (g->nkeys > SQD_UINT64_MAX) Die("Too many keys in GSI64 index.");\n+\n+ GSI64WriteHeader(fp, g->nfiles, g->nkeys);\n+ for (i = 0; i < g->nfiles; i++)\n+ GSI64WriteFileRecord(fp, g->filenames[i], i+1, g->fmt[i]);\n+ for (j = 0; j < g->nkeys; j++)\n+ GSI64WriteKeyRecord(fp, g->elems[j].key, g->elems[j].filenum, g->elems[j].offset);\n+}\n+\n+\n+\n+\n+\n+/* Function: GSI64WriteHeader()\n+ * Date: SRE, Wed Aug 5 10:36:02 1998 [St. Louis]\n+ *\n+ * Purpose: Write the first record to an open GSI64 file:\n+ * "GSI64" <nfiles> <nkeys>\n+ *\n+ * Args: fp - open file to write to.\n+ * nfiles - number of files indexed\n+ * nkeys - number of keys indexed \n+ *\n+ * Returns: void\n+ */\n+void\n+GSI64WriteHeader(FILE *fp, int nfiles, long long nkeys)\n+{\n+ char key[GSI64_KEYSIZE];\n+ sqd_uint16 f1;\n+ sqd_uint64 f2;\n+\n+ /* beware potential range errors!\n+ */\n+ if (nfiles > SQD_UINT16_MAX) Die("GSI64: nfiles out of range");\n+ if (nkeys > SQD_UINT64_MAX) Die("GSI64: nkeys out of range");\n+\n+ f1 = (sqd_uint16) nfiles;\n+ f2 = (sqd_uint64) nkeys;\n+#if 0 /* HACK no byteswap */\n+ f1 = sre_htons(f1);\n+ f2 = sre_htonl(f2);\n+#endif\n+ strcpy(key, "GSI64");\n+\n+ if (fwrite(key, 1, GSI64_KEYSIZE, fp) < GSI64_KEYSIZE) PANIC;\n+ if (fwrite(&f1, 2, 1, fp) < 1) PANIC;\n+ if (fwrite(&f2, 8, 1, fp) < 1) PANIC;\n+}\n+\n+\n+/* Function: GSI64WriteFileRecord()\n+ * Date: SRE, Wed Aug 5 10:45:51 1998 [St. Louis]\n+ *\n+ * Purpose: Write a file record to an open GSI64 file.\n+ *\n+ * Args: fp - open GSI64 file\n+ * fname - file name (max 31 characters)\n+ * idx - file number\n+ * fmt - file format (e.g. kPearson, etc.)\n+ *\n+ * Returns: 0 on failure. 1 on success.\n+ */\n+int\n+GSI64WriteFileRecord(FILE *fp, char *fname, int idx, int fmt)\n+{\n+ sqd_uint16 f1;\n+ sqd_uint64 f2;\n+\n+ if (strlen(fname) >= GSI64_KEYSIZE) return 0;\n+ if (idx > SQD_UINT16_MAX) Die("GSI64: file index out of range");\n+ if (fmt > SQD_UINT64_MAX) Die("GSI64: format index out of range");\n+\n+ f1 = (sqd_uint16) idx;\n+ f2 = (sqd_uint64) fmt;\n+#if 0 /* hack : no byteswap */\n+ f1 = sre_htons(f1);\n+ f2 = sre_htonl(f2);\n+#endif\n+\n+ if (fwrite(fname, 1, GSI64_KEYSIZE, fp) < GSI64_KEYSIZE) PANIC;\n+ if (fwrite(&f1, 2, 1, fp) < 1) PANIC;\n+ if (fwrite(&f2, 8, 1, fp) < 1) PANIC;\n+ return 1;\n+}\n+\n+\n+/* Function: GSI64WriteKeyRecord()\n+ * Date: SRE, Wed Aug 5 10:52:30 1998 [St. Louis]\n+ *\n+ * Purpose: Write a key record to a GSI64 file.\n+ *\n+ * Args: fp - open GSI64 file for writing\n+ * key - key (max 31 char + \\0)\n+ * fileidx - which file number to find this key in\n+ * offset - offset for this key \n+ * \n+ * Returns: 1 on success, else 0.\n+ * will fail if key >= 32 chars, for instance.\n+ */\n+int\n+GSI64WriteKeyRecord(FILE *fp, char *key, int fileidx, long long offset)\n+{\n+ sqd_uint16 f1;\n+ sqd_uint64 f2;\n+\n+ if (strlen(key) >= GSI64_KEYSIZE) return 0;\n+ if (fileidx > SQD_UINT16_MAX) Die("GSI64: file index out of range");\n+ if (offset > SQD_UINT64_MAX) Die("GSI64: offset out of range");\n+\n+ f1 = (sqd_uint16) fileidx;\n+ f2 = (sqd_uint64) offset;\n+#if 0 /* HACK! */\n+ f1 = sre_htons(f1);\n+ f2 = sre_htonl(f2);\n+#endif \n+ \n+ if (fwrite(key, 1, GSI64_KEYSIZE, fp) < GSI64_KEYSIZE) PANIC;\n+ if (fwrite(&f1, 2, 1, fp) < 1) PANIC;\n+ if (fwrite(&f2, 8, 1, fp) < 1) PANIC;\n+ return 1;\n+}\n+\n+#endif /*USE_GSI64 */\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/squid/gsi64.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/squid/gsi64.h Thu Jul 21 13:35:08 2011 -0400 |
[ |
@@ -0,0 +1,95 @@ +/***************************************************************** + * @LICENSE@ + *****************************************************************/ + +#ifndef GSI64H_INCLUDED +#define GSI64H_INCLUDED +#ifdef USE_GSI64 + +/* gsi64.h + * Database indexing (GSI64 format support) + * CVS $Id: gsi64.h,v 1.2 2000/12/21 23:42:59 eddy Exp) + * + * A GSI64 (generic sequence index, 64 bit hack) file is composed of + * recnum + nfiles + 1 records. Each record contains + * three fields; key, file number, and disk offset. + * Record 0 contains: + * [ "GSI64" ] [ nfiles ] [ recnum ] + * Records 1..nfiles map file names to file numbers, and contain: + * [ filename ] [ file number, 1..nfiles ] [ 0 (unused) ] + * Records nfiles+1 to recnum+nfiles+1 provide disk offset + * and file number indices for every key: + * [ key ] [ file number ] [ offset] + * + * Because the file is binary, we take some (but not + * complete) care to improve portability amongst platforms. + * This means using network order integers (see ntohl()) + * and defining types for 16 and 64 bit integers. + * + * A short test program that verifies the sizes of these + * data types would be a good idea... + * + * Because we use 64-bit offsets, ftell64(), and fseek64(), + * we rely on the OS actually providing these. This is + * a temporary hack for human genome analysis. + */ +typedef unsigned long long sqd_uint64; /* 64 bit integer. */ + +#define GSI64_KEYSIZE 32 /* keys are 32 bytes long */ +#define GSI64_RECSIZE 42 /* 32 + 2 + 8 bytes */ +#define SQD_UINT16_MAX 65535 /* 2^16-1 */ +#define SQD_UINT64_MAX 18446744073709551615LU /* 2^64-1 */ + +struct gsi64_s { + FILE *gsifp; /* open GSI index file */ + sqd_uint16 nfiles; /* number of files = 16 bit int */ + sqd_uint64 recnum; /* number of records = 64 bit int */ +}; +typedef struct gsi64_s GSI64FILE; + +struct gsi64key_s { + char key[GSI64_KEYSIZE]; + sqd_uint16 filenum; + sqd_uint64 offset; +}; +struct gsi64index_s { + char **filenames; + int *fmt; + sqd_uint16 nfiles; + + struct gsi64key_s *elems; + sqd_uint64 nkeys; +}; + + + +/* if ntohl() and friends are not available, you + * can slip replacements in by providing sre_ntohl() + * functions. (i.e., there is a possible portability problem here.) + */ +#if 0 +#define sre_ntohl(x) ntohl(x); +#define sre_ntohs(x) ntohs(x); +#define sre_htonl(x) htonl(x); +#define sre_htons(x) htons(x); +#endif + +/* from gsi64.c + */ +extern GSI64FILE *GSI64Open(char *gsifile); +extern int GSI64GetRecord(GSI64FILE *gsi, char *f1, sqd_uint16 *f2, sqd_uint64 *f3); +extern int GSI64GetOffset(GSI64FILE *gsi, char *key, char *sqfile, + int *fmt, long long *ret_offset); +extern void GSI64Close(GSI64FILE *gsi); +extern struct gsi64index_s *GSI64AllocIndex(void); +extern void GSI64FreeIndex(struct gsi64index_s *g); +extern void GSI64AddFileToIndex(struct gsi64index_s *g, char *filename, int fmt); +extern void GSI64AddKeyToIndex(struct gsi64index_s *g, char *key, int filenum, long long offset); +extern void GSI64SortIndex(struct gsi64index_s *g); +extern void GSI64WriteIndex(FILE *fp, struct gsi64index_s *g); +extern void GSI64WriteHeader(FILE *fp, int nfiles, long long nkeys); +extern int GSI64WriteFileRecord(FILE *fp, char *fname, int idx, int fmt); +extern int GSI64WriteKeyRecord(FILE *fp, char *key, int fileidx, long long offset); + +#endif /* USE_GSI64 */ +#endif /*GSIH_INCLUDED*/ |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/squid/hsregex.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/squid/hsregex.c Thu Jul 21 13:35:08 2011 -0400 |
[ |
b'@@ -0,0 +1,1350 @@\n+/*****************************************************************\n+ * SQUID - a library of functions for biological sequence analysis\n+ * Copyright (C) 1992-2002 Washington University School of Medicine\n+ * \n+ * This source code is freely distributed under the terms of the\n+ * GNU General Public License. See the files COPYRIGHT and LICENSE\n+ * for details.\n+ *****************************************************************/\n+\n+/*****************************************************************\n+ * This code is an altered version of Henry Spencer\'s\n+ * regex library. Alterations are limited to minor streamlining,\n+ * and some name changes to protect the SQUID namespace.\n+ * Henry\'s copyright notice appears below.\n+ * You can obtain the original from \n+ * ftp://ftp.zoo.toronto.edu/pub/bookregex.tar.Z\n+ * Thanks, Henry!\n+ * \n+ * The magic word for compiling a testdriver: NBA_TEAM_IN_STL\n+ * gcc -o test -g -DNBA_TEAM_IN_STL -L. hsregex.c -lsquid -lm\n+ * \n+ * Usage: \n+ * test <pattern> <ntok> <string>\n+ * \n+ * SRE, Fri Aug 28 11:10:17 1998\n+ * CVS $Id: hsregex.c,v 1.7 2001/08/09 17:50:17 eddy Exp)\n+ *****************************************************************/ \n+\n+#include <stdio.h>\n+#include <stdlib.h>\n+#include <string.h>\n+#include <ctype.h>\n+#include "squid.h"\n+\n+/* global sqd_parse[] are managed by Strparse().\n+ * WARNING: TODO: this code is not threadsafe, and needs to be revised. \n+ */\n+char *sqd_parse[10];\n+\n+/* Function: Strparse()\n+ * \n+ * Purpose: Match a regexp to a string. Returns 1 if pattern matches,\n+ * else 0.\n+ *\n+ * Much like Perl, Strparse() makes copies of the matching\n+ * substrings available via globals, sqd_parse[].\n+ * sqd_parse[0] contains a copy of the complete matched\n+ * text. sqd_parse[1-9] contain copies of up to nine\n+ * different substrings matched within parentheses.\n+ * The memory for these strings is internally managed and\n+ * volatile; the next call to Strparse() may destroy them.\n+ * If the caller needs the matched substrings to persist\n+ * beyond a new Strparse() call, it must make its own \n+ * copies.\n+ * \n+ * A minor drawback of the memory management is that\n+ * there will be a small amount of unfree\'d memory being\n+ * managed by Strparse() when a program exits; this may\n+ * confuse memory debugging (Purify, dbmalloc). The\n+ * general cleanup function SqdClean() is provided;\n+ * you can call this before exiting.\n+ * \n+ * Uses an extended POSIX regular expression interface.\n+ * A copylefted GNU implementation is included in the squid\n+ * implementation (gnuregex.c) for use on non-POSIX compliant\n+ * systems. POSIX 1003.2-compliant systems (all UNIX,\n+ * some WinNT, I believe) can omit the GNU code if necessary.\n+ * \n+ * I built this for ease of use, not speed nor efficiency.\n+ *\n+ * Example: Strparse("foo-...-baz", "foo-bar-baz") returns 0\n+ * Strparse("foo-(...)-baz", "foo-bar-baz")\n+ * returns 0; sqd_parse[0] is "foo-bar-baz";\n+ * sqd_parse[1] is "bar".\n+ * \n+ * A real example: \n+ * s = ">gnl|ti|3 G10P69425RH2.T0 {SUB 81..737} /len=657"\n+ * pat = "SUB ([0-9]+)"\n+ * Strparse(pat, s, 1)\n+ * returns 1; sqd_parse[1] is "81".\n+ * \n+ * Args: rexp - regular expression, extended POSIX form\n+ * s - string to match against\n+ * ntok - number of () substrings we will save (maximum NSUBEXP-1)\n+ * \n+ * Return: 1 on match, 0 if no match\n+ */\n+int\n+Strparse(char *rexp, char *s, int ntok)\n+{\n+ sqd_regexp *pat;\n+ int code;\n+ int len;\n+ int i;\n+\t\t\t\t/* sanity check */\n+ if (ntok >= NSUBEXP ) Die("Strparse()'..b'();\n+\n+/*\n+ - regdump - dump a regexp onto stdout in vaguely comprehensible form\n+ */\n+void\n+regdump(r)\n+sqd_regexp *r;\n+{\n+\tregister char *s;\n+\tregister char op = EXACTLY;\t/* Arbitrary non-END op. */\n+\tregister char *next;\n+\n+\n+\ts = r->program + 1;\n+\twhile (op != END) {\t/* While that wasn\'t END last time... */\n+\t\top = OP(s);\n+\t\tprintf("%2d%s", s-r->program, regprop(s));\t/* Where, what. */\n+\t\tnext = regnext(s);\n+\t\tif (next == NULL)\t\t/* Next ptr. */\n+\t\t\tprintf("(0)");\n+\t\telse \n+\t\t\tprintf("(%d)", (s-r->program)+(next-s));\n+\t\ts += 3;\n+\t\tif (op == ANYOF || op == ANYBUT || op == EXACTLY) {\n+\t\t\t/* Literal string, where present. */\n+\t\t\twhile (*s != \'\\0\') {\n+\t\t\t\tputchar(*s);\n+\t\t\t\ts++;\n+\t\t\t}\n+\t\t\ts++;\n+\t\t}\n+\t\tputchar(\'\\n\');\n+\t}\n+\n+\t/* Header fields of interest. */\n+\tif (r->regstart != \'\\0\')\n+\t\tprintf("start `%c\' ", r->regstart);\n+\tif (r->reganch)\n+\t\tprintf("anchored ");\n+\tif (r->regmust != NULL)\n+\t\tprintf("must have \\"%s\\"", r->regmust);\n+\tprintf("\\n");\n+}\n+\n+/*\n+ - regprop - printable representation of opcode\n+ */\n+static char *\n+regprop(op)\n+char *op;\n+{\n+\tregister char *p;\n+\tstatic char buf[50];\n+\n+\t(void) strcpy(buf, ":");\n+\n+\tswitch (OP(op)) {\n+\tcase BOL:\n+\t\tp = "BOL";\n+\t\tbreak;\n+\tcase EOL:\n+\t\tp = "EOL";\n+\t\tbreak;\n+\tcase ANY:\n+\t\tp = "ANY";\n+\t\tbreak;\n+\tcase ANYOF:\n+\t\tp = "ANYOF";\n+\t\tbreak;\n+\tcase ANYBUT:\n+\t\tp = "ANYBUT";\n+\t\tbreak;\n+\tcase BRANCH:\n+\t\tp = "BRANCH";\n+\t\tbreak;\n+\tcase EXACTLY:\n+\t\tp = "EXACTLY";\n+\t\tbreak;\n+\tcase NOTHING:\n+\t\tp = "NOTHING";\n+\t\tbreak;\n+\tcase BACK:\n+\t\tp = "BACK";\n+\t\tbreak;\n+\tcase END:\n+\t\tp = "END";\n+\t\tbreak;\n+\tcase OPEN+1:\n+\tcase OPEN+2:\n+\tcase OPEN+3:\n+\tcase OPEN+4:\n+\tcase OPEN+5:\n+\tcase OPEN+6:\n+\tcase OPEN+7:\n+\tcase OPEN+8:\n+\tcase OPEN+9:\n+\t\tsprintf(buf+strlen(buf), "OPEN%d", OP(op)-OPEN);\n+\t\tp = NULL;\n+\t\tbreak;\n+\tcase CLOSE+1:\n+\tcase CLOSE+2:\n+\tcase CLOSE+3:\n+\tcase CLOSE+4:\n+\tcase CLOSE+5:\n+\tcase CLOSE+6:\n+\tcase CLOSE+7:\n+\tcase CLOSE+8:\n+\tcase CLOSE+9:\n+\t\tsprintf(buf+strlen(buf), "CLOSE%d", OP(op)-CLOSE);\n+\t\tp = NULL;\n+\t\tbreak;\n+\tcase STAR:\n+\t\tp = "STAR";\n+\t\tbreak;\n+\tcase PLUS:\n+\t\tp = "PLUS";\n+\t\tbreak;\n+\tdefault:\n+\t\tsqd_regerror("corrupted opcode");\n+\t\tbreak;\n+\t}\n+\tif (p != NULL)\n+\t\t(void) strcat(buf, p);\n+\treturn(buf);\n+}\n+#endif\n+\n+\n+/*\n+ - sqd_regsub - perform substitutions after a regexp match\n+ */\n+void\n+sqd_regsub(rp, source, dest)\n+const sqd_regexp *rp;\n+const char *source;\n+char *dest;\n+{\n+\tregister sqd_regexp * const prog = (sqd_regexp *)rp;\n+\tregister char *src = (char *)source;\n+\tregister char *dst = dest;\n+\tregister char c;\n+\tregister int no;\n+\tregister size_t len;\n+\n+\tif (prog == NULL || source == NULL || dest == NULL) {\n+\t\tsqd_regerror("NULL parameter to sqd_regsub");\n+\t\treturn;\n+\t}\n+\tif ((unsigned char)*(prog->program) != SQD_REGMAGIC) {\n+\t\tsqd_regerror("damaged regexp");\n+\t\treturn;\n+\t}\n+\n+\twhile ((c = *src++) != \'\\0\') {\n+\t\tif (c == \'&\')\n+\t\t\tno = 0;\n+\t\telse if (c == \'\\\\\' && isdigit((int) (*src)))\n+\t\t\tno = *src++ - \'0\';\n+\t\telse\n+\t\t\tno = -1;\n+\n+\t\tif (no < 0) {\t/* Ordinary character. */\n+\t\t\tif (c == \'\\\\\' && (*src == \'\\\\\' || *src == \'&\'))\n+\t\t\t\tc = *src++;\n+\t\t\t*dst++ = c;\n+\t\t} else if (prog->startp[no] != NULL && prog->endp[no] != NULL &&\n+\t\t\t\t\tprog->endp[no] > prog->startp[no]) {\n+\t\t\tlen = prog->endp[no] - prog->startp[no];\n+\t\t\t(void) strncpy(dst, prog->startp[no], len);\n+\t\t\tdst += len;\n+\t\t\tif (*(dst-1) == \'\\0\') {\t/* strncpy hit NUL. */\n+\t\t\t\tsqd_regerror("damaged match string");\n+\t\t\t\treturn;\n+\t\t\t}\n+\t\t}\n+\t}\n+\t*dst++ = \'\\0\';\n+}\n+\n+\n+void\n+sqd_regerror(s)\n+char *s;\n+{\n+ fprintf(stderr, "regexp(3): %s\\n", s);\n+ exit(EXIT_FAILURE);\n+ /* NOTREACHED */\n+}\n+\n+#ifdef NBA_TEAM_IN_STL\n+int\n+main(int argc, char **argv)\n+{\n+ char *pat;\n+ int ntok;\n+ char *s;\n+ int status;\n+\n+ pat = argv[1];\n+ ntok = atoi(argv[2]);\n+ s = argv[3];\n+\n+ status = Strparse(pat, s, ntok);\n+ if (status == 0) {\n+ printf("no match\\n");\n+ } else {\n+ int i;\n+ printf("MATCH.\\n");\n+ for (i = 1; i <= ntok; i++) \n+ printf("matched token %1d: %s\\n", i, sqd_parse[i]);\n+ }\n+}\n+#endif /*NBA_TEAM_IN_STL*/\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/squid/iupac.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/squid/iupac.c Thu Jul 21 13:35:08 2011 -0400 |
[ |
@@ -0,0 +1,219 @@ +/***************************************************************** + * SQUID - a library of functions for biological sequence analysis + * Copyright (C) 1992-2002 Washington University School of Medicine + * + * This source code is freely distributed under the terms of the + * GNU General Public License. See the files COPYRIGHT and LICENSE + * for details. + *****************************************************************/ + +/* iupac.c + * + * Globally defines the IUPAC symbols for nucleic acid sequence + * Slowly evolving into a repository of globals. Tue Apr 20 1993 + * + * RCS $Id: iupac.c 217 2011-03-19 10:27:10Z andreas $ (Original squid RCS Id: iupac.c,v 1.3 2001/02/21 21:09:10 eddy Exp) + */ +#include "squid.h" + +/* Default expected nucleotide occurrence frequencies, A/C/G/T. + * Used (for instance) as the default distribution for + * i.i.d. random nucleotide sequences. + */ +float dnafq[4] = { 0.25, 0.25, 0.25, 0.25 }; + +/* Dayhoff f(i) amino acid occurrence frequencies. + * From SwissProt 34: 21,210,388 residues + * In alphabetic order by single-letter code. + * Used (for instance) as the default distribution for + * i.i.d. random protein sequences. + */ +float aafq[20] = { + 0.075520, /* A */ + 0.016973, /* C */ + 0.053029, /* D */ + 0.063204, /* E */ + 0.040762, /* F */ + 0.068448, /* G */ + 0.022406, /* H */ + 0.057284, /* I */ + 0.059398, /* K */ + 0.093399, /* L */ + 0.023569, /* M */ + 0.045293, /* N */ + 0.049262, /* P */ + 0.040231, /* Q */ + 0.051573, /* R */ + 0.072214, /* S */ + 0.057454, /* T */ + 0.065252, /* V */ + 0.012513, /* W */ + 0.031985 /* Y */ +}; + +char aa_alphabet[] = AMINO_ALPHABET; + /* aa_index converts to pam's 27x27 scheme */ +int aa_index[20] = { 0, 2, 3, 4, 5, 6, 7, 8, 10, 11, + 12, 13, 15, 16, 17, 18, 19, 21, 22, 24 }; + + /* IUPAC code translations */ + /* note: sequence chars are UPPER CASE */ +struct iupactype iupac[] = { + { 'A', 'T', NTA, NTT, }, + { 'C', 'G', NTC, NTG, }, + { 'G', 'C', NTG, NTC, }, + { 'T', 'A', NTT, NTA, }, + { 'U', 'A', NTU, NTA, }, + { 'N', 'N', NTN, NTN, }, + { ' ', ' ', NTGAP, NTGAP, }, + { 'R', 'Y', NTR, NTY, }, + { 'Y', 'R', NTY, NTR, }, + { 'M', 'K', NTM, NTK, }, + { 'K', 'M', NTK, NTM, }, + { 'S', 'S', NTS, NTS, }, + { 'W', 'W', NTW, NTW, }, + { 'H', 'D', NTH, NTD, }, + { 'B', 'V', NTB, NTV, }, + { 'V', 'B', NTV, NTB, }, + { 'D', 'H', NTD, NTH, }, + }; + + +char *stdcode1[65] = { + "K", /* AAA */ + "N", /* AAC */ + "K", /* AAG */ + "N", /* AAU */ + "T", /* ACA */ + "T", /* ACC */ + "T", /* ACG */ + "T", /* ACU */ + "R", /* AGA */ + "S", /* AGC */ + "R", /* AGG */ + "S", /* AGU */ + "I", /* AUA */ + "I", /* AUC */ + "M", /* AUG */ + "I", /* AUU */ + "Q", /* CAA */ + "H", /* CAC */ + "Q", /* CAG */ + "H", /* CAU */ + "P", /* CCA */ + "P", /* CCC */ + "P", /* CCG */ + "P", /* CCU */ + "R", /* CGA */ + "R", /* CGC */ + "R", /* CGG */ + "R", /* CGU */ + "L", /* CUA */ + "L", /* CUC */ + "L", /* CUG */ + "L", /* CUU */ + "E", /* GAA */ + "D", /* GAC */ + "E", /* GAG */ + "D", /* GAU */ + "A", /* GCA */ + "A", /* GCC */ + "A", /* GCG */ + "A", /* GCU */ + "G", /* GGA */ + "G", /* GGC */ + "G", /* GGG */ + "G", /* GGU */ + "V", /* GUA */ + "V", /* GUC */ + "V", /* GUG */ + "V", /* GUU */ + "*", /* UAA */ + "Y", /* UAC */ + "*", /* UAG */ + "Y", /* UAU */ + "S", /* UCA */ + "S", /* UCC */ + "S", /* UCG */ + "S", /* UCU */ + "*", /* UGA */ + "C", /* UGC */ + "W", /* UGG */ + "C", /* UGU */ + "L", /* UUA */ + "F", /* UUC */ + "L", /* UUG */ + "F", /* UUU */ + "X", /* unknown */ +}; + + + + +char *stdcode3[65] = { + "Lys", /* AAA */ + "Asn", /* AAC */ + "Lys", /* AAG */ + "Asn", /* AAU */ + "Thr", /* ACA */ + "Thr", /* ACC */ + "Thr", /* ACG */ + "Thr", /* ACU */ + "Arg", /* AGA */ + "Ser", /* AGC */ + "Arg", /* AGG */ + "Ser", /* AGU */ + "Ile", /* AUA */ + "Ile", /* AUC */ + "Met", /* AUG */ + "Ile", /* AUU */ + "Gln", /* CAA */ + "His", /* CAC */ + "Gln", /* CAG */ + "His", /* CAU */ + "Pro", /* CCA */ + "Pro", /* CCC */ + "Pro", /* CCG */ + "Pro", /* CCU */ + "Arg", /* CGA */ + "Arg", /* CGC */ + "Arg", /* CGG */ + "Arg", /* CGU */ + "Leu", /* CUA */ + "Leu", /* CUC */ + "Leu", /* CUG */ + "Leu", /* CUU */ + "Glu", /* GAA */ + "Asp", /* GAC */ + "Glu", /* GAG */ + "Asp", /* GAU */ + "Ala", /* GCA */ + "Ala", /* GCC */ + "Ala", /* GCG */ + "Ala", /* GCU */ + "Gly", /* GGA */ + "Gly", /* GGC */ + "Gly", /* GGG */ + "Gly", /* GGU */ + "Val", /* GUA */ + "Val", /* GUC */ + "Val", /* GUG */ + "Val", /* GUU */ + "***", /* UAA */ + "Tyr", /* UAC */ + "***", /* UAG */ + "Tyr", /* UAU */ + "Ser", /* UCA */ + "Ser", /* UCC */ + "Ser", /* UCG */ + "Ser", /* UCU */ + "***", /* UGA */ + "Cys", /* UGC */ + "Trp", /* UGG */ + "Cys", /* UGU */ + "Leu", /* UUA */ + "Phe", /* UUC */ + "Leu", /* UUG */ + "Trp", /* UUU */ + "XXX", /* unknown */ +}; |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/squid/msa.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/squid/msa.c Thu Jul 21 13:35:08 2011 -0400 |
[ |
b'@@ -0,0 +1,1442 @@\n+/*****************************************************************\n+ * SQUID - a library of functions for biological sequence analysis\n+ * Copyright (C) 1992-2002 Washington University School of Medicine\n+ * \n+ * This source code is freely distributed under the terms of the\n+ * GNU General Public License. See the files COPYRIGHT and LICENSE\n+ * for details.\n+ *****************************************************************/\n+\n+/* msa.c\n+ * SRE, Mon May 17 10:48:47 1999\n+ * \n+ * SQUID\'s interface for multiple sequence alignment\n+ * manipulation: access to the MSA object.\n+ * \n+ * RCS $Id: msa.c 217 2011-03-19 10:27:10Z andreas $ (Original squid RCS Id: msa.c,v 1.18 2002/10/12 04:40:35 eddy Exp)\n+ */\n+\n+#include <stdio.h>\n+#include <stdlib.h>\n+#include <string.h>\n+#include "squid.h"\n+#include "msa.h"\t/* multiple sequence alignment object support */\n+#include "gki.h"\t/* string indexing hashtable code */\n+#include "ssi.h"\t/* SSI sequence file indexing code */\n+\n+/* Function: MSAAlloc()\n+ * Date: SRE, Tue May 18 10:45:47 1999 [St. Louis]\n+ *\n+ * Purpose: Allocate an MSA structure, return a pointer\n+ * to it.\n+ * \n+ * Designed to be used in three ways:\n+ * 1) We know exactly the dimensions of the alignment:\n+ * both nseq and alen.\n+ * msa = MSAAlloc(nseq, alen);\n+ * \n+ * 2) We know the number of sequences but not alen.\n+ * (We add sequences later.) \n+ * msa = MSAAlloc(nseq, 0);\n+ * \n+ * 3) We even don\'t know the number of sequences, so\n+ * we\'ll have to dynamically expand allocations.\n+ * We provide a blocksize for the allocation expansion,\n+ * and expand when needed.\n+ * msa = MSAAlloc(10, 0);\n+ * if (msa->nseq == msa->nseqalloc) MSAExpand(msa); \n+ *\n+ * Args: nseq - number of sequences, or nseq allocation blocksize\n+ * alen - length of alignment in columns, or 0 \n+ *\n+ * Returns: pointer to new MSA object, w/ all values initialized.\n+ * Note that msa->nseq is initialized to 0, though space\n+ * is allocated.\n+ * \n+ * Diagnostics: "always works". Die()\'s on memory allocation failure.\n+ * \n+ */\n+MSA *\n+MSAAlloc(int nseq, int alen)\n+{\n+ MSA *msa;\n+ int i;\n+\n+ msa = MallocOrDie(sizeof(MSA));\n+ msa->aseq = MallocOrDie(sizeof(char *) * nseq);\n+ msa->sqname = MallocOrDie(sizeof(char *) * nseq);\n+ msa->sqlen = MallocOrDie(sizeof(int) * nseq);\n+ msa->wgt = MallocOrDie(sizeof(float) * nseq);\n+\n+ for (i = 0; i < nseq; i++)\n+ {\n+ msa->sqname[i] = NULL;\n+ msa->sqlen[i] = 0;\n+ msa->wgt[i] = -1.0;\n+\n+ if (alen != 0) msa->aseq[i] = MallocOrDie(sizeof(char) * (alen+1));\n+ else msa->aseq[i] = NULL;\n+ } \n+\n+ msa->alen = alen;\n+ msa->nseq = 0;\n+ msa->nseqalloc = nseq;\n+ msa->nseqlump = nseq;\n+\n+ msa->flags = 0;\n+ msa->type = kOtherSeq;\n+ msa->name = NULL;\n+ msa->desc = NULL;\n+ msa->acc = NULL;\n+ msa->au = NULL;\n+ msa->ss_cons = NULL;\n+ msa->sa_cons = NULL;\n+ msa->rf = NULL;\n+ msa->sqacc = NULL;\n+ msa->sqdesc = NULL;\n+ msa->ss = NULL;\n+ msa->sslen = NULL;\n+ msa->sa = NULL;\n+ msa->salen = NULL;\n+ msa->index = GKIInit();\n+ msa->lastidx = 0;\n+\n+ for (i = 0; i < MSA_MAXCUTOFFS; i++) {\n+ msa->cutoff[i] = 0.;\n+ msa->cutoff_is_set[i] = FALSE;\n+ }\n+\n+ /* Initialize unparsed optional markup\n+ */\n+ msa->comment = NULL;\n+ msa->ncomment = 0;\n+ msa->alloc_ncomment = 0;\n+\n+ msa->gf_tag = NULL;\n+ msa->gf = NULL;\n+ msa->ngf = 0;\n+\n+ msa->gs_tag = NULL;\n+ msa->gs = NULL;\n+ msa->gs_idx = NULL;\n+ msa->ngs = 0;\n+\n+ msa->gc_tag = NULL;\n+ msa->gc = NULL;\n+ msa->'..b"E/FALSE flags; TRUE means include \n+ * this seq in new alignment\n+ * ret_new -- RETURN: new alignment \n+ *\n+ * Returns: void\n+ * ret_new is allocated here; free with MSAFree() \n+ */\n+void\n+MSASmallerAlignment(MSA *msa, int *useme, MSA **ret_new)\n+{\n+ MSA *new; /* RETURN: new alignment */\n+ int nnew;\t\t\t/* number of seqs in new msa (e.g. # of TRUEs) */\n+ int oidx, nidx;\t\t/* old, new indices */\n+ int i;\n+\n+ nnew = 0;\n+ for (oidx = 0; oidx < msa->nseq; oidx++)\n+ if (useme[oidx]) nnew++;\n+ if (nnew == 0) { *ret_new = NULL; return; }\n+ \n+ new = MSAAlloc(nnew, 0);\n+ nidx = 0;\n+ for (oidx = 0; oidx < msa->nseq; oidx++)\n+ if (useme[oidx])\n+ {\n+\tnew->aseq[nidx] = sre_strdup(msa->aseq[oidx], msa->alen);\n+\tnew->sqname[nidx] = sre_strdup(msa->sqname[oidx], msa->alen);\n+\tGKIStoreKey(new->index, msa->sqname[oidx]);\n+\tnew->wgt[nidx] = msa->wgt[oidx];\n+\tif (msa->sqacc != NULL)\n+\t MSASetSeqAccession(new, nidx, msa->sqacc[oidx]);\n+\tif (msa->sqdesc != NULL)\n+\t MSASetSeqDescription(new, nidx, msa->sqdesc[oidx]);\n+\tif (msa->ss != NULL && msa->ss[oidx] != NULL)\n+\t {\n+\t if (new->ss == NULL) new->ss = MallocOrDie(sizeof(char *) * new->nseq);\n+\t new->ss[nidx] = sre_strdup(msa->ss[oidx], -1);\n+\t }\n+\tif (msa->sa != NULL && msa->sa[oidx] != NULL)\n+\t {\n+\t if (new->sa == NULL) new->sa = MallocOrDie(sizeof(char *) * new->nseq);\n+\t new->sa[nidx] = sre_strdup(msa->sa[oidx], -1);\n+\t }\n+\tnidx++;\n+ }\n+\n+ new->nseq = nnew;\n+ new->alen = msa->alen; \n+ new->flags = msa->flags;\n+ new->type = msa->type;\n+ new->name = sre_strdup(msa->name, -1);\n+ new->desc = sre_strdup(msa->desc, -1);\n+ new->acc = sre_strdup(msa->acc, -1);\n+ new->au = sre_strdup(msa->au, -1);\n+ new->ss_cons = sre_strdup(msa->ss_cons, -1);\n+ new->sa_cons = sre_strdup(msa->sa_cons, -1);\n+ new->rf = sre_strdup(msa->rf, -1);\n+ for (i = 0; i < MSA_MAXCUTOFFS; i++) {\n+ new->cutoff[i] = msa->cutoff[i];\n+ new->cutoff_is_set[i] = msa->cutoff_is_set[i];\n+ }\n+ free(new->sqlen);\n+\n+ MSAMingap(new);\n+ *ret_new = new;\n+ return;\n+}\n+\n+\n+/*****************************************************************\n+ * Retrieval routines\n+ * \n+ * Access to MSA structure data is possible through these routines.\n+ * I'm not doing this because of object oriented design, though\n+ * it might work in my favor someday.\n+ * I'm doing this because lots of MSA data is optional, and\n+ * checking through the chain of possible NULLs is a pain.\n+ *****************************************************************/\n+\n+char *\n+MSAGetSeqAccession(MSA *msa, int idx)\n+{\n+ if (msa->sqacc != NULL && msa->sqacc[idx] != NULL)\n+ return msa->sqacc[idx];\n+ else\n+ return NULL;\n+}\n+char *\n+MSAGetSeqDescription(MSA *msa, int idx)\n+{\n+ if (msa->sqdesc != NULL && msa->sqdesc[idx] != NULL)\n+ return msa->sqdesc[idx];\n+ else\n+ return NULL;\n+}\n+char *\n+MSAGetSeqSS(MSA *msa, int idx)\n+{\n+ if (msa->ss != NULL && msa->ss[idx] != NULL)\n+ return msa->ss[idx];\n+ else\n+ return NULL;\n+}\n+char *\n+MSAGetSeqSA(MSA *msa, int idx)\n+{\n+ if (msa->sa != NULL && msa->sa[idx] != NULL)\n+ return msa->sa[idx];\n+ else\n+ return NULL;\n+}\n+\n+\n+/*****************************************************************\n+ * Information routines\n+ * \n+ * Access information about the MSA.\n+ *****************************************************************/\n+\n+/* Function: MSAAverageSequenceLength()\n+ * Date: SRE, Sat Apr 6 09:41:34 2002 [St. Louis]\n+ *\n+ * Purpose: Return the average length of the (unaligned) sequences\n+ * in the MSA.\n+ *\n+ * Args: msa - the alignment\n+ *\n+ * Returns: average length\n+ */\n+float\n+MSAAverageSequenceLength(MSA *msa)\n+{\n+ int i;\n+ float avg;\n+ \n+ avg = 0.;\n+ for (i = 0; i < msa->nseq; i++) \n+ avg += (float) DealignedLength(msa->aseq[i]);\n+\n+ if (msa->nseq == 0) return 0.;\n+ else return (avg / msa->nseq);\n+}\n+\n+\n" |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/squid/msa.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/squid/msa.h Thu Jul 21 13:35:08 2011 -0400 |
[ |
b'@@ -0,0 +1,302 @@\n+/*****************************************************************\n+ * SQUID - a library of functions for biological sequence analysis\n+ * Copyright (C) 1992-2002 Washington University School of Medicine\n+ * \n+ * This source code is freely distributed under the terms of the\n+ * GNU General Public License. See the files COPYRIGHT and LICENSE\n+ * for details.\n+ *****************************************************************/\n+\n+#ifndef SQUID_MSA_INCLUDED\n+#define SQUID_MSA_INCLUDED\n+\n+/* msa.h\n+ * SRE, Mon May 17 10:24:30 1999\n+ * \n+ * Header file for SQUID\'s multiple sequence alignment \n+ * manipulation code.\n+ * \n+ * RCS $Id: msa.h 217 2011-03-19 10:27:10Z andreas $ (Original squid RCS Id: msa.h,v 1.12 2002/10/12 04:40:35 eddy Exp)\n+ */\n+\n+#include <stdio.h>\t\t/* FILE support */\n+#include "gki.h"\t\t/* hash table support */\n+#include "ssi.h"\t\t/* sequence file index support */\n+#include "squid.h"\t\t/* need SQINFO */\n+\n+/****************************************************\n+ * Obsolete alignment information, AINFO\n+ * Superceded by MSA structure further below; but we\n+ * need AINFO for the near future for backwards\n+ * compatibility.\n+ ****************************************************/\n+/* Structure: aliinfo_s\n+ * \n+ * Purpose: Optional information returned from an alignment file.\n+ * \n+ * flags: always used. Flags for which info is valid/alloced.\n+ * \n+ * alen: mandatory. Alignments are always flushed right\n+ * with gaps so that all aseqs are the same length, alen.\n+ * Available for all alignment formats.\n+ *\n+ * nseq: mandatory. Aligned seqs are indexed 0..nseq-1. \n+ * \n+ * wgt: 0..nseq-1 vector of sequence weights. Mandatory.\n+ * If not explicitly set, weights are initialized to 1.0.\n+ *\n+ * cs: 0..alen-1, just like the alignment. Contains single-letter\n+ * secondary structure codes for consensus structure; "<>^+"\n+ * for RNA, "EHL." for protein. May be NULL if unavailable\n+ * from seqfile. Only available for SELEX format files.\n+ * \n+ * rf: 0..alen-1, just like the alignment. rf is an arbitrary string\n+ * of characters, used for annotating columns. Blanks are\n+ * interpreted as non-canonical columns and anything else is\n+ * considered canonical. Only available from SELEX files.\n+ * \n+ * sqinfo: mandatory. Array of 0..nseq-1 \n+ * per-sequence information structures, carrying\n+ * name, id, accession, coords.\n+ * \n+ */\n+struct aliinfo_s {\t\t\n+ int flags; /* flags for what info is valid */\n+ int alen;\t/* length of alignment (columns) */\n+ int nseq; /* number of seqs in alignment */\n+ float *wgt;\t/* sequence weights [0..nseq-1] */\n+ char *cs; /* consensus secondary structure string */\n+ char *rf; /* reference coordinate system */\n+ struct seqinfo_s *sqinfo; /* name, id, coord info for each sequence */\n+\n+ /* Pfam/HMMER pick-ups */\t\n+ char *name;\t\t\t/* name of alignment */\n+ char *desc;\t\t\t/* description of alignment */\n+ char *acc;\t\t\t/* accession of alignment */\n+ char *au;\t\t\t/* "author" information */\n+ float tc1, tc2;\t\t/* trusted score cutoffs (per-seq, per-domain) */\n+ float nc1, nc2;\t\t/* noise score cutoffs (per-seq, per-domain) */\n+ float ga1, ga2;\t\t/* gathering cutoffs */\n+};\n+typedef struct aliinfo_s AINFO;\n+#define AINFO_TC (1 << 0)\n+#define AINFO_NC (1 << 1)\n+#define AINFO_GA (1 << 2)\n+\n+/*****************************************************************\n+ * MSA \n+ * SRE, Sun Jun 27 15:03:35 1999 [TW 723 over Greenland]\n+ * '..b"+\n+ SSIFILE *ssi;\t\t /* open SSI index file; or NULL, if none. */\n+\n+ int do_gzip;\t\t/* TRUE if f is a pipe from gzip -dc (need pclose(f)) */\n+ int do_stdin;\t\t/* TRUE if f is stdin (don't close f, not our problem) */\n+ int format;\t\t\t/* format of alignment file we're reading */\n+} MSAFILE;\n+\n+\n+/* Alignment file formats.\n+ * Must coexist with sqio.c/squid.h unaligned file format codes.\n+ * Rules:\n+ * - 0 is an unknown/unassigned format \n+ * - <100 reserved for unaligned formats\n+ * - >100 reserved for aligned formats\n+ */\n+#define MSAFILE_UNKNOWN 0\t/* unknown format */\n+#define MSAFILE_STOCKHOLM 101\t/* Pfam/HMMER's Stockholm format */\n+#define MSAFILE_SELEX\t 102\t/* Obsolete(!): old HMMER/SELEX format */\n+#define MSAFILE_MSF\t 103\t/* GCG MSF format */\n+#define MSAFILE_CLUSTAL\t 104\t/* Clustal V/W format */\n+#define MSAFILE_A2M\t 105\t/* aligned FASTA (A2M is UCSC terminology) */\n+#define MSAFILE_PHYLIP 106\t/* Felsenstein's PHYLIP format */\n+#define MSAFILE_EPS 107\t/* Encapsulated PostScript (output only) */\n+#ifdef CLUSTALO\n+#define MSAFILE_VIENNA 108\t/* Vienna: concatenated fasta */\n+#endif\n+\n+#define IsAlignmentFormat(fmt) ((fmt) > 100)\n+\n+\n+/* from msa.c\n+ */\n+extern MSAFILE *MSAFileOpen(char *filename, int format, char *env);\n+extern MSA *MSAFileRead(MSAFILE *afp);\n+extern void MSAFileClose(MSAFILE *afp);\n+extern void MSAFree(MSA *msa);\n+extern void MSAFileWrite(FILE *fp, MSA *msa, int outfmt, int do_oneline);\n+\n+extern int MSAFileRewind(MSAFILE *afp);\n+extern int MSAFilePositionByKey(MSAFILE *afp, char *key);\n+extern int MSAFilePositionByIndex(MSAFILE *afp, int idx);\n+\n+extern int MSAFileFormat(MSAFILE *afp);\n+extern MSA *MSAAlloc(int nseq, int alen);\n+extern void MSAExpand(MSA *msa);\n+extern char *MSAFileGetLine(MSAFILE *afp);\n+extern void MSASetSeqAccession(MSA *msa, int seqidx, char *acc);\n+extern void MSASetSeqDescription(MSA *msa, int seqidx, char *desc);\n+extern void MSAAddComment(MSA *msa, char *s);\n+extern void MSAAddGF(MSA *msa, char *tag, char *value);\n+extern void MSAAddGS(MSA *msa, char *tag, int seqidx, char *value);\n+extern void MSAAppendGC(MSA *msa, char *tag, char *value);\n+extern char *MSAGetGC(MSA *msa, char *tag);\n+extern void MSAAppendGR(MSA *msa, char *tag, int seqidx, char *value);\n+extern void MSAVerifyParse(MSA *msa);\n+extern int MSAGetSeqidx(MSA *msa, char *name, int guess);\n+\n+extern MSA *MSAFromAINFO(char **aseq, AINFO *ainfo); \n+\n+extern void MSAMingap(MSA *msa);\n+extern void MSANogap(MSA *msa);\n+extern void MSAShorterAlignment(MSA *msa, int *useme);\n+extern void MSASmallerAlignment(MSA *msa, int *useme, MSA **ret_new);\n+\n+extern char *MSAGetSeqAccession(MSA *msa, int idx);\n+extern char *MSAGetSeqDescription(MSA *msa, int idx);\n+extern char *MSAGetSeqSS(MSA *msa, int idx);\n+extern char *MSAGetSeqSA(MSA *msa, int idx);\n+\n+extern float MSAAverageSequenceLength(MSA *msa);\n+\n+/* from a2m.c\n+ */\n+extern MSA *ReadA2M(MSAFILE *afp);\n+#ifdef CLUSTALO\n+extern void WriteA2M(FILE *fp, MSA *msa, int vienna);\n+#else\n+extern void WriteA2M(FILE *fp, MSA *msa);\n+#endif\n+/* from clustal.c\n+ */\n+extern MSA *ReadClustal(MSAFILE *afp);\n+extern void WriteClustal(FILE *fp, MSA *msa);\n+\n+/* from eps.c\n+ */\n+extern void EPSWriteSmallMSA(FILE *fp, MSA *msa);\n+\n+/* from msf.c\n+ */\n+extern MSA *ReadMSF(MSAFILE *afp);\n+extern void WriteMSF(FILE *fp, MSA *msa);\n+\n+/* from phylip.c\n+ */\n+extern MSA *ReadPhylip(MSAFILE *afp);\n+extern void WritePhylip(FILE *fp, MSA *msa);\n+\n+/* from selex.c\n+ */\n+extern MSA *ReadSELEX(MSAFILE *afp);\n+extern void WriteSELEX(FILE *fp, MSA *msa);\n+extern void WriteSELEXOneBlock(FILE *fp, MSA *msa);\n+\n+/* from stockholm.c\n+ */\n+extern MSA *ReadStockholm(MSAFILE *afp);\n+extern void WriteStockholm(FILE *fp, MSA *msa);\n+extern void WriteStockholmOneBlock(FILE *fp, MSA *msa);\n+\n+#endif /*SQUID_MSA_INCLUDED*/\n" |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/squid/msf.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/squid/msf.c Thu Jul 21 13:35:08 2011 -0400 |
[ |
b'@@ -0,0 +1,388 @@\n+/*****************************************************************\n+ * SQUID - a library of functions for biological sequence analysis\n+ * Copyright (C) 1992-2002 Washington University School of Medicine\n+ * \n+ * This source code is freely distributed under the terms of the\n+ * GNU General Public License. See the files COPYRIGHT and LICENSE\n+ * for details.\n+ *****************************************************************/\n+\n+/* msf.c\n+ * SRE, Sun Jul 11 16:17:32 1993\n+ * \n+ * Import/export of GCG MSF multiple sequence alignment\n+ * formatted files. Designed using format specifications\n+ * kindly provided by Steve Smith of Genetics Computer Group.\n+ * \n+ * RCS $Id: msf.c 217 2011-03-19 10:27:10Z andreas $ (Original squid RCS Id: msf.c,v 1.4 2001/04/23 00:35:33 eddy Exp)\n+ */\n+\n+#include <stdio.h>\n+#include <stdlib.h>\n+#include <string.h>\n+#include <ctype.h>\n+#include <time.h>\n+#include "squid.h"\n+#include "msa.h"\n+\n+#ifdef TESTDRIVE_MSF\n+/*****************************************************************\n+ * msf.c test driver: \n+ * cc -DTESTDRIVE_MSF -g -O2 -Wall -o test msf.c msa.c gki.c sqerror.c sre_string.c file.c hsregex.c sre_math.c sre_ctype.c sqio.c alignio.c selex.c interleaved.c types.c -lm\n+ * \n+ */\n+int\n+main(int argc, char **argv)\n+{\n+ MSAFILE *afp;\n+ MSA *msa;\n+ char *file;\n+ \n+ file = argv[1];\n+\n+ if ((afp = MSAFileOpen(file, MSAFILE_STOCKHOLM, NULL)) == NULL)\n+ Die("Couldn\'t open %s\\n", file);\n+\n+ while ((msa = ReadMSF(afp)) != NULL)\n+ {\n+ WriteMSF(stdout, msa);\n+ MSAFree(msa); \n+ }\n+ \n+ MSAFileClose(afp);\n+ exit(0);\n+}\n+/******************************************************************/\n+#endif /* testdrive_msf */\n+\n+\n+\n+/* Function: ReadMSF()\n+ * Date: SRE, Tue Jun 1 08:07:22 1999 [St. Louis]\n+ *\n+ * Purpose: Parse an alignment read from an open MSF format\n+ * alignment file. (MSF is a single-alignment format.)\n+ * Return the alignment, or NULL if we\'ve already\n+ * read the alignment.\n+ * \n+ * Args: afp - open alignment file\n+ *\n+ * Returns: MSA * - an alignment object\n+ * caller responsible for an MSAFree()\n+ * NULL if no more alignments\n+ *\n+ * Diagnostics: \n+ * Will Die() here with a (potentially) useful message\n+ * if a parsing error occurs.\n+ */\n+MSA *\n+ReadMSF(MSAFILE *afp)\n+{\n+ MSA *msa;\n+ char *s;\n+ int alleged_alen;\n+ int alleged_type;\n+ int alleged_checksum;\n+ char *tok;\n+ char *sp;\n+ int slen;\n+ int sqidx;\n+ char *name;\n+ char *seq;\n+\n+ if (feof(afp->f)) return NULL;\n+ if ((s = MSAFileGetLine(afp)) == NULL) return NULL;\n+\n+ /* The first line is the header.\n+ * This is a new-ish GCG feature. Don\'t count on it, so\n+ * we can be a bit more tolerant towards non-GCG software\n+ * generating "MSF" files.\n+ */\n+ msa = MSAAlloc(10, 0);\n+ if (strncmp(s, "!!AA_MULTIPLE_ALIGNMENT", 23) == 0) {\n+ msa->type = kAmino;\n+ if ((s = MSAFileGetLine(afp)) == NULL) return NULL;\n+ } else if (strncmp(s, "!!NA_MULTIPLE_ALIGNMENT", 23) == 0) {\n+ msa->type = kRNA;\n+ if ((s = MSAFileGetLine(afp)) == NULL) return NULL;\n+ }\n+\n+ /* Now we\'re in the free text comment section of the MSF file.\n+ * It ends when we see the "MSF: Type: Check: .." line.\n+ * This line must be present. \n+ */\n+ do\n+ {\n+ if ((strstr(s, "..") != NULL && strstr(s, "MSF:") != NULL) &&\n+\t Strparse("^.+MSF: +([0-9]+) +Type: +([PNX]).+Check: +([0-9]+) +\\\\.\\\\.", s, 3))\n+\t{\n+\t alleged_alen = atoi(sqd_parse[0]);\n+\t switch (*(sqd_parse[1])) {\n+\t case \'N\' : alleged_type = kRNA; break;\n+\t case \'P\' : alleged_type = kAmino; break; \n+\t case \'X\' : alleged_type = kOtherSeq; break;\n+\t default : alleged_type = kOtherSeq; \n+\t }\n+\t alleged_checksum = atoi(sqd_parse[3]);\n+\t if (msa->type == kOtherSeq) msa->type = alleged_type;\n+\t break;\t\t/* we\'re done with comment section. */\n+\t}\n+ if (! Is'..b'ernal gap.\n+ *****************************************************************/ \n+ \n+\t\t\t\t/* make copies that we can edit */\n+ gcg_aseq = MallocOrDie(sizeof(char *) * msa->nseq);\n+ gcg_sqname = MallocOrDie(sizeof(char *) * msa->nseq);\n+ for (idx = 0; idx < msa->nseq; idx++)\n+ {\n+ gcg_aseq[idx] = sre_strdup(msa->aseq[idx], msa->alen);\n+ gcg_sqname[idx] = sre_strdup(msa->sqname[idx], -1);\n+ }\n+\t\t\t\t/* alter names as needed */\n+ for (idx = 0; idx < msa->nseq; idx++)\n+ for (s = gcg_sqname[idx]; *s != \'\\0\'; s++)\n+ if (! isalnum((int) *s) && *s != \'-\' && *s != \'_\')\n+\t *s = \'_\';\n+\t\t\t\t/* alter gap chars in seq */\n+ for (idx = 0; idx < msa->nseq; idx++)\n+ {\n+ for (s = gcg_aseq[idx]; *s != \'\\0\' && isgap(*s); s++)\n+\t *s = \'~\';\n+ for (; *s != \'\\0\'; s++)\n+\t if (isgap(*s)) *s = \'.\';\n+ for (pos = msa->alen-1; pos > 0 && isgap(gcg_aseq[idx][pos]); pos--)\n+\t gcg_aseq[idx][pos] = \'~\';\n+ }\n+\t\t\t\t/* calculate max namelen used */\n+ namelen = 0;\n+ for (idx = 0; idx < msa->nseq; idx++)\n+ if ((len = strlen(msa->sqname[idx])) > namelen) \n+ namelen = len;\n+\n+ /*****************************************************\n+ * Write the MSF header\n+ *****************************************************/\n+\t\t\t\t/* required file type line */\n+ if (msa->type == kOtherSeq)\n+ msa->type = GuessAlignmentSeqtype(msa->aseq, msa->nseq);\n+\n+ if (msa->type == kRNA) fprintf(fp, "!!NA_MULTIPLE_ALIGNMENT 1.0\\n");\n+ else if (msa->type == kDNA) fprintf(fp, "!!NA_MULTIPLE_ALIGNMENT 1.0\\n");\n+ else if (msa->type == kAmino) fprintf(fp, "!!AA_MULTIPLE_ALIGNMENT 1.0\\n");\n+ else if (msa->type == kOtherSeq) \n+ Die("WriteMSF(): couldn\'t guess whether that alignment is RNA or protein.\\n"); \n+ else \n+ Die("Invalid sequence type %d in WriteMSF()\\n", msa->type); \n+\n+\t\t\t\t/* free text comments */\n+ if (msa->ncomment > 0)\n+ {\n+ for (idx = 0; idx < msa->ncomment; idx++)\n+\tfprintf(fp, "%s\\n", msa->comment[idx]);\n+ fprintf(fp, "\\n");\n+ }\n+\t\t\t\t/* required checksum line */\n+ now = time(NULL);\n+ if (strftime(date, 64, "%B %d, %Y %H:%M", localtime(&now)) == 0)\n+ Die("What time is it on earth? strftime() failed in WriteMSF().\\n");\n+ fprintf(fp, " %s MSF: %d Type: %c %s Check: %d ..\\n", \n+\t msa->name != NULL ? msa->name : "squid.msf",\n+\t msa->alen,\n+\t msa->type == kRNA ? \'N\' : \'P\',\n+\t date,\n+\t GCGMultchecksum(gcg_aseq, msa->nseq));\n+ fprintf(fp, "\\n");\n+\n+ /*****************************************************\n+ * Names/weights section\n+ *****************************************************/\n+\n+ for (idx = 0; idx < msa->nseq; idx++)\n+ {\n+ fprintf(fp, " Name: %-*.*s Len: %5d Check: %4d Weight: %.2f\\n",\n+\t namelen, namelen,\n+\t gcg_sqname[idx],\n+\t msa->alen,\n+\t GCGchecksum(gcg_aseq[idx], msa->alen),\n+\t msa->wgt[idx]);\n+ }\n+ fprintf(fp, "\\n");\n+ fprintf(fp, "//\\n");\n+\n+ /*****************************************************\n+ * Write the sequences\n+ *****************************************************/\n+\n+ for (pos = 0; pos < msa->alen; pos += 50)\n+ {\n+ fprintf(fp, "\\n");\t/* Blank line between sequence blocks */\n+\n+\t\t\t\t/* Coordinate line */\n+ len = (pos + 50) > msa->alen ? msa->alen - pos : 50;\n+ if (len > 10)\n+\tfprintf(fp, "%*s %-6d%*s%6d\\n", namelen, "", \n+\t\tpos+1,\n+\t\tlen + ((len-1)/10) - 12, "",\n+\t\tpos + len);\n+ else\n+\tfprintf(fp, "%*s %-6d\\n", namelen, "", pos+1);\n+\n+ for (idx = 0; idx < msa->nseq; idx++)\n+\t{\n+\t fprintf(fp, "%-*s ", namelen, gcg_sqname[idx]);\n+\t\t\t\t/* get next line\'s worth of 50 from seq */\n+\t strncpy(buffer, gcg_aseq[idx] + pos, 50);\n+\t buffer[50] = \'\\0\';\n+\t\t\t\t/* draw the sequence line */\n+\t for (i = 0; i < len; i++)\n+\t {\n+\t if (! (i % 10)) fputc(\' \', fp);\n+\t fputc(buffer[i], fp);\n+\t }\n+\t fputc(\'\\n\', fp);\n+\t}\n+ }\n+\n+ Free2DArray((void **) gcg_aseq, msa->nseq);\n+ Free2DArray((void **) gcg_sqname, msa->nseq);\n+ return;\n+}\n+\n+\n+\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/squid/phylip.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/squid/phylip.c Thu Jul 21 13:35:08 2011 -0400 |
[ |
@@ -0,0 +1,173 @@ +/***************************************************************** + * SQUID - a library of functions for biological sequence analysis + * Copyright (C) 1992-2002 Washington University School of Medicine + * + * This source code is freely distributed under the terms of the + * GNU General Public License. See the files COPYRIGHT and LICENSE + * for details. + *****************************************************************/ + +/* phylip.c + * SRE, Mon Jun 14 14:08:33 1999 [St. Louis] + * + * Import/export of PHYLIP interleaved multiple sequence alignment + * format files. + * + * RCS $Id: phylip.c 217 2011-03-19 10:27:10Z andreas $ (Original squid RCS Id: phylip.c,v 1.1 1999/07/15 22:29:20 eddy Exp) + */ + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <ctype.h> +#include "squid.h" +#include "msa.h" + +#ifdef TESTDRIVE_PHYLIP +/***************************************************************** + * phylip.c test driver: + * + */ +int +main(int argc, char **argv) +{ + MSAFILE *afp; + MSA *msa; + char *file; + + file = argv[1]; + + if ((afp = MSAFileOpen(file, MSAFILE_UNKNOWN, NULL)) == NULL) + Die("Couldn't open %s\n", file); + + printf("format %d\n", afp->format); + + while ((msa = ReadPhylip(afp)) != NULL) + { + WritePhylip(stdout, msa); + MSAFree(msa); + } + + MSAFileClose(afp); + exit(0); +} +/******************************************************************/ +#endif /* testdrive_phylip */ + + + +/* Function: ReadPhylip() + * Date: SRE, Fri Jun 18 12:59:37 1999 [Sanger Centre] + * + * Purpose: Parse an alignment from an open Phylip format + * alignment file. Phylip is a single-alignment format. + * Return the alignment, or NULL if we have no data. + * + * Args: afp - open alignment file + * + * Returns: MSA * - an alignment object + * Caller responsible for an MSAFree() + * NULL if no more alignments + */ +MSA * +ReadPhylip(MSAFILE *afp) +{ + MSA *msa; + char *s, *s1, *s2; + char name[11]; /* seq name max len = 10 char */ + int nseq, alen; + int idx; /* index of current sequence */ + int slen; + int nblock; + + if (feof(afp->f)) return NULL; + + /* Skip until we see a nonblank line; it's the header, + * containing nseq/alen + */ + nseq = 0; alen = 0; + while ((s = MSAFileGetLine(afp)) != NULL) + { + if ((s1 = sre_strtok(&s, WHITESPACE, NULL)) == NULL) continue; + if ((s2 = sre_strtok(&s, WHITESPACE, NULL)) == NULL) + Die("Failed to parse nseq/alen from first line of PHYLIP file %s\n", afp->fname); + if (! IsInt(s1) || ! IsInt(s2)) + Die("nseq and/or alen not an integer in first line of PHYLIP file %s\n", afp->fname); + nseq = atoi(s1); + alen = atoi(s2); + break; + } + + msa = MSAAlloc(nseq, 0); + idx = 0; + nblock = 0; + while ((s = MSAFileGetLine(afp)) != NULL) + { + /* ignore blank lines. nonblank lines start w/ nonblank char */ + if (isspace(*s)) continue; + /* First block has seq names */ + if (nblock == 0) { + strncpy(name, s, 10); + name[10] = '\0'; + GKIStoreKey(msa->index, name); + msa->sqname[idx] = sre_strdup(name, -1); + s += 10; + } + /* be careful of trailing whitespace on lines */ + if ((s1 = sre_strtok(&s, WHITESPACE, &slen)) == NULL) + Die("Failed to parse sequence at line %d of PHYLIP file %s\n", + afp->linenumber, afp->fname); + msa->sqlen[idx] = sre_strcat(&(msa->aseq[idx]), msa->sqlen[idx], s1, slen); + + idx++; + if (idx == nseq) { idx = 0; nblock++; } + } + msa->nseq = nseq; + MSAVerifyParse(msa); /* verifies; sets alen, wgt; frees sqlen[] */ + return msa; +} + + + +/* Function: WritePhylip() + * Date: SRE, Fri Jun 18 12:07:41 1999 [Sanger Centre] + * + * Purpose: Write an alignment in Phylip format to an open file. + * + * Args: fp - file that's open for writing. + * msa - alignment to write. + * + * Returns: (void) + */ +void +WritePhylip(FILE *fp, MSA *msa) +{ + int idx; /* counter for sequences */ + int cpl = 50; /* 50 seq char per line */ + char buf[51]; /* buffer for writing seq */ + int pos; + + /* First line has nseq, alen + */ + fprintf(fp, " %d %d\n", msa->nseq, msa->alen); + + /* Alignment section. + * PHYLIP is a multiblock format, blocks (optionally) separated + * by blanks; names only attached to first block. Names are + * restricted to ten char; we achieve this by simple truncation (!). + * (Do we need to convert gap characters from our ./- convention?) + */ + for (pos = 0; pos < msa->alen; pos += cpl) + { + if (pos > 0) fprintf(fp, "\n"); + + for (idx = 0; idx < msa->nseq; idx++) + { + strncpy(buf, msa->aseq[idx] + pos, cpl); + buf[cpl] = '\0'; + if (pos > 0) fprintf(fp, "%s\n", buf); + else fprintf(fp, "%-10.10s%s\n", msa->sqname[idx], buf); + } + } + return; +} |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/squid/revcomp.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/squid/revcomp.c Thu Jul 21 13:35:08 2011 -0400 |
[ |
@@ -0,0 +1,87 @@ +/***************************************************************** + * SQUID - a library of functions for biological sequence analysis + * Copyright (C) 1992-2002 Washington University School of Medicine + * + * This source code is freely distributed under the terms of the + * GNU General Public License. See the files COPYRIGHT and LICENSE + * for details. + *****************************************************************/ + +/* revcomp.c + * + * Reverse complement of a IUPAC character string + * RCS $Id: revcomp.c 217 2011-03-19 10:27:10Z andreas $ (Original squid RCS Id: revcomp.c,v 1.5 2002/06/25 20:06:06 eddy Exp) + */ + +#include <stdio.h> +#include <string.h> +#include <ctype.h> +#include "squid.h" + +/* Function: revcomp() + * + * Purpose: Reverse complement seq; store in comp. + * Can revcomp "in place" (revcomp(seq, seq)). + * + * Args: comp - destination for reverse complement of seq + * seq - sequence to reverse complement + * + * Returns: NULL on failure; or a (useless) pointer to comp. + */ +char * +revcomp(char *comp, char *seq) +{ + char *s; + char c; + + if (comp == NULL) return NULL; + if (seq == NULL) return NULL; + + StrReverse(comp, seq); + for (s = comp; *s != '\0'; s++) + { + c = *s; + c = sre_toupper(c); + switch (c) { + case 'A': c = 'T'; break; + case 'C': c = 'G'; break; + case 'G': c = 'C'; break; + case 'T': c = 'A'; break; + case 'U': c = 'A'; break; + case 'R': c = 'Y'; break; + case 'Y': c = 'R'; break; + case 'M': c = 'K'; break; + case 'K': c = 'M'; break; + case 'S': c = 'S'; break; + case 'W': c = 'W'; break; + case 'H': c = 'D'; break; + case 'D': c = 'H'; break; + case 'B': c = 'V'; break; + case 'V': c = 'B'; break; + default: break; /* anything else? leave it; it's prob a gap or an X */ + } + if (islower((int) *s)) c = (char) sre_tolower((int) c); + *s = c; + } + return comp; +} + +#ifdef REVCOMP_TESTDRIVER +/* gcc -g -DREVCOMP_TESTDRIVER revcomp.c sre_string.c shuffle.c sre_math.c sre_ctype.c sqerror.c -lm +*/ +int +main(void) +{ + float p[4] = {0.25, 0.25, 0.25, 0.25}; + char *alphabet = "ACGT"; + int len = 10; + char *seq; + + seq = RandomSequence(alphabet, p, 4, len); + printf("%s\n", seq); + revcomp(seq, seq); + printf("%s\n", seq); + free(seq); + exit(0); +} +#endif |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/squid/rk.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/squid/rk.c Thu Jul 21 13:35:08 2011 -0400 |
[ |
@@ -0,0 +1,133 @@ +/***************************************************************** + * SQUID - a library of functions for biological sequence analysis + * Copyright (C) 1992-2002 Washington University School of Medicine + * + * This source code is freely distributed under the terms of the + * GNU General Public License. See the files COPYRIGHT and LICENSE + * for details. + *****************************************************************/ + +/* rk.c (originally from rnabob's patsearch.c) + * + * Contains a compiler and a search engine for Rabin-Karp + * based primary sequence pattern searching on encoded + * sequences. + * + * See Sedgewick, _Algorithms_, for a general discussion of + * the Rabin-Karp algorithm. See the rkcomp or rkexec man + * pages for specific details. + * + * RCS $Id: rk.c 217 2011-03-19 10:27:10Z andreas $ (Original squid RCS Id: rk.c,v 1.2 1998/10/09 18:07:16 eddy Exp) + */ + +#include <stdio.h> +#include <string.h> +#include <ctype.h> +#include "squid.h" /* seq encoding utilities and typedefs */ +#include "rk.h" + + +#ifdef MEMDEBUG +#include "dbmalloc.h" +#endif + +Hashseq +rkcomp(char *probe) /* A,C,G,T/U, N probe string, 0-8 nt long */ +{ + Hashseq hashprobe = 0; + char coded[RK_HASHSIZE + 1]; + int len; + int i; + /* check bounds violation on probe */ + if ((len = strlen(probe)) > RK_HASHSIZE) return 0; + /* encode the probe */ + if (seqencode(coded, probe) == 0) return 0; + /* pack the probe into a Hashseq */ + for (i = 0; i < len; i++) + { + hashprobe <<= 4; + hashprobe |= (Hashseq) coded[i]; + } + /* left adjust as needed */ + for (; i < RK_HASHSIZE; i++) + { + hashprobe <<= 4; + hashprobe |= (Hashseq) NTN; + } + /* return the compiled probe */ + return hashprobe; +} + +int +rkseq(Hashseq hashprobe, /* up to 8 nt packed into the probe */ + char *sequence) /* encoded sequence */ +{ + long i; + long pos = 0; + Hashseq target = 0; + + /* initialize the target hashseq */ + for (i = 0; i < RK_HASHSIZE; i++) + { + if (*(sequence + i) == NTEND) + break; + target <<= 4; + target |= (Hashseq) (*(sequence + i)); + } + + while (*(sequence + pos + RK_HASHSIZE -1) != NTEND) + { +#ifdef DEBUG + printf("hashprobe: "); + writehash(hashprobe); + printf("\ttarget: "); + writehash(target); + printf("\nhashprobe & target: "); + writehash(hashprobe & target); + printf("\n"); +#endif + if ((hashprobe & target) == target) + return ((int) pos); + target <<= 4; + target |= (Hashseq) (*(sequence + pos + RK_HASHSIZE)); + pos++; + } + /* now we deal with an end effect */ + for (i = 0; i < RK_HASHSIZE; i++) + { + target |= (Hashseq) NTN; + if ((hashprobe & target) == target) + return ((int) pos); + target <<=4; + pos++; + } + + return(-1); +} + + +#ifdef DEBUG /* Debugging aids */ + +static void +writehash(Hashseq hashseq) +{ + int idx; + int sym; + + if (hashseq/16) + writehash(hashseq/16); + + sym = (int) (hashseq % 16); + if (sym == 0) + putchar('-'); + else + { + for (idx = 0; sym != iupac[idx].code && idx < IUPACSYMNUM; idx++); + if (idx > IUPACSYMNUM) + printf("(%d)", sym); + else + putchar(iupac[idx].sym); + } +} + +#endif |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/squid/rk.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/squid/rk.h Thu Jul 21 13:35:08 2011 -0400 |
b |
@@ -0,0 +1,39 @@ +/***************************************************************** + * SQUID - a library of functions for biological sequence analysis + * Copyright (C) 1992-2002 Washington University School of Medicine + * + * This source code is freely distributed under the terms of the + * GNU General Public License. See the files COPYRIGHT and LICENSE + * for details. + *****************************************************************/ + +#ifndef SQRKH_INCLUDED +#define SQRKH_INCLUDED + +/* rk.h + * + * Header file for Rabin-Karp pattern searching on encoded + * sequence strings. + * + * Sean Eddy, Thu Oct 1 11:45:42 1992 + * RCS $Id: rk.h 217 2011-03-19 10:27:10Z andreas $ (Original squid RCS Id: rk.h,v 1.2 1998/10/09 18:07:16 eddy Exp) + */ + + + /* expect 32 bits for 8 nt */ +typedef unsigned long Hashseq; + /* but we count to be sure... + RK_HASHSIZE is the number of nt that fit + in one probe */ +#define RK_HASHSIZE (sizeof(Hashseq)*2) + /* empirically, how many nt minimum we require + in a pattern before we abandon rk and + go with something else */ +#define RK_REQUIRE 4 + +extern int rkseq(Hashseq hashprobe, char *sequence); +extern Hashseq rkcomp(char *probe); /* compile a Hashseq from a pattern */ + + + +#endif /* SQRKH_INCLUDED */ |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/squid/selex.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/squid/selex.c Thu Jul 21 13:35:08 2011 -0400 |
[ |
b'@@ -0,0 +1,833 @@\n+/*****************************************************************\n+ * SQUID - a library of functions for biological sequence analysis\n+ * Copyright (C) 1992-2002 Washington University School of Medicine\n+ * \n+ * This source code is freely distributed under the terms of the\n+ * GNU General Public License. See the files COPYRIGHT and LICENSE\n+ * for details.\n+ *****************************************************************/\n+\n+/* selex.c \n+ * \n+ * SRE, Mon Jun 14 11:08:38 1999\n+ * SELEX obsolete as the preferred HMMER/SQUID format\n+ * replaced by Stockholm format\n+ * selex support retained for backwards compatibility\n+ * kludged to use the MSA interface\n+ * \n+ * SRE, Mon Jan 30 14:41:49 1995:\n+ * #=SA side chain % surface accessibility annotation supported\n+ * \n+ * SRE, Tue Nov 9 17:40:50 1993: \n+ * major revision. #= special comments and aliinfo_s optional\n+ * alignment info support added. Support for #=CS (consensus\n+ * secondary structure), #=SS (individual secondary structure),\n+ * #=RF (reference coordinate system), #=SQ (per-sequence header info),\n+ * and #=AU ("author") added.\n+ *\n+ * Fri Dec 4 17:43:24 1992, SRE:\n+ * Reading and writing aligned sequences to/from disk files.\n+ * Implements a new, broader specification of SELEX format\n+ * and supercedes alignio.c.\n+ *\n+ * SELEX format is documented in Docs/formats.tex.\n+ ****************************************************************************\n+ * RCS $Id: selex.c 217 2011-03-19 10:27:10Z andreas $ (Original squid RCS Id: selex.c,v 1.11 2002/10/12 04:40:35 eddy Exp)\n+ */\n+\n+#include <stdio.h>\n+#include <stdlib.h>\n+#include <string.h>\n+#include <ctype.h>\n+#include <memory.h>\n+#include "squid.h"\n+#include "msa.h"\n+\n+static int copy_alignment_line(char *aseq, int apos, int name_rcol, \n+\t\t\t\tchar *buffer, int lcol, int rcol, char gapsym);\n+static void actually_write_selex(FILE *fp, MSA *msa, int cpl);\n+\n+static char commentsyms[] = "%#";\n+\n+/* Function: ReadSELEX()\n+ * Date: SRE, Sun Jun 6 18:24:09 1999 [St. Louis]\n+ *\n+ * Purpose: Parse an alignment read from an open SELEX format\n+ * alignment file. (SELEX is a single alignment format).\n+ * Return the alignment, or NULL if we\'ve already read the\n+ * alignment or there\'s no alignment data in the file.\n+ * \n+ * Limitations: SELEX is the only remaining multipass parser for\n+ * alignment files. It cannot read from gzip or from stdin.\n+ * It Die()\'s here if you try. The reason for this\n+ * that SELEX allows space characters as gaps, so we don\'t\n+ * know the borders of an alignment block until we\'ve seen\n+ * the whole block. I could rewrite to allow single-pass\n+ * parsing (by storing the whole block in memory) but\n+ * since SELEX is now legacy, why bother.\n+ * \n+ * Note that the interface is totally kludged: fastest\n+ * possible adaptation of old ReadSELEX() to the new\n+ * MSA interface. \n+ *\n+ * Args: afp - open alignment file\n+ *\n+ * Returns: MSA * - an alignment object\n+ * caller responsible for an MSAFree()\n+ * NULL if no alignment data. \n+ */\n+MSA *\n+ReadSELEX(MSAFILE *afp)\n+{\n+ MSA *msa; /* RETURN: mult seq alignment */\n+ FILE *fp; /* ptr to opened seqfile */\n+ char **aseqs; /* aligned seqs */\n+ int num = 0;\t\t/* number of seqs read */\n+ char buffer[LINEBUFLEN];\t/* input buffer for lines */\n+ char bufcpy[LINEBUFLEN];\t/* strtok\'able copy of buffer */\n+ struct block_struc { /** alignment data for a block: */\n+ int lcol;\t\t\t/* furthest left aligned sym */\n+ int rcol;\t\t\t/* furthest right aligned sym */\n+ } *blocks = NULL;\n+ int blocknum;\t\t/* number of blocks in file */\n+ char *nptr; /* ptr to start of name on line */\n+ char '..b'+ for (i = lcol; i <= rcol; i++)\n+ {\n+ if (*s2 == \'\\t\') {\n+#ifdef CLUSTALO\n+\tWarning("TAB characters will corrupt a SELEX alignment! Please remove them first.");\n+#else\n+\tWarn("TAB characters will corrupt a SELEX alignment! Please remove them first.");\n+#endif \n+\treturn 0;\n+ }\n+ if (name_rcol >= i)\t/* name intrusion special case: pad left w/ gaps */\n+\t*s1 = gapsym;\n+\t\t\t\t/* short buffer special case: pad right w/ gaps */\n+ else if (*s2 == \'\\0\' || *s2 == \'\\n\')\n+\t*s1 = gapsym;\n+\n+ else if (*s2 == \' \')\t/* new: disallow spaces as gap symbols */\n+\t*s1 = gapsym;\n+\n+ else\t\t\t/* normal case: copy buffer into aseq */\n+\t*s1 = *s2;\n+\n+ s1++;\n+ if (*s2) s2++;\n+ }\n+ return 1;\n+}\n+\n+ \n+ \n+\n+\n+/* Function: DealignAseqs()\n+ * \n+ * Given an array of (num) aligned sequences aseqs,\n+ * strip the gaps. Store the raw sequences in a new allocated array.\n+ * \n+ * Caller is responsible for free\'ing the memory allocated to\n+ * rseqs.\n+ * \n+ * Returns 1 on success. Returns 0 and sets squid_errno on\n+ * failure.\n+ */\n+int\n+DealignAseqs(char **aseqs, int num, char ***ret_rseqs)\n+{\n+ char **rseqs; /* de-aligned sequence array */\n+ int idx;\t\t\t/* counter for sequences */\n+ int depos; \t\t/* position counter for dealigned seq*/\n+ int apos;\t\t\t/* position counter for aligned seq */\n+ int seqlen;\t\t/* length of aligned seq */\n+\n+\t\t\t\t/* alloc space */\n+ rseqs = (char **) MallocOrDie (num * sizeof(char *));\n+\t\t\t\t/* main loop */\n+ for (idx = 0; idx < num; idx++)\n+ {\n+ seqlen = strlen(aseqs[idx]);\n+\t\t\t\t/* alloc space */\n+ rseqs[idx] = (char *) MallocOrDie ((seqlen + 1) * sizeof(char));\n+\n+\t\t\t\t/* strip gaps */\n+ depos = 0;\n+ for (apos = 0; aseqs[idx][apos] != \'\\0\'; apos++)\n+\tif (!isgap(aseqs[idx][apos]))\n+\t {\n+\t rseqs[idx][depos] = aseqs[idx][apos];\n+\t depos++;\n+\t }\n+ rseqs[idx][depos] = \'\\0\';\n+ }\n+ *ret_rseqs = rseqs;\n+ return 1;\n+}\n+\n+\n+/* Function: IsSELEXFormat()\n+ * \n+ * Return TRUE if filename may be in SELEX format.\n+ * \n+ * Accuracy is sacrificed for speed; a TRUE return does\n+ * *not* guarantee that the file will pass the stricter\n+ * error-checking of ReadSELEX(). All it checks is that\n+ * the first 500 non-comment lines of a file are \n+ * blank, or if there\'s a second "word" on the line\n+ * it looks like sequence (i.e., it\'s not kOtherSeq).\n+ * \n+ * Returns TRUE or FALSE.\n+ */\n+int\n+IsSELEXFormat(char *filename)\n+{\n+ FILE *fp; /* ptr to open sequence file */\n+ char buffer[LINEBUFLEN];\n+ char *sptr; /* ptr to first word */\n+ int linenum;\n+\n+\n+ if ((fp = fopen(filename, "r")) == NULL)\n+ { squid_errno = SQERR_NOFILE; return 0; }\n+\n+ linenum = 0;\n+ while (linenum < 500 && \n+\t fgets(buffer, LINEBUFLEN, fp) != NULL)\n+ {\n+ linenum++;\n+\t\t\t\t/* dead giveaways for extended SELEX */\n+ if (strncmp(buffer, "#=AU", 4) == 0) goto DONE;\n+ else if (strncmp(buffer, "#=ID", 4) == 0) goto DONE;\n+ else if (strncmp(buffer, "#=AC", 4) == 0) goto DONE;\n+ else if (strncmp(buffer, "#=DE", 4) == 0) goto DONE;\n+ else if (strncmp(buffer, "#=GA", 4) == 0) goto DONE;\n+ else if (strncmp(buffer, "#=TC", 4) == 0) goto DONE;\n+ else if (strncmp(buffer, "#=NC", 4) == 0) goto DONE;\n+ else if (strncmp(buffer, "#=SQ", 4) == 0) goto DONE;\n+ else if (strncmp(buffer, "#=SS", 4) == 0) goto DONE;\n+ else if (strncmp(buffer, "#=CS", 4) == 0) goto DONE;\n+ else if (strncmp(buffer, "#=RF", 4) == 0) goto DONE;\n+\n+\t\t\t\t/* a comment? */\n+ if (strchr(commentsyms, *buffer) != NULL) continue;\n+\n+\t\t\t\t/* a blank line? */\n+ if ((sptr = strtok(buffer, WHITESPACE)) == NULL) continue;\n+\n+\t\t\t\t/* a one-word line (name only)\n+\t\t\t\t is possible, though rare */\n+ if ((sptr = strtok(NULL, "\\n")) == NULL) continue;\n+ \n+ if (Seqtype(sptr) == kOtherSeq) {fclose(fp); return 0;}\n+ }\n+\n+ DONE:\n+ fclose(fp);\n+ return 1;\n+}\n+\n+\n+\n+\n+\n+\n+\n+\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/squid/seqencode.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/squid/seqencode.c Thu Jul 21 13:35:08 2011 -0400 |
[ |
@@ -0,0 +1,176 @@ +/***************************************************************** + * SQUID - a library of functions for biological sequence analysis + * Copyright (C) 1992-2002 Washington University School of Medicine + * + * This source code is freely distributed under the terms of the + * GNU General Public License. See the files COPYRIGHT and LICENSE + * for details. + *****************************************************************/ + +/* seqencode.c + * + * Routines for creating and manipulating encoded sequence strings. + * RCS $Id: seqencode.c 217 2011-03-19 10:27:10Z andreas $ (Original squid RCS Id: seqencode.c,v 1.3 1999/05/02 21:55:27 eddy Exp) + */ +#include <stdio.h> +#include <string.h> +#include <ctype.h> +#include "squid.h" + + +#ifdef MEMDEBUG +#include "dbmalloc.h" +#endif + /* seqcmp() + returns 0 if s1 == s2 + mismatch number otherwise */ +int +seqcmp(char *s1, char *s2, int allow) +{ + int mmat = 0; + + while ((*s1 != NTEND) && (*s2 != NTEND) && (mmat <= allow)) + { + if (!(ntmatch(*s1, *s2))) + mmat++;; + s1++; + s2++; + } + while ((*s1++ != NTEND) && (mmat <= allow)) + mmat++; + return(mmat); +} + /* seqncmp() + same as seqcmp but it looks at, + at most, n positions */ +int +seqncmp(char *s1, char *s2, int n, int allow) +{ + int mmat = 0; + + while ((*s2 != NTEND) && + (n-- != 0)) + { + if ((!(ntmatch(*s1, *s2))) && + (++mmat > allow)) + return(mmat); + s1++; + s2++; + } + while ((n-- != 0) && (*s1++ != NTEND) && (mmat <= allow)) + mmat++; + return (mmat); +} + + /* seqencode() + given a character text string str (A,C,G,T), + convert to an encoded seq string; + return 1 for success, 0 if fail */ +int +seqencode(char *codeseq, /* pre-allocated space for answer */ + char *str) /* character string to convert */ +{ + char *ptr; + int idx; + + ptr = codeseq; + while (*str != '\0') + { + if (islower((int) (*str))) *str = (char) toupper((int) (*str)); + for (idx = 0; *str != iupac[idx].sym && idx <= IUPACSYMNUM; idx++) + ; + if (idx > IUPACSYMNUM) + { + *ptr = (char) NTEND; + return 0; + } + else + *ptr = iupac[idx].code; + ptr++; + str++; + } + *ptr = NTEND; + return 1; +} + + +int +coded_revcomp(char *comp, char *seq) +{ + long bases; + char *bckp, *fwdp; + int idx; + long pos; + + bases = strlen(seq); + + fwdp = comp; + bckp = seq + bases -1; + for (pos = 0; pos < bases; pos++) + { + for (idx = 0; *bckp != iupac[idx].code && idx < IUPACSYMNUM; idx++); + if (idx > IUPACSYMNUM) + { + *fwdp = NTEND; + return 0; + } + else + *fwdp = iupac[idx].comp; + fwdp++; + bckp--; + } + *fwdp = NTEND; + return(1); +} + +int +seqdecode(char *str, char *codeseq) +{ + int idx; + int pos; + + pos = 0; + while (*codeseq != NTEND) + { + for (idx = 0; *codeseq != iupac[idx].code && idx < IUPACSYMNUM; idx++) + ; + if (idx > IUPACSYMNUM) + { + str[pos] = 'X'; + return 0; + } + else + str[pos] = iupac[idx].sym; + codeseq++; + pos++; + } + str[pos] = '\0'; + return 1; +} + +int +seqndecode( + char *str, /* pre-allocated string to write into */ + char *codeseq, /* sequence to decode */ + int n) /* how many bases to decode */ +{ + int idx; + int pos = 0; + + while (--n >= 0) + { + for (idx = 0; *codeseq != iupac[idx].code && idx < IUPACSYMNUM; idx++); + if (idx > IUPACSYMNUM) + { + str[pos] = 'X'; + return 0; + } + else + str[pos] = iupac[idx].sym; + codeseq++; + pos++; + } + str[pos] = '\0'; + return 1; +} + |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/squid/shuffle.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/squid/shuffle.c Thu Jul 21 13:35:08 2011 -0400 |
[ |
b'@@ -0,0 +1,638 @@\n+/*****************************************************************\n+ * SQUID - a library of functions for biological sequence analysis\n+ * Copyright (C) 1992-2002 Washington University School of Medicine\n+ * \n+ * This source code is freely distributed under the terms of the\n+ * GNU General Public License. See the files COPYRIGHT and LICENSE\n+ * for details.\n+ *****************************************************************/\n+\n+/* shuffle.c\n+ * \n+ * Routines for randomizing sequences.\n+ * \n+ * All routines are alphabet-independent (DNA, protein, RNA, whatever);\n+ * they assume that input strings are purely alphabetical [a-zA-Z], and\n+ * will return strings in all upper case [A-Z].\n+ * \n+ * All return 1 on success, and 0 on failure; 0 status invariably\n+ * means the input string was not alphabetical.\n+ * \n+ * StrShuffle() - shuffled string, preserve mono-symbol composition.\n+ * StrDPShuffle() - shuffled string, preserve mono- and di-symbol composition.\n+ * \n+ * StrMarkov0() - random string, same zeroth order Markov properties.\n+ * StrMarkov1() - random string, same first order Markov properties.\n+ * \n+ * StrReverse() - simple reversal of string\n+ * StrRegionalShuffle() - mono-symbol shuffled string in regional windows\n+ *\n+ * There are also similar routines for shuffling alignments:\n+ *\n+ * AlignmentShuffle() - alignment version of StrShuffle().\n+ * AlignmentBootstrap() - sample with replacement; a bootstrap dataset.\n+ * QRNAShuffle() - shuffle a pairwise alignment, preserving all gap positions.\n+ * \n+ * CVS $Id: shuffle.c,v 1.6 2002/10/09 14:26:09 eddy Exp)\n+ */\n+\n+#include <string.h>\n+#include <ctype.h>\n+\n+#include "squid.h"\n+#include "sre_random.h"\n+\n+/* Function: StrShuffle()\n+ * \n+ * Purpose: Returns a shuffled version of s2, in s1.\n+ * (s1 and s2 can be identical, to shuffle in place.)\n+ * \n+ * Args: s1 - allocated space for shuffled string.\n+ * s2 - string to shuffle.\n+ * \n+ * Return: 1 on success.\n+ */\n+int\n+StrShuffle(char *s1, char *s2)\n+{\n+ int len;\n+ int pos;\n+ char c;\n+ \n+ if (s1 != s2) strcpy(s1, s2);\n+ for (len = strlen(s1); len > 1; len--)\n+ {\t\t\t\t\n+ pos = CHOOSE(len);\n+ c = s1[pos];\n+ s1[pos] = s1[len-1];\n+ s1[len-1] = c;\n+ }\n+ return 1;\n+}\n+\n+/* Function: StrDPShuffle()\n+ * Date: SRE, Fri Oct 29 09:15:17 1999 [St. Louis]\n+ *\n+ * Purpose: Returns a shuffled version of s2, in s1.\n+ * (s1 and s2 may be identical; i.e. a string\n+ * may be shuffled in place.) The shuffle is a \n+ * "doublet-preserving" (DP) shuffle. Both\n+ * mono- and di-symbol composition are preserved.\n+ * \n+ * Done by searching for a random Eulerian \n+ * walk on a directed multigraph. \n+ * Reference: S.F. Altschul and B.W. Erickson, Mol. Biol.\n+ * Evol. 2:526-538, 1985. Quoted bits in my comments\n+ * are from Altschul\'s outline of the algorithm.\n+ *\n+ * Args: s1 - RETURN: the string after it\'s been shuffled\n+ * (space for s1 allocated by caller)\n+ * s2 - the string to be shuffled\n+ *\n+ * Returns: 0 if string can\'t be shuffled (it\'s not all [a-zA-z]\n+ * alphabetic.\n+ * 1 on success. \n+ */\n+int\n+StrDPShuffle(char *s1, char *s2)\n+{\n+ int len;\n+ int pos;\t/* a position in s1 or s2 */\n+ int x,y; /* indices of two characters */\n+ char **E; /* edge lists: E[0] is the edge list from vertex A */\n+ int *nE; /* lengths of edge lists */\n+ int *iE; /* positions in edge lists */\n+ int n;\t/* tmp: remaining length of an edge list to be shuffled */\n+ char sf; /* last character in s2 */\n+ char Z[26]; /* connectivity in last edge graph Z */ \n+ int keep_connecting; /* flag used in Z connectivity algorithm */\n+ int is_eulerian;\t\t/* flag used for when we\'ve got a good Z */\n+ \n+ /* First, verify that the string is en'..b'+ for (i = 0; i < nseq; i++)\n+ ali1[i][alen] = \'\\0\';\n+\n+ return 1;\n+}\n+\n+\n+/* Function: QRNAShuffle()\n+ * Date: SRE, Mon Dec 10 10:14:12 2001 [St. Louis]\n+ *\n+ * Purpose: Shuffle a pairwise alignment x,y while preserving the\n+ * position of gaps; return the shuffled alignment in xs,\n+ * ys.\n+ * \n+ * Works by doing three separate\n+ * shuffles, of (1) columns with residues in both\n+ * x and y, (2) columns with residue in x and gap in y,\n+ * and (3) columns with gap in x and residue in y.\n+ * \n+ * xs,x and ys,y may be identical: that is, to shuffle\n+ * an alignment "in place", destroying the original\n+ * alignment, just call:\n+ * QRNAShuffle(x,y,x,y);\n+ *\n+ * Args: xs, ys: allocated space for shuffled pairwise ali of x,y [L+1]\n+ * x, y: pairwise alignment to be shuffled [0..L-1]\n+ *\n+ * Returns: 1 on success, 0 on failure.\n+ * The shuffled alignment is returned in xs, ys.\n+ */\n+int\n+QRNAShuffle(char *xs, char *ys, char *x, char *y)\n+{\n+ int L;\n+ int *xycol, *xcol, *ycol;\n+ int nxy, nx, ny;\n+ int i;\n+ int pos, c;\n+ char xsym, ysym;\n+\n+ if (xs != x) strcpy(xs, x);\n+ if (ys != y) strcpy(ys, y);\n+\n+ /* First, construct three arrays containing lists of the column positions\n+ * of the three types of columns. (If a column contains gaps in both x and y,\n+ * we\'ve already simply copied it to the shuffled sequence.)\n+ */\n+ L = strlen(x);\n+ xycol = MallocOrDie(sizeof(int) * L);\n+ xcol = MallocOrDie(sizeof(int) * L);\n+ ycol = MallocOrDie(sizeof(int) * L);\n+ nxy = nx = ny = 0;\n+\n+ for (i = 0; i < L; i++)\n+ {\n+ if (isgap(x[i]) && isgap(y[i])) { continue; }\n+ else if (! isgap(x[i]) && ! isgap(y[i])) { xycol[nxy] = i; nxy++; }\n+ else if (isgap(x[i])) { ycol[ny] = i; ny++; }\n+ else if (isgap(y[i])) { xcol[nx] = i; nx++; }\n+ }\n+\n+ /* Second, shuffle the sequences indirectly, via shuffling these arrays.\n+ * Yow, careful with those indices, and with order of the statements...\n+ */\n+ for (; nxy > 1; nxy--) {\n+ pos = CHOOSE(nxy);\n+ xsym = xs[xycol[pos]]; ysym = ys[xycol[pos]]; c = xycol[pos]; \n+ xs[xycol[pos]] = xs[xycol[nxy-1]]; ys[xycol[pos]] = ys[xycol[nxy-1]]; xycol[pos] = xycol[nxy-1];\n+ xs[xycol[nxy-1]] = xsym; ys[xycol[nxy-1]] = ysym; xycol[pos] = xycol[nxy-1];\n+ }\n+ for (; nx > 1; nx--) {\n+ pos = CHOOSE(nx); \n+ xsym = xs[xcol[pos]]; ysym = ys[xcol[pos]]; c = xcol[pos]; \n+ xs[xcol[pos]] = xs[xcol[nx-1]]; ys[xcol[pos]] = ys[xcol[nx-1]]; xcol[pos] = xcol[nx-1]; \n+ xs[xcol[nx-1]] = xsym; ys[xcol[nx-1]] = ysym; xcol[nx-1] = c; \n+ }\n+ for (; ny > 1; ny--) {\n+ pos = CHOOSE(ny); \n+ xsym = xs[ycol[pos]]; ysym = ys[ycol[pos]]; c = ycol[pos]; \n+ xs[ycol[pos]] = xs[ycol[ny-1]]; ys[ycol[pos]] = ys[ycol[ny-1]]; ycol[pos] = ycol[ny-1];\n+ xs[ycol[ny-1]] = xsym; ys[ycol[ny-1]] = ysym; ycol[ny-1] = c; \n+ }\n+\n+ free(xycol); free(xcol); free(ycol);\n+ return 1;\n+}\n+\n+\n+#ifdef TESTDRIVER\n+/*\n+ * cc -g -o testdriver -DTESTDRIVER -L. shuffle.c -lsquid -lm\n+ */\n+int \n+main(int argc, char **argv)\n+{\n+ char s1[100];\n+ char s2[100];\n+\n+ sre_srandom(42);\n+ strcpy(s2, "GGGGGGGGGGCCCCCCCCCC");\n+ /* strcpy(s2, "AGACATAAAGTTCCGTACTGCCGGGAT");\n+ */\n+ StrDPShuffle(s1, s2);\n+ printf("DPshuffle: %s\\n", s1);\n+ StrMarkov0(s1,s2);\n+ printf("Markov 0 : %s\\n", s1);\n+ StrMarkov1(s1,s2);\n+ printf("Markov 1 : %s\\n", s1);\n+\n+ strcpy(s1, "ACGTACGT--------ACGTACGT----ACGTACGT");\n+ strcpy(s2, "ACGTACGTACGTACGT------------ACGTACGT");\n+ QRNAShuffle(s1,s2,s1,s2);\n+ printf("QRNA : %s\\n", s1);\n+ printf(" : %s\\n", s2);\n+\n+ return 0;\n+}\n+#endif\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/squid/sqerror.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/squid/sqerror.c Thu Jul 21 13:35:08 2011 -0400 |
[ |
@@ -0,0 +1,98 @@ +/***************************************************************** + * SQUID - a library of functions for biological sequence analysis + * Copyright (C) 1992-2002 Washington University School of Medicine + * + * This source code is freely distributed under the terms of the + * GNU General Public License. See the files COPYRIGHT and LICENSE + * for details. + *****************************************************************/ + +/* sqerror.c + * + * error handling for the squid library + * RCS $Id: sqerror.c 217 2011-03-19 10:27:10Z andreas $ (Original squid RCS Id: sqerror.c,v 1.4 1999/07/15 22:28:31 eddy Exp) + */ + + /* a global errno equivalent */ +int squid_errno; + +#include <stdio.h> +#include <stdlib.h> +#include <stdarg.h> + +#ifdef MEMDEBUG +#include "dbmalloc.h" +#endif + +/* Function: Die() + * + * Purpose: Print an error message and die. The arguments + * are formatted exactly like arguments to printf(). + * + * Return: None. Exits the program. + */ +/* VARARGS0 */ +void +Die(char *format, ...) +{ + va_list argp; + /* format the error mesg */ + fprintf(stderr, "\nFATAL: "); + va_start(argp, format); + vfprintf(stderr, format, argp); + va_end(argp); + fprintf(stderr, "\n"); + fflush(stderr); + /* exit */ + exit(1); +} + + + +/* Function: Warn() + * + * Purpose: Print an error message and return. The arguments + * are formatted exactly like arguments to printf(). + * + * Return: (void) + */ +/* VARARGS0 */ +void +#ifdef CLUSTALO +Warning(char *format, ...) +#else +Warn(char *format, ...) +#endif +{ + va_list argp; + /* format the error mesg */ + fprintf(stderr, "WARNING: "); + va_start(argp, format); + vfprintf(stderr, format, argp); + va_end(argp); + fprintf(stderr, "\n"); + fflush(stderr); +} + +/* Function: Panic() + * + * Purpose: Die from a lethal error that's not my problem, + * but instead a failure of a StdC/POSIX call that + * shouldn't fail. Call perror() to get the + * errno flag, then die. + * + * Usually called by the PANIC macro which adds + * the __FILE__ and __LINE__ information; see + * structs.h. + * + * Inspired by code in Donald Lewine's book, _POSIX + * Programmer's Guide_. + */ +void +Panic(char *file, int line) +{ + (void) fprintf(stderr, "\nPANIC [%s line %d] ", file, line); + (void) perror("Unusual error"); + exit(EXIT_FAILURE); +} + |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/squid/sqfuncs.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/squid/sqfuncs.h Thu Jul 21 13:35:08 2011 -0400 |
b |
b"@@ -0,0 +1,274 @@\n+/*****************************************************************\n+ * SQUID - a library of functions for biological sequence analysis\n+ * Copyright (C) 1992-2002 Washington University School of Medicine\n+ * \n+ * This source code is freely distributed under the terms of the\n+ * GNU General Public License. See the files COPYRIGHT and LICENSE\n+ * for details.\n+ *****************************************************************/\n+\n+#ifndef SQFUNCSH_INCLUDED\n+#define SQFUNCSH_INCLUDED\n+/* sqfuncs.h\n+ * \n+ * Prototypes for squid library functions;\n+ * also makes a good reference list for what the package contains.\n+ *\n+ * Warning: squid is a slowly evolving beast. Some functions are\n+ * obsolete. Some functions are probably just wrong, dating to\n+ * a primordial era before I knew anything about what I was doing.\n+ * Some functions are both obsolete and wrong but still necessary\n+ * to get legacy code to compile.\n+ *\n+ * CVS $Id: sqfuncs.h,v 1.28 2002/10/09 14:26:09 eddy Exp)\n+ */\n+\n+/* \n+ * from aligneval.c\n+ */\n+extern float ComparePairAlignments(char *known1, char *known2, char *calc1, char *calc2);\n+extern float CompareRefPairAlignments(int *ref, char *known1, char *known2, char *calc1, char *calc2);\n+extern float CompareMultAlignments(char **kseqs, char **tseqs, int N);\n+extern float CompareRefMultAlignments(int *ref, char **kseqs, char **tseqs, int N);\n+extern float PairwiseIdentity(char *s1, char *s2);\n+extern float AlignmentIdentityBySampling(char **aseq, int L, int N, int nsample);\n+extern char *MajorityRuleConsensus(char **aseq, int nseq, int alen);\n+\n+/* \n+ * from alignio.c\n+ */\n+extern void AllocAlignment(int nseq, int alen, char ***ret_aseq, AINFO *ainfo);\n+extern void InitAinfo(AINFO *ainfo);\n+extern void FreeAlignment(char **aseqs, AINFO *ainfo);\n+extern void SAMizeAlignment(char **aseq, int nseq, int alen);\n+extern void SAMizeAlignmentByGapFrac(char **aseq, int nseq, int alen, float maxgap);\n+extern int MakeAlignedString(char *aseq, int alen, char *ss, char **ret_s);\n+extern int MakeDealignedString(char *aseq, int alen, char *ss, char **ret_s);\n+extern int DealignedLength(char *aseq);\n+extern int WritePairwiseAlignment(FILE *ofp, char *aseq1, char *name1, int spos1,\n+\t\t\t\t char *aseq2, char *name2, int spos2,\n+\t\t\t\t int **pam, int indent);\n+extern int MingapAlignment(char **aseqs, AINFO *ainfo);\n+extern int RandomAlignment(char **rseqs, SQINFO *sqinfo, int nseq, float pop, float pex,\n+\t\t\t char ***ret_aseqs, AINFO *ainfo);\n+extern void AlignmentHomogenousGapsym(char **aseq, int nseq, int alen, char gapsym);\n+\n+/* from cluster.c\n+ */\n+extern int Cluster(float **mx, int N, enum clust_strategy mode, struct phylo_s **ret_tree);\n+extern struct phylo_s *AllocPhylo(int N);\n+extern void FreePhylo(struct phylo_s *tree, int N);\n+extern void MakeDiffMx(char **aseqs, int num, float ***ret_dmx);\n+extern void MakeIdentityMx(char **aseqs, int num, float ***ret_imx);\n+extern void PrintNewHampshireTree(FILE *fp, AINFO *ainfo, struct phylo_s *tree, int N);\n+extern void PrintPhylo(FILE *fp, AINFO *ainfo, struct phylo_s *tree, int N);\n+\n+/* \n+ * from dayhoff.c\n+ */\n+extern int ParsePAMFile(FILE *fp, int ***ret_pam, float *ret_scale);\n+extern void ScalePAM(int **pam, int scale);\n+\n+\n+/* from file.c\n+ */\n+extern char *FileDirname(char *filename);\n+extern char *FileTail(char *file, int noextension);\n+extern char *FileSameDirectory(char *full, char *file);\n+extern char *FileConcat(char *dir, char *file);\n+extern char *FileAddSuffix(char *filename, char *sfx);\n+extern FILE *EnvFileOpen(char *fname, char *env, char **ret_dir);\n+extern int FileExists(char *filename);\n+\n+\n+/* from getopt.c\n+ */\n+extern int Getopt(int argc, char **argv, \n+\t\t struct opt_s *opt, int nopts, char *usage,\n+\t\t int *ret_optind, char **ret_optname, char **ret_optarg);\n+\n+\n+/* from hsregex.c\n+ * Henry Spencer's regex() code\n+ */\n+extern int Strparse(char *rexp, char *s, int ntok);\n+extern void SqdClean"..b'tion(SQFILE *sfp, SSIOFFSET *offset);\n+extern void SeqfileRewind(SQFILE *sfp);\n+extern void SeqfileClose(SQFILE *sfp);\n+\n+extern int ReadSeq(SQFILE *fp, int format, char **ret_seq, SQINFO *sqinfo);\n+extern int GCGBinaryToSequence(char *seq, int len);\n+extern int GCGchecksum(char *seq, int seqlen);\n+extern int GCGMultchecksum(char **seqs, int nseq);\n+extern void WriteSimpleFASTA(FILE *fp, char *seq, char *name, char *desc);\n+extern int WriteSeq(FILE *outf, int outfmt, char *seq, SQINFO *sqinfo);\n+extern int Seqtype(char *seq);\n+extern int GuessAlignmentSeqtype(char **aseq, int nseq);\n+extern int String2SeqfileFormat(char *s);\n+extern char *SeqfileFormat2String(int code);\n+extern SQINFO *MSAToSqinfo(MSA *msa); \n+\n+/* from squidcore.c\n+ */\n+extern void Banner(FILE *fp, char *banner); \n+\n+\n+/* from sre_ctype.c\n+ */\n+extern int sre_tolower(int c);\n+extern int sre_toupper(int c);\n+\n+/* from sre_math.c\n+ */\n+extern int Linefit(float *x, float *y, int N, \n+\t\t float *ret_a, float *ret_b, float *ret_r);\n+extern void WeightedLinefit(float *x, float *y, float *var, int N,\n+\t\t\t float *ret_m, float *ret_b);\n+extern double Gammln(double xx);\n+extern float **FMX2Alloc(int rows, int cols);\n+extern void FMX2Free(float **mx);\n+extern double **DMX2Alloc(int rows, int cols);\n+extern void DMX2Free(double **mx);\n+extern void FMX2Multiply(float **A, float **B, float **C, int m, int p, int n);\n+extern double IncompleteGamma(double a, double x);\n+\n+/* from sre_string.c\n+ */\n+#ifdef NOSTR\n+extern char *strstr(char *s, char *subs);\n+#endif\n+extern char *Strdup(char *s);\n+extern void StringChop(char *s);\n+extern int Strinsert(char *s1, char c, int pos);\n+extern int Strdelete(char *s1, int pos);\n+extern void s2lower(char *s);\n+extern void s2upper(char *s);\n+extern void *sre_malloc(char *file, int line, size_t size);\n+extern void *sre_realloc(char *file, int line, void *p, size_t size);\n+extern void Free2DArray(void **p, int dim1);\n+extern void Free3DArray(void ***p, int dim1, int dim2);\n+extern char *RandomSequence(char *alphabet, float *p, int n, int len);\n+extern char *sre_fgets(char **buf, int *n, FILE *fp);\n+extern int sre_strcat(char **dest, int ldest, char *src, int lsrc);\n+extern char *sre_strtok(char **s, char *delim, int *len);\n+extern char *sre_strdup(char *s, int n);\n+extern char *sre_strncat(char *s1, char *s2, int n);\n+extern int IsBlankline(char *s);\n+\n+/* from stack.c\n+ */\n+extern struct intstack_s *InitIntStack(void);\n+extern void PushIntStack(struct intstack_s *stack, int data);\n+extern int PopIntStack(struct intstack_s *stack, int *ret_data);\n+extern void ReverseIntStack(struct intstack_s *stack);\n+extern int FreeIntStack( struct intstack_s *stack );\n+\n+/* \n+ * from translate.c\n+ */\n+extern char *Translate(char *seq, char **code);\n+\n+/* \n+ * from types.c\n+ */\n+extern int IsInt(char *s);\n+extern int IsReal(char *s);\n+extern void Byteswap(char *swap, int nbytes);\n+#ifndef USE_HOST_BYTESWAP_FUNCTIONS\n+extern sqd_uint16 sre_ntoh16(sqd_uint16 netshort);\n+extern sqd_uint32 sre_ntoh32(sqd_uint32 netlong);\n+extern sqd_uint16 sre_hton16(sqd_uint16 hostshort);\n+extern sqd_uint32 sre_hton32(sqd_uint32 hostlong);\n+#endif /*!USE_HOST_BYTESWAP_FUNCTIONS*/\n+extern sqd_uint64 sre_ntoh64(sqd_uint64 net_int64);\n+extern sqd_uint64 sre_hton64(sqd_uint64 host_int64);\n+\n+/* \n+ * from weight.c\n+ */\n+extern void GSCWeights(char **aseq, int nseq, int alen, float *wgt);\n+extern void VoronoiWeights(char **aseq, int nseq, int alen, float *wgt);\n+extern void BlosumWeights(char **aseq, int nseq, int alen, float blosumlevel, float *wgt);\n+extern void PositionBasedWeights(char **aseq, int nseq, int alen, float *wgt);\n+extern void FilterAlignment(MSA *msa, float cutoff, MSA **ret_new);\n+extern void SampleAlignment(MSA *msa, int sample, MSA **ret_new);\n+extern void SingleLinkCluster(char **aseq, int nseq, int alen, float maxid, \n+\t\t int **ret_c, int *ret_nc);\n+#endif /* SQFUNCSH_INCLUDED */\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/squid/sqio.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/squid/sqio.c Thu Jul 21 13:35:08 2011 -0400 |
[ |
b'@@ -0,0 +1,2041 @@\n+/*****************************************************************\n+ * SQUID - a library of functions for biological sequence analysis\n+ * Copyright (C) 1992-2002 Washington University School of Medicine\n+ * \n+ * This source code is freely distributed under the terms of the\n+ * GNU General Public License. See the files COPYRIGHT and LICENSE\n+ * for details.\n+ *****************************************************************/\n+\n+/* File: sqio.c\n+ * From: ureadseq.c in Don Gilbert\'s sequence i/o package\n+ *\n+ * Reads and writes nucleic/protein sequence in various\n+ * formats. Data files may have multiple sequences.\n+ *\n+ * Heavily modified from READSEQ package\n+ * Copyright (C) 1990 by D.G. Gilbert\n+ * Biology Dept., Indiana University, Bloomington, IN 47405\n+ * email: gilbertd@bio.indiana.edu\n+ * Thanks Don!\n+ *\n+ * SRE: Modifications as noted. Fri Jul 3 09:44:54 1992\n+ * Packaged for squid, Thu Oct 1 10:07:11 1992\n+ * ANSI conversion in full swing, Mon Jul 12 12:22:21 1993\n+ *\n+ * CVS $Id: sqio.c,v 1.29 2002/08/26 23:10:52 eddy Exp)\n+ * \n+ *****************************************************************\n+ * Basic API for single sequence reading:\n+ * \n+ * SQFILE *sqfp;\n+ * char *seqfile;\n+ * int format; - see squid.h for formats; example: SQFILE_FASTA\n+ * char *seq;\n+ * SQINFO sqinfo;\n+ * \n+ * if ((sqfp = SeqfileOpen(seqfile, format, "BLASTDB")) == NULL)\n+ * Die("Failed to open sequence database file %s\\n%s\\n", seqfile, usage);\n+ * while (ReadSeq(sqfp, sqfp->format, &seq, &sqinfo)) {\n+ * do_stuff;\n+ * FreeSequence(seq, &sqinfo);\n+ * }\n+ * SeqfileClose(sqfp); \n+ * \n+ ***************************************************************** \n+ */\n+\n+#include <stdio.h>\n+#include <stdlib.h>\n+#include <string.h>\n+#include <ctype.h>\n+\n+#ifndef SEEK_SET\n+#include <unistd.h>\t\n+#endif\n+\n+#include "squid.h"\n+#include "msa.h"\n+#include "ssi.h"\n+\n+static void SeqfileGetLine(SQFILE *V);\n+\n+#define kStartLength 500\n+\n+static char *aminos = "ABCDEFGHIKLMNPQRSTVWXYZ*";\n+static char *primenuc = "ACGTUN";\n+static char *protonly = "EFIPQZ";\n+\n+static SQFILE *seqfile_open(char *filename, int format, char *env, int ssimode);\n+\n+/* Function: SeqfileOpen()\n+ * \n+ * Purpose : Open a sequence database file and prepare for reading\n+ * sequentially.\n+ * \n+ * Args: filename - name of file to open\n+ * format - format of file\n+ * env - environment variable for path (e.g. BLASTDB) \n+ * ssimode - -1, SSI_OFFSET_I32, or SSI_OFFSET_I64\n+ *\n+ * Returns opened SQFILE ptr, or NULL on failure.\n+ */\n+SQFILE *\n+SeqfileOpen(char *filename, int format, char *env)\n+{\n+ return seqfile_open(filename, format, env, -1);\n+}\n+SQFILE *\n+SeqfileOpenForIndexing(char *filename, int format, char *env, int ssimode)\n+{\n+ return seqfile_open(filename, format, env, ssimode);\n+}\n+static SQFILE *\n+seqfile_open(char *filename, int format, char *env, int ssimode)\n+{\n+ SQFILE *dbfp;\n+\n+ dbfp = (SQFILE *) MallocOrDie (sizeof(SQFILE));\n+\n+ dbfp->ssimode = ssimode;\n+ dbfp->rpl = -1;\t\t/* flag meaning "unset" */\n+ dbfp->lastrpl = 0;\n+ dbfp->maxrpl = 0;\n+ dbfp->bpl = -1;\t\t/* flag meaning "unset" */\n+ dbfp->lastbpl = 0;\n+ dbfp->maxbpl = 0;\n+\n+ /* Open our file handle.\n+ * Three possibilities:\n+ * 1. normal file open\n+ * 2. filename = "-"; read from stdin\n+ * 3. filename = "*.gz"; read thru pipe from gzip \n+ * If we\'re reading from stdin or a pipe, we can\'t reliably\n+ * back up, so we can\'t do two-pass parsers like the interleaved alignment \n+ * formats.\n+ */\n+ if (strcmp(filename, "-") == 0)\n+ {\n+ dbfp->f = stdin;\n+ dbfp->do_stdin = TRUE; \n+ dbfp->do_gzip = FALSE;\n+ dbfp->fname = sre_strdup("[STDIN]", -1);\n+ }\n+#ifndef SRE_STRICT_ANSI\n+ /* popen(), pclose() aren\'t portable to non-POSIX systems; disable */\n+ else if (Strparse("^.*\\\\.gz$", filename, 0)'..b'eFormat2String(int code)\n+{\n+ switch (code) {\n+ case SQFILE_UNKNOWN: return "unknown";\n+ case SQFILE_FASTA: return "FASTA";\n+#ifdef CLUSTALO\n+ case SQFILE_VIENNA: return "Vienna";\n+#endif\n+ case SQFILE_GENBANK: return "Genbank";\n+ case SQFILE_EMBL: return "EMBL"; \n+ case SQFILE_GCG: return "GCG";\n+ case SQFILE_GCGDATA: return "GCG data library";\n+ case SQFILE_RAW: return "raw"; \n+ case SQFILE_IG: return "Intelligenetics";\n+ case SQFILE_STRIDER: return "MacStrider";\n+ case SQFILE_IDRAW: return "Idraw Postscript";\n+ case SQFILE_ZUKER: return "Zuker"; \n+ case SQFILE_PIR: return "PIR";\n+ case SQFILE_SQUID: return "SQUID";\n+ case MSAFILE_STOCKHOLM: return "Stockholm";\n+ case MSAFILE_SELEX: return "SELEX";\n+ case MSAFILE_MSF: return "MSF";\n+ case MSAFILE_CLUSTAL: return "Clustal";\n+ case MSAFILE_A2M: return "a2m";\n+ case MSAFILE_PHYLIP: return "Phylip";\n+ case MSAFILE_EPS: return "EPS";\n+ default: \n+ Die("Bad code passed to MSAFormat2String()");\n+ }\n+ /*NOTREACHED*/\n+ return NULL;\n+}\n+\n+\n+/* Function: MSAToSqinfo()\n+ * Date: SRE, Tue Jul 20 14:36:56 1999 [St. Louis]\n+ *\n+ * Purpose: Take an MSA and generate a SQINFO array suitable\n+ * for use in annotating the unaligned sequences.\n+ * Return the array.\n+ * \n+ * Permanent temporary code. sqinfo was poorly designed.\n+ * it must eventually be replaced, but the odds\n+ * of this happening soon are nil, so I have to deal.\n+ *\n+ * Args: msa - the alignment\n+ *\n+ * Returns: ptr to allocated sqinfo array.\n+ * Freeing is ghastly: free in each individual sqinfo[i] \n+ * with FreeSequence(NULL, &(sqinfo[i])), then\n+ * free(sqinfo).\n+ */\n+SQINFO *\n+MSAToSqinfo(MSA *msa)\n+{\n+ int idx;\n+ SQINFO *sqinfo;\n+\n+ sqinfo = MallocOrDie(sizeof(SQINFO) * msa->nseq);\n+\n+ for (idx = 0; idx < msa->nseq; idx++)\n+ {\n+ sqinfo[idx].flags = 0;\n+ SetSeqinfoString(&(sqinfo[idx]), \n+\t\t msa->sqname[idx], SQINFO_NAME);\n+ SetSeqinfoString(&(sqinfo[idx]), \n+\t\t MSAGetSeqAccession(msa, idx), SQINFO_ACC);\n+ SetSeqinfoString(&(sqinfo[idx]), \n+\t\t MSAGetSeqDescription(msa, idx), SQINFO_DESC);\n+\n+ if (msa->ss != NULL && msa->ss[idx] != NULL) {\n+\tMakeDealignedString(msa->aseq[idx], msa->alen, \n+\t\t\t msa->ss[idx], &(sqinfo[idx].ss));\n+\tsqinfo[idx].flags |= SQINFO_SS;\n+ }\n+\n+ if (msa->sa != NULL && msa->sa[idx] != NULL) {\n+\tMakeDealignedString(msa->aseq[idx], msa->alen, \n+\t\t\t msa->sa[idx], &(sqinfo[idx].sa));\n+\tsqinfo[idx].flags |= SQINFO_SA;\n+ }\n+\n+ sqinfo[idx].len = DealignedLength(msa->aseq[idx]);\n+ sqinfo[idx].flags |= SQINFO_LEN;\n+ }\n+ return sqinfo;\n+}\n+\n+\n+\n+/* cc -o sqio_test -DA_QUIET_DAY -L. sqio.c -lsquid */\n+#ifdef A_QUIET_DAY\n+#include "ssi.h"\n+int\n+main(int argc, char **argv)\n+{\n+ FILE *fp;\n+ char *filename;\n+ char *buf;\n+ int len;\n+ int mode = 3;\n+ SSIOFFSET off;\n+\n+ filename = argv[1];\n+\n+ if (mode == 1) {\n+ buf = malloc(sizeof(char) * 256);\n+ if ((fp = fopen(filename, "r")) == NULL)\n+ Die("open of %s failed", filename); \n+ while (fgets(buf, 255, fp) != NULL)\n+ ;\n+ fclose(fp);\n+ free(buf);\n+ } else if (mode == 2) {\n+ if ((fp = fopen(filename, "r")) == NULL)\n+ Die("open of %s failed", filename); \n+ buf = NULL; len = 0;\n+ while (sre_fgets(&buf, &len, fp) != NULL)\n+ SSIGetFilePosition(fp, SSI_OFFSET_I32, &off); \n+ fclose(fp);\n+ free(buf);\n+ } else if (mode == 3) {\n+ SQFILE *dbfp;\n+ SQINFO info;\n+\n+ if ((dbfp = SeqfileOpen(filename, SQFILE_FASTA, NULL)) == NULL)\n+ Die("open of %s failed", filename); \n+ while (ReadSeq(dbfp, dbfp->format, &buf, &info)) { \n+ SSIGetFilePosition(dbfp->f, SSI_OFFSET_I32, &off); \n+ FreeSequence(buf, &info);\n+ }\n+ SeqfileClose(dbfp);\n+ }\n+ \n+}\n+ \n+\n+#endif\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/squid/squid-1.9g.tar.gz |
b |
Binary file clustalomega/clustal-omega-1.0.2/src/squid/squid-1.9g.tar.gz has changed |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/squid/squid.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/squid/squid.h Thu Jul 21 13:35:08 2011 -0400 |
[ |
b'@@ -0,0 +1,531 @@\n+/* Generated automatically from squid.h.in by configure. */\n+/*****************************************************************\n+ * SQUID - a library of functions for biological sequence analysis\n+ * Copyright (C) 1992-2002 Washington University School of Medicine\n+ * \n+ * This source code is freely distributed under the terms of the\n+ * GNU General Public License. See the files COPYRIGHT and LICENSE\n+ * for details.\n+ *****************************************************************/\n+\n+#ifndef SQUIDH_INCLUDED\n+#define SQUIDH_INCLUDED\n+\n+/* squid.h\n+ * Header file for my library of sequence functions.\n+ *\n+ * CVS $Id: squid.h.in,v 1.5 2002/10/09 14:26:09 eddy Exp)\n+ */\n+\n+#include <stdio.h>\n+#include <math.h>\n+#include <stdlib.h>\n+#include <unistd.h>\t\t/* for sysconf() #define\'s */\n+\n+\n+#if DEBUGLEVEL > 0\n+#include <assert.h>\t\t/* for SQD_DASSERT1(), etc. */\n+#endif\n+\n+/* include clustal\'s config.h */\n+#ifdef CLUSTALO\n+#include "config.h"\n+#define CLUSTALO 1\n+#else\n+#include "clustal-omega-config.h"\n+#define CLUSTALO 1\n+#endif\n+\n+#ifdef CLUSTALO\n+/* we don\'t want squidconf.h but our own config header. but, there are\n+ * some checks, espcially at the end of squidconf.h might be\n+ * necessary for squid to work. They follow after the inclusion of\n+ * config.h\n+ */\n+#undef DEBUG\n+\n+/* squidconf.h checks:\n+ */\n+#if defined HAVE_NTOHL && defined HAVE_NTOHS && defined HAVE_HTONS && defined HAVE_HTONL\n+#define USE_HOST_BYTESWAP_FUNCTIONS 1\n+#endif\n+/* On 64-bit machines like Alphas, strtoull doesn\'t exist, strotul will work\n+ */\n+#if SIZEOF_UNSIGNED_LONG == 8 && defined HAVE_STRTOUL && ! defined HAVE_STRTOULL\n+#define strtoull strtoul\n+#endif\n+\n+#if defined HAVE_FTELLO && defined HAVE_FSEEKO && SIZEOF_OFF_T == 8\n+#define HAS_64BIT_FILE_OFFSETS 1\n+#elif defined HAVE_FTELLO64 && defined HAVE_FSEEKO64 && SIZEOF_OFF64_T == 8\n+#define HAS_64BIT_FILE_OFFSETS 1\n+#elif defined HAVE_FTELL64 && defined HAVE_FSEEK64 \n+#define HAS_64BIT_FILE_OFFSETS 1\n+#elif defined ARITHMETIC_FPOS_T && SIZEOF_FPOS_T == 8\n+#define HAS_64BIT_FILE_OFFSETS 1\n+#else\n+#undef HAS_64BIT_FILE_OFFSETS \n+#endif\n+\n+/* The following check seems like nonsense to me (AW), therefore */\n+#if 0\n+/* Stuff to work around Tru64 not having strtoull() -\n+ * on systems with 64-bit longs, we can use strtoul()\n+ */\n+#undef HAVE_STRTOULL\n+#if ! defined HAVE_STRTOULL && SIZEOF_UNSIGNED_LONG == 8\n+#define strtoull strtoul\n+#endif\n+#endif\n+\n+#else /* CLUSTALO */\n+#include "squidconf.h"\t\t/* #define\'s generated by ./configure script */\n+#endif\n+\n+/*****************************************************************\n+ * Integers of guaranteed size. (used for instance in gsi.c, gsi2.c)\n+ * These are set by the ./configure script; if they show up as FIXME,\n+ * they must be manually edited to appropriate type definitions. You\n+ * do need 64-bit integers in the current code; email me if this\n+ * prevents you from compiling SQUID and tell me your system (I don\'t\n+ * know of any systems that don\'t have 64-bit integers these days).\n+ *****************************************************************/\n+typedef unsigned short sqd_uint16;\n+typedef unsigned int sqd_uint32;\n+typedef unsigned long sqd_uint64;\n+\n+#ifdef USE_HOST_BYTESWAP_FUNCTIONS\n+#include <sys/types.h>\t\t/* only for ntohl() and friends. */\n+#include <netinet/in.h>\t\t/* only for ntohl() and friends. */\n+#define sre_ntoh16(x) ntohs(x);\n+#define sre_ntoh32(x) ntohl(x);\n+#define sre_hton16(x) htons(x);\n+#define sre_hton32(x) htonl(x);\n+#endif /* USE_HOST_BYTESWAP_FUNCTIONS */\n+\n+/* Library version info is made available as a global to\n+ * any interested program. These are defined in iupac.c\n+ * with the other globals.\n+ */\n+extern char squid_version[];\t/* version number */\n+extern char squid_date[];\t/* date of release */\n+extern int squid_errno;\t/* error codes */\n+\n+\n+\n+/****************************************************\n+ * Error codes returned by squid library functions (squid_errn'..b' library.\n+ ****************************************************/\n+\n+#define NSUBEXP 10\n+typedef struct sqd_regexp {\n+\tchar *startp[NSUBEXP];\n+\tchar *endp[NSUBEXP];\n+\tchar regstart;\t\t/* Internal use only. */\n+\tchar reganch;\t\t/* Internal use only. */\n+\tchar *regmust;\t\t/* Internal use only. */\n+\tint regmlen;\t\t/* Internal use only. */\n+\tchar program[1];\t/* Unwarranted chumminess with compiler. */\n+} sqd_regexp;\n+\n+/* Strparse() defines and manages these. \n+ * sqd_parse[0] contains the substring that matched the pattern.\n+ * sqd_parse[1-9] contain substrings matched with ()\'s.\n+ */\n+extern char *sqd_parse[10];\n+\n+/****************************************************\n+ * Portable detection of multiprocessor # of CPUs.\n+ * #include <unistd.h>\n+ * long foo = SQD_NPROC;\n+ * returns the number of available processors.\n+ * if foo == -1, we failed.\n+ ****************************************************/\n+\n+/* Our problem here is that POSIX apparently doesn\'t specify\n+ * a standard for how to get sysconf() to report the number of\n+ * processors on-line. _SC_NPROCESSORS_ONLN is specified\n+ * by SVR4.0MP. Thanks to W. Gish for help here.\n+ */\n+#undef SQD_NPROC\n+#ifdef _SC_NPROCESSORS_ONLN /* Sun Solaris, Digital UNIX */\n+#define SQD_NPROC sysconf(_SC_NPROCESSORS_ONLN)\n+#else\n+#ifdef _SC_NPROC_ONLN\t\t/* Silicon Graphics IRIX */\n+#define SQD_NPROC sysconf(_SC_NPROC_ONLN)\n+#else /* FreeBSD, Linux don\'t support getting ncpu via sysconf() */\n+#define SQD_NPROC -1\n+#endif\n+#endif\n+\n+/****************************************************\n+ * Three levels of debugging printf\'s and assert\'s\n+ * level 1: little impact on verbosity or performance\n+ * level 2: moderate impact\n+ * level 3: high impact\n+ * Example:\n+ * SQD_DPRINTF3(("Matrix row %d col %d = %f\\n", i, j, val));\n+ * Note the double parentheses; these are important.\n+ ****************************************************/\n+\n+#ifndef DEBUGLEVEL\n+#define DEBUGLEVEL 0\n+#endif\n+\n+#if (DEBUGLEVEL >= 1)\n+#define SQD_DPRINTF1(x) printf x\n+#define SQD_DASSERT1(x) assert x\n+#else\n+#define SQD_DPRINTF1(x) \n+#define SQD_DASSERT1(x)\n+#endif\n+#if (DEBUGLEVEL >= 2)\n+#define SQD_DPRINTF2(x) printf x\n+#define SQD_DASSERT2(x) assert x\n+#else\n+#define SQD_DPRINTF2(x) \n+#define SQD_DASSERT2(x)\n+#endif\n+#if (DEBUGLEVEL >= 3)\n+#define SQD_DPRINTF3(x) printf x\n+#define SQD_DASSERT3(x) assert x\n+#else\n+#define SQD_DPRINTF3(x) \n+#define SQD_DASSERT3(x)\n+#endif\n+\n+/* PANIC is called for failures of Std C/POSIX functions,\n+ * instead of my own functions. Panic() calls perror() and exits\n+ * abnormally.\n+ */\n+#define PANIC Panic(__FILE__, __LINE__)\n+\n+/* Malloc/realloc calls are wrapped\n+ */\n+#define MallocOrDie(x) sre_malloc(__FILE__, __LINE__, (x))\n+#define ReallocOrDie(x,y) sre_realloc(__FILE__, __LINE__, (x), (y))\n+\n+/****************************************************\n+ * Miscellaneous macros and defines\n+ ****************************************************/\n+\n+#define SQDCONST_E 2.71828182845904523536028747135\n+#define SQDCONST_PI 3.14159265358979323846264338328\n+\n+\t\t\t\t/* must declare swapfoo to use SWAP() */\n+#define SWAP(a,b) {swapfoo = b; b = a; a = swapfoo;}\n+#define ScalarsEqual(a,b) (fabs((a)-(b)) < 1e-7)\n+\n+#ifndef MIN\n+#define MIN(a,b) (((a)<(b))?(a):(b))\n+#endif\n+#ifndef MAX\n+#define MAX(a,b) (((a)>(b))?(a):(b))\n+#endif\n+\n+/* For convenience and (one hopes) clarity in boolean tests:\n+ */\n+#ifndef TRUE\n+#define TRUE 1\n+#endif\n+#ifndef FALSE \n+#define FALSE 0\n+#endif\n+\n+/* Somewhere, there is a universe in which Unix vendors comply\n+ * with the ANSI C standard. Unfortunately, it is not ours:\n+ */\n+#ifndef EXIT_SUCCESS\n+#define EXIT_SUCCESS 0\n+#endif\n+#ifndef EXIT_FAILURE\n+#define EXIT_FAILURE 1\n+#endif\n+\n+#include "sqfuncs.h"\t\t/* squid function declarations */\n+#include "sre_random.h" /* random number generator and samplers */\n+#include "vectorops.h" /* vector operations */\n+#endif /* SQUIDH_INCLUDED */\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/squid/squidcore.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/squid/squidcore.c Thu Jul 21 13:35:08 2011 -0400 |
[ |
@@ -0,0 +1,52 @@ +/************************************************************ + * SQUID - a library of functions for biological sequence analysis + * Copyright (C) 1992-2002 Washington University School of Medicine + * + * This source code is freely distributed under the terms of the + * GNU General Public License. See the files COPYRIGHT and LICENSE + * for details. + ************************************************************/ + +/* squidcore.c + * SRE, Sun Jun 20 17:19:04 1999 [Graeme's kitchen] + * + * Core functions for SQUID library. + * RCS $Id: squidcore.c 217 2011-03-19 10:27:10Z andreas $ (Original squid RCS Id: squidcore.c,v 1.1 1999/07/15 22:24:41 eddy Exp) + */ + +#include <stdio.h> +#include "version.h" + +/* Function: Banner() + * Date: SRE, Sun Jun 20 17:19:41 1999 [Graeme's kitchen] + * + * Purpose: Print a package version and copyright banner. + * Used by all the main()'s. + * + * Expects to be able to pick up defined macros: + * macro example + * ------ -------------- + * PACKAGE "HMMER" + * RELEASE "2.0.42" + * RELEASEDATE "April 1 1999" + * COPYRIGHT "Copyright (C) 1992-1999 Washington University School of Medicine" + * LICENSE "HMMER is freely distributed under the GNU General Public License (GPL)." + * + * This gives us a general mechanism to update release information + * without changing multiple points in the code; we can also override + * SQUID release data with another package's release data (e.g. + * HMMER) just by redefining macros. + * + * Args: fp - where to print it + * banner - one-line program description, e.g.: + * "foobar - make bars from foo with elan" + * Returns: (void) + */ +void +Banner(FILE *fp, char *banner) +{ + fprintf(fp, "%s\n%s %s (%s)\n%s\n%s\n", banner, PACKAGE, RELEASE, RELEASEDATE, COPYRIGHT, LICENSE); + fprintf(fp, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n"); +} + + |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/squid/sre_ctype.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/squid/sre_ctype.c Thu Jul 21 13:35:08 2011 -0400 |
b |
@@ -0,0 +1,34 @@ +/***************************************************************** + * SQUID - a library of functions for biological sequence analysis + * Copyright (C) 1992-2002 Washington University School of Medicine + * + * This source code is freely distributed under the terms of the + * GNU General Public License. See the files COPYRIGHT and LICENSE + * for details. + *****************************************************************/ + +/* sre_ctype.c + * + * For portability. Some systems have functions tolower, toupper + * as macros (for instance, MIPS M-2000 RISC/os!) + * + * RCS $Id: sre_ctype.c 217 2011-03-19 10:27:10Z andreas $ (Original squid RCS Id: sre_ctype.c,v 1.3 2001/09/02 23:43:19 eddy Exp) + */ + +#include <ctype.h> +#include "squid.h" + +int +sre_tolower(int c) +{ + if (isupper(c)) return tolower(c); + else return c; +} + +int +sre_toupper(int c) +{ + if (islower(c)) return toupper(c); + else return c; +} + |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/squid/sre_math.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/squid/sre_math.c Thu Jul 21 13:35:08 2011 -0400 |
[ |
b'@@ -0,0 +1,331 @@\n+/*****************************************************************\n+ * SQUID - a library of functions for biological sequence analysis\n+ * Copyright (C) 1992-2002 Washington University School of Medicine\n+ * \n+ * This source code is freely distributed under the terms of the\n+ * GNU General Public License. See the files COPYRIGHT and LICENSE\n+ * for details.\n+ *****************************************************************/\n+\n+/* sre_math.c\n+ * \n+ * Portability for and extensions to C math library.\n+ * RCS $Id: sre_math.c 217 2011-03-19 10:27:10Z andreas $ (Original squid RCS Id: sre_math.c,v 1.12 2002/10/09 14:26:09 eddy Exp)\n+ */\n+\n+#include <stdio.h>\n+#include <stdlib.h>\n+#include <math.h>\n+#include "squid.h"\n+\n+ \n+/* Function: Linefit()\n+ * \n+ * Purpose: Given points x[0..N-1] and y[0..N-1], fit to\n+ * a straight line y = a + bx.\n+ * a, b, and the linear correlation coefficient r\n+ * are filled in for return.\n+ * \n+ * Args: x - x values of data\n+ * y - y values of data \n+ * N - number of data points\n+ * ret_a - RETURN: intercept\n+ * ret_b - RETURN: slope\n+ * ret_r - RETURN: correlation coefficient \n+ * \n+ * Return: 1 on success, 0 on failure.\n+ */\n+int \n+Linefit(float *x, float *y, int N, float *ret_a, float *ret_b, float *ret_r) \n+{\t\t\t\t\n+ float xavg, yavg;\n+ float sxx, syy, sxy;\n+ int i;\n+ \n+ /* Calculate averages, xavg and yavg\n+ */\n+ xavg = yavg = 0.0;\n+ for (i = 0; i < N; i++)\n+ {\n+ xavg += x[i];\n+ yavg += y[i];\n+ }\n+ xavg /= (float) N;\n+ yavg /= (float) N;\n+\n+ sxx = syy = sxy = 0.0;\n+ for (i = 0; i < N; i++)\n+ {\n+ sxx += (x[i] - xavg) * (x[i] - xavg);\n+ syy += (y[i] - yavg) * (y[i] - xavg);\n+ sxy += (x[i] - xavg) * (y[i] - yavg);\n+ }\n+ *ret_b = sxy / sxx;\n+ *ret_a = yavg - xavg*(*ret_b);\n+ *ret_r = sxy / (sqrt(sxx) * sqrt(syy));\n+ return 1;\n+}\n+\n+\n+/* Function: WeightedLinefit()\n+ * \n+ * Purpose: Given points x[0..N-1] and y[0..N-1] with\n+ * variances (measurement errors) var[0..N-1], \n+ * fit to a straight line y = mx + b.\n+ * \n+ * Method: Algorithm from Numerical Recipes in C, [Press88].\n+ * \n+ * Return: (void)\n+ * ret_m contains slope; ret_b contains intercept \n+ */ \n+void\n+WeightedLinefit(float *x, float *y, float *var, int N, float *ret_m, float *ret_b) \n+{\n+ int i;\n+ double s;\n+ double sx, sy;\n+ double sxx, sxy;\n+ double delta;\n+ double m, b;\n+ \n+ s = sx = sy = sxx = sxy = 0.;\n+ for (i = 0; i < N; i++)\n+ {\n+ s += 1./var[i];\n+ sx += x[i] / var[i];\n+ sy += y[i] / var[i];\n+ sxx += x[i] * x[i] / var[i];\n+ sxy += x[i] * y[i] / var[i];\n+ }\n+\n+ delta = s * sxx - (sx * sx);\n+ b = (sxx * sy - sx * sxy) / delta;\n+ m = (s * sxy - sx * sy) / delta;\n+\n+ *ret_m = m;\n+ *ret_b = b;\n+}\n+ \n+\n+/* Function: Gammln()\n+ *\n+ * Returns the natural log of the gamma function of x.\n+ * x is > 0.0. \n+ *\n+ * Adapted from a public domain implementation in the\n+ * NCBI core math library. Thanks to John Spouge and\n+ * the NCBI. (According to the NCBI, that\'s Dr. John\n+ * "Gammas Galore" Spouge to you, pal.)\n+ */\n+double\n+Gammln(double x)\n+{\n+ int i;\n+ double xx, tx;\n+ double tmp, value;\n+ static double cof[11] = {\n+ 4.694580336184385e+04,\n+ -1.560605207784446e+05,\n+ 2.065049568014106e+05,\n+ -1.388934775095388e+05,\n+ 5.031796415085709e+04,\n+ -9.601592329182778e+03,\n+ 8.785855930895250e+02,\n+ -3.155153906098611e+01,\n+ 2.908143421162229e-01,\n+ -2.319827630494973e-04,\n+ 1.251639670050933e-10\n+ };\n+ \n+ /* Protect against x=0. We see this in Dirichlet code,\n+ * for terms alpha = 0. This is a severe hack but it is effective\n+ * and (we think?) safe. (due to GJM)\n+ */ \n+ if (x <= 0.0) return 999999.; \n+\n+ xx = x - 1.0;\n+ tx = tmp = xx + '..b'ize.\n+ */\n+void\n+FMX2Multiply(float **A, float **B, float **C, int m, int p, int n)\n+{\n+ int i, j, k;\n+\n+ for (i = 0; i < m; i++)\n+ for (j = 0; j < n; j++)\n+ {\n+\tC[i][j] = 0.;\n+\tfor (k = 0; k < p; k++)\n+\t C[i][j] += A[i][p] * B[p][j];\n+ }\n+}\n+\n+\n+/* Function: IncompleteGamma()\n+ * \n+ * Purpose: Returns 1 - P(a,x) where:\n+ * P(a,x) = \\frac{1}{\\Gamma(a)} \\int_{0}^{x} t^{a-1} e^{-t} dt\n+ * = \\frac{\\gamma(a,x)}{\\Gamma(a)}\n+ * = 1 - \\frac{\\Gamma(a,x)}{\\Gamma(a)}\n+ * \n+ * Used in a chi-squared test: for a X^2 statistic x\n+ * with v degrees of freedom, call:\n+ * p = IncompleteGamma(v/2., x/2.) \n+ * to get the probability p that a chi-squared value\n+ * greater than x could be obtained by chance even for\n+ * a correct model. (i.e. p should be large, say \n+ * 0.95 or more).\n+ * \n+ * Method: Based on ideas from Numerical Recipes in C, Press et al.,\n+ * Cambridge University Press, 1988. \n+ * \n+ * Args: a - for instance, degrees of freedom / 2 [a > 0]\n+ * x - for instance, chi-squared statistic / 2 [x >= 0] \n+ * \n+ * Return: 1 - P(a,x).\n+ */ \n+double\n+IncompleteGamma(double a, double x)\n+{\n+ int iter;\t\t\t/* iteration counter */\n+\n+ if (a <= 0.) Die("IncompleteGamma(): a must be > 0");\n+ if (x < 0.) Die("IncompleteGamma(): x must be >= 0");\n+\n+ /* For x > a + 1 the following gives rapid convergence;\n+ * calculate 1 - P(a,x) = \\frac{\\Gamma(a,x)}{\\Gamma(a)}:\n+ * use a continued fraction development for \\Gamma(a,x).\n+ */\n+ if (x > a+1) \n+ {\n+ double oldp;\t\t/* previous value of p */\n+ double nu0, nu1;\t\t/* numerators for continued fraction calc */\n+ double de0, de1;\t\t/* denominators for continued fraction calc */\n+\n+ nu0 = 0.;\t\t\t/* A_0 = 0 */\n+ de0 = 1.;\t\t\t/* B_0 = 1 */\n+ nu1 = 1.;\t\t\t/* A_1 = 1 */\n+ de1 = x;\t\t\t/* B_1 = x */\n+\n+ oldp = nu1;\n+ for (iter = 1; iter < 100; iter++)\n+\t{\n+\t /* Continued fraction development:\n+\t * set A_j = b_j A_j-1 + a_j A_j-2\n+\t * B_j = b_j B_j-1 + a_j B_j-2\n+ * We start with A_2, B_2.\n+\t */\n+\t\t\t\t/* j = even: a_j = iter-a, b_j = 1 */\n+\t\t\t\t/* A,B_j-2 are in nu0, de0; A,B_j-1 are in nu1,de1 */\n+\t nu0 = nu1 + ((double)iter - a) * nu0;\n+\t de0 = de1 + ((double)iter - a) * de0;\n+\n+\t\t\t\t/* j = odd: a_j = iter, b_j = x */\n+\t\t\t\t/* A,B_j-2 are in nu1, de1; A,B_j-1 in nu0,de0 */\n+\t nu1 = x * nu0 + (double) iter * nu1;\n+\t de1 = x * de0 + (double) iter * de1;\n+\n+\t\t\t\t/* rescale */\n+\t if (de1 != 0.) \n+\t { \n+\t nu0 /= de1; \n+\t de0 /= de1;\n+\t nu1 /= de1;\n+\t de1 = 1.;\n+\t }\n+\t\t\t\t/* check for convergence */\n+\t if (fabs((nu1-oldp)/nu1) < 1.e-7)\n+\t return nu1 * exp(a * log(x) - x - Gammln(a));\n+\n+\t oldp = nu1;\n+\t}\n+ Die("IncompleteGamma(): failed to converge using continued fraction approx");\n+ }\n+ else /* x <= a+1 */\n+ {\n+ double p;\t\t\t/* current sum */\n+ double val;\t\t/* current value used in sum */\n+\n+ /* For x <= a+1 we use a convergent series instead:\n+ * P(a,x) = \\frac{\\gamma(a,x)}{\\Gamma(a)},\n+ * where\n+ * \\gamma(a,x) = e^{-x}x^a \\sum_{n=0}{\\infty} \\frac{\\Gamma{a}}{\\Gamma{a+1+n}} x^n\n+ * which looks appalling but the sum is in fact rearrangeable to\n+ * a simple series without the \\Gamma functions:\n+ * = \\frac{1}{a} + \\frac{x}{a(a+1)} + \\frac{x^2}{a(a+1)(a+2)} ...\n+ * and it\'s obvious that this should converge nicely for x <= a+1.\n+ */\n+ \n+ p = val = 1. / a;\n+ for (iter = 1; iter < 10000; iter++)\n+\t{\n+\t val *= x / (a+(double)iter);\n+\t p += val;\n+\t \n+\t if (fabs(val/p) < 1.e-7)\n+\t return 1. - p * exp(a * log(x) - x - Gammln(a));\n+\t}\n+ Die("IncompleteGamma(): failed to converge using series approx");\n+ }\n+ /*NOTREACHED*/\n+ return 0.;\n+}\n+ \n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/squid/sre_random.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/squid/sre_random.c Thu Jul 21 13:35:08 2011 -0400 |
[ |
b'@@ -0,0 +1,313 @@\n+/* sre_random.c\n+ * \n+ * Portable random number generator, and sampling routines.\n+ *\n+ * SRE, Tue Oct 1 15:24:11 2002 [St. Louis]\n+ * CVS $Id: sre_random.c,v 1.1 2002/10/09 14:26:09 eddy Exp)\n+ */\n+\n+#include <stdio.h>\n+#include <stdlib.h>\n+#include <math.h>\n+#include "sre_random.h"\n+\n+static int sre_randseed = 42;\t/* default seed for sre_random() */\n+\n+/* Function: sre_random()\n+ * \n+ * Purpose: Return a uniform deviate x, 0.0 <= x < 1.0.\n+ * \n+ * sre_randseed is a static variable, set\n+ * by sre_srandom(). When it is non-zero, \n+ * we re-seed.\n+ * \n+ * Implements L\'Ecuyer\'s algorithm for combining output\n+ * of two linear congruential generators, plus a Bays-Durham\n+ * shuffle. This is essentially ran2() from Numerical Recipes,\n+ * sans their nonhelpful Rand/McNally-esque code obfuscation.\n+ * \n+ * Overflow errors are avoided by Schrage\'s algorithm:\n+ * az % m = a(z%q) - r(z/q) (+m if <0)\n+ * where q=m/a, r=m%a\n+ *\n+ * Requires that long int\'s have at least 32 bits.\n+ * This function uses statics and is NOT THREADSAFE.\n+ * \n+ * Reference: Press et al. Numerical Recipes in C, 1992. \n+ *\n+ * Reliable and portable, but slow. Benchmarks on wrasse,\n+ * using Linux gcc and Linux glibc rand() (see randspeed, in Testsuite):\n+ * sre_random(): 0.5 usec/call\n+ * rand(): 0.2 usec/call\n+ */\n+double\n+sre_random(void)\n+{\n+ static long rnd1;\t\t/* random number from LCG1 */\n+ static long rnd2; /* random number from LCG2 */\n+ static long rnd; /* random number we return */\n+ static long tbl[64];\t\t/* table for Bays/Durham shuffle */\n+ long x,y;\n+ int i;\n+\n+ /* Magic numbers a1,m1, a2,m2 from L\'Ecuyer, for 2 LCGs.\n+ * q,r derive from them (q=m/a, r=m%a) and are needed for Schrage\'s algorithm.\n+ */\n+ long a1 = 40014;\t\t\n+ long m1 = 2147483563;\t\t\n+ long q1 = 53668;\n+ long r1 = 12211;\n+\n+ long a2 = 40692;\n+ long m2 = 2147483399;\n+ long q2 = 52774;\n+ long r2 = 3791;\n+\n+ if (sre_randseed > 0) \n+ {\n+ rnd1 = sre_randseed;\n+ rnd2 = sre_randseed;\n+\t\t\t\t/* Fill the table for Bays/Durham */\n+ for (i = 0; i < 64; i++) {\n+\tx = a1*(rnd1%q1); /* LCG1 in action... */\n+\ty = r1*(rnd1/q1);\n+\trnd1 = x-y;\n+\tif (rnd1 < 0) rnd1 += m1;\n+\n+\tx = a2*(rnd2%q2); /* LCG2 in action... */\n+\ty = r2*(rnd2/q2);\n+\trnd2 = x-y;\n+\tif (rnd2 < 0) rnd2 += m2;\n+\n+\ttbl[i] = rnd1-rnd2;\n+\tif (tbl[i] < 0) tbl[i] += m1;\n+ }\n+ sre_randseed = 0;\t\t/* drop the flag. */\n+ }/* end of initialization*/\n+\n+\n+ x = a1*(rnd1%q1); /* LCG1 in action... */\n+ y = r1*(rnd1/q1);\n+ rnd1 = x-y;\n+ if (rnd1 < 0) rnd1 += m1;\n+\n+ x = a2*(rnd2%q2); /* LCG2 in action... */\n+ y = r2*(rnd2/q2);\n+ rnd2 = x-y;\n+ if (rnd2 < 0) rnd2 += m2;\n+\n+ \t\t\t/* Choose our random number from the table... */\n+ i = (int) (((double) rnd / (double) m1) * 64.);\n+ rnd = tbl[i];\n+\t\t\t/* and replace with a new number by L\'Ecuyer. */\n+ tbl[i] = rnd1-rnd2;\n+ if (tbl[i] < 0) tbl[i] += m1;\n+\n+ return ((double) rnd / (double) m1); \n+}\n+\n+/* Function: sre_srandom()\n+ * \n+ * Purpose: Initialize with a random seed. Seed must be\n+ * >= 0 to work; we silently enforce this.\n+ */\n+void\n+sre_srandom(int seed)\n+{\n+ if (seed < 0) seed = -1 * seed;\n+ if (seed == 0) seed = 42;\n+ sre_randseed = seed;\n+}\n+\n+/* Function: sre_random_positive()\n+ * Date: SRE, Wed Apr 17 13:34:32 2002 [St. Louis]\n+ *\n+ * Purpose: Assure 0 < x < 1 (positive uniform deviate)\n+ */\n+double\n+sre_random_positive(void)\n+{\n+ double x;\n+ do { x = sre_random(); } while (x == 0.0);\n+ return x;\n+}\n+\n+/* Function: ExponentialRandom()\n+ * Date: SRE, Mon Sep 6 21:24:29 1999 [St. Louis]\n+ *\n+ * Purpose: Pick an exponentially distributed random variable\n+ * 0 > x >= infinity\n+ * \n+ * Args: (void)\n+ *\n+ * Returns: x\n+ */\n+double\n+E'..b'tion", Math. Comput. 27:927-937 (1973).\n+ *\n+ * Impenetrability of the code is to be blamed on its FORTRAN/f2c lineage.\n+ * \n+ */\n+double\n+Gaussrandom(double mean, double stddev)\n+{\n+ static double a[32] = {\n+ 0.0,3.917609E-2,7.841241E-2,0.11777,0.1573107,0.1970991,0.2372021,0.2776904, 0.3186394,0.36013,0.4022501,0.4450965,0.4887764,0.5334097,0.5791322,\n+ 0.626099,0.6744898,0.7245144,0.7764218,0.8305109,0.8871466,0.9467818,\n+ 1.00999,1.077516,1.150349,1.229859,1.318011,1.417797,1.534121,1.67594,\n+ 1.862732,2.153875\n+ };\n+ static double d[31] = {\n+ 0.0,0.0,0.0,0.0,0.0,0.2636843,0.2425085,0.2255674,0.2116342,0.1999243,\n+ 0.1899108,0.1812252,0.1736014,0.1668419,0.1607967,0.1553497,0.1504094,\n+ 0.1459026,0.14177,0.1379632,0.1344418,0.1311722,0.128126,0.1252791,\n+ 0.1226109,0.1201036,0.1177417,0.1155119,0.1134023,0.1114027,0.1095039\n+ };\n+ static double t[31] = {\n+ 7.673828E-4,2.30687E-3,3.860618E-3,5.438454E-3,7.0507E-3,8.708396E-3,\n+ 1.042357E-2,1.220953E-2,1.408125E-2,1.605579E-2,1.81529E-2,2.039573E-2,\n+ 2.281177E-2,2.543407E-2,2.830296E-2,3.146822E-2,3.499233E-2,3.895483E-2,\n+ 4.345878E-2,4.864035E-2,5.468334E-2,6.184222E-2,7.047983E-2,8.113195E-2,\n+ 9.462444E-2,0.1123001,0.136498,0.1716886,0.2276241,0.330498,0.5847031\n+ };\n+ static double h[31] = {\n+ 3.920617E-2,3.932705E-2,3.951E-2,3.975703E-2,4.007093E-2,4.045533E-2,\n+ 4.091481E-2,4.145507E-2,4.208311E-2,4.280748E-2,4.363863E-2,4.458932E-2,\n+ 4.567523E-2,4.691571E-2,4.833487E-2,4.996298E-2,5.183859E-2,5.401138E-2,\n+ 5.654656E-2,5.95313E-2,6.308489E-2,6.737503E-2,7.264544E-2,7.926471E-2,\n+ 8.781922E-2,9.930398E-2,0.11556,0.1404344,0.1836142,0.2790016,0.7010474\n+ };\n+ static long i;\n+ static double snorm,u,s,ustar,aa,w,y,tt;\n+\n+ u = sre_random();\n+ s = 0.0;\n+ if(u > 0.5) s = 1.0;\n+ u += (u-s);\n+ u = 32.0*u;\n+ i = (long) (u);\n+ if(i == 32) i = 31;\n+ if(i == 0) goto S100;\n+ /*\n+ * START CENTER\n+ */\n+ ustar = u-(double)i;\n+ aa = *(a+i-1);\n+S40:\n+ if(ustar <= *(t+i-1)) goto S60;\n+ w = (ustar-*(t+i-1))**(h+i-1);\n+S50:\n+ /*\n+ * EXIT (BOTH CASES)\n+ */\n+ y = aa+w;\n+ snorm = y;\n+ if(s == 1.0) snorm = -y;\n+ return (stddev*snorm + mean);\n+S60:\n+ /*\n+ * CENTER CONTINUED\n+ */\n+ u = sre_random();\n+ w = u*(*(a+i)-aa);\n+ tt = (0.5*w+aa)*w;\n+ goto S80;\n+S70:\n+ tt = u;\n+ ustar = sre_random();\n+S80:\n+ if(ustar > tt) goto S50;\n+ u = sre_random();\n+ if(ustar >= u) goto S70;\n+ ustar = sre_random();\n+ goto S40;\n+S100:\n+ /*\n+ * START TAIL\n+ */\n+ i = 6;\n+ aa = *(a+31);\n+ goto S120;\n+S110:\n+ aa += *(d+i-1);\n+ i += 1;\n+S120:\n+ u += u;\n+ if(u < 1.0) goto S110;\n+ u -= 1.0;\n+S140:\n+ w = u**(d+i-1);\n+ tt = (0.5*w+aa)*w;\n+ goto S160;\n+S150:\n+ tt = u;\n+S160:\n+ ustar = sre_random();\n+ if(ustar > tt) goto S50;\n+ u = sre_random();\n+ if(ustar >= u) goto S150;\n+ u = sre_random();\n+ goto S140;\n+}\n+\n+ \n+/* Functions: DChoose(), FChoose()\n+ *\n+ * Purpose: Make a random choice from a normalized distribution.\n+ * DChoose() is for double-precision vectors;\n+ * FChoose() is for single-precision float vectors.\n+ * Returns the number of the choice.\n+ */\n+int\n+DChoose(double *p, int N)\n+{\n+ double roll; /* random fraction */\n+ double sum; /* integrated prob */\n+ int i; /* counter over the probs */\n+\n+ roll = sre_random();\n+ sum = 0.0;\n+ for (i = 0; i < N; i++)\n+ {\n+ sum += p[i];\n+ if (roll < sum) return i;\n+ }\n+ return (int) (sre_random() * N); /* bulletproof */\n+}\n+int\n+FChoose(float *p, int N)\n+{\n+ float roll; /* random fraction */\n+ float sum;\t\t\t/* integrated prob */\n+ int i; /* counter over the probs */\n+\n+ roll = sre_random();\n+ sum = 0.0;\n+ for (i = 0; i < N; i++)\n+ {\n+ sum += p[i];\n+ if (roll < sum) return i;\n+ }\n+ return (int) (sre_random() * N); /* bulletproof */\n+}\n+\n+ \n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/squid/sre_random.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/squid/sre_random.h Thu Jul 21 13:35:08 2011 -0400 |
b |
@@ -0,0 +1,18 @@ +/* sre_random.h + * Header file for sre_random.c + * + * SRE, Tue Oct 1 15:24:29 2002 + * CVS $Id: sre_random.h,v 1.1 2002/10/09 14:26:09 eddy Exp) + */ + +extern double sre_random(void); +extern void sre_srandom(int seed); +extern double sre_random_positive(void); +extern double ExponentialRandom(void); +extern double Gaussrandom(double mean, double stddev); +extern int DChoose(double *p, int N); +extern int FChoose(float *p, int N); + +#define CHOOSE(a) ((int) (sre_random() * (a))) + + |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/squid/sre_string.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/squid/sre_string.c Thu Jul 21 13:35:08 2011 -0400 |
[ |
b'@@ -0,0 +1,523 @@\n+/*****************************************************************\n+ * SQUID - a library of functions for biological sequence analysis\n+ * Copyright (C) 1992-2002 Washington University School of Medicine\n+ * \n+ * This source code is freely distributed under the terms of the\n+ * GNU General Public License. See the files COPYRIGHT and LICENSE\n+ * for details.\n+ *****************************************************************/\n+\n+/* sre_string.c\n+ * \n+ * my library of extra string functions. Some for portability\n+ * across UNIXes\n+ *\n+ * RCS $Id: sre_string.c 217 2011-03-19 10:27:10Z andreas $ (Original squid RCS Id: sre_string.c,v 1.11 2001/06/07 16:59:37 eddy Exp)\n+ */\n+\n+#include <stdio.h>\n+#include <stdlib.h>\n+#include <string.h>\n+#include <stdarg.h>\n+#include <ctype.h>\n+#include "squid.h"\n+\n+/* Function: Strdup()\n+ * \n+ * Purpose: Implementation of the common (but non-ANSI) function\n+ * strdup(). Robust against being passed a NULL pointer.\n+ * \n+ */\n+char *\n+Strdup(char *s)\n+{\n+ char *new;\n+ if (s == NULL) return NULL;\n+ if ((new = (char *) malloc (strlen(s) +1)) == NULL) return NULL;\n+ strcpy(new, s);\n+ return new;\n+}\n+\n+/* Function: StringChop()\n+ * Date: SRE, Wed Oct 29 12:10:02 1997 [TWA 721]\n+ * \n+ * Purpose: Chop trailing whitespace off of a string.\n+ */\n+void\n+StringChop(char *s)\n+{\n+ int i;\n+\n+ i = strlen(s) - 1;\t\t /* set i at last char in string */\n+ while (i >= 0 && isspace((int) s[i])) i--; /* i now at last non-whitespace char, or -1 */\n+ s[i+1] = \'\\0\';\n+}\n+\n+int\n+Strinsert(char *s1, /* string to insert a char into */\n+\t char c,\t\t/* char to insert */\n+\t int pos)\t\t/* position in s1 to insert c at */\n+{\n+ char oldc;\n+ char *s;\n+\n+ for (s = s1 + pos; c; s++)\n+ {\n+\t\t\t\t/* swap current char for inserted one */\n+ oldc = *s;\t\t/* pick up current */\n+ *s = c; \t\t/* put down inserted one */\n+ c = oldc;\t\t/* old becomes next to insert */\n+ }\n+ *s = \'\\0\';\n+\n+ return 1;\n+}\n+\n+\n+int\n+Strdelete(char *s1, /* string to delete a char from */\n+\t int pos)\t\t/* position of char to delete 0..n-1 */\n+{\n+ char *s; \n+\n+ for (s = s1 + pos; *s; s++)\n+ *s = *(s + 1);\n+\n+ return 1;\n+}\n+\n+void\n+s2lower(char *s)\n+{\n+ for (; *s != \'\\0\'; s++)\n+ *s = sre_tolower((int) *s);\n+}\n+\n+void\n+s2upper(char *s)\n+{\n+ for (; *s != \'\\0\'; s++)\n+ *s = sre_toupper((int) *s);\n+}\n+\n+\n+void *\n+sre_malloc(char *file, int line, size_t size)\n+{\n+ void *ptr;\n+\n+ SQD_DPRINTF3(("MALLOC: %d bytes (file %s line %d)\\n", size, file, line));\n+ if ((ptr = malloc (size)) == NULL)\n+ Die("malloc of %ld bytes failed: file %s line %d", size, file, line);\n+ return ptr;\n+}\n+\n+void *\n+sre_realloc(char *file, int line, void *p, size_t size)\n+{\n+ void *ptr;\n+\n+ if ((ptr = realloc(p, size)) == NULL)\n+ Die("realloc of %ld bytes failed: file %s line %d", size, file, line);\n+ return ptr;\n+}\n+\n+\n+\n+/* Function: Free2DArray(), Free3DArray()\n+ * Date: SRE, Tue Jun 1 14:47:14 1999 [St. Louis]\n+ *\n+ * Purpose: Convenience functions for free\'ing 2D\n+ * and 3D pointer arrays. Tolerates any of the\n+ * pointers being NULL, to allow "sparse" \n+ * arrays.\n+ *\n+ * Args: p - array to be freed\n+ * dim1 - n for first dimension\n+ * dim2 - n for second dimension\n+ *\n+ * e.g. a 2d array is indexed p[0..dim1-1][]\n+ * a 3D array is indexed p[0..dim1-1][0..dim2-1][]\n+ * \n+ * Returns: void\n+ * \n+ * Diagnostics: (void)\n+ * "never fails"\n+ */\n+void\n+Free2DArray(void **p, int dim1)\n+{\n+ int i;\n+ \n+ if (p != NULL) {\n+ for (i = 0; i < dim1; i++)\n+ if (p[i] != NULL) free(p[i]);\n+ free(p);\n+ }\n+}\n+void\n+Free3DArray(void ***p, int dim1, int dim2)\n+{\n+ int i, j;\n+\n+ if (p != NULL) {\n+ for (i = 0; i < dim1; i++)\n+ if (p[i] != NULL) {\n+\tfor (j = 0; j < dim2; j++)\n+'..b'ons:\n+ * *s can\'t be a constant string, since we write to it.\n+ * \n+ * Example: \n+ * char *tok;\n+ * int len;\n+ * char *s; \n+ * char buf[50] = "This is a sentence.";\n+ * \n+ * s = buf; \n+ * tok = sre_strtok(&s, " ", &len);\n+ * tok is "This"; s is "is a sentence."; len is 4.\n+ * tok = sre_strtok(&s, " ", &len);\n+ * tok is "is"; s is " a sentence."; len is 2.\n+ * tok = sre_strtok(&s, " ", &len);\n+ * tok is "a"; s is "sentence."; len is 1.\n+ * tok = sre_strtok(&s, " ", &len);\n+ * tok is "sentence."; s is "\\0"; len is 9.\n+ * tok = sre_strtok(&s, " ", &len);\n+ * tok is NULL; s is "\\0", len is undefined.\n+ * \n+ * Args: s - a tmp, modifiable ptr to string\n+ * delim - characters that delimits tokens\n+ * len - RETURN: length of token; pass NULL if not wanted\n+ *\n+ * Returns: ptr to next token, or NULL if there aren\'t any.\n+ */\n+char *\n+sre_strtok(char **s, char *delim, int *len)\n+{\n+ char *begin, *end;\n+ int n;\n+\n+ begin = *s;\n+ begin += strspn(begin, delim);\n+ if (! *begin) return NULL;\n+\n+ n = strcspn(begin, delim);\n+ end = begin + n;\n+ if (*end == \'\\0\') { *s = end;}\n+ else {\n+ *end = \'\\0\';\n+ *s = end+1;\n+ }\n+\n+ if (len != NULL) *len = n;\n+ return begin;\n+}\n+\n+\n+\n+/* Function: sre_strdup()\n+ * Date: SRE, Wed May 19 17:57:28 1999 [St. Louis]\n+ *\n+ * Purpose: A version of the common but non-ANSI strdup()\n+ * function. Can pass len, if known, to save a\n+ * strlen() call.\n+ *\n+ * Args: s - string to duplicate\n+ * n - length of string, if known; -1 if unknown.\n+ * \n+ * Returns: allocated copy of string.\n+ * NULL on failure.\n+ */\n+char *\n+sre_strdup(char *s, int n)\n+{\n+ char *new;\n+\n+ if (s == NULL) return NULL;\n+ if (n < 0) n = strlen(s);\n+ new = MallocOrDie (sizeof(char) * (n+1));\n+ strcpy(new, s);\n+ return new;\n+}\n+\n+\n+/* Function: sre_strncpy()\n+ * Date: SRE, Tue Jun 22 10:10:46 1999 [Sanger Centre]\n+ *\n+ * Purpose: a strncpy() that makes sure it adds a trailing \\0.\n+ *\n+ * Args: s1 - string to copy to (allocated n+1 or larger)\n+ * s2 - string to copy from\n+ * n - number of chars to copy \n+ *\n+ * Returns: s1. \n+ * Done only for consistency with strncpy(). Not clear\n+ * why it\'s useful for a strncpy() to return s1.\n+ */\n+char *\n+sre_strncpy(char *s1, char *s2, int n)\n+{\n+ strncpy(s1,s2,n);\n+ s1[n] = \'\\0\';\n+ return s1;\n+}\n+\n+/* Function: IsBlankline()\n+ * Date: SRE, Fri Jun 18 14:36:08 1999 [St. Louis]\n+ *\n+ * Purpose: Returns TRUE if string consists solely of whitespace.\n+ *\n+ * Args: s - string to check\n+ */\n+int\n+IsBlankline(char *s)\n+{\n+ for (; *s != \'\\0\'; s++)\n+ if (! isspace(*s)) return FALSE;\n+ return TRUE;\n+}\n+\n+\n+\n+#ifdef CUBS_WIN\n+/* A timing test for sre_strcat()\n+ * cc -O2 -g sre_string.c sre_ctype.c sqerror.c sre_math.c hsregex.c -lm \n+ * 15.200u - 5.360u = 9.84u if sre_strcat() with no length info passed\n+ * 13.660u - 5.360u = 8.30u if strcat(), with a single malloc().\n+ * 11.370u - 5.360u = 6.01u if sre_strcat() with length info passed.\n+ */\n+int main(void)\n+{\n+ float p[4] = {0.25, 0.25, 0.25, 0.25};\n+ int buflen;\n+ int len;\n+ int nappends;\n+ int nstrings;\n+ char *s1 = NULL;\n+ char *s2;\n+ int i;\n+\n+ nappends = 100;\n+ nstrings = 1000;\n+ while (nstrings--)\n+ {\n+ /* s1 = malloc(sizeof(char) * (255*nappends+1));\n+\t s1[0] = \'\\0\';\n+ */\n+\n+ s1 = NULL;\n+ len = 0;\n+ for (i = 0; i < nappends; i++)\n+\t{\n+\t buflen = CHOOSE(255) + 1;\n+\t s2 = RandomSequence("ACGT", p, 4, buflen);\n+ \n+\t /* strcat(s1,s2); */\n+\t if ((len = sre_strcat(&s1, len, s2, buflen)) < 0) exit(1); \n+\t free(s2);\n+\t}\n+ free(s1); \n+ }\n+ exit(0);\n+}\n+#endif /*CUBS_WIN*/\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/squid/ssi.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/squid/ssi.c Thu Jul 21 13:35:08 2011 -0400 |
[ |
b'@@ -0,0 +1,1537 @@\n+/*****************************************************************\n+ * SQUID - a library of functions for biological sequence analysis\n+ * Copyright (C) 1992-2002 Washington University School of Medicine\n+ * \n+ * This source code is freely distributed under the terms of the\n+ * GNU General Public License. See the files COPYRIGHT and LICENSE\n+ * for details.\n+ *****************************************************************/\n+\n+#include <stdio.h>\n+#include <stdlib.h>\n+#include <string.h>\n+#include <sys/stat.h>\n+#include <sys/types.h>\n+#include <unistd.h>\n+#include "squid.h"\n+#include "ssi.h"\n+#ifdef CLUSTALO\n+#include <limits.h>\n+#endif\n+\n+static sqd_uint32 v20magic = 0xf3f3e9b1; /* SSI 1.0: "ssi1" + 0x80808080 */\n+static sqd_uint32 v20swap = 0xb1e9f3f3; /* byteswapped */\n+\n+static int read_i16(FILE *fp, sqd_uint16 *ret_result);\n+static int read_i32(FILE *fp, sqd_uint32 *ret_result);\n+static int read_i64(FILE *fp, sqd_uint64 *ret_result);\n+static int read_offset(FILE *fp, char mode, SSIOFFSET *ret_offset);\n+static int write_i16(FILE *fp, sqd_uint16 n);\n+static int write_i32(FILE *fp, sqd_uint32 n);\n+static int write_i64(FILE *fp, sqd_uint64 n);\n+static int write_offset(FILE *fp, SSIOFFSET *offset);\n+static int binary_search(SSIFILE *sfp, char *key, int klen, SSIOFFSET *base, \n+\t\t\t sqd_uint32 recsize, sqd_uint32 maxidx);\n+static int indexfile_position(SSIFILE *sfp, SSIOFFSET *base, sqd_uint32 len,\n+\t\t\t sqd_uint32 n);\n+static void clear_ssifile(SSIFILE *sfp);\n+static sqd_uint64 current_index_size(SSIINDEX *g);\n+static int activate_external_sort(SSIINDEX *g);\n+static int load_indexfile(SSIFILE *sfp);\n+static int parse_pkey_info(char *buf, char mode, struct ssipkey_s *pkey);\n+static int parse_skey_info(char *buf, struct ssiskey_s *skey);\n+\n+/* Function: SSIOpen()\n+ * Date: SRE, Sun Dec 31 12:40:03 2000 [St. Louis]\n+ *\n+ * Purpose: Opens the SSI index file {filename} and returns\n+ * a SSIFILE * stream thru {ret_sfp}.\n+ * The caller must eventually close this stream using\n+ * SSIClose(). More than one index file can be open\n+ * at once.\n+ *\n+ * Args: filename - full path to a SSI index file\n+ *\n+ * Returns: Returns 0 on success, nonzero on failure.\n+ */\n+int\n+SSIOpen(char *filename, SSIFILE **ret_sfp)\n+{\n+ SSIFILE *sfp = NULL;\n+ int status;\n+ if ((sfp = malloc(sizeof(SSIFILE))) == NULL) return SSI_ERR_MALLOC;\n+ if ((sfp->fp = fopen(filename, "rb")) == NULL) {\n+ free(sfp);\n+ return SSI_ERR_NOFILE; \n+ }\n+ status = load_indexfile(sfp);\n+ *ret_sfp = sfp;\n+ return status;\n+}\n+/* load_indexfile(): given a SSIFILE structure with an open and positioned \n+ * stream (fp) -- but no other data loaded -- read the next SSIFILE\n+ * in from disk. We use this routine without its SSIOpen() wrapper\n+ * as part of the external mergesort when creating large indices.\n+ */\n+static int\n+load_indexfile(SSIFILE *sfp)\n+{\n+ sqd_uint32 magic;\n+ sqd_uint16 i;\t\t/* counter over files */\n+ int status;\t\t/* overall return status if an error is thrown */\n+\n+ status = SSI_ERR_BADFORMAT; /* default: almost every kind of error is a bad format error */\n+\n+ sfp->filename = NULL;\n+ sfp->fileformat = NULL;\n+ sfp->fileflags = NULL;\n+ sfp->bpl = NULL;\n+ sfp->rpl = NULL;\n+ sfp->nfiles = 0; \n+ if (! read_i32(sfp->fp, &magic)) {status = SSI_ERR_BADMAGIC; goto FAILURE; }\n+ if (magic != v20magic && magic != v20swap) {status = SSI_ERR_BADMAGIC; goto FAILURE; }\n+ if (! read_i32(sfp->fp, &(sfp->flags))) goto FAILURE; \n+\n+ /* If we have 64-bit offsets, make sure we can deal with them.\n+ */\n+#ifndef HAS_64BIT_FILE_OFFSETS \n+ if ((sfp->flags & SSI_USE64_INDEX) ||\n+ (sfp->flags & SSI_USE64))\n+ { status = SSI_ERR_NO64BIT; goto FAILURE; }\n+#endif\n+\n+ sfp->imode = (sfp->flags & SSI_USE64_INDEX) ? SSI_OFFSET_I64 : SSI_OFFSET_I32;\n+ sfp->smode = (sfp->fla'..b'>skeys); \n+ g->pkeys = NULL;\n+ g->skeys = NULL;\n+\n+ /* Turn control over to external accumulation mode.\n+ */\n+ g->external = TRUE;\n+ return 0;\n+}\n+\n+\n+/*****************************************************************\n+ * Debugging API\n+ *****************************************************************/\n+void\n+SSIForceExternalSort(SSIINDEX *g)\n+{\n+ if (activate_external_sort(g) != 0)\n+ Die("failed to turn external sorting on.");\n+}\n+\n+\n+/*****************************************************************\n+ * Test driving mode\n+ *****************************************************************/\n+#ifdef MUGGINS_LETS_ME_SLEEP \n+/* Minimally: \n+ cc -g -Wall -o shiva -DDEBUGLEVEL=1 -DMUGGINS_LETS_ME_SLEEP ssi.c sqerror.c sre_string.c types.c sre_ctype.c sre_math.c file.c -lm \n+*/\n+\n+int\n+main(int argc, char **argv)\n+{\n+ char name[32], accession[32];\n+ SSIINDEX *ssi;\n+ int mode;\n+ SSIOFFSET r_off, d_off;\n+ FILE *ofp;\n+ int i;\n+ int fh;\t\t\t/* a file handle */\n+ int status;\t\t/* return status from a SSI call */\n+ \n+ mode = SSI_OFFSET_I32;\n+ if ((ssi = SSICreateIndex(mode)) == NULL)\n+ Die("Failed to allocate SSI index");\n+\n+ /* Generate two FASTA files, tmp.0 and tmp.1, and index them.\n+ */\n+ if ((ofp = fopen("tmp.0", "w")) == NULL) \n+ Die("failed to open tmp.0");\n+ if ((status = SSIAddFileToIndex(ssi, "tmp.0", SQFILE_FASTA, &fh)) != 0)\n+ Die("SSIAddFileToIndex() failed: %s", SSIErrorString(status));\n+ for (i = 0; i < 10; i++) {\n+ if ((status = SSIGetFilePosition(ofp, mode, &r_off)) != 0)\n+ Die("SSIGetFilePosition() failed: %s", SSIErrorString(status));\n+ sprintf(name, "seq%d", i);\n+ sprintf(accession, "ac%d", i);\n+ fprintf(ofp, ">%s [%s] Description? we don\'t need no steenking description.\\n", \n+\t name, accession);\n+ if ((status = SSIGetFilePosition(ofp, mode, &d_off)) != 0) \n+ Die("SSIGetFilePosition() failed: %s", SSIErrorString(status));\n+ fprintf(ofp, "AAAAAAAAAA\\n");\n+ fprintf(ofp, "CCCCCCCCCC\\n");\n+ fprintf(ofp, "GGGGGGGGGG\\n");\n+ fprintf(ofp, "TTTTTTTTTT\\n");\n+\n+ if ((status = SSIAddPrimaryKeyToIndex(ssi, name, fh, &r_off, &d_off, 40)) != 0)\n+ Die("SSIAddPrimaryKeyToIndex() failed: %s", SSIErrorString(status));\n+ if ((status = SSIAddSecondaryKeyToIndex(ssi, accession, name)) != 0)\n+ Die("SSIAddSecondaryKeyToIndex() failed: %s", SSIErrorString(status));\n+ }\n+ SSISetFileForSubseq(ssi, fh, 11, 10);\n+ fclose(ofp);\n+ \n+ if ((ofp = fopen("tmp.1", "w")) == NULL) \n+ Die("failed to open tmp.1");\n+ if ((status = SSIAddFileToIndex(ssi, "tmp.1", SQFILE_FASTA, &fh)) != 0)\n+ Die("SSIAddFileToIndex() failed: %s", SSIErrorString(status));\n+ for (i = 10; i < 20; i++) {\n+ if ((status = SSIGetFilePosition(ofp, mode, &r_off)) != 0)\n+ Die("SSIGetFilePosition() failed: %s", SSIErrorString(status));\n+ sprintf(name, "seq%d", i);\n+ sprintf(accession, "ac%d", i);\n+ fprintf(ofp, ">%s [%s] i/o, i/o, it\'s off to disk we go.\\n", \n+\t name, accession);\n+ if ((status = SSIGetFilePosition(ofp, mode, &d_off)) != 0)\n+ Die("SSIGetFilePosition() failed: %s", SSIErrorString(status));\n+ fprintf(ofp, "AAAAAAAAAA 10\\n");\n+ fprintf(ofp, "CCCCCCCCCC 20\\n");\n+ fprintf(ofp, "GGGGGGGGGG 30\\n");\n+ fprintf(ofp, "TTTTTTTTTT 40\\n");\n+\n+ if ((status = SSIAddPrimaryKeyToIndex(ssi, name, fh, &r_off, &d_off, 40)) != 0)\n+ Die("SSIAddPrimaryKeyToIndex() failed: %s", SSIErrorString(status));\n+ if ((status = SSIAddSecondaryKeyToIndex(ssi, accession, name)) != 0)\n+ Die("SSIAddSecondaryKeyToIndex() failed: %s", SSIErrorString(status));\n+ }\n+ SSISetFileForSubseq(ssi, fh, 14, 10);\n+ fclose(ofp);\n+ \n+ /* Write the index to tmp.ssi\n+ */ \n+ if ((status = SSIWriteIndex("tmp.ssi", ssi)) != 0) \n+ Die("SSIWriteIndex() failed: %s", SSIErrorString(status));\n+ SSIFreeIndex(ssi);\n+\n+ /* Now reopen the index and run some tests.\n+ */\n+ exit(0);\n+}\n+\n+\n+#endif /* test driving code */\n+\n+\n+\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/squid/ssi.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/squid/ssi.h Thu Jul 21 13:35:08 2011 -0400 |
[ |
@@ -0,0 +1,189 @@ +/***************************************************************** + * SQUID - a library of functions for biological sequence analysis + * Copyright (C) 1992-2002 Washington University School of Medicine + * + * This source code is freely distributed under the terms of the + * GNU General Public License. See the files COPYRIGHT and LICENSE + * for details. + *****************************************************************/ + +#ifndef SSIH_INCLUDED +#define SSIH_INCLUDED + +/* ssi.h + * Database indexing (SSI format support) + * CVS $Id: ssi.h,v 1.7 2002/02/24 19:39:27 eddy Exp) + * + * See: ssi_format.tex in Docs/ + */ + +#include <stdio.h> +#include "squid.h" + +/* Limits + */ +#define SSI_MAXFILES 32767 /* 2^15-1 */ +#define SSI_MAXKEYS 2147483647L /* 2^31-1 */ +#define SSI_MAXRAM 200 /* allow 200MB indexes before external sort mode */ + +/* typedef: SSIOFFSET + * Use the union to save space, since the two offset types are + * mutually exclusive, controlled by "mode" + */ +struct ssioffset_s { + char mode; /* GSI_OFFSET_I32, for example */ + union { + sqd_uint32 i32; /* an offset that fseek() can use */ + sqd_uint64 i64; /* an offset that e.g. fseeko64() can use */ + } off; +}; +typedef struct ssioffset_s SSIOFFSET; +#define SSI_OFFSET_I32 0 +#define SSI_OFFSET_I64 1 + +/* Structure: SSIFILE + * xref: SSI API documentation in ssi-format.tex + */ +struct ssifile_s { + FILE *fp; /* open SSI index file */ + sqd_uint32 flags; /* optional behavior flags */ + sqd_uint16 nfiles; /* number of files = 16 bit int */ + sqd_uint32 nprimary; /* number of primary keys */ + sqd_uint32 nsecondary; /* number of secondary keys */ + sqd_uint32 flen; /* length of filenames (inc '\0') */ + sqd_uint32 plen; /* length of primary keys (inc '\0') */ + sqd_uint32 slen; /* length of secondary keys (inc '\0') */ + sqd_uint32 frecsize; /* # bytes in a file record */ + sqd_uint32 precsize; /* # bytes in a primary key record */ + sqd_uint32 srecsize; /* # bytes in a secondary key record */ + SSIOFFSET foffset; /* disk offset, start of file records */ + SSIOFFSET poffset; /* disk offset, start of pri key recs */ + SSIOFFSET soffset; /* disk offset, start of sec key recs */ + + char imode; /* mode for index file offsets, 32 v. 64 bit */ + char smode; /* mode for sequence file offsets, 32 v. 64 bit */ + + /* File information: + */ + char **filename; /* list of file names [0..nfiles-1] */ + sqd_uint32 *fileformat; /* file formats */ + sqd_uint32 *fileflags; /* optional per-file behavior flags */ + sqd_uint32 *bpl; /* bytes per line in file */ + sqd_uint32 *rpl; /* residues per line in file */ +}; +typedef struct ssifile_s SSIFILE; + +/* optional per-index behavior flags in SSIFILE structure's flags: + */ +#define SSI_USE64 1<<0 /* seq offsets are 64-bit */ +#define SSI_USE64_INDEX 1<<1 /* index file offsets are 64-bit */ + +/* optional per-file behavior flags in fileflags + */ +#define SSI_FAST_SUBSEQ 1<<0 /* can do subseq lookup in this file */ + +/* Structure: SSIINDEX + * + * Used when building up an index and writing it to disk + */ +struct ssipkey_s { /* Primary key data: */ + char *key; /* key name */ + sqd_uint16 fnum; /* file number */ + SSIOFFSET r_off; /* record offset */ + SSIOFFSET d_off; /* data offset */ + sqd_uint32 len; /* sequence length */ +}; +struct ssiskey_s { /* Secondary key data: */ + char *key; /* secondary key name */ + char *pkey; /* primary key name */ +}; +struct ssiindex_s { + int smode; /* sequence mode: SSI_OFFSET_I32 or _I64 */ + int imode; /* index mode: SSI_OFFSET_I32 or _I64 */ + int external; /* TRUE if pkeys and skeys are on disk */ + int max_ram; /* maximum RAM in MB before switching to external */ + + char **filenames; + sqd_uint32 *fileformat; + sqd_uint32 *bpl; + sqd_uint32 *rpl; + sqd_uint32 flen; /* length of longest filename, inc '\0' */ + sqd_uint16 nfiles; + + struct ssipkey_s *pkeys; + sqd_uint32 plen; /* length of longest pkey, including '\0' */ + sqd_uint32 nprimary; + char *ptmpfile; /* name of tmp file, for external sort mode */ + FILE *ptmp; /* handle on open ptmpfile */ + + struct ssiskey_s *skeys; + sqd_uint32 slen; /* length of longest skey, including '\0' */ + sqd_uint32 nsecondary; + char *stmpfile; /* name of tmp file, for external sort mode */ + FILE *stmp; /* handle on open ptmpfile */ +}; +typedef struct ssiindex_s SSIINDEX; + +/* These control malloc and realloc chunk sizes in the index + * construction code. + */ +#define SSI_FILE_BLOCK 10 +#define SSI_KEY_BLOCK 100 + +/* Error codes set by the API + */ +#define SSI_ERR_OK 0 +#define SSI_ERR_NODATA 1 /* no data? an fread() failed */ +#define SSI_ERR_NO_SUCH_KEY 2 /* that key's not in the index */ +#define SSI_ERR_MALLOC 3 +#define SSI_ERR_NOFILE 4 /* no such file? an fopen() failed */ +#define SSI_ERR_BADMAGIC 5 /* magic number mismatch in GSIOpen() */ +#define SSI_ERR_BADFORMAT 6 /* didn't read what I expected to fread() */ +#define SSI_ERR_NO64BIT 7 /* needed 64-bit support and didn't have it */ +#define SSI_ERR_SEEK_FAILED 8 /* an fseek() (or similar) failed */ +#define SSI_ERR_TELL_FAILED 9 /* an ftell() (or similar) failed */ +#define SSI_ERR_NO_SUBSEQS 10 /* fast subseq is disallowed */ +#define SSI_ERR_RANGE 11 /* subseq requested is out of range */ +#define SSI_ERR_BADARG 12 /* something wrong with a function argument */ +#define SSI_ERR_TOOMANY_FILES 13 /* ran out of range for files in an index */ +#define SSI_ERR_TOOMANY_KEYS 14 /* ran out of range for keys in an index */ +#define SSI_ERR_FWRITE 15 +#define SSI_ERR_EXTERNAL_SORT 16 /* external sort failed */ + +/* The SSI file reading API: + */ +extern int SSIOpen(char *filename, SSIFILE **ret_sfp); +extern int SSIGetOffsetByName(SSIFILE *sfp, char *key, int *ret_fh, + SSIOFFSET *ret_offset); +extern int SSIGetOffsetByNumber(SSIFILE *sfp, int n, int *ret_fh, + SSIOFFSET *ret_offset); +extern int SSIGetSubseqOffset(SSIFILE *sfp, char *key, int requested_start, + int *ret_fh, SSIOFFSET *record_offset, + SSIOFFSET *data_offset, int *ret_actual_start); +extern int SSISetFilePosition(FILE *fp, SSIOFFSET *offset); +extern int SSIFileInfo(SSIFILE *sfp, int fh, char **ret_filename, int *ret_format); +extern void SSIClose(SSIFILE *sfp); + +/* The SSI index file writing API: + */ +extern int SSIRecommendMode(char *file); +extern SSIINDEX *SSICreateIndex(int mode); +extern int SSIGetFilePosition(FILE *fp, int mode, SSIOFFSET *ret_offset); +extern int SSIAddFileToIndex(SSIINDEX *g, char *filename, int fmt, int *ret_fh); +extern int SSISetFileForSubseq(SSIINDEX *g, int fh, int bpl, int rpl); +extern int SSIAddPrimaryKeyToIndex(SSIINDEX *g, char *key, int fh, + SSIOFFSET *r_off, SSIOFFSET *d_off, + int L); +extern int SSIAddSecondaryKeyToIndex(SSIINDEX *g, char *key, char *pkey); +extern int SSIWriteIndex(char *file, SSIINDEX *g); +extern void SSIFreeIndex(SSIINDEX *g); + +/* The SSI misc. functions API: + */ +extern char *SSIErrorString(int n); + +/* The SSI debugging API: + */ +extern void SSIForceExternalSort(SSIINDEX *g); + +#endif /*SSIH_INCLUDED*/ |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/squid/stack.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/squid/stack.c Thu Jul 21 13:35:08 2011 -0400 |
b |
@@ -0,0 +1,102 @@ +/***************************************************************** + * SQUID - a library of functions for biological sequence analysis + * Copyright (C) 1992-2002 Washington University School of Medicine + * + * This source code is freely distributed under the terms of the + * GNU General Public License. See the files COPYRIGHT and LICENSE + * for details. + *****************************************************************/ + +/* stack.c + * SRE, Thu Mar 3 10:08:48 1994 + * + * Implementation of generic stack structures. + * RCS $Id: stack.c 217 2011-03-19 10:27:10Z andreas $ (Original squid RCS Id: stack.c,v 1.2 1998/10/09 18:07:16 eddy Exp) + */ + +#include <stdlib.h> +#include "squid.h" + +#ifdef MEMDEBUG +#include "dbmalloc.h" +#endif + + +/************************************************************ + * intstack_s implementation. + * + * Functions: InitIntStack() - returns ptr to new stack + * PushIntStack() - (void) + * PopIntStack() - returns 1 on success, 0 if stack empty + * FreeIntStack() - returns number of elements free'd, or 0 if + * stack was empty. + * + * Implementation of the pushdown stack for storing single + * integers. + *************************************************************/ +struct intstack_s * +InitIntStack(void) +{ + struct intstack_s *stack; + + if ((stack = (struct intstack_s *) malloc (sizeof(struct intstack_s))) == NULL) + Die("Memory allocation failure at %s line %d", __FILE__, __LINE__); + stack->nxt = NULL; + return stack; +} +void +PushIntStack(struct intstack_s *stack, int data) +{ + struct intstack_s *new; + + if ((new = (struct intstack_s *) malloc (sizeof(struct intstack_s))) == NULL) + Die("Memory allocation failure at %s line %d", __FILE__, __LINE__); + new->data = data; + + new->nxt = stack->nxt; + stack->nxt = new; +} + +int +PopIntStack(struct intstack_s *stack, int *ret_data) +{ + struct intstack_s *old; + + if (stack->nxt == NULL) return 0; + + old = stack->nxt; + stack->nxt = old->nxt; + + *ret_data = old->data; + free(old); + return 1; +} + +void +ReverseIntStack(struct intstack_s *stack) +{ + struct intstack_s *old; + struct intstack_s *new; + + old = stack->nxt; + stack->nxt = NULL; + while (old != NULL) + { + new = old; /* remove one from top of old stack */ + old = old->nxt; + new->nxt = stack->nxt; /* push it onto new stack */ + stack->nxt = new; + } +} + +int +FreeIntStack( struct intstack_s *stack ) +{ + int data; + int count = 0; + + while (PopIntStack(stack, &data)) + count++; + free(stack); + return count; +} |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/squid/stockholm.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/squid/stockholm.c Thu Jul 21 13:35:08 2011 -0400 |
[ |
b'@@ -0,0 +1,627 @@\n+/*****************************************************************\n+ * SQUID - a library of functions for biological sequence analysis\n+ * Copyright (C) 1992-2002 Washington University School of Medicine\n+ * \n+ * This source code is freely distributed under the terms of the\n+ * GNU General Public License. See the files COPYRIGHT and LICENSE\n+ * for details.\n+ *****************************************************************/\n+\n+/* stockholm.c\n+ * SRE, Fri May 28 15:46:41 1999\n+ * \n+ * Reading/writing of Stockholm format multiple sequence alignments.\n+ * \n+ * example of API:\n+ * \n+ * MSA *msa;\n+ * FILE *fp; -- opened for write with fopen()\n+ * MSAFILE *afp; -- opened for read with MSAFileOpen()\n+ * \n+ * while ((msa = ReadStockholm(afp)) != NULL)\n+ * {\n+ * WriteStockholm(fp, msa);\n+ * MSAFree(msa);\n+ * }\n+ * \n+ * RCS $Id: stockholm.c 217 2011-03-19 10:27:10Z andreas $ (Original squid RCS Id: stockholm.c,v 1.7 2002/10/12 04:40:36 eddy Exp)\n+ */\n+#include <stdio.h>\n+#include <string.h>\n+#include "squid.h"\n+#include "msa.h"\n+\n+static int parse_gf(MSA *msa, char *buf);\n+static int parse_gs(MSA *msa, char *buf);\n+static int parse_gc(MSA *msa, char *buf);\n+static int parse_gr(MSA *msa, char *buf);\n+static int parse_comment(MSA *msa, char *buf);\n+static int parse_sequence(MSA *msa, char *buf);\n+static void actually_write_stockholm(FILE *fp, MSA *msa, int cpl);\n+\n+#ifdef TESTDRIVE_STOCKHOLM\n+/*****************************************************************\n+ * stockholm.c test driver: \n+ * cc -DTESTDRIVE_STOCKHOLM -g -O2 -Wall -o test stockholm.c msa.c gki.c sqerror.c sre_string.c file.c hsregex.c sre_math.c sre_ctype.c -lm \n+ * \n+ */\n+int\n+main(int argc, char **argv)\n+{\n+ MSAFILE *afp;\n+ MSA *msa;\n+ char *file;\n+ \n+ file = argv[1];\n+\n+ if ((afp = MSAFileOpen(file, MSAFILE_STOCKHOLM, NULL)) == NULL)\n+ Die("Couldn\'t open %s\\n", file);\n+\n+ while ((msa = ReadStockholm(afp)) != NULL)\n+ {\n+ WriteStockholm(stdout, msa);\n+ MSAFree(msa); \n+ }\n+ \n+ MSAFileClose(afp);\n+ exit(0);\n+}\n+/******************************************************************/\n+#endif /* testdriver */\n+\n+\n+/* Function: ReadStockholm()\n+ * Date: SRE, Fri May 21 17:33:10 1999 [St. Louis]\n+ *\n+ * Purpose: Parse the next alignment from an open Stockholm\n+ * format alignment file. Return the alignment, or\n+ * NULL if there are no more alignments in the file.\n+ *\n+ * Args: afp - open alignment file\n+ *\n+ * Returns: MSA * - an alignment object. \n+ * caller responsible for an MSAFree() \n+ * NULL if no more alignments\n+ *\n+ * Diagnostics:\n+ * Will Die() here with a (potentially) useful message\n+ * if a parsing error occurs \n+ */\n+MSA *\n+ReadStockholm(MSAFILE *afp)\n+{\n+ MSA *msa;\n+ char *s;\n+ int status;\n+\n+ if (feof(afp->f)) return NULL;\n+\n+ /* Initialize allocation of the MSA.\n+ */\n+ msa = MSAAlloc(10, 0);\n+\n+ /* Check the magic Stockholm header line.\n+ * We have to skip blank lines here, else we perceive\n+ * trailing blank lines in a file as a format error when\n+ * reading in multi-record mode.\n+ */\n+ do {\n+ if ((s = MSAFileGetLine(afp)) == NULL) {\n+ MSAFree(msa);\n+ return NULL;\n+ }\n+ } while (IsBlankline(s));\n+\n+ if (strncmp(s, "# STOCKHOLM 1.", 14) != 0)\n+ Die("\\\n+File %s doesn\'t appear to be in Stockholm format.\\n\\\n+Assuming there isn\'t some other problem with your file (it is an\\n\\\n+alignment file, right?), please either:\\n\\\n+ a) use the Babelfish format autotranslator option (-B, usually);\\n\\\n+ b) specify the file\'s format with the --informat option; or\\n\\\n+ a) reformat the alignment to Stockholm format.\\n", \n+\tafp->fname);\n+\n+ /* Read the alignment file one line at a time.\n+ */\n+ while ((s = MSAFileGetLine(afp)) != NULL) \n+ {\n+ while (*s == \' \' || *s == \'\\t\') s++; /* skip leading whitespace */\n+\n+ if (*s == \'#\') {\n+'..b'L)) == NULL) return 0;\n+ while (*text && (*text == \' \' || *text == \'\\t\')) text++;\n+ \n+ /* GS usually follows another GS; guess lastidx+1\n+ */\n+ seqidx = MSAGetSeqidx(msa, seqname, msa->lastidx+1);\n+ msa->lastidx = seqidx;\n+\n+ if (strcmp(featurename, "WT") == 0)\n+ {\n+ msa->wgt[seqidx] = atof(text);\n+ msa->flags |= MSA_SET_WGT;\n+ }\n+\n+ else if (strcmp(featurename, "AC") == 0)\n+ MSASetSeqAccession(msa, seqidx, text);\n+\n+ else if (strcmp(featurename, "DE") == 0)\n+ MSASetSeqDescription(msa, seqidx, text);\n+\n+ else\t\t\t\t\n+ MSAAddGS(msa, featurename, seqidx, text);\n+\n+ return 1;\n+}\n+\n+/* Format of a GC line:\n+ * #=GC <featurename> <text>\n+ */\n+static int \n+parse_gc(MSA *msa, char *buf)\n+{\n+ char *gc;\n+ char *featurename;\n+ char *text; \n+ char *s;\n+ int len;\n+\n+ s = buf;\n+ if ((gc = sre_strtok(&s, WHITESPACE, NULL)) == NULL) return 0;\n+ if ((featurename = sre_strtok(&s, WHITESPACE, NULL)) == NULL) return 0;\n+ if ((text = sre_strtok(&s, WHITESPACE, &len)) == NULL) return 0;\n+ \n+ if (strcmp(featurename, "SS_cons") == 0)\n+ sre_strcat(&(msa->ss_cons), -1, text, len);\n+ else if (strcmp(featurename, "SA_cons") == 0)\n+ sre_strcat(&(msa->sa_cons), -1, text, len);\n+ else if (strcmp(featurename, "RF") == 0)\n+ sre_strcat(&(msa->rf), -1, text, len);\n+ else\n+ MSAAppendGC(msa, featurename, text);\n+\n+ return 1;\n+}\n+\n+/* Format of a GR line:\n+ * #=GR <seqname> <featurename> <text>\n+ */\n+static int\n+parse_gr(MSA *msa, char *buf)\n+{\n+ char *gr;\n+ char *seqname;\n+ char *featurename;\n+ char *text;\n+ int seqidx;\n+ int len;\n+ int j;\n+ char *s;\n+\n+ s = buf;\n+ if ((gr = sre_strtok(&s, WHITESPACE, NULL)) == NULL) return 0;\n+ if ((seqname = sre_strtok(&s, WHITESPACE, NULL)) == NULL) return 0;\n+ if ((featurename = sre_strtok(&s, WHITESPACE, NULL)) == NULL) return 0;\n+ if ((text = sre_strtok(&s, WHITESPACE, &len)) == NULL) return 0;\n+\n+ /* GR usually follows sequence it refers to; guess msa->lastidx */\n+ seqidx = MSAGetSeqidx(msa, seqname, msa->lastidx);\n+ msa->lastidx = seqidx;\n+\n+ if (strcmp(featurename, "SS") == 0) \n+ {\n+ if (msa->ss == NULL)\n+\t{\n+\t msa->ss = MallocOrDie(sizeof(char *) * msa->nseqalloc);\n+\t msa->sslen = MallocOrDie(sizeof(int) * msa->nseqalloc);\n+\t for (j = 0; j < msa->nseqalloc; j++)\n+\t {\n+\t msa->ss[j] = NULL;\n+\t msa->sslen[j] = 0;\n+\t }\n+\t}\n+ msa->sslen[seqidx] = sre_strcat(&(msa->ss[seqidx]), msa->sslen[seqidx], text, len);\n+ }\n+ else if (strcmp(featurename, "SA") == 0)\n+ {\n+ if (msa->sa == NULL)\n+\t{\n+\t msa->sa = MallocOrDie(sizeof(char *) * msa->nseqalloc);\n+\t msa->salen = MallocOrDie(sizeof(int) * msa->nseqalloc);\n+\t for (j = 0; j < msa->nseqalloc; j++) \n+\t {\n+\t msa->sa[j] = NULL;\n+\t msa->salen[j] = 0;\n+\t }\n+\t}\n+ msa->salen[seqidx] = sre_strcat(&(msa->sa[seqidx]), msa->salen[seqidx], text, len);\n+ }\n+ else \n+ MSAAppendGR(msa, featurename, seqidx, text);\n+\n+ return 1;\n+}\n+\n+\n+/* comments are simply stored verbatim, not parsed\n+ */\n+static int\n+parse_comment(MSA *msa, char *buf)\n+{\n+ char *s;\n+ char *comment;\n+\n+ s = buf + 1;\t\t\t /* skip leading \'#\' */\n+ if (*s == \'\\n\') { *s = \'\\0\'; comment = s; } /* deal with blank comment */\n+ else if ((comment = sre_strtok(&s, "\\n", NULL)) == NULL) return 0;\n+ \n+ MSAAddComment(msa, comment);\n+ return 1;\n+}\n+\n+static int\n+parse_sequence(MSA *msa, char *buf)\n+{\n+ char *s;\n+ char *seqname;\n+ char *text;\n+ int seqidx;\n+ int len;\n+\n+ s = buf;\n+ if ((seqname = sre_strtok(&s, WHITESPACE, NULL)) == NULL) return 0;\n+ if ((text = sre_strtok(&s, WHITESPACE, &len)) == NULL) return 0; \n+ \n+ /* seq usually follows another seq; guess msa->lastidx +1 */\n+ seqidx = MSAGetSeqidx(msa, seqname, msa->lastidx+1);\n+ msa->lastidx = seqidx;\n+\n+ msa->sqlen[seqidx] = sre_strcat(&(msa->aseq[seqidx]), msa->sqlen[seqidx], text, len);\n+ return 1;\n+}\n+\n+\n+\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/squid/stockholm.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/squid/stockholm.h Thu Jul 21 13:35:08 2011 -0400 |
b |
@@ -0,0 +1,51 @@ +#ifndef STOCKHOLM_H_INCLUDED +#define STOCKHOLM_H_INCLUDED + +#include "gki.h" + +typedef struct { + int *linetype; /* e.g. STOCKHOLM_GF_LINE; always valid */ + int *featurecode; /* all markup codes: e.g. STOCKHOLM_GF_ID; + nonmarkup: always set to STOCKHOLM_UNPARSED */ + char **featurename; /* all unparsed markup codes: string, e.g. "ID"; + all other lines: NULL */ + int *seqidx; /* all GS, GR, GC, sequence lines: which sequence; + other lines: 0 */ + int *len; /* all GR, GC, sequence lines: length of text field; + other lines: 0 */ + char **text; /* all unparsed nonblank lines: rest of data + other lines: NULL */ + int nseqalloc; /* current nseqs allocated for in aseqs and ainfo */ + int nlines; /* number of lines in this skel */ + int nlinealloc; /* current # of lines allocated for in this skel */ + int overall_line; /* line # in file (important in files w/ >1 ali)*/ +} alifile_skeleton; + +#define STOCKHOLM_GF_LINE 0 +#define STOCKHOLM_GS_LINE 1 +#define STOCKHOLM_GC_LINE 2 +#define STOCKHOLM_GR_LINE 3 +#define STOCKHOLM_SEQ_LINE 4 +#define STOCKHOLM_BLANK_LINE 5 +#define STOCKHOLM_COMMENT_LINE 6 + +#define STOCKHOLM_UNPARSED 0 +#define STOCKHOLM_GF_ID 1 +#define STOCKHOLM_GF_AC 2 +#define STOCKHOLM_GF_DE 3 +#define STOCKHOLM_GF_AU 4 +#define STOCKHOLM_GF_GA 5 +#define STOCKHOLM_GF_NC 6 +#define STOCKHOLM_GF_TC 7 +#define STOCKHOLM_GS_WT 100 +#define STOCKHOLM_GS_AC 101 +#define STOCKHOLM_GS_DE 102 +#define STOCKHOLM_GC_CS 200 +#define STOCKHOLM_GC_RF 201 +#define STOCKHOLM_GR_SS 300 +#define STOCKHOLM_GR_SA 301 + +#define SKEL_NSEQLUMP 10 /* allocate for new seqs in blocks of this size */ +#define SKEL_LUMPSIZE 100 /* allocate for new lines in skel in blocks of this size */ + +#endif /*STOCKHOLM_H_INCLUDED*/ |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/squid/stopwatch.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/squid/stopwatch.c Thu Jul 21 13:35:08 2011 -0400 |
[ |
b'@@ -0,0 +1,306 @@\n+/************************************************************\n+ * SQUID - a library of functions for biological sequence analysis\n+ * Copyright (C) 1992-2002 Washington University School of Medicine\n+ * \n+ * This source code is freely distributed under the terms of the\n+ * GNU General Public License. See the files COPYRIGHT and LICENSE\n+ * for details.\n+ ************************************************************/\n+\n+/* stopwatch.c\n+ * SRE, Fri Nov 26 14:54:21 1999 [St. Louis] [HMMER]\n+ * SRE, Thu Aug 3 08:11:52 2000 [St. Louis] [moved to SQUID]\n+ * \n+ * Reporting of cpu/system/elapsed time used by a process.\n+ * thanks to Warren Gish for assistance.\n+ * \n+ * Basic API:\n+ * \n+ * Stopwatch_t *w;\n+ * w = StopwatchCreate();\n+ * \n+ * StopwatchStart(w);\n+ * do_lots_of_stuff;\n+ * StopwatchStop(w);\n+ * StopwatchDisplay(stdout, "CPU time: ", w);\n+ * \n+ * StopwatchFree(w);\n+ * \n+ * Some behavior can be controlled at compile time by #define\'s:\n+ * \n+ * SRE_STRICT_ANSI: By default, stopwatch module assumes that a\n+ * machine is POSIX-compliant (e.g. has struct tms, sys/times.h, \n+ * and times()). If compiled with -DSRE_STRICT_ANSI, reverts to \n+ * pure ANSI C conformant implementation. This simpler system \n+ * won\'t report system times, only user and elapsed times.\n+ * \n+ * SRE_ENABLE_PVM: If compiled with -DSRE_ENABLE_PVM, the\n+ * functions StopwatchPVMPack() and StopwatchPVMUnpack()\n+ * are compiled, providing PVM communications ability.\n+ * \n+ * One additional compile-time configuration note: \n+ * PTHREAD_TIMES_HACK: Linux pthreads, as of RH6.0/glibc-devel-2.1.1-6, \n+ * appears to interact poorly with times() -- usage times in all \n+ * but the master thread are lost. A workaround for this bug is \n+ * to run stopwatches in each worker thread, and accumulate those \n+ * times back into the master stopwatch using StopwatchInclude().\n+ * (Just like a PVM implementation has to do.) In HMMER, this \n+ * behavior is compiled in with -DPTHREAD_TIMES_HACK. No\n+ * changes are made in stopwatch functions themselves, though;\n+ * all the extra code is HMMER code. See hmmcalibrate.c for\n+ * an example.\n+ * \n+ * See hmmcalibrate.c for examples of more complex usage\n+ * in dealing with pthreads and PVM.\n+ */\n+\n+#include <stdio.h>\n+#include <stdlib.h>\n+#include <unistd.h>\n+#ifdef SRE_ENABLE_PVM\n+#include <pvm3.h>\n+#endif\n+\n+#include "stopwatch.h"\n+\n+/* Function: format_time_string()\n+ * Date: SRE, Fri Nov 26 15:06:28 1999 [St. Louis]\n+ *\n+ * Purpose: Given a number of seconds, format into\n+ * hh:mm:ss.xx in a provided buffer.\n+ *\n+ * Args: buf - allocated space (128 is plenty!)\n+ * sec - number of seconds\n+ * do_frac - TRUE (1) to include hundredths of a sec\n+ */\n+static void\n+format_time_string(char *buf, double sec, int do_frac)\n+{\n+ int h, m, s, hs;\n+ \n+ h = (int) (sec / 3600.);\n+ m = (int) (sec / 60.) - h * 60;\n+ s = (int) (sec) - h * 3600 - m * 60;\n+ if (do_frac) {\n+ hs = (int) (sec * 100.) - h * 360000 - m * 6000 - s * 100;\n+ sprintf(buf, "%02d:%02d:%02d.%02d", h,m,s,hs);\n+ } else {\n+ sprintf(buf, "%02d:%02d:%02d", h,m,s);\n+ }\n+}\n+\n+/* Function: StopwatchStart()\n+ * Date: SRE, Fri Nov 26 15:07:48 1999 [St. Louis]\n+ *\n+ * Purpose: Start a stopwatch.\n+ *\n+ * Args: w - the watch\n+ */\n+void\n+StopwatchStart(Stopwatch_t *w)\n+{\n+ w->t0 = time(NULL);\n+#ifdef SRE_STRICT_ANSI\n+ w->cpu0 = clock();\n+#else\n+ (void) times(&(w->cpu0));\n+#endif\n+\n+ w->elapsed = 0.;\n+ w->user = 0.;\n+ w->sys = 0.;\n+}\n+\n+/* Function: StopwatchStop()\n+ * Date: SRE, Fri Nov 26 15:08:16 1999 [St. Louis]\n+ *\n+ * Purpose: Stop a stopwatch. \n+ *\n+ * The implementation allows "split times":\n+ * you can stop a watch multiple times, reporting\n+ * times at multiple poi'..b'>sys = (double) (cpu1.tms_stime + cpu1.tms_cstime -\n+\t\t w->cpu0.tms_stime - w->cpu0.tms_cstime) /\n+ (double) clk_tck;\n+#endif\n+}\n+\n+/* Function: StopwatchInclude()\n+ * Date: SRE, Fri Nov 26 15:09:34 1999 [St. Louis]\n+ *\n+ * Purpose: Merge the cpu and system times from a slave into\n+ * a master stopwatch. Both watches must be\n+ * stopped, and should not be stopped again unless\n+ * You Know What You\'re Doing.\n+ * \n+ * Elapsed time is *not* merged; master is assumed\n+ * to be keeping track of the wall clock time,\n+ * and the slave/worker watch is ignored.\n+ * \n+ * Used in two cases:\n+ * 1) PVM; merge in the stopwatch(es) from separate\n+ * process(es) in a cluster.\n+ * 2) Threads, for broken pthreads/times() implementations\n+ * that lose track of cpu times used by spawned\n+ * threads.\n+ * \n+ * Args: w1 - the master stopwatch\n+ * w2 - the slave/worker watch\n+ *\n+ */\n+void\n+StopwatchInclude(Stopwatch_t *w1, Stopwatch_t *w2)\n+{\n+ w1->user += w2->user;\n+ w1->sys += w2->sys;\n+}\n+\n+/* Function: StopwatchAlloc(), StopwatchZero(), StopwatchCopy(), \n+ * StopwatchFree()\n+ * Date: SRE, Fri Nov 26 15:13:14 1999 [St. Louis]\n+ *\n+ * Purpose: The usual creation/manipulation/destruction routines\n+ * for a stopwatch object.\n+ */\n+Stopwatch_t *\n+StopwatchCreate(void)\n+{\n+ Stopwatch_t *w;\n+ w = malloc(sizeof(Stopwatch_t));\n+ return w;\n+}\n+void\n+StopwatchZero(Stopwatch_t *w)\n+{\n+ w->elapsed = 0.;\n+ w->user = 0.;\n+ w->sys = 0.;\n+}\n+void \n+StopwatchCopy(Stopwatch_t *w1, Stopwatch_t *w2)\n+{\n+ w1->t0 = w2->t0;\n+#ifdef SRE_STRICT_ANSI\n+ w1->cpu0 = w2->cpu0;\n+#else\n+ w1->cpu0.tms_utime = w2->cpu0.tms_utime;\n+ w1->cpu0.tms_stime = w2->cpu0.tms_stime;\n+ w1->cpu0.tms_cutime = w2->cpu0.tms_cutime;\n+ w1->cpu0.tms_cstime = w2->cpu0.tms_cstime;\n+#endif\n+ w1->elapsed = w2->elapsed;\n+ w1->user = w2->user;\n+ w1->sys = w2->sys;\n+}\n+void\n+StopwatchFree(Stopwatch_t *w)\n+{\n+ free(w);\n+}\n+\n+\n+/* Function: StopwatchDisplay()\n+ * Date: SRE, Fri Nov 26 15:14:12 1999 [St. Louis]\n+ *\n+ * Purpose: Output a usage summary line from a *stopped*\n+ * stopwatch (the times will reflect the last\n+ * time StopwatchStop() was called.)\n+ * \n+ * For s = "CPU Time: " an example output line is:\n+ * CPU Time: 142.55u 7.17s 149.72 Elapsed: 00:02:35.00\n+ *\n+ * Args: fp - open file for writing (stdout, possibly)\n+ * s - prefix for the report line\n+ * w - a (recently stopped) stopwatch \n+ *\n+ */\n+void\n+StopwatchDisplay(FILE *fp, char *s, Stopwatch_t *w)\n+{\n+ char buf[128];\t/* (safely holds up to 10^14 years) */\n+ \n+ if (s == NULL)\n+ fputs("CPU Time: ", fp);\n+ else \n+ fputs(s, fp);\n+\n+ format_time_string(buf, w->user+w->sys, 1);\n+#ifdef SRE_STRICT_ANSI\n+ fprintf(fp, "%.2fu %s ", w->user, buf);\n+#else\n+ fprintf(fp, "%.2fu %.2fs %s ", w->user, w->sys, buf);\n+#endif\n+\n+ format_time_string(buf, w->elapsed, 0);\n+ fprintf(fp, "Elapsed: %s\\n", buf);\n+}\n+ \n+#ifdef SRE_ENABLE_PVM\n+/* Function: StopwatchPVMPack(), StopwatchPVMUnpack()\n+ * Date: SRE, Fri Nov 26 15:22:04 1999 [St. Louis]\n+ *\n+ * Purpose: Transmission of stopwatch data in a PVM\n+ * cluster.\n+ */\n+void\n+StopwatchPVMPack(Stopwatch_t *w)\n+{\n+ pvm_pkdouble(&(w->elapsed), 1, 1);\n+ pvm_pkdouble(&(w->user), 1, 1);\n+ pvm_pkdouble(&(w->sys), 1, 1);\n+}\n+void\n+StopwatchPVMUnpack(Stopwatch_t *w)\n+{\n+ pvm_upkdouble(&(w->elapsed), 1, 1);\n+ pvm_upkdouble(&(w->user), 1, 1);\n+ pvm_upkdouble(&(w->sys), 1, 1);\n+}\n+#endif /*SRE_ENABLE_PVM*/\n+\n+\n+#ifdef TESTDRIVER\n+int\n+main(int argc, char **argv)\n+{\n+ Stopwatch_t stopwatch;\n+\n+ StopwatchStart(&stopwatch);\n+\n+ sleep(5);\n+\n+ StopwatchStop(&stopwatch);\n+ StopwatchDisplay(stdout, "CPU Time: ", &stopwatch);\n+}\n+#endif\n' |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/squid/stopwatch.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/squid/stopwatch.h Thu Jul 21 13:35:08 2011 -0400 |
[ |
@@ -0,0 +1,58 @@ +/* stopwatch.h + * SRE, Fri Nov 26 14:54:21 1999 [St. Louis] [HMMER] + * SRE, Thu Aug 3 08:00:35 2000 [St. Louis] [moved to SQUID] + * CVS $Id: stopwatch.h,v 1.2 2000/08/03 22:24:38 eddy Exp) + * + * Header file for stopwatch.c module: + * reporting of cpu/system/elapsed time used by a process. + * See stopwatch.c comments for documentation of compile-time + * configuration options and API. + * + ***************************************************************** + * SQUID - a library of functions for biological sequence analysis + * Copyright (C) 1992-2002 Washington University School of Medicine + * + * This source code is freely distributed under the terms of the + * GNU General Public License. See the files COPYRIGHT and LICENSE + * for details. + ***************************************************************** + */ +#include <stdio.h> +#include <time.h> +#ifndef SRE_STRICT_ANSI +#include <sys/times.h> +#endif + +#ifndef STOPWATCH_H_INCLUDED +#define STOPWATCH_H_INCLUDED + +struct stopwatch_s { + time_t t0; /* Wall clock time, ANSI time() */ +#ifdef SRE_STRICT_ANSI + clock_t cpu0; /* CPU time, ANSI clock() */ +#else + struct tms cpu0; /* CPU/system time, POSIX times()*/ +#endif + + double elapsed; /* elapsed time, seconds */ + double user; /* CPU time, seconds */ + double sys; /* system time, seconds */ +}; +typedef struct stopwatch_s Stopwatch_t; + +extern void StopwatchStart(Stopwatch_t *w); +extern void StopwatchStop(Stopwatch_t *w); +extern void StopwatchInclude(Stopwatch_t *w1, Stopwatch_t *w2); +extern Stopwatch_t *StopwatchCreate(void); +extern void StopwatchZero(Stopwatch_t *w); +extern void StopwatchCopy(Stopwatch_t *w1, Stopwatch_t *w2); +extern void StopwatchFree(Stopwatch_t *w); +extern void StopwatchDisplay(FILE *fp, char *s, Stopwatch_t *w); + +#ifdef HMMER_PVM +extern void StopwatchPVMPack(Stopwatch_t *w); +extern void StopwatchPVMUnpack(Stopwatch_t *w); +#endif + +#endif /*STOPWATCH_H_INCLUDED*/ + |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/squid/translate.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/squid/translate.c Thu Jul 21 13:35:08 2011 -0400 |
[ |
@@ -0,0 +1,86 @@ +/***************************************************************** + * SQUID - a library of functions for biological sequence analysis + * Copyright (C) 1992-2002 Washington University School of Medicine + * + * This source code is freely distributed under the terms of the + * GNU General Public License. See the files COPYRIGHT and LICENSE + * for details. + *****************************************************************/ + +/* + * translate.c - functions for translating nucleic acid sequence + * created Tue Jan 12 11:27:29 1993, SRE + * + * RCS $Id: translate.c 217 2011-03-19 10:27:10Z andreas $ (Original squid RCS Id: translate.c,v 1.2 1998/10/09 18:07:16 eddy Exp) + */ + +#include <stdio.h> +#include <string.h> +#include "squid.h" + + +#ifdef MEMDEBUG +#include "dbmalloc.h" +#endif + + + +/* Function: Translate(char *seq, char **code) + * + * Given a ptr to the start of a nucleic acid sequence, + * and a genetic code, translate the sequence into + * amino acid sequence. + * + * code is an array of 65 strings, representing + * the translations of the 64 codons, arranged + * in order AAA, AAC, AAG, AAU, ..., UUA, UUC, UUG, UUU. + * '*' or '***' is used to represent termination + * codons, usually. The final string, code[64], + * is the code for an ambiguous amino acid. + * + * Because of the way space is allocated for the amino + * acid sequence, the amino acid strings cannot be + * longer than 3 letters each. (I don't foresee using + * anything but the single- and triple- letter codes.) + * + * Returns a ptr to the translation string on success, + * or NULL on failure. + */ +char * +Translate(char *seq, char **code) +{ + int codon; /* index for codon */ + char *aaseq; /* RETURN: the translation */ + char *aaptr; /* ptr into aaseq */ + int i; + + if (seq == NULL) + { squid_errno = SQERR_NODATA; return NULL; } + if ((aaseq = (char *) calloc (strlen(seq) + 1, sizeof(char))) == NULL) + Die("calloc failed"); + + aaptr = aaseq; + for (; *seq != '\0' && *(seq+1) != '\0' && *(seq+2) != '\0'; seq += 3) + { + /* calculate the lookup value for + this codon */ + codon = 0; + for (i = 0; i < 3; i++) + { + codon *= 4; + switch (*(seq + i)) { + case 'A': case 'a': break; + case 'C': case 'c': codon += 1; break; + case 'G': case 'g': codon += 2; break; + case 'T': case 't': codon += 3; break; + case 'U': case 'u': codon += 3; break; + default: codon = 64; break; + } + if (codon == 64) break; + } + + strcpy(aaptr, code[codon]); + aaptr += strlen(code[codon]); + } + return aaseq; +} |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/squid/types.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/squid/types.c Thu Jul 21 13:35:08 2011 -0400 |
[ |
@@ -0,0 +1,227 @@ +/***************************************************************** + * SQUID - a library of functions for biological sequence analysis + * Copyright (C) 1992-2002 Washington University School of Medicine + * + * This source code is freely distributed under the terms of the + * GNU General Public License. See the files COPYRIGHT and LICENSE + * for details. + *****************************************************************/ + +/* file: types.c + * + * Finicky type checkers for strings. Return 1 (TRUE) if ok, 0 elsewise. + * Also, finicky type converters (sre_ntoh32() and friends) + * + * CVS $Id: types.c,v 1.5 2001/01/08 22:58:12 eddy Exp) + */ + +#include <string.h> +#include <ctype.h> +#include "squid.h" + +/* Function: IsInt() + * + * Returns TRUE if s points to something that atoi() will parse + * completely and convert to an integer. + */ +int +IsInt(char *s) +{ + int hex = 0; + + if (s == NULL) {squid_errno = SQERR_PARAMETER; return 0; } + + /* skip whitespace */ + while (isspace((int) (*s))) s++; + /* skip leading sign */ + if (*s == '-' || *s == '+') s++; + /* skip leading conversion signals */ + if ((strncmp(s, "0x", 2) == 0 && (int) strlen(s) > 2) || + (strncmp(s, "0X", 2) == 0 && (int) strlen(s) > 2)) + { + s += 2; + hex = 1; + } + else if (*s == '0' && (int) strlen(s) > 1) + s++; + /* examine remainder for garbage chars */ + if (!hex) + while (*s != '\0') + { + if (!isdigit((int) (*s))) return 0; + s++; + } + else + while (*s != '\0') + { + if (!isxdigit((int) (*s))) return 0; + s++; + } + + return 1; +} + + +/* Function: IsReal() + * + * Purpose: Returns TRUE if s is a string representation + * of a valid floating point number. + */ +int +IsReal(char *s) +{ + int gotdecimal = 0; + int gotexp = 0; + int gotreal = 0; + + if (s == NULL) return 0; + + while (isspace((int) (*s))) s++; /* skip leading whitespace */ + if (*s == '-' || *s == '+') s++; /* skip leading sign */ + + /* Examine remainder for garbage. Allowed one '.' and + * one 'e' or 'E'; if both '.' and e/E occur, '.' + * must be first. + */ + while (*s != '\0') + { + if (isdigit((int) (*s))) + gotreal++; + else if (*s == '.') + { + if (gotdecimal) return 0; /* can't have two */ + if (gotexp) return 0; /* e/E preceded . */ + else gotdecimal++; + } + else if (*s == 'e' || *s == 'E') + { + if (gotexp) return 0; /* can't have two */ + else gotexp++; + } + else if (isspace((int) (*s))) + break; + + s++; + } + + while (isspace((int) (*s))) s++; /* skip trailing whitespace */ + if (*s == '\0' && gotreal) return 1; + else return 0; +} + + +/* Function: Byteswap() + * + * Purpose: Swap between big-endian and little-endian. + * For example: + * int foo = 0x12345678; + * byteswap((char *) &foo, sizeof(int)); + * printf("%x\n", foo) + * gives 78563412. + * + * I don't fully understand byte-swapping issues. + * However, I have tested this on chars through floats, + * on various machines: + * SGI IRIX 4.0.5, SunOS 4.1.3, DEC Alpha OSF/1, Alliant + * + * Date: Sun Feb 12 10:26:22 1995 + */ +void +Byteswap(char *swap, int nbytes) +{ + int x; + char byte; + + for (x = 0; x < nbytes / 2; x++) + { + byte = swap[nbytes - x - 1]; + swap[nbytes - x - 1] = swap[x]; + swap[x] = byte; + } +} + + + +/* Functions: sre_ntoh16(), etc. + * Date: SRE, Sun Dec 31 11:26:53 2000 [St. Louis] + * + * Purpose: Provide functionality of ntohs(), etc; extended + * to 64-bit unsigned ints, and explicitly provided + * in case a machine doesn't have the ntohs() + * family. + * + * If we're using the host functions, + * USE_HOST_BYTESWAP_FUNCTIONS was set to 1 in + * squidconf.h, and we #define'd sre_hton16(x)=hton(x), etc. + * in squid.h. In doing this, we assumed that the + * host functions work on 16- and 32-bit unsigned quantities. + * If for some reason that's not true, set + * USE_HOST_BYTESWAP_FUNCTIONS to 0. + */ +#ifndef USE_HOST_BYTESWAP_FUNCTIONS +sqd_uint16 +sre_ntoh16(sqd_uint16 netshort) +{ +#ifdef WORDS_BIGENDIAN + return netshort; +#else + Byteswap((char *) &netshort, 2); + return netshort; +#endif +} +sqd_uint32 +sre_ntoh32(sqd_uint32 netlong) +{ +#ifdef WORDS_BIGENDIAN + return netlong; +#else + Byteswap((char *) &netlong, 4); + return netlong; +#endif +} +sqd_uint16 +sre_hton16(sqd_uint16 hostshort) +{ +#ifdef WORDS_BIGENDIAN + return hostshort; +#else + Byteswap((char *) &hostshort, 2); + return hostshort; +#endif +} +sqd_uint32 +sre_hton32(sqd_uint32 hostlong) +{ +#ifdef WORDS_BIGENDIAN + return hostlong; +#else + Byteswap((char *) &hostlong, 4); + return hostlong; +#endif +} +#endif /*USE_HOST_BYTESWAP_FUNCTIONS*/ + +sqd_uint64 +sre_ntoh64(sqd_uint64 net_int64) +{ +#ifdef WORDS_BIGENDIAN + return net_int64; +#else + Byteswap((char *) &net_int64, 8); + return net_int64; +#endif +} +sqd_uint64 +sre_hton64(sqd_uint64 host_int64) +{ +#ifdef WORDS_BIGENDIAN + return host_int64; +#else + Byteswap((char *) &host_int64, 8); + return host_int64; +#endif +} + + + + |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/squid/vectorops.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/squid/vectorops.c Thu Jul 21 13:35:08 2011 -0400 |
[ |
@@ -0,0 +1,297 @@ +/* vectorops.c + * Operations on vectors of floats or doubles. + * + * DSet(), FSet() - set all items in vector to value. + * DScale(), FScale() - multiply all items in vector by scale + * DSum(), FSum() - return sum of values in vector + * DAdd(), FAdd() - add vec2 to vec1. + * DCopy(), FCopy() - set vec1 to be same as vec2. + * DDot(), FDot() - return dot product of two vectors. + * DMax(), FMax() - return value of maximum element in vector + * DMin(), FMin() - return value of minimum element in vector + * DArgMax(), FArgMax() - return index of maximum element in vector + * DArgMin(), FArgMin() - return index of minimum element in vector + * + * DNorm(), FNorm() - normalize a probability vector of length n. + * DLog(), FLog() - convert to log probabilities + * DExp(), FExp() - convert log p's back to probabilities + * DLogSum(), FLogSum() - given vector of log p's; return log of summed p's. + * + * SRE, Tue Oct 1 15:23:25 2002 [St. Louis] + * CVS $Id: vectorops.c,v 1.1 2002/10/09 14:26:09 eddy Exp) + */ + +#include <stdlib.h> +#include <math.h> +#include <float.h> +#include "vectorops.h" + +void +DSet(double *vec, int n, double value) +{ + int x; + for (x = 0; x < n; x++) vec[x] = value; +} + +void +FSet(float *vec, int n, float value) +{ + int x; + for (x = 0; x < n; x++) vec[x] = value; +} + +void +DScale(double *vec, int n, double scale) +{ + int x; + for (x = 0; x < n; x++) vec[x] *= scale; +} + +void +FScale(float *vec, int n, float scale) +{ + int x; + for (x = 0; x < n; x++) vec[x] *= scale; +} + +double +DSum(double *vec, int n) +{ + double sum = 0.; + int x; + for (x = 0; x < n; x++) sum += vec[x]; + return sum; +} + +float +FSum(float *vec, int n) +{ + float sum = 0.; + int x; + for (x = 0; x < n; x++) sum += vec[x]; + return sum; +} + +void +DAdd(double *vec1, double *vec2, int n) +{ + int x; + for (x = 0; x < n; x++) vec1[x] += vec2[x]; +} + +void +FAdd(float *vec1, float *vec2, int n) +{ + int x; + for (x = 0; x < n; x++) vec1[x] += vec2[x]; +} + +void +DCopy(double *vec1, double *vec2, int n) +{ + int x; + for (x = 0; x < n; x++) vec1[x] = vec2[x]; +} + +void +FCopy(float *vec1, float *vec2, int n) +{ + int x; + for (x = 0; x < n; x++) vec1[x] = vec2[x]; +} + +double +DDot(double *vec1, double *vec2, int n) +{ + double result = 0.; + int x; + for (x = 0; x < n; x++) result += vec1[x] * vec2[x]; + return result; +} + +float +FDot(float *vec1, float *vec2, int n) +{ + float result = 0.; + int x; + for (x = 0; x < n; x++) result += vec1[x] * vec2[x]; + return result; +} + +double +DMax(double *vec, int n) +{ + int i; + double best; + + best = vec[0]; + for (i = 1; i < n; i++) + if (vec[i] > best) best = vec[i]; + return best; +} + +float +FMax(float *vec, int n) +{ + int i; + float best; + + best = vec[0]; + for (i = 1; i < n; i++) + if (vec[i] > best) best = vec[i]; + return best; +} + +double +DMin(double *vec, int n) +{ + int i; + double best; + + best = vec[0]; + for (i = 1; i < n; i++) + if (vec[i] < best) best = vec[i]; + return best; +} + +float +FMin(float *vec, int n) +{ + int i; + float best; + + best = vec[0]; + for (i = 1; i < n; i++) + if (vec[i] < best) best = vec[i]; + return best; +} + +double +DArgMax(double *vec, int n) +{ + int i; + int best = 0; + + for (i = 1; i < n; i++) + if (vec[i] > vec[best]) best = i; + return best; +} + +float +FArgMax(float *vec, int n) +{ + int i; + int best = 0; + + for (i = 1; i < n; i++) + if (vec[i] > vec[best]) best = i; + return best; +} + +double +DArgMin(double *vec, int n) +{ + int i; + int best = 0; + for (i = 1; i < n; i++) + if (vec[i] < vec[best]) best = i; + return best; +} + +float +FArgMin(float *vec, int n) +{ + int i; + int best = 0; + + for (i = 1; i < n; i++) + if (vec[i] < vec[best]) best = i; + return best; +} + +void +DNorm(double *vec, int n) +{ + int x; + double sum; + + sum = DSum(vec, n); + if (sum != 0.0) for (x = 0; x < n; x++) vec[x] /= sum; + else for (x = 0; x < n; x++) vec[x] = 1. / (double) n; +} + +void +FNorm(float *vec, int n) +{ + int x; + float sum; + + sum = FSum(vec, n); + if (sum != 0.0) for (x = 0; x < n; x++) vec[x] /= sum; + else for (x = 0; x < n; x++) vec[x] = 1. / (float) n; +} + +void +DLog(double *vec, int n) +{ + int x; + for (x = 0; x < n; x++) + if (vec[x] > 0.) vec[x] = log(vec[x]); + else vec[x] = -DBL_MAX; +} + +void +FLog(float *vec, int n) +{ + int x; + for (x = 0; x < n; x++) + if (vec[x] > 0.) vec[x] = log(vec[x]); + else vec[x] = -FLT_MAX; +} + +void +DExp(double *vec, int n) +{ + int x; + for (x = 0; x < n; x++) vec[x] = exp(vec[x]); +} + +void +FExp(float *vec, int n) +{ + int x; + for (x = 0; x < n; x++) vec[x] = exp(vec[x]); +} + +float +DLogSum(double *vec, int n) +{ + int x; + double max, sum; + + max = DMax(vec, n); + sum = 0.0; + for (x = 0; x < n; x++) + if (vec[x] > max - 50.) + sum += exp(vec[x] - max); + sum = log(sum) + max; + return sum; +} + +float +FLogSum(float *vec, int n) +{ + int x; + float max, sum; + + max = FMax(vec, n); + sum = 0.0; + for (x = 0; x < n; x++) + if (vec[x] > max - 50.) + sum += exp(vec[x] - max); + sum = log(sum) + max; + return sum; +} + + + |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/squid/vectorops.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/squid/vectorops.h Thu Jul 21 13:35:08 2011 -0400 |
[ |
@@ -0,0 +1,36 @@ +/* vectorops.h + * Header file for vectorops.c + * + * SRE, Tue Oct 1 15:23:37 2002 [St. Louis] + * CVS $Id: vectorops.h,v 1.1 2002/10/09 14:26:09 eddy Exp) + */ + +extern void DSet(double *vec, int n, double value); +extern void FSet(float *vec, int n, float value); +extern void DScale(double *vec, int n, double scale); +extern void FScale(float *vec, int n, float scale); +extern double DSum(double *vec, int n); +extern float FSum(float *vec, int n); +extern void DAdd(double *vec1, double *vec2, int n); +extern void FAdd(float *vec1, float *vec2, int n); +extern void DCopy(double *vec1, double *vec2, int n); +extern void FCopy(float *vec1, float *vec2, int n); +extern double DDot(double *vec1, double *vec2, int n); +extern float FDot(float *vec1, float *vec2, int n); +extern double DMax(double *vec, int n); +extern float FMax(float *vec, int n); +extern double DMin(double *vec, int n); +extern float FMin(float *vec, int n); +extern double DArgMax(double *vec, int n); +extern float FArgMax(float *vec, int n); +extern double DArgMin(double *vec, int n); +extern float FArgMin(float *vec, int n); +extern void DNorm(double *vec, int n); +extern void FNorm(float *vec, int n); +extern void DLog(double *vec, int n); +extern void FLog(float *vec, int n); +extern void DExp(double *vec, int n); +extern void FExp(float *vec, int n); +extern float DLogSum(double *vec, int n); +extern float FLogSum(float *vec, int n); + |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/squid/version.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/squid/version.h Thu Jul 21 13:35:08 2011 -0400 |
b |
@@ -0,0 +1,6 @@ +/* version.h -- automatically generated by a Makefile. DO NOT EDIT. */ +#define PACKAGE "SQUID" +#define RELEASE "1.9g" +#define RELEASEDATE "Oct 2002" +#define COPYRIGHT "Copyright (C) 1992-2002 HHMI/Washington University School of Medicine" +#define LICENSE "Freely distributed under the GNU General Public License (GPL)" |
b |
diff -r ff1768533a07 -r bc707542e5de clustalomega/clustal-omega-1.0.2/src/squid/weight.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/clustalomega/clustal-omega-1.0.2/src/squid/weight.c Thu Jul 21 13:35:08 2011 -0400 |
[ |
b'@@ -0,0 +1,748 @@\n+/*****************************************************************\n+ * SQUID - a library of functions for biological sequence analysis\n+ * Copyright (C) 1992-2002 Washington University School of Medicine\n+ * \n+ * This source code is freely distributed under the terms of the\n+ * GNU General Public License. See the files COPYRIGHT and LICENSE\n+ * for details.\n+ *****************************************************************/\n+\n+/* weight.c\n+ * SRE, Thu Mar 3 07:56:01 1994\n+ * \n+ * Calculate weights for sequences in an alignment.\n+ * RCS $Id: weight.c 217 2011-03-19 10:27:10Z andreas $ (Original squid RCS Id: weight.c,v 1.9 2002/10/09 14:26:09 eddy Exp)\n+ */\n+\n+#include <ctype.h>\n+#include <string.h>\n+#include "squid.h"\n+#include "sre_random.h"\n+\n+static void upweight(struct phylo_s *tree, int nseq, float *lwt, float *rwt, int node);\n+static void downweight(struct phylo_s *tree, int nseq, float *lwt, float *rwt, \n+\t\t float *fwt, int node);\n+static float simple_distance(char *s1, char *s2);\n+static int simple_diffmx(char **aseqs,int num, float ***ret_dmx);\n+\n+/* Function: GSCWeights()\n+ * \n+ * Purpose: Use Erik\'s tree-based algorithm to set weights for\n+ * sequences in an alignment. upweight() and downweight()\n+ * are derived from Graeme Mitchison\'s code.\n+ * \n+ * Args: aseq - array of (0..nseq-1) aligned sequences\n+ * nseq - number of seqs in alignment \n+ * alen - length of alignment\n+ * wgt - allocated [0..nseq-1] array of weights to be returned\n+ * \n+ * Return: (void)\n+ * wgt is filled in.\n+ */\n+void\n+GSCWeights(char **aseq, int nseq, int alen, float *wgt)\n+{\n+ float **dmx; /* distance (difference) matrix */\n+ struct phylo_s *tree;\n+ float *lwt, *rwt; /* weight on left, right of this tree node */\n+ float *fwt; /* final weight assigned to this node */\n+ int i;\n+ \n+ /* Sanity check first\n+ */\n+ if (nseq == 1) { wgt[0] = 1.0; return; }\n+\n+ /* I use a simple fractional difference matrix derived by\n+ * pairwise identity. Perhaps I should include a Poisson\n+ * distance correction.\n+ */\n+ MakeDiffMx(aseq, nseq, &dmx);\n+ if (! Cluster(dmx, nseq, CLUSTER_MIN, &tree)) Die("Cluster() failed");\n+ \n+ /* Allocations\n+ */\n+ lwt = MallocOrDie (sizeof(float) * (2 * nseq - 1));\n+ rwt = MallocOrDie (sizeof(float) * (2 * nseq - 1));\n+ fwt = MallocOrDie (sizeof(float) * (2 * nseq - 1));\n+ \n+ /* lwt and rwt are the total branch weight to the left and\n+ * right of a node or sequence. They are 0..2N-2. 0..N-1 are \n+ * the sequences; these have weight 0. N..2N-2 are the actual\n+ * tree nodes.\n+ */\n+ for (i = 0; i < nseq; i++)\n+ lwt[i] = rwt[i] = 0.0;\n+\t\t\t\t/* recursively calculate rwt, lwt, starting\n+\t\t\t\t at node nseq (the root) */\n+ upweight(tree, nseq, lwt, rwt, nseq);\n+\n+\t\t\t\t/* recursively distribute weight across the\n+\t\t\t\t tree */\n+ fwt[nseq] = nseq;\n+ downweight(tree, nseq, lwt, rwt, fwt, nseq);\n+\t\t\t\t/* collect the weights */\n+ for (i = 0; i < nseq; i++)\n+ wgt[i] = fwt[i];\n+\n+ FMX2Free(dmx);\n+ FreePhylo(tree, nseq);\n+ free(lwt); free(rwt); free(fwt);\n+}\n+\n+static void \n+upweight(struct phylo_s *tree, int nseq, float *lwt, float *rwt, int node)\n+{\n+ int ld,rd;\n+\n+ ld = tree[node-nseq].left;\n+ if (ld >= nseq) upweight(tree, nseq, lwt, rwt, ld);\n+ rd = tree[node-nseq].right;\n+ if (rd >= nseq) upweight(tree, nseq, lwt, rwt, rd);\n+ lwt[node] = lwt[ld] + rwt[ld] + tree[node-nseq].lblen;\n+ rwt[node] = lwt[rd] + rwt[rd] + tree[node-nseq].rblen;\n+}\n+\n+\n+static void \n+downweight(struct phylo_s *tree, int nseq, float *lwt, float *rwt, float *fwt, int node)\n+{\n+ int ld,rd;\n+ float lnum, rnum;\n+\n+ ld = tree[node-nseq].left;\n+ rd = tree[node-nseq].right;\n+ if (lwt[node] + rwt[node] > 0.0)\n+ {\n+ fwt[ld] = fwt[node] * (lwt[node] / (lwt[node] + rwt[node]));\n+ fwt[rd] = fwt[node]'..b" within a column, there's no mixed case.\n+ * \n+ * Algorithm: \n+ * I don't know if this algorithm is published. I \n+ * haven't seen it in graph theory books, but that might\n+ * be because it's so obvious that nobody's bothered.\n+ * \n+ * In brief, we're going to do a breadth-first search\n+ * of the graph, and we're going to calculate links\n+ * on the fly rather than precalculating them into\n+ * some sort of standard adjacency structure.\n+ * \n+ * While working, we keep two stacks of maximum length N:\n+ * a : list of vertices that are still unconnected.\n+ * b : list of vertices that we've connected to \n+ * in our current breadth level, but we haven't\n+ * yet tested for other connections to a.\n+ * The current length (number of elements in) a and b are\n+ * kept in na, nb.\n+ * \n+ * We store our results in an array of length N:\n+ * c : assigns each vertex to a component. for example\n+ * c[4] = 1 means that vertex 4 is in component 1.\n+ * nc is the number of components. Components\n+ * are numbered from 0 to nc-1. We return c and nc\n+ * to our caller.\n+ * \n+ * The algorithm is:\n+ * \n+ * Initialisation: \n+ * a <-- all the vertices\n+ * na <-- N\n+ * b <-- empty set\n+ * nb <-- 0\n+ * nc <-- 0\n+ * \n+ * Then:\n+ * while (a is not empty)\n+ * pop a vertex off a, push onto b\n+ * while (b is not empty)\n+ * pop vertex v off b\n+ * assign c[v] = nc\n+ * for each vertex w in a:\n+ * compare v,w. If w is linked to v, remove w\n+ * from a, push onto b.\n+ * nc++ \n+ * q.e.d. :) \n+ *\n+ * Args: aseq - aligned sequences\n+ * nseq - number of sequences in aseq\n+ * alen - alignment length\n+ * maxid - fractional identity threshold 0..1. if id >= maxid, seqs linked\n+ * ret_c - RETURN: 0..nseq-1 assignments of seqs to components (clusters)\n+ * ret_nc - RETURN: number of components\n+ *\n+ * Returns: void.\n+ * ret_c is allocated here. Caller free's with free(*ret_c)\n+ */\n+void\n+SingleLinkCluster(char **aseq, int nseq, int alen, float maxid, \n+\t\t int **ret_c, int *ret_nc)\n+{\n+ int *a, na; /* stack of available vertices */\n+ int *b, nb; /* stack of working vertices */\n+ int *c; /* array of results */\n+ int nc;\t\t\t/* total number of components */\n+ int v,w;\t\t\t/* index of a working vertices */\n+ int i;\t\t\t/* loop counter */\n+\n+ /* allocations and initializations\n+ */\n+ a = MallocOrDie (sizeof(int) * nseq);\n+ b = MallocOrDie (sizeof(int) * nseq);\n+ c = MallocOrDie (sizeof(int) * nseq);\n+ for (i = 0; i < nseq; i++) a[i] = i;\n+ na = nseq;\n+ nb = 0;\n+ nc = 0;\n+\n+ /* Main algorithm\n+ */\n+ while (na > 0)\n+ {\n+ v = a[na-1]; na--;\t/* pop a vertex off a, */\n+ b[nb] = v; nb++;\t/* and push onto b */\n+ while (nb > 0)\n+\t{\n+\t v = b[nb-1]; nb--;\t/* pop vertex off b */\n+\t c[v] = nc;\t\t/* assign it to component nc */\n+\t for (i = na-1; i >= 0; i--)/* backwards, becase of deletion/swapping we do*/\n+\t if (simple_distance(aseq[v], aseq[a[i]]) <= 1. - maxid) /* linked? */\n+\t {\t\t\t\n+\t\tw = a[i]; a[i] = a[na-1]; na--;\t/* delete w from a (note swap) */\n+\t\tb[nb] = w; nb++; /* push w onto b */\n+\t }\n+\t}\n+ nc++;\n+ }\n+\n+ /* Cleanup and return\n+ */\n+ free(a);\n+ free(b);\n+ *ret_c = c;\n+ *ret_nc = nc;\n+ return;\n+}\n" |