我不能用";makeblast";命令



我通过在R中使用以下代码获得了fasta输出。我需要读取我使用这些代码获得的fasta文件(homo_ref.faa(;CCD_ 1";通过终端。但我得到了";BLAST options error: File homo_ref.faa does not exist";。你建议我如何对此代码进行更改?

library(seqinr)
library(Biostrings)
library(data.table)
library(tidyverse)

#read homo_tabular format
homo_tab = read.csv("proteins_homo.csv", header = TRUE, sep = ",")
homo_tab_1 = homo_tab[,c(7,9:11)]
colnames(homo_tab_1)[2]="ID"

#select longest locus
son <- homo_tab_1 %>%
group_by(Locus) %>%
slice_max(Length, n = 1) %>%
slice_head(n = 1)

#read homo protein fasta ile and convert list to df/dt
human_prot <- read.fasta(file= "homo_s.faa", seqtype="AA", as.string =TRUE, set.attributes =TRUE)
human_prot = unlist(human_prot)
human_prot = as.data.frame(human_prot)
human_prot = setDT(human_prot, keep.rownames = "ID")
#rename column
colnames(human_prot)[1] ="ID" 
colnames(human_prot)[2] ="seq"
#merge csv and fasta file
merged = merge(human_prot , son , by="ID", all.x=TRUE)
#remove na rows
library(dplyr)
merged_1 <- na.omit(merged)
#delete column
merged_2 = subset(merged_1, select = -c(3,4,5) )

write.fasta(sequences = merged_2, names = names(merged_3), file.out = "homo_ref.faa")

在这里我可以得到表格和fasta文件:

您是否尝试键入fasta文件的路径?例如makeblastdb -in /Usr/Desktop/homo_ref.faa -dbtype prot

我用以下代码解决了我的问题:"chmod a+r homo_ref.faa";。感谢Mensur Dlakic的类似问题回答。

最新更新