Body: <p>I want to make a python script that can get as input sequence of N amino acids, and the output is a matrix of Nx6 containing 6 features.
  The features are:</p>
  <ul>
  <li>Computed volume</li>
  <li>Hydrophobicity</li>
  <li>Surface charge</li>
  <li>Secondary structure (SS)</li>
  <li>Go, InterPro and Pfam type</li>
  </ul>
  <p>I have developed this script :</p>
  <pre><code>#Importing Libraries
  import numpy as np
  import pandas as pd
  from Bio.SeqUtils.ProtParam import ProteinAnalysis
  from Bio.SeqUtils.ProtParam import ProtParamData
  from quantiprot.metrics.aaindex import get_aa2volume, get_aa2hydropathy
  from quantiprot.metrics.basic import average
  
  #Input amino acid
   my_seq = input(&quot;Enter Your Sequence : &quot;)
   SEQ = my_seq.upper()
  
  #Analysis
  analysed_seq = ProteinAnalysis(SEQ)
  MW=  analysed_seq.molecular_weight()
  Gravity = analysed_seq.gravy()
  aa_composition = analysed_seq.count_amino_acids()
  aa_percentage=analysed_seq.get_amino_acids_percent()
  HP = analysed_seq.protein_scale(window=7, param_dict=ProtParamData.kd)
  Sec_Str = analysed_seq.secondary_structure_fraction()
  
   #Amino Acid Compsoition Calculation
    print(&quot;\n&quot; ,&quot;AA count:&quot;,aa_composition,&quot;\n&quot;)
  
    #Molecular Weight Calculation
     print(&quot;Molecular Weight : &quot;,MW)
  
  
     #Gravity Calculation
      print(&quot;\n&quot;,&quot;Gravity:&quot;,&quot;\n\n&quot;,Gravity)
      #Hydrophobicty Calculation by using kd scale
      print(&quot;\n&quot;,&quot;Hydrophobicity:&quot;,&quot;\n\n&quot;,HP)
      #kd → Kyte &amp; Doolittle Index of Hydrophobicity
     #Flex → Normalized average flexibility parameters (B-values)
     #hw → Hopp &amp; Wood Index of Hydrophilicity
     #em → Emini Surface fractional probability
  
    #Amino Acid Percent Calculation
  
   print(&quot;\n&quot;,&quot;Percentage of Amino Acids in Protein:&quot;,&quot;\n\n&quot;,aa_composition)
  
  
   #Volume Calculation by using quantiprot library
   vol =  get_aa2volume(analysed_seq)
  print(&quot;\n&quot;,&quot;Volume of amino acids in protein:&quot;,&quot;\n\n&quot;,str(vol))
  </code></pre>
  <p>I have calculated volume, Hydrophobicity, and SS but I don't know how can I find the</p>
  <ul>
  <li>Go, InterPro and Pfam type</li>
  <li>polarity, i.e. surface charge</li>
  </ul>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-07-19T01:27:30.273Z
Comments.Text: Type and polarity are static, right? So just import from some db. Surface accessibility changes based on folding doesn't it? So unless U do something really fancy with alphafold that might be hard...
Comments.UserDisplayName: Liam McIntyre
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-07-19T04:09:57.127Z
Comments.Text: RSA can be computed with NACCESS which I think also has a BioPython interface
Comments.UserDisplayName: Jan Wilamowski
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-07-19T09:03:45.253Z
Comments.Text: RSA requires a structure. _Predicted_ SS does not, but _assigned_ SS does and is  is folds better (bad pun intended). You have also `Normalized average flexibility parameters (B-values)`, which requires both a structure and metadata on that structure as the B-factors depend on the resolution (unless you have a protocol for it, it is not a rabbit hole worth going down, not due to the maths, but due the isotropic and anisotropic business).
Comments.UserDisplayName: Matteo Ferla
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-07-19T10:45:36.153Z
Comments.Text: Which dB I can use to import type and polarity?
Comments.UserDisplayName: Anas Jamshed
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-07-19T13:37:43.517Z
Comments.Text: If by "Polarity", you mean global charge, then that's isoelectric point (pI), which is actually useful for the protein engeering folk (pI close to pH is less soluble). If you mean some sort of per-residue value based on charged and polar residues in a window, then that would be something nearly similar to a Kyte & Doolittle Index. The per-voxel surface charge on a protein, requires a structure (and the Advance Poison-Boltzmann Solver).
Comments.UserDisplayName: Matteo Ferla
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-07-19T21:03:14.030Z
Comments.Text: how can I find the type?
Comments.UserDisplayName: Anas Jamshed
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-07-20T06:47:44.660Z
Comments.Text: Type is vague word. Take [GNB1](https://www.uniprot.org/uniprot/P62873), the G-protein subunit beta-1. It has a GO term `GO:0003924` (GTPase activity), an InterPro  `IPR001632` (G-Protein B), and PFam 7x `PF00400` (WD40 repeats). So the word describing what type of protein a protein is depends on the classifier in question.
Comments.UserDisplayName: Matteo Ferla
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-07-20T11:02:23.800Z
Comments.Text: but I want to find the type if any input sequence?
Comments.UserDisplayName: Anas Jamshed
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-07-21T20:15:02.083Z
Comments.Text: Read Matteo's comment - "type" is a vague word. Define it better; give it more context and maybe someone will be able to help you.
Comments.UserDisplayName: Ram RS
Tags: <python><proteins><protein-structure>
Title: Python script to calculate properties of amino acids and storing them in matrix
ThreadText: # Python script to calculate properties of amino acids and storing them in matrix
  
  (Asked by: username_0 on 2021-07-18)
  
  I want to make a python script that can get as input sequence of N amino acids, and the output is a matrix of Nx6 containing 6 features.
  The features are:
  
  * Computed volume
  * Hydrophobicity
  * Surface charge
  * Secondary structure (SS)
  * Go, InterPro and Pfam type
  
  I have developed this script :
  
  ```
  #Importing Libraries
  import numpy as np
  import pandas as pd
  from Bio.SeqUtils.ProtParam import ProteinAnalysis
  from Bio.SeqUtils.ProtParam import ProtParamData
  from quantiprot.metrics.aaindex import get_aa2volume, get_aa2hydropathy
  from quantiprot.metrics.basic import average
  
  #Input amino acid
   my_seq = input("Enter Your Sequence : ")
   SEQ = my_seq.upper()
  
  #Analysis
  analysed_seq = ProteinAnalysis(SEQ)
  MW=  analysed_seq.molecular_weight()
  Gravity = analysed_seq.gravy()
  aa_composition = analysed_seq.count_amino_acids()
  aa_percentage=analysed_seq.get_amino_acids_percent()
  HP = analysed_seq.protein_scale(window=7, param_dict=ProtParamData.kd)
  Sec_Str = analysed_seq.secondary_structure_fraction()
  
   #Amino Acid Compsoition Calculation
    print("\n" ,"AA count:",aa_composition,"\n")
  
    #Molecular Weight Calculation
     print("Molecular Weight : ",MW)
  
     #Gravity Calculation
      print("\n","Gravity:","\n\n",Gravity)
      #Hydrophobicty Calculation by using kd scale
      print("\n","Hydrophobicity:","\n\n",HP)
      #kd → Kyte & Doolittle Index of Hydrophobicity
     #Flex → Normalized average flexibility parameters (B-values)
     #hw → Hopp & Wood Index of Hydrophilicity
     #em → Emini Surface fractional probability
  
    #Amino Acid Percent Calculation
  
   print("\n","Percentage of Amino Acids in Protein:","\n\n",aa_composition)
  
   #Volume Calculation by using quantiprot library
   vol =  get_aa2volume(analysed_seq)
  print("\n","Volume of amino acids in protein:","\n\n",str(vol))
  
  ```
  
  I have calculated volume, Hydrophobicity, and SS but I don't know how can I find the
  
  * Go, InterPro and Pfam type
  * polarity, i.e. surface charge
  
  **Tags:** python, proteins, protein-structure
  
  > **Comments:**
  > **username_1**: Type and polarity are static, right? So just import from some db. Surface accessibility changes based on folding doesn't it? So unless U do something really fancy with alphafold that might be hard...  
  > **username_2**: RSA can be computed with NACCESS which I think also has a BioPython interface  
  > **username_3**: RSA requires a structure. _Predicted_ SS does not, but _assigned_ SS does and is  is folds better (bad pun intended). You have also `Normalized average flexibility parameters (B-values)`, which requires both a structure and metadata on that structure as the B-factors depend on the resolution (unless you have a protocol for it, it is not a rabbit hole worth going down, not due to the maths, but due the isotropic and anisotropic business).  
  > **username_0**: Which dB I can use to import type and polarity?  
  > **username_3**: If by "Polarity", you mean global charge, then that's isoelectric point (pI), which is actually useful for the protein engeering folk (pI close to pH is less soluble). If you mean some sort of per-residue value based on charged and polar residues in a window, then that would be something nearly similar to a Kyte & Doolittle Index. The per-voxel surface charge on a protein, requires a structure (and the Advance Poison-Boltzmann Solver).  
  > **username_0**: how can I find the type?  
  > **username_3**: Type is vague word. Take [GNB1](https://www.uniprot.org/uniprot/P62873), the G-protein subunit beta-1. It has a GO term `GO:0003924` (GTPase activity), an InterPro  `IPR001632` (G-Protein B), and PFam 7x `PF00400` (WD40 repeats). So the word describing what type of protein a protein is depends on the classifier in question.  
  > **username_0**: but I want to find the type if any input sequence?  
  > **username_4**: Read username_3's comment - "type" is a vague word. Define it better; give it more context and maybe someone will be able to help you.  
  
  ---
  
  ## 0 answers
  
  