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 about any of the acids.
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))
The features are:
- Computed volume
- Hydrophobicity
- Polarity
- Relative surface accessibility (RSA)
- Secondary structure (SS)
- Type
I have calculated volume, Hydrophobicity, and SS but I don't know how can I merge them in one matrix?
Please help me
Could you provide an example showing what do those six features look like? If they are all lists, you can easily stack them by numpy.vstack to a 2D array
first, I have to calculate Polarity Relative surface accessibility (RSA) and Type but I am not sure which library I can use?
they all are not list
Can anyone help me please?