Skip to content

Commit

Permalink
multiple AC lines
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruibin-Liu committed Dec 15, 2023
1 parent 94b529e commit 77700cb
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions pyuniprot/Uniprot.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,10 +302,16 @@ def _get_category_lines(self) -> None:
aa_length = int(items[2])
content_dict["ID"] = ID(entry_name, is_reviewed, aa_length)
elif line.startswith("AC"):
items = line[2:-1].split()
primary_accession = items[0]
secondary_accessions = [i.strip(";") for i in items[1:]]
content_dict["AC"] = AC(primary_accession, secondary_accessions)
accessions: list[str] = []
while line.startswith("AC"):
items = line[2:-1].split()
accessions.extend(items)
line = u_file.readline()
accessions = [i.strip(";") for i in accessions]
primary_accession = accessions[0]
accessions.remove(primary_accession)
content_dict["AC"] = AC(primary_accession, accessions)
continue
elif line.startswith("DT"):
history_lines: list[tuple[date, str]] = []
date_format = "%d-%b-%Y"
Expand Down

0 comments on commit 77700cb

Please sign in to comment.