Skip to content

File Formats

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

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

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
}