plotResultInteractive: Interactive plotting of results

Description Usage Arguments Details Value Author(s) Examples

View source: R/Postprocessing.R

Description

Plots the manhattan plot for a given environmental variable. The plot is interactive and a map of the distribution of the marker can be retrieved as well as nearby genes listed in Ensembl.

Usage

1
2
3
4
plotResultInteractive(preparedOutput, varEnv, envFile, species = NULL,
  pass = NULL, x = NULL, y = NULL, valueName = "pvalueG",
  chromo = "all", gdsFile = NULL, IDCol = NULL, popStrCol = NULL,
  ensemblHost = "www.ensembl.org")

Arguments

preparedOutput

char The prepared output list from prepare_output function

varEnv

char The name of the environmental variable one wish to study (as in the header of envFile)

envFile

char The file containing the input environmental variable of sambada.

species

char The abbreviated latin name of the species without capitals nor punctuation (e.g. btaurus, chircus,...). Can be set to null if species not present in ensembl database. !!! Warning !!! This function only works for species for which a SNP dataset is available in ensembl. You can check the list using the following R command: snp_dataset = biomaRt::useMart('ENSEMBL_MART_SNP'); biomaRt::listDatasets(snp_dataset)

pass

integer Number of BP around a SNP in which to look for an annotation in Ensembl. Set to null if species is null

x

char The name of the column corresponding to the x-coordinate in the envFile. Can be set to null if unknown, in this case the maps will not be available

y

char The name of the column corresponding to the y-coordinate in the env file. Can be set to null if x is null.

valueName

char Name of the p- or q-value one wish to plot the manhattan on. This can be either pvalueG, pvalueW, qvalueG, qvalueW for G- or Waldscore respectively.

chromo

char/integer Name or vector of name of the chromosome to investigate. If all is chosen (default), all numerical chromosome will be mapped. If your sambada output is large (typically if you are working with more than 50K genomic file), you should probably map a subset of your dataset (e.g. chromo=1)

gdsFile

char The GDS file created in the preprocessing of sambada. If null, will try with envFile(without -env.csv or -env-export.csv) and .gds

IDCol

char The name of the column in envFile corresponding to the ID of the individual. If provided, hover on the output map will give the id of the animal

popStrCol

char The name or vector of name of column(s) in envFile describing population structure. If provided, additional layers on the map will be available representing population structure.

ensemblHost

char The ensembl url as defined in biomaRt::useMart. Useful to access archived version of ensembl dataset.

Details

This function opens a local web-page first showing a manhattan plot. By clicking on a marker, a list of information is shown (chromosome and exact position, ensembl gene within the determined window, variant consequence on the protein and if the SNP is correlated with other variables). A map also shows the geographical distribution of the marker (presence/absence), the environmental variable and if present the population variable. On the right of the plot, the variable to be plotted can be checked in the list by clicking on it. Also two boxplots shows the distribution of the environmental variables for individuals with and without the marker. The scale of the y-axis is the unit of the environmental variable.

Value

None

Author(s)

Solange Duruz

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
## Not run: 
# Example with data from the package
# First copy needed files into the temporary directory
file.copy(system.file("extdata", "uganda-subset-mol-Out-2.csv", package = "R.SamBada"), 
     file.path(tempdir(),'uganda-subset-mol-Out-2.csv'), overwrite=TRUE)
file.copy(system.file("extdata", "uganda-subset-mol-storey.csv", package = "R.SamBada"), 
     file.path(tempdir(),'uganda-subset-mol-storey.csv'), overwrite=TRUE)
file.copy(system.file("extdata", "uganda-subset-env-export.csv", package = "R.SamBada"), 
     file.path(tempdir(),'uganda-subset-env-export.csv'), overwrite=TRUE)
if(Sys.info()['sysname']=='Windows'){
  file.copy(system.file("extdata", "uganda-subset-mol_windows.gds", package = "R.SamBada"),
      file.path(tempdir(),'uganda-subset-mol.gds'), overwrite=TRUE) #If you run Windows
} else {
  file.copy(system.file("extdata", "uganda-subset-mol_unix.gds", package = "R.SamBada"),
      file.path(tempdir(),'uganda-subset-mol.gds'), overwrite=TRUE)
}
# Run prepareOutput
prep=prepareOutput(file.path(tempdir(),'uganda-subset-mol'),2,popStr=TRUE,
     interactiveChecks=FALSE)
###################
# Run plotResultInteractive
###################
plotResultInteractive(prep,'bio1','uganda-subset-env-export.csv',species='btaurus',
     pass=25000,x='longitude',y='latitude', gdsFile='uganda-subset-mol.gds',
     IDCol='short_name',popStrCol='pop1')

## End(Not run)

SolangeD/sambadaOnR documentation built on Dec. 25, 2021, 12:19 a.m.