generate_And_Wrap_Pseudorandom_DNA_Sequence   xtlang


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/examples/core/fasta_lang_shootout.xtm

Implementation

(bind-func generate_And_Wrap_Pseudorandom_DNA_Sequence
  (let ((line:|61,i8|* (alloc))
        (cumulative_Probability 0.0:f) (i 0)
        (line_Length 0) (column 0) (r 0.0:f)
        (count 0))
    (lambda (nucleotides_Information:nucleotide_info* number_Of_Nucleotides:i64 number_Of_Characters_To_Create:i64)
      (set! cumulative_Probability 0.0:f)
      (let ((cumulative_Probabilities:float* (salloc number_Of_Nucleotides))
            (current_Number_Of_Characters_To_Create number_Of_Characters_To_Create)
            (IMf (i32tof IM)))
        (dotimes (i number_Of_Nucleotides)
          (set! cumulative_Probability (+ cumulative_Probability (tref (pref-ptr nucleotides_Information i) 1)))
          (pset! cumulative_Probabilities i (* IMf cumulative_Probability)))
        (aset! line MAXIMUM_LINE_WIDTH #o012)
        (while (> current_Number_Of_Characters_To_Create 0)
          (set! line_Length MAXIMUM_LINE_WIDTH)
          (if (< current_Number_Of_Characters_To_Create MAXIMUM_LINE_WIDTH)
              (begin
                (set! line_Length current_Number_Of_Characters_To_Create)
                (aset! line line_Length #o012)))
          (dotimes (column line_Length)
            (set! r (get_LCG_Pseudorandom_Number IMf))
            (set! count 0)
            (dotimes (i number_Of_Nucleotides)
              (if (<= (pref cumulative_Probabilities i) r)
                  (set! count (+ count 1))))
            (aset! line column (tref (pref-ptr nucleotides_Information count) 0)))
          (fwrite (cast line) (+ line_Length 1) 1 stdout)
          (set! current_Number_Of_Characters_To_Create (- current_Number_Of_Characters_To_Create line_Length))))
      void)))


Back to Index

Similar Entries

  • PARAM_RANDOM    scheme    /digego/extempore/tree/v0.8.9/libs/core/instruments-scm.xtm
  • PARAM_RANDOM    scheme    /digego/extempore/tree/v0.8.9/examples/sharedsystem/audiosetup.xtm
  • VAO_bind_and_draw_arrays    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gl/gl-objects.xtm
  • aiProcess_FindDegenerates    scheme    /digego/extempore/tree/v0.8.9/libs/external/assimp.xtm
  • aiProcess_MakeLeftHanded    scheme    /digego/extempore/tree/v0.8.9/libs/external/assimp.xtm
  • bind-wrapper    macro    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • bindfunc_with_zone_size_and_docstring    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/aot-compilation.xtm
  • cas_expand_term    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/cas.xtm
  • cl:and?    scheme    /digego/extempore/tree/v0.8.9/runtime/scheme.xtm
  • cond-eval-and    scheme    /digego/extempore/tree/v0.8.9/runtime/init.xtm
  • cond-expand    macro    /digego/extempore/tree/v0.8.9/runtime/init.xtm
  • cond-expand-runtime    scheme    /digego/extempore/tree/v0.8.9/runtime/init.xtm
  • constructor-name-and-type    scheme    /digego/extempore/tree/v0.8.9/libs/base/adt.xtm
  • cpBBExpand    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/libchipmunk/cpBB.xtm
  • cpBBWrapVect    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/libchipmunk/cpBB.xtm
  • cpTransformWrap    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/libchipmunk/cpTransform.xtm
  • cpTransformWrapInverse    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/libchipmunk/cpTransform.xtm
  • deconstructor-name-and-type    scheme    /digego/extempore/tree/v0.8.9/libs/base/adt.xtm
  • divide-and-conquer    xtlang    /digego/extempore/tree/v0.8.9/examples/core/xthread.xtm
  • draw_color_body_frame_with_hands    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/orbbec_test.xtm
  • dsp_randn    xtlang    /digego/extempore/tree/v0.8.9/libs/core/audio_dsp.xtm
  • dsp_randn    xtlang    /digego/extempore/tree/v0.8.9/libs/core/vaudio_dsp.xtm
  • env-wrap    xtlang    /digego/extempore/tree/v0.8.9/examples/core/extempore_lang.xtm
  • expand    macro    /digego/extempore/tree/v0.8.9/libs/contrib/cas.xtm
  • generate_random_vao    xtlang    /digego/extempore/tree/v0.8.9/examples/external/xtmrender4.xtm
  • generate_tri_normals    xtlang    /digego/extempore/tree/v0.8.9/examples/external/xtmrender4.xtm
  • generate_tri_uvws    xtlang    /digego/extempore/tree/v0.8.9/examples/external/xtmrender4.xtm
  • get_LCG_Pseudorandom_Number    xtlang    /digego/extempore/tree/v0.8.9/examples/core/fasta_lang_shootout.xtm
  • get_browser_process_handler    xtlang    /digego/extempore/tree/v0.8.9/libs/external/cef/cef.xtm
  • get_context_menu_handler    xtlang    /digego/extempore/tree/v0.8.9/libs/external/cef/cef.xtm
  • get_dialog_handler    xtlang    /digego/extempore/tree/v0.8.9/libs/external/cef/cef.xtm
  • get_display_handler    xtlang    /digego/extempore/tree/v0.8.9/libs/external/cef/cef.xtm
  • get_download_handler    xtlang    /digego/extempore/tree/v0.8.9/libs/external/cef/cef.xtm
  • get_drag_handler    xtlang    /digego/extempore/tree/v0.8.9/libs/external/cef/cef.xtm
  • get_find_handler    xtlang    /digego/extempore/tree/v0.8.9/libs/external/cef/cef.xtm
  • get_focus_handler    xtlang    /digego/extempore/tree/v0.8.9/libs/external/cef/cef.xtm
  • get_geolocation_handler    xtlang    /digego/extempore/tree/v0.8.9/libs/external/cef/cef.xtm
  • get_hand_data    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/orbbec_test.xtm
  • get_jsdialog_handler    xtlang    /digego/extempore/tree/v0.8.9/libs/external/cef/cef.xtm
  • get_keyboard_handler    xtlang    /digego/extempore/tree/v0.8.9/libs/external/cef/cef.xtm
  • get_life_span_handler    xtlang    /digego/extempore/tree/v0.8.9/libs/external/cef/cef.xtm
  • get_load_handler    xtlang    /digego/extempore/tree/v0.8.9/libs/external/cef/cef.xtm
  • get_render_handler    xtlang    /digego/extempore/tree/v0.8.9/libs/external/cef/cef.xtm
  • get_render_process_handler    xtlang    /digego/extempore/tree/v0.8.9/libs/external/cef/cef.xtm
  • get_request_handler    xtlang    /digego/extempore/tree/v0.8.9/libs/external/cef/cef.xtm
  • get_resource_bundle_handler    xtlang    /digego/extempore/tree/v0.8.9/libs/external/cef/cef.xtm
  • glfw_init_and_create_compatibility_window    xtlang    /digego/extempore/tree/v0.8.9/libs/external/glfw3.xtm
  • glfw_init_and_create_fullscreen_compatibility_window    xtlang    /digego/extempore/tree/v0.8.9/libs/external/glfw3.xtm
  • glfw_init_and_create_fullscreen_interaction_compatibility_window    xtlang    /digego/extempore/tree/v0.8.9/libs/external/glfw3.xtm
  • glfw_init_and_create_fullscreen_interaction_window    xtlang    /digego/extempore/tree/v0.8.9/libs/external/glfw3.xtm
  • glfw_init_and_create_fullscreen_interaction_window    xtlang    /digego/extempore/tree/v0.8.9/libs/external/glfw3.xtm
  • glfw_init_and_create_fullscreen_window    xtlang    /digego/extempore/tree/v0.8.9/libs/external/glfw3.xtm
  • glfw_init_and_create_fullscreen_window    xtlang    /digego/extempore/tree/v0.8.9/libs/external/glfw3.xtm
  • glfw_init_and_create_interaction_compatibility_window    xtlang    /digego/extempore/tree/v0.8.9/libs/external/glfw3.xtm
  • glfw_init_and_create_interaction_window    xtlang    /digego/extempore/tree/v0.8.9/libs/external/glfw3.xtm
  • glfw_init_and_create_window    xtlang    /digego/extempore/tree/v0.8.9/libs/external/glfw3.xtm
  • glwrapper-arg-list-symbols    scheme    /digego/extempore/tree/v0.8.9/libs/external/gl/gl-getprocaddress.xtm
  • glwrapper-arg-list-symbols    scheme    /digego/extempore/tree/v0.8.9/libs/external/gl/glcore-glew.xtm
  • impc:aot:do-and-emit    macro    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:compiler:print-cannot-expand-non-generic-error    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:ir:get-type-expand-poly    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmir.xtm
  • impc:ir:split-and-decode-poly-adhoc-name    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmir.xtm
  • impc:ti:adhoc-scheme-wrapper    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:ti:and    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:ti:completely-unwrap-named-type    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:ti:create-scheme-wrapper    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:ti:create-scm-wrapper?    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:ti:expand-generic-type    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:ti:expand-generic-type-func-gpoly-arity    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:ti:expand-generic-types    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:ti:generate-generic-type-cname    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:ti:get-generictype-candidate-types    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:ti:get-polyfunc-candidate    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:ti:get-polyfunc-candidate-list    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:ti:get-polyfunc-candidate-names    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:ti:get-polyfunc-candidate-pretty-types    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:ti:get-polyfunc-candidate-types    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:ti:get-polytype-candidate    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:ti:get-polytype-candidate-list    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:ti:get-polytype-candidate-names    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:ti:get-polytype-candidate-pretty-types    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:ti:get-polytype-candidate-types    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:ti:handle-forced-types    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:ti:reify-generic-type-expand    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:ti:remove-polyfunc-candidate    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:ti:unique-polyfunc-candidate    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • ivl:expand/contract    scheme    /digego/extempore/tree/v0.8.9/libs/core/pc_ivl.xtm
  • kinect_get_hand_left    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/kinect2.xtm
  • kinect_get_hand_right    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/kinect2.xtm
  • light-and-shade-frag    scheme    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline-scm.xtm
  • light-and-shade-vert-xtm    scheme    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline-scm.xtm
  • llvm:compile-ir-and-print    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmir.xtm
  • macro-expand    scheme    /digego/extempore/tree/v0.8.9/runtime/init.xtm
  • make_static_scheme_wrapper_ir    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • more-handlers?    scheme    /digego/extempore/tree/v0.8.9/runtime/init.xtm
  • my-inc-maker-wrapper    xtlang    /digego/extempore/tree/v0.8.9/examples/core/extempore_lang.xtm
  • on_before_command_line_processing    xtlang    /digego/extempore/tree/v0.8.9/libs/external/cef/cef.xtm
  • pc:expand/contract    scheme    /digego/extempore/tree/v0.8.9/libs/core/pc_ivl.xtm
  • pc:random    scheme    /digego/extempore/tree/v0.8.9/libs/core/pc_ivl.xtm
  • pcg32_boundedrand_r    xtlang    /digego/extempore/tree/v0.8.9/libs/core/pcg-rng.xtm
  • pop-handler    scheme    /digego/extempore/tree/v0.8.9/runtime/init.xtm
  • push-handler    scheme    /digego/extempore/tree/v0.8.9/runtime/init.xtm
  • random    scheme    /digego/extempore/tree/v0.8.9/runtime/scheme.xtm
  • random    xtlang    /digego/extempore/tree/v0.8.9/libs/core/adt.xtm
  • random-next    scheme    /digego/extempore/tree/v0.8.9/runtime/init.xtm
  • read_and_write_frame    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/opencv_test.xtm
  • repeat_And_Wrap_String    xtlang    /digego/extempore/tree/v0.8.9/examples/core/fasta_lang_shootout.xtm
  • set_width_and_height    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/horde3d_knight.xtm
  • xt_pcg32_random    xtlang    /digego/extempore/tree/v0.8.9/libs/core/pcg-rng.xtm
  • xt_pcg32_random_r    xtlang    /digego/extempore/tree/v0.8.9/libs/core/pcg-rng.xtm
  • xt_pcg32_srandom    xtlang    /digego/extempore/tree/v0.8.9/libs/core/pcg-rng.xtm
  • xt_pcg32_srandom_r    xtlang    /digego/extempore/tree/v0.8.9/libs/core/pcg-rng.xtm
  • xtm-setup-and-start-gl-loop    scheme    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline-scm.xtm
  • xtm_scale_and_draw_vgimage    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/openvg.xtm
  • xtm_scale_and_draw_vgimaged    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/openvg.xtm
  • xtmdoc-builtin-handler    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • xtmdoc-closure-handler    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • xtmdoc-genericfunc-handler    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • xtmdoc-generictype-handler    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • xtmdoc-globalvar-handler    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • xtmdoc-namedtype-handler    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • xtmdoc-nativefunc-handler    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • xtmdoc-polyfunc-handler    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • xtmdoc-polytype-handler    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • xtmdoc-scheme-function-handler    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • xtmdoc-scheme-macro-handler    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • xtmdoc-typealias-handler    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm