Skip to content

Commit

Permalink
Revised readme for install GAPIT by remotes
Browse files Browse the repository at this point in the history
  • Loading branch information
jiabowang committed Jul 26, 2024
1 parent 1025648 commit 04ce72b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
19 changes: 12 additions & 7 deletions R/GAPIT.Numericalization.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,20 @@ function(x,bit=2,effect="Add",impute="Middle", Create.indicator = FALSE, Major.a
##############################################################################################
if(bit==1) {
x[x=="X"]="N"
x[x=="-"]="N"
# x[x=="-"]="N"
x[x=="+"]="N"
x[x=="/"]="N"
x[x=="K"]="Z" #K (for GT genotype)is replaced by Z to ensure heterozygose has the largest value
}

if(bit==2) {
x[x=="XX"]="N"
x[x=="--"]="N"
# x[x=="--"]="N"
x[x=="++"]="N"
x[x=="//"]="N"
x[x=="NN"]="N"
x[x=="00"]="N"
# x[x=="-"]="N"

}

Expand All @@ -32,7 +33,7 @@ len=length(lev)
#print(len)
#Jiabo creat this code to convert AT TT to 1 and 2. 2018.5.29

if(bit==2)inter_store=c("AT","AG","AC","TA","GA","CA","GT","TG","GC","CG","CT","TC")
if(bit==2)inter_store=c("AT","AG","AC","TA","GA","CA","GT","TG","GC","CG","CT","TC","A-","-A","C-","-C","G-","-G","G-","-G")
if(bit==1)inter_store=c("R","Y","S","W","K","M")
inter=intersect(lev,inter_store)
#else{
Expand Down Expand Up @@ -87,12 +88,16 @@ if(Major.allele.zero){
}else{
# if(bit==1){
count.temp = cbind(lev,count)
print(count.temp)
if(length(inter)!=0)
{
count.temp = count.temp[-which(lev==inter),,drop=FALSE]
count=count[-which(lev==inter)]
lev=lev[-which(lev==inter)]
# len=length(lev)
if(lev[1]!=inter)
{
count.temp = count.temp[-which(lev==inter),,drop=FALSE]
count=count[-which(lev==inter)]
lev=lev[-which(lev==inter)]
len=length(lev)
}
}
order.index=order(as.numeric(count.temp[,2]), decreasing = TRUE)
count.temp <- count.temp[order.index,]
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,13 @@ Installation can also be made from GitHub when the R package `devtools` is avail
R> install.packages("devtools")
R> devtools::install_github("jiabowang/GAPIT", force=TRUE)
R> library(GAPIT)
or
R> install.packages("remotes")
R> remotes::install_github("jiabowang/GAPIT")
R> library(GAPIT)
```


Expand Down

0 comments on commit 04ce72b

Please sign in to comment.