Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

handle false positive warning when expanding ranges #111

Open
kriemo opened this issue Oct 5, 2023 · 0 comments
Open

handle false positive warning when expanding ranges #111

kriemo opened this issue Oct 5, 2023 · 0 comments

Comments

@kriemo
Copy link
Member

kriemo commented Oct 5, 2023

These are false positives, as trim is called immediately. To silence, one option would be to check for these ivls before expanding to avoid the warning.
From here

x_extend <- trim(x + variant_dist)

library(raer)
library(GenomicFeatures)
mock_txdb <- function() {

    # mock up a txdb with genes
    gr <- GRanges(c(
        "SPCS3:100-120:-",
        "SPCS3:325-350:-"
    ))
    gr$source <- "raer"
    gr$type <- "exon"
    gr$source <- NA
    gr$phase <- NA_integer_
    gr$gene_id <- c(1, 2)
    gr$transcript_id <- c("1.1", "2.1")
    txdb <- makeTxDbFromGRanges(gr)
    txdb
}
rse_adar_ifn <- mock_rse()
rse <- rse_adar_ifn[seqnames(rse_adar_ifn) == "SPCS3"]
txdb <- mock_txdb()

filter_clustered_variants(rse, txdb, variant_dist = 100)
#> Warning in valid.GenomicRanges.seqinfo(x, suggest.trim = TRUE): GRanges object contains 1 out-of-bound range located on sequence SPCS3.
#>   Note that ranges located on a sequence whose length is unknown (NA) or
#>   on a circular sequence are not considered out-of-bound (use
#>   seqlengths() and isCircular() to get the lengths and circularity flags
#>   of the underlying sequences). You can use trim() to trim these ranges.
#>   See ?`trim,GenomicRanges-method` for more information.
#> ℹ `filter_clustered_variants()`: removed 7 sites from 8 (1 remain)
#> class: RangedSummarizedExperiment 
#> dim: 1 2 
#> metadata(0):
#> assays(7): ALT nRef ... nC nG
#> rownames(1): site_SPCS3_99_1
#> rowData names(4): REF rpbz vdb sor
#> colnames(2): wt adar1_ko
#> colData names(1): sample

Created on 2023-10-05 with reprex v2.0.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant