Description Usage Arguments Details Value Author(s) See Also Examples
get.data
queries SHiNeMaS and returns the data-sets.
1 2 3 4 5 6 7 8 9 10 | get.data(db_user = "pierre", db_host = "127.0.0.1",
db_name = "shinemas_tuto", db_password = "pierre",
query.type = "person", filter.on = NULL, germplasm.in = NULL,
germplasm.out = NULL, germplasm.type.in = NULL,
germplasm.type.out = NULL, year.in = NULL, year.out = NULL,
project.in = NULL, project.out = NULL, person.in = NULL,
person.out = NULL, seed.lot.in = NULL, seed.lot.out = NULL,
relation.in = NULL, reproduction.type.in = NULL, variable.in = NULL,
data.type = NULL, network.info = TRUE, Mdist = FALSE,
fill.diffusion.gap = FALSE, mixrep_to_repro = TRUE)
|
db_user |
user name of SHiNeMaS |
db_host |
IP address of the computer where SHiNeMaS is. If local host db_host = "127.0.0.1" |
db_name |
name of the data base |
db_password |
your password to login. If no password is needed, put "" |
query.type |
Type of query, which will create a data set. There are eight types:
|
filter.on |
This argument is needed if you want to use filters. It chooses on which seed-lots the filters are applied: "son", "father" or "father-son". Filter.on is not used for data.type = "seed-lots", query.type = "methods" and query.type = "person.info" |
germplasm.in |
Filter: vector with germplasms to keep. By default, all the germplasms are in. |
germplasm.out |
Filter: vector with germplasms to discard. By default, no germplasm is out. |
germplasm.type.in |
Filter: vector with germplasms to keep. By default, all the germplasm types are in. |
germplasm.type.out |
Filter: vector with germplasms to discard. By default, no germplasm type is out. |
year.in |
Filter: vector with years to keep. By default, all the years are in. |
year.out |
Filter: vector with years to discard. By default, no year is out. |
project.in |
Filter: vector of projects to keep. By default, all the projects are in. |
project.out |
Filter: vector of projects to discard. By default, no project is out. |
person.in |
Filter: vector of persons to keep. By default, all the persons are in. |
person.out |
Filter: vector of persons to discard. By default, no person is out. |
seed.lot.in |
Filter: vector of seed-lots to keep. By default, all the seed-lots are in. |
seed.lot.out |
Filter: vector of seed-lots to discard. By default, no seed-lot is out. |
relation.in |
Filter on a relation to keep: "reproduction", "mixture", "selection" or "diffusion". By default, all relations are in. |
reproduction.type.in |
Filter on reproduction types |
variable.in |
Filter: vector with variables to keep. If NULL, all variables in SHiNeMaS are displayed. |
data.type |
For queries in "data-". Type of data: "relation" for data linked to relation between seed lots and "seed-lots" for data linked to seed lots |
network.info |
For query.type = "network". If TRUE, aggregates information on relations and seed-lots on the network and return it in the results. |
Mdist |
For query.type = "network". If TRUE, computes the Mdist matrix and return it in the results. See details. |
fill.diffusion.gap |
For query.type = "network", create a network with no gaps between seed-lots (as long as there is information!) |
mixrep_to_repro |
For query.type = "network", tranform the mixtures of replications into reproductions, i.e. the network keeps only 'real' mixtures (i.e. different germplasm for father and son) and correct the information regarding what have been harvested and sown after as the mixture disappear. TRUE by default. |
Queries "cross"
The data frame returned has a column "expe" which corresponds to an id of the set of seed-lots used in the cross
Queries "S"
The data frame returned has a column "expe" which corresponds to an id of one selection differential
Queries "SR"
The data frame returned has a column "expe" which corresponds to an id of one selection differential and the corresponding response to selection
The query "data-SR" takes into account when selection has been done to get a seed lot, that this seed lot has been merged and then has been sown. It is the case when selection has been carried out in a replication that has been merged afterwards. Even if this case should not arrise, it might happen.
Query "network"
The Mdist square matrix can be compared to a differentiation distance. It can be put in relation with genetic Fst for example. Note that a value of 1 means a distance between
a seed-lot that has been diffused to location A without beeing sown and harvested on location B and
a seed-lot that has been diffused to location B and beeing sown and harvested on location B
Correlated data or not
Note that for data linked to seed-lots, all the data are correlated as there is one measure for a given seed-lot. Therefore the element of the list for non correlated data is always NULL.
For data linked to relations, as it can be linked to individual within a seed-lot, data may be correlated (data taken on the same individual) or not.
The function returns a list with
data according to the query type.
For network it returns a list with
the network object with information on:
vertex: year, person, germplasm, germplasm.type, sex
edges: relation type, number of generations on a given location + confidence of the information, number of generations since the information is known + confidence of the information
the network.query dataframe coming from the query
the network.info matrix with information on relations in the network. The possible information are:
reproduction: "sow", "harvest", "harvest-sow"
selection: "selection"
mixture: "mixture_real" (for 'real' mixture i.e. seed-lots of different germplasm), "mixture_rep" (for mixture of replication i.e. seed-lots of identical germplasm)
diffusion: "give", "receive", "give-receive"
the Mdist square matrix with the number of reproductions that separate two seed-lots since their last common diffusion.
For raw information on levels and variables present in SHiNeMaS it returns a vector
For data with variables on specific seed-lots it returns a list with
a data frame with the data set
a list with data set with individuals that are correlated for a set of variables
the description of methods used for each variable with its description and units
information to connect to SHiNeMaS
Pierre Riviere for R code and Yannick de Oliveira for SQL code
encrypt.data
, translate.data
,, format.data
, get.ggplot
, get.table
1 | # See the vignette
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.