storing long strings (DNA sequence) in R

后端 未结 2 1094
刺人心
刺人心 2020-12-21 02:11

I have written a function that finds the indices of subsequences in a long DNA sequence. It works when my longer DNA sequence is < about 4000 characters. However, when I

2条回答
  •  一整个雨季
    2020-12-21 02:51

    Rather than write your own function, why not use the function words.pos in package seqinr. It seems to work even for strings up to a million base pairs.

    For example,

    library(seqinr)
    data(ec999)
    myseq <- paste(ec999[[1]], collapse="")
    myseq <- paste(rep(myseq,100), collapse="")
    words.pos("atat", myseq)
    

提交回复
热议问题