Commit 35c5654f by Mustafa Tekpinar

Added --maxcoillength argument.

parent b14838e3
......@@ -267,7 +267,7 @@ def launchJET(prot, retMet, bFile, fFile, pdbfile, chains, n, N, nl):
prot+".pdb -o `pwd` -p AVJCG -r input -f "+prot+"_"+chainID+".fasta -d chain -n "+n+" -a 3"+" > "+prot+".out"
#One can also add: -g 'trace,pc,cv,clusters,axs'
print("\nRunning for SC1:\n"+jetcmd)
print("\nRunning JET2 with following arguments:\n"+jetcmd)
reCode=subprocess.call(jetcmd,shell=True)
if os.path.isfile(prot+"/"+prot+"_jet.res"):
os.rename(prot+"/"+prot+"_jet.res",prot+"_jet.res")
......@@ -334,7 +334,7 @@ def launchPred(prot,inAli,mutFile, normWeightMode, alphabet):
# rcmd="Rscript --save $ESGEMME_PATH/computePred.R "+prot+" "+inAli+" TRUE none "+normWeightMode+" "+alphabet
rcmd="Rscript --save computePred.R "+prot+" "+inAli+" TRUE none "+normWeightMode+" "+alphabet
print("\nRunning: \n"+rcmd)
print("\nRunning Rscript with following arguments: \n"+rcmd)
reCode=subprocess.call(rcmd,shell=True)
#Add plots here with gemmemore
......@@ -955,6 +955,10 @@ def parse_command_line():
help="Select a colormap from standard matplotlib colormaps",
required=False, default='Oranges_r')
parser.add_argument('--maxcoillength', dest='maxcoillength', type=int, \
help="If coil length is > maxcoillength, it will use JET values.",
required=False, default=5)
args = parser.parse_args()
arg_dict = vars(args)
......@@ -969,12 +973,13 @@ def parse_command_line():
def doit(inAli,mutFile,retMet,bFile,fFile,n,N, jetfile, pdbfile, normWeightMode,\
alphabet, verbosity, offset, colormap):
alphabet, verbosity, offset, colormap, maxCoilLength = 5):
"""
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.jetfile)
"""
debug = 0
if(mutFile != ''):
simple = False
else:
......@@ -1040,18 +1045,21 @@ def doit(inAli,mutFile,retMet,bFile,fFile,n,N, jetfile, pdbfile, normWeightMode,
countCoilSegments(pdbfile+".dssp")
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 = 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)
if(debug):
print(df['pos'])
print(pdbfile+".dssp")
print(os.getcwd())
print(df2)
print(mergedRes)
sstjetormaxList = []
maxCoilLength = 5
# maxCoilLength = 5
print("WARNING: Max. coil length = {}".format(maxCoilLength))
for index, row in mergedRes.iterrows():
if(row['ss']=='C') and (row['length']>maxCoilLength):
......@@ -1245,7 +1253,8 @@ def main():
doit(args.input, args.mutations, args.retrievingMethod, args.blastFile,\
args.fastaFile, args.nIter,args.NSeqs, args.jetfile, args.pdbfile,\
args.normweightmode, args.alphabet, args.verbose, args.offset, args.colormap)
args.normweightmode, args.alphabet, args.verbose, args.offset, \
args.colormap, maxCoilLength=args.maxcoillength)
toc = time.perf_counter()
......
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