Skip to content

Idea: database structure/tree #520

@Bjoernsen

Description

@Bjoernsen

We (KWS SAAT SE & Co. KGaA) like your Sequenceserver very much. Unfortunately, we have several hundreds of blast databases. Using the default Sequenceserver list does not work for us.

This was the reason why I tried to implement jstree (https://www.jstree.com) and a data/folder structure to group the databases.
Because some/many of the databases might belong to different groups, we have a raw data folder where all files are located in and a Sequence server data folder with many subfolders that only include symbolic links.

To explain everything, I created a new example data structure including some randomly selected databases.

The folder structure:
folder_structure

The raw_data folder including the fasta and blast files:
raw_data_folder

The data folder used by the Sequenceserver only includes symbolic links:
data_folder

The resulting tree shown in the Sequenceserver mimics 1:1 the folder structure. This makes it easy for everyone to define their specific tree structure. Furthermore, it is possible to use the search field next to e.g. ‘Nucleotide databases’:
tree

I forked your project and created a new branch ‘tree’. See https://github.com/bjoern-hammesfahr/sequenceserver/tree/tree

Unfortunately, I do not know React and my time was limited. Furthermore, I did not want to introduce to many changes, therefore I hide your database list and simulate a selection when a db gets selected in the tree.

Maybe this idea is helpful for you and it would be possible to implement it to the Sequenceserver.

My changes:

  • package.json: add jstree (line 35)
  • public/config.json: add jstree (line 30)
  • public/vendor: automatically changed?
  • public/js/search.js
    • add jstree (line 4)
    • add key tree to getInitialState (line 210)
    • add data['tree'] to setStage (line 230)
    • add timeout that clicks the hstree:div after 1s (line 241:244)
    • add tree={this.state.tree} to Databases (line 344)
    • add function handleLoadTree to load the tree (line 687:729)
    • add id database_list to div panel panel-default (line 770)
    • add this.renderDatabaseSearch(category) to add the nucleotide/protein searches (line 773:775)
    • hide the button (line 776) and the ul (line 781) because of time and to reduce the number of changes
    • add this.renderDatabaseTree(category) to add the nucleotide/protein trees (line 793:795)
    • add function renderDatabaseSearch to render the search (line 800:814)
    • add function renderDatabaseTree to render the tree (line 816:833)
  • public/css/sequenceserver.css: add jstree (line 8)
  • lib/sequenceserver/database.rb
    • add categories to Database stucture (line 22)
    • add method tree to prepare the tree data (line 105:125)
    • determine_formatted_fastas: change line.split(' ') to line.split("\t"), because this did not work for us (line 122)
    • determine_formatted_fastas: add get_categories (line 124)
    • add method get_categories to get the category for each fasta db (line 281:285)
  • lib/sequenceserver/routes.rb: add tree to searchdata.json (line 79)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions