Skip to content

File Formats

Niema Moshiri edited this page Dec 20, 2016 · 22 revisions

User Configuration File Format

The user configuration file format is a JSON file with certain restrictions. Specifically, it must be in the following format:

{
    "ContactNetwork":                "NetworkX",
    "Driver":                        "Default",
    "EndCriteria":                   "Transmissions",
    "NodeEvolution":                 "Dummy",
    "NodeSample":                    "Perfect",
    "PostValidation":                "Dummy",
    "SeedSelection":                 "Random",
    "SeedSequence":                  "Random",
    "SourceSample":                  "Dummy",
    "TransmissionNodeSample":        "Random",
    "TransmissionTimeSample":        "Fixed",
    "TreeNode":                      "DendroPy",
    "contact_network_file":          "~/GitHub/FAVITES/test/example_contact_network.txt",
    "end_transmissions":             2,
    "fixed_transmission_time_delta": 10,
    "num_seeds":                     1,
    "out_dir":                       "~/FAVITES_output",
    "seed_sequence_length":          100
}

You must specify an implementation for every module, and for any modules that have additional parameters, you must specify their respective parameters. The list of module implementations and their respective parameters can be found in modules/FAVITES_ModuleList.json. If you are missing anything in your configuration file, FAVITES will notify you what exactly is missing.

Contact Network File Format

For robustness to future development, we designed a file format similar to an edge list that must be used for the input Contact Network. The first portion of the file is a list of nodes, and the second portion is a list of edges.

  • "Node" lines have three tab-delimited sections:
    1. NODE (i.e., just the string NODE)
    2. This node's label
    3. Attributes of this node as comma-separated values, or a period (i.e., '.') if this node has no attributes
  • "Edge" lines have five tab-delimited sections:
    1. EDGE (i.e., just the string EDGE)
    2. The label of the node from which this edge leaves
    3. The label of the node to which this edge goes
    4. Attributes of this edge as comma-separated values, or a period (i.e., '.') if this edge has no attributes
    5. d (directed) or u (undirected) to denote whether or not this edge is directed (i.e., u -> v vs. u <-> v)
  • Lines beginning with the pound symbol (i.e., '#') and empty lines are ignored

Below is an example of this file format. Note that <TAB> is referring to a single tab character (i.e., '\t').

#NODE<TAB>label<TAB>attributes (csv or .)
#EDGE<TAB>u<TAB>v<TAB>attributes (csv or .)<TAB>(d)irected or (u)ndirected

NODE<TAB>Bill<TAB>USA,Mexico
NODE<TAB>Eric<TAB>USA
NODE<TAB>Curt<TAB>.
EDGE<TAB>Bill<TAB>Eric<TAB>.<TAB>d
EDGE<TAB>Curt<TAB>Eric<TAB>Friends<TAB>u

Transmission Network File Format

The file format of the transmission networks that are outputted by FAVITES are in the standard edge list format. Each line represents a single edge via three tab-delimited attributes:

  1. The label of the node from which this edge leaves
  2. The label of the node to which this edge goes
  3. The time at which this transmission event occurred

Below is an example of this file format. Note that <TAB> is referring to a single tab character (i.e., '\t').

Eric<TAB>Bill<TAB>1
Eric<TAB>Curt<TAB>2
Eric<TAB>Curt<TAB>3
Curt<TAB>Bill<TAB>4
Curt<TAB>Bill<TAB>5