Tool to generate a chain file from an agp file
Entering edit mode
7.4 years ago

Hi all,

here is some background to my question in the title: I have two genome versions, a scaffolded and unscaffolded one; as luck has it, the annotated version is the unscaffolded one. I would like to update the coordinates in the GFF file to the scaffolded version. I wanted to use crossMap ( for this, but I need a chain file. I already have an AGP file describing how the scaffolds were generated. I am thus looking for a tool that would convert the AGP tile to a chain file. Does such a tool exist?

agp crossmap gff chain • 4.1k views
Entering edit mode

Hi - did you figure this out?

Entering edit mode

No, I gave up on it. Sorry!

Entering edit mode

There is a bunch of scripts here, in particular, formats/ may do what you want.

Entering edit mode

liftUp from the Kent tools should do the job if I only could fire the right command! Anyone a working example from .agp to .chain?

liftUp - change coordinates of .psl, .agp, .gap, .gl, .out, .align, .gff, .gtf
.bscore .tab .gdup .axt .chain .net, .gp, .genepred, .wab, .bed, or .bed8 files to
parent coordinate system.

   liftUp [] destFile liftSpec how sourceFile(s)
The optional -type parameter tells what type of files to lift
If omitted the type is inferred from the suffix of destFile
Type is one of the suffixes described above.
DestFile will contain the merged and lifted source files,
with the coordinates translated as per liftSpec.  LiftSpec
is tab-delimited with each line of the form:
   offset oldName oldSize newName newSize
LiftSpec may optionally have a sixth column specifying + or - strand,
but strand is not supported for all input types.
The 'how' parameter controls what the program will do with
items which are not in the liftSpec.  It must be one of:
   carry - Items not in liftSpec are carried to dest without translation
   drop  - Items not in liftSpec are silently dropped from dest
   warn  - Items not in liftSpec are dropped.  A warning is issued
   error - Items not in liftSpec generate an error
If the destination is a .agp file then a 'large inserts' file
also needs to be included in the command line:
   liftUp dest.agp liftSpec how inserts sourceFile(s)
This file describes where large inserts due to heterochromitin
should be added. Use /dev/null and set -gapsize if there's not inserts file.

   -nohead  No header written for .psl files
   -dots=N Output a dot every N lines processed
   -pslQ  Lift query (rather than target) side of psl
   -axtQ  Lift query (rather than target) side of axt
   -chainQ  Lift query (rather than target) side of chain
   -netQ  Lift query (rather than target) side of net
   -wabaQ  Lift query (rather than target) side of waba alignment
      (waba lifts only work with query side at this time)
   -nosort Don't sort bed, gff, or gdup files, to save memory
   -gapsize change contig gapsize from default
   -ignoreVersions - Ignore NCBI-style version number in sequence ids of input files
   -extGenePred lift extended genePred
Entering edit mode
6.4 years ago
Malcolm.Cook ★ 1.5k

Yes. ALLMAPS has which can do this.

Example: fromagp my.agp unscaffolded.fa scaffolded.fa > my.chain

Login before adding your answer.

Traffic: 2564 users visited in the last hour
Help About
Access RSS

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6