This GAlignments object is then plotted using ggbio - but it can also be integrated with any of the other R packages that supports GAlignments or GRanges.
First you'll need to setup an R environment. We have currently only tested with R 3.0.3. There are known issues in R 3.0.2 and R 3.1.0.
Then you'll need a valid client ID and secret. Follow the authentication instructions, but instead of downloading the JSON file, you'll pass the
Client secretvalues into the setup function.
In an R interpreter:
source("/path/to/genomics-tools/client-r/genomics-api.R") setup("<client ID>", "<client secret>") getReadData() plotAlignments() # Plot basic alignment and coverage data
setup only needs to be run once. After it has been called,
can then be run repeatedly. It fetches data from the API
and can be used to search over any set of reads. You can pull up a different
sequence position by specifying additional arguments:
getReadData(chromosome="chr3", start="121458049", end="121459049")
Or, you can use the
readsetId argument to query a different readset entirely:
alignments are exported as global variables so that you
can use other Bioconductor tools to modify the
data as you wish.
If the sample code does not work with R 3.0.3, please check that your
matches our testing environment.
> sessionInfo() R version 3.0.3 (2014-03-06) Platform: x86_64-apple-darwin10.8.0 (64-bit) locale:  en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8 attached base packages:  parallel stats graphics grDevices utils datasets methods  base other attached packages:  Rsamtools_1.14.3 Biostrings_2.30.1 ggbio_1.10.16  ggplot2_0.9.3.1 GenomicRanges_1.14.4 XVector_0.2.0  IRanges_1.20.7 BiocGenerics_0.8.0 BiocInstaller_1.12.1  httr_0.3 rjson_0.2.13 loaded via a namespace (and not attached):  AnnotationDbi_1.24.0 Biobase_2.22.0 biomaRt_2.18.0  biovizBase_1.10.8 bitops_1.0-6 BSgenome_1.30.0  cluster_1.15.2 colorspace_1.2-4 DBI_0.2-7  dichromat_2.0-0 digest_0.6.4 Formula_1.1-1  GenomicFeatures_1.14.5 grid_3.0.3 gridExtra_0.9.1  gtable_0.1.2 Hmisc_3.14-4 httpuv_1.3.0  jsonlite_0.9.6 labeling_0.2 lattice_0.20-29  latticeExtra_0.6-26 MASS_7.3-31 munsell_0.4.2  plyr_1.8.1 proto_0.3-10 RColorBrewer_1.0-5  Rcpp_0.11.1 RCurl_1.95-4.1 reshape2_1.2.2  RSQLite_0.11.4 rtracklayer_1.22.7 scales_0.2.3  splines_3.0.3 stats4_3.0.3 stringr_0.6.2  survival_2.37-7 tcltk_3.0.3 tools_3.0.3  VariantAnnotation_1.8.13 XML_3.95-0.2 zlibbioc_1.8.0
- Provide an R library that hooks up the Genomics APIs to all of the other great existing R tools for biology. This library should be consumable by R developers.
- In addition, for non-developers, provide many Read and Variant analysis samples that can easily be run on API data without requiring a lot of prior biology or cs knowledge.
This project is in active development - the current code is very minimal and a lot or work is left. See GitHub issues for more details.