---
title: "20-annot-derm"
output: html_document
date: "2025-07-18"
---
Rmd to annotate the count matrix of _D. imbricata_ transcripts with the big table created in 17-BLAST-derm.Rmd.
```{r}
library(tidyverse)
library(dplyr)
```
Read in count matrix:
read in transcript:
```{r}
dtranscript <- read.csv("../data/derm_transcript_count_matrix_2023.csv")
head(dtranscript)
```
```{r}
dannottable <- read.table("../output/17-BLAST-derm/Derm_blast_GO_annotation_table.tab")
head(dannottable)
```
rename first column in the dannottable to "transcript_id":
```{r}
colnames(dannottable) <- c("transcript_id", "V2", "Entry", "gene_name", "V5", "V6", "V7", "V8", "V9", "V10", "V11", "V12", "V13", "V14", "From", "Reviewed", "Entry.Name", "Protein.Names", "Gene.Names", "Organism", "Length", "Gene.Ontology.biological.process", "Gene.Ontology.cellular.component", "Gene.Ontology.GO", "Gene.Ontology.Molecular.Function", "Gene.Ontology.IDs")
head(dannottable)
```
```{r}
dcountannot <- left_join(dtranscript, dannottable, by = "transcript_id")
head(dcountannot)
```
write out table:
```{r}
write.table(dcountannot, "../output/20-annot-derm/Derm_transcript_counts_annotation.tab")
```