【发布时间】:2015-05-26 15:44:33
【问题描述】:
我正在尝试使用下面的代码为 SimRAD 包中的 RADseq 运行进行计算机消化。我认为问题在于数据的加载 - 我不断收到以下错误:
strsplit(DNAseq, split = recognition_code, fixed = FALSE, perl = FALSE) 中的错误: 非字符参数
在我的 Fasta 文件中,我的 fasta 标头是: gi 32456060 emb BX526834 Cryptosporidium parvum 染色体 6 我删除了所有 . , 和 |以前在文件名中,因为我读到 |特别是会导致 strsplit 错误。
不幸的是,我发现的所有 SimRAD 文档都没有处理这个问题,而且我发现论坛主题与完全不同的样本类型相关的所有 strsplit 错误,我无法确定要更改的内容或修改以防止错误。
这里是包含所需包的代码:
###-----Start Code
source("http://bioconductor.org/biocLite.R")
biocLite("Biostrings")
biocLite("ShortRead")
install.packages("~/Downloads/SimRAD_0.95.tgz", repos = NULL)
library(Biostrings)
library(ShortRead)
library(seqinr)
library(SimRAD)
#Restriction Enzyme 1
#MseI #
MseIcs_5p <- "T"
MseIcs_3p <- "TAA"
#Restriction Enzyme 2
#EcoRI#
EcoRIcs_5p <- "G"
EcoRIcs_3p <- "AATTC"
##these are two alternative means I've tried to read in a fasta file
##I believe this is the the problem line - either a new line for
##importing or #some subsequent line is needed to prevent the error that
##follows
CryptoParChr6 <- read.fasta(file = "filepath.fasta")
CryptoParChr6 <- readDNAStringSet("filepath.fasta", "fasta")
##the error comes in at this line
CryptoParChr6.dig <- insilico.digest(CryptoParChr6, MseIcs_5p,
MseIcs_3p, EcoRIcs_5p, EcoRIcs_3p, verbose = TRUE)
###-----End Code
如果有人熟悉 SimRAD 并对正确导入 fasta 文件有任何建议 - 我将不胜感激。
【问题讨论】:
标签: r bioconductor strsplit