Skip to content

Instantly share code, notes, and snippets.

@abloom
Created January 16, 2019 19:38
Show Gist options
  • Save abloom/2bc6935ff422f5f8a95582a459dad73c to your computer and use it in GitHub Desktop.
Save abloom/2bc6935ff422f5f8a95582a459dad73c to your computer and use it in GitHub Desktop.
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