We will be offering mothur and R workshops throughout 2019. Learn more.

Get.relabund

From mothur
Jump to: navigation, search

The get.relabund command calculates the relative abundance of each otu in a sample. It outputs a .relabund file.

Default Settings

mothur > make.shared(list=abrecovery.fn.list, group=abrecovery.groups)
mothur > get.relabund(shared=abrecovery.fn.shared)

scale

The scale parameter allows you to select what scale you would like to use. Choices are totalgroup, totalotu, averagegroup, averageotu, default is totalgroup.

totalgroup

Abundance / Total number of sequences in the group.

mothur > get.relabund(shared=abrecovery.fn.shared, label=unique-0.03-0.05-0.10, scale=totalgroup)

In the file abrecovery.fn.relabund you would see something like:

unique	B 242	0.000000   0.000000   0.000000   0.000000   0.000000	0.011905 ...		
unique	C 242	0.013514   0.013514   0.013514   0.000000   0.013514    0.000000 ...		
unique	A 242	0.000000   0.000000   0.000000   0.011905   0.000000	0.000000 ...		
0.03	B 168	0.000000   0.000000   0.000000	 0.000000   0.000000	0.011905 ...	
0.03	C 168	0.013514   0.013514   0.013514   0.000000   0.013514	0.000000 ...		
0.03	A 168	0.000000   0.000000   0.000000   0.011905   0.000000	0.000000 ...			
0.05	B 138	0.000000   0.000000   0.000000   0.000000   0.000000	0.013514 ...	
0.05	C 138	0.013514   0.013514   0.013514   0.000000   0.013514	0.000000 ...	
0.05	A 138	0.000000   0.000000   0.000000   0.011905   0.000000	0.000000 ...	
0.10	B 112	0.000000   0.000000   0.000000   0.000000   0.000000	0.011905 ...		
0.10	C 112	0.013514   0.013514   0.013514   0.000000   0.013514	0.000000 ...		
0.10	A 112	0.000000   0.000000   0.000000   0.011905   0.000000	0.000000 ...
...


totalotu

Abundance / Total number of sequences in the OTU.


mothur > get.relabund(shared=abrecovery.fn.shared, label=unique-0.03-0.05-0.10, scale=totalotu)

In the file abrecovery.fn.relabund you would see something like:

unique	B 242	0.000000   0.000000   0.000000   0.000000   0.000000	1.000000 ...		
unique	C 242	1.000000   1.000000   1.000000   0.000000   1.000000    0.000000 ...		
unique	A 242	0.000000   0.000000   0.000000   1.000000   0.000000	0.000000 ...		
0.03	B 168	0.000000   0.000000   0.000000	 0.000000   0.000000	1.000000 ...	
0.03	C 168	1.000000   1.000000   1.000000   0.000000   1.000000	0.000000 ...		
0.03	A 168	0.000000   0.000000   0.000000   1.000000   0.000000	0.000000 ...			
0.05	B 138	0.000000   0.000000   0.000000   0.000000   0.000000	1.000000 ...	
0.05	C 138	1.000000   1.000000   1.000000   0.000000   1.000000	0.000000 ...	
0.05	A 138	0.000000   0.000000   0.000000   1.000000   0.000000	0.000000 ...	
0.10	B 112	0.000000   0.000000   0.000000   0.000000   0.000000	1.000000 ...		
0.10	C 112	1.000000   1.000000   1.000000   0.000000   1.000000	0.000000 ...		
0.10	A 112	0.000000   0.000000   0.000000   1.000000   0.000000	0.000000 ...
...


averagegroup

Abundance / (Total number of sequences in the group / Total number of OTU's).

mothur > get.relabund(shared=abrecovery.fn.shared, label=unique-0.03-0.05-0.10, scale=averagegroup)

In the file abrecovery.fn.relabund you would see something like:

unique	B 242	0.000000   0.000000   0.000000   0.000000   0.000000	2.880952 ...		
unique	C 242	3.270270   3.270270   3.270270   0.000000   3.270270    0.000000 ...		
unique	A 242	0.000000   0.000000   0.000000   2.880952   0.000000	0.000000 ...		
0.03	B 168	0.000000   0.000000   0.000000	 0.000000   0.000000	2.000000 ...	
0.03	C 168	2.270270   2.270270   2.270270   0.000000   2.270270	0.000000 ...		
0.03	A 168	0.000000   0.000000   0.000000   2.000000   0.000000	0.000000 ...			
0.05	B 138	0.000000   0.000000   0.000000   0.000000   0.000000	1.642857 ...	
0.05	C 138	1.864865   1.864865   1.864865   0.000000   1.864865	0.000000 ...	
0.05	A 138	0.000000   0.000000   0.000000   1.642857   0.000000	0.000000 ...	
0.10	B 112	0.000000   0.000000   0.000000   0.000000   0.000000	1.333333 ...		
0.10	C 112	1.513514   1.513514   1.513514   0.000000   1.513514	0.000000 ...		
0.10	A 112	0.000000   0.000000   0.000000   1.333333   0.000000	0.000000 ...
...


averageotu

Abundance / (Total number of sequences in the OTU / Number of groups).

mothur > get.relabund(shared=abrecovery.fn.shared, label=unique-0.03-0.05-0.10, scale=averageotu)

In the file abrecovery.fn.relabund you would see something like:

unique	B 242	0.000000   0.000000   0.000000   0.000000   0.000000	3.000000 ...		
unique	C 242	3.000000   3.000000   3.000000   0.000000   3.000000    0.000000 ...		
unique	A 242	0.000000   0.000000   0.000000   3.000000   0.000000	0.000000 ...		
0.03	B 168	0.000000   0.000000   0.000000	 0.000000   0.000000	3.000000 ...	
0.03	C 168	3.000000   3.000000   3.000000   0.000000   3.000000	0.000000 ...		
0.03	A 168	0.000000   0.000000   0.000000   3.000000   0.000000	0.000000 ...			
0.05	B 138	0.000000   0.000000   0.000000   0.000000   0.000000	3.000000 ...	
0.05	C 138	3.000000   3.000000   3.000000   0.000000   3.000000	0.000000 ...	
0.05	A 138	0.000000   0.000000   0.000000   3.000000   0.000000	0.000000 ...	
0.10	B 112	0.000000   0.000000   0.000000   0.000000   0.000000	3.000000 ...		
0.10	C 112	3.000000   3.000000   3.000000   0.000000   3.000000	0.000000 ...		
0.10	A 112	0.000000   0.000000   0.000000   3.000000   0.000000	0.000000 ...
...


label

There may only be a couple of lines in your OTU data that you are interested in finding the relative abundance for. There are two options. You could: (i) manually delete the lines you aren't interested in from your list file; (ii) or use the label option. To use the label option with the get.relabund() command you need to know the labels you are interested in. If you want the relative abundance for the lines labeled unique, 0.03, 0.05 and 0.10 you would enter:

mothur > get.relabund(shared=abrecovery.fn.shared, label=unique-0.03-0.05-0.10)

In the file abrecovery.fn.relabund you would see something like:

unique	B 242	0.000000   0.000000   0.000000   0.000000   0.000000	0.011905 ...		
unique	C 242	0.013514   0.013514   0.013514   0.000000   0.013514    0.000000 ...		
unique	A 242	0.000000   0.000000   0.000000   0.011905   0.000000	0.000000 ...		
0.03	B 168	0.000000   0.000000   0.000000	 0.000000   0.000000	0.011905 ...	
0.03	C 168	0.013514   0.013514   0.013514   0.000000   0.013514	0.000000 ...		
0.03	A 168	0.000000   0.000000   0.000000   0.011905   0.000000	0.000000 ...			
0.05	B 138	0.000000   0.000000   0.000000   0.000000   0.000000	0.013514 ...	
0.05	C 138	0.013514   0.013514   0.013514   0.000000   0.013514	0.000000 ...	
0.05	A 138	0.000000   0.000000   0.000000   0.011905   0.000000	0.000000 ...	
0.10	B 112	0.000000   0.000000   0.000000   0.000000   0.000000	0.011905 ...		
0.10	C 112	0.013514   0.013514   0.013514   0.000000   0.013514	0.000000 ...		
0.10	A 112	0.000000   0.000000   0.000000   0.011905   0.000000	0.000000 ...
...


groups

If you are only interested in the looking at specific samples you could use the groups option:

mothur > get.relabund(shared=abrecovery.fn.shared, groups=B-C)

Revisions

  • 1.40.0 - Speed and memory improvements for shared files. #357 , #347