Skip to content

ipr.summary

OTHER_DISEASES

OTHER_DISEASES = 'other disease types'

ENTREZ_GENE_URL

ENTREZ_GENE_URL = 'https://www.ncbi.nlm.nih.gov/gene'

GRAPHKB_GUI

GRAPHKB_GUI = 'https://graphkb.bcgsc.ca'

filter_by_record_class()

Given a list of records, return the subset matching a class or list of classes

def filter_by_record_class(
    record_list: List[Dict], *record_classes, exclude: bool = False
) -> List[Dict]:

Args

  • record_list (List[Dict])

Returns

  • List[Dict]

Create a link for a set of statements to the GraphKB client

def create_graphkb_link(
    record_ids: List[str],
    record_class: str = 'Statement',
) -> str:

Args

  • record_ids (List[str])
  • record_class (str)

Returns

  • str

substitute_sentence_template()

Create the filled-in sentence template for a given template and list of substitutions which may be the result of the aggregation of 1 or more statements

def substitute_sentence_template(
    template: str,
    conditions: List[Record],
    subjects: List[Record],
    relevance: Record,
    evidence: List[Record],
    statement_rids: List[str] = [],
    disease_matches: Set[str] = set(),
) -> str:

Args

  • template (str)
  • conditions (List[Record])
  • subjects (List[Record])
  • relevance (Record)
  • evidence (List[Record])
  • statement_rids (List[str])
  • disease_matches (Set[str])

Returns

  • str

aggregate_statements()

Group Statements that only differ in disease conditions and evidence

def aggregate_statements(
    graphkb_conn: GraphKBConnection,
    template: str,
    statements: List[Statement],
    disease_matches: Set[str],
) -> Dict[str, str]:

Args

  • graphkb_conn (GraphKBConnection)
  • template (str)
  • statements (List[Statement])
  • disease_matches (Set[str])

Returns

  • Dict[str, str]

create_section_html()

Generate HTML for a gene section of the comments

def create_section_html(
    graphkb_conn: GraphKBConnection,
    gene_name: str,
    sentences_by_statement_id: Dict[str, str],
    statements: Dict[str, Statement],
    exp_variants: List[IprVariant],
) -> str:

Args

  • graphkb_conn (GraphKBConnection)
  • gene_name (str)
  • sentences_by_statement_id (Dict[str, str])
  • statements (Dict[str, Statement])
  • exp_variants (List[IprVariant])

Returns

  • str

section_statements_by_genes()

Determine the statements associated with each gene name

def section_statements_by_genes(
    graphkb_conn: GraphKBConnection, statements: Sequence[Statement]
) -> Dict[str, Set[str]]:

Args

  • graphkb_conn (GraphKBConnection)
  • statements (Sequence[Statement])

Returns

  • Dict[str, Set[str]]

summarize()

Given a list of GraphKB matches generate a text summary to add to the report

def summarize(
    graphkb_conn: GraphKBConnection,
    matches: Sequence[KbMatch],
    disease_name: str,
    variants: List[IprVariant],
) -> str:

Args

  • graphkb_conn (GraphKBConnection)
  • matches (Sequence[KbMatch])
  • disease_name (str)
  • variants (List[IprVariant])

Returns

  • str
Back to top