Commit 461e81ee by Mustafa Tekpinar

Transposed classical GEMME output for better legibility!

parent ae5d1c5f
FROM ubuntu:20.04 FROM ubuntu:20.04
LABEL maintainer="Mustafa Tekpinar <tekpinar@buffalo.edu>" LABEL maintainer="Mustafa Tekpinar <tekpinar@buffalo.edu>"
LABEL description="ESGEMME: Evolutionary and Structural Global Epistatic Model for Predicting Mutational Effects." LABEL description="ESGEMME: Evolutionary and Structural Global Epistatic Model for predicting Mutational Effects."
WORKDIR /home/tekpinar/research/lcqb WORKDIR /home/tekpinar/research/lcqb
ENV JET2_PATH=/home/tekpinar/research/lcqb/JET2 ENV JET2_PATH=/home/tekpinar/research/lcqb/JET2
...@@ -13,6 +13,7 @@ COPY ./ESGEMME/pred.R ./ESGEMME/pred.R ...@@ -13,6 +13,7 @@ COPY ./ESGEMME/pred.R ./ESGEMME/pred.R
COPY ./ESGEMME/computePred.R ./ESGEMME/computePred.R COPY ./ESGEMME/computePred.R ./ESGEMME/computePred.R
COPY ./ESGEMME/default.conf ./ESGEMME/default.conf COPY ./ESGEMME/default.conf ./ESGEMME/default.conf
COPY ./ESGEMME/data/ ./ESGEMME/data/ COPY ./ESGEMME/data/ ./ESGEMME/data/
COPY ./ESGEMME/examples/ ./ESGEMME/examples/
################################################################### ###################################################################
RUN apt-get update --fix-missing && \ RUN apt-get update --fix-missing && \
...@@ -25,6 +26,7 @@ apt-get install -y r-base r-base-core && \ ...@@ -25,6 +26,7 @@ apt-get install -y r-base r-base-core && \
apt-get install -y muscle && \ apt-get install -y muscle && \
apt-get install -y dssp && \ apt-get install -y dssp && \
apt-get install -y default-jre && \ apt-get install -y default-jre && \
apt-get install -y ncbi-blast+ && \
apt-get install csh && \ apt-get install csh && \
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
################################################################### ###################################################################
...@@ -33,5 +35,12 @@ RUN ln -s /usr/bin/python3 /usr/bin/python ...@@ -33,5 +35,12 @@ RUN ln -s /usr/bin/python3 /usr/bin/python
RUN pip3 install --no-cache-dir prody matplotlib scipy pandas biotite RUN pip3 install --no-cache-dir prody matplotlib scipy pandas biotite
RUN Rscript -e 'install.packages("seqinr", repos="http://cran.us.r-project.org", dependencies=TRUE)' RUN Rscript -e 'install.packages("seqinr", repos="http://cran.us.r-project.org", dependencies=TRUE)'
# Build command
# sudo docker build -t tekpinar/esgemme-docker:v1.3.0 .
# Pull command on M1 Mac with macOS Monterey
# docker pull tekpinar/esgemme-docker:v1.3.0
# Run command on M1 Mac with macOS Monterey
# docker run -i -t -v $(pwd) --platform linux/amd64 tekpinar/esgemme-docker:v1.3.0 /bin/bash
...@@ -1053,6 +1053,20 @@ def doit(inAli,mutFile,retMet,bFile,fFile,n,N, jetfile, pdbfile, normWeightMode, ...@@ -1053,6 +1053,20 @@ def doit(inAli,mutFile,retMet,bFile,fFile,n,N, jetfile, pdbfile, normWeightMode,
gemmeData = parseGEMMEoutput(prot+"_normPred_evolCombi.txt", verbose=False) gemmeData = parseGEMMEoutput(prot+"_normPred_evolCombi.txt", verbose=False)
plotGEMMEmatrix(gemmeData, prot+"_normPred_evolCombi.png", 1, None,\ plotGEMMEmatrix(gemmeData, prot+"_normPred_evolCombi.png", 1, None,\
colorMap='Oranges_r', offSet=0, pixelType='square') colorMap='Oranges_r', offSet=0, pixelType='square')
#Convert standard combined output to a transposed format to increase
#legibility.
gemmeDF = pd.read_table(prot+"_normPred_evolCombi.txt", sep="\s+")
gemmeDFtrans = gemmeDF.T
print(gemmeDF)
# gemmeDF.columns = gemmeDF.columns.str.upper()
gemmeDFtrans.columns = gemmeDFtrans.columns.str.upper()
# with open('./filename.txt', 'w') as fo:
# fo.write(gemmeDFtrans.__repr__())
gemmeDFtrans.to_csv(prot+"_normPred_evolCombiTransposed.txt", sep='\t', float_format='%.2f', na_rep='NaN')
#sys.exit(-1)
else: else:
print("ERROR: "+prot+"_normPred_evolCombi.txt file does not exist!") print("ERROR: "+prot+"_normPred_evolCombi.txt file does not exist!")
print(" Can not generate "+prot+"_normPred_evolCombi.png file!") print(" Can not generate "+prot+"_normPred_evolCombi.png file!")
......
...@@ -285,7 +285,11 @@ normalizePredWithNbSeqsZeroSelMult<-function(pred, trace, wt, listMut){ ...@@ -285,7 +285,11 @@ normalizePredWithNbSeqsZeroSelMult<-function(pred, trace, wt, listMut){
myAA = tolower(let[[i]]) myAA = tolower(let[[i]])
n = length(myPos) n = length(myPos)
predTMP = c() predTMP = c()
for(k in 1:n){predTMP=c(predTMP,pred[myAA[k],myPos[k]])} # print(myPos[1])
for(k in 1:n){
# print(k)
predTMP=c(predTMP,pred[myAA[k],myPos[k]])
}
normPred[i] = sum(predTMP * trace[myPos]) normPred[i] = sum(predTMP * trace[myPos])
} }
return(normPred) return(normPred)
......
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