Advertisement
Guest User

Untitled

a guest
Feb 17th, 2016
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
R 1.23 KB | None | 0 0
  1. # problems plotting trancripts on same line
  2.  
  3. ensembl_transcript_id_A <- "ENST00000561401"
  4. ensembl_transcript_id_B <- "ENST00000560818"
  5.  
  6. mart <- biomaRt::useMart(
  7.   biomart = "ENSEMBL_MART_ENSEMBL",
  8.   dataset = "hsapiens_gene_ensembl",
  9.   host = "dec2013.archive.ensembl.org")
  10.  
  11. biomartBoth <- Gviz::BiomartGeneRegionTrack(
  12.   filters = list(
  13.     ensembl_transcript_id = c(ensembl_transcript_id_B,
  14.                               ensembl_transcript_id_A)),
  15.   biomart = mart)
  16.  
  17. # Create axis track
  18. axisTrack <- Gviz::GenomeAxisTrack()
  19.  
  20. # works as expected:
  21. Gviz::plotTracks(
  22.   c(biomartBoth, axisTrack),
  23.   from = biomartBoth@start,
  24.   to = biomartBoth@end,
  25.   chromosome = rep("chr15", 2),
  26.   showId = TRUE,
  27.   just.group = "below"
  28. )
  29. # plots the transcript on different lines:
  30. Gviz::plotTracks(
  31.   c(biomartBoth, axisTrack),
  32.   from = biomartBoth@start,
  33.   to = biomartBoth@end,
  34.   chromosome = rep("chr15", 2),
  35.   showId = TRUE,
  36.   just.group = "below",
  37.   reverseStrand = TRUE
  38. )
  39. # if I turn showId off, it works as expected again:
  40. Gviz::plotTracks(
  41.   c(biomartBoth, axisTrack),
  42.   from = biomartBoth@start,
  43.   to = biomartBoth@end,
  44.   chromosome = rep("chr15", 2),
  45.   showId = FALSE,
  46.   just.group = "below",
  47.   reverseStrand = TRUE
  48. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement