Merge Tables

Merge Tables takes two elements with table views as input and combines their contents into a single table (Image table_16_n_p) by matching rows based on one or more pairs of columns. If an input element has multiple table views, only its default table view is used.

To run the tool, go to:

        Tools | Utility Tools (Image utilities_closed_16_n_p) | Merge Tables (Image merge_tables_16_n_p)

The following options can be configured (figure 38.1):

Image merge_tables
Figure 38.1: Options for merging two tables. In this example, five columns are used from the first table and three from the second table. Rows are matched using two column pairs. Rows are merged when the values in both column pairs are equal.

The tool outputs a single merged table (Image table_16_n_p). When matching rows are found, their selected columns are combined in the output. Rows from either table without a match are also added to the merged table. The resulting columns are constructed as follows:

Consider the following example, where the two tables below are merged.

Sequence Start Name Match Type
seq1 629 Motif 1 AGTTTT Motif
seq1 629 Motif 3 AGTTTT Motif
seq1 1662 Motif 2 GGGGAC Motif
seq2 186 Motif 2 GGGGAC Motif

Name Annotation start Type
seq1 629 Type 1
seq2 186 Type 2
seq3 433 Type 3

where all columns are included and the following column pairs are used for matching: Sequence matches Name, and Start matches Annotation start. The resulting table will be:

Sequence Start Name Match Type (1) Type (2)
seq1 629 Motif 1 AGTTTT Motif Type 1
seq1 629 Motif 3 AGTTTT Motif Type 1
seq1 1662 Motif 2 GGGGAC Motif  
seq2 186 Motif 2 GGGGAC Motif Type 2
seq3 433       Type 3

Three rows from the first table have matching values in both column pairs. Two of these rows share the values (seq1, 629), while the third row has the values (seq2, 186). For each match, the columns from the second table are added to the output.

Rows from the first table without a corresponding match are added to the merged table, with empty values in columns originating from the second table. Likewise, rows from the second table without a corresponding match are added to the merged table, with empty values in columns originating from the first table.

Both Type and Name are present in both tables. These columns are handled as follows: