---
title: "18-Spur-genesym-join"
output: html_document
---



```{r}
library(tidyverse)
```


```{r}

spur <- read.csv("../analyses/Cg-ProteinsSpur5.0_blastx.tab", header = FALSE, sep="\t") %>%
  distinct(V1, .keep_all = TRUE) %>%
  select(V1, V2, V11)
```


```{r}
head(spur)
```


```{r}
ncbiP <- read.csv("../data/NcbiProteinEchinobaseGene_Spur.txt", header = FALSE, sep="\t")

head(ncbiP)
```
```{r}
library(fuzzyjoin)

```



```{r}
betterspur <- spur %>% fuzzy_inner_join(ncbiP, by = "V2", match_fun = str_detect)

```

```{r}
spur %>% stringdist_inner_join(ncbiP, by = "V2", max_dist = 2)
```



```{r}
write_tsv(
  betterspur,
  "../analyses/Spur-blastx-LOCsym.tab"
)

```

