DNA sequence parser
related function: getCuttedPrimer(primer, len, direction='forward'), grepSeqByPrimer(seq, fprimer, rprimer)
# assume you have devtools installed
devtools::install_github(repo = 'mutolisp/seqParser')
Dependencies: dplyr, Biostrings, data.table, stringr, seqinr
Set up original primers
library(seqParser)
##### set up primers #####
fprimer <- 'AGATATTGGAAC[A|T]TTATATTTTATTT[A|T]TGG'
rprimer <- 'GGAGGATT[C|T]GG[A|T]AATTGATTAGT'
Adjust the length of each primer
##### grep by forward and reverse primers #####
fp <- getCuttedPrimer(fprimer, len=17, direction = 'forward')
rp <- getCuttedPrimer(rprimer, len=11, direction = 'reverse')
Grep sequences by given primers and export
ex.fasta <- outputSeq(fastaFile = 'example.fasta',
outputFasta = 'example.fasta',
fprimer = fp,
rprimer = rp,
duplinum = 5,
fill = TRUE)
Blast+ (you need to install NCBI blast first)
# make blast database
makeblastdb(input = 'example.fasta',
dbtype='nucl', title='example', out='/tmp/out/ab')
# blast: blast(type='blastn', ...) or blast(type='blastx', ...)
blast(type='blastn', query='query.fasta',
db = '/path/to/the/sdb', out = '/tmp/output.txt',
task='megablast', evalue=1, max_target_seqs=20, num_threads=8,
Cheng-Tao Lin (2018) seqParser: R package for DNA sequence parsing. URL: https://github.com/mutolisp/seqParser DOI: 10.5281/zenodo.1493692
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.