Var

Note

Most of these instance variables listed below are shown erroneously as being None. It is is a known issue with Sphinx. See what those values really are, in the var instance. Or look at the source.

class Var

An instance of this class is the global bucket.

An instance of this class is made, called ‘var’. It can be read and changed by the user, and it is imported by other classes that need access to ‘global’ variables contained in it.

alignments = None

A list of alignments. Only those alignments read from the command line and from read()

argvAfterDoubleDash = None

In the p4 script, non-filename command-line args are accommodated, awkwardly. They need to be put after a double dash. They can then be found here.

doSplash = None

Whether to do the splash screen on startup with no args. When you get tired of it, turn it off in a customization file. You can always see it again with p4.func.splash().

examplesDir

The directory where the p4 examples can be found.

Assuming that p4 can find them.

excepthookEditor

The editor that is called by excepthook, or None

Setting this to None or to the name of an editor acts as a Boolean to say whether to follow a traceback with a hook to call your editor.

It is for using p4 at the terminal, writing scripts and source in an editor such as emacs or vi. The various files and lines of the traceback are given numbers that you can type in to get to the source. Handy!

The editor needs to be clever enough to use the “+N” command line option to be able to go to a particular line (N). Emacs and vi can both do this.

Set to, for example ‘emacsclient -n’, or ‘vim’. Default is None.

fileNames = None

Files read in from the command line.

interactiveHelper

For interactive use, set the helper.

Set to p3rlcompleter, bpython, or ipython. Default is None.

modelSymbols = None

A list of symbols used in text tree drawings, showing model disposition on the tree.

newick_allowSpacesInNames = None

Allow unquoted taxon names in Newick and Nexus trees to have spaces.

This will allow reading trees like (A, B C, (D E, F)G H); Multiple spaces are collapsed into single spaces.

nexusSets = None

A single NexusSets object (not a list) from files from the command line or from read(). If more sets info is read in, it all gets put in the single NexusSets object

nexus_allowAllDigitNames = None

The NEXUS spec does not allow names that are all numerals. Temporarily override by True-ing this.

nexus_allowUTREE = None

UTREE has been deprecated since at least 1997.

But if you need to read UTREE-containing tree files, you can turn it on with this.

nexus_getAllCommandComments

Whether to get all command comments in NEXUS tree files.

nexus_getLineEndingsAsTokens
nexus_getP4CommandComments

Whether to get p4-specific command comments in NEXUS trees.

nexus_getWeightCommandComments

Whether to get the ‘weight’ command comment in a NEXUS tree.

nexus_ignoreFormatCommandSymbols = None

In nexus, if you have dna, rna, or protein datatype, you can, according to the nexus standard, add extra symbols, defined in the format command. I don’t like that, so I don’t allow it. However, at least I warn the user, either as a warning (if True) or a glitch (if False).

nexus_readBeastTreeCommandComments = None

Beast trees use command comments eg [&stuff=0.12345] a lot. To read them, turn var.nexus_getAllCommandComments on, and then turn this on.

nexus_warnSkipUnknownBlock = None

Print a little message if p4 encounters a NEXUS block that it does not know what to do with.

nexus_warnSwitchGapChar = None

In Nexus data, the characters for gap and missing can be set to almost anything you like, but I like them to be ‘-‘ and ‘?’, which is more usual. So if needed, I switch them. Dodgy! – But at least I warn the user, unless that warning is turned off.

nexus_warnSwitchMissingChar = None

See Var.nexus_warnSwitchGapChar

nexus_writeVisibleComments
phylipDataMaxNameLength = None

The length of the taxon name in phylip data.

Unfortunately the phylip data format has a lot of variations. Even in the ‘official’ phylip data format, the name length is a compile-time variable. Its usually 10, tho. You can change it with this.

rMatrixNormalizeTo1
rMatrixProteinSpecs = None

A list of the currently available protein models.

sequenceLists = None

A list of SequenceList objects from files from the command line or from read()

strictRunNumberChecking = None

Require that MCMC run numbers are in order.

topologyDistanceMetrics = None

A list of metrics.

Used by Tree.Tree.topologyDistance() and Trees.Trees.topologyDistanceMatrix()

trees = None

Tree objects from files from the command line or from read()

verboseRead = None

Running commentary on p4’s attempts to read in files.

warnReadNoFile = None

If you give read() a string that is not a file, p4 points it out, in case its a mistake.

writeFastaUppercase = None

Whether fasta sequences are written in uppercase.