<commit_before>#BioChemicalEntity: "Protein", "Gene_or_gene_product", "Simple_chemical", "Complex", "GENE"
#MacroMolecule: "Protein", "Gene_or_gene_product", "Complex", "GENE"

#- name: amino_acid
#  label: Gene_or_gen_product
#  priority: 3
#  type: token
#  pattern: |
#    [word=/(?i)alanine|arginine|asparagine|aspartic acid|cysteine|glutamic acid|glutamine|glycine|histidine|isoleucine|leucine|lysine|methionine|phenylalanine|proline|serine|threonine|tryptophan|tyrosine|valine/ & !mention=/./]

- name: site_long
  label: Site
  priority: 1
  type: token
  pattern: |
    [word = /(?i)^(glycine|phenylalanine|leucine|serine|tyrosine|cysteine|tryptophan|proline|histidine|arginine|soleucine|methionine|threonine|asparagine|lysine|serine|arginine|valine|alanine|aspartate|glutamate|glycine)$/]
    [word = /acid/]?
    [word = /(?i)residue/]?
    [word = /\d{3}$/]?

- name: site_1letter
  label: Site
  priority: 1
  type: token
  pattern: |
    [word=/(?i)^[ACDEFGHIKLMNQRSTVWY]\d+[ACDEFGHIKLMNPQRSTVWY]?$/] [word=/mutant/]? |
    /^P\d+[ACDEFGHIKLMNPQRSTVWYacdefghiklmnpqrstvwy]?$/ [word=/mutant/]?

- name: site_3letter
  label: Site
  priority: 1
  type: token
  pattern: |
   [word=/(?i)^(Ala|Arg|Asn|Asp|Cys|Gln|Glu|Gly|His|Ile|Leu|Lys|Met|Phe|Pro|Ser|Thr|Trp|Tyr|Val)\d+(Ala|Arg|Asn|Asp|Cys|Gln|Glu|Gly|His|Ile|Leu|Lys|Met|Phe|Pro|Ser|Thr|Trp|Tyr|Val)?$/]
   [word=/mutant/]?

#- name: site_3letterALT1
#  label: Site
#  priority: 1
#  type: token
#  pattern: |
#   [word=/(?i)^(Ala|Arg|Asn|Asp|Cys|Gln|Glu|Gly|His|Ile|Leu|Lys|Met|Phe|Pro|Ser|Thr|Trp|Tyr|Val)([-0-9]+)?/]
#   [word=mutant]?

- name: site_3letterALT
  label: Site
  priority: 1
  type: token
  pattern: |
   [word=/(?i)^(Ala|Arg|Asn|Asp|Cys|Gln|Glu|Gly|His|Ile|Leu|Lys|Met|Phe|Pro|Ser|Thr|Trp|Tyr|Val)$/]
   [word=/residue/]?
   [word=/\d+/]

- name: site_fragment
  label: Site
  priority: 1
  type: token
  example: "Under the same conditions, ASPP2 (693-1128) fragment phosphorylated by p38 SAPK had very low levels of incorporated 32P"
  pattern: |
    "("
    /^\d+-\d+$/
    ")"
    "fragment"

- name: site_domain
  label: Site
  priority: 1
  type: token
  pattern: |
    /\(/? /^[A-Z0-9-]+$/ /\)/? /domain/

# - name: multi_site
#   label: Multiple_sites
#   priority: 3
#   type: token
#   action: mkMultiSite
#   pattern: |
#     (?<parent> [mention=Site]) [word=/,|and/ | tag=CD]+ (?<site> [tag=CD])

# - name: protein_with_site_token_1
#   label: Protein_with_site
#   priority: 3
#   type: token
#   action: mkComplexEntity
#   pattern: |
#     (?<site> [mention=Site]) [tag=IN] (?<protein> [mention=/^(Protein|Gene_or_gene_product)$/] ([tag=/(,|CC)/]+ [mention=/^(Protein|Gene_or_gene_product)$/])*)
#       |
#     (?<protein> [mention=/^(Protein|Gene_or_gene_product)$/]) [tag=IN] (?<site> [mention=Site] ([tag=/(,|CC)/]+ [mention=Site])*)

# - name: site_with_protein_syntax_1
#   label: Protein_with_site
#   priority: 3
#   type: dependency
#   action: mkProteinWithSiteSyntax
#   pattern: |
#     trigger: [mention=Site]
#     protein: /pobj|prep_|conj|nn/+ [mention=/^Protein$|^Gene_or_gene_product$/]  # can't use a conj_nor.   There must be other bad conjunctions.

# - name: protein_with_site_syntax_1
#   label: Protein_with_site
#   priority: 3
#   type: dependency
#   action: mkProteinWithSiteSyntax
#   pattern: |
#     trigger: [mention=/^Protein$|^Gene_or_gene_product$/]
#     site: /pobj|prep_|conj_[^n]|nn/+ [mention=Site] # can't use a conj_nor.   There must be other bad conjunctions.

- name: simple_chem
  label: [Simple_chemical, BioChemicalEntity]
  priority: 1
  type: token
  pattern: |
    /(?i)^(GDP|GTP|ATP|ADP|adenine|adenosine|guanine|guanosine)(-(ribose|methyl|acetyl))?$/ /(?i)group/?
      |
    /(?i)fatty/ /(?i)acid/
      |
    # Radioactive forms of GDP and GTP used in experiments.
    # Capturing 32P-GDP, 32P-GTP, 33P-GDP, and 33P-GTP should be enough.
    # (32P and 33P are the only useful isotopes of phosphorus, and 32P is much more common in laboratory usage.)
     /^\d\d*?P-G[DT]P/

- name: acid
  label: [Gene_or_gene_product, MacroMolecule, BioChemicalEntity]
  priority: 2
  type: token
  pattern: |
    [word = /(?i)^(glycine|phenylalanine|leucine|serine|tyrosine|cysteine|tryptophan|proline|histidine|arginine|soleucine|methionine|threonine|asparagine|lysine|serine|arginine|valine|alanine|aspartate|glutamate|glycine)/ & !word=/-rich/ & !mention=/./]

- name: HER_default
  label: [Protein, MacroMolecule, BioChemicalEntity]
  priority: 1<commit_msg>Fixed Protein_with_site rules using Odin2 syntax.<commit_after>#BioChemicalEntity: "Protein", "Gene_or_gene_product", "Simple_chemical", "Complex", "GENE"
#MacroMolecule: "Protein", "Gene_or_gene_product", "Complex", "GENE"

#- name: amino_acid
#  label: Gene_or_gen_product
#  priority: 3
#  type: token
#  pattern: |
#    [word=/(?i)alanine|arginine|asparagine|aspartic acid|cysteine|glutamic acid|glutamine|glycine|histidine|isoleucine|leucine|lysine|methionine|phenylalanine|proline|serine|threonine|tryptophan|tyrosine|valine/ & !mention=/./]

- name: site_long
  label: Site
  priority: 1
  type: token
  pattern: |
    [word = /(?i)^(glycine|phenylalanine|leucine|serine|tyrosine|cysteine|tryptophan|proline|histidine|arginine|soleucine|methionine|threonine|asparagine|lysine|serine|arginine|valine|alanine|aspartate|glutamate|glycine)$/]
    [word = /acid/]?
    [word = /(?i)residue/]?
    [word = /\d{3}$/]?

- name: site_1letter
  label: Site
  priority: 1
  type: token
  pattern: |
    [word=/(?i)^[ACDEFGHIKLMNQRSTVWY]\d+[ACDEFGHIKLMNPQRSTVWY]?$/] [word=/mutant/]? |
    /^P\d+[ACDEFGHIKLMNPQRSTVWYacdefghiklmnpqrstvwy]?$/ [word=/mutant/]?

- name: site_3letter
  label: Site
  priority: 1
  type: token
  pattern: |
   [word=/(?i)^(Ala|Arg|Asn|Asp|Cys|Gln|Glu|Gly|His|Ile|Leu|Lys|Met|Phe|Pro|Ser|Thr|Trp|Tyr|Val)\d+(Ala|Arg|Asn|Asp|Cys|Gln|Glu|Gly|His|Ile|Leu|Lys|Met|Phe|Pro|Ser|Thr|Trp|Tyr|Val)?$/]
   [word=/mutant/]?

#- name: site_3letterALT1
#  label: Site
#  priority: 1
#  type: token
#  pattern: |
#   [word=/(?i)^(Ala|Arg|Asn|Asp|Cys|Gln|Glu|Gly|His|Ile|Leu|Lys|Met|Phe|Pro|Ser|Thr|Trp|Tyr|Val)([-0-9]+)?/]
#   [word=mutant]?

- name: site_3letterALT
  label: Site
  priority: 1
  type: token
  pattern: |
   [word=/(?i)^(Ala|Arg|Asn|Asp|Cys|Gln|Glu|Gly|His|Ile|Leu|Lys|Met|Phe|Pro|Ser|Thr|Trp|Tyr|Val)$/]
   [word=/residue/]?
   [word=/\d+/]

- name: site_fragment
  label: Site
  priority: 1
  type: token
  example: "Under the same conditions, ASPP2 (693-1128) fragment phosphorylated by p38 SAPK had very low levels of incorporated 32P"
  pattern: |
    "("
    /^\d+-\d+$/
    ")"
    "fragment"

- name: site_domain
  label: Site
  priority: 1
  type: token
  pattern: |
    /\(/? /^[A-Z0-9-]+$/ /\)/? /domain/

# - name: multi_site
#   label: Multiple_sites
#   priority: 3
#   type: token
#   action: mkMultiSite
#   pattern: |
#     (?<parent> [mention=Site]) [word=/,|and/ | tag=CD]+ (?<site> [tag=CD])

- name: protein_with_site_token_1
  label: [Protein_with_site, BioChemicalEntity]
  priority: 3
  type: token
  pattern: |
    @site:Site [tag=IN] (?<protein> [mention=/^(Protein|Gene_or_gene_product)$/] ([tag=/(,|CC)/]+ [mention=/^(Protein|Gene_or_gene_product)$/])*)
      |
    @protein:BioChemicalEntity [tag=IN] (?<site> [mention=Site] ([tag=/(,|CC)/]+ [mention=Site])*)

- name: site_with_protein_syntax_1
  label: [Protein_with_site, BioChemicalEntity]
  priority: 3
  pattern: |
     site:Site
     protein:BioChemicalEntity = /pobj|prep_|conj|nn/+ # can't use a conj_nor.   There must be other bad conjunctions.

- name: protein_with_site_syntax_1
  label: [Protein_with_site, BioChemicalEntity]
  priority: 3
  pattern: |
    protein:BioChemicalEntity
    site:Site = /pobj|prep_|conj_[^n]|nn/+ # can't use a conj_nor.   There must be other bad conjunctions.

- name: simple_chem
  label: [Simple_chemical, BioChemicalEntity]
  priority: 1
  type: token
  pattern: |
    /(?i)^(GDP|GTP|ATP|ADP|adenine|adenosine|guanine|guanosine)(-(ribose|methyl|acetyl))?$/ /(?i)group/?
      |
    /(?i)fatty/ /(?i)acid/
      |
    # Radioactive forms of GDP and GTP used in experiments.
    # Capturing 32P-GDP, 32P-GTP, 33P-GDP, and 33P-GTP should be enough.
    # (32P and 33P are the only useful isotopes of phosphorus, and 32P is much more common in laboratory usage.)
     /^\d\d*?P-G[DT]P/

- name: acid
  label: [Gene_or_gene_product, MacroMolecule, BioChemicalEntity]
  priority: 2
  type: token
  pattern: |
    [word = /(?i)^(glycine|phenylalanine|leucine|serine|tyrosine|cysteine|tryptophan|proline|histidine|arginine|soleucine|methionine|threonine|asparagine|lysine|serine|arginine|valine|alanine|aspartate|glutamate|glycine)/ & !word=/-rich/ & !mention=/./]

- name: HER_default
  label: [Protein, MacroMolecule, BioChemicalEntity]
  priority: 1
{'fraction_non_alphanumeric': 0.17477825790311577, 'fraction_numerical': 0.012394814646349783, 'mean_word_length': 4.674193548387096, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6894231', 'n_tokens_mistral': 4029, 'n_tokens_neox': 3585, 'n_words': 587}