R/CreateConsensus.R

Defines functions CreateConsensus

Documented in CreateConsensus

CreateConsensus <- function(alignedSequences,iicc){
	
	if (iicc$alignment!="MEME"){
		alignedSequences<-as.matrix(alignedSequences)
	    SeqCons<-con(alignedSequences, method= c("IUPAC"))
	}else{
		num_motif<-iicc$nummotif;len_motif<-iicc$lenmotif
		call.meme=iicc$call.meme
		system(paste(paste(paste(paste(call.meme,alignedSequences,sep=" "),"-oc memeout -dna -mod anr -w", len_motif,sep=" "), "-nmotifs", sep=" "),num_motif,sep=" "))
		
		resultat<-readLines(paste(getwd(),"/memeout/meme.txt", sep="", collapse=NULL))
		y <- readMEME(resultat, num_motif)
		SeqCons<-consensus<-y[[length(y)]]
	}
	
  SeqCons
}

Try the MEET package in your browser

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

MEET documentation built on May 2, 2019, 5:52 p.m.