Skip to content

Instantly share code, notes, and snippets.

@countdigi
Created March 17, 2020 18:44
Show Gist options
  • Save countdigi/c75ead34a3f930281580f67e7cb20c54 to your computer and use it in GitHub Desktop.
Save countdigi/c75ead34a3f930281580f67e7cb20c54 to your computer and use it in GitHub Desktop.
Analyzing RsMergeArch
#!/usr/bin/env python3
import gzip
import os
import sys
import collections
def load_rsmerge_records(fname):
fields = ["rshigh", "rslow", "build_id", "orien", "create_time", "last_updated_time", "rscurrent", "orien2current", "comment"]
Record = collections.namedtuple("Record", fields)
with gzip.open(fname, "rt", encoding="utf-8") as f:
for line in f:
fields = line.rstrip("\n").split("\t")
yield Record(*fields)
def main(argv):
rsmerge_fname = "/shares/hii/bioinfo/ref/ncbi/human_9606/2020/RsMergeArch.bcp.gz"
records = []
db = {}
records = list(load_rsmerge_records(rsmerge_fname))
for r in records:
db[r.rshigh] = r
if __name__ == "__main__":
main(sys.argv)
# Record(rshigh='10674', rslow='3789', build_id='85', orien='0', create_time='2000-09-19 14:28:00.0', last_updated_time='2015-03-10 18:18:07.857', rscurrent='1228', orien2current='0', comment='[orien] estimaded per JIRA:SNP-7510')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment