R/SelectBestPhage.R

Defines functions SelectBestPhage

# SelectBestPhage

SelectBestPhage<-function(list_phage_cluster,matrix_pb,bacteria_number){
  PhageSet=0
  BestCounter=0
  for (i in list_phage_cluster){
    counter<-0
    for (j in 1:bacteria_number){
      counter<-counter+matrix_pb[j,i]
    }
    if (counter > BestCounter){
      PhageSet=i
      BestCounter<-counter
    }
  }
  if (BestCounter==0){PhageSet<-list_phage_cluster[1]}
  return(PhageSet)
}

Try the PhageCocktail package in your browser

Any scripts or data that you put into this service are public.

PhageCocktail documentation built on May 14, 2022, 1:05 a.m.