track.fasta-constructors: Track constructors for FASTA files

track.fasta-constructorsR Documentation

Track constructors for FASTA files

Description

Produces sliceable-inheriting objects to query "in situ" FASTA files.

track.fasta.multi is designed to handle a single multi-FASTA file aggregating all the chromosomes of an organism. An index as generated by the HTSlib (formerly "SAMtools") faidx command is required.

track.fasta.collection is designed to handle a collection of standard FASTA files, one per chromosome.

Usage

  track.fasta.multi(fastaFile, indexFile, .name, .organism, .assembly,
    .parameters, warn = TRUE)
  track.fasta.collection(files, chromosomes, .name, .organism, .assembly,
    .parameters, warn = TRUE)

Arguments

fastaFile

Single character value, the file name and path to a multi-FASTA file (.fa) to build a track upon.

indexFile

Single character value, the file name and path to a multi-FASTA index file (.fai) corresponding to fastaFile. This index file is supposd to be produced by the faidx command from SAMtools.

.name

Single character value, to fill the name field inherited from drawable.

.organism

Single character value, to fill the organism field of the object.

.assembly

Single character value, to fill the assembly field of the object.

.parameters

A list of drawing parameters, to fill the parameters field of the object.

warn

Single logical value, to be passed to the appropriate check method. Other conversion warnings rely on this value too in track.table.

files

Character vector, file names and paths to multiple single-FASTA file (.fa) to build a track upon (one per chromosome).

chromosomes

Character vector, chromosomes names to attribute to each file in files.

Details

Both functions suppose the FASTA files to respect the following :

  • They begin with a single line of comment, after a '>' sign.

  • All sequence lines have the same length (whatever it is).

  • The line separator (\n, \r\n) is always the same in a file.

  • No empty line.

Returned sequences may be wrong (without error or notice !) if any of these is not fullfilled. Standard sources (see below) usually enforce these conditions.

Value

An object of class track.fasta.

Author(s)

Sylvain Mareschal

References

Example of FASTA file collection (human assembly 'hg19'), from UCSC : http://hgdownload.soe.ucsc.edu/goldenPath/hg19/bigZips/chromFa.tar.gz

Example of single multi-FASTA file (human assembly 'hg19'), from 1000 genomes : ftp://ftp.1000genomes.ebi.ac.uk/vol1/ftp/technical/reference/human_g1k_v37.fasta.gz

The faidx documentation, from the HTSlib project.

See Also

track-constructors, Annotation

tk.browse, browsePlot


Rgb documentation built on Aug. 18, 2023, 5:05 p.m.