Skip to content
Permalink
ad7c3cc84b
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
21 lines (16 sloc) 657 Bytes
import csv
class Parser:
def __init__(self):
self.annotation = {}
def read_plaza_interpro(self, filename):
with open(filename) as csvfile:
reader = csv.DictReader(csvfile, delimiter=';')
for row in reader:
gene = row['gene_id']
domain = {"id": row['motif_id'],
"start": row['start'],
"stop": row['stop']}
if gene not in self.annotation.keys():
self.annotation[gene] = []
if domain not in self.annotation[gene]:
self.annotation[gene].append(domain)