setDasServer(server="http://www.ensembl.org/das")
print(getDasServer())
# See the sources (supported organisms)
sources <- getDasSource()
head(sources)
dsn_sources <- getDasDsn()
head(dsn_sources)
# Notice that sources returns more information but we need the source ID
# given by getDasDsn, that corresponds to getDasSource$title in this
# server.
# The server we are quering is a genomic sequence server, so no gene
# information nor structure is available here
# Let's see what this sever supports for SCerevisiae
source <- "Saccharomyces_cerevisiae.EF4.reference"
# das1:entry_points das1:sequence das1:features
sources[grep(source, sources$title), ]
# Ask for the entries
entries <- getDasEntries(source)
head(entries)
# Retrive first 1000nts in the beginning of chromosomes I and II
range <- GRanges(c("I", "II"), IRanges(start=1, end=1000))
seq <- getDasSequence(source, range, class="DNAStringSet")
# Server supports features, but not types...
types <- getDasTypes(source)
# Server returns null... So we will perform a query without types
print(types)
# Let's see which features is returning the server
features <- getDasFeature(source, range, NULL)
print(features)
# Features here are not genomic features (like genes), this is only
# sequence info
# In the webpage http://www.dasregistry.org/listSources.jsp
# We can see all the registred DAS servers and the information they provide
# Remember that DASiR is only an interface to DAS servers! You should know
# what the server you are querying contains and if it supports your desired
# features!
# Now let's retrieve genes in that region from another source
# This is UCSC Genome browser, which has access to all the features
# displayed in the webpage
setDasServer(server="http://genome.ucsc.edu/cgi-bin/das")
# Notice that id now changes, we can retrieve it from getDasDsn()
source <- "sacCer3"
# Retrieve the types
types <- getDasTypes(source)
# We want the official genes from 'sdgGene' and the ENSEMBL predicted genes
# from 'ensGene'
features <- getDasFeature(source, range, c("sgdGene","ensGene"))
print(features)
# We obtain a total of 4 genes, 2 in chromosome I and 2 in chromosome II
# Notice each gene appears 2 times, one as a sgdGene and another as ensGene
# Now plot the features (but only from one range at a time!)
# Notice that with the default parameters each feature will appear with a
# different color
plotFeatures(features[features$segment.range == 1,])
Run the code above in your browser using DataLab