Questions tagged [genomicranges]
72 questions
0
votes
0 answers
GenomicRanges method to make the total width of ranges a certain value?
I wish to extract the n positions closest to the end of a GRanges object or in other words, making the total width of the ranges in the object n if we count from the end (fixed to the end). Something similar can be done with the resize method…

MikeKatz45
- 545
- 5
- 16
0
votes
0 answers
Find overlaps within a GRanges object
I want to use a txdb annotation database to find out the genes that have no overlap with others. So I first get all genes locus:
library(GenomicFeatures)
txdb <- loadDb("gencode.v40.annotation.sqlite")
gene <- genes(txdb)
gene
## GRanges object with…

Liu Yang
- 1
0
votes
0 answers
Error in GenomicRanges library - GRanges function
I am taking a Edx course which illustrates how to use GenomicRanges package.
My code is
library(GenomicRanges)
GRanges("chr1", IRanges(c(1,101), c(50,150)), strand=c("+","-"))
However, I get an error message saying:
Error in…

Amal
- 1
0
votes
1 answer
R - remove specific numeric ranges from a dataframe based on second dataframe and reshape everything
I have a dataframe ('reference') containing the genomic locations ('start' and 'end' columns) for 3 human chromosomes ('seqnames' column). I need to remove specific ranges from each chromosome based on a second dataframe ('blacklist'), and reshape…

ASF
- 269
- 2
- 10
0
votes
0 answers
finding overlap using GenomicRanges with two data sets specifying minoverlap Function
I am trying to find overlap using GenomicRanges package function findOverlaps,I have two data sets and want to find overlaps using minoverlap parameter. So I want to give different minoverlap for every read.
Ex df1:
chr2 2800 3270
chr2 3600…

user15708301
- 63
- 6
0
votes
1 answer
Fast way to find overlaps in linear intervals
I have a data.frame of linear intervals (genomic coordinates of mapped RNA-seq reads), for example:
df <- data.frame(seqnames = c(rep("chr10",2),rep("chr5",8)),
start =…

dan
- 6,048
- 10
- 57
- 125
0
votes
1 answer
How to query a GRanges object into a object that can be queried again?
"I loaded a TxDb object created from Gencode and queried it for the exons, then I used lapply to get all the LAST exons from each transcript that has >1 exon:
#Load db:
Gencode <- loadDb("gencode.v39.basic.annotation.sqlite")
#Exons by…

Sky Scraper
- 148
- 1
- 10
0
votes
0 answers
How to find overlaps between two different dataframes and write overlap into corresponding bins
How to find overlaps between two different dataframes and then write this data into corresponding bins?
For example I would have a dataframe (represented by the first table here) that contains the start and end points of a subset of e.g. a sequence…
0
votes
1 answer
How to input data to use GenomicRanges packages to analyze in R?
I would like to make data like this one
library(Gviz)
library(GenomicRanges)
#Load data : class = GRanges
data(cpgIslands)
cpgIslands
## GRanges with 10 ranges and 0 metadata columns:
## seqnames ranges strand
## …

amirandi
- 1
- 1
0
votes
0 answers
Error in extracting several sequences from a .fasta file using a genomic range object as reference
I have a fasta file that corresponds to my reference genome and a vcf file that corresponds to the SNP call of my data. I would like to get the sequence of each one of the SNPs from my fasta.
For that, using R I loaded the vcf file and extract a…

Fpertille
- 383
- 1
- 14
0
votes
1 answer
Plot the longest transcript in GenomicRanges with ggbio
I am trying to plot an specific region using ggbio. I am using the below code that produced my desire output, except that it contains several transcript. Is it possible to only plot the longest transcript? I've not been able to access the genomic…

GabrielMontenegro
- 683
- 1
- 6
- 21
0
votes
2 answers
GenomicRanges Error loading DESeq2 library on R
I tried to loading DESeq2 on R:
library(DESeq2)
The Error showed is:
Loading required package: GenomicRanges
Error: package or namespace load failed for ‘GenomicRanges’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]):
object…

Giffredo
- 79
- 2
- 8
0
votes
1 answer
Transform genomic regions to genomic positions in an R dataframe or GenomicRanges object
I have a dataframe with some genomic intervals and its corresponding coverage in several samples:
sample1 sample2 sample3
1:1-3 30 NA NA
1:1-4 NA 40 35
1:4-5 35 NA NA
1:5-7 NA …

Jeni
- 918
- 7
- 19
0
votes
1 answer
Get the longest ranges per seqnames
I have a GRanges object with different genomic ranges for each seqnames (e.g. chromosomes).
How can I get a GRanges containing only the longest range for each seqname/chromosome?
For example, if gr is a GRanges:
library(GenomicRanges)
# Make a…

Pascal Martin
- 311
- 2
- 9
0
votes
2 answers
How to obtain distinct/unique rows from GenomicRanges object
I have the following GenomicRanges object created with this:
library(GenomicRanges)
gr <- GRanges(seqnames = "chr1", strand = c("+", "-","-", "+"),ranges = IRanges(start = c(1,3,3,5), width = 3))
gr
That looks like this:
GRanges object with 4…

littleworth
- 4,781
- 6
- 42
- 76