Skip to content

Instantly share code, notes, and snippets.

@tpapp
Created December 8, 2016 07:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tpapp/0c5edb91afb1c72a9aef1c1376034453 to your computer and use it in GitHub Desktop.
Save tpapp/0c5edb91afb1c72a9aef1c1376034453 to your computer and use it in GitHub Desktop.
countingVMZ
using AMDB
using DataStructures
using GZip
using UnicodePlots
# if we want to pass around code, extend it with your own machine name
# (gethostname# ()) and path
AMDB_path = get(Dict("tamas" =>
"/home/tamas/research/AMDB/data/AMDB_subsample.jls.gz"),
gethostname(),
"/Users/emmamckeown/Documents/Thesis/AMDB_subsample.jls.gz")
records = GZip.open(deserialize, AMDB_path, "r")
long_samples = [data for (id,data) in records if length(data.AMP_spells) > 1000]
length(long_samples) # 6
# let's look at the first one
f = long_samples[1].VMZ_spells
unique(spell.status for spell in f) # about 3 stauses
# let's count them
c1 = counter(Tuple{VMZ.Spell,VMZ.Einstellgrund}) # CHANGED HERE
for spell in f
push!(c1, (spell.status, spell.discontinuation))
end
c1.map
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment