{ "cells": [ { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "library(\"vegan\")\n", "\n", "setwd(dir = \"~/miseq/ReverseTrans/\")\n", "df1 = read.csv(\"normalized_tab.csv\")\n", "\n", "mapping = read.csv(\"mapping.csv\", sep = \"\\t\")\n", "\n", "rownames(df1) = df1[,1]\n", "\n", "df1 = df1[,-1]\n", "df1 = t(df1)" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "species_diversity = specpool(df1, rownames(df1))\n", "\n", "df1Shannon = diversity(df1, index = \"shannon\",base = exp(1))\n", "df1Pielou = df1Shannon/log(rowSums(df1),base = exp(1))" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
Name | Enzyme | Species | Shannon | Pielou | |
---|---|---|---|---|---|
1 | Osnat037 | TGIRT | 1753 | 6.376924 | 0.6923657 |
4 | Osnat040 | TGIRT | 1732 | 6.079408 | 0.6600633 |
5 | Osnat041 | TGIRT | 1595 | 5.950627 | 0.6460811 |
6 | Osnat042 | TGIRT | 1542 | 6.049250 | 0.6567890 |
7 | Osnat043 | TGIRT | 1558 | 6.148981 | 0.6676172 |
8 | Osnat044 | SuperScriptIV | 1723 | 6.381981 | 0.6929147 |
10 | Osnat046 | SuperScriptIV | 1604 | 5.934493 | 0.6443294 |
11 | Osnat047 | SuperScriptIV | 1794 | 6.116224 | 0.6640606 |
13 | Osnat049 | SuperScriptIV | 1470 | 6.017251 | 0.6533147 |
14 | Osnat050 | SuperScriptIV | 1412 | 6.099111 | 0.6622025 |
15 | Osnat051 | Promega42 | 1199 | 6.139135 | 0.6665481 |
16 | Osnat052 | Promega42 | 1499 | 5.727399 | 0.6218445 |
17 | Osnat053 | Promega42 | 1582 | 5.988915 | 0.6502381 |
18 | Osnat054 | Promega42 | 1049 | 5.427566 | 0.5892905 |
21 | Osnat057 | Promega42 | 1548 | 6.190277 | 0.6721008 |
22 | Osnat058 | Promega55 | 1689 | 6.177508 | 0.6707144 |
25 | Osnat061 | Promega55 | 1535 | 5.969043 | 0.6480806 |
26 | Osnat062 | Promega55 | 1532 | 6.140683 | 0.6667162 |
27 | Osnat063 | Promega55 | 1416 | 5.951154 | 0.6461384 |
28 | Osnat064 | Promega55 | 1268 | 5.825569 | 0.6325031 |