Learn R Programming

CRISPRseek (version 1.12.0)

writeHits: Write the hits of sequence search to a file

Description

write the hits of sequence search to a file, internal function used by searchHits

Usage

writeHits(gRNA, seqname, matches, strand, file, gRNA.size = 20, PAM = "N[A|G]G$", max.mismatch = 4, chrom.len, append = FALSE)

Arguments

gRNA
DNAString object with gRNA sequence with PAM appended immediately after,e.g., ACGTACGTACGTACTGACGTCGG with 20bp gRNA sequence plus 3bp PAM sequence CGG
seqname
chromosome name as character, e.g., chr1
matches
XStringViews object storing matched chromosome locations
strand
strand of the match, + for plus strand and - for minus strand
file
file path where the hits is written to
gRNA.size
gRNA size, default 20
PAM
PAM as regular expression for filtering the hits, default N[A|G]G$
max.mismatch
maximum mismatch allowed within the gRNA (excluding PAM portion) for filtering the hits, default 4
chrom.len
length of the matched chromosome
append
TRUE if append to existing file, false if start a new file

Value

results are saved in the file specified by file

Details

References

http://bioconductor.org/packages/2.8/bioc/vignettes/BSgenome/inst/doc/ GenomeSearching.pdf

See Also

offTargetAnalysis

Examples

Run this code
    gRNAPlusPAM <- DNAString("ACGTACGTACGTACTGACGTCGG")
    x <- DNAString("AAGCGCGATATGACGTACGTACGTACTGACGTCGG")
    chrom.len <- nchar(as.character(x))
    m <- matchPattern(gRNAPlusPAM, x)
    names(m) <- "testing"
    writeHits(gRNA = gRNAPlusPAM, seqname = "chr1", 
        matches = m, strand = "+", file = "exampleWriteHits.txt", 
        chrom.len = chrom.len, append = FALSE)

Run the code above in your browser using DataLab