chain2psl.py - convert a chain file to a psl file

Tags

Genomics Intervals GenomeAlignment PSL CHAIN Conversion

Purpose

convert a UCSC chain formatted file to a UCSC psl formatted file.

This tool is equivalent to the UCSC tool chainToPsl except that it will not compute the number of matching, mismatching, etc. bases and thus does not require the sequences.

The nomenclature the UCSC uses for its chain files is targetToQuery.chain for mapping query to target (reference). According to the UCSC documentation, target is the first entry in chain files.

We have been using the nomenclature QueryToTarget.psl. In following this convention, the correct way to converting a psl file is:

python chain2psl.py < targetToQuery.chain > QueryToTarget.psl

If you would like to keep the TargetToQuery convention, you will need to add a pslSwap:

python chain2psl.py < targetToQuery.chain | pslSwap stdin stdout > targetToQuery.psl

Usage

For example:

cgat chain2psl.py < in.chain > out.psl

Type:

cgat chain2psl.py --help

for command line help.

Command line options

usage: chain2psl [-h] [--version] [--timeit TIMEIT_FILE]
                 [--timeit-name TIMEIT_NAME] [--timeit-header]
                 [--random-seed RANDOM_SEED] [-v LOGLEVEL]
                 [--log-config-filename LOG_CONFIG_FILENAME]
                 [--tracing {function}] [-? ?] [-I STDIN] [-L STDLOG]
                 [-E STDERR] [-S STDOUT]
chain2psl: error: argument -?: expected one argument