-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMake_Map_file_PLINK.R
32 lines (22 loc) · 965 Bytes
/
Make_Map_file_PLINK.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
Make_Map_file_PLINK=function(Num_Chr,nmloci,nmSnps)
{
# Num_Chr=30, nmloci=500, nmSnps=15000,
#set working directory
#setwd("C:/Users/neshatm/R_code_plink/QMSim_Linux/QMSim_process_test/")
print("------------------ Making Map file is running --------------")
# print the genetic variables
print(paste(Num_Chr,"------Number of Chromosome----"))
print(paste(nmloci,"------Number of loci----"))
print(paste(nmSnps,"------Number of SNPs----"))
Chr= rep(c(1:Num_Chr), each = nmloci)
SN = 1:nmSnps
GD= rep(0,times=nmSnps)
Bp= seq(100000, nmloci*100000, by=100000)
BPP= rep(Bp,times=Num_Chr)
snps_map <- data.frame("Chr" = Chr, "SN" = SN, "GD" = GD, "BPP" = BPP,stringsAsFactors = FALSE)
filename = paste0("Snps",1,".map")
#write.csv(snps_map, "snps_map.csv", row.names=FALSE, quote=FALSE)
write.table(snps_map, file=filename, append = FALSE, sep = " ", dec = ".",
row.names = FALSE, col.names = FALSE, quote=FALSE)
}
#"snps_map_T.txt"