-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathcomparison_SNP_sample_sizes.R
76 lines (65 loc) · 2.6 KB
/
comparison_SNP_sample_sizes.R
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
library(snpStats)
# Oar3.1 mapping
# plink name
sheep_plink_name <- "../sheep/data/SNP_chip/oar31_mapping/Plates_1to87_QC3"
# read merged plink data
sheep_bed <- paste0(sheep_plink_name, ".bed")
sheep_bim <- paste0(sheep_plink_name, ".bim")
sheep_fam <- paste0(sheep_plink_name, ".fam")
full_sample <- read.plink(sheep_bed, sheep_bim, sheep_fam)
ncol(full_sample$genotypes) # 39368
nrow(full_sample$genotypes) # 7700
# plink name
sheep_plink_name <- "../sheep/data/SNP_chip/oar31_mapping/Plates_1-2_HD_QC2"
# read merged plink data
sheep_bed <- paste0(sheep_plink_name, ".bed")
sheep_bim <- paste0(sheep_plink_name, ".bim")
sheep_fam <- paste0(sheep_plink_name, ".fam")
full_sample <- read.plink(sheep_bed, sheep_bim, sheep_fam)
ncol(full_sample$genotypes) # 430702
nrow(full_sample$genotypes) # 7700
# Ramb mapping
# plink name
sheep_plink_name <- "../sheep/data/SNP_chip/ramb_mapping/Plates_1to87_QC4_ram"
# read merged plink data
sheep_bed <- paste0(sheep_plink_name, ".bed")
sheep_bim <- paste0(sheep_plink_name, ".bim")
sheep_fam <- paste0(sheep_plink_name, ".fam")
full_sample_ld <- read.plink(sheep_bed, sheep_bim, sheep_fam)
ncol(full_sample$genotypes) # 38300
nrow(full_sample$genotypes) # 7700
# plink name
sheep_plink_name <- "../sheep/data/SNP_chip/ramb_mapping/Plates_1-2_HD_QC3_ram"
# read merged plink data
sheep_bed <- paste0(sheep_plink_name, ".bed")
sheep_bim <- paste0(sheep_plink_name, ".bim")
sheep_fam <- paste0(sheep_plink_name, ".fam")
#full_sample <- read.plink(sheep_bed, sheep_bim, sheep_fam)
full_sample_hd <- read.plink(sheep_bed, sheep_bim, sheep_fam)
ncol(full_sample$genotypes) # 411800
nrow(full_sample$genotypes) # 7700
# merged RAM
# plink name
sheep_plink_name <- "../sheep/data/SNP_chip/ramb_mapping/merged_sheep_geno_ram_snpfilt"
# read merged plink data
sheep_bed <- paste0(sheep_plink_name, ".bed")
sheep_bim <- paste0(sheep_plink_name, ".bim")
sheep_fam <- paste0(sheep_plink_name, ".fam")
full_sample <- read.plink(sheep_bed, sheep_bim, sheep_fam)
ncol(full_sample$genotypes) # 411800
nrow(full_sample$genotypes) # 7700
ld <- colnames(full_sample_ld$genotypes)
hd <- colnames(full_sample_hd$genotypes)
merged <- colnames(full_sample$genotypes)
# genotyped on both chips and in merged
sum(merged %in% ld[(ld %in% hd)])
# imputed
sheep_plink_name <- "data/sheep_geno_imputed_ram_400k_filt"
# read merged plink data
sheep_bed <- paste0(sheep_plink_name, ".bed")
sheep_bim <- paste0(sheep_plink_name, ".bim")
sheep_fam <- paste0(sheep_plink_name, ".fam")
full_sample <- read.plink(sheep_bed, sheep_bim, sheep_fam)
ncol(full_sample$genotypes) # 411800
nrow(full_sample$genotypes) # 7700
summary(full_sample$genotypes)