correcting indendation

This commit is contained in:
Tanushree Tunstall 2020-04-08 12:43:37 +01:00
parent 30aa64fd2b
commit c025a22343
3 changed files with 33 additions and 27 deletions

View file

@ -202,12 +202,15 @@ def dssp_to_csv(inputdsspfile, outfile, pdbchainlist):
#%%
#=======================================================================
def main():
print('Running dssp on', in_filename, 'extracting df and output csv:', dsspcsv_filename)
print('Running dssp with the following params:\n'
, in_filename
, 'outfile:', dsspcsv_filename)
dssp_file_from_pdb(infile, dssp_file, DSSP = "dssp")
my_chains = extract_chain_dssp(infile)
dssp_to_csv(dssp_file, dsspcsv_file, my_chains)
if __name__ == "__main__":
if __name__ == '__main__':
main()
#%% end of script
#=======================================================================
#=======================================================================

View file

@ -94,15 +94,11 @@ def kd_to_csv(inputfasta, outputkdcsv, windowsize):
@param windowsize: windowsize to perform KD calcs on (Kyte&-Doolittle)
@type DSSP: numeric
@return: writes df of kd values as csv
@type: .csv
@return: none, writes kd values df as csv
"""
#===================
#calculate KD values: same as the expasy server
#===================
my_window = windowsize
offset = round((my_window/2)-0.5)
#========================
# read input fasta file
#========================
fh = open(inputfasta)
for record in SeqIO.parse(fh, 'fasta'):
@ -114,7 +110,13 @@ def kd_to_csv(inputfasta, outputkdcsv, windowsize):
sequence = str(seq)
X = ProteinAnalysis(sequence)
#===================
# calculate KD values: same as the expasy server
#===================
my_window = windowsize
offset = round((my_window/2)-0.5)
# edge weight is set to default (100%)
kd_values = (X.protein_scale(ProtParamData.kd , window = my_window))
# sanity checks
print('Sequence Length:', num_residues)
@ -181,6 +183,7 @@ def kd_to_csv(inputfasta, outputkdcsv, windowsize):
print('Checking dtype for after conversion:\n'
, '\ndtype is:', kd_df.index.dtype
, '\n=========================================================')
#===============
# writing file
#===============
@ -215,13 +218,13 @@ def kd_to_csv(inputfasta, outputkdcsv, windowsize):
#kd_to_csv(infile, outfile, windowsize = 3)
#=======================================================================
def main():
print('Running hydropathy calcs', in_filename, 'output csv:', out_filename)
print('Running hydropathy calcs with following params\n'
, in_filename
, '\noutfile:', out_filename)
kd_to_csv(infile, outfile, 3)
print('Finished writing file:'
, '\nFilename:', outfile
, '\nFilename:', out_filename
, '\nPath:', outdir
# , '\nNo. of rows:', ''
# , '\nNo. of cols:', ''
, '\n=============================================================')
if __name__ == '__main__':

View file

@ -81,8 +81,7 @@ def rd_to_csv(inputtsv, outputrdcsv):
@param outputrdsv: csv file with rd values
@type outfile: string
@return: writes df of kd values as csv
@type: .csv
@return: none, writes rd values df as csv
"""
#========================
# read downloaded tsv file
@ -142,6 +141,7 @@ def rd_to_csv(inputtsv, outputrdcsv):
, '\nExpected no. of rows:', len(rd_data)
, '\nGot no. of rows:', len(rd_df)
, '\n=====================================================')
#===============
# writing file
#===============
@ -160,13 +160,13 @@ def rd_to_csv(inputtsv, outputrdcsv):
#rd_to_csv(infile, outfile)
#=======================================================================
def main():
print('Running hydropathy calcs', in_filename, 'output csv:', out_filename)
print('residue depth using the following params\n'
, in_filename
, '\noutfile:', out_filename)
rd_to_csv(infile, outfile)
print('Finished Writing file:'
, '\nFilename:', outfile
, '\nFilename:', out_filename
, '\nPath:', outdir
## , '\nNo. of rows:', ''
## , '\nNo. of cols:', ''
, '\n=============================================================')
if __name__ == '__main__':