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
90e5f3e6
Commit
90e5f3e6
authored
Mar 06, 2023
by
Mustafa Tekpinar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added ssjetormax normalization weight mode.
parent
fcd3b21b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
3 deletions
+50
-3
computePred.R
computePred.R
+11
-0
sgemme.py
sgemme.py
+39
-3
No files found.
computePred.R
View file @
90e5f3e6
...
...
@@ -253,6 +253,17 @@ if((normWeightMode=="maxtracepc") | (normWeightMode=="maxpctrace")){
for
(
row
in
1
:
nrow
(
jet
))
{
trace
<-
append
(
trace
,
jet
[
row
,
"bfactor"
])
}
}
else
if
(
normWeightMode
==
"ssjetormax"
){
print
(
"Using only ssjetormax"
)
for
(
row
in
1
:
nrow
(
jet
))
{
if
(
sum
(
colnames
(
jet
)
==
"ssjetormax"
)
==
1
){
trace
<-
append
(
trace
,
jet
[
row
,
"ssjetormax"
])
}
else
{
print
(
"No field called ssjetormax in the JET output!"
)
quit
(
status
=
-1
)
}
}
}
else
{
print
(
"ERROR: Unknown --normWeightMode selected!"
)
print
(
"It can only be 'trace', 'tracemovingaverage', 'pc', 'cv', 'dfi', 'bfactor',"
)
...
...
sgemme.py
View file @
90e5f3e6
...
...
@@ -235,11 +235,13 @@ def launchJET(prot, retMet, bFile, fFile, pdbfile, chains, n, N, nl):
# Run Rscript to compute predictions
def
launchPred
(
prot
,
inAli
,
mutFile
,
normWeightMode
,
alphabet
):
SGEMME_DEV_PATH
=
"/home/tekpinar/research/lcqb/SGEMME-dev-ss-based-jetormax"
if
(
mutFile
!=
''
):
rcmd
=
"Rscript --save "
+
SGEMME_DEV_PATH
+
"/computePred.R "
+
prot
+
" "
+
inAli
+
" FALSE "
+
mutFile
+
" "
+
normWeightMode
+
" "
+
alphabet
if
mutFile
!=
''
:
rcmd
=
"Rscript --save $SGEMME_PATH/computePred.R "
+
prot
+
" "
+
inAli
+
" FALSE "
+
mutFile
+
" "
+
normWeightMode
+
" "
+
alphabet
#TODO: remember that there is a problem here!!!!
else
:
rcmd
=
"Rscript --save $SGEMME_PATH
/computePred.R "
+
prot
+
" "
+
inAli
+
" TRUE none "
+
normWeightMode
+
" "
+
alphabet
rcmd
=
"Rscript --save "
+
SGEMME_DEV_PATH
+
"
/computePred.R "
+
prot
+
" "
+
inAli
+
" TRUE none "
+
normWeightMode
+
" "
+
alphabet
print
(
"
\n
Running:
\n
"
+
rcmd
)
reCode
=
subprocess
.
call
(
rcmd
,
shell
=
True
)
...
...
@@ -784,6 +786,7 @@ def doit(inAli,mutFile,retMet,bFile,fFile,n,N, jetfile, pdbfile, normWeightMode,
(
normWeightMode
!=
'maxtracehalftracecvhalfcvpc'
)
and
\
(
normWeightMode
!=
'maxhalftracepchalftracecvhalfcvpc'
)
and
\
(
normWeightMode
!=
'jetormax'
)
and
\
(
normWeightMode
!=
'ssjetormax'
)
and
\
(
normWeightMode
!=
'tracemovingaverage'
)
and
\
(
normWeightMode
!=
'maxtracehalfpccv'
)):
print
(
"ERROR: normWeightMode can only be 'trace', 'tracemovingaverage', 'cv', 'pc', 'dfi', bfactor,
\n
"
+
\
...
...
@@ -835,6 +838,39 @@ def doit(inAli,mutFile,retMet,bFile,fFile,n,N, jetfile, pdbfile, normWeightMode,
df
.
to_csv
(
prot
+
"_jet.res"
,
header
=
True
,
index
=
None
,
sep
=
'
\t
'
,
mode
=
'w'
)
print
(
df
)
if
((
normWeightMode
==
'ssjetormax'
)):
if
(
pdbfile
==
None
):
print
(
"ERROR: There is not any pdb file to calculate DFI."
)
sys
.
exit
(
-
1
)
else
:
#proc=subprocess.Popen("python /home/tekpinar/software/scripts/python_scripts/biotite-secondary-structure.py "+pdbfile+" "+pdbfile+".dssp",stdout=subprocess.PIPE,shell=True)
os
.
system
(
"python /home/tekpinar/software/scripts/python_scripts/biotite-secondary-structure.py "
+
pdbfile
+
" "
+
pdbfile
+
".dssp"
)
os
.
system
(
"python /home/tekpinar/software/scripts/python_scripts/count-coil-segments-v2.py "
+
pdbfile
+
".dssp >"
+
pdbfile
+
".dssp.new"
)
df
=
pd
.
read_table
(
prot
+
"_jet.res"
,
sep
=
"
\
s+"
)
print
(
df
[
'pos'
])
print
(
pdbfile
+
".dssp"
)
print
(
os
.
getcwd
())
df2
=
pd
.
read_table
(
pdbfile
+
".dssp.new"
,
header
=
None
,
sep
=
","
)
df2
.
columns
=
[
'pos'
,
'ss'
,
'length'
]
print
(
df2
)
mergedRes
=
pd
.
merge
(
df
,
df2
,
on
=
'pos'
,
right_index
=
False
)
print
(
mergedRes
)
ssjetormaxList
=
[]
maxCoilLength
=
5
print
(
"WARNING: Max. coil length = {}"
.
format
(
maxCoilLength
))
for
index
,
row
in
mergedRes
.
iterrows
():
if
(
row
[
'ss'
]
==
'C'
)
and
(
row
[
'length'
]
>
maxCoilLength
):
ssjetormaxList
.
append
(
row
[
'trace'
])
else
:
maxVal
=
max
([((
row
[
'trace'
]
+
row
[
'pc'
])
/
2.0
),
((
row
[
'trace'
]
+
row
[
'cv'
])
/
2.0
),
((
row
[
'cv'
]
+
row
[
'pc'
])
/
2.0
)])
ssjetormaxList
.
append
(
maxVal
)
#ssjetormaxList=rankSortProteinData(ssjetormaxList, inverted=False)
df
[
'ssjetormax'
]
=
ssjetormaxList
df
[
'ssjetormax'
]
=
df
[
'ssjetormax'
]
.
round
(
decimals
=
4
)
df
.
to_csv
(
prot
+
"_jet.res"
,
header
=
True
,
index
=
None
,
sep
=
'
\t
'
,
mode
=
'w'
)
#sys.exit(-1)
#If a real pdb file is given, calculate dfi for the residues.
if
(((
normWeightMode
==
'tracemovingaverage'
))):
...
...
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