-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path04- Assign Taxonomy.Rmd
42 lines (33 loc) · 1.19 KB
/
04- Assign Taxonomy.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
---
title: "Assign Taxonomy"
author: "Marwa Tawfik"
summary: "NP_devStages_ampliseq"
Platform: "R version 4.1.0 (2021-05-18) -- Camp Pontanezen; x86_64-conda-linux-gnu (64-bit)"
date: "22 October 2022"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
```{r}
# Assign Taxonomy ----
#for silva from kingdom to spp.
taxa <- assignTaxonomy(seqtab.nochim2, "silva_nr99_v138_train_set.fa", multithread = TRUE)
taxa <- addSpecies(taxa, "silva_species_assignment_v138.fa")
unname(head(taxa))
saveRDS(taxa, file = "Robjects/taxa.rds")
write.table(taxa, file = "tables/taxa.txt", sep = "\t")
# taxa <- readRDS("Robjects/taxa.rds") #incase need to read rds file into a vector in our R env
```
```{r}
#let's inspect the taxonmic asssignment (same as unname(head(taxa))) > better way than unname(head(taxa))
taxa.print <- taxa #remove sequence rawnames for display only
rownames(taxa.print) <- NULL
head(taxa.print)
write.table(taxa.print, file = "tables/taxa.print.txt", sep = "\t")
# some editing to save sequences as fasta as follow (done in excel)
# kept the sequences in notepad/word and then save as .txt and changed that later to .fasta
```
```{r}
sessionInfo()
```