def get_protein_sequence_descriptor(Uniprot_ID_list, no_compitable_sequence_file_name): #write a file has non-compatable protein sequence... #text_file = open("non_compitable_sequence_uniprot.txt", "w") #text_file = open("non_compitable_sequence_drugbank.txt", "w") text_file = open(no_compitable_sequence_file_name, "w") descr = [] error_protein_list = [] for protein in Uniprot_ID_list: proseq = gps(protein) Des = GetProDes(proseq) print protein try: alldes = Des.GetALL() PSD_list = [] for key in alldes: PSD_list.append(alldes[key]) descr.append(PSD_list) except (KeyError, IOError, AttributeError, ZeroDivisionError): error_protein_list.append(protein) text_file.write(protein) text_file.write("\n") pass text_file.close() descr = np.asarray(descr) return descr
def test_p48039(): proteinsequence = gps("P48039") # download the protein sequence by uniprot id DesObject = PyPro.GetProDes(proteinsequence) # construct a GetProDes object print(DesObject.GetCTD()) # calculate 147 CTD descriptors print(DesObject.GetAAComp()) # calculate 20 amino acid composition descriptors paac = DesObject.GetPAAC( lamda=10, weight=0.05 ) # calculate 30 pseudo amino acid composition descriptors for i in paac: print(i)
def test_p33765(): # TODO: "P33765" gives "HTTP Error 300" (abiguity?) Why? proteinsequence = gps( "P33765") # download the protein sequence by uniprot id DesObject = PyPro.GetProDes( proteinsequence) # construct a GetProDes object print(DesObject.GetCTD()) # calculate 147 CTD descriptors print(DesObject.GetAAComp() ) # calculate 20 amino acid composition descriptors paac = DesObject.GetPAAC( lamda=10, weight=0.05) # calculate 30 pseudo amino acid composition descriptors for i in paac: print(i)
def test_docs(): uniprotid = "P48039" gps(uniprotid) # Check the return value!