Skip to content

Commit

Permalink
better cosmic parsing of cosm id page
Browse files Browse the repository at this point in the history
  • Loading branch information
davidvanzessen committed Feb 17, 2023
1 parent 6b59ec0 commit 8b8c59c
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions sources/cosmic.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from bs4 import BeautifulSoup

from search import parse_search
from search import parse_cdot, parse_pdot

from .source_result import Source, SourceURL

Expand Down Expand Up @@ -111,7 +111,14 @@ async def gene_cdot(self):
self.html_links["main"] = SourceURL("Go", cosmic_variant_url)

resp, cosmic_text = await self.async_get_text(cosmic_variant_url)
self.new_variant_data.update(parse_search(cosmic_text))

self.new_variant_data.update(parse_cdot(cosmic_text))
if "cdot_ref" in self.new_variant_data:
self.new_variant_data["ref"] = self.new_variant_data["cdot_ref"]
if "cdot_alt" in self.new_variant_data:
self.new_variant_data["alt"] = self.new_variant_data["cdot_alt"]

self.new_variant_data.update(parse_pdot(cosmic_text))

cosmic_count = aa_data[4]
self.html_text = f"<p class='h6'>Count: {cosmic_count}</p>"
Expand Down

0 comments on commit 8b8c59c

Please sign in to comment.