snps.to.genes {PAGWAS} | R Documentation |
Assigns SNPs to genes based on their physical distance.
snps.to.genes(snp.info, gene.info, distance)
snp.info |
A data frame with 3 columns with names: Name, Position and Chr that correspond to the SNP name, its position on the genome and its chromosome, respectively |
gene.info |
A data frame with 4 columns with names: Name, Start, End and Chr that correspond to the gene name, start and end positions on the genome and its chromosome, respectively |
distance |
A number that corresponds to the distance below and above the Start and End positions of the gene that all SNPs in that region should be assigned to the gene |
A list of the same size as the number of genes of the gene.info data frame. The names of the SNPs assigned to each gene are returned
data(SNPs)
data(genes)
snps.to.genes(snp.info=SNPs,gene.info=genes,distance=50)