Skip to content

Commit

Permalink
add shannon diversity
Browse files Browse the repository at this point in the history
  • Loading branch information
SilasK committed Oct 5, 2023
1 parent 3436fce commit 96db777
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions R/Analyze_genecatalog.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,10 @@ non_singleton_genes <- gene_stats %>%
dplyr::pull(GeneNr)
# take a subset to speed up caluclation !!!! remove this line
non_singleton_genes <- non_singleton_genes[1:1000]
cat("Select", length(non_singleton_genes), "non singleton genes from total", dim(gene_stats)[1], "genes.")
Expand All @@ -282,3 +286,10 @@ gene_coverage <- load_subset_of_genes(abundance_file, non_singleton_genes)
```


```{r}
shannon_diversity <- vegan::diversity(t(gene_coverage), index = "shannon")
hist(shannon_diversity)
```


0 comments on commit 96db777

Please sign in to comment.