-
Notifications
You must be signed in to change notification settings - Fork 0
Biom File
Iroki uses biom files to make color gradients for you tree.
The biom file is a widely used format for representing biological sample data in table format. Biom files can be stored in a variety of formats including json, hdf5, and tab separated plain text files. Iroki currently is only compatible with tab separated biom files.
See here for more info on the biom format.
If you have a biom file from Qiime for example, you can convert the biom file to the tab-separated version readable by Iroki using the following command
biom convert --input-fp otus.biom --output-fp otus.biom.tsv --to-tsv --table-type "OTU table"
If you don't have the biom program, you can find instructions on installing it here.
The tab-separated biom file format is very eary to make yourself even if you are not using any program that outputs them. Here is an example:
| #Sequence Name | Sample 1 | Sample 2 |
|---|---|---|
| s1 | 23 | 15 |
| s2 | 50 | 34 |
| s3 | 0 | 10 |
The first column holds the names of the sequences, OTUs, or whatever the terminal nodes of your tree are. The remaining columns contain numerical data (observations, counts, abundance, whatever) for each of the samples in your study.
Let's look at some examples of using biom files with Iroki to make some cool abundance-based color gradients.
The newick tree looks like this
((a1,a2,a3),(b1,b2,b3),(c1,c2,c3));
And the biom file looks like this
| #Name | Sample 1 | Sample 2 |
|---|---|---|
| a1 | 10 | 0 |
| a2 | 5 | 0 |
| a3 | 1 | 0 |
| b1 | 7 | 5 |
| b2 | 5 | 5 |
| b3 | 5 | 7 |
| c1 | 0 | 10 |
| c2 | 0 | 5 |
| c3 | 0 | 1 |
And the Iroki command
iroki -bte --biom biom_example.two_sample.biom --infile biom_example.newick --outfile biom_example.two_sample.nexus
And this is how it looks!

HHH's pro tip!: If you have one sample that where the nodes with highest abundance also have a high abundance relative to the other sample, put that sample in column 1, and you will get a nice greenish tree.
Of course this is a contrived example to show you how things look.
So what's going on with this?
Sequences that are only present in Sample 1 are green (#00ff00). Those that are only in Sample 2 are blue (#0000ff). Those sequences that have the same abundance in both Sample 1 and Sample 2 are cyan (#00ffff), which is the exact light mixture of the green and blue. Sequences that are in between fall in the green-blue color gradient.
In this tree the a, sequences are only present in Sample 1, so they are blue, with the darker blue reprenting sequences at higher abundance in that sampl. The c sequences are the same but for Sample 2. And the b sequences are present in both samples. b1 is more abundant in Sample 1 so it is greener, b2 is equally abundant in both, so it is a shade of cyan, and b3 is more abundant in Sample 2 so it is more blue than green.