xmap.files            package:xmapbridge            R Documentation

_U_n_d_e_r_l_y_i_n_g _x_m_a_p _m_e_t_h_o_d_s _f_o_r _m_a_n_i_p_u_l_a_t_i_n_g _p_r_o_j_e_c_t_s, _g_r_a_p_h_s, _a_n_d _p_l_o_t_s

_D_e_s_c_r_i_p_t_i_o_n:

     These methods are used to control xmap.projects, xmap.graphs and
     xmap.plots

     A project contains one or more graphs, and a graph can contain one
     or more plots (each plot can have a different style)

     A simpler method to generate X:Map graphs is to use the xmap.plot
     and xmap.points methods.

     The xmap.debug method was introduced as otherwise the vignette
     would not print out id values as it was supposed to.  For some
     reason Sweave ignores the show and as.character methods being
     overridden, and simply does its own thing.

_U_s_a_g_e:

       xmap.debug( idobject, newlines=FALSE )

       xmap.project.new( name )
       xmap.project.list()
       xmap.project.load( projectid )
       xmap.project.save( projectid, data )
       xmap.project.delete( projectid )

       xmap.graph.new( projectid, name, desc, min, max, chr, start, stop, ylab="value",
                       species=c("homo_sapiens", "mus_musculus", "rattus_norvegicus") )
       xmap.graph.list( projectid )
       xmap.graph.load( graphid )
       xmap.graph.save( graphid, data )
       xmap.graph.delete( graphid )

       xmap.plot.new( graphid, name, x, y, 
                      type=c("scatter", "line", "bar", "step", "area", "steparea"),
                      col = NULL, dp = 2 )
       xmap.plot.list( graphid )
       xmap.plot.load( plotid )
       xmap.plot.save( plotid, data, x, y, dp = 2 )
       xmap.plot.delete( plotid )

_A_r_g_u_m_e_n_t_s:

idobject: An id object for an xmapbridge project, graph or plot 

newlines: Should the resultant string be nicely formatyted with newline
          characters? 

    name: The name for this object (stored in the NAME variable of the
          list returned by load) 

projectid: The projectid (returned by xmap.project.new and as a list
          from xmap.project.list) 

    data: This is a list object for this particular object type 

    desc: The description for this item 

     min: The minimum y value for the graph 

     max: The maximum y value for the graph 

     chr: A string representing the chromosome this graph is to be
          drawn on 

   start: The BP that this graph should start on 

    stop: The BP that this graph reaches until.  Must be greater than
          start 

    ylab: The label for the yaxis of this graph 

 species: The species that this graph is to be drawn on 

 graphid: The graphid returned by xmap.graph.new or xmap.graph.list 

    type: The type of graph you wish to draw 

     col: The colour of the graph defined as an integer in the format
          0xAARRGGBB.  See 'xmap.col' 

       x: The points for the x-axis of this plot.  These points must be
          offsets from the start of the graph, and not their actual
          chromosomal location 

       y: The points for the y-axis of this plot.  Points where min>y
          or y >max will not be displayed 

      dp: The number of decimal places you want to save for the
          y-coordinates 

  plotid: The plotid which is returned by xmap.plot.new or
          xmap.plot.list 

_V_a_l_u_e:

     xmap.graph.new returns the graphid of the created graph
     xmap.graph.list returns a vector of all graphs contained within
     the given project xmap.graph.load returns a list containing the
     parameters for the given graph xmap.graph.save

_A_u_t_h_o_r(_s):

     Tim Yates

_S_e_e _A_l_s_o:

     'xmap.plot'
      'xmap.points'
      'xmap.col'
      <URL: http://xmap.picr.man.ac.uk>

_E_x_a_m_p_l_e_s:

       
       # Create a new project
       projectid <- xmap.project.new( "A quick project" )

       # Create a graph in this project covering 100K bases on chromosome 1
       graphid <- xmap.graph.new( projectid, "A quick graph", "This is a quick graph", 
                                 -10, 10, "1", 5000, 105000, species="homo_sapiens" )

       # Make our datasets
       x <- seq( 1000, 100000, by = 1000 )
       y <- runif( length( x ), -10, 10 )

       # Then add a plot to this graph
       xmap.plot.new( graphid, "Graph 1", x, y, type="area", col=0xAAFFEE00 )

       # And another one, in a different colour  
       a <- xmap.plot.new( graphid, "Graph 2", x, y, type="scatter", col=0xAA0000FF )
       
       cat( xmap.debug( a, newlines=TRUE ) )

       # At this point, we should be able to see the graphs using the XMapBridge application

       # Clean up our project file...
       xmap.project.delete( projectid )
       

