Skip to content

file utilities

Michael Alonge edited this page Nov 1, 2021 · 6 revisions

RagTag Version: v2.1.0

agp2fa

This utility builds sequence objects in FASTA format given an AGP file and components in FASTA format.

Usage

usage: ragtag.py agp2fa <scaffolds.agp> <components.fasta>

Build sequences in FASTA format from an AGP v2.1 file.

positional arguments:
  <scaffolds.agp>     AGP v2.1 file
  <components.fasta>  component FASTA file (can be uncompressed or bgzipped)

optional arguments:
  -h, --help          show this help message and exit

agpcheck

This utility checks that the provided AGP files are properly formatted. While agpcheck performs the majority of necessary checks, one should additionally use the NCBI AGP validation tool for a comprehensive validation.

If the file is invalid, an error message will be provided. Please see the AGP specification to interpret the error messages.

Usage

usage: ragtag.py agpcheck <asm1.agp> [<asm2.agp> ... <asmN.agp>]

Check AGP v2.1 files for validity.

positional arguments:
  <asm1.agp> [<asm2.agp> ... <asmN.agp>]
                        AGP v2.1 files

optional arguments:
  -h, --help            show this help message and exit

asmstats

This utility provides simple assembly stats for a variety of assembly file formats. Supply >1 file for a table of stats.

Usage

usage: ragtag.py asmstats [options] <in.fa>|<in.fa.fai>|<in.fa.sizes>|<in.gfa>|<in.agp> [...]

Calculate assembly sequence stats.

positional arguments:
  <in.fa>|<in.fa.fai>|<in.fa.sizes>|<in.gfa>|<in.agp> [...]
                        assembly files (bgzipped or uncompressed for FASTA)

optional arguments:
  -h, --help            show this help message and exit
  -g INT                genome size for NGx [null]

splitasm

This utility splits an assembly at gaps. 'splitasm' provides an AGP file that can be used along with the output fasta file to recreate the original assembly.

Usage

usage: ragtag.py splitasm <asm.fa>

Split sequencs at gaps

positional arguments:
  <asm.fa>    assembly fasta file (uncompressed or bgzipped)

optional arguments:
  -h, --help  show this help message and exit
  -n INT      minimum gap size [0]
  -o PATH     output AGP file path [./ragtag.splitasm.agp]

delta2paf

This utility converts a delta file to a PAF file.

Usage

usage: ragtag.py delta2paf <alns.delta>

Convert a Nucmer delta file to a PAF file.

positional arguments:
  <alns.delta>  delta file to convert.

optional arguments:
  -h, --help    show this help message and exit

paf2delta

This utility converts a PAF file to a delta file.

Usage

usage: ragtag.py paf2delta <with-cg.paf>

Convert a PAF file to a Nucmer delta file. PAF file lines must have CIGAR strings ('-c' when using Minimap2)

positional arguments:
  <with-cg.paf>  PAF file to convert (gzip allowed).

optional arguments:
  -h, --help     show this help message and exit
  -r PATH        PATH to there reference fasta file
  -q PATH        PATH to there query fasta file

updategff

This utility updates GFF coordinates to match a new RagTag 'correct' or 'scaffold' assembly. Since 'correct' and 'scaffold' never alter query sequences, GFF features can be exactly updated to refer to the new RagTag assembly coordinates. When updating coordinates to a corrected assembly with RagTag 'correct', be sure to use --gff to ensure that the query assembly is never broken inside of GFF features.

This is not a tool for inexact feature "liftover" (i.e. mapping features from a reference genome to an assembly from a distinct genotype/haplotype). For this, I recommend Liftoff.

Usage

usage: ragtag.py updategff [-c] <genes.gff> <ragtag.agp>

Update gff intervals given a RagTag AGP file

positional arguments:
  <genes.gff>     gff file
  <ragtag.*.agp>  agp file

optional arguments:
  -h, --help      show this help message and exit
  -c              update for misassembly correction (ragtag.correction.agp)
Clone this wiki locally