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
49dff695
Commit
49dff695
authored
May 09, 2022
by
Mustafa Tekpinar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added normweightmode as an argument to Python part of the code
parent
e197ed88
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
10 deletions
+17
-10
computePred.R
computePred.R
+3
-2
gemme.py
gemme.py
+11
-5
gemmeAnal.py
gemmeAnal.py
+3
-3
No files found.
computePred.R
View file @
49dff695
...
...
@@ -3,7 +3,7 @@
# This code is part of the gemme package and governed by its license.
# Please see the LICENSE.txt file included as part of this package.
# Usage: Rscript --save
run
Pred.R XXXX
# Usage: Rscript --save
compute
Pred.R XXXX
library
(
"seqinr"
)
source
(
paste
(
Sys.getenv
(
"GEMME_PATH"
),
"/pred.R"
,
sep
=
""
))
...
...
@@ -22,6 +22,7 @@ prot = args[1]
aliFile
=
args
[
2
]
simple
=
args
[
3
]
fname
=
args
[
4
]
normWeightMode
=
args
[
5
]
# read alignment and convert to matrix
ali
=
as.matrix.alignment
(
read.alignment
(
aliFile
,
format
=
"fasta"
))
...
...
@@ -92,7 +93,7 @@ print("running normalization...")
#normWeightMode="trace+pc+cv"
#normWeightMode="trace+pc"
#normWeightMode="trace+cv"
normWeightMode
=
"trace"
#
normWeightMode="trace"
#print(normWeightMode)
#In future, you may need to comment line 44 to use this functionality if you do
#weighting not just in normalization.
...
...
gemme.py
View file @
49dff695
...
...
@@ -255,9 +255,14 @@ def parse_command_line():
help
=
'fasta file containing related sequences'
,
default
=
''
)
retMet_args
.
add_argument
(
'--isjet2on'
,
dest
=
'isjet2on'
,
type
=
str
,
\
help
=
"If false, it will skip JET2 calculation and use a precalculated JET2 file. Default is true"
,
required
=
False
,
default
=
"True"
)
retMet_args
.
add_argument
(
'--normweightmode'
,
dest
=
'normweightmode'
,
type
=
str
,
\
help
=
"It can be one of these: 'trace', 'trace+pc', 'trace+cv' or 'trace+pc+cv'. Default is 'trace'."
,
required
=
False
,
default
=
"trace"
)
args
=
parser
.
parse_args
()
...
...
@@ -267,14 +272,15 @@ def parse_command_line():
# Check flag arguments
if
args
.
input
is
None
:
parser
.
error
(
"
gemme
requires an input alignment."
)
parser
.
error
(
"
GEMME
requires an input alignment."
)
return
args
def
doit
(
inAli
,
mutFile
,
retMet
,
bFile
,
fFile
,
n
,
N
,
isjet2on
):
def
doit
(
inAli
,
mutFile
,
retMet
,
bFile
,
fFile
,
n
,
N
,
isjet2on
,
normWeightMode
):
"""
Fonksiyon aciklamasi ile taniminin ayni olmasi super olmus!
Perfect explanation for a function: typing the function call exactly!
doit is basically the main function in disguise!
doit(args.input,args.mutations,args.retrievingMethod,args.blastFile,args.fastaFile, args.isjet2on)
"""
simple
=
True
...
...
@@ -298,7 +304,7 @@ def doit(inAli,mutFile,retMet,bFile,fFile,n,N, isjet2on):
else
:
print
(
"ERROR: You can only use true or false after --isjet2on!"
)
sys
.
exit
(
-
1
)
launchPred
(
prot
,
inAli
,
mutFile
)
launchPred
(
prot
,
inAli
,
mutFile
,
normWeightMode
)
#Do Python plotting here
#TODO: Eventually, I will do the map plotting with a completely independent
...
...
@@ -344,7 +350,7 @@ def doit(inAli,mutFile,retMet,bFile,fFile,n,N, isjet2on):
def
main
():
args
=
parse_command_line
()
doit
(
args
.
input
,
args
.
mutations
,
args
.
retrievingMethod
,
args
.
blastFile
,
\
args
.
fastaFile
,
args
.
nIter
,
args
.
NSeqs
,
args
.
isjet2on
)
args
.
fastaFile
,
args
.
nIter
,
args
.
NSeqs
,
args
.
isjet2on
,
args
.
normweightmode
)
if
(
__name__
==
'__main__'
):
main
()
...
...
gemmeAnal.py
View file @
49dff695
...
...
@@ -135,12 +135,12 @@ def launchJET(prot,retMet,bFile,fFile,n,N,nl):
return
(
reCode
)
# Run Rscript to compute predictions
def
launchPred
(
prot
,
inAli
,
mutFile
):
def
launchPred
(
prot
,
inAli
,
mutFile
,
normWeightMode
):
if
mutFile
!=
''
:
rcmd
=
"Rscript --save $GEMME_PATH/computePred.R "
+
prot
+
" "
+
inAli
+
" FALSE "
+
mutFile
rcmd
=
"Rscript --save $GEMME_PATH/computePred.R "
+
prot
+
" "
+
inAli
+
" FALSE "
+
mutFile
+
" "
+
normWeightMode
else
:
rcmd
=
"Rscript --save $GEMME_PATH/computePred.R "
+
prot
+
" "
+
inAli
+
" TRUE none
"
rcmd
=
"Rscript --save $GEMME_PATH/computePred.R "
+
prot
+
" "
+
inAli
+
" TRUE none
"
+
normWeightMode
print
(
"
\n
Running:
\n
"
+
rcmd
)
reCode
=
subprocess
.
call
(
rcmd
,
shell
=
True
)
...
...
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