Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
PRESCOTT
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mustafa Tekpinar
PRESCOTT
Commits
4e82cee0
Commit
4e82cee0
authored
Mar 09, 2023
by
Mustafa Tekpinar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed editConfJET to editConfJETpython to reduce bash dependency.
parent
aabe1568
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
23 deletions
+55
-23
esgemme.py
esgemme.py
+44
-16
example-sgemme-script.sh
example/example-sgemme-script.sh
+11
-7
No files found.
esgemme.py
View file @
4e82cee0
...
@@ -19,6 +19,7 @@ import glob
...
@@ -19,6 +19,7 @@ import glob
from
prody
import
*
from
prody
import
*
from
scipy.stats
import
rankdata
from
scipy.stats
import
rankdata
from
Bio
import
AlignIO
#from gemmeAnal import *
#from gemmeAnal import *
...
@@ -50,17 +51,29 @@ def extractQuerySeq(filename):
...
@@ -50,17 +51,29 @@ def extractQuerySeq(filename):
fOUT
.
close
()
fOUT
.
close
()
return
prot
,
seq
,
i
-
1
return
prot
,
seq
,
i
-
1
def
getNbSeq
(
filename
):
# def getNbSeq(filename):
#TODO: Remove bash dependency and count the sequences within Python!
# #TODO: Remove bash dependency and count the sequences within Python!
"""
# """
# Get the number of sequences in a multi-fasta file
# # Get the number of sequences in a multi-fasta file
"""
# """
if
filename
!=
''
:
# if filename!='':
proc
=
subprocess
.
Popen
(
"grep -c '^>' "
+
filename
,
stdout
=
subprocess
.
PIPE
,
shell
=
True
)
# proc=subprocess.Popen("grep -c '^>' "+filename,stdout=subprocess.PIPE,shell=True)
return
int
(
proc
.
stdout
.
read
())
# return int(proc.stdout.read())
else
:
# else:
return
0
# return 0
# def getNbSeqPython(filename):
# #TODO: Remove bash dependency and count the sequences within Python!
# """
# Get the number of sequences in a multi-fasta file using only Python functions.
# """
# if ((filename != '') or (filename != None)):
# alignment = AlignIO.read(filename, "fasta")
# return int(len(alignment))
# else:
# print("ERROR: Could not find MSA file!")
# return 0
def
createPDB
(
prot
,
seq
):
def
createPDB
(
prot
,
seq
):
"""
"""
...
@@ -80,12 +93,27 @@ def createPDB(prot,seq):
...
@@ -80,12 +93,27 @@ def createPDB(prot,seq):
i
+=
1
i
+=
1
fOUT
.
close
()
fOUT
.
close
()
def
editConfJET
(
N
):
# def editConfJET(N):
# """
# # Edit JET configuration file with correct number of Seqs & MSA
# """
# reCode=subprocess.call("sed -i 's/results\t\t5000/results\t\t"+str(N)+"/' default.conf",shell=True)
# return(reCode)
def
editConfJETpython
(
N
):
"""
"""
# Edit JET configuration file with correct number of Seqs & MSA
# Edit JET configuration file with correct number of Seqs & MSA
"""
"""
reCode
=
subprocess
.
call
(
"sed -i 's/results
\t\t
5000/results
\t\t
"
+
str
(
N
)
+
"/' default.conf"
,
shell
=
True
)
with
open
(
"default.conf"
,
"r+"
)
as
file
:
return
(
reCode
)
fileContents
=
file
.
read
()
textPattern
=
re
.
compile
(
re
.
escape
(
"results
\t\t
5000"
))
fileContents
=
textPattern
.
sub
(
"results
\t\t
"
+
str
(
N
),
fileContents
)
file
.
seek
(
0
)
file
.
truncate
()
file
.
write
(
fileContents
)
#reCode=subprocess.call("sed -i 's/results\t\t5000/results\t\t"+str(N)+"/' default.conf",shell=True)
return
0
def
minMaxNormalization
(
data
):
def
minMaxNormalization
(
data
):
"""
"""
...
@@ -147,7 +175,7 @@ def launchJET(prot, retMet, bFile, fFile, pdbfile, chains, n, N, nl):
...
@@ -147,7 +175,7 @@ def launchJET(prot, retMet, bFile, fFile, pdbfile, chains, n, N, nl):
if
bFile
!=
''
:
if
bFile
!=
''
:
#TODO: I think these two lines must be here as well but I am not sure.
#TODO: I think these two lines must be here as well but I am not sure.
# print(N)
# print(N)
# editConfJET(N)
# editConfJET
python
(N)
if
(
bFile
==
prot
+
"_"
+
chainID
+
".psiblast"
):
if
(
bFile
==
prot
+
"_"
+
chainID
+
".psiblast"
):
shutil
.
copy2
(
bFile
,
bFile
+
".orig"
)
shutil
.
copy2
(
bFile
,
bFile
+
".orig"
)
...
@@ -166,7 +194,7 @@ def launchJET(prot, retMet, bFile, fFile, pdbfile, chains, n, N, nl):
...
@@ -166,7 +194,7 @@ def launchJET(prot, retMet, bFile, fFile, pdbfile, chains, n, N, nl):
else
:
else
:
print
(
N
)
print
(
N
)
editConfJET
(
N
)
editConfJET
python
(
N
)
if
(
fFile
==
prot
+
"_"
+
chainID
+
".fasta"
):
if
(
fFile
==
prot
+
"_"
+
chainID
+
".fasta"
):
shutil
.
copy2
(
fFile
,
fFile
+
".orig"
)
shutil
.
copy2
(
fFile
,
fFile
+
".orig"
)
...
...
example/example-sgemme-script.sh
View file @
4e82cee0
...
@@ -15,34 +15,38 @@ elif [ "$1" == "jetoff" ]
...
@@ -15,34 +15,38 @@ elif [ "$1" == "jetoff" ]
then
then
# If you have your own JET2 score file, you can turn off JET2 as follows:
# If you have your own JET2 score file, you can turn off JET2 as follows:
# In ../tests folder, you can find a sample JET2 file called BLAT_jet.res
# In ../tests folder, you can find a sample JET2 file called BLAT_jet.res
echo
"Running SGEMME with a user-provided alignment file."
echo
"Running
E
SGEMME with a user-provided alignment file."
echo
"Using a previously produced prot_jet.res file to check reproducibility!"
echo
"Using a previously produced prot_jet.res file to check reproducibility!"
cp ../tests/BLAT_jet.res
.
cp ../tests/BLAT_jet.res
.
python
$
SGEMME_PATH
/
sgemme.py aliBLAT.fasta
-r
input
-f
aliBLAT.fasta
--jetfile
BLAT_jet.res
python
$
ESGEMME_PATH
/e
sgemme.py aliBLAT.fasta
-r
input
-f
aliBLAT.fasta
--jetfile
BLAT_jet.res
elif
[
"
$1
"
==
"withpdb"
]
elif
[
"
$1
"
==
"withpdb"
]
then
then
#Please note that CV isa structural feature and it can not be calculated if you don't specify a pdb file.
#Please note that CV isa structural feature and it can not be calculated if you don't specify a pdb file.
echo
"Using blat-af2.pdb for the structural feature calculations!"
echo
"Using blat-af2.pdb for the structural feature calculations!"
python
$SGEMME_PATH
/sgemme.py aliBLAT.fasta
-r
input
-f
aliBLAT.fasta
--pdbfile
blat-af2.pdb
--normweightmode
maxhalftracepchalftracecvhalfcvpc
echo
"Entire mutational map of the protein will be calculated!"
python
$ESGEMME_PATH
/esgemme.py aliBLAT.fasta
-r
input
-f
aliBLAT.fasta
--pdbfile
blat-af2.pdb
--normweightmode
maxhalftracepchalftracecvhalfcvpc
elif
[
"
$1
"
==
"withpdb-withmutfile"
]
elif
[
"
$1
"
==
"withpdb-withmutfile"
]
then
then
#Please note that CV isa structural feature and it can not be calculated if you don't specify a pdb file.
#Please note that CV isa structural feature and it can not be calculated if you don't specify a pdb file.
echo
"Using blat-af2.pdb for the structural feature calculations!"
echo
"Using blat-af2.pdb for the structural feature calculations!"
python
$SGEMME_PATH
/sgemme.py aliBLAT.fasta
-r
input
-f
aliBLAT.fasta
--pdbfile
blat-af2.pdb
--normweightmode
maxhalftracepchalftracecvhalfcvpc
-m
Stiffler_2015_BLAT_ECOLX.mut
echo
"Only effects of mutations specified in the Stiffler_2015_BLAT_ECOLX.mut file will be calculated!"
python
$ESGEMME_PATH
/esgemme.py aliBLAT.fasta
-r
input
-f
aliBLAT.fasta
--pdbfile
blat-af2.pdb
--normweightmode
maxhalftracepchalftracecvhalfcvpc
-m
Stiffler_2015_BLAT_ECOLX.mut
elif
[
"
$1
"
==
"ssjetormax"
]
elif
[
"
$1
"
==
"ssjetormax"
]
then
then
#Please note that CV isa structural feature and it can not be calculated if you don't specify a pdb file.
#Please note that CV isa structural feature and it can not be calculated if you don't specify a pdb file.
echo
"Using blat-af2.pdb for the secondary structure based calculations!"
echo
"Using blat-af2.pdb for the secondary structure based calculations!"
python
$SGEMME_PATH
/sgemme.py aliBLAT.fasta
-r
input
-f
aliBLAT.fasta
--pdbfile
blat-af2.pdb
--normweightmode
ssjetormax
-m
Stiffler_2015_BLAT_ECOLX.mut
echo
"Only effects of mutations specified in the Stiffler_2015_BLAT_ECOLX.mut file will be calculated!"
python
$ESGEMME_PATH
/esgemme.py aliBLAT.fasta
-r
input
-f
aliBLAT.fasta
--pdbfile
blat-af2.pdb
--normweightmode
ssjetormax
-m
Stiffler_2015_BLAT_ECOLX.mut
else
else
echo
"Running SGEMME with a user-provided alignment file."
echo
"Running EGEMME with a user-provided alignment file."
python
$SGEMME_PATH
/sgemme.py aliBLAT.fasta
-r
input
-f
aliBLAT.fasta
echo
"Since a pdb file is not provided, only evolutionary information will be used!"
python
$ESGEMME_PATH
/esgemme.py aliBLAT.fasta
-r
input
-f
aliBLAT.fasta
fi
fi
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment