blaST2GR: Convert an imported blast result table to a GRanges

Description Usage Arguments Value Examples

View source: R/blaST2GR.R

Description

Note that readlength table is expected to contain all reads (not only the reads that have an alignment)

Usage

1
blaST2GR(blastresults, readlength)

Arguments

blastresults

A tibble obtained with the readBlast function (containing strand info)

readlength

A tibble with 2 columns named ReadName and ReadLength. This table is expected to contain all reads, not only those having an alignment to the vector

Value

GRanges

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Import some blast result data:
    Path2Blast <- system.file("extdata", "BAC02_Blast18S.res", package = "NanoBAC")
    myblastResult <- readBlast(Path2Blast)
## Import a 2-column table with ReadName and ReadLength:
    Path2ReadLength <- system.file("extdata", "BAC02_ReadLength.tsv", package = "NanoBAC")
    ReadLengthTable <- read.table(Path2ReadLength,
                                  sep = "\t", header = FALSE,
                                  stringsAsFactors = FALSE,
                                  col.names = c("ReadName", "ReadLength"))
## Convert the blast result table to a GRanges
    myBlastGR <- blaST2GR(myblastResult, ReadLengthTable)

pgpmartin/NanoBAC documentation built on Dec. 11, 2020, 9:51 a.m.