NAME

gonz_unmap.pl - unmap or remap identifiers/strings using a given id mapping

SYNOPSIS

 Usage: gonz_unmap.pl [OPTIONS] <map_file> <input_file> <output_file>

 gonz_unmap.pl will (un)map or remap identifiers of tables using a given id
 mapping. All input files are exptected to be tab-separated. Column numbers
 are zero-based.

 Examples:
   gonz_unmap.pl --from 0 --to 1 --col 0 map.tsv data.tsv data.unmapped.tsv
   # remaps column 0 (the 1st column) of data.tsv using the mapping of 
   # column 0 -> column 1 in map.tsv and saves it to data.unmapped.tsv.

OPTIONS:

 -?, --help               show the full help with all options explained

 -k, --from
 -v, --to
 -m, --col=<NUMBER>
     --skip_na
     --comment=<REGEX>
     --keep
 -h, --header
     --filter=<REGEX>
     --na_prefix=<STRING>
     --na_suffix=<STRING>
     --multi
 

SEE ALSO

OPTIONS

--from

The column to match the ids against

--to

If the from column has a match, output the id in column to.

--col

The columns that should be mapped. Can be used multiple times to map multiple columns with the same mapping at the same time.

--skip_na

Do only output sucessfully mapped ids/strings.

(usually gonz_unmap.pl dies if a mapping fails)

--comment=<REGEX>

The data input has comments of the form <REGEX>, just copy it directly to the output.

--keep

Do not replace the ids in the col-column, but add a new column after it with the mapped ids.

--header

The data file has a header, just copy it directly to the output.

--filter=<REGEX>

Prefilter the input data by <REGEX >

--na_prefix=<STRING>

Prefix the original ids with <STRING> and take the prefixed version as mapped id.

(usually gonz_unmap.pl dies if a mapping fails)

--na_suffix

Add the suffix <STRING> the original ids and take the suffixed version as mapped id.

(usually gonz_unmap.pl dies if a mapping fails)

--multi

If one id (from) maps to multiple ids (to), output all mappings. Default is to take the last encountered (from,to)-pair as mapping entry.

AUTHOR

jw bargsten, <jwb at cpan dot org>