Created
January 16, 2019 19:38
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
class Gene | |
def init(line = ""): | |
for pair in line.split(";"): | |
splits = pair.split(" ") | |
if len(splits) == 2: | |
key = pair.split(" ")[0] | |
value = pair.split(" ")[1] # TODO add some code to remove the quotes from the result | |
self.data[key] = data | |
def get(field): | |
return self.data[field] | |
# Load the file and create genes | |
genes = [] | |
with open('path/to/gene-file') as fp: | |
for count, line in enumerate(fp): | |
genes.append(Gene(line)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment