Skip to content

Instantly share code, notes, and snippets.

Hacking away

Samuel Lampa samuell

Hacking away
View GitHub Profile
samuell / Drugbank parse to DB
Created Mar 2, 2018 — forked from sgsfak/Drugbank parse to DB
Parse DrugBank XML file with xmlstarlet
We couldn’t find that file to show.
View gc_count.exs
defmodule ATGCCount do
def count(sequence), do: cnt(String.to_char_list(sequence),0,0)
def cnt([65|t],at,gc), do: cnt(t,at+1,gc)
def cnt([84|t],at,gc), do: cnt(t,at+1,gc)
def cnt([71|t],at,gc), do: cnt(t,at,gc+1)
def cnt([67|t],at,gc), do: cnt(t,at,gc+1)
def cnt([62|_],at,gc), do: {at,gc}
def cnt([],at,gc), do: {at,gc}
# def cnt(_,0,0), do: {0,0}
def cnt([_|t], at, gc), do: cnt(t,at,gc)
View gist:fbc4671f29e09714d304
  1. General Background and Overview
You can’t perform that action at this time.