Skip to content

Commit 617dd77

Browse files
committedSep 2, 2024
Split '_' in names
Seems that in the text search the "_" is treated as a word character. This means we don't get the sort of partial matches we would like. This should fix that, but may require some tweaking.
1 parent 14afc1d commit 617dd77

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed
 

‎scripts/export/rfam_xml_dumper.py

+5-7
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,17 @@
2020
import timeit
2121
import traceback
2222
import xml.etree.ElementTree as ET
23-
from sets import Set
2423
from xml.dom import minidom
2524

2625
import django
27-
2826
from config import rfam_config as rfc
2927
from config import rfam_search as rs
30-
from config.rfam_config import RFAMREL, RFAMLIVE
28+
from config.rfam_config import RFAMLIVE, RFAMREL
29+
from rfam_schemas.RfamLive.models import Genome, Genseq
30+
from sets import Set
3131
from utils import RfamDB
3232
from utils.parse_taxbrowser import *
3333

34-
from rfam_schemas.RfamLive.models import Genseq, Genome
35-
3634
"""
3735
Description: This module exports Rfam data for the search engine
3836
@@ -237,10 +235,10 @@ def family_xml_builder(name_dict, name_object, entries, rfam_acc=None, hfields=T
237235
entry = ET.SubElement(entries, "entry", id=rfam_acc)
238236

239237
# entry name
240-
ET.SubElement(entry, "name").text = str(fam_fields["name"])
238+
ET.SubElement(entry, "name").text = str(fam_fields["name"]).replace("_", " ")
241239

242240
# entry description
243-
ET.SubElement(entry, "description").text = str(fam_fields["description"])
241+
ET.SubElement(entry, "description").text = str(fam_fields["description"]).replace("_", " ")
244242

245243
# entry dates - common to motifs and clans
246244
dates = ET.SubElement(entry, "dates")

0 commit comments

Comments
 (0)