INGOR
Loading...
Searching...
No Matches
Public Member Functions | List of all members
ytTXT Class Reference

The TXT network file format consisting of parent-child pair edge list. More...

#include <ytTXT.h>

Public Member Functions

void ytTXT_write (FILE *fp, const ytNetwork *network, const ytKeyValues *args)
 Writes a network in parent child list text format.
 
ytNetworkytTXT_read (FILE *fp, const ytKeyValues *args)
 Reads a network file written in TXT format.
 

Detailed Description

The TXT network file format consisting of parent-child pair edge list.

This format is a tab-delimited text file where each row represents a single edge.

Columns

Parent

Parent node name.

Child

Child node name.

id

Edge index. The index origin can be changed by the argument. By default, the index begins with 1 (one). This is for processing the file by the R script.

parent.id

Parent node id.

child.id

Child node id.

name

(OPTIONAL) "Parent_Child" style edge name where Parent and Child represent the names of the parent and the child of the edge, respectively. This is enabled when "name" option is set when outputting. The binding character can be changed see ytTXT_write() for details.

NOTE: The default binding character was changed to "_" (underscore) from "-" (hyphen-minus) since rel. 0.9.0.

In addition to the above columns, edge properties are also written in separate columns.

The node properties are written in a column parent.* and child.* where "*" represents the original node property name.

If npropc is specified when writing, the same property of the parent and child nodes are written in a single column node.*, and values are concatinated by "|" (vertical bar) in the following rows.

See also
ytIO

Member Function Documentation

◆ ytTXT_read()

ytNetwork * ytTXT_read ( FILE *  fp,
const ytKeyValues args 
)

Reads a network file written in TXT format.

Options

skip=n (default: n =0)
The number of lines from the beginning to ignore.
header= ( on | off ) (default: on)
Whether the first line of the file is a header row. This takes the value of the skip arguments for account. That is, the header row comes after ignoring the specified lines.
type={ col_name = type,...}
Column value types.
use_index
Use index values of nodes in the file if available.

◆ ytTXT_write()

void ytTXT_write ( FILE *  fp,
const ytNetwork network,
const ytKeyValues args 
)

Writes a network in parent child list text format.

Arguments

header= ( on | off )
Whether or not to output the header row. (default: on)
origin= i
Index origin for columns id, parent.id, and child.id. (default: i =1)
full
If specified, nodes without any edges are also included. In such a case, it is written as a parent, and "NA" is set to its child.
npropc
The same type of node properties for parent and child nodes are written in a single column node.* where "*" represents the node property name.
na=str (default: "" (empty string))
String expression used for NA values.
name
Specifies to output the "name" column which shows "Parent_Child" style names of edges, where Parent and Child represents the names of the parent and child of the edge, respectively. The binding character ("_" by default) can be changed by the binder argument.
binder=str
The binding character used to output the "name" column. "_" (underscore) is used by default.
Parameters
fp
network
args

The documentation for this class was generated from the following file: