Nexus class. Parse the contents of a nexus file. Based upon 'NEXUS: An
extensible file format for systematic information' Maddison, Swofford,
Maddison. 1997. Syst. Biol. 46(4):590-621
|
safename(name,
mrbayes=False)
Return a taxon identifier according to NEXUS standard. |
source code
|
|
|
quotestrip(word)
Remove quotes and/or double quotes around identifiers. |
source code
|
|
|
get_start_end(sequence,
skiplist=[ ' - ' , ' ? ' ] )
Return position of first and last character which is not in skiplist. |
source code
|
|
|
_sort_keys_by_values(p)
Returns a sorted list of keys of p sorted by values of p. |
source code
|
|
|
_make_unique(l)
Check that all values in list are unique and return a pruned and
sorted list. |
source code
|
|
|
_unique_label(previous_labels,
label)
Returns a unique name if label is already in previous_labels. |
source code
|
|
|
_seqmatrix2strmatrix(matrix)
Converts a Seq-object matrix to a plain sequence-string matrix. |
source code
|
|
|
_compact4nexus(orig_list)
Transform [1 2 3 5 6 7 8 12 15 18 20] (baseindex 0, used in the Nexus
class) into '2-4 6-9 13-19\3 21' (baseindex 1, used in programs like
Paup or MrBayes.). |
source code
|
|
|
combine(matrices)
Combine matrices in [(name,nexus-instance),...] and return new nexus
instance. |
source code
|
|
|
|
|
|
|
_replace_parenthesized_ambigs(seq,
rev_ambig_values)
Replaces ambigs in xxx(ACG)xxx format by IUPAC ambiguity code. |
source code
|
|
|
C = False
|
|
INTERLEAVE = 70
|
|
SPECIAL_COMMANDS = [ ' charstatelabels ' , ' charlabels ' , ' taxlabel ...
|
|
KNOWN_NEXUS_BLOCKS = [ ' trees ' , ' data ' , ' characters ' , ' taxa ' , ' ...
|
|
PUNCTUATION = ' ()[]{}/\\,;:=*\'"`+-<> '
|
|
MRBAYESSAFE = ' abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTU ...
|
|
WHITESPACE = ' \t\n '
|
|
SPECIALCOMMENTS = [ ' & ' ]
|
|
CHARSET = ' chars '
|
|
TAXSET = ' taxa '
|
|
CODONPOSITIONS = ' codonpositions '
|
|
DEFAULTNEXUS = ' #NEXUS\nbegin data; dimensions ntax=0 nchar=0; ...
|
|
__package__ = ' Bio.Nexus '
|