This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns specfn.core | |
(:require [clojure.spec :as s] | |
[clojure.spec.test :as t])) | |
(defn- spec-symbols [s] | |
(->> s | |
(drop 1) | |
(partition-all 2) | |
(map first) | |
(map name) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Example for https://www.biostars.org/p/193145 | |
import pybedtools | |
import pysam | |
# Use an example BAM file included with pybedtools | |
fn = pybedtools.example_filename('x.bam') | |
bam = pysam.Samfile(fn, 'r') | |
# Filter reads using pysam. Since all aspects of the SAM-format read |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns dt.core | |
(:require [datascript.core :as d])) | |
;; schema so nice | |
(def schema {:maker/email {:db/unique :db.unique/identity} | |
:car/model {:db/unique :db.unique/identity} | |
:car/maker {:db/type :db.type/ref} | |
:car/colors {:db/cardinality :db.cardinality/many}}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%%file _chi2.c | |
#include <Python.h> | |
#include <numpy/arrayobject.h> | |
#include "chi2.h" | |
static char module_docstring[] = | |
"This module provides an interface for calculating chi-squared using C."; | |
static char chi2_docstring[] = | |
"Calculate the chi-squared of some data given a model."; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <htslib/sam.h> | |
int main(int argc, char *argv[]){ | |
samFile *fp_in = hts_open(argv[1],"r"); //open bam file | |
bam_hdr_t *bamHdr = sam_hdr_read(fp_in); //read header | |
bam1_t *aln = bam_init1(); //initialize an alignment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns sql-like-join | |
(:require [clojure.set :refer [difference | |
intersection | |
union]])) | |
(defn inner-join | |
[left-keys right-keys] | |
(intersection (set left-keys) (set right-keys))) | |
(defn outer-join |
Arrange files like this:
apple/
__init__.py
apple.py
tests/
test_everything.py
In Clojure you can apply destructuring within either a let
binding list; function parameter list or even a macro.
A simple example would be:
(def coords [5 7]) ; define a symbol "coords" that points to a vector [5 7]
(let [[x y] coords] (println "x:" x "y:" y))
; => x: 5 y: 7
People
![]() :bowtie: |
π :smile: |
π :laughing: |
---|---|---|
π :blush: |
π :smiley: |
:relaxed: |
π :smirk: |
π :heart_eyes: |
π :kissing_heart: |
π :kissing_closed_eyes: |
π³ :flushed: |
π :relieved: |
π :satisfied: |
π :grin: |
π :wink: |
π :stuck_out_tongue_winking_eye: |
π :stuck_out_tongue_closed_eyes: |
π :grinning: |
π :kissing: |
π :kissing_smiling_eyes: |
π :stuck_out_tongue: |