wiki:RqtlIntegration

R/qtl interface

This tutorial describes how to connect XGAP to the RqtlPackage.

Retrieve raw data sets from XGAP into R/qtl for analysis

  1. Connect XGAP to R as described in RprojectInterface.
  1. Load the R/qtl package by entering (we assume you installed it ;-)).
library(qtl)
  1. Import an a genotype (individual x marker) matrix and a phenotype matrix (individual x trait) into an R/qtl 'cross' object from XGAP by using the CrossFromMolgenis function. The first parameter denotes the investigation_name, the second and third parameter refer to data matrices. (Tip: list all data matrices available using find.data()

Here we use again the MetaNetwork set as example.

myCross <- CrossFromMolgenis("MetaNetwork" ,"data_genotypes", "data_metaboliteexpression")
  1. Perform a standard QTL scan on all traits by using the 'scanall' method which a wrapper around a custom 'scanone' function that handles trait names properly.
myResults <- scanall(myCross)

Pushing results back-and-forth between XGAP and R/qtl

The results can be handled as any R/qtl data.

  1. For example, make a plot of the first trait by selecting the first 'scanone' object from the result list.
plot(myResults[[1]])

Result:

  1. Push the results back to the XGAP database by using the ResultsToMolgenis function. The name for the datamatrix that will be created may not yet exist in the database and will be automatically created.
ResultsToMolgenis("MetaNetwork", "myResults", myResults)
  1. You can now use the "Rplot" plugin at the Matrices to also visualize this profile, in a generic way:

  1. You can access past results by using ResultsFromMolgenis?:
myOldResult <- ResultsFromMolgenis("MetaNetwork", "myResults")
  1. and plot it again:
plot(myOldResult[[1]])
Last modified 7 years ago Last modified on 2010-10-01T23:38:13+02:00

Attachments (2)

Download all attachments as: .zip