Skip to content
Snippets Groups Projects
Commit 7bc8e683 authored by jkvis's avatar jkvis Committed by Vermaat
Browse files

Added extractor_loader.py to load DNA sequences from RAW files and put them...

Added extractor_loader.py to load DNA sequences from RAW files and put them through the Desciption Extractor
parent 36a7657d
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env python
import sys
import json
import describe
class MyEncoder(json.JSONEncoder):
def default(self, o):
return o.__dict__
def main():
if len(sys.argv) < 3:
print "usage: " + sys.argv[0] + " reference sample"
exit()
#if
f = open(sys.argv[1], "r")
ref = f.read()
f.close()
f = open(sys.argv[2], "r")
alt = f.read()
f.close()
extracted_allele = describe.describe(ref, alt)
print describe.extractor.VERSION
print "HGVS: " + describe.allele_description(extracted_allele)
print "JSON: " + json.dumps({"reference_sequence": ref, "sample_sequence": alt, "allele_description": extracted_allele}, cls=MyEncoder)
#main
if __name__ == "__main__":
main()
#!/usr/bin/env python
import json
import describe
class MyEncoder(json.JSONEncoder):
def default(self, o):
return o.__dict__
def main():
ref = "ACGTCGATTCGCTAGCTTCGGGGGATAGATAGAGATATAGAGATATTTTT"
alt = "ACGTCGGTTCGCTAGCTTCGGGGGATAGATAGATATATAGAGATATTTTT"
extracted_allele = describe.describe(ref, alt)
print extracted_allele
print describe.allele_description(extracted_allele)
print json.dumps({"reference_sequence": ref, "sample_sequence": alt,
"allele_description": extracted_allele}, cls=MyEncoder)
#main
if __name__ == "__main__":
main()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment