Commit 83ba006d by Mustafa Tekpinar

Corrected a bug in computePred.R when there is only one mutation in the mut file.

parent f469ecb8
...@@ -110,6 +110,7 @@ wt = wt[[1]][1:n] ...@@ -110,6 +110,7 @@ wt = wt[[1]][1:n]
if(simple==FALSE){ if(simple==FALSE){
print("reading selected mutations...") print("reading selected mutations...")
res=readMut(fname) res=readMut(fname)
#print(res)
pos = res[[1]] pos = res[[1]]
subsaa = res[[2]] subsaa = res[[2]]
rawMut = res[[3]] rawMut = res[[3]]
...@@ -122,8 +123,8 @@ nbSeqs = computeNbSeqs(ali) ...@@ -122,8 +123,8 @@ nbSeqs = computeNbSeqs(ali)
# compute gap counts for each position # compute gap counts for each position
nbGaps = N[1] - apply(nbSeqs,2,sum) nbGaps = N[1] - apply(nbSeqs,2,sum)
# output the conservation values # output the conservation values
dat=rbind(trace,KL=res[[1]][[2]],SE=res[[1]][[1]],gap=nbGaps/N[1],KL60=res[[2]][[2]],SE60=res[[2]][[1]],KL80=res[[3]][[2]],SE80=res[[3]][[1]]) # dat=rbind(trace,KL=res[[1]][[2]],SE=res[[1]][[1]],gap=nbGaps/N[1],KL60=res[[2]][[2]],SE60=res[[2]][[1]],KL80=res[[3]][[2]],SE80=res[[3]][[1]])
write.table(dat,paste0(prot,"_conservation.txt")) # write.table(dat,paste0(prot,"_conservation.txt"))
# compute log-odd ratios between mutated and wt sequence counts # compute log-odd ratios between mutated and wt sequence counts
predInd = computePredNbSeqs(wt,nbSeqs) predInd = computePredNbSeqs(wt,nbSeqs)
rownames(predInd)=aa rownames(predInd)=aa
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment