Skip to content

Commit

Permalink
Merge pull request #14 from VascoElbrecht/update-v3
Browse files Browse the repository at this point in the history
hotfix
  • Loading branch information
VascoElbrecht committed Apr 4, 2016
2 parents ef52d20 + 61bcca0 commit 1c503a3
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions PrimerMiner/R/Vsearch.R
Original file line number Diff line number Diff line change
Expand Up @@ -108,16 +108,16 @@ N,any base,0.25,0.25,0.25,0.25,T
upac[upac==0.3] <- 1/3
upac.score <- upac[,3:6] > 0

upac[upac==0.25] <- 0 # make N zero score!

letter <- c()
for (j in 1:nrow(upac.score)){
letter[j] <- paste(as.numeric(upac.score[j,]), collapse="")
}


# loop import!
d <- 6
d <- 5


for (d in 1:length(start)){


Expand All @@ -127,6 +127,8 @@ alignment <- unlist(strsplit(alignment, split=""))
alignment <- match(alignment, upac$ID)
alignment <- matrix(alignment, nrow=length(alignment1), ncol=nchar(alignment1[1]), byrow=T)

table(alignment)

meep2 <- c()
for (k in 1:ncol(alignment)){
data <- alignment[,k]
Expand All @@ -142,9 +144,12 @@ if(threshold=="Majority"){
p <- p ==max(p)
} else {p <- p>=threshold}

if(is.na(p[1])){p <- c(0,0,0,0)} # replace N's (they are detected and writen as NA)
meep2 <- c(meep2, paste(as.numeric(p), collapse=""))
}



buildsequ <- upac$ID[match(meep2, letter)]
cat(paste(">", d, "\n", paste(buildsequ, sep="", collapse=""), "\n", sep=""), file=paste(setwd, "/", filename, "_cons_cluster_", threshold, ".fasta", sep=""), append=T)

Expand Down

0 comments on commit 1c503a3

Please sign in to comment.