【问题标题】:SimRAD users: fasta import to prevent insilico.digest strsplit errorSimRAD 用户:fasta 导入以防止 insilico.digest strsplit 错误
【发布时间】: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


    【解决方案1】:

    您的问题与SimRAD本身无关。正如?insilico.digest 中明确写的那样,第一个参数必须是字符串(或其向量)。例如。 read.fasta 改为输出 SeqFastadna 对象的列表。所以,你必须自己提取序列:

    myFasta     <- read.fasta(file = "filepath.fasta", as.string = 1)
    mySequences <- unlist(myFasta)
    myDigest    <- insilico.digest(myFasta, MseIcs_5p, MseIcs_3p, EcoRIcs_5p, EcoRIcs_3p, verbose = TRUE)
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-11-13
      • 2011-06-16
      • 2012-05-28
      • 1970-01-01
      • 2019-09-05
      • 1970-01-01
      相关资源
      最近更新 更多