Skip to content
Jean-Baptiste edited this page May 31, 2020 · 29 revisions

The trickiest part of using BioWeb3D is to generate the files that the application can read (and it's not that bad !). The format of those files is up to you, you can choose :

  • A quick and easy approach with less options (CSV).
  • A structured approached a bit more complicated but with more options (JSON official website).
  • Another option to input structured data is to use XML (official website)

dataset files

When the user adds a new Dataset file, a new Dataset section is created in the "Data" panel of the application. One dataset file contains one dataset. The dataset is composed only of 3D coordinates (x,y,z) along with a small amount of additional information (e.g., an optional name, an optional "chain" that has to be set to true to link the points together). Below is an example of a minimal 3 point dataset file:

{ "dataset" : {
      "name" : "my superb dataset",
      "chain" : true,
      "points" : [
          [
            0.5,
            100,
            -50.5
          ],
          [
            200,
            10,
            0.0
          ],
          [
            3,
            250.15,
            15
          ]
        ]
     }
}

The exact equivalent of the previous Json file translated in XML will be :

<?xml version="1.0" ?>
<dataset>
	<name>my superb dataset</name>	
	<chain>true</chain>
	<points>
		<point>
			<x>0.5</x>
			<y>100</y>
			<z>-50.5</z>
		</point>

		<point>
			<x>200</x>
			<y>10</y>
			<z>0.0</z>
		</point>

		<point>
			<x>3</x>
			<y>250.15</y>
			<z>15</z>
		</point>
	</points>
</dataset>

You can also input you file directly in CSV if it more convenient for you. The same dataset in CSV format is :

0.5,100,-50.5
200,10,0.0
3,250.15,15

Note that you can't use the "name" or "chain" properties in CSV

Information layer files

The Information layer file contains information about the points described in the Dataset file. The information entered in this file has to be inputted in the same order as the points defined in the Dataset file. Multiple information layers can be defined in the same file as follows::

  • a name
  • a number of categories called numClass
  • A list of labels for the clusters (optional)

For example coming back to the 3 points defined previously, two information layers could correspond to:

  • one clustering algorithm that puts the first two points together in class one and the third point alone in a second class
  • a second clustering algorithm that puts each point in a separate class

In this case the Information layer file would look like:

{ "information" :
  [
    {
      "name": "clustering algo 1",
      "numClass": "2",
      "labels" : [
        "Category 1",
        "Category 2"
      ],
      "values": [
        1,
        1,
        2
      ]
    },
    {
      "name": "clustering algo 2",
      "numClass": "3",
      "values": [
        1,
        2,
        3
      ]
    }
  ]
}

The exact equivalent of the previous Json file translated in XML will be :

<?xml version="1.0" ?>
<information>
	<set>
		<name>Clustering Algo 1</name>
		<numClass>2</numClass>
		<labels>
			<label>Category 1</label>
			<label>Category 2</label>
		</labels>
		<values>
			<value>1</value>
			<value>1</value>
			<value>2</value>
		</values>
	</set>
	<set>
		<name>Clustering Algo 2</name>
		<numClass>3</numClass>
		<values>
			<value>1</value>
			<value>2</value>
			<value>3</value>
		</values>
	</set>
</information>

You can also input the information layer file with a CSV format. In this format each column is a different information layer. So for the same two layers as the previous JSON example, the CSV would look like :

1,1
1,2
2,3

Note that you can't use the "name" or "labels" properties in CSV

Do I have to put everything in two files ?

No, you can upload separately different datasets and multiple cluster sets.

Where can I find example files ?

Here !

Contribute to bioWeb3D

You like bioWeb3D and want to make it better? Check out the page HOWTO Contribute to bioWeb3D