fetch-sequences
$program_version
Retrieve genome sequences for a set of coordinates specified in a bed file.
- Jacques van Helden <Jacques.van-Helden\@univ-amu.fr>
Adapted from a script developed by Carl Herrmann.
genomics
sequences
fetch-sequences [-i bedfile] [-o seqfile] [-v #] [...]
Examples
- Retrieve peaks identified by the peak-calling program MACS.
- fetch-sequences -i MACS_output_peaks.bed -genome mm8
- To retrieve regions of fixed width (200bp) centred on the peak summitsreturned by MACS.
- fetch-sequences -i MACS_output_summits.bed -genome mm8 -extend 100
The definition of the BED format is provided on the UCSC Genome Browser web site (http://genome.ucsc.edu/FAQ/FAQformat#format1).
The first three required BED fields are:
- Chrom
The name of the chromosome (e.g. chr3, chrY, chr2_random) or scaffold (e.g. scaffold10671).
- ChromStart
The starting position of the feature in the chromosome or scaffold.
The first base in a chromosome is numbered 0.
- ChromEnd
The ending position of the feature in the chromosome or scaffold.
The chromEnd base is not included in the display of the feature. For example, the first 100 bases of a chromosome are defined as chromStart=0, chromEnd=100, and span the bases numbered 0-99.
The 9 additional optional BED fields are:
- Name
Defines the name of the BED line. This label is displayed to the left of the BED line in the Genome Browser window when the track is open to full display mode or directly to the left of the item in pack mode.
- Score
A score between 0 and 1000. If the track line useScore attribute is set to 1 for this annotation data set, the score value will determine the level of gray in which this feature is displayed (higher numbers = darker gray).
- Strand
Defines the strand - either '+' or '-'.
- ThickStart
The starting position at which the feature is drawn thickly (for example, the start codon in gene displays).
- ThickEnd
The ending position at which the feature is drawn thickly (for example, the stop codon in gene displays).
- ItemRgb
An RGB value of the form R,G,B (e.g. 255,0,0). If the track line itemRgb attribute is set to "On", this RBG value will determine the display color of the data contained in this BED line. NOTE: It is recommended that a simple color scheme (eight colors or less) be used with this attribute to avoid overwhelming the color resources of the Genome Browser and your Internet browser.
- BlockCount
The number of blocks (exons) in the BED line.
- BlockSizes
A comma-separated list of the block sizes. The number of items in this list should correspond to blockCount.
- BlockStarts
A comma-separated list of block starts. All of the blockStart positions should be calculated relative to chromStart. The number of items in this list should correspond to blockCount.
Sequences are exported in fasta format.
- -v #
- Level of verbosity (detail in the warning messages during execution)
- -h
- Display full help message
- -help
- Same as -h
- -i inputfile
- The input file should be in bed format (see section INPUT FORMATS above).
- If no input file is specified, the standard input is used. This allows to use the command within a pipe.
- -genome genome_version (mandatory)
- Genome version (e.g. mm9, hg19).
- -header_format header_format
- Format for sequence headers.
- Supported header formats.
- - UCSC (default)
- - galaxy
- -upstr_ext #
- Extend each region by # base pairs on the upstream side (i.e. left side for + strands, right side for - strand).
- Under others, this option is convenient to retrieve regions of fixed width around the summits of peak calling results (e.g. summit file produced by MACS).
- -downstr_ext #
- Extend each region by # base pairs on the downstream side (i.e. right for + strand, left for - strand).
- -extend #
- Extend each region by # base pairs on both upstream and downstream sides.
- -reference segment|end|start
- Reference from which the sequences should be fetched.
- segment (default)
- Retrieve sequences from the start to the end positions of each feature (possibly extended with the options -upstr_ext, -downstr_ext or -extend).
- start | end
- Retrieve sequences relative to repsectively the start or the end position of each feature.
- This option is generally combined with the options -upstr_ext, -downstr_ext or -extend, in order to retrieve sequences of a fixed width around the end coordinate.
- -top #
- Only consider the # top features of the bed file as queries.
- This option is convenient for restricting the number of peak sequences, and for testing.
- -chunk #
- Send queries to UCSC by chunk of # features (default: chunk=10000).
- This can be useful to fix problems of timeout, which can occur if too many queries are sent to UCSC in one shot.
- -o outputfile
- The output file is in fasta format.
- If no output file is specified, the standard output is used. This allows to use the command within a pipe.
- peak-motifs
- A common utilization of fetch-sequences is to retrieve UCSC sequences for the peak coordinates produced by a peak calling program (e.g. MACS, SICER, SWEMBL, ...).
- -maf
- Get multi-genome alignment files instead of single-genome sequence.
- The maf output requires to specify either a taxon (option -taxon) or a list of organisms (option -org_list organism_file.txt).
- -taxon
- Taxonomic level for multi-genome alignment files.
- -mask
- Add support for UCSC masking options (coding, repetitive, ...).
- For the time being, all sequences are transformed to uppercases.