Problems in while -R condition

1

Hello! I have a problem in my condition in the while loop. It does not recognize when it should stop and it is in an infinite loop. The purpose of the function is to tell what is between "a" "t" "g" and "t" "a" "g" or "t" "g" "a "or" t "" a "" a. If anyone can help thank you :).

  orfs<-function(x,p){
  count<-0
  cntorfs<-0
  n<-length(x)
  v<-n-2
  for (i in 1:v){
 if(x[i]=="a"&& x[i+1]=="t"&& x[i+2]=="g"){
  k<-i+3;
  w<-x[k]
  y<-x[k+1]
  z<-x[k+2]
  while (w!="t"&&y!="a"&& z!="g" ||w!="t" &&y!="a"&&z!="a"||w!="t"&&y!="g"&& z!="a"){
    count<-count+1
    k<-k+1
    w<-x[k]
    y<-x[k+1] 
    z<-x[k+2]
  }
  }
if(count>p){
  cntorfs<-cntorfs+1 
} 
if (count!=0){
  count<-0
}
}
cat("orf:",cntorfs)
'insira o código aqui'}
    
asked by anonymous 27.10.2018 / 10:19

0 answers