Skip to content
Browse files

first commit

  • Loading branch information...
0 parents commit c303b8a00f0c8fbad14a9f96073353c6019c44e4 @bioinfornatics bioinfornatics committed Apr 29, 2012
Showing with 21,126 additions and 0 deletions.
  1. +165 −0 LISENSE
  2. +243 −0 Makefile
  3. +96 −0 README
  4. +11 −0 TODO
  5. +8 −0 build/.lock-waf_linux2_build
  6. +3 −0 build/c4che/_cache.py
  7. +2 −0 build/c4che/build.config.py
  8. +10 −0 build/config.log
  9. +12 −0 clean.sh
  10. +315 −0 command.make
  11. +121 −0 cutedoc.ddoc
  12. +215 −0 cutedoc.js.in.in
  13. +8 −0 dscience/.lock-waf_linux2_build
  14. +231 −0 dscience/exception.d
  15. +466 −0 dscience/math/alignement.d
  16. +3,471 −0 dscience/math/matrix.d
  17. +69 −0 dscience/math/motif.d
  18. +135 −0 dscience/math/statistics.d
  19. +1,439 −0 dscience/molecules/amino_acid.d
  20. +491 −0 dscience/molecules/nucleic_acid.d
  21. +143 −0 dscience/molecules/protein.d
  22. +419 −0 dscience/molecules/saccharide.d
  23. +242 −0 dscience/molecules/sequence.d
  24. +394 −0 dscience/parser/Metatool.d
  25. +204 −0 dscience/parser/Pdbml.d
  26. +501 −0 dscience/parser/Pdbml.d.back
  27. +261 −0 dscience/parser/fasta.d
  28. +335 −0 dscience/parser/ini.d
  29. +63 −0 dscience/parser/matrix.d
  30. +1,001 −0 dscience/parser/ucsc.d
  31. +258 −0 dscience/parser/xml.d.working
  32. +1,188 −0 dscience/physic/atom.d
  33. +210 −0 dscience/physic/bond.d
  34. +94 −0 dscience/physic/charge.d
  35. +151 −0 dscience/physic/fermion.d
  36. +640 −0 dscience/physic/molecule.d
  37. BIN examples/alignement/needlemanAndWunsh
  38. +15 −0 examples/alignement/needlemanAndWunsh.d
  39. +51 −0 examples/motif/motif_usage.d
  40. +20 −0 examples/parser/test.bed
  41. +23 −0 examples/parser/test.fasta
  42. +7 −0 examples/parser/test.gff
  43. +22 −0 examples/parser/test.gtf
  44. +25 −0 examples/parser/test_fasta.d
  45. +240 −0 examples/parser/test_out.bed
  46. +51 −0 examples/parser/test_out.gff
  47. +10 −0 examples/parser/test_out.gtf
  48. +108 −0 examples/parser/test_ucsc.d
  49. +329 −0 float.css.in
  50. +4 −0 jquery.js.in
  51. +19 −0 modules.ddoc
  52. +6 −0 settings.ddoc
  53. +329 −0 static.css.in
  54. +358 −0 style.css.in
  55. +108 −0 tools/getMatix.py
  56. +31 −0 tools/matrix/BLOSUM100
  57. +31 −0 tools/matrix/BLOSUM100.50
  58. +31 −0 tools/matrix/BLOSUM30
  59. +31 −0 tools/matrix/BLOSUM30.50
  60. +31 −0 tools/matrix/BLOSUM35
  61. +31 −0 tools/matrix/BLOSUM35.50
  62. +31 −0 tools/matrix/BLOSUM40
  63. +31 −0 tools/matrix/BLOSUM40.50
  64. +31 −0 tools/matrix/BLOSUM45
  65. +31 −0 tools/matrix/BLOSUM45.50
  66. +31 −0 tools/matrix/BLOSUM50
  67. +31 −0 tools/matrix/BLOSUM50.50
  68. +31 −0 tools/matrix/BLOSUM55
  69. +31 −0 tools/matrix/BLOSUM55.50
  70. +31 −0 tools/matrix/BLOSUM60
  71. +31 −0 tools/matrix/BLOSUM60.50
  72. +31 −0 tools/matrix/BLOSUM62
  73. +31 −0 tools/matrix/BLOSUM62.50
  74. +31 −0 tools/matrix/BLOSUM65
  75. +31 −0 tools/matrix/BLOSUM65.50
  76. +31 −0 tools/matrix/BLOSUM70
  77. +31 −0 tools/matrix/BLOSUM70.50
  78. +31 −0 tools/matrix/BLOSUM75
  79. +31 −0 tools/matrix/BLOSUM75.50
  80. +31 −0 tools/matrix/BLOSUM80
  81. +31 −0 tools/matrix/BLOSUM80.50
  82. +31 −0 tools/matrix/BLOSUM85
  83. +31 −0 tools/matrix/BLOSUM85.50
  84. +31 −0 tools/matrix/BLOSUM90
  85. +31 −0 tools/matrix/BLOSUM90.50
  86. +31 −0 tools/matrix/BLOSUMN
  87. +31 −0 tools/matrix/BLOSUMN.50
  88. +32 −0 tools/matrix/DAYHOFF
  89. +26 −0 tools/matrix/GONNET
  90. +25 −0 tools/matrix/IDENTITY
  91. +34 −0 tools/matrix/PAM10
  92. +34 −0 tools/matrix/PAM100
  93. +34 −0 tools/matrix/PAM110
  94. +34 −0 tools/matrix/PAM120
  95. +34 −0 tools/matrix/PAM120.cdi
  96. +34 −0 tools/matrix/PAM130
  97. +34 −0 tools/matrix/PAM140
  98. +34 −0 tools/matrix/PAM150
  99. +34 −0 tools/matrix/PAM160
  100. +34 −0 tools/matrix/PAM160.cdi
  101. +34 −0 tools/matrix/PAM170
  102. +34 −0 tools/matrix/PAM180
  103. +34 −0 tools/matrix/PAM190
  104. +34 −0 tools/matrix/PAM20
  105. +34 −0 tools/matrix/PAM200
  106. +34 −0 tools/matrix/PAM200.cdi
  107. +34 −0 tools/matrix/PAM210
  108. +34 −0 tools/matrix/PAM220
  109. +34 −0 tools/matrix/PAM230
  110. +34 −0 tools/matrix/PAM240
  111. +34 −0 tools/matrix/PAM250
  112. +34 −0 tools/matrix/PAM250.cdi
  113. +34 −0 tools/matrix/PAM260
  114. +34 −0 tools/matrix/PAM270
  115. +34 −0 tools/matrix/PAM280
  116. +34 −0 tools/matrix/PAM290
  117. +34 −0 tools/matrix/PAM30
  118. +34 −0 tools/matrix/PAM300
  119. +34 −0 tools/matrix/PAM310
  120. +34 −0 tools/matrix/PAM320
  121. +34 −0 tools/matrix/PAM330
  122. +34 −0 tools/matrix/PAM340
  123. +34 −0 tools/matrix/PAM350
  124. +34 −0 tools/matrix/PAM360
  125. +34 −0 tools/matrix/PAM370
  126. +34 −0 tools/matrix/PAM380
  127. +34 −0 tools/matrix/PAM390
  128. +34 −0 tools/matrix/PAM40
  129. +34 −0 tools/matrix/PAM40.cdi
  130. +34 −0 tools/matrix/PAM400
  131. +34 −0 tools/matrix/PAM410
  132. +34 −0 tools/matrix/PAM420
  133. +34 −0 tools/matrix/PAM430
  134. +34 −0 tools/matrix/PAM440
  135. +34 −0 tools/matrix/PAM450
  136. +34 −0 tools/matrix/PAM460
  137. +34 −0 tools/matrix/PAM470
  138. +34 −0 tools/matrix/PAM480
  139. +34 −0 tools/matrix/PAM490
  140. +34 −0 tools/matrix/PAM50
  141. +34 −0 tools/matrix/PAM500
  142. +34 −0 tools/matrix/PAM60
  143. +34 −0 tools/matrix/PAM70
  144. +34 −0 tools/matrix/PAM80
  145. +34 −0 tools/matrix/PAM80.cdi
  146. +34 −0 tools/matrix/PAM90
  147. +2,637 −0 tools/matrixD
  148. BIN waf
  149. +170 −0 wscript
165 LISENSE
@@ -0,0 +1,165 @@
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+
+ This version of the GNU Lesser General Public License incorporates
+the terms and conditions of version 3 of the GNU General Public
+License, supplemented by the additional permissions listed below.
+
+ 0. Additional Definitions.
+
+ As used herein, "this License" refers to version 3 of the GNU Lesser
+General Public License, and the "GNU GPL" refers to version 3 of the GNU
+General Public License.
+
+ "The Library" refers to a covered work governed by this License,
+other than an Application or a Combined Work as defined below.
+
+ An "Application" is any work that makes use of an interface provided
+by the Library, but which is not otherwise based on the Library.
+Defining a subclass of a class defined by the Library is deemed a mode
+of using an interface provided by the Library.
+
+ A "Combined Work" is a work produced by combining or linking an
+Application with the Library. The particular version of the Library
+with which the Combined Work was made is also called the "Linked
+Version".
+
+ The "Minimal Corresponding Source" for a Combined Work means the
+Corresponding Source for the Combined Work, excluding any source code
+for portions of the Combined Work that, considered in isolation, are
+based on the Application, and not on the Linked Version.
+
+ The "Corresponding Application Code" for a Combined Work means the
+object code and/or source code for the Application, including any data
+and utility programs needed for reproducing the Combined Work from the
+Application, but excluding the System Libraries of the Combined Work.
+
+ 1. Exception to Section 3 of the GNU GPL.
+
+ You may convey a covered work under sections 3 and 4 of this License
+without being bound by section 3 of the GNU GPL.
+
+ 2. Conveying Modified Versions.
+
+ If you modify a copy of the Library, and, in your modifications, a
+facility refers to a function or data to be supplied by an Application
+that uses the facility (other than as an argument passed when the
+facility is invoked), then you may convey a copy of the modified
+version:
+
+ a) under this License, provided that you make a good faith effort to
+ ensure that, in the event an Application does not supply the
+ function or data, the facility still operates, and performs
+ whatever part of its purpose remains meaningful, or
+
+ b) under the GNU GPL, with none of the additional permissions of
+ this License applicable to that copy.
+
+ 3. Object Code Incorporating Material from Library Header Files.
+
+ The object code form of an Application may incorporate material from
+a header file that is part of the Library. You may convey such object
+code under terms of your choice, provided that, if the incorporated
+material is not limited to numerical parameters, data structure
+layouts and accessors, or small macros, inline functions and templates
+(ten or fewer lines in length), you do both of the following:
+
+ a) Give prominent notice with each copy of the object code that the
+ Library is used in it and that the Library and its use are
+ covered by this License.
+
+ b) Accompany the object code with a copy of the GNU GPL and this license
+ document.
+
+ 4. Combined Works.
+
+ You may convey a Combined Work under terms of your choice that,
+taken together, effectively do not restrict modification of the
+portions of the Library contained in the Combined Work and reverse
+engineering for debugging such modifications, if you also do each of
+the following:
+
+ a) Give prominent notice with each copy of the Combined Work that
+ the Library is used in it and that the Library and its use are
+ covered by this License.
+
+ b) Accompany the Combined Work with a copy of the GNU GPL and this license
+ document.
+
+ c) For a Combined Work that displays copyright notices during
+ execution, include the copyright notice for the Library among
+ these notices, as well as a reference directing the user to the
+ copies of the GNU GPL and this license document.
+
+ d) Do one of the following:
+
+ 0) Convey the Minimal Corresponding Source under the terms of this
+ License, and the Corresponding Application Code in a form
+ suitable for, and under terms that permit, the user to
+ recombine or relink the Application with a modified version of
+ the Linked Version to produce a modified Combined Work, in the
+ manner specified by section 6 of the GNU GPL for conveying
+ Corresponding Source.
+
+ 1) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (a) uses at run time
+ a copy of the Library already present on the user's computer
+ system, and (b) will operate properly with a modified version
+ of the Library that is interface-compatible with the Linked
+ Version.
+
+ e) Provide Installation Information, but only if you would otherwise
+ be required to provide such information under section 6 of the
+ GNU GPL, and only to the extent that such information is
+ necessary to install and execute a modified version of the
+ Combined Work produced by recombining or relinking the
+ Application with a modified version of the Linked Version. (If
+ you use option 4d0, the Installation Information must accompany
+ the Minimal Corresponding Source and Corresponding Application
+ Code. If you use option 4d1, you must provide the Installation
+ Information in the manner specified by section 6 of the GNU GPL
+ for conveying Corresponding Source.)
+
+ 5. Combined Libraries.
+
+ You may place library facilities that are a work based on the
+Library side by side in a single library together with other library
+facilities that are not Applications and are not covered by this
+License, and convey such a combined library under terms of your
+choice, if you do both of the following:
+
+ a) Accompany the combined library with a copy of the same work based
+ on the Library, uncombined with any other library facilities,
+ conveyed under the terms of this License.
+
+ b) Give prominent notice with the combined library that part of it
+ is a work based on the Library, and explaining where to find the
+ accompanying uncombined form of the same work.
+
+ 6. Revised Versions of the GNU Lesser General Public License.
+
+ The Free Software Foundation may publish revised and/or new versions
+of the GNU Lesser General Public License from time to time. Such new
+versions will be similar in spirit to the present version, but may
+differ in detail to address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Library as you received it specifies that a certain numbered version
+of the GNU Lesser General Public License "or any later version"
+applies to it, you have the option of following the terms and
+conditions either of that published version or of any later version
+published by the Free Software Foundation. If the Library as you
+received it does not specify a version number of the GNU Lesser
+General Public License, you may choose any version of the GNU Lesser
+General Public License ever published by the Free Software Foundation.
+
+ If the Library as you received it specifies that a proxy can decide
+whether future versions of the GNU Lesser General Public License shall
+apply, that proxy's public statement of acceptance of any version is
+permanent authorization for you to choose that version for the
+Library.
243 Makefile
@@ -0,0 +1,243 @@
+export PROJECT_NAME = dscience
+export AUTHOR = "Jonathan MERCIER aka bioinfornatics"
+export DESCRIPTION = "Library for scientific computing"
+export REPO_SRC_DIR = https://gitorious.org/dscience/dscience
+export LOGO_SRC = https://s3.amazonaws.com/cloud.ohloh.net/attachments/51259/dscience_med.png
+export MAJOR_VERSION = 1
+export MINOR_VERSION = 0
+export PATCH_VERSION = 0
+export PROJECT_VERSION = $(MAJOR_VERSION).$(MINOR_VERSION).$(PATCH_VERSION)
+export LICENSE = LGPLv3+
+export ROOT_SOURCE_DIR = dscience
+DDOCFILES = modules.ddoc settings.ddoc cutedoc.ddoc
+
+# include some command
+include command.make
+
+SOURCES = $(getSource)
+OBJECTS = $(patsubst %.d,$(BUILD_PATH)$(PATH_SEP)%.o, $(SOURCES))
+PICOBJECTS = $(patsubst %.d,$(BUILD_PATH)$(PATH_SEP)%.pic.o,$(SOURCES))
+HEADERS = $(patsubst %.d,$(IMPORT_PATH)$(PATH_SEP)%.di, $(SOURCES))
+DOCUMENTATIONS = $(patsubst %.d,$(DOC_PATH)$(PATH_SEP)%.html, $(SOURCES))
+DDOCUMENTATIONS = $(patsubst %.d,$(DDOC_PATH)$(PATH_SEP)%.html, $(SOURCES))
+DDOC_FLAGS = $(foreach macro,$(DDOCFILES), $(DDOC_MACRO)$(macro))
+css_files = float.css static.css style.css
+js_files = cutedoc.js jquery.js
+css_files_in = float.css.in static.css.in style.css.in
+js_files_in = cutedoc.js.in jquery.js.in
+
+define make-lib
+ $(MKDIR) $(DLIB_PATH)
+ $(AR) rcs $(DLIB_PATH)$(PATH_SEP)$@ $^
+ $(RANLIB) $(DLIB_PATH)$(PATH_SEP)$@
+endef
+
+############# BUILD #############
+all: static-lib header doc pkgfile-static
+ @echo ------------------ Building $^ done
+all-shared: shared-lib header doc pkgfile-shared
+ @echo ------------------ Building $^ done
+
+.PHONY : pkgfile
+.PHONY : doc
+.PHONY : ddoc
+.PHONY : clean
+
+static-lib: $(STATIC_LIBNAME)
+
+shared-lib: $(SHARED_LIBNAME)
+
+header: $(HEADERS)
+
+doc: $(DOCUMENTATIONS)
+ @echo ------------------ Building Doc done
+
+ddoc: settings.ddoc $(css_files) $(js_files) $(DDOCUMENTATIONS)
+ @echo ------------------ Building DDoc done
+
+%.js : %.js.in
+ $(MKDIR) $(DDOC_PATH)$(PATH_SEP)$(PROJECT_NAME)
+ $(CP) $@.in $(DDOC_PATH)$(PATH_SEP)$(PROJECT_NAME)$(PATH_SEP)$@
+
+%.css : %.css.in
+ $(MKDIR) $(DDOC_PATH)$(PATH_SEP)$(PROJECT_NAME)
+ $(CP) $@.in $(DDOC_PATH)$(PATH_SEP)$(PROJECT_NAME)$(PATH_SEP)$@
+
+geany-tag:
+ @echo ------------------ Building geany tag
+ $(MKDIR) geany_config
+ geany -c geany_config -g $(PROJECT_NAME).d.tags $(SOURCES)
+
+pkgfile-shared:
+ @echo ------------------ Building pkg-config file
+ @echo "# Package Information for pkg-config" > $(PKG_CONFIG_FILE)
+ @echo "# Author: $(AUTHOR)" >> $(PKG_CONFIG_FILE)
+ @echo "# Created: `date`" >> $(PKG_CONFIG_FILE)
+ @echo "# Licence: $(LICENSE)" >> $(PKG_CONFIG_FILE)
+ @echo >> $(PKG_CONFIG_FILE)
+ @echo prefix=$(PREFIX) >> $(PKG_CONFIG_FILE)
+ @echo exec_prefix=$(PREFIX) >> $(PKG_CONFIG_FILE)
+ @echo libdir=$(LIB_DIR) >> $(PKG_CONFIG_FILE)
+ @echo includedir=$(INCLUDE_DIR) >> $(PKG_CONFIG_FILE)
+ @echo >> $(PKG_CONFIG_FILE)
+ @echo Name: "$(PROJECT_NAME)" >> $(PKG_CONFIG_FILE)
+ @echo Description: "$(DESCRIPTION)" >> $(PKG_CONFIG_FILE)
+ @echo Version: "$(PROJECT_VERSION)" >> $(PKG_CONFIG_FILE)
+ @echo Libs: $(LINKERFLAG)-l$(PROJECT_NAME)-$(COMPILER) >> $(PKG_CONFIG_FILE)
+ @echo Cflags: -I$(INCLUDE_DIR)$(PATH_SEP)$(PROJECT_NAME) $(LDCFLAGS)>> $(PKG_CONFIG_FILE)
+ @echo >> $(PKG_CONFIG_FILE)
+
+pkgfile-static:
+ @echo ------------------ Building pkg-config file
+ @echo "# Package Information for pkg-config" > $(PKG_CONFIG_FILE)
+ @echo "# Author: $(AUTHOR)" >> $(PKG_CONFIG_FILE)
+ @echo "# Created: `date`" >> $(PKG_CONFIG_FILE)
+ @echo "# Licence: $(LICENSE)" >> $(PKG_CONFIG_FILE)
+ @echo >> $(PKG_CONFIG_FILE)
+ @echo prefix=$(PREFIX) >> $(PKG_CONFIG_FILE)
+ @echo exec_prefix=$(PREFIX) >> $(PKG_CONFIG_FILE)
+ @echo libdir=$(LIB_DIR) >> $(PKG_CONFIG_FILE)
+ @echo includedir=$(INCLUDE_DIR) >> $(PKG_CONFIG_FILE)
+ @echo >> $(PKG_CONFIG_FILE)
+ @echo Name: "$(PROJECT_NAME)" >> $(PKG_CONFIG_FILE)
+ @echo Description: "$(DESCRIPTION)" >> $(PKG_CONFIG_FILE)
+ @echo Version: "$(PROJECT_VERSION)" >> $(PKG_CONFIG_FILE)
+ @echo Libs: $(LIB_DIR)$(PATH_SEP)$(STATIC_LIBNAME) >> $(PKG_CONFIG_FILE)
+ @echo Cflags: -I$(INCLUDE_DIR)$(PATH_SEP)$(PROJECT_NAME) $(LDCFLAGS)>> $(PKG_CONFIG_FILE)
+ @echo >> $(PKG_CONFIG_FILE)
+
+settings.ddoc:
+ @echo "PROJECTNAME = $(PROJECT_NAME)" > settings.ddoc
+ @echo "LINKPREFIX = $(LINKERFLAG)" >> settings.ddoc
+ @echo "REPOSRCDIR = $(REPO_SRC_DIR)" >> settings.ddoc
+ @echo "ROOT = $(DESTDIR)$(DOC_DIR)$(PATH_SEP)$(PROJECT_NAME)$(PATH_SEP)cute_doc" >> settings.ddoc
+ @echo "LOGOSRC = $(LOGO_SRC)" >> settings.ddoc
+ @echo "LOGOALT = $(PROJECT_NAME)" >> settings.ddoc
+
+cutedoc.js.in: cutedoc.js.in.in
+ sed "s|img src=\"images|img src=\"$(DESTDIR)$(DOC_DIR)$(PATH_SEP)$(PROJECT_NAME)$(PATH_SEP)cute_doc$(PATH_SEP)$(PROJECT_NAME)$(PATH_SEP)images|" cutedoc.js.in.in > cutedoc.js.in
+
+
+# For build lib need create object files and after run make-lib
+$(STATIC_LIBNAME): $(OBJECTS)
+ @echo ------------------ Building static library
+ $(make-lib)
+
+# For build shared lib need create shared object files
+$(SHARED_LIBNAME): $(PICOBJECTS)
+ @echo ------------------ Building shared library
+ $(MKDIR) $(DLIB_PATH)
+ $(CC) -l$(PHOBOS) -l$(DRUNTIME) -shared -Wl,-soname,$@.$(MAJOR_VERSION) -o $(DLIB_PATH)$(PATH_SEP)$@.$(MAJOR_VERSION) $^
+# $(DC) -shared $(SONAME_FLAG) $@.$(MAJOR_VERSION) $(OUTPUT)$(DLIB_PATH)$(PATH_SEP)$@.$(MAJOR_VERSION) $^
+
+# create object files
+$(BUILD_PATH)$(PATH_SEP)%.o : %.d
+ $(DC) $(DCFLAGS) $(DCFLAGS_LINK) $(DCFLAGS_IMPORT) -c $< $(OUTPUT)$@
+
+# create shared object files
+$(BUILD_PATH)$(PATH_SEP)%.pic.o : %.d
+ $(DC) $(DCFLAGS) $(DCFLAGS_LINK) $(FPIC) $(DCFLAGS_IMPORT) -c $< $(OUTPUT)$@
+
+# Generate Header files
+$(IMPORT_PATH)$(PATH_SEP)%.di : %.d
+ $(DC) $(DCFLAGS) $(DCFLAGS_LINK) $(DCFLAGS_IMPORT) -c $(NO_OBJ) $< $(HF)$@
+
+# Generate Documentation
+$(DOC_PATH)$(PATH_SEP)%.html : %.d
+ $(DC) $(DCFLAGS) $(DCFLAGS_LINK) $(DCFLAGS_IMPORT) -c $(NO_OBJ) $< $(DF)$@
+
+# Generate ddoc Documentation
+$(DDOC_PATH)$(PATH_SEP)%.html : %.d
+ $(DC) $(DCFLAGS) $(DCFLAGS_LINK) $(DCFLAGS_IMPORT) -c $(NO_OBJ) $(DDOC_FLAGS) $< $(DF)$@
+
+############# CLEAN #############
+clean: clean-objects clean-static-lib clean-doc clean-header clean-pkgfile
+ $(RM) $(BUILD_PATH)$(PATH_SEP)$(PROJECT_NAME)
+ @echo ------------------ Cleaning $^ done
+
+clean-shared: clean-shared-objects clean-shared-lib
+ @echo ------------------ Cleaning $^ done
+
+clean-objects:
+ $(RM) $(OBJECTS)
+ @echo ------------------ Cleaning objects done
+
+clean-shared-objects:
+ $(RM) $(PICOBJECTS)
+ @echo ------------------ Cleaning shared-object done
+
+clean-static-lib:
+ $(RM) $(DLIB_PATH)$(PATH_SEP)$(STATIC_LIBNAME)
+ @echo ------------------ Cleaning static-lib done
+
+clean-shared-lib:
+ $(RM) $(DLIB_PATH)$(PATH_SEP)$(SHARED_LIBNAME).$(MAJOR_VERSION)
+ @echo ------------------ Cleaning shared-lib done
+
+clean-header:
+ $(RM) $(HEADERS)
+ $(RM) $(IMPORT_PATH)
+ @echo ------------------ Cleaning header done
+
+clean-doc:
+ $(RM) $(DOCUMENTATIONS)
+ $(RM) $(DOC_PATH)$(PATH_SEP)$(PROJECT_NAME)
+ @echo ------------------ Cleaning doc done
+
+clean-ddoc:
+ $(RM) $(DDOCUMENTATIONS) $(js_files) $(css_files) cutedoc.js.in
+ $(RM) $(DDOC_PATH)$(PATH_SEP)$(PROJECT_NAME)
+ @echo ------------------ Cleaning ddoc done
+
+clean-geany-tag:
+ $(RM) geany_config $(PROJECT_NAME).d.tags
+ @echo ------------------ Cleaning geany tag done
+
+clean-pkgfile:
+ $(RM) $(PKG_CONFIG_FILE)
+ @echo ------------------ Cleaning pkgfile done
+
+############# INSTALL #############
+
+install: install-static-lib install-doc install-header install-pkgfile
+ @echo ------------------ Installing $^ done
+
+install-shared: install-shared-lib install-doc install-header install-pkgfile
+ @echo ------------------ Installing $^ done
+
+install-static-lib:
+ $(MKDIR) $(DESTDIR)$(LIB_DIR)
+ $(CP) $(DLIB_PATH)$(PATH_SEP)$(STATIC_LIBNAME) $(DESTDIR)$(LIB_DIR)
+ @echo ------------------ Installing static-lib done
+
+install-shared-lib:
+ $(MKDIR) $(DESTDIR)$(LIB_DIR)
+ $(CP) $(DLIB_PATH)$(PATH_SEP)$(SHARED_LIBNAME).$(MAJOR_VERSION) $(DESTDIR)$(LIB_DIR)
+ cd $(DESTDIR)$(LIB_DIR)$(PATH_SEP) && $(LN) $(SHARED_LIBNAME).$(MAJOR_VERSION) $(SHARED_LIBNAME).$(PROJECT_VERSION)
+ cd $(DESTDIR)$(LIB_DIR)$(PATH_SEP) && $(LN) $(SHARED_LIBNAME).$(PROJECT_VERSION) $(SHARED_LIBNAME)
+ @echo ------------------ Installing shared-lib done
+
+install-header:
+ $(MKDIR) $(DESTDIR)$(INCLUDE_DIR)
+ $(CP) $(IMPORT_PATH)$(PATH_SEP)$(PROJECT_NAME) $(DESTDIR)$(INCLUDE_DIR)
+ @echo ------------------ Installing header done
+
+install-doc:
+ $(MKDIR) $(DESTDIR)$(DOC_DIR)$(PATH_SEP)$(PROJECT_NAME)$(PATH_SEP)normal_doc$(PATH_SEP)
+ $(CP) $(DOC_PATH)$(PATH_SEP)* $(DESTDIR)$(DOC_DIR)$(PATH_SEP)$(PROJECT_NAME)$(PATH_SEP)normal_doc$(PATH_SEP)
+ @echo ------------------ Installing doc done
+
+install-ddoc:
+ $(MKDIR) $(DESTDIR)$(DOC_DIR)$(PATH_SEP)$(PROJECT_NAME)$(PATH_SEP)cute_doc$(PATH_SEP)
+ $(CP) $(DDOC_PATH)$(PATH_SEP)* $(DESTDIR)$(DOC_DIR)$(PATH_SEP)$(PROJECT_NAME)$(PATH_SEP)cute_doc$(PATH_SEP)
+ @echo ------------------ Installing ddoc done
+
+install-geany-tag:
+ $(MKDIR) $(DESTDIR)$(DATA_DIR)$(PATH_SEP)geany$(PATH_SEP)tags$(PATH_SEP)
+ $(CP) $(PROJECT_NAME).d.tags $(DESTDIR)$(DATA_DIR)$(PATH_SEP)geany$(PATH_SEP)tags$(PATH_SEP)
+ @echo ------------------ Installing geany tag done
+
+install-pkgfile:
+ $(MKDIR) $(DESTDIR)$(PKGCONFIG_DIR)
+ $(CP) $(PKG_CONFIG_FILE) $(DESTDIR)$(PKGCONFIG_DIR)$(PATH_SEP)$(PROJECT_NAME).pc
+ @echo ------------------ Installing pkgfile done
96 README
@@ -0,0 +1,96 @@
+============
+DScience
+============
+
+The DScience Project goal is to become an international association of developers of freely available D tools for
+computational molecular biology. It is a distributed collaborative effort to develop D libraries and applications which
+address the needs of current and future work in bioinformatics.
+
+How build our project:
+-----------------------
+In same directory where is the file Makefile do:
+ $ make
+ $ make install
+
+Use -j flag for multithreading:
+ $ make -j
+ $ make install -j
+
+You can override many varibale as prefix or libdir:
+ $ make
+ $ make install PREFIX=/usr LIB_DIR=/usr/lib64
+
+Set DFLAGS
+ $ make DCFLAGS="-w -d -g -O"
+
+Set Include flag
+ DFLAGS_IMPORT="-Idir1 -Idir2"
+
+Set compiler
+ $ make DC=dmd
+
+Generate tag for geany
+ $ make geany-tag
+
+Generate pkgconfig file
+ $ make pkgfile
+
+Generate Ddoc
+ You need wrote in root dir a modules.ddoc file, afeter this do
+ $ make ddoc
+
+Generate shared lib:
+ $ make shared-lib
+
+Combine targets together:
+$ make -j all shared-lib ddoc DFLAGS_IMPORT="-ImySourceDir"
+
+Default target:
+ all: able to build static lib, doc, header, pkg-confih file
+
+Others targets:
+- shared-lib
+- ddoc
+- geany-tag
+
+How Clean your project:
+-----------------------
+Each build targets has a clean target by example if you have built with "shared-lib" target use "clean-shared-lib" target
+
+How Install your project:
+-------------------------:
+Each build targets has a install target by example if you have builti with "shared-lib" target use "install-shared-lib" target
+
+RESUME:
+-------
+
+BUILD | CLEAN | INSTALL
+___________________________________________________
+all | clean | install
+static-libs | clean-static-lib | install-static-lib
+shared-lib | clean-shared-lib | install-shared-lib
+header | clean-header | install-header
+doc | clean-doc | install-doc
+ddoc | clean-ddoc | install-ddoc
+geany-tag | clean-geany-tag | install-geany-tag
+pkgfile | clean-pkgfile | install-pkgfile
+
+
+Feature:
+--------
+- Support 3 compilers: ldc, gdc, dmd
+- Build as static lib or shared
+- Generate geany tag
+- Generate package config file
+- Generate both normal doc and cute doc
+
+TODO:
+-----
+- Add Windows support (should work)
+
+
+Warning:
+--------
+if you override PREFIX var you need to give prefix at each step, build and install, by example
+$ make -j4 PREFIX=/usr all ddoc
+$ sudo make -j4 PREFIX=/usr install install-ddoc
11 TODO
@@ -0,0 +1,11 @@
+TODO LIST:
+- search if they are a better way for ut a 3 D location an atom, a molecule ...
+- add biological tool as: blast, neighbour joining ...
+- add in a directory some example of use
+- Works on Saccharide and his structure in some environnment like watery
+
+- add MatrixFactory (blosum, pam, etc etc) (load matrix by xml ?)
+- add abstract class NetworkParser, MoleculParser et SequenceParser to
+ parse pdb, metatool and fasta file for example. (metatool parser alreayd exist and need to herit from this abstract class)
+
+- DOCUMENTE THE CODE !!!!!!!!
8 build/.lock-waf_linux2_build
@@ -0,0 +1,8 @@
+argv = ['./waf', 'configure', '--prefix=/usr']
+environ = {'SSH_ASKPASS': '/usr/libexec/openssh/gnome-ssh-askpass', 'WINDOWID': '33554438', 'GNOME_DESKTOP_SESSION_ID': 'this-is-deprecated', 'LESSOPEN': '||/usr/bin/lesspipe.sh %s', 'QT_IM_MODULE': 'xim', 'LOGNAME': 'jonathan', 'USER': 'jonathan', 'PATH': '/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin', 'XDG_VTNR': '1', 'GNOME_KEYRING_CONTROL': '/tmp/keyring-02qCUv', 'DISPLAY': ':0', 'LANG': 'fr_FR.utf8', 'TERM': 'xterm', 'SHELL': '/bin/bash', 'XDG_SESSION_COOKIE': 'b86d160eca2ebd0f61847c4600000013-1332281934.414024-181422185', 'SESSION_MANAGER': 'local/unix:@/tmp/.ICE-unix/1708,unix/unix:/tmp/.ICE-unix/1708', 'SHLVL': '2', 'HISTSIZE': '1000', 'WINDOWPATH': '1', 'IMSETTINGS_INTEGRATE_DESKTOP': 'yes', 'GPG_AGENT_INFO': '/tmp/keyring-02qCUv/gpg:0:1', 'HOME': '/home/jonathan', 'USERNAME': 'jonathan', 'IMSETTINGS_MODULE': 'none', 'XDG_RUNTIME_DIR': '/run/user/jonathan', 'SSH_AUTH_SOCK': '/tmp/keyring-02qCUv/ssh', 'GDMSESSION': 'gnome', 'XMODIFIERS': '@im=none', 'XDG_SESSION_ID': '2', 'DBUS_SESSION_BUS_ADDRESS': 'unix:abstract=/tmp/dbus-NIqhIaQXVx,guid=f6361cb9b59728a4146b352f00000027', '_': './waf', 'XAUTHORITY': '/var/run/gdm/auth-for-jonathan-1jK0Aa/database', 'DESKTOP_SESSION': 'gnome', 'GNOME_KEYRING_PID': '1704', 'OLDPWD': '/home/jonathan/Projets/MakefileForD', 'HOSTNAME': 'jonathan', 'GDM_LANG': 'fr_FR.utf8', 'HISTCONTROL': 'ignoredups', 'PWD': '/home/jonathan/Projets/dscience', 'COLORTERM': 'gnome-terminal', 'MAIL': '/var/spool/mail/jonathan', 'LS_COLORS': 'rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=01;05;37;41:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.tbz=01;31:*.tbz2=01;31:*.bz=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=01;36:*.au=01;36:*.flac=01;36:*.mid=01;36:*.midi=01;36:*.mka=01;36:*.mp3=01;36:*.mpc=01;36:*.ogg=01;36:*.ra=01;36:*.wav=01;36:*.axa=01;36:*.oga=01;36:*.spx=01;36:*.xspf=01;36:*.pdf=00;33:*.ps=00;33:*.ps.gz=00;33:*.txt=00;33:*.patch=00;33:*.diff=00;33:*.log=00;33:*.tex=00;33:*.xls=00;33:*.xlsx=00;33:*.ppt=00;33:*.pptx=00;33:*.rtf=00;33:*.doc=00;33:*.docx=00;33:*.odt=00;33:*.ods=00;33:*.odp=00;33:*.xml=00;33:*.epub=00;33:*.abw=00;33:*.html=00;33:*.wpd=00;33:', 'XDG_SEAT': 'seat0'}
+files = ['/home/jonathan/Projets/dscience/wscript']
+hash = 7900572336416784618
+options = {'files': '', 'docdir': '', 'jobs': 4, 'verbose': 0, 'nocache': False, 'progress_bar': 0, 'top': '', 'datadir': '', 'libdir': '', 'pkgconfigdir': '', 'destdir': '', 'keep': 0, 'zones': '', 'prefix': '/usr', 'includedir': '', 'download': False, 'force': False, 'out': '', 'targets': '', 'bindir': '', 'compiler': 'ldc2'}
+out_dir = '/home/jonathan/Projets/dscience/build'
+run_dir = '/home/jonathan/Projets/dscience'
+top_dir = '/home/jonathan/Projets/dscience/dscience'
3 build/c4che/_cache.py
@@ -0,0 +1,3 @@
+BINDIR = '/usr/bin'
+LIBDIR = '/usr/lib'
+PREFIX = '/usr'
2 build/c4che/build.config.py
@@ -0,0 +1,2 @@
+version = 0x1060b00
+tools = []
10 build/config.log
@@ -0,0 +1,10 @@
+# project dscience (0.0.1) configured on Thu Mar 22 02:30:02 2012 by
+# waf 1.6.11 (abi 98, python 20702f0 on linux2)
+# using ./waf configure --prefix=/usr
+#
+----------------------------------------
+Setting top to
+/home/jonathan/Projets/dscience/dscience
+----------------------------------------
+Setting out to
+/home/jonathan/Projets/dscience/build
12 clean.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+#rm -fr $(find . -type f | grep '?' | sed 's:^.::' | grep -i cmake)
+rm -f cmake_install.cmake Makefile CMakeCache.txt
+rm -fr CMakeFiles
+echo "[+] Cleaning files generated by cmake"
+
+rm -fr build/
+rm -fr include/
+rm -fr lib/
+#find . -name "Makefile" | xargs rm 2> /dev/null
+echo "[+] Cleaning files generated by make"
315 command.make
@@ -0,0 +1,315 @@
+ifdef SystemRoot
+ OS = "Windows"
+ STATIC_LIB_EXT = .lib
+ DYNAMIC_LIB_EXT = .dll
+ PATH_SEP =\
+ message = @(echo $1)
+ SHELL = cmd.exe
+ Filter = %/linux/%.d %/darwin/%.d %/freebsd/%.d %/solaris/%.d
+ getSource =$(shell dir $(ROOT_SOURCE_DIR) /s /b)
+else
+ SHELL = sh
+ PATH_SEP =/
+ getSource =$(shell find $(ROOT_SOURCE_DIR) -name "*.d")
+ ifeq ($(shell uname), Linux)
+ OS = "Linux"
+ STATIC_LIB_EXT = .a
+ DYNAMIC_LIB_EXT = .so
+ message = @(echo \033[31m $1 \033[0;0m1)
+ Filter = %/win32/%.d %/darwin/%.d %/freebsd/%.d %/solaris/%.d
+ else ifeq ($(shell uname), Solaris)
+ STATIC_LIB_EXT = .a
+ DYNAMIC_LIB_EXT = .so
+ OS = "Solaris"
+ message = @(echo \033[31m $1 \033[0;0m1)
+ Filter = %/win32/%.d %/linux/%.d %/darwin/%.d %/freebsd/%.d
+ else ifeq ($(shell uname),Freebsd)
+ STATIC_LIB_EXT = .a
+ DYNAMIC_LIB_EXT = .so
+ OS = "Freebsd"
+ message = @(echo \033[31m $1 \033[0;0m1)
+ Filter = %/win32/%.d %/linux/%.d %/darwin/%.d %/solaris/%.d
+ else ifeq ($(shell uname),Darwin)
+ STATIC_LIB_EXT = .a
+ DYNAMIC_LIB_EXT = .so
+ OS = "Darwin"
+ message = @(echo \033[31m $1 \033[0;0m1)
+ Filter = %/win32/%.d %/linux/%.d %/freebsd/%.d %/solaris/%.d
+ endif
+endif
+
+# Define command for copy, remove and create file/dir
+ifeq ($(OS),"Windows")
+ RM = del /Q
+ CP = copy /Y
+ MKDIR = mkdir
+ MV = move
+ LN = mklink
+else ifeq ($(OS),"Linux")
+ RM = rm -fr
+ CP = cp -fr
+ MKDIR = mkdir -p
+ MV = mv
+ LN = ln -s
+else ifeq ($(OS),"Freebsd")
+ RM = rm -fr
+ CP = cp -fr
+ MKDIR = mkdir -p
+ MV = mv
+ LN = ln -s
+else ifeq ($(OS),"Solaris")
+ RM = rm -fr
+ CP = cp -fr
+ MKDIR = mkdir -p
+ MV = mv
+ LN = ln -s
+else ifeq ($(OS),"Darwin")
+ RM = rm -fr
+ CP = cp -fr
+ MKDIR = mkdir -p
+ MV = mv
+ LN = ln -s
+endif
+
+# If compiler is not define try to find it
+ifndef DC
+ ifneq ($(strip $(shell which dmd 2>/dev/null)),)
+ DC=dmd
+ else ifneq ($(strip $(shell which ldc 2>/dev/null)),)
+ DC=ldc
+ else ifneq ($(strip $(shell which ldc2 2>/dev/null)),)
+ DC=ldc2
+ else
+ DC=gdc
+ endif
+endif
+
+# Define flag for gdc other
+ifeq ($(DC),gdc)
+ DCFLAGS = -O2 -fdeprecated
+ LINKERFLAG= -Xlinker
+ OUTPUT = -o
+ HF = -fintfc-file=
+ DF = -fdoc-file=
+ NO_OBJ = -fsyntax-only
+ DDOC_MACRO= -fdoc-inc=
+else
+ DCFLAGS = -O -d
+ LINKERFLAG= -L
+ OUTPUT = -of
+ HF = -Hf
+ DF = -Df
+ NO_OBJ = -o-
+ DDOC_MACRO=
+endif
+
+#define a suffix lib who inform is build with which compiler, name of phobos lib
+ifeq ($(DC),gdc)
+ COMPILER = gdc
+ VERSION = -fversion
+ SONAME_FLAG = $(LINKERFLAG) -soname
+ PHOBOS = gphobos2
+ DRUNTIME = gdruntime
+else ifeq ($(DC),gdmd)
+ COMPILER = gdc
+ VERSION = -fversion
+ SONAME_FLAG = $(LINKERFLAG) -soname
+ PHOBOS = gphobos2
+ DRUNTIME = gdruntime
+else ifeq ($(DC),ldc)
+ COMPILER = ldc
+ VERSION = -d-version
+ SONAME_FLAG = -soname
+ PHOBOS = phobos-ldc
+ DRUNTIME = druntime-ldc
+else ifeq ($(DC),ldc2)
+ COMPILER = ldc
+ VERSION = -d-version
+ SONAME_FLAG = -soname
+ PHOBOS = phobos-ldc
+ DRUNTIME = druntime-ldc
+else ifeq ($(DC),ldmd)
+ COMPILER = ldc
+ VERSION = -d-version
+ SONAME_FLAG = -soname
+ PHOBOS = phobos2-ldc
+ DRUNTIME = druntime-ldc
+else ifeq ($(DC),dmd)
+ COMPILER = dmd
+ VERSION = -version
+ SONAME_FLAG = $(LINKERFLAG) -soname
+ PHOBOS = phobos2
+ DRUNTIME = druntime
+else ifeq ($(DC),dmd2)
+ COMPILER = dmd
+ VERSION = -d-version
+ SONAME_FLAG = $(LINKERFLAG) -soname
+ PHOBOS = phobos2
+ DRUNTIME = druntime
+endif
+
+# Define relocation model for ldc or other
+ifneq (,$(findstring ldc,$(DC)))
+ FPIC = -relocation-model=pic
+else
+ FPIC = -fPIC
+endif
+
+# Add -ldl flag for linux
+ifeq ($(OS),"Linux")
+ LDCFLAGS += $(LINKERFLAG) -ldl
+endif
+
+# If model are not given take the same as current system
+ifndef ARCH
+ ifeq ($(OS),"Windows")
+ ifeq ($(PROCESSOR_ARCHITECTURE), x86)
+ ARCH = x86
+ else
+ ARCH = x86_64
+ endif
+ else
+ ARCH = $(shell arch || uname -m)
+ endif
+endif
+ifndef MODEL
+ ifeq ($(ARCH), x86_64)
+ MODEL = 64
+ else
+ MODEL = 32
+ endif
+endif
+
+ifeq ($(MODEL), 64)
+ DCFLAGS += -m64
+ LDCFLAGS += -m64
+else
+ DCFLAGS += -m32
+ LDCFLAGS += -m32
+endif
+
+ifndef DESTDIR
+ DESTDIR =
+endif
+
+# Define var PREFIX, BIN_DIR, LIB_DIR, INCLUDE_DIR, DATA_DIR
+ifndef PREFIX
+ ifeq ($(OS),"Windows")
+ PREFIX = $(PROGRAMFILES)
+ else ifeq ($(OS), "Linux")
+ PREFIX = /usr/local
+ else ifeq ($(OS), "Darwin")
+ PREFIX = /usr/local
+ endif
+endif
+
+ifndef BIN_DIR
+ ifeq ($(OS), "Windows")
+ BIN_DIR = $(PROGRAMFILES)\$(PROJECT_NAME)\bin
+ else ifeq ($(OS), "Linux")
+ BIN_DIR = $(PREFIX)/bin
+ else ifeq ($(OS), "Darwin")
+ BIN_DIR = $(PREFIX)/bin
+ endif
+endif
+ifndef LIB_DIR
+ ifeq ($(OS), "Windows")
+ LIB_DIR = $(PREFIX)\$(PROJECT_NAME)\lib
+ else ifeq ($(OS), "Linux")
+ LIB_DIR = $(PREFIX)/lib
+ else ifeq ($(OS), "Darwin")
+ LIB_DIR = $(PREFIX)/lib
+ endif
+endif
+
+ifndef INCLUDE_DIR
+ ifeq ($(OS), "Windows")
+ INCLUDE_DIR = $(PROGRAMFILES)\$(PROJECT_NAME)\import
+ else
+ INCLUDE_DIR = $(PREFIX)/include/d/
+ endif
+endif
+
+ifndef DATA_DIR
+ ifeq ($(OS), "Windows")
+ DATA_DIR = $(PROGRAMFILES)\$(PROJECT_NAME)\data
+ DOC_DIR = $(PROGRAMFILES)\$(PROJECT_NAME)\doc
+ else
+ DATA_DIR = $(PREFIX)/share
+ DOC_DIR = $(DATA_DIR)/doc
+ endif
+endif
+
+ifndef PKGCONFIG_DIR
+ ifeq ($(OS), "Windows")
+ PKGCONFIG_DIR = $(PROGRAMFILES)\$(PROJECT_NAME)\data
+ else
+ PKGCONFIG_DIR = $(DATA_DIR)/pkgconfig
+ endif
+endif
+
+ifndef CC
+ CC = gcc
+endif
+
+DLIB_PATH = ./lib
+IMPORT_PATH = ./import
+DOC_PATH = ./doc
+DDOC_PATH = ./ddoc
+BUILD_PATH = ./build
+
+DCFLAGS_IMPORT =
+DCFLAGS_LINK = $(LDCFLAGS)
+
+STATIC_LIBNAME = lib$(PROJECT_NAME)-$(COMPILER)$(STATIC_LIB_EXT)
+SHARED_LIBNAME = lib$(PROJECT_NAME)-$(COMPILER)$(DYNAMIC_LIB_EXT)
+
+PKG_CONFIG_FILE = $(PROJECT_NAME).pc
+
+MAKE = make
+AR = ar
+ARFLAGS = rcs
+RANLIB = ranlib
+
+export AR
+export ARCH
+export ARFLAGS
+export BIN_DIR
+export BUILD_PATH
+export CC
+export COMPILER
+export CP
+export DATA_DIR
+export DC
+export DF
+export DCFLAGS
+export DCFLAGS_IMPORT
+export DCFLAGS_LINK
+export DESTDIR
+export DLIB_PATH
+export DOC_PATH
+export DDOC_PATH
+export DYNAMIC_LIB_EXT
+export FixPath
+export HF
+export INCLUDE_DIR
+export IMPORT_PATH
+export LDCFLAGS
+export FPIC
+export LIBNAME
+export LIB_DIR
+export LINKERFLAG
+export message
+export MAKE
+export MKDIR
+export MODEL
+export MV
+export OUTPUT
+export OS
+export PATH_SEP
+export PKG_CONFIG_FILE
+export PREFIX
+export RANLIB
+export RM
+export STATIC_LIB_EXT
+export SONAME
121 cutedoc.ddoc
@@ -0,0 +1,121 @@
+SECTION = <h3 class="section">$1</h3> <div class="section">$2</div>
+SSECTION = <div class="ssection">$(B $1): $2</div>
+STDSECTION = <div class="stdsection">$(B $1):<br/> &nbsp; &nbsp; &nbsp; $2</div>
+WEB = <a href="http://$1" title="$2">$2</a>
+
+WARNING = <div class="warning"><strong>Warning:</strong> $0</div>
+CRITICAL = <div class="critical"><strong>Critical:</strong> $0</div>
+
+LINKTO = <a href="#$0">$0</a>
+
+LINK = $(LINKPREFIX)$0
+REPO = $(REPOSRCDIR)$0
+
+MODULE = <li><a href="$(ROOT)/$1.html" title="$2">$1</a></li>
+
+DDOC = <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+ <html>
+ <head>
+ <meta http-equiv="content-type" content="text/html; charset=utf-8">
+ <title>$(TITLE) - $(PROJECTNAME) documentation</title>
+ <link rel="stylesheet" type="text/css" href="$(ROOT)/dscience/style.css">
+ <script type="text/javascript" src="$(ROOT)/dscience/jquery.js"></script>
+ <script type="text/javascript" src="$(ROOT)/dscience/cutedoc.js"></script>
+ </head>
+ <body>
+ <div id="header">
+ <div id="inner">
+ <img src="$(LOGOSRC)" alt="$(LOGOALT)"/>
+ <p>$(BIG $(TITLE)) - $(SMALL $(PROJECTNAME) documentation)</p>
+ </div>
+ </div>
+
+ <div id="floating">
+ <div id="modulesouter">
+ <h3>Modules</h3>
+ <div id="modules">$(MODULES)</div>
+ </div>
+
+ <div id="childsouter">
+ <h3>Jump to</h3>
+ <div id="childs"></div>
+ </div>
+ </div>
+
+ <div id="content">
+ $(BODY)
+ </div>
+ <p align="center"><small>Copyright by $(COPYRIGHT) $(YEAR).<br/>
+ Generated by ddoc, Theme: cutedoc.</small></p>
+ </body>
+ </html>
+
+
+
+DDOC_DECL = <h1 class="decl">$0</h1>
+
+DDOC_SUMMARY = <div class="summary">$0</div>
+
+DDOC_DESCRIPTION = <div class="description">$0</div>
+DDOC_BUGS = $(STDSECTION Known bugs, $0)
+DDOC_COPYRIGHT = $(STDSECTION Copyright, $0)
+DDOC_AUTHORS = $(STDSECTION Authors, $0)
+DDOC_DATE = $(STDSECTION Date, $0)
+DDOC_DEPRECATED = $(STDSECTION Deprecated, $0)
+DDOC_EXAMPLES = <h3 class="section">Examples</h3> <div class="section examples">$0</div>
+DDOC_EXAMPLE = <h3 class="section">Examples</h3> <div class="section examples">$0</div>
+DDOC_HISTORY = $(STDSECTION History, $0)
+DDOC_LICENSE = $(SSECTION License, $0)
+DDOC_RETURNS = $(STDSECTION Returns, $0)
+DDOC_SEE_ALSO = $(STDSECTION See also, $0)
+DDOC_STANDARDS = $(STDSECTION Standards, $0)
+DDOC_THROWS = $(STDSECTION Throws, $0)
+DDOC_VERSION = $(STDSECTION Version, $0)
+
+
+DDOC_DECL_DD = <div class="decldd">$0</div>
+
+DDOC_PARAMS = $(SECTION Parameters, <table width="100%">$0</table>)
+DDOC_PARAM_ROW = <tr>$0</tr>
+DDOC_PARAM_ID = <td width="16%">$0</td>
+DDOC_PARAM_DESC = <td>$0</td>
+
+
+DDOC_KEYWORD = $(BLUE $0)
+
+D_STRING = <span style="color:orange;">$0</span>
+D_PARAM = $(B $0)
+D_COMMENT = <span style="color:gray;">$0</span>
+
+DDOC_PSYMBOL = <a class="psymbol" name="$0">$0</a>
+DDOC_SYMBOL = <s>$0</s>
+
+RPAREN = )
+LPAREN = (
+LESS = &lt;
+GREATER = &gt;
+WEB = $(LINK2 http://$1,$2)
+LUCKY = $(WEB google.com/search?btnI=I%27m+Feeling+Lucky&amp;ie=UTF-8&amp;oe=UTF-8&amp;q=$0,$0)
+D = <span class="inlinecode">$0</span>
+BIGOH = <b><i>&Omicron;</i>(</b>$(D $0)<b><i>)</i></b>
+GLOSSARY = $(LINK2 ../glossary.html#$0, $0)
+XREF = <a href="std_$1.html#$2">$(D std.$1.$2)</a>
+CXREF = <a href="core_$1.html#$2">$(D core.$1.$2)</a>
+ECXREF = <a href="etc_c_$1.html#$2">$(D etc.c.$1.$2)</a>
+LREF = <a href="#$1">$(D $1)</a>
+BUGZILLA = $(LINK2 http://d.puremagic.com/issues/show_bug.cgi?id=$0, Bugzilla $0)
+PRE = <pre>$0</pre>
+PHOBOSSRC=$(LINK2 https://github.com/D-Programming-Language/phobos/blob/master/$0, $0)
+DRUNTIMESRC=$(LINK2 https://github.com/D-Programming-Language/druntime/blob/master/src/$0, $0)
+SAMPLESRC=$(LINK2 https://github.com/D-Programming-Language/dmd/blob/master/samples/$0, /dmd/samples/d/$0)
+
+BOOKTABLE = <table cellspacing=0 cellpadding=5 class=book><caption>$1</caption>$2</table>
+LEADINGROW = <tr class=leadingrow><td colspan=2><b><em>&nbsp;&nbsp;&nbsp;&nbsp;$0</em></b></td></tr>
+TABLE = <table cellspacing=0 cellpadding=5><caption>$1</caption>$2</table>
+TD = <td valign=top>$0</td>
+TDNW = <td valign=top class="donthyphenate">$0</td>
+SUB = <sub>$0</sub>
+
+COLOR = <span style="color:$1">$2</span>
+
+TABLE_SV = <table style="border:1px solid silver;">$0</table>
215 cutedoc.js.in.in
@@ -0,0 +1,215 @@
+/**
+ * Copyright 2011 by Robert Pasiński
+ *
+ * Licensed under MIT License
+ */
+$(document).ready(function() {
+
+ $('#childs').css('display', 'none');
+ $('#modules').css('display','none');
+
+ /*
+ * COLORIZE CLASSES AND STRUCTS
+ */
+
+ $('.decl').each(function(){
+ var $this = $(this);
+
+ var map = ['class', 'template', 'struct', 'alias'];
+
+ for(var i = 0; i <= map.length; i++)
+ {
+ if($this.text().indexOf(map[i]) >= 0)
+ $this.html('<span class="'+map[i]+'decl">' + $this.html() + '</span>');
+ }
+ });
+
+
+ /*
+ * SYMBOLS LISTING
+ */
+ var j = $('#childs');
+
+ j.append(list($('#content > dl').children()));
+
+ function list(e)
+ {
+ var str = '<ul>';
+ e.each(function(i){
+ var $this = $(this);
+
+ if($this.hasClass('decl')) {
+ var name = $this.find('a').html();
+ if(name==null)
+ name = "this";
+
+ var prefix = '';
+
+ var kw = $this.text();
+
+ if( kw.indexOf('struct') >= 0 )
+ {
+ prefix = img('struct.png', 'Struct');
+ }
+ else if(kw.indexOf('class') >= 0)
+ {
+ prefix = img('class.png', 'Class');
+ }
+ else if(kw.indexOf('enum') >= 0)
+ {
+ prefix = img('enum.png', 'Enum');
+ }
+ else if(kw.indexOf('template') >= 0)
+ {
+ prefix = img('template.png', 'Template');
+ }
+ else if(kw.indexOf('alias') >= 0)
+ {
+ prefix = img('alias.png', 'Alias');
+ }
+ else if(kw.indexOf('@property') >= 0)
+ {
+ prefix = img('property.png', 'Property');
+ }
+ else if(kw.indexOf('(') >= 0)
+ {
+ prefix = img('func.png', 'Function');
+ }
+ else
+ {
+ prefix = img('var.png', 'Variable');
+ }
+
+
+ str += '<li>'+prefix+'<a href="#'+name+'">'+name+'</a></li>';
+ }
+ else if($this.hasClass('decldd'))
+ {
+ str += list($this.children('.decldd dl').children());
+ }
+ });
+ str += '</ul>';
+ return str;
+ }
+
+
+ /*
+ * LINK FIX
+ */
+
+ $('#modules li a').each(function(){
+ var name = $(this).text();
+ //name = name.substr(1, name.length - 2);
+
+ $(this).text(name.replace(/\_/g, '.'));
+ });
+
+ /*var tree = {};
+
+ $('#modules li a').each(function(){
+ var name = $(this).name();
+ var parts = name.split(".");
+ var curr = tree;
+
+ for(var i = 0; i <= parts.length - 1; i++)
+ {
+ curr[parts[i]] = name;
+ }
+ });*/
+
+ $('a').click(function() {
+ $('.decl .psymbol').each(function(){
+ if( $(this).attr('name') == location.hash.substr(1) )
+ {
+ $(this).parent().addClass('current');
+ }
+ else
+ {
+ $(this).parent().removeClass('current');
+ }
+ });
+ });
+
+
+
+ /*
+ * MODULES TREE
+ */
+ var m = $('#modules a > a');
+
+ m.each(function() {
+ var $this = $(this);
+ var tmp = $this.attr('href');
+ tmp = tmp.substr(2, tmp.length - 7);
+ $this.attr('href', tmp.replace(/\./g, '_')+'.html');
+
+ var parts = tmp.split('.');
+ $(this).text(parts[parts.length - 1]);
+ });
+
+
+ /*
+ * TOGGLE
+ */
+ var modules = false, jumper = false;
+ $('#childsouter h3').click(function(){
+ $('#childs').slideToggle('slow');
+ jumper = !jumper;
+ });
+
+ $('#modulesouter h3').click(function(){
+ $('#modules').slideToggle('slow');
+ modules = !modules;
+ });
+
+ $(window).unload(function() {
+ createCookie("modules", modules ? "1" : "0");
+ createCookie("jumper", jumper ? "1" : "0");
+ });
+
+ $(window).load(function(){
+
+ if(readCookie("modules") == "1")
+ $("#modules").slideDown();
+
+ if(readCookie("jumper") == "1")
+ $("#childs").slideDown();
+ });
+
+
+
+ /*
+ * UTIL
+ */
+ function img(filename, title)
+ {
+ return '<img src="images/'+filename+'" alt="'+title+'" title="'+title+'" />';
+ }
+
+ function createCookie(name,value,days) {
+ if (days) {
+ var date = new Date();
+ date.setTime(date.getTime()+(days*24*60*60*1000));
+ var expires = "; expires="+date.toGMTString();
+ }
+ else var expires = "";
+ document.cookie = name+"="+value+expires;
+ }
+
+ function readCookie(name) {
+ var nameEQ = name + "=";
+ var ca = document.cookie.split(';');
+ for(var i=0;i < ca.length;i++) {
+ var c = ca[i];
+ while (c.charAt(0)==' ') c = c.substring(1,c.length);
+ if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
+ }
+ return null;
+ }
+
+ function repeat(times)
+ {
+ return new Array(times + 1).join("--");
+ }
+
+});
8 dscience/.lock-waf_linux2_build
@@ -0,0 +1,8 @@
+argv = ['./waf', 'configure', '--prefix=/usr']
+environ = {'SSH_ASKPASS': '/usr/libexec/openssh/gnome-ssh-askpass', 'WINDOWID': '33554438', 'GNOME_DESKTOP_SESSION_ID': 'this-is-deprecated', 'LESSOPEN': '||/usr/bin/lesspipe.sh %s', 'QT_IM_MODULE': 'xim', 'LOGNAME': 'jonathan', 'USER': 'jonathan', 'PATH': '/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin', 'XDG_VTNR': '1', 'GNOME_KEYRING_CONTROL': '/tmp/keyring-02qCUv', 'DISPLAY': ':0', 'LANG': 'fr_FR.utf8', 'TERM': 'xterm', 'SHELL': '/bin/bash', 'XDG_SESSION_COOKIE': 'b86d160eca2ebd0f61847c4600000013-1332281934.414024-181422185', 'SESSION_MANAGER': 'local/unix:@/tmp/.ICE-unix/1708,unix/unix:/tmp/.ICE-unix/1708', 'SHLVL': '2', 'HISTSIZE': '1000', 'WINDOWPATH': '1', 'IMSETTINGS_INTEGRATE_DESKTOP': 'yes', 'GPG_AGENT_INFO': '/tmp/keyring-02qCUv/gpg:0:1', 'HOME': '/home/jonathan', 'USERNAME': 'jonathan', 'IMSETTINGS_MODULE': 'none', 'XDG_RUNTIME_DIR': '/run/user/jonathan', 'SSH_AUTH_SOCK': '/tmp/keyring-02qCUv/ssh', 'GDMSESSION': 'gnome', 'XMODIFIERS': '@im=none', 'XDG_SESSION_ID': '2', 'DBUS_SESSION_BUS_ADDRESS': 'unix:abstract=/tmp/dbus-NIqhIaQXVx,guid=f6361cb9b59728a4146b352f00000027', '_': './waf', 'XAUTHORITY': '/var/run/gdm/auth-for-jonathan-1jK0Aa/database', 'DESKTOP_SESSION': 'gnome', 'GNOME_KEYRING_PID': '1704', 'OLDPWD': '/home/jonathan/Projets/MakefileForD', 'HOSTNAME': 'jonathan', 'GDM_LANG': 'fr_FR.utf8', 'HISTCONTROL': 'ignoredups', 'PWD': '/home/jonathan/Projets/dscience', 'COLORTERM': 'gnome-terminal', 'MAIL': '/var/spool/mail/jonathan', 'LS_COLORS': 'rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=01;05;37;41:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.tbz=01;31:*.tbz2=01;31:*.bz=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=01;36:*.au=01;36:*.flac=01;36:*.mid=01;36:*.midi=01;36:*.mka=01;36:*.mp3=01;36:*.mpc=01;36:*.ogg=01;36:*.ra=01;36:*.wav=01;36:*.axa=01;36:*.oga=01;36:*.spx=01;36:*.xspf=01;36:*.pdf=00;33:*.ps=00;33:*.ps.gz=00;33:*.txt=00;33:*.patch=00;33:*.diff=00;33:*.log=00;33:*.tex=00;33:*.xls=00;33:*.xlsx=00;33:*.ppt=00;33:*.pptx=00;33:*.rtf=00;33:*.doc=00;33:*.docx=00;33:*.odt=00;33:*.ods=00;33:*.odp=00;33:*.xml=00;33:*.epub=00;33:*.abw=00;33:*.html=00;33:*.wpd=00;33:', 'XDG_SEAT': 'seat0'}
+files = ['/home/jonathan/Projets/dscience/wscript']
+hash = 7900572336416784618
+options = {'files': '', 'docdir': '', 'jobs': 4, 'verbose': 0, 'nocache': False, 'progress_bar': 0, 'top': '', 'datadir': '', 'libdir': '', 'pkgconfigdir': '', 'destdir': '', 'keep': 0, 'zones': '', 'prefix': '/usr', 'includedir': '', 'download': False, 'force': False, 'out': '', 'targets': '', 'bindir': '', 'compiler': 'ldc2'}
+out_dir = '/home/jonathan/Projets/dscience/build'
+run_dir = '/home/jonathan/Projets/dscience'
+top_dir = '/home/jonathan/Projets/dscience/dscience'
231 dscience/exception.d
@@ -0,0 +1,231 @@
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ */
+
+/**
+ * Exception raise in dscience.
+ *
+ * Copyright: Copyright Jonathan MERCIER 2012-.
+ *
+ * License: LGPLv3+
+ *
+ * Authors: Jonathan MERCIER aka bioinfornatics
+ *
+ * Source: dscience/exception.d
+ */
+
+module dscience.exception;
+
+import std.exception;
+import std.string;
+import dscience.physic.atom;
+import dscience.physic.bond;
+
+class AtomBondException : Exception{
+ this( string file = __FILE__, size_t line = __LINE__ ){
+ super( "Two many bond used for an atom", file, line );
+ }
+
+ this(IAtom atom, string file = __FILE__, size_t line = __LINE__ ){
+ string msg = "Two many bond used for atom id: %sSymbol: %s\t max bond: %s".format(
+ atom.atomId(),
+ atom.symbol(),
+ atom.maxElectronInLastLevel()
+ );
+ super( msg, file, line );
+ }
+
+ this( string msg, string file = __FILE__, size_t line = __LINE__ ){
+ super( msg, file, line );
+ }
+}
+
+class AtomNotFoundException : Exception{
+ this( string file = __FILE__, size_t line = __LINE__ ) {
+ super( "Atom not found!", file, line );
+ }
+
+ this( IAtom atom, string file = __FILE__, size_t line = __LINE__ ){
+ string msg = "Atom id %d not found!".format( atom.atomId() );
+ super( msg, file, line );
+ }
+
+ this( string type, size_t atomNum, string file = __FILE__, size_t line = __LINE__ ){
+ string msg = "Atom type %s number %d not found!".format( type, atomNum);
+ super( msg, file, line );
+ }
+
+ this( string msg, string file = __FILE__, size_t line = __LINE__ ){
+ super( msg, file, line );
+ }
+}
+
+class BadSymbolException : Exception{
+ this( string file = __FILE__, size_t line = __LINE__ ){
+ super( "One or more bad symbol!", file, line );
+ }
+
+ this( string msg, string file = __FILE__, size_t line = __LINE__ ){
+ super( "One or more bad symbol!"~msg, file, line );
+ }
+}
+
+class BondNotFoundException : Exception{
+ this( string file = __FILE__, size_t line = __LINE__ ) {
+ super( "Bond not found!", file, line );
+ }
+
+ this( IBond bond, string file = __FILE__, size_t line = __LINE__ ){
+ string msg = "Bond id %d not found!".format( bond.bondId );
+ super( msg, file, line );
+ }
+
+ this( string type, size_t bondNum, string file = __FILE__, size_t line = __LINE__ ){
+ string msg = "Bond type %s number %d not found!".format( type, bondNum );
+ super( msg, file, line );
+ }
+
+ this( string msg, string file = __FILE__, size_t line = __LINE__ ){
+ super( msg, file, line );
+ }
+}
+
+class ElectronCloudException : Exception{
+ this( string file = __FILE__, size_t line = __LINE__ ){
+ super( "No electron cloud found", file, line );
+ }
+
+ this( string msg, string file = __FILE__, size_t line = __LINE__ ){
+ super( msg, file, line );
+ }
+}
+
+class ElectronNumberException : Exception{
+ this( string file = __FILE__, size_t line = __LINE__ )
+ {
+ super( "the number of electron in an atom need be between 1 and 280", file, line );
+ }
+
+ this( string msg, string file = __FILE__, size_t line = __LINE__ )
+ {
+ super( msg, file, line );
+ }
+}
+
+class SequenceTooBigException : Exception{
+ this( string file = __FILE__, size_t line = __LINE__ ){
+ super( "Sequence length is more than %d character!".format( size_t.max), file, line );
+ }
+
+ this( string msg, string file = __FILE__, size_t line = __LINE__ ){
+ super( "Sequence length is more than %d character!%s".format( size_t.max, msg), file, line );
+ }
+}
+
+class SymbolNotFoundException : Exception{
+ this( string file = __FILE__, size_t line = __LINE__ ){
+ super( "Symbol not found!", file, line );
+ }
+
+ this( string msg, string file = __FILE__, size_t line = __LINE__ ){
+ super( "Symbol not found: "~msg, file, line );
+ }
+}
+
+class UnknowAminoAcidException : Exception{
+ this( string file = __FILE__, size_t line = __LINE__ ){
+ super( "Unknow amino acid check name or symbol!", file, line );
+ }
+
+ this( string msg, string file = __FILE__, size_t line = __LINE__ ){
+ super( "Unknow amino acid: "~msg, file, line );
+ }
+}
+
+class UnknowAtomException : Exception{
+ this( string file = __FILE__, size_t line = __LINE__ ){
+ super( "Unknow atom check name or symbol!", file, line );
+ }
+
+ this( string msg, string file = __FILE__, size_t line = __LINE__ ){
+ super( "Unknow atom: "~msg, file, line );
+ }
+}
+
+class UnknowBondException : Exception{
+ this( string file = __FILE__, size_t line = __LINE__ ){
+ super( "Unknow bond check name or symbol!", file, line );
+ }
+
+ this( string msg, string file = __FILE__, size_t line = __LINE__ ){
+ super( "Unknow bond check : "~msg, file, line );
+ }
+}
+
+class UnknowMoleculeException : Exception{
+ this( string file = __FILE__, size_t line = __LINE__ ){
+ super( "Unknow molecule check name or symbol!", file, line );
+ }
+
+ this( string msg, string file = __FILE__, size_t line = __LINE__ ){
+ super( "Unknow molecule : "~msg, file, line );
+ }
+}
+
+class UnknowCompoundException : Exception{
+ this( string file = __FILE__, size_t line = __LINE__ ){
+ super( "Unknow compound check name or symbol!", file, line );
+ }
+
+ this( string msg, string file = __FILE__, size_t line = __LINE__ ){
+ super( "Unknow compound : "~msg, file, line );
+ }
+}
+
+class UnknowNucleicAcidException : Exception{
+ this( string file = __FILE__, size_t line = __LINE__ ){
+ super( "Unknow nucleic acid check name or symbol!", file, line );
+ }
+
+ this( string msg, string file = __FILE__, size_t line = __LINE__ ){
+ super( "Unknow nucleic acid : "~msg, file, line );
+ }
+}
+
+class UnknowSaccharideException : Exception{
+ this( string file = __FILE__, size_t line = __LINE__ )
+ {
+ super( "Unknow saccharide check name!", file, line );
+ }
+
+ this( string msg, string file = __FILE__, size_t line = __LINE__ )
+ {
+ super( "Unknow saccharide: "~msg, file, line );
+ }
+}
+
+class UnknowMatrixException : Exception{
+ this( string file = __FILE__, size_t line = __LINE__ )
+ {
+ super( "Unknow matrix check name!", file, line );
+ }
+
+ this( string msg, string file = __FILE__, size_t line = __LINE__ )
+ {
+ super( "Unknow matrix: "~msg, file, line );
+ }
+}
466 dscience/math/alignement.d
@@ -0,0 +1,466 @@
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ */
+
+/**
+ * Implements algorith to align biological sequence.
+ *
+ * Copyright: Copyright Jonathan MERCIER 2012-.
+ *
+ * License: LGPLv3+
+ *
+ * Authors: Jonathan MERCIER aka bioinfornatics
+ *
+ * Source: dscience/math/alignement.d
+ */
+module dscience.math.alignement;
+
+import std.stdio;
+import std.path;
+import std.string;
+import std.conv;
+import std.algorithm;
+import dscience.physic.molecule;
+import dscience.exception;
+
+abstract class Alignement{
+ protected:
+ SubstitutionMatrix substitutionMatrix;
+ long insertPenality;
+ long deletePenality;
+ long gapExtend;
+ long[][][] costMatrix;
+ long[][][] coordMatrix;
+ uint alignementNumber;
+
+ public:
+ this(SubstitutionMatrix substitutionMatrix, long insertPenality, long deletePenality, long gapExtend){
+ this.substitutionMatrix = substitutionMatrix;
+ this.insertPenality = insertPenality;
+ this.deletePenality = deletePenality;
+ this.gapExtend = gapExtend;
+ this.costMatrix = new long[][][](3);
+ this.coordMatrix = new long[][][](3);
+ this.alignementNumber = 0;
+ }
+
+
+ this(SubstitutionMatrix substitutionMatrix){
+ this.substitutionMatrix = substitutionMatrix;
+ this.insertPenality = 0;
+ this.deletePenality = 0;
+ this.gapExtend = 1;
+ this.costMatrix = new long[][][](3);
+ this.coordMatrix = new long[][][](3);
+ }
+
+ string[] pairwiseAlignment(ISymbol[] sequence1, ISymbol[] sequence2){
+ return pairwiseAlignment(symbolToString(sequence1), symbolToString(sequence2));
+ }
+
+ abstract string[] pairwiseAlignment(string sequence1, string sequence2, bool isVerbose=true);
+
+ /**
+ * This gives the edit distance according to the given parameters of this
+ * certain object. It returns just the last element of the internal cost
+ * matrix (left side down).
+ *
+ * Returns:
+ * returns the edit_distance computed with the given parameters.
+ */
+ long getEditDistance(){
+ return costMatrix[alignementNumber][costMatrix[alignementNumber].length - 1][costMatrix[alignementNumber][costMatrix[alignementNumber].length - 1].length - 1];
+ }
+
+ abstract:
+ void calculateMatrix(ref string sequence1, ref string sequence2, ref size_t[] sequence1Array, ref size_t[] sequence2Array);
+
+ protected:
+ string symbolToString(ref ISymbol[] sequence){
+ char[] result = new char[](sequence.length);
+ foreach(index, symbol; sequence)
+ result[index] = symbol.letter;
+
+ return to!string( result );
+ }
+
+ bool checkSequence(ref string sequence){
+ bool result = true;
+ size_t index = 0;
+ while(result && index < sequence.length){
+ result = substitutionMatrix.isIn(sequence[index]);
+ index++;
+ }
+ return result;
+ }
+
+}
+
+class NeedlemanWunsh: Alignement{
+ public:
+
+ this(SubstitutionMatrix substitutionMatrix, long insertPenality, long deletePenality, long gapExtend){
+ super(substitutionMatrix, insertPenality, deletePenality, gapExtend);
+ }
+
+ this(SubstitutionMatrix substitutionMatrix){
+ super(substitutionMatrix);
+ }
+
+
+ string[] searchAllSolutions(string sequence1, string sequence2, bool isVerbose=true){
+ size_t arrayLen = max(sequence1.length,sequence2.length);
+ string seq1reverse = to!string( sequence1.dup.reverse );
+ string seq2reverse = to!string( sequence2.dup.reverse );
+ string[] result = new string[](6,arrayLen);
+ result[0..2] = pairwiseAlignment(sequence1, sequence2);
+ alignementNumber++;
+ result[2..4] = pairwiseAlignment(seq1reverse, sequence2);
+ alignementNumber++;
+ result[4..6] = pairwiseAlignment(seq1reverse, seq2reverse);
+ alignementNumber = 0;
+ return result;
+ }
+
+ override:
+ string[] pairwiseAlignment(string sequence1, string sequence2, bool isVerbose=true){
+ size_t[] sequence1Array = substitutionMatrix.convertSequenceToArray(sequence1);
+ size_t[] sequence2Array = substitutionMatrix.convertSequenceToArray(sequence2);
+ calculateMatrix(sequence1, sequence2, sequence1Array, sequence2Array);
+
+ debug{
+ writefln( "array1: %s", sequence1Array );
+ writefln( "array2: %S", sequence2Array );
+ writeln( "--------------------------" );
+ writeln( "Matrice (penality):" );
+ foreach(ref line; costMatrix[alignementNumber]){
+ foreach(ref column; line){
+ if(column >= 0 && column < 10)
+ writefln(" %d",column );
+ else if((column >= 10 && column < 100) || (column < 0 && column > -10))
+ Swritefln(" %d",column );
+ else if((column >= 100 && column < 1000) || (column <= -10 && column > -100))
+ writefln(" %d",column );
+ }
+ writeln();
+ }
+ writeln("--------------------------");
+ writeln("Matrice (substitution):");
+ foreach(ref line; substitutionMatrix.getMatrix())
+ writeln( line );
+ writeln("--------------------------");
+ }
+
+ string alignement1 = "";
+ string alignement2 = "";
+ size_t i = sequence1.length;
+ size_t j = sequence2.length;
+
+ size_t coordArrayLength = coordMatrix[alignementNumber].length;
+
+ while(i > 0 && j > 0){
+ long score = costMatrix[alignementNumber][i][j];
+ long scoreDiagonale = costMatrix[alignementNumber][i-1][j-1];
+ long scoreLeft = costMatrix[alignementNumber][i-1][j];
+ long scoreUp = costMatrix[alignementNumber][i][j-1];
+ debug{
+ writeln("Alignement optimale");
+ writefln("i: %d\tj: %d",i,j);
+ writefln("substitution matrix:\t%d",substitutionMatrix[sequence1Array[i-1],sequence2Array[j-1]]);
+ }
+ if(score == scoreDiagonale + substitutionMatrix[sequence1Array[i-1],sequence2Array[j-1]]){
+ alignement1 = sequence1[--i] ~ alignement1;
+ alignement2 = sequence2[--j] ~ alignement2;
+ }
+ else if (score == scoreLeft + insertPenality){
+ alignement1 = sequence1[--i] ~ alignement1;
+ alignement2 = "-" ~ alignement2;
+ }
+ else if (score == scoreUp + deletePenality){
+ alignement1 = "-" ~ alignement1;
+ alignement2 = sequence2[--j] ~ alignement2;
+ }
+ else{
+ alignement1 = "-" ~ alignement1;
+ alignement2 = sequence2[--j] ~ alignement2;
+ }
+
+ if(coordArrayLength == coordMatrix[alignementNumber].length)
+ coordMatrix[alignementNumber].length = coordMatrix[alignementNumber].length +10;
+ coordMatrix[alignementNumber][coordArrayLength] = [i,j];
+ coordArrayLength++;
+
+ debug{
+ writefln("score:\t\t\t%d",score);
+ writefln("score diagonale:\t%d",scoreDiagonale);
+ writefln("score up:\t\t%d",scoreLeft);
+ writefln("score left:\t\t%d",scoreUp);
+ writefln("Sequence 1:\t%d",alignement1);
+ writefln("Sequence 2:\t%d",alignement2);
+ writeln("--------------------------");
+ }
+ }
+ while(i > 0){
+ alignement1 = sequence1[--i] ~ alignement1;
+ alignement2 = "-" ~ alignement2;
+ if(coordArrayLength == coordMatrix.length)
+ coordMatrix.length = coordMatrix.length +10;
+
+ coordMatrix[alignementNumber][coordArrayLength] = [i,j];
+ coordArrayLength++;
+ }
+ while(j > 0){
+ alignement1 = "-" ~ alignement1;
+ alignement2 = sequence2[--j] ~ alignement2;
+ if(coordArrayLength == coordMatrix.length)
+ coordMatrix.length = coordMatrix.length +10;
+
+ coordMatrix[alignementNumber][coordArrayLength] = [i,j];
+ coordArrayLength++;
+ }
+ // resize array to content
+ coordMatrix.length = coordArrayLength;
+ if(isVerbose){
+ writefln("Result");
+ writefln("Sequence 1:\t%d",sequence1);
+ writefln("Sequence 2:\t%d",sequence2);
+ writefln("The edit distance:\t%d", getEditDistance());
+ writeln("Alignement:");
+ writeln(alignement1);
+ writeln(alignement2);
+ }
+ return [alignement1, alignement2].dup;
+ }
+
+ void calculateMatrix(ref string sequence1, ref string sequence2, ref size_t[] sequence1Array, ref size_t[] sequence2Array){
+ costMatrix[alignementNumber] = new long[][](sequence1Array.length+1,sequence2Array.length+1);
+ for( size_t j = 1; j <= sequence2Array.length; j++){
+ // j do not be > long.max or the result can not be store in matrix.
+ // for this reason sequence length can not be > long.max.
+ //we can not use ulong because they are negative value in matrix
+ costMatrix[alignementNumber][0][j] = deletePenality * j * gapExtend;
+ costMatrix[alignementNumber][1][j] = deletePenality * j * gapExtend;// * deletePenality * gapExtend;
+ }
+ for(size_t i = 1; i <= sequence1Array.length; i++){
+ costMatrix[alignementNumber][i][0] = insertPenality * i * gapExtend;
+ costMatrix[alignementNumber][i][1] = insertPenality * i * gapExtend;// * insertPenality * gapExtend;
+ for(size_t j = 1; j <= sequence2Array.length; j++){
+ debug{
+ writeln("Calculate Matrix:");
+ writefln("i:\t%d\tj:\t%d",i,j);
+ writefln("match:%d,%d =>\t%d", sequence1Array[i-1], sequence2Array[j-1], substitutionMatrix[sequence1Array[i-1], sequence2Array[j-1]]);
+ writefln("matrix[i-1][j-1]:\t%d", costMatrix[alignementNumber][i-1][j-1]);
+ writefln("matrix[i-1][j]:\t\t%d", costMatrix[alignementNumber][i-1][j]);
+ writefln("matrix[i][j-1]:\t\t%d", costMatrix[alignementNumber][i][j-1]);
+ writeln("--------------------------");
+ }
+ long scoreDiagonale = costMatrix[alignementNumber][i-1][j-1] + substitutionMatrix[sequence1Array[i-1],sequence2Array[j-1]];
+ long scoreLeft = costMatrix[alignementNumber][i-1][j] + insertPenality;
+ long scoreUp = costMatrix[alignementNumber][i][j-1] + deletePenality;
+ costMatrix[alignementNumber][i][j] = max(scoreDiagonale,scoreLeft,scoreUp);
+ }
+ }
+ }
+}
+
+class SubstitutionMatrix{
+ private:
+ short[][] matrix;
+ short min;
+ short max;
+ string alphabet;
+
+ public:
+ /**
+ * Construct an identity matrix
+ */
+ this(string alphabetList, short match, short replace){
+ this.alphabet = alphabetList;
+ this.matrix = new short[][](alphabetList.length, alphabetList.length);
+ foreach(r, ref row; matrix){
+ foreach(c, ref column; row){
+ if(r == c)
+ column = match;
+ else
+ column = replace;
+ }
+ }
+ this.min = replace;
+ this.max = match;
+ }
+
+ /**
+ * Construct an identity matrix
+ * match = 1
+ * replace = 0
+ */
+ this(string alphabetList){
+ this.alphabet = alphabetList;
+ this.matrix = new short[][](alphabetList.length, alphabetList.length);
+ foreach(r, ref row; matrix){
+ foreach(c, ref column; row){
+ if(r == c)
+ column = 1;
+ else
+ column = 0;
+ }
+ }
+ this.min = 0;
+ this.max = 1;
+ }
+
+ /**
+ * Construct a subtitution matrix from given matrix
+ * Element in alphabetList need be in right order!
+ */
+ this (string alphabetList, short[][] matrix){
+ this.min = short.min;
+ this.max = short.min;
+ this.alphabet = alphabetList;
+ this.matrix = matrix;
+ foreach(row; matrix){
+ foreach(column; row){
+ if (column < min)
+ min = column;
+ else if (column > max)
+ max = column;
+ }
+ }
+ }
+
+ /**
+ * Copy a substitution Matrix object
+ */
+ this(SubstitutionMatrix substitutionMatrix){
+ this.matrix = substitutionMatrix.getMatrix();
+ this.alphabet = substitutionMatrix.getAlphabet();
+ this.min = substitutionMatrix.getMin();
+ this.max = substitutionMatrix.getMax();
+ }
+
+ short[][] getMatrix(){
+ return matrix.dup;
+ }
+
+ string getAlphabet(){
+ return alphabet.idup;
+ }
+
+ short getMin(){
+ return min;
+ }
+
+ short getMax(){
+ return max;
+ }
+
+ bool isIn(char symbol){
+ bool isSearching = true;
+ bool isPresent = false;
+ short index = 0;
+ while(isSearching && index < alphabet.length){
+ if (alphabet[index] == symbol){
+ isPresent = true;
+ isSearching = false;
+ }
+ else
+ index++;
+ }
+ return isPresent;
+ }
+
+ short getSymbolPosition(char symbol){
+ bool isSearching = true;
+ bool isPresent = false;
+ short index = 0;
+ while(isSearching && index < alphabet.length){
+ if (alphabet[index] == symbol){
+ isPresent = true;
+ isSearching = false;
+ }
+ else
+ index++;
+ }
+ if (isPresent == false)
+ throw new SymbolNotFoundException(__FILE__,__LINE__);
+ return index;
+ }
+
+ size_t[] convertSequenceToArray(string sequence){
+ size_t[] result = new size_t[](sequence.length);
+ foreach(index, letter; sequence)
+ result[index] = getSymbolPosition(letter);
+ return result.dup;
+ }
+
+ char getSymbol(size_t number){
+ return alphabet[number];
+ }
+
+ short getValue(size_t i, size_t j){
+ return matrix[i][j];
+ }
+
+ short opIndex(size_t i, size_t j){
+ return getValue(i,j);
+ }
+
+}
+
+
+class PositionWeightMatrix(T){
+ private:
+ string _name;
+ T[][] _matrix;
+ string[size_t] _label;
+
+ public:
+ this( string name, T[][] matrix, string[size_t] label ){
+ _name = name;
+ _matrix = matrix;
+ _label = label;
+ }
+
+ /**
+ * Load simple matrix file, something like(contain only number tab delimited) :
+ * 0.5 0.25 0.25 0
+ * 0.25 0.5 0.25 0
+ * 0.5 0 0.25 0.25
+ * 0.25 0.5 0.25 0
+ * For an advanced parser see module format and his class Mat
+ */
+ this( string filePath, string[size_t] label, string separator = "\t" ){
+ File pwmFile = File( filePath, "r" );
+ _label = label;
+ if( extension( filePath ).empty )
+ _name = baseName( filePath );
+ else
+ _name = baseName( filePath, extension( filePath ) );
+ size_t length = 10;
+ size_t counter = 0;
+ _matrix.length = 10;
+
+ foreach( counter, line; pwmFile.byLine() ){
+ if( length == counter ){ // save time by not increase at each step matrix size
+ length += 10;
+ _matrix.length = length;
+ }
+ _matrix[counter] = array( map!(to!T)( line.splitter(separator) ) );
+ }
+ _matrix.length = counter;
+ }
+}
3,471 dscience/math/matrix.d
3,471 additions, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
69 dscience/math/motif.d
@@ -0,0 +1,69 @@
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ */
+
+/**
+ * Implements functionality works around motif searching.
+ *
+ * Copyright: Copyright Jonathan MERCIER 2012-.
+ *
+ * License: LGPLv3+
+ *
+ * Authors: Jonathan MERCIER aka bioinfornatics
+ *
+ * Source: dscience/math/motif.d
+ */
+ module dscience.motif;
+
+import std.string;
+import std.stdio;
+import std.conv : to;
+import std.array : array, map, split, empty, appender;
+import std.math : log2;
+import std.algorithm : filter, reduce;
+
+/**
+ * scanning
+ * scan the whole sequence against a position Weight matrix
+ * Params:
+ * matrix = a normalized position weight matrix
+ * sequence = sequence to scan
+ * label = name / position to each column ( ["A":0, "C":1, "G":2, "T":3] )
+ * background = ["A":0.25, "T":0.25, "G":0.25, "C":0.25];
+ * treshold = minimum score to filter, default value 0
+ * Returns:
+ * scanning score to corresponding sequence / matrix
+ */
+T[][] scanning( T )( ref T[][] motif, size_t[string] label, string sequence, T[string] backgroung, double treshold = 0 ){ // sequence.length > motif.length
+ size_t startPosition = 0;
+ T currentScore = 0;
+ T[][] score;
+ auto list = appender(score);
+
+ while( startPosition < (sequence.length - motif.length) ){ // iterate over sequence to scan letter by letter
+ foreach( size_t motifPosition, ref T[] letterWeight; motif ){ // compute score if motif are located at this poition
+ char letter = sequence[motifPosition + startPosition]; // get which letter are into sequence at this position
+ size_t letterIndex = label[ to!string(letter) ]; // take at which position are located the letter into the pwm matrix
+ currentScore += letterWeight[letterIndex]; // get is corresponding score
+ }
+ if( currentScore >= treshold )
+ list.put( [startPosition, (startPosition + motif.length), currentScore] );
+ startPosition++;
+ currentScore = 0;
+ }
+ return list.data;
+}
135 dscience/math/statistics.d
@@ -0,0 +1,135 @@
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ */
+
+/**
+ * Implements functionality to do basic statistics.
+ *
+ * Copyright: Copyright Jonathan MERCIER 2012-.
+ *
+ * License: LGPLv3+
+ *
+ * Authors: Jonathan MERCIER aka bioinfornatics
+ *
+ * Source: dscience/math/statistics.d
+ */
+module dscience.math.statistics;
+import std.string;
+import std.exception;
+import std.math : ceil, floor, sqrt;
+import std.algorithm: sort;;
+import std.array;
+
+real[] quartile(T)( T[] data ){
+ T[3] result;
+ size_t effective = data.length;
+ real q1 = ceil(effective / 4) - 1; // array tart at 0 so - 1
+ real q2 = (effective % 2 == 0) ? data[(effective/2) - 1] + data[effective/2] / 2 : data[effective/2];
+ real q3 = q1 *3;
+ result[0] = q1; // 25%
+ result[1] = q2; // 50% median
+ result[2] = q3; // 75%
+ return result;
+
+}
+
+size_t[string] sampling(T)( T[] data, double frame=1 ){
+ size_t[string] hash;
+ foreach( item; data ){
+ real result, start, end;
+ string key;
+ result = item / frame;
+ start = floor( result ) * frame;
+ end = ceil( result ) * frame;
+ key = "%.2f - %.2f".format(start, end);
+ if( key in hash )
+ hash[key] += 1u;
+ else
+ hash[key] = 1u;
+ }
+ return hash;
+}
+
+real average(T)( T[] data ){
+ return cast(T) reduce!("a + b")(data) / data.length;
+}
+
+real variance(T)( T[] data ){
+ real avg = average!T( data );
+ real var = 0;
+ foreach(T item; data )
+ var += ( item - avg )^^2 ;
+ return var / data.length;
+}
+
+real standard_deviation(T)( T[] data ){
+ return sqrt( variance!T(data) );
+}
+
+/**
+ * Benjamini & Hochberg
+ * Params:
+ * pv = p value list
+ * threshold = level at which FDR rate should be controlled
+ */
+T[] bh_rejected(T)( T[] pv, double threshold = 0.05, bool isSorted = false){
+ T[] result;
+ size_t m, index;
+ bool isComputing = true;
+ if( threshold < 0 || threshold > 1 )
+ throw new Exception("The threshold must be between 0 and 1");
+ if ( pv !is null ){
+ if( !isSorted )
+ pv = array( sort!("a < b")( pv ) );
+ if( pv[0] < 0 || pv[$-1] > 1 )
+ throw new Exception("p-values must be between 0 and 1");
+ m = pv.length;
+ index = m - 1;
+ while( isComputing ){
+ writefln( "Index: %d, p value: %s, compute: %f", index, pv[index] , (index+1) * threshold / m );
+ if( pv[index] <= (index+1) * threshold / m ){
+ result = pv[0..index+1];
+ isComputing = false;
+ }
+ if( index == 0 )
+ isComputing = false;
+ else
+ index--;
+ }
+ }
+ return result;
+}
+
+real accuracy(T)( T positive, T negative, T true_positive, T true_negative ){
+ return (true_positive + true_negative) / (positive + negative);
+}
+
+real specificity(T)( T true_negative, T false_positive ){
+ return true_negative / (false_positive + true_negative);
+}
+
+real precision(T)(T true_positive, T false_positive){
+ return true_positive / (true_positive + false_positive);
+}
+
+real false_discovery_rate(T)(T true_positive, T false_positive){
+ return false_positive / (false_positive + true_positive);
+}
+
+real true_positive_rate(T)(T true_positive, T false_negative){
+ return true_positive / (true_positive + false_negative);
+}
1,439 dscience/molecules/amino_acid.d
@@ -0,0 +1,1439 @@
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ */
+
+/**
+ * Amino acid definition in dscience.
+ *
+ * Copyright: Copyright Jonathan MERCIER 2012-.
+ *
+ * License: LGPLv3+
+ *
+ * Authors: Jonathan MERCIER aka bioinfornatics
+ *
+ * Source: dscience/molecules/amino_acid.d
+ */
+module dscience.molecules.amino_acid;
+
+import std.string;
+
+import dscience.physic.molecule;
+import dscience.physic.bond;
+import dscience.physic.atom;
+import dscience.exception;
+
+interface IAmino : IMolecule,