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
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
58 additions
and
26 deletions
+58
-26
esgemme.py
esgemme.py
+47
-19
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
from
prody
import
*
from
scipy.stats
import
rankdata
from
Bio
import
AlignIO
#from gemmeAnal import *
...
...
@@ -50,18 +51,30 @@ def extractQuerySeq(filename):
fOUT
.
close
()
return
prot
,
seq
,
i
-
1
def
getNbSeq
(
filename
):
#TODO: Remove bash dependency and count the sequences within Python!
"""
# Get the number of sequences in a multi-fasta file
#
def getNbSeq(filename):
#
#TODO: Remove bash dependency and count the sequences within Python!
#
"""
#
# Get the number of sequences in a multi-fasta file
"""
if
filename
!=
''
:
proc
=
subprocess
.
Popen
(
"grep -c '^>' "
+
filename
,
stdout
=
subprocess
.
PIPE
,
shell
=
True
)
return
int
(
proc
.
stdout
.
read
())
else
:
return
0
# """
# if filename!='':
# proc=subprocess.Popen("grep -c '^>' "+filename,stdout=subprocess.PIPE,shell=True)
# return int(proc.stdout.read())
# else:
# 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
):
"""
If there is not a real PDB file for a given sequence,
...
...
@@ -80,12 +93,27 @@ def createPDB(prot,seq):
i
+=
1
fOUT
.
close
()
def
editConfJET
(
N
):
"""
# 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
)
return
(
reCode
)
# 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
"""
with
open
(
"default.conf"
,
"r+"
)
as
file
:
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
):
"""
...
...
@@ -147,7 +175,7 @@ def launchJET(prot, retMet, bFile, fFile, pdbfile, chains, n, N, nl):
if
bFile
!=
''
:
#TODO: I think these two lines must be here as well but I am not sure.
# print(N)
# editConfJET(N)
# editConfJET
python
(N)
if
(
bFile
==
prot
+
"_"
+
chainID
+
".psiblast"
):
shutil
.
copy2
(
bFile
,
bFile
+
".orig"
)
...
...
@@ -166,7 +194,7 @@ def launchJET(prot, retMet, bFile, fFile, pdbfile, chains, n, N, nl):
else
:
print
(
N
)
editConfJET
(
N
)
editConfJET
python
(
N
)
if
(
fFile
==
prot
+
"_"
+
chainID
+
".fasta"
):
shutil
.
copy2
(
fFile
,
fFile
+
".orig"
)
...
...
example/example-sgemme-script.sh
View file @
4e82cee0
...
...
@@ -15,34 +15,38 @@ elif [ "$1" == "jetoff" ]
then
# 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
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!"
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"
]
then
#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!"
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"
]
then
#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!"
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"
]
then
#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!"
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
echo
"Running SGEMME with a user-provided alignment file."
python
$SGEMME_PATH
/sgemme.py aliBLAT.fasta
-r
input
-f
aliBLAT.fasta
echo
"Running EGEMME with a user-provided alignment file."
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
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