promoters_txdb <- promoters(txdb, upstream = 2000) is not 2000
1
0
Entering edit mode
linouhao ▴ 20
@linouhao-15901
Last seen 2 days ago
United States
# Load required package
require(TxDb.Hsapiens.UCSC.hg38.knownGene)

# Assign package to variable for easier use 
txdb <- TxDb.Hsapiens.UCSC.hg38.knownGene

# Get promoter regions for genes (2000bp upstream, 0bp downstream)
df <- promoters(genes(txdb), upstream = 2000, downstream = 0)

# Get promoter regions for transcripts
promoters_txdb <- promoters(txdb)

# Get promoter regions for transcripts with 2000bp upstream
promoters_txdb <- promoters(txdb, upstream = 2000)

GRanges object with 6 ranges and 2 metadata columns:
                    seqnames      ranges strand |     tx_id           tx_name
                       <Rle>   <IRanges>  <Rle> | <integer>       <character>
  ENST00000456328.2     chr1  9869-12068      + |         1 ENST00000456328.2
  ENST00000450305.2     chr1 10010-12209      + |         2 ENST00000450305.2
  ENST00000473358.1     chr1 27554-29753      + |         3 ENST00000473358.1
  ENST00000469289.1     chr1 28267-30466      + |         4 ENST00000469289.1
  ENST00000607096.1     chr1 28366-30565      + |         5 ENST00000607096.1
  ENST00000606857.1     chr1 50473-52672      + |         6 ENST00000606857.1
  -------
  seqinfo: 640 sequences (1 circular) from hg38 genome
> 9869-12068
[1] -2199 # this is not 2000
TxDb.Hsapiens.UCSC.hg38.knownGene • 59 views
ADD COMMENT
0
Entering edit mode
@james-w-macdonald-5106
Last seen 10 hours ago
United States

If you use promoters and do not provide an argument for something that has a default, you will get the default argument. Your last call to promoters did not specify the downstream distance, which has a default of 200.

> suppressWarnings(table(width(promoters(TxDb.Hsapiens.UCSC.hg38.knownGene, downstream = 0))))

  2000 
278220 
> suppressWarnings(table(width(promoters(TxDb.Hsapiens.UCSC.hg38.knownGene))))

  2200 
278220 
>

Login before adding your answer.

Traffic: 666 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy