Tongbcc / PaternityT

an R package for duo paternity testing
1 stars 1 forks source link

how to install #1

Open royalzeng opened 8 months ago

royalzeng commented 8 months ago

hello,i want to know how to install this R package,thank you very much

royalzeng commented 8 months ago

and if you tell me how to use it i'll be very grateful

Tongbcc commented 8 months ago

You can get it with the code: devtools::install_github("Tongbcc/PaternityT")

This R package is mainly designed for calculating the data of parentage and offspring data, and it is written based on the PLINK format data. You can type ?CPI_calculator to view the usage instructions.

Usage:

CPI_calculator(
  x,
  y = NULL,
  genename,
  genenamey = NULL,
  genestart = 2,
  genesel = NULL,
  onecolumn = FALSE,
  sexcolumn = NULL,
  threshold = 0.9999
)

Here are 9 parameters:

  1. x: A matrix or data frame containing individual names and gene information. The first column must be an individual_ID. Just like the plink .ped format

  2. y: Another gene information matrix or data frame, default is NULL.

  3. genename: A vector or matrix containing only all gene names. Just like the second column in plink .map files. The order of gene names must correspond to the order in x.

  4. genenamey: Another vector or matrix containing only all gene names. The order of gene names must correspond to the order in y, default is NULL.

Note that the x and genename are required parameters. When y and genenamey are missing, it will compute the CPI and POP between every pair of individuals in the x matrix. Otherwise, it will calculate the index between individuals in the x matrix and individuals in the y matrix. If you have two matrices, typically you would place the offspring in the x matrix and the parents in the y matrix.

  1. genestart: Tell the program where the first gene starts, for example, in Plink, this number would be 7.
  2. genesel: Typically, you wouldn't use too many loci for parentage analysis. You can choose a subset of loci for analysis by specifying the names of the genes directly, which must be a subset of genename and genenamey.
  3. onecolumn: You need to inform the program whether each gene is represented by one column or two. Taking SNPs as an example, if the genotype of a locus is "AC", you can either place them in one column or separate them into two columns.
  4. sexcolumn: If your genotype matrix includes gender information, please specify the column number where it is located. This column must be positioned between columns of the individual IDs and the genotype results.
  5. threshold: Typically, a relationship is considered to have parentage when the probability of parentage (POP) exceeds 99.99%. Therefore, the default value is set to 99.99%.

image

Best!

royalzeng commented 8 months ago

Thank you very much for your reply, but I still have some questions. Can you add a contact method? Such as WeChat...

Tongbcc commented 8 months ago

Thank you very much for your reply, but I still have some questions. Can you add a contact method? Such as WeChat...

Sure, please send your WeChat number to my E-mail: tongbccc@gmail.com