PyDNAutil module

Created on Wed May 18 14:06:37 2016

@author: yzj

PyDNAutil.ALPHABET = 'ACGT'

Used for process original data.

PyDNAutil.ConvertPhycheIndexToDict(phyche_index)[source]
PyDNAutil.DNAChecks(s)[source]
PyDNAutil.Frequency(tol_str, tar_str)[source]

Generate the frequency of tar_str in tol_str.

Parameters:
  • tol_str – mother string.
  • tar_str – substring.
PyDNAutil.GeneratePhycheValue(k, phyche_index=None, all_property=False, extra_phyche_index=None)[source]

Combine the user selected phyche_list, is_all_property and extra_phyche_index to a new standard phyche_value. #################################################################

PyDNAutil.GetData(input_data, desc=False)[source]

Get sequence data from file or list with check.

Parameters:
  • input_data – type file or list
  • desc – with this option, the return value will be a Seq object list(it only works in file object).
Returns:

sequence data or shutdown.

PyDNAutil.GetSequenceCheckDna(f)[source]

Read the fasta file.

Input: f: HANDLE to input. e.g. sys.stdin, or open(<file>)

PyDNAutil.IsFasta(seq)[source]

Judge the Seq object is in FASTA format. Two situation: 1. No seq name. 2. Seq name is illegal. 3. No sequence.

Parameters:seq – Seq object.
PyDNAutil.IsSequenceList(sequence_list)[source]

Judge the sequence list is within the scope of alphabet and change the lowercase to capital. #################################################################

PyDNAutil.IsUnderAlphabet(s, alphabet)[source]

Judge the string is within the scope of the alphabet or not.

Parameters:
  • s – The string.
  • alphabet – alphabet.
PyDNAutil.NormalizeIndex(phyche_index, is_convert_dict=False)[source]
PyDNAutil.ReadFasta(f)[source]

Read a fasta file.

Parameters:f – HANDLE to input. e.g. sys.stdin, or open(<file>)
PyDNAutil.ReadFastaCheckDna(f)[source]

Read the fasta file, and check its legality.

Parameters:f – HANDLE to input. e.g. sys.stdin, or open(<file>)
PyDNAutil.ReadFastaYield(f)[source]

Yields a Seq object.

Parameters:f – HANDLE to input. e.g. sys.stdin, or open(<file>)
class PyDNAutil.Seq(name, seq, no)[source]
PyDNAutil.StandardDeviation(value_list)[source]
PyDNAutil.WriteLibsvm(vector_list, label_list, write_file)[source]