---
title: "01-blast"
author: "Zach Bengtsson"
date: "2023-04-24"
output: html_document
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
```{bash}
cd ~/Applications/bioinfo/
curl -O https://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/LATEST/ncbi-blast-2.13.0+-x64-linux.tar.gz
tar -xf ncbi-blast-2.13.0+-x64-linux.tar.gz
```
```{bash}
ls ~/Applications/bioinfo/ncbi-blast-2.13.0+/bin
```


```{bash}
```{bash}
~/Applications/bioinfo/ncbi-blast-2.13.0+/bin/blastx -h
```

```{bash}
cd ~/data
curl -O https://ftp.uniprot.org/pub/databases/uniprot/current_release/knowledgebase/complete/uniprot_sprot.fasta.gz
mv uniprot_sprot.fasta.gz uniprot_sprot_r2023_01.fasta.gz
gunzip -k uniprot_sprot_r2023_01.fasta.gz
ls ~/data
```
```{bash}
~/Applications/bioinfo/ncbi-blast-2.13.0+/bin/makeblastdb \
-in ~/data/uniprot_sprot_r2023_01.fasta \
-dbtype prot \
-out ~/blastdb/uniprot_sprot_r2023_01
```
```{bash}
curl https://eagle.fish.washington.edu/cnidarian/Ab_4denovo_CLC6_a.fa \
-k \
> ~/github/zach-coursework/data/Ab_4denovo_CLC6_a.fa

```

```{bash}
head ~/github/zach-coursework/data/Ab_4denovo_CLC6_a.fa
echo "How many sequences are there?"
grep -c ">" ~/github/zach-coursework/data/Ab_4denovo_CLC6_a.fa
```
```{bash}
~/Applications/bioinfo/ncbi-blast-2.13.0+/bin/blastx \
-query ~/github/zach-coursework/data/Ab_4denovo_CLC6_a.fa \
-db ~/blastdb/uniprot_sprot_r2023_01 \
-out ~/github/zach-coursework/output/Ab_4-uniprot_blastx.tab \
-evalue 1E-20 \
-num_threads 20 \
-max_target_seqs 1 \
-outfmt 6
```
```{bash}
head -2 ~/github/zach-coursework/output/Ab_4-uniprot_blastx.tab
wc -l ~/github/zach-coursework/output/Ab_4-uniprot_blastx.tab
```
```{bash}

```






