--- title: "03-repro-annot" author: "Steven Roberts" date: "`r format(Sys.time(), '%d %B, %Y')`" analyses: github_document: toc: true toc_depth: 3 number_sections: true html_preview: true html_document: theme: readable highlight: zenburn toc: true toc_float: true number_sections: true code_folding: show code_download: true editor_options: markdown: wrap: sentence --- ```{r setup, include=FALSE} library(knitr) library(tidyverse) library(kableExtra) library(DT) library(Biostrings) library(tm) library(pheatmap) library(DESeq2) knitr::opts_chunk$set( echo = TRUE, # Display code chunks eval = FALSE, # Evaluate code chunks warning = FALSE, # Hide warnings message = FALSE, # Hide messages fig.width = 6, # Set plot width in inches fig.height = 4, # Set plot height in inches fig.align = "center", # Align plots to the center comment = "" # Prevents appending '##' to beginning of lines in code analyses ) ``` Using Swiss-Prot Repro subset.. ```{r, engine='bash', eval=TRUE} head ../data/PO2457_Ostrea_lurida.protein.fasta ``` ```{r, engine='bash', eval=TRUE} grep ">" -c ../data/PO2457_Ostrea_lurida.protein.fasta ``` # Make BlastDB ```{r, engine='bash'} curl -H "Accept: text/plain" "https://rest.uniprot.org/uniprotkb/stream?format=fasta&query=%28%28go%3A0022414%29%29+AND+%28reviewed%3Atrue%29" -o ../data/SwissProt-GO:0022414.fa ``` ```{r, engine='bash', eval=TRUE} head ../data/SwissProt-GO:0022414.fa echo "Number of Sequences" grep -c ">" ../data/SwissProt-GO:0022414.fa ``` ```{r, engine='bash'} /home/shared/ncbi-blast-2.11.0+/bin/makeblastdb \ -in ../data/SwissProt-GO:0022414.fa \ -dbtype prot \ -out ../blastdb/SwissProt-GO:0022414 ``` # Blast ```{r, engine='bash'} /home/shared/ncbi-blast-2.15.0+/bin/blastp \ -query ../data/PO2457_Ostrea_lurida.protein.fasta \ -db ../blastdb/SwissProt-GO:0022414 \ -out ../output/03-repro-annot/Olur-SP0022414_blastp.tab \ -evalue 1E-10 \ -num_threads 48 \ -max_target_seqs 1 \ -max_hsps 1 \ -outfmt 6 ``` ```{r, engine='bash', eval=TRUE} head ../output/03-repro-annot/Olur-SP0022414_blastp.tab ``` ```{r, engine='bash', eval=TRUE} wc -l ../output/03-repro-annot/Olur-SP0022414_blastp.tab ``` ```{r, engine='bash', eval=TRUE} tr '|' '\t' < ../output/03-repro-annot/Olur-SP0022414_blastp.tab \ > ../output/03-repro-annot/Olur-SP0022414_blastp_sep.tab head -1 ../output/03-repro-annot/Olur-SP0022414_blastp_sep.tab ``` # Download SP GO INFORMATION ```{bash} curl -H "Accept: text/plain; format=tsv" "https://rest.uniprot.org/uniprotkb/stream?fields=accession%2Creviewed%2Cid%2Cprotein_name%2Cgene_names%2Corganism_name%2Clength%2Cgo_p%2Cgo_c%2Cgo%2Cgo_f%2Cgo_id&format=tsv&query=%28%28go%3A0022414%29%29+AND+%28reviewed%3Atrue%29" -o ../data/SwissProt-GO:0022414.tsv ``` ```{r read-data} bltabl <- read.csv("../output/03-repro-annot/Olur-SP0022414_blastp_sep.tab", sep = '\t', header = FALSE) spgo <- read.csv("../data/SwissProt-GO:0022414.tsv", sep = '\t', header = TRUE) ``` ```{r join} annot_tab <- left_join(bltabl, spgo, by = c("V3" = "Entry")) %>% select(V1, V3, V13, Protein.names, Organism, Gene.Ontology..biological.process., Gene.Ontology.IDs) ```