peptides.py icon indicating copy to clipboard operation
peptides.py copied to clipboard

RuntimeWarning in auto_correlation function()

Open jhahnfeld opened this issue 4 years ago • 0 comments

Hi, thank you for creating peptides.py.

Some hydrophobicity tables together with certain proteins cause a runtime warning for in the function auto_correlation():

import peptides

for hydro in peptides.tables.HYDROPHOBICITY.keys():
    print(hydro)
    table = peptides.tables.HYDROPHOBICITY[hydro]
    peptides.Peptide('MANTQNISIWWWAR').auto_correlation(table)

Warning (s2 == 0):

RuntimeWarning: invalid value encountered in double_scalars
  return s1 / s2

The tables concerned are: octanolScale_pH2, interfaceScale_pH2, oiScale_pH2 Some other proteins causing the same warning: ['MSYGGSCAGFGGGFALLIVLFILLIIIGCSCWGGGGYGY', 'MFILLIIIGASCFGGGGGCGYGGYGGYAGGYGGYCC', 'MSFGGSCAGFGGGFALLIVLFILLIIIGCSCWGGGGGF']

jhahnfeld avatar Apr 06 '22 15:04 jhahnfeld