The cl-sam Reference Manual

This is the cl-sam Reference Manual, version 0.16.0, generated automatically by Declt version 4.0 beta 2 "William Riker" on Mon Feb 26 15:38:31 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

The main system appears first, followed by any subsystem dependency.


2.1 cl-sam

Toolkit for manipulation of DNA sequence alignment data stored in the Sequence Alignment/Map (SAM) format.

Author

Keith James

License

GPL v3

Version

0.16.0

Dependencies
  • deoxybyte-systems (system)., at least version "1.0.0"
  • deoxybyte-gzip (system)., at least version "0.6.0"
  • deoxybyte-unix (system)., at least version "0.8.0"
Source

cl-sam.asd.

Child Component

cl-sam (module).


3 Modules

Modules are listed depth-first from the system components tree.


3.1 cl-sam/cl-sam

Source

cl-sam.asd.

Parent Component

cl-sam (system).

Child Components

4 Files

Files are sorted by type and then listed depth-first from the systems components trees.


4.1 Lisp


4.1.1 cl-sam/cl-sam.asd

Source

cl-sam.asd.

Parent Component

cl-sam (system).

ASDF Systems

cl-sam.


4.1.2 cl-sam/cl-sam/package.lisp

Source

cl-sam.asd.

Parent Component

cl-sam (module).

Packages

4.1.3 cl-sam/cl-sam/conditions.lisp

Dependency

package.lisp (file).

Source

cl-sam.asd.

Parent Component

cl-sam (module).

Public Interface
Internals

4.1.4 cl-sam/cl-sam/bgzf.lisp

Dependency

conditions.lisp (file).

Source

cl-sam.asd.

Parent Component

cl-sam (module).

Public Interface
Internals

4.1.5 cl-sam/cl-sam/bgzf-reader.lisp

Dependency

bgzf.lisp (file).

Source

cl-sam.asd.

Parent Component

cl-sam (module).

Internals

4.1.6 cl-sam/cl-sam/bgzf-writer.lisp

Dependency

bgzf-reader.lisp (file).

Source

cl-sam.asd.

Parent Component

cl-sam (module).

Internals

4.1.7 cl-sam/cl-sam/bgzip-stream.lisp

Dependency

bgzf-writer.lisp (file).

Source

cl-sam.asd.

Parent Component

cl-sam (module).

Public Interface
Internals

4.1.8 cl-sam/cl-sam/sam.lisp

Dependency

bgzip-stream.lisp (file).

Source

cl-sam.asd.

Parent Component

cl-sam (module).

Public Interface
Internals

4.1.9 cl-sam/cl-sam/bam.lisp

Dependency

sam.lisp (file).

Source

cl-sam.asd.

Parent Component

cl-sam (module).

Public Interface
Internals

4.1.10 cl-sam/cl-sam/bam-index.lisp

Dependency

bam.lisp (file).

Source

cl-sam.asd.

Parent Component

cl-sam (module).

Public Interface
Internals

4.1.11 cl-sam/cl-sam/bam-index-reader.lisp

Dependency

bam-index.lisp (file).

Source

cl-sam.asd.

Parent Component

cl-sam (module).

Public Interface
Internals

4.1.12 cl-sam/cl-sam/bam-index-writer.lisp

Dependency

bam-index-reader.lisp (file).

Source

cl-sam.asd.

Parent Component

cl-sam (module).

Public Interface

write-bam-index (generic function).

Internals

4.1.13 cl-sam/cl-sam/bam-indexer.lisp

Dependency

bam-index-writer.lisp (file).

Source

cl-sam.asd.

Parent Component

cl-sam (module).

Public Interface

index-bam-file (function).

Internals

4.1.14 cl-sam/cl-sam/bam-reader.lisp

Dependency

bam-indexer.lisp (file).

Source

cl-sam.asd.

Parent Component

cl-sam (module).

Public Interface
Internals

4.1.15 cl-sam/cl-sam/bam-writer.lisp

Dependency

bam-reader.lisp (file).

Source

cl-sam.asd.

Parent Component

cl-sam (module).

Public Interface

4.1.16 cl-sam/cl-sam/sam-writer.lisp

Dependency

bam-writer.lisp (file).

Source

cl-sam.asd.

Parent Component

cl-sam (module).

Public Interface
Internals

4.1.17 cl-sam/cl-sam/external-bam-sort.lisp

Dependency

sam-writer.lisp (file).

Source

cl-sam.asd.

Parent Component

cl-sam (module).

Public Interface
Internals

4.1.18 cl-sam/cl-sam/bam-utilities.lisp

Dependency

external-bam-sort.lisp (file).

Source

cl-sam.asd.

Parent Component

cl-sam (module).

Public Interface
Internals

4.1.19 cl-sam/cl-sam/cl-sam.lisp

Dependency

bam-utilities.lisp (file).

Source

cl-sam.asd.

Parent Component

cl-sam (module).

Public Interface
Internals

stream-view-sam (function).


5 Packages

Packages are listed by definition order.


5.1 sam

cl-sam is a Common Lisp toolkit for manipulation of
DNA sequence alignment data stored in the Sequence Alignment/Map (SAM) format <http://samtools.sourceforge.net>. The SAM specficiation describes text (SAM) and binary (BAM) formats.

cl-sam uses the BGZF block compression code from the SAMtools C toolkit, but is otherwise an independent Lisp implementation capable
of editing every aspect of BAM files or creating BAM data de novo.

The following example implements something similar to samtools flagstat:

;;; (with-bgzf (bgzf "example.bam" :direction :input)
;;; (multiple-value-bind (header num-refs ref-meta)
;;; (read-bam-meta bgzf)
;;; (format t "BAM header: ~s~%" header)
;;; (format t "Number of references: ~d~%" num-refs)
;;; (loop
;;; for (id name length) in ref-meta
;;; do (format t "Reference name: ~s Length: ~d~%" id name length))) ;;; (loop
;;; for alignment = (read-alignment bgzf)
;;; while alignment
;;; for flag = (alignment-flag alignment)
;;; count flag into total
;;; count (fails-platform-qc-p flag) into qc-fail
;;; count (pcr/optical-duplicate-p flag) into duplicates
;;; count (not (query-unmapped-p flag)) into mapped
;;; count (sequenced-pair-p flag) into seq-paired
;;; count (first-in-pair-p flag) into read1
;;; count (second-in-pair-p flag) into read2
;;; count (mapped-proper-pair-p flag) into proper-paired
;;; count (and (not (query-unmapped-p flag))
;;; (not (mate-unmapped-p flag))) into both-mapped
;;; count (mate-unmapped-p flag) into singletons
;;; finally (format t (str "~d in total~%"
;;; "~d QC failure~%"
;;; "~d duplicates~%"
;;; "~d mapped (~$%)~%"
;;; "~d paired in sequencing~%"
;;; "~d read1~%"
;;; "~d read2~%"
;;; "~d properly paired (~$%)~%"
;;; "~d both mapped~%"
;;; "~d singletons (~$%)~%")
;;; total qc-fail duplicates mapped
;;; (* 100 (/ mapped total))
;;; seq-paired read1 read2 proper-paired
;;; (* 100 (/ proper-paired total))
;;; both-mapped singletons
;;; (* 100 (/ singletons total)))))

Source

package.lisp.

Use List
  • cffi.
  • common-lisp.
  • uk.co.deoxybyte-io.
  • uk.co.deoxybyte-utilities.
Public Interface
Internals

5.2 bgzf-ffi

A foreign function interface to the block gzip
functions provided by the Broad Institute. See bgzf.h in the SAMtools package for function documentation.

Source

package.lisp.

Use List
  • cffi.
  • common-lisp.

6 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


6.1 Public Interface


6.1.1 Special variables

Special Variable: *sam-version*

The SAM version written by cl-sam.

Package

sam.

Source

sam.lisp.


6.1.2 Macros

Macro: define-alignment-tag (tag value-type &optional docstring)

Defines a new alignment tag to hold a datum of a particular SAM type.

Arguments:

- tag (symbol): The tag e.g. :rg
- value-type (symbol): The value type, one of :char , :string , :hex :int32 or :float .

Optional:

- docstring (string): Documentation for the tag.

Package

sam.

Source

bam.lisp.

Macro: with-bam ((var (&optional header num-refs ref-meta) filespec &rest args &key compress-header pad-header index regions &allow-other-keys) &body body)

Evaluates BODY with VAR bound to a new BAM generator function on pathname designator FILESPEC. The direction (:input versus :output) is determined by the stream-opening arguments in ARGS. The standard generator interface functions NEXT and HAS-MORE-P may be used in operations on the returned generator.

On reading, HEADER, NUM-REFS and REF-META will be automatically bound to the BAM file metadata i.e. the metadata are read automatically and the iterator positioned before the first alignment record.

Optionally, iteration may be restricted to a specific reference, designated by REF-NUM and to alignments that start between reference positions START and END. Furthermore, a BAM-INDEX object INDEX may be provided to allow the stream to seek directly to the desired region of the file.

On writing, HEADER, NUM-REFS and REF-META should be bound to appropriate values for the BAM file metadata, which will be automatically written to the underlying stream.

The COMPRESS-HEADER and PAD-HEADER keyword arguments are only applicable on writing where they control whether the records and header block should be compressed and whether the header string should be padded with nulls to allow space for expansion. Writing an uncompressed, padded header means that a header that fits in the first BGZF block may be updated without re-writing the entire BAM file. The BGZF COMPRESSION keyword is also accepted, permitting the Zlib compression level to be set for the stream.

A list REGIONS may be supplied to limit the returned alignments to specific references and reference coordinates. REGIONS may be region objects or region designators in the form of list tuples

;;; (<reference designator> start end)

where a reference designator is either the reference name string or its identifier number in the BAM file. REGIONS will be normalised automatically by sorting according to reference position in the BAM file (according to the BAM metadata) and then by start and
end. Overlapping regions will be merged.

For example:

To count all records in a BAM file:

;;; (with-bam (in () "in.bam")
;;; (loop
;;; while (has-more-p in)
;;; count (next in)))

To copy only records with a mapping quality of >= 30 to another BAM file:

;;; (with-bam (in (header n ref-meta) "in.bam")
;;; (with-bam (out (header n rer-meta) "out.bam" :direction :output) ;;; (let ((q30 (discarding-if (lambda (x)
;;; (< (mapping-quality x) 30)) in))) ;;; (loop
;;; while (has-more-p q30)
;;; do (consume out (next q30))))))

To count records with mapping quality of >= 30 in a set of genomic ranges, using an index:

;;; (with-bam-index (index "index.bai")
;;; (with-bam (bam () bam-file :index index
;;; :regions ’((0 1000000 1100000) (1 1000000 1100000))) ;;; (loop
;;; while (has-more-p bam)
;;; count (>= (mapping-quality (next bam)) 30))))

Package

sam.

Source

bam.lisp.

Macro: with-bam-index ((var filespec) &body body)

Evaluates BODY with VAR bound to a BAM-INDEX read from file denoted by pathname designator FILESPEC.

Package

sam.

Source

bam-index-reader.lisp.

Macro: with-bgzf ((var filespec &rest args) &body body)

Executes BODY with VAR bound to a BGZF handle structure created by opening the file denoted by FILESPEC.

Arguments:

- var (symbol): The symbol to be bound.
- filespec (pathname designator): The file to open.

Rest:

- args: Arguments applicable to bgzf-open.

Package

sam.

Source

bgzf.lisp.

Macro: with-open-bgzip ((var filespec &rest args) &body body)
Package

sam.

Source

bgzip-stream.lisp.


6.1.3 Ordinary functions

Function: add-pg-record (header new-record)

Returns a copy of HEADER with PG record NEW-RECORD added. If the ID of NEW-RECORD clashes with existing IDs, all IDs are remapped to new, generated sequential integer IDs, starting at 0. PP links are also updated. NEW-RECORD must have its PP field set by the caller.

Package

sam.

Source

sam.lisp.

Function: alignment-bin (aln)

Returns an integer that indicates the alignment bin to which ALN has been assigned.

Package

sam.

Source

bam.lisp.

Function: alignment-cigar (aln)

Returns the CIGAR record list of the alignment described by
ALN. CIGAR operations are given as a list, each member being a list of a CIGAR operation keyword and an integer operation length.

Package

sam.

Source

bam.lisp.

Function: alignment-core (aln &key validate)

Returns a list of the core data described by ALN. The list elements are comprised of reference-id, alignment-position, read-name length, mapping-quality alignment-bin, cigar length, alignment flag, read length, mate reference-id, mate alignment-position and insert length.

Package

sam.

Source

bam.lisp.

Function: alignment-core-alist (aln &key validate)

Returns the same data as {defun alignment-core} in the form of an alist.

Package

sam.

Source

bam.lisp.

Function: alignment-flag (aln &key validate)

Returns an integer whose bits are flags that describe properties of the ALN. If the VALIDATE key is T (the default) the flag’s bits are checked for internal consistency.

Package

sam.

Source

bam.lisp.

Function: alignment-flag-alist (aln &key validate)

Returns the bitwise flags of ALN in the form of an alist. The primary purpose of this function is debugging.

Package

sam.

Source

bam.lisp.

Function: alignment-generator (reference-id read-group &key read-length name-suffix insert-length start end step-size mapping-quality seq-fn quality-fn)

Returns a new standard generator function which returns pairs of
BAM alignment records.

Arguments:

- reference-id (integer): The BAM reference identifier.
- read-group (string): The read group name.

Key:

- read-length (integer): The read length.
- insert-length (integer): The insert length, defined as the distance between the inner boundaries of the paired alignments.
- start (integer): The position at which to start generating alignments. - end (integer): The position at which to stop generating alignments, expressed in Lisp vector indices (zero-based, half-open), rather than BAM’s (zero-based, closed).
- step-size (integer): The distance between each successive pair of alignments.
- mapping-quality (integer): The mapping quality of the alignments.

Returns

- A function.

Package

sam.

Source

bam-utilities.lisp.

Function: alignment-name< (alignment-record1 alignment-record2)

Returns T if ALIGNMENT-RECORD1 sorts before ALIGNMENT-RECORD2 by read name. Sorting semantics of read names are not fully defined in the SAM spec; whether you should expect natural order or numeric order of read name strings is not defined.

This function compares numerically by read name, then by alignment template region for reads paired in sequencing and finally by alignment strand.

Package

sam.

Source

external-bam-sort.lisp.

Function: alignment-not-primary-p (flag)

Returns T if FLAG indicates that the read mapping was not the primary mapping to a reference, or NIL otherwise.

Package

sam.

Source

bam.lisp.

Function: alignment-orphanizer (gen &key test)

Given an alignment generator function GEN, returns a new function that omits some alignments, yielding orphans. Any alignments for which TEST returns T will be omitted. The default is to omit alternate last fragment alignments.

Package

sam.

Source

bam-utilities.lisp.

Function: alignment-position (aln)

Returns the 0-based sequence coordinate of ALN in the reference sequence of the first base of the clipped read.

Package

sam.

Source

bam.lisp.

Function: alignment-record< (alignment-record1 alignment-record2)

Returns T if ALIGNMENT-RECORD1 sorts before
ALIGNMENT-RECORD2. Sorting semantics are not fully defined in the SAM spec, however, an informal consensus on sequence order sorting seems to be:

- mapped reads should first be sorted by their reference in the order in which reference sequences appear in the header
- unmapped reads should sort after mapped reads
- reads mapped to the same reference must appear in ascending order of their alignment position

This function compares first by reference sequence, then alignment position, by alignment strand and finally by read name. The output is identical to a coordinate sort performed by Picard 1.07.

Package

sam.

Source

external-bam-sort.lisp.

Function: alignment-reference-end (aln)

Returns the end position of the alignment on the reference. Requires decoding the CIGAR string.

Package

sam.

Source

bam.lisp.

Function: alignment-tag-values (aln)

Returns an alist of tag and values described by ALN.

Package

sam.

Source

bam.lisp.

Reader: bam-index-refs (instance)
Writer: (setf bam-index-refs) (instance)
Package

sam.

Source

bam-index.lisp.

Target Slot

refs.

Function: bam-sort-error (previous-ref previous-pos ref pos &optional message &rest message-arguments)
Package

sam.

Source

bam.lisp.

Function: bgzf-close (bgzf)

Closes an open block gzip file.

Arguments:

- bgzf (bgzf structure): The file to close.

Returns:

- T on success.

Package

sam.

Source

bgzf.lisp.

Function: bgzf-eof-p (bgzf)

Returns T if the BGZF stream is terminated by an empty record.

Package

sam.

Source

bgzf.lisp.

Function: bgzf-open (bgzfspec &rest args &key compression &allow-other-keys)

Opens a block gzip file for reading or writing.

Arguments:

- bgzfspec (pathname designator, open stream or bgzf object): The file to open or an open stream or bgzf object (which is returned unmodified). The *standard-input* or *standard-ouput* streams may be used.

Key:

- compression (keyword): The zlib compression level (for writing).

Also accepts the keyword arguments applicable to CL:OPEN. However,
an :element-type argument will be ignored as the type is always octet.

Returns:

- A BGZF structure.

Package

sam.

Source

bgzf.lisp.

Function: bgzf-open-p (bgzf)
Package

sam.

Source

bgzf.lisp.

Function: bgzf-seek (bgzf position)

Seeks with the file encapsulated by a block gzip file.

Arguments:

- bgzf (bgzf structure): The handle to seek.

- position (integer): The position to seek. Only values previously returned by {defun bgzf-tell} may be used. The most significant 48 bits denote the real file position and the least significant 16 bits the offset within the uncompressed gzip member (see the SAM spec).

Returns:

- The new position.

Package

sam.

Source

bgzf.lisp.

Function: bgzf-tell (bgzf)

Returns the current position in the encapsulated file of a block gzip file.

Arguments:

- bgzf (bgzf structure): The file.

Returns:

- The file position.

Package

sam.

Source

bgzf.lisp.

Function: bgzip-open (filespec &key direction)

Opens a block gzip stream for FILESPEC.

Key:

- direction (symbol): One of :input (the default) or :output

Returns:

- A {defclass bgzip-stream}

Package

sam.

Source

bgzip-stream.lisp.

Function: bin-chunk (bin chunk-num)

Returns the chunk number CHUNK-NUM in BIN.

Package

sam.

Source

bam-index.lisp.

Reader: bin-chunks (instance)
Writer: (setf bin-chunks) (instance)
Package

sam.

Source

bam-index.lisp.

Target Slot

chunks.

Reader: bin-num (instance)
Package

sam.

Source

bam-index.lisp.

Target Slot

num.

Reader: chunk-end (instance)
Writer: (setf chunk-end) (instance)
Package

sam.

Source

bam-index.lisp.

Target Slot

end.

Reader: chunk-start (instance)
Writer: (setf chunk-start) (instance)
Package

sam.

Source

bam-index.lisp.

Target Slot

start.

Function: cigar-length (aln)

Returns the number of CIGAR operations in ALN.

Package

sam.

Source

bam.lisp.

Function: coordinate-sorted-p (header)

Returns T if parsed HEADER indicates that the file is sorted by coordinate, or NIL otherwise.

Package

sam.

Source

sam.lisp.

Function: copy-alignment-record (aln &key alignment-flag reference-id alignment-pos mate-reference-id mate-alignment-pos mapping-quality alignment-bin insert-length cigar tag-values)

Returns a copy of ALN, optionally setting some fields to new values.

Package

sam.

Source

bam.lisp.

Function: empty-bin-p (bin)

Returns T if BIN contains no chunks, or NIL otherwise.

Package

sam.

Source

bam-index.lisp.

Function: ensure-mandatory-header-tags (record)

Returns HEADER-RECORD if all mandatory tags are present, or raises a {define-condition malformed-record-error} .

Package

sam.

Source

sam.lisp.

Function: ensure-valid-header-tags (record)

Checks list HEADER-RECORD for tag validity and returns HEADER-RECORD or raises a {define-condition malformed-record-error} if invalid tags are present. Ignores any user tags (lower case tags).

Package

sam.

Source

sam.lisp.

Function: ensure-valid-programs (header)

Returns HEADER if its PG records have unique ID tag values and valid PP tag values. A valid PP tag must point to the ID of one of the other PG records in the header.

Package

sam.

Source

sam.lisp.

Function: fails-platform-qc-p (flag)

Returns T if FLAG indicates that the read failed plaform quality control, or NIL otherwise.

Package

sam.

Source

bam.lisp.

Function: find-bam-index (bam-filespec)

Returns the pathname of an index file for BAM-FILESPEC, if the file is present and conforms to the naming convention of either Picard or Samtools. If both are present, the Picard convention is favoured.

Package

sam.

Source

bam-index.lisp.

Function: find-bins (index reference-id start end)

Returns a list of all the bins for reference REFERENCE-ID in INDEX, between reference positions START and END.

Package

sam.

Source

bam-index.lisp.

Function: first-frag-p (flag)

Returns T if FLAG indicates that the read was the first in a pair of reads from one template, or NIL otherwise.

Package

sam.

Alias for

first-in-pair-p.

Function: first-in-pair-p (flag)

Returns T if FLAG indicates that the read was the first in a pair of reads from one template, or NIL otherwise.

Package

sam.

Source

bam.lisp.

Function: flag-bits (flag &rest bit-names)

Returns an integer FLAG that had BAM flag bits named by symbols BIT-NAMES set.

Arguments:

- flag (unsigned-byte 8): a BAM alignment flag.

Rest:

- bit-names (symbols): Any number of valid bit flag names:

;;; :sequenced-pair
;;; :mapped-proper-pair
;;; :query-mapped , :query-unmapped
;;; :mate-mapped , :mate-unmapped
;;; :query-forward , :query-reverse
;;; :mate-forward , :mate-reverse
;;; :first-in-pair , :second-in-pair
;;; :alignment-primary , :alignment-not-primary
;;; :fails-platform-qc
;;; :pcr/optical-duplicate

Returns:

- An (unsigned-byte 8)

Package

sam.

Source

bam.lisp.

Function: flagstat (bam-filespec &optional stream)

Writes SAM flag counts from BAM-FILESPEC to STREAM.

Package

sam.

Source

cl-sam.lisp.

Function: frag-forward-p (flag)

Returns T if FLAG indicates that the read was mapped to the forward strand of a reference, or NIL if it was mapped to the reverse strand.

Package

sam.

Alias for

query-forward-p.

Function: frag-mapped-p (flag)

Returns T if FLAG indicates that the read’s mate was mapped to a reference, or NIL otherwise.

Package

sam.

Alias for

query-mapped-p.

Function: frag-reverse-p (flag)

Returns T if FLAG indicates that the read was mapped to the reverse strand of a reference, or NIL if it was mapped to the forward strand.

Package

sam.

Alias for

query-reverse-p.

Function: frag-unmapped-p (flag)

Returns T if FLAG indicates that the read was not mapped to a reference, or NIL otherwise.

Package

sam.

Alias for

query-unmapped-p.

Function: generate-bam-file (filespec num-refs ref-length read-groups &rest aln-generators)

Writes a very uniform BAM file to the file denoted by pathname designator FILESPEC, for testing purposes.

Arguments:

- filespec (pathname designator): The BAM file to be written.
- num-refs (integer): The number of reference sequences in the BAM header. - read-groups (list of string): The read group names in the BAM header. Each reference will have a set of reads generated in each read group.

Rest:

- aln-generators (list of function): A list of alignment generator functions created with {defun alignment-generator} function. All of these functions will be called until exhausted, so they should represent finite sequences.

Returns

- filespec.

Package

sam.

Source

bam-utilities.lisp.

Function: generate-reference-file (filespec name length &optional fn)

Creates an artificial reference genome Fasta file to accompany a generated BAM file.

Arguments:

- filespec (pathname designator): The file to create.
- name (string): The name of the reference sequence.
- length (integer): The length of the reference sequence.

Optional:

- fn (function): A function that returns a single base character. The default randomly returns a, c, g or t in equal proportions.

Returns:

- The filespec.

Package

sam.

Source

bam-utilities.lisp.

Function: hd-record (&key version sort-order)

Returns a new HD record.

Package

sam.

Source

sam.lisp.

Function: header-records (header header-type)

Returns a list of all records of HEADER-TYPE from HEADER.

Package

sam.

Source

sam.lisp.

Function: header-tags (record)

Returns an alist of the tag-values of RECORD.

Package

sam.

Source

sam.lisp.

Function: header-type (record)

Returns a symbol indicating the header-type of RECORD, being one of :HD , :SQ , :RG or :PG .

Package

sam.

Source

sam.lisp.

Function: header-value (record tag)

Returns the value associated with TAG in RECORD.

Package

sam.

Source

sam.lisp.

Function: index-bam-file (filespec)

Returns a new BAM-INDEX object, given pathname designator FILESPEC.

Package

sam.

Source

bam-indexer.lisp.

Function: insert-length (aln)

Returns the insert length described by ALN.

Package

sam.

Source

bam.lisp.

Function: last-frag-p (flag)

Returns T if FLAG indicates that the read was the second in a pair of reads from one template, or NIL otherwise.

Package

sam.

Alias for

second-in-pair-p.

Function: last-programs (header)

Returns a list of the PG ID values from HEADER that are the last programs to act on the data. i.e. these are the leaf programs in the previous program tree.

Package

sam.

Source

sam.lisp.

Function: make-alignment-record (read-name seq-str alignment-flag &key reference-id alignment-pos mate-reference-id mate-alignment-pos mapping-quality alignment-bin insert-length cigar quality-str tag-values)

Returns a new alignment record array.

Arguments:

- read-name (string): The read name.
- seq-str (string): The read sequence.
- alignment-flag (integer): The binary alignment flag.

Key:

- reference-id (integer): The reference identifier, defaults to -1
- alignment-pos (integer): The 1-based alignment position, defaults to -1. - mate-reference-id (integer): The reference identifier of the mate, defaults to -1.
- mate-alignment-pos (integer): The 1-based alignment position of the mate. - mapping-quality (integer): The mapping quality, defaults to 0.
- alignment-bin (integer): The alignment bin, defaults to 0.
- insert-length (integer): The insert size, defaults to 0.
- cigar (alist): The cigar represented as an alist of operations e.g.

;;; ’((:M . 9) (:I . 1) (:M . 25))

- quality-str (string): The read quality string.
- tag-values (alist): The alignment tags represented as an alist e.g.

;;; ’((:XT . #U) (:NM . 1) (:X0 . 1) (:X1 . 0)
;;; (:XM . 1) (:XO . 0) (:XG . 0) (:MD . "3T31"))

The tags must have been defined with {defmacro define-alignment-tag} .

Returns:

- A vector of ’(unsigned-byte 8).

Package

sam.

Source

bam.lisp.

Function: make-bam-output (bam)

Returns a consumer function that accepts an argument of a BAM record and writes it to BAM output stream BAM. The standard consumer interface function CONSUME may be used in operations on the returned consumer.

Package

sam.

Source

bam-writer.lisp.

Function: make-header-record (str)

Parses a single SAM header record STR and returns a list. May raise a {define-condition malformed-record-error} or {define-condition malformed-field-error} . SAM tags are converted to keyword symbols.

Given a header record of

;;; "@SQ SN:AL096846 LN:6490 SP:Schizosaccharomyces pombe"

the returned list will be

;;; (:SQ (:SN . "AL096846") (:LN . 6490)
;;; (:SP . "Schizosaccharomyces pombe"))

thus the list’s first element is a keyword describing the record type and the rest of the list is itself an alist of record keys and values.

Package

sam.

Source

sam.lisp.

Function: make-reference-table (ref-meta-list)

Returns a hash-table mapping reference identifiers to reference names for the reference data in REF-META-LIST.

Package

sam.

Source

bam.lisp.

Function: make-sam-header (str)

Returns a list containing the data in header STR as Lisp
objects. If the header is NIL (there was no header) this function
returns NIL.

Given a header of

;;; "@HD VN:1.0
;;; @SQ SN:AL096846 LN:6490 SP:Schizosaccharomyces pombe
;;; @PG ID:bwa VN:0.4.6 CL:aln -n 0.04 -o 1 -e -1 -i 5 -d 10 -k 2 -M 3 -O 11 -E 4"

the returned list will be

;;; ((:HD (:VN . "1.0"))
;;; (:SQ (:SN . "AL096846") (:LN . 6490)
;;; (:SP . "Schizosaccharomyces pombe"))
;;; (:PG (:ID . "bwa") (:VN . "0.4.6")
;;; (:CL . "aln -n 0.04 -o 1 -e -1 -i 5 -d 10 -k 2 -M 3 -O 11 -E 4"))))

thus each list element is a list whose first element is a keyword
describing the record type. The rest of each list is itself an alist
of record keys and values.

Package

sam.

Source

sam.lisp.

Function: mapped-proper-pair-p (flag)

Returns T if FLAG indicates that the read was mapped as a member of a properly oriented read-pair, or NIL otherwise.

Package

sam.

Source

bam.lisp.

Function: mapping-quality (aln)

Returns the integer mapping quality of ALN.

Package

sam.

Source

bam.lisp.

Function: mate-alignment-position (aln)

Returns the 0-based sequence position of the read mate’s alignment described by ALN.

Package

sam.

Source

bam.lisp.

Function: mate-forward-p (flag)

Returns T if FLAG indicates that the read’s mate was mapped to the forward, or NIL if it was mapped to the reverse strand.

Package

sam.

Source

bam.lisp.

Function: mate-mapped-p (flag)

Returns T if FLAG indicates that the read’s mate was mapped to a reference, or NIL otherwise.

Package

sam.

Source

bam.lisp.

Function: mate-reference-id (aln)

Returns the integer reference ID of ALN.

Package

sam.

Source

bam.lisp.

Function: mate-reverse-p (flag)

Returns T if FLAG indicates that the read’s mate was mapped to the reverse, or NIL if it was mapped to the forward strand.

Package

sam.

Source

bam.lisp.

Function: mate-unmapped-p (flag)

Returns T if FLAG indicates that the read’s mate was not mapped to a reference, or NIL otherwise.

Package

sam.

Source

bam.lisp.

Function: medial-frag-p (flag)

Returns T if FLAG indicates that the read was sequenced as a non-terminal part of a linear template, or NIL otherwise.

Package

sam.

Source

bam.lisp.

Function: merge-header-records (record1 record2)

Returns a new header record created by merging the tags of header-records RECORD1 and RECORD2. Records may be safely merged if they have the same header-type and do not contain any conflicting tag values.

Package

sam.

Source

sam.lisp.

Function: merge-sam-headers (&rest headers)

Returns a new SAM header that is the result of merging HEADERS. Headers may be safely merged if none of their constituent records contain conflicting tag values once merged.

Package

sam.

Source

sam.lisp.

Function: multiple-frags-p (flag)

Returns T if FLAG indicates that the read was sequenced as a member of a pair, or NIL otherwise.

Package

sam.

Alias for

sequenced-pair-p.

Function: name-sorted-p (header)

Returns T if parsed HEADER indicates that the file is sorted by name, or NIL otherwise.

Package

sam.

Source

sam.lisp.

Function: next-reverse-p (flag)

Returns T if FLAG indicates that the read’s mate was mapped to the reverse, or NIL if it was mapped to the forward strand.

Package

sam.

Alias for

mate-reverse-p.

Function: next-unmapped-p (flag)

Returns T if FLAG indicates that the read’s mate was not mapped to a reference, or NIL otherwise.

Package

sam.

Alias for

mate-unmapped-p.

Function: parse-region-string (str)

Returns a new region from a string region designator in samtools-style format:

<reference name>:<start coordinate>-<end coordinate>

The reference name must be one of those described in the BAM header metadata. The reference sequence coordinates are zero-based, half open with start < end.

Package

sam.

Source

bam-reader.lisp.

Function: pcr/optical-duplicate-p (flag)

Returns T if FLAG indicates that the read is a PCR or optical duplicate, or NIL otherwise.

Package

sam.

Source

bam.lisp.

Function: pg-record (identity &key program-name program-version previous-program command-line)

Returns a new PG record.

Package

sam.

Source

sam.lisp.

Function: previous-programs (header identity)

Returns a list of PG ID values from HEADER that are previous programs with respect to PG ID IDENTITY. The list is ordered with the most recently used program first i.e. reverse chronological order.

Package

sam.

Source

sam.lisp.

Function: proper-aligned-frags-p (flag)

Returns T if FLAG indicates that the read was mapped as a member of a properly oriented read-pair, or NIL otherwise.

Package

sam.

Alias for

mapped-proper-pair-p.

Function: quality-string (aln)

Returns the sequence quality string described by ALN.

Package

sam.

Source

bam.lisp.

Function: query-forward-p (flag)

Returns T if FLAG indicates that the read was mapped to the forward strand of a reference, or NIL if it was mapped to the reverse strand.

Package

sam.

Source

bam.lisp.

Function: query-mapped-p (flag)

Returns T if FLAG indicates that the read’s mate was mapped to a reference, or NIL otherwise.

Package

sam.

Source

bam.lisp.

Function: query-reverse-p (flag)

Returns T if FLAG indicates that the read was mapped to the reverse strand of a reference, or NIL if it was mapped to the forward strand.

Package

sam.

Source

bam.lisp.

Function: query-unmapped-p (flag)

Returns T if FLAG indicates that the read was not mapped to a reference, or NIL otherwise.

Package

sam.

Source

bam.lisp.

Function: read-alignment (bgzf &key validate)

Reads one alignment block from handle BGZF, returns it as a Lisp array of unsigned-byte 8. The handle is advanced to the next alignment. If no more alignments are available, returns NIL.

This is the preferred function to use for validation. i.e. validate early. A USE-VALUE restart is provided so that an invalid alignment may be modified and re-read without unwinding the stack.

Package

sam.

Source

bam-reader.lisp.

Function: read-bam-header (bgzf)

Returns the unparsed BAM header from the handle BGZF as a Lisp string.

Package

sam.

Source

bam-reader.lisp.

Function: read-bam-index (stream)

Reads a BAM (.bai) index from STREAM.

Package

sam.

Source

bam-index-reader.lisp.

Function: read-bam-magic (bgzf)

Reads the BAM magic number from the handle BGZF and returns T if it is valid or raises a {define-condition malformed-file-error} if not.

Package

sam.

Source

bam-reader.lisp.

Function: read-bam-meta (bgzf)

Reads all BAM metadata from handle BGZF, leaving the handle pointing at the first alignment record. Returns the header string, the number of references and a list of reference sequence metadata. The list contains one element per reference sequence, each element being a list of reference identifier, reference name and reference length.

Package

sam.

Source

bam-reader.lisp.

Function: read-bam-terminator (bgzf)

Reads the EOF from handle BGZF, returning T if it is present, or raising a {define-condition malformed-file-error} otherwise.

Package

sam.

Source

bam-reader.lisp.

Function: read-length (aln)

Returns the length of the read described by ALN.

Package

sam.

Source

bam.lisp.

Function: read-name (aln)

Returns the read name string described by ALN.

Package

sam.

Source

bam.lisp.

Function: read-name-length (aln)

Returns the length in ASCII characters of the read name of ALN.

Package

sam.

Source

bam.lisp.

Function: read-num-references (bgzf)

Returns the number of reference sequences described in the BAM header of handle BGZF.

Package

sam.

Source

bam-reader.lisp.

Function: read-reference-meta (bgzf)

Returns the reference sequence metadata for a single reference sequence described in the BAM header of handle BGZF. Two values are returned, the reference name as a string and the reference length as an integer,

Package

sam.

Source

bam-reader.lisp.

Function: ref-index (bam-index reference-id)

Returns the reference index for reference number REFERENCE-ID in BAM-INDEX.

Package

sam.

Source

bam-index.lisp.

Function: ref-index-bin (ref-index bin-num)

Returns the BIN number BIN-NUM in REF-INDEX.

Package

sam.

Source

bam-index.lisp.

Reader: ref-index-bins (instance)
Writer: (setf ref-index-bins) (instance)
Package

sam.

Source

bam-index.lisp.

Target Slot

bins.

Reader: ref-index-intervals (instance)
Writer: (setf ref-index-intervals) (instance)
Package

sam.

Source

bam-index.lisp.

Target Slot

intervals.

Function: reference-id (aln)

Returns the reference sequence identifier of ALN. This is an integer locally assigned to a reference sequence within the context of a BAM file.

Package

sam.

Source

bam.lisp.

Function: repair-mapping-flags (aln)

Returns alignment ALN if it has correct mapped-proper-pair, query-mapped and mate-mapped flags, or a modified copy with fixed flags. Also sets the user tag ZF:I:<original flag> if the flags are changed.

Alignments produced by the BWA aligner have been observed to contain invalid flags. This is caused by BWA creating mappings that overhang the end of the reference. The underlying cause is reference concatenation in the Burrows-Wheeler index.

This function attempts to fix invalid mapped-proper-pair flags in cases where query-unmapped and/or mate-unmapped flags are set. Such unmapped reads may also have reference-ids set and good mapping scores. This function does not correct these other fields.

It is necessary to use this function in order to obtain correct flag counts when using samtools flagstat or {defun flagstat} .

Package

sam.

Source

bam-utilities.lisp.

Function: rg-record (identity sample &key library description platform-unit insert-size sequencing-centre sequencing-date platform-tech flow-order key-sequence)

Returns a new RG record.

Package

sam.

Source

sam.lisp.

Function: second-in-pair-p (flag)

Returns T if FLAG indicates that the read was the second in a pair of reads from one template, or NIL otherwise.

Package

sam.

Source

bam.lisp.

Function: seq-string (aln)

Returns the sequence string described by ALN.

Package

sam.

Source

bam.lisp.

Function: sequenced-pair-p (flag)

Returns T if FLAG indicates that the read was sequenced as a member of a pair, or NIL otherwise.

Package

sam.

Source

bam.lisp.

Function: sort-bam-file (in-filespec out-filespec &key sort-order buffer-size)

Sorts a BAM file by coordinate or by read name.

Arguments:

- in-filespec (pathname designator): The input BAM file.
- out-filespec (pathname designator): The output BAM file.

Key:

- sort-order (symbol): The sort order, either :coordinate
or :queryname .

- buffer-size (fixnum): The maximum number of reads to sort in memory at any one time, defaulting to 1000000.

Returns:

- The number of alignments sorted.
- The number of files used in the external merge sort.

Package

sam.

Source

external-bam-sort.lisp.

Function: sq-record (seq-name seq-length &key assembly-identity seq-md5 seq-uri seq-species)

Returns a new SQ record.

Package

sam.

Source

sam.lisp.

Function: subst-group-order (header order)

Returns a copy of HEADER with any group order tag initially present substituted by symbol ORDER, which must be one of the valid SAM sort orders. If there is no HD record in HEADER, one is added.

Package

sam.

Source

sam.lisp.

Function: subst-sam-version (header &optional version)

Returns a copy of HEADER with any header version tag initially present substituted by string VERSION, defaulting to *SAM-VERSION* .

Package

sam.

Source

sam.lisp.

Function: subst-sort-order (header order)

Returns a copy of HEADER with any sort order tag initially present substituted by symbol ORDER, which must be one of the valid SAM sort orders. If there is no HD record in HEADER, one is added.

Package

sam.

Source

sam.lisp.

Function: unknown-frag-p (flag)

Returns T if FLAG indicates that the read was sequenced as part of a non-linear template or as part of a linear template where the position has been lost, or NIL otherwise.

Package

sam.

Source

bam.lisp.

Function: valid-flag-p (flag)

Returns T if the paired-read-specific bits of FLAG are internally consistent.

Package

sam.

Source

bam.lisp.

Function: valid-mapped-pair-p (flag)

Returns T if FLAG indicates valid mapping states for a pair of mapped reads, that is both must be mapped, or NIL otherwise.

Package

sam.

Source

bam.lisp.

Function: valid-mapped-proper-pair-p (flag)

Returns T if FLAG indicates valid proper mapping states for a pair of mapped reads, that is both must be mapped and on opposite strands, or NIL otherwise.

Package

sam.

Source

bam.lisp.

Function: valid-reference-name-p (str)

Returns T if STR is a valid reference sequence name matching the regex [!-)+-<>-~][!-~]* , or NIL otherwise.

Package

sam.

Source

sam.lisp.

Function: valid-sam-version-p (str)

Returns T if SAM version string STR matches /^[0-9]+.[0-9]$/, or NIL otherwise.

Package

sam.

Source

sam.lisp.

Function: view-sam (bam-filespec sam-filespec)

Writes the contents of binary BAM file BAM-FILESPEC to SAM text file SAM-FILESPEC.

Package

sam.

Source

cl-sam.lisp.

Function: write-alignment (bgzf alignment-record)

Writes one ALIGNMENT-RECORD to handle BGZF and returns the number of bytes written.

Package

sam.

Source

bam-writer.lisp.

Function: write-bam-header (bgzf header &key compress null-padding mtime)

Writes the BAM header string HEADER to handle BGZF, followed by padding of NULL-PADDING null bytes. This function also writes the header length, including padding, in the 4 bytes preceding the header.

Package

sam.

Source

bam-writer.lisp.

Function: write-bam-magic (bgzf &key compress)

Writes the BAM magic number to the handle BGZF.

Package

sam.

Source

bam-writer.lisp.

Function: write-bam-meta (bgzf header num-refs ref-meta &key compress null-padding)

Writes BAM magic number and then all metadata to handle BGZF. The metadata consist of the HEADER string, number of reference sequences NUM-REFS and a list reference sequence metadata REF-META. The list contains one element per reference sequence, each element being a list of reference identifier, reference name and reference length. Returns the number of bytes written.

Key:

- compress-header (boolean): Compress the header block if T.
- null-padding (fixnum): A number of null bytes to be appended to the end of the header string, as allowed by the SAM spec. This is useful for creating slack space so that BAM headers may be edited in place.

Package

sam.

Source

bam-writer.lisp.

Function: write-header-record (header-record &optional stream)

Writes alist HEADER-RECORD to STREAM.

Package

sam.

Source

sam-writer.lisp.

Function: write-num-references (bgzf n)

Writes the number of reference sequences N to handle BGZF.

Package

sam.

Source

bam-writer.lisp.

Function: write-reference-meta (bgzf ref-name ref-length)

Writes the metadata for a single reference sequence named REF-NAME, of length REF-LENGTH bases, to handle BGZF.

Package

sam.

Source

bam-writer.lisp.

Function: write-sam-alignment (alignment-record ref-table &optional stream)

Writes ALIGNMENT-RECORD to STREAM as SAM. REF-TABLE is a hash-table created by {defun make-reference-table} .

Package

sam.

Source

sam-writer.lisp.

Function: write-sam-header (alist &optional stream)

Writes SAM header ALIST as a string to STREAM.

Package

sam.

Source

sam-writer.lisp.


6.1.4 Generic functions

Generic Function: alignment-tag-documentation (tag)

Returns the documentation for TAG or NIL if none is available.

Package

sam.

Source

bam.lisp.

Methods
Method: alignment-tag-documentation ((tag (eql :xt)))
Method: alignment-tag-documentation ((tag (eql :xs)))
Method: alignment-tag-documentation ((tag (eql :xo)))
Method: alignment-tag-documentation ((tag (eql :xn)))
Method: alignment-tag-documentation ((tag (eql :xm)))
Method: alignment-tag-documentation ((tag (eql :xg)))
Method: alignment-tag-documentation ((tag (eql :xf)))
Method: alignment-tag-documentation ((tag (eql :xe)))
Method: alignment-tag-documentation ((tag (eql :xc)))
Method: alignment-tag-documentation ((tag (eql :xa)))
Method: alignment-tag-documentation ((tag (eql :x1)))
Method: alignment-tag-documentation ((tag (eql :x0)))
Method: alignment-tag-documentation ((tag (eql :zf)))
Method: alignment-tag-documentation ((tag (eql :za)))
Method: alignment-tag-documentation ((tag (eql :uq)))
Method: alignment-tag-documentation ((tag (eql :u2)))
Method: alignment-tag-documentation ((tag (eql :tc)))
Method: alignment-tag-documentation ((tag (eql :sq)))
Method: alignment-tag-documentation ((tag (eql :sm)))
Method: alignment-tag-documentation ((tag (eql :s2)))
Method: alignment-tag-documentation ((tag (eql :sa)))
Method: alignment-tag-documentation ((tag (eql :rt)))
Method: alignment-tag-documentation ((tag (eql :rg)))
Method: alignment-tag-documentation ((tag (eql :r2)))
Method: alignment-tag-documentation ((tag (eql :qt)))
Method: alignment-tag-documentation ((tag (eql :q2)))
Method: alignment-tag-documentation ((tag (eql :pu)))
Method: alignment-tag-documentation ((tag (eql :pt)))
Method: alignment-tag-documentation ((tag (eql :pq)))
Method: alignment-tag-documentation ((tag (eql :pg)))
Method: alignment-tag-documentation ((tag (eql :oq)))
Method: alignment-tag-documentation ((tag (eql :op)))
Method: alignment-tag-documentation ((tag (eql :oc)))
Method: alignment-tag-documentation ((tag (eql :nm)))
Method: alignment-tag-documentation ((tag (eql :nh)))
Method: alignment-tag-documentation ((tag (eql :mq)))
Method: alignment-tag-documentation ((tag (eql :mf)))
Method: alignment-tag-documentation ((tag (eql :md)))
Method: alignment-tag-documentation ((tag (eql :ih)))
Method: alignment-tag-documentation ((tag (eql :hi)))
Method: alignment-tag-documentation ((tag (eql :h2)))
Method: alignment-tag-documentation ((tag (eql :h1)))
Method: alignment-tag-documentation ((tag (eql :h0)))
Method: alignment-tag-documentation ((tag (eql :lb)))
Method: alignment-tag-documentation ((tag (eql :gq)))
Method: alignment-tag-documentation ((tag (eql :gs)))
Method: alignment-tag-documentation ((tag (eql :gc)))
Method: alignment-tag-documentation ((tag (eql :fz)))
Method: alignment-tag-documentation ((tag (eql :fs)))
Method: alignment-tag-documentation ((tag (eql :fi)))
Method: alignment-tag-documentation ((tag (eql :e2)))
Method: alignment-tag-documentation ((tag (eql :ct)))
Method: alignment-tag-documentation ((tag (eql :cs)))
Method: alignment-tag-documentation ((tag (eql :cq)))
Method: alignment-tag-documentation ((tag (eql :cp)))
Method: alignment-tag-documentation ((tag (eql :co)))
Method: alignment-tag-documentation ((tag (eql :cm)))
Method: alignment-tag-documentation ((tag (eql :cc)))
Method: alignment-tag-documentation ((tag (eql :bq)))
Method: alignment-tag-documentation ((tag (eql :bc)))
Method: alignment-tag-documentation ((tag (eql :as)))
Method: alignment-tag-documentation ((tag (eql :am)))
Method: alignment-tag-documentation (tag)
Generic Function: write-bam-index (index stream)
Package

sam.

Source

bam-index-writer.lisp.

Methods
Method: write-bam-index ((index bam-index) stream)
Method: write-bam-index ((index samtools-bam-index) stream)

6.1.5 Standalone methods

Method: initialize-instance :after ((stream bam-merge-stream) &key)
Source

external-bam-sort.lisp.

Method: make-merge-stream ((stream bam-sort-input-stream) predicate &key key buffer-size)
Package

uk.co.deoxybyte-io.

Source

external-bam-sort.lisp.

Method: print-object ((object ref-index) stream)
Source

bam-index.lisp.

Method: print-object ((object chunk) stream)
Source

bam-index.lisp.

Method: print-object ((object bin) stream)
Source

bam-index.lisp.

Method: print-object ((object alignment) stream)
Source

bam.lisp.

Method: print-object ((object region) stream)
Source

bam-index.lisp.

Method: print-object ((object samtools-ref-index) stream)
Source

bam-index.lisp.

Method: stream-close ((stream bgzip-stream) &key abort)
Package

uk.co.deoxybyte-io.

Source

bgzip-stream.lisp.

Method: stream-element-type ((stream bgzip-stream))
Source

bgzip-stream.lisp.

Method: stream-file-position ((stream bgzip-input-stream) &optional position)
Package

sb-gray.

Source

bgzip-stream.lisp.

Method: stream-merge ((stream bam-merge-stream))
Package

uk.co.deoxybyte-io.

Source

external-bam-sort.lisp.

Method: stream-read-byte ((stream bgzip-input-stream))
Package

sb-gray.

Source

bgzip-stream.lisp.

Method: stream-read-element ((stream bam-sort-input-stream))
Package

uk.co.deoxybyte-io.

Source

external-bam-sort.lisp.

Method: stream-read-sequence ((stream bgzip-input-stream) sequence &optional start end)
Package

sb-gray.

Source

bgzip-stream.lisp.

Method: stream-write-element ((alignment-record vector) (stream bam-sort-output-stream))
Package

uk.co.deoxybyte-io.

Source

external-bam-sort.lisp.


6.1.6 Conditions

Condition: bam-error

The parent type of all BAM error conditions.

Package

sam.

Source

conditions.lisp.

Direct superclasses
  • error.
  • formatted-condition.
Direct subclasses

bam-sort-error.

Condition: bam-sort-error
Package

sam.

Source

conditions.lisp.

Direct superclasses

bam-error.

Direct methods
Direct slots
Slot: prev-position
Initform

(quote nil)

Initargs

:prev-position

Readers

prev-position-of.

Writers

This slot is read-only.

Slot: position
Package

common-lisp.

Initform

(quote nil)

Initargs

:position

Readers

position-of.

Writers

This slot is read-only.

Slot: prev-reference
Initform

(quote nil)

Initargs

:prev-reference

Readers

prev-reference-of.

Writers

This slot is read-only.

Slot: reference
Initform

(quote nil)

Initargs

:reference

Readers

reference-of.

Writers

This slot is read-only.

Condition: bgzf-io-error

A condition raised when an error occurs reading from or writing to a BGZF stream.

Package

sam.

Source

conditions.lisp.

Direct superclasses
  • io-error.
  • simple-text-condition.
Direct methods
Direct slots
Slot: bgzf

The BGZF stream that caused the error.

Initform

(quote nil)

Initargs

:bgzf

Readers

bgzf-of.

Writers

This slot is read-only.

Slot: errno

The C error number.

Initform

(quote nil)

Initargs

:errno

Readers

errno-of.

Writers

This slot is read-only.


6.1.7 Structures

Structure: bam-index

A BAM file index covering all the reference sequences in a BAM file.

Package

sam.

Source

bam-index.lisp.

Direct superclasses

structure-object.

Direct subclasses

samtools-bam-index.

Direct methods

write-bam-index.

Direct slots
Slot: refs
Type

simple-vector

Initform

(make-array 0)

Readers

bam-index-refs.

Writers

(setf bam-index-refs).

Structure: bgzf

A block gzip file.

- pathname: The file pathname.
- stream: The file stream.
- buffer: A simple-octet-vector used for buffering reads.
- position: The file position component of the BGZF virtual file offset (most significant 48 bits). This is the position in the stream at which this member starts.
- offset: The within-member offset component of the BGZF virtual file offset (least significant 16 bits). This is a position within the uncompressed data of the member.
- pointer: The buffer index after the last usable data element. i.e. the index at which new data may be written to the buffer prior to deflating. Calling (subseq buffer 0 bgzf-pointer) will extract the current usable bytes.
- util-buffer: a 4 byte buffer used internally to store an integer. - loaded-p: T if the bgz data has been loaded into the buffer (used internally in decompression and reading).
- load-seek: On loading the bgz data, proceed immediately to this offset (used internally in decompression and reading).
- eof: T if the decompression process has reached EOF (used internally in decompression and reading).

Package

sam.

Source

bgzf.lisp.

Direct superclasses

structure-object.

Direct slots
Slot: pathname
Package

common-lisp.

Readers

bgzf-pathname.

Writers

(setf bgzf-pathname).

Slot: stream
Package

common-lisp.

Readers

bgzf-stream.

Writers

(setf bgzf-stream).

Slot: compression
Type

(integer 0 9)

Initform

sam::*default-compression*

Readers

bgzf-compression.

Writers

(setf bgzf-compression).

Slot: buffer
Type

uk.co.deoxybyte-utilities:simple-octet-vector

Initform

(make-array sam::+bgz-max-payload-length+ :element-type (quote uk.co.deoxybyte-utilities:octet))

Readers

bgzf-buffer.

Writers

(setf bgzf-buffer).

Slot: position
Package

common-lisp.

Type

(unsigned-byte 48)

Initform

0

Readers

bgzf-position.

Writers

(setf bgzf-position).

Slot: offset
Type

uk.co.deoxybyte-utilities:uint16

Initform

0

Readers

bgzf-offset.

Writers

(setf bgzf-offset).

Slot: pointer
Type

(integer 0 65536)

Initform

0

Readers

bgzf-pointer.

Writers

(setf bgzf-pointer).

Slot: util-buffer
Type

(simple-array uk.co.deoxybyte-utilities:octet (4))

Initform

(make-array 4 :element-type (quote uk.co.deoxybyte-utilities:octet) :initial-element 0)

Readers

bgzf-util-buffer.

Writers

(setf bgzf-util-buffer).

Slot: loaded-p
Readers

bgzf-loaded-p.

Writers

(setf bgzf-loaded-p).

Slot: load-seek
Type

uk.co.deoxybyte-utilities:uint16

Initform

0

Readers

bgzf-load-seek.

Writers

(setf bgzf-load-seek).

Slot: eof
Readers

bgzf-eof.

Writers

(setf bgzf-eof).

Structure: bin

A bin within a BAM binning index. A bin is a region on a reference sequence that is identified by a number. The bin location and numbering system used is the UCSC binning scheme by Richard Durbin and Lincoln Stein. A bin contains a vector of chunks.

Package

sam.

Source

bam-index.lisp.

Direct superclasses

structure-object.

Direct methods

print-object.

Direct slots
Slot: num
Type

fixnum

Initform

0

Readers

bin-num.

Writers

This slot is read-only.

Slot: chunks
Type

simple-vector

Initform

(make-array 0)

Readers

bin-chunks.

Writers

(setf bin-chunks).

Structure: chunk

A chunk within a BAM index bin. Chunks are groups of records that lie within a bin and are close together within the BAM file.

Package

sam.

Source

bam-index.lisp.

Direct superclasses

structure-object.

Direct methods

print-object.

Direct slots
Slot: start
Type

(unsigned-byte 64)

Initform

0

Readers

chunk-start.

Writers

(setf chunk-start).

Slot: end
Type

(unsigned-byte 64)

Initform

most-positive-fixnum

Readers

chunk-end.

Writers

(setf chunk-end).

Structure: ref-index

An index for a single reference sequence. An index is composed of a vector of bins (the binning index) and a vector of intervals (the linear index). The bins are sorted by increasing bin number. The binning index is hierarchical, while the linear index is flat, being a projection of reads from all bins onto a single vector.

Package

sam.

Source

bam-index.lisp.

Direct superclasses

structure-object.

Direct subclasses

samtools-ref-index.

Direct methods
Direct slots
Slot: id
Type

fixnum

Initform

sam::+unknown-reference+

Readers

ref-index-id.

Writers

This slot is read-only.

Slot: bins
Type

simple-vector

Initform

(make-array 0 :initial-element nil)

Readers

ref-index-bins.

Writers

(setf ref-index-bins).

Slot: intervals
Type

(simple-array fixnum (*))

Initform

(make-array 0 :element-type (quote fixnum))

Readers

ref-index-intervals.

Writers

(setf ref-index-intervals).


6.1.8 Classes

Class: bgzip-input-stream

A stream that reads from a BGZF file.

Package

sam.

Source

bgzip-stream.lisp.

Direct superclasses
Direct methods
Direct slots
Slot: buffer

The Lisp buffer from which data are read.

Initargs

:buffer

Slot: num-bytes

The number of bytes that were read into the buffer from the stream.

Initform

0

Slot: offset

The offset in the byte buffer from which the next byte is to be read.

Initform

0

Class: bgzip-stream

A BGZF stream capable of reading or writing block compressed data.

Package

sam.

Source

bgzip-stream.lisp.

Direct superclasses
Direct subclasses

bgzip-input-stream.

Direct methods

6.2 Internals


6.2.1 Constants

Constant: +alignment-size-tag+

The size of the BAM alignment size indicator.

Package

sam.

Source

bam.lisp.

Constant: +bgz-max-payload-length+

The maximium size in bytes of a BGZ member payload. This is dictated by the fact that the SAM spec makes 16 bits are avaliable for addressing positions with the BGZ member.

Package

sam.

Source

bgzf.lisp.

Constant: +bgzip-buffer-size+

Buffer size for {defclass bgzip-input-stream} internal buffer.

Package

sam.

Source

bgzip-stream.lisp.

Constant: +linear-bin-size+

The size in bases of intervals in the linear bin index.

Package

sam.

Source

bam-index.lisp.

Constant: +max-num-bins+

The maximum number of bins possible in the BAM indexing scheme.

Package

sam.

Source

bam-index.lisp.

Constant: +member-footer-length+

The total number of bytes in the BGZ footer.

Package

sam.

Source

bgzf.lisp.

Constant: +member-header-length+

The total number of bytes in the BGZ header.

Package

sam.

Source

bgzf.lisp.

Constant: +null-byte+

The termination byte for BAM strings.

Package

sam.

Source

bam.lisp.

Constant: +samtools-kludge-bin+

Extra bin with different semantics added by samtools.

Package

sam.

Source

bam-index.lisp.

Constant: +sf1+

The value of the RCF1952 first extra subfield used by BGZ members.

Package

sam.

Source

bgzf.lisp.

Constant: +sf2+

The value of the RCF1952 first extra subfield used by BGZ members.

Package

sam.

Source

bgzf.lisp.

Constant: +slen+

The value of the RFC1952 subfield length field used by BGZ members.

Package

sam.

Source

bgzf.lisp.

Constant: +tag-size+

The size of a BAM auxilliary tag in bytes.

Package

sam.

Source

bam.lisp.

Constant: +unknown-position+

The position value for unmapped reads.

Package

sam.

Source

bam.lisp.

Constant: +unknown-quality+

The value for unavailable quality scores.

Package

sam.

Source

bam.lisp.

Constant: +unknown-reference+

The reference id for unmapped reads.

Package

sam.

Source

bam.lisp.

Constant: +xlen+

The value of the RCF1952 eXtra LENgth field used by BGZ members.

Package

sam.

Source

bgzf.lisp.


6.2.2 Special variables

Special Variable: *bam-index-file-type*
Package

sam.

Source

bam-index.lisp.

Special Variable: *bam-index-magic*

The BAI index file magic header bytes.

Package

sam.

Source

bam-index.lisp.

Special Variable: *bam-magic*

The BAM file magic header bytes.

Package

sam.

Source

bam.lisp.

Special Variable: *default-compression*

The default bgz compression level (Zlib level 5).

Package

sam.

Source

bgzf.lisp.

Special Variable: *empty-bgz-record*

SAMtools version >0.1.5 appends an empty BGZF record to allow detection of truncated BAM files. These 28 bytes constitute such a record.

Package

sam.

Source

bgzf.lisp.

Special Variable: *invalid-read-name-chars*
Package

sam.

Source

bam.lisp.

Special Variable: *mandatory-header-tags*

A mapping that describes the mandatory tags for each SAM header record type.

Package

sam.

Source

sam.lisp.

Special Variable: *tree-deepening-boundaries*
Package

sam.

Source

bam-index.lisp.

Special Variable: *valid-group-orders*

Valid values for SAM group order tags. Group order is no longer a valid tag in SAM version 1.3.

Package

sam.

Source

sam.lisp.

Special Variable: *valid-header-tags*

A mapping that describes the valid tags for each SAM header record type.

Package

sam.

Source

sam.lisp.

Special Variable: *valid-header-types*

A list of valid SAM header types.

Package

sam.

Source

sam.lisp.

Special Variable: *valid-sort-orders*

Valid values for SAM sort order tags.

Package

sam.

Source

sam.lisp.

Special Variable: *voffset-merge-distance*

If two index chunks are this number of bytes or closer to each other, they should be merged.

Package

sam.

Source

bam-index.lisp.


6.2.3 Macros

Macro: define-header-tag-parser (name (header-type var) tag-specs)

Defines a tag parsing function NAME that parses tag values for SAM header HEADER-TYPE.

Package

sam.

Source

sam.lisp.


6.2.4 Ordinary functions

Function: %encode-string-tag (value aln index)
Package

sam.

Source

bam.lisp.

Function: %make-bam-index (num-refs ref-indices &optional unassigned)
Package

sam.

Source

bam-indexer.lisp.

Function: %make-ref-index (reference-id ref-start ref-end chunks intervals &optional mapped unmapped)
Package

sam.

Source

bam-indexer.lisp.

Function: %read-bam-alignment (stream num-bytes)
Package

sam.

Source

external-bam-sort.lisp.

Function: %stream-read-sequence (stream sequence &optional start end)
Package

sam.

Source

bgzip-stream.lisp.

Function: %write-int32 (n buffer stream)
Package

sam.

Source

bam-index-writer.lisp.

Function: %write-int64 (n buffer stream)
Package

sam.

Source

bam-index-writer.lisp.

Function: adjacentp (chunk1 chunk2)

Returns T if BAM index CHUNK1 and CHUNK2 are adjacent. In this context this means that they are sequential in a file stream and close enough together for it to be more efficient to continue reading across the intervening bytes, rather than seeking.

Package

sam.

Source

bam-index.lisp.

Function: alignment-indices (aln)

Returns 7 integer values which are byte-offsets within ALN at which the various core data lie. See the SAM spec.

Package

sam.

Source

bam.lisp.

Function: alignment-name-natural< (alignment-record1 alignment-record2)
Package

sam.

Source

external-bam-sort.lisp.

Function: alignment-p (object)
Package

sam.

Source

bam.lisp.

Function: alignment-primary-p (flag)

Returns T if FLAG indicates that the read mapping was the primary mapping to a reference, or NIL otherwise.

Package

sam.

Source

bam.lisp.

Function: alignment-read-length (aln)

Returns the length of the alignment on the read.

Package

sam.

Source

bam.lisp.

Function: alignment-reference-length (aln)

Returns the length of the alignment on the reference.

Package

sam.

Source

bam.lisp.

Function: alignment-tag-bytes (value)

Returns the number of bytes required to encode VALUE.

Package

sam.

Source

bam.lisp.

Reader: aln-bin (instance)
Writer: (setf aln-bin) (instance)
Package

sam.

Source

bam.lisp.

Target Slot

bin.

Reader: aln-cigar (instance)
Writer: (setf aln-cigar) (instance)
Package

sam.

Source

bam.lisp.

Target Slot

cigar.

Reader: aln-flag (instance)
Writer: (setf aln-flag) (instance)
Package

sam.

Source

bam.lisp.

Target Slot

flag.

Reader: aln-insert-length (instance)
Writer: (setf aln-insert-length) (instance)
Package

sam.

Source

bam.lisp.

Target Slot

insert-length.

Reader: aln-map-qual (instance)
Writer: (setf aln-map-qual) (instance)
Package

sam.

Source

bam.lisp.

Target Slot

map-qual.

Reader: aln-mate-pos (instance)
Writer: (setf aln-mate-pos) (instance)
Package

sam.

Source

bam.lisp.

Target Slot

mate-pos.

Reader: aln-mate-ref-id (instance)
Writer: (setf aln-mate-ref-id) (instance)
Package

sam.

Source

bam.lisp.

Target Slot

mate-ref-id.

Reader: aln-pos (instance)
Writer: (setf aln-pos) (instance)
Package

sam.

Source

bam.lisp.

Target Slot

pos.

Reader: aln-qual-str (instance)
Writer: (setf aln-qual-str) (instance)
Package

sam.

Source

bam.lisp.

Target Slot

qual-str.

Reader: aln-read-name (instance)
Writer: (setf aln-read-name) (instance)
Package

sam.

Source

bam.lisp.

Target Slot

read-name.

Reader: aln-record (instance)
Writer: (setf aln-record) (instance)
Package

sam.

Source

bam.lisp.

Target Slot

record.

Reader: aln-ref-id (instance)
Writer: (setf aln-ref-id) (instance)
Package

sam.

Source

bam.lisp.

Target Slot

ref-id.

Reader: aln-ref-len (instance)
Writer: (setf aln-ref-len) (instance)
Package

sam.

Source

bam.lisp.

Target Slot

ref-len.

Reader: aln-seq-str (instance)
Writer: (setf aln-seq-str) (instance)
Package

sam.

Source

bam.lisp.

Target Slot

seq-str.

Function: bam-index-p (object)
Package

sam.

Source

bam-index.lisp.

Function: bam-meta-size (filespec)

Returns the number of bytes occupied by the metadata in the BAM file FILESPEC. Metadata is defined here as the magic number, header and header padding, reference sequence count and reference sequence names and lengths.

Package

sam.

Source

bam-reader.lisp.

Function: bam-meta-size2 (header &rest ref-meta)
Package

sam.

Source

bam-reader.lisp.

Reader: bgz-member-bsize (instance)
Writer: (setf bgz-member-bsize) (instance)
Package

sam.

Source

bgzf.lisp.

Target Slot

bsize.

Function: bgz-member-cdata (instance)
Package

sam.

Source

bgzf.lisp.

Function: (setf bgz-member-cdata) (instance)
Package

sam.

Source

bgzf.lisp.

Function: bgz-member-cend (instance)
Package

sam.

Source

bgzf.lisp.

Function: (setf bgz-member-cend) (instance)
Package

sam.

Source

bgzf.lisp.

Function: bgz-member-cm (instance)
Package

sam.

Source

bgzf.lisp.

Function: bgz-member-crc32 (instance)
Package

sam.

Source

bgzf.lisp.

Function: (setf bgz-member-crc32) (instance)
Package

sam.

Source

bgzf.lisp.

Function: bgz-member-flg (instance)
Package

sam.

Source

bgzf.lisp.

Function: (setf bgz-member-flg) (instance)
Package

sam.

Source

bgzf.lisp.

Function: bgz-member-id1 (instance)
Package

sam.

Source

bgzf.lisp.

Function: bgz-member-id2 (instance)
Package

sam.

Source

bgzf.lisp.

Function: bgz-member-isize (instance)
Package

sam.

Source

bgzf.lisp.

Function: (setf bgz-member-isize) (instance)
Package

sam.

Source

bgzf.lisp.

Function: bgz-member-mtime (instance)
Package

sam.

Source

bgzf.lisp.

Function: (setf bgz-member-mtime) (instance)
Package

sam.

Source

bgzf.lisp.

Function: bgz-member-os (instance)
Package

sam.

Source

bgzf.lisp.

Function: (setf bgz-member-os) (instance)
Package

sam.

Source

bgzf.lisp.

Function: bgz-member-p (object)
Package

sam.

Source

bgzf.lisp.

Reader: bgz-member-sf1 (instance)
Package

sam.

Source

bgzf.lisp.

Target Slot

sf1.

Reader: bgz-member-sf2 (instance)
Package

sam.

Source

bgzf.lisp.

Target Slot

sf2.

Reader: bgz-member-slen (instance)
Package

sam.

Source

bgzf.lisp.

Target Slot

slen.

Reader: bgz-member-udata (instance)
Writer: (setf bgz-member-udata) (instance)
Package

sam.

Source

bgzf.lisp.

Target Slot

udata.

Function: bgz-member-xfl (instance)
Package

sam.

Source

bgzf.lisp.

Function: (setf bgz-member-xfl) (instance)
Package

sam.

Source

bgzf.lisp.

Function: bgz-member-xlen (instance)
Package

sam.

Source

bgzf.lisp.

Function: (setf bgz-member-xlen) (instance)
Package

sam.

Source

bgzf.lisp.

Reader: bgzf-buffer (instance)
Writer: (setf bgzf-buffer) (instance)
Package

sam.

Source

bgzf.lisp.

Target Slot

buffer.

Function: bgzf-coffset (position)

Returns the compressed offset (most significant bits) component of BGZF virtual offset POSITION.

Package

sam.

Source

bgzf.lisp.

Reader: bgzf-compression (instance)
Writer: (setf bgzf-compression) (instance)
Package

sam.

Source

bgzf.lisp.

Target Slot

compression.

Function: bgzf-empty-p (bgzf)

Returns T if all decompressed bytes have been read from the current decompressed BGZ block.

Package

sam.

Source

bgzf.lisp.

Reader: bgzf-eof (instance)
Writer: (setf bgzf-eof) (instance)
Package

sam.

Source

bgzf.lisp.

Target Slot

eof.

Function: bgzf-flush (bgzf &key compress append-eof mtime)
Package

sam.

Source

bgzf-writer.lisp.

Reader: bgzf-load-seek (instance)
Writer: (setf bgzf-load-seek) (instance)
Package

sam.

Source

bgzf.lisp.

Target Slot

load-seek.

Reader: bgzf-loaded-p (instance)
Writer: (setf bgzf-loaded-p) (instance)
Package

sam.

Source

bgzf.lisp.

Target Slot

loaded-p.

Reader: bgzf-offset (instance)
Writer: (setf bgzf-offset) (instance)
Package

sam.

Source

bgzf.lisp.

Target Slot

offset.

Function: bgzf-p (object)
Package

sam.

Source

bgzf.lisp.

Reader: bgzf-pathname (instance)
Writer: (setf bgzf-pathname) (instance)
Package

sam.

Source

bgzf.lisp.

Target Slot

pathname.

Reader: bgzf-pointer (instance)
Writer: (setf bgzf-pointer) (instance)
Package

sam.

Source

bgzf.lisp.

Target Slot

pointer.

Reader: bgzf-position (instance)
Writer: (setf bgzf-position) (instance)
Package

sam.

Source

bgzf.lisp.

Target Slot

position.

Reader: bgzf-stream (instance)
Writer: (setf bgzf-stream) (instance)
Package

sam.

Source

bgzf.lisp.

Target Slot

stream.

Function: bgzf-uoffset (position)

Returns the uncompressed (least significant bits) component of BGZF virtual offset POSITION.

Package

sam.

Source

bgzf.lisp.

Reader: bgzf-util-buffer (instance)
Writer: (setf bgzf-util-buffer) (instance)
Package

sam.

Source

bgzf.lisp.

Target Slot

util-buffer.

Function: bin-p (object)
Package

sam.

Source

bam-index.lisp.

Function: block-sizes (filespec n)
Package

sam.

Source

bam-reader.lisp.

Function: buffer-empty-p (stream)
Package

sam.

Source

bgzip-stream.lisp.

Function: chunk-p (object)
Package

sam.

Source

bam-index.lisp.

Function: copy-alignment (instance)
Package

sam.

Source

bam.lisp.

Function: copy-bam-index (instance)
Package

sam.

Source

bam-index.lisp.

Function: copy-bgz-member (instance)
Package

sam.

Source

bgzf.lisp.

Function: copy-bgzf (instance)
Package

sam.

Source

bgzf.lisp.

Function: copy-bin (instance)
Package

sam.

Source

bam-index.lisp.

Function: copy-chunk (instance)
Package

sam.

Source

bam-index.lisp.

Function: copy-ref-index (instance)
Package

sam.

Source

bam-index.lisp.

Function: copy-region (instance)
Package

sam.

Source

bam-index.lisp.

Function: copy-samtools-bam-index (instance)
Package

sam.

Source

bam-index.lisp.

Function: copy-samtools-ref-index (instance)
Package

sam.

Source

bam-index.lisp.

Function: decode-cigar (aln index num-bytes)

Returns an alist of CIGAR operations from NUM-BYTES bytes within ALN, starting at INDEX. The decoding of the = and X operations is not documented in the spec.

Package

sam.

Source

bam.lisp.

Function: decode-quality-string (aln index num-bytes)

Returns a string containing the alignment query sequence of length NUM-BYTES. The sequence must be present in ALN at INDEX. The SAM spec states that quality data are optional, with absence indicated by 0xff. If the first byte of quality data is 0xff, NIL is returned.

Package

sam.

Source

bam.lisp.

Function: decode-read-name (aln index num-bytes)

Returns a string containing the template/read name of length NUM-BYTES, encoded at byte INDEX in ALN.

Package

sam.

Source

bam.lisp.

Function: decode-seq-string (aln index num-bytes)

Returns a string containing the alignment query sequence of length NUM-BYTES. The sequence must be present in ALN at INDEX.

Package

sam.

Source

bam.lisp.

Function: decode-tag-values (aln index)

Returns a list of auxilliary data from ALN at INDEX. The BAM two-letter data keys are transformed to Lisp keywords.

Package

sam.

Source

bam.lisp.

Function: default-orphanizer-test ()

Returns a new orphanizer test that causes alternate last fragments to be omitted.

Package

sam.

Source

bam-utilities.lisp.

Function: default-qual-string (length)
Package

sam.

Source

bam-utilities.lisp.

Function: default-seq-string (length)
Package

sam.

Source

bam-utilities.lisp.

Function: deflate-bgz-member (bgz &key compression mtime backoff)
Package

sam.

Source

bgzf.lisp.

Function: encode-char-tag (value aln index)

Returns ALN having encoded character VALUE into it, starting at INDEX.

Package

sam.

Source

bam.lisp.

Function: encode-cigar (cigar aln index)

Returns ALN having encoded alist CIGAR into it, starting at INDEX.

Package

sam.

Source

bam.lisp.

Function: encode-float-tag (value aln index)

Returns ALN having encoded float VALUE into it, starting at INDEX.

Package

sam.

Source

bam.lisp.

Function: encode-hex-tag (value aln index)

Returns ALN having encoded hex string VALUE into it, starting at INDEX.

Package

sam.

Source

bam.lisp.

Function: encode-int-tag (value aln index)

Returns ALN having encoded integer VALUE into it, starting at INDEX. BAM format is permitted to use more compact integer storage where possible.

Package

sam.

Source

bam.lisp.

Function: encode-phred-quality (q)

Returns the character encoding Phred quality Q.

Package

sam.

Source

bam-utilities.lisp.

Function: encode-quality-string (str aln index)

Returns ALN having encoded quality string STR into it, starting at INDEX.

Package

sam.

Source

bam.lisp.

Function: encode-read-name (read-name aln index)

Returns ALN having encoded READ-NAME into it, starting at INDEX.

Package

sam.

Source

bam.lisp.

Function: encode-seq-string (str aln index)

Returns ALN having encoded STR into it, starting at INDEX.

Package

sam.

Source

bam.lisp.

Function: encode-string-tag (value aln index)

Returns ALN having encoded string VALUE into it, starting at INDEX.

Package

sam.

Source

bam.lisp.

Function: encode-unknown-quality (n aln index)

Returns ALN having encoded N unknown qualities into it, starting at INDEX.

Package

sam.

Source

bam.lisp.

Function: ensure-order (header domain)

Returns a copy of HEADER that is guaranteed to contain a sort tag for DOMAIN, which must be one of :sort or :group .

Package

sam.

Source

sam.lisp.

Function: ensure-sam-version (header &optional version)

Returns a copy of HEADER that is guaranteed to contain a version tag.

Package

sam.

Source

sam.lisp.

Function: ensure-unique-tag-values (header record-type tag)

Returns HEADER if all records of RECORD-TYPE have unique TAG values, with respect to each other, or raises a {define-condition malformed-field-error} .

Package

sam.

Source

sam.lisp.

Function: ensure-valid-flag (flag &optional aln)
Package

sam.

Source

bam.lisp.

Function: ensure-valid-read-name (str)
Package

sam.

Source

bam.lisp.

Function: ensure-valid-reference-name (str)

Returns STR if it is a valid reference sequence name, or raises a {define-condition malformed-field-error} if not.

Package

sam.

Source

bam.lisp.

Function: ensure-valid-region (region)

Returns REGION if it is a valid region designator, or raises an {define-condition invalid-argument-error} .

A region designator may be any of the following:

- A list of a string and two integers, being a reference name, start position and end position, respectively.

- A list of three integers, being a reference identifier, start position and end position, respectively.

- A region struct.

The start position must be less than, or equal to the end position.

Package

sam.

Source

bam-reader.lisp.

Function: fill-buffer (stream)
Package

sam.

Source

bgzip-stream.lisp.

Function: find-duplicate-header-tags (record)

Returns a list of duplicate SAM header tags found in RECORD. Each list element contains the tag, followed by a list of the conflicting values.

Package

sam.

Source

sam.lisp.

Function: find-duplicate-records (header header-type)

Returns a list of any duplicate records of HEADER-TYPE in HEADER.

Package

sam.

Source

sam.lisp.

Function: find-interval (ref-index start)
Package

sam.

Source

bam-index.lisp.

Function: flag-symbol (flag)

Returns a 3 character string symbolising the read pairing denoted by FLAG. The left character indicates the query strand, the middle the alignment pairing and the right the mate strand.

Query mapped forward >
Query mapped reverse <
Query unmapped .

Not paired .
Mapped proper pair =
Mapped pair -
Singleton ~

Mate mapped forward >
Mate mapped reverse <
Mate unmapped .

Package

sam.

Source

bam.lisp.

Function: flag-validation-error (flag message &optional aln)

Raised a {define-condition malformed-field-error} for alignment FLAG in ALN, with MESSAGE.

Package

sam.

Source

bam.lisp.

Function: group-by-tag (records header-tag)

Returns a hash-table of header-records taken from list RECORDS. The hash-table keys are HEADER-TAG values taken from the records and the hash-table values are lists of header-records that share that HEADER-TAG value.

Package

sam.

Source

sam.lisp.

Function: header-record (record-type &rest args)

Returns a new header record of HEADER-TYPE. ARGS are tag values in the same order as the tag returned by {defun valid-header-tags} , which is the same order as they are presented in the SAM spec.

Package

sam.

Source

sam.lisp.

Function: inflate-bgz-member (bgz)
Package

sam.

Source

bgzf.lisp.

Function: make-alignment (aln)

Returns a new ALIGNMENT structure given BAM record ALN.

Package

sam.

Source

bam.lisp.

Function: make-aln (read-name seq-str qual-str flag ref-id mate-ref-id pos mate-pos cigar ref-len map-qual insert-length bin record)
Package

sam.

Source

bam.lisp.

Function: make-bam-chunks (index region)

Returns a list of read chunks from INDEX covering REGION, sorted by increasing chunk start.

Package

sam.

Source

bam-index.lisp.

Function: make-bam-full-scan-input (bam)

Returns a generator function that returns BAM alignment records for BAM stream BAM by scanning the entire stream. This to be used in cases where a full scan is necessary, or as a fallback when neither index, nor regions are available. The standard generator interface functions NEXT and HAS-MORE-P may be used in operations on the returned generator.

Package

sam.

Source

bam-reader.lisp.

Function: make-bam-index (&key refs)
Package

sam.

Source

bam-index.lisp.

Function: make-bam-index-input (bam index regions)

Returns a generator function that returns BAM alignment records for BAM stream BAM by scanning for alignments in the list of REGIONS. Note that REGIONS are zero-based, closed base coordinates. The standard generator interface functions NEXT and HAS-MORE-P may be used in operations on the returned generator.

Package

sam.

Source

bam-reader.lisp.

Function: make-bam-scan-input (bam regions)

Returns a generator function that returns BAM alignment records for BAM stream BAM by scanning for alignments in the list of REGIONS. Note that REGIONS use zero-based, closed base coordinates. This to be used in cases where a full scan is necessary, or as a fallback when an index is not available. The standard generator interface functions NEXT and HAS-MORE-P may be used in operations on the returned generator.

Package

sam.

Source

bam-reader.lisp.

Function: make-bgz-member (&key id1 id2 cm flg mtime xfl os xlen isize crc32 cdata cend sf1 sf2 slen bsize udata)
Package

sam.

Source

bgzf.lisp.

Function: make-bgzf (&key pathname stream compression buffer position offset pointer util-buffer loaded-p load-seek eof)
Package

sam.

Source

bgzf.lisp.

Function: make-bin (&key num chunks)
Package

sam.

Source

bam-index.lisp.

Function: make-chunk (&key start end)
Package

sam.

Source

bam-index.lisp.

Function: make-header-string (alist)

Returns a new SAM header string representing the header data in ALIST.

Package

sam.

Source

sam-writer.lisp.

Function: make-ref-index (&key id bins intervals)
Package

sam.

Source

bam-index.lisp.

Function: make-region (&key ref start end)
Package

sam.

Source

bam-index.lisp.

Function: make-region< (ref-meta)

Returns a new comparator function which sorts regions according to the BAM reference metadata REF-META. Ranges are sorted first by the reference order in the BAM file, then by region start and finally by region end. Regions are sorted before they are normalised.

Package

sam.

Source

bam-reader.lisp.

Function: make-samtools-bam-index (&key refs unassigned)
Package

sam.

Source

bam-index.lisp.

Function: make-samtools-ref-index (&key id bins intervals start end mapped unmapped)
Package

sam.

Source

bam-index.lisp.

Function: mandatory-header-tags (header-type)

Returns a list of the mandatory tags for SAM header
HEADER-TYPE. Both HEADER-TYPE. and the returned tags are represented as symbols.

Package

sam.

Source

sam.lisp.

Function: max-bin-num (ref-length)
Package

sam.

Source

bam-index.lisp.

Function: merge-chunks (chunks)

Returns a new list of BAM index chunks created by merging members of list CHUNKS that are {defun adjacentp} .

Package

sam.

Source

bam-index.lisp.

Function: next-forward-p (flag)

Returns T if FLAG indicates that the read’s mate was mapped to the forward, or NIL if it was mapped to the reverse strand.

Package

sam.

Alias for

mate-forward-p.

Function: next-mapped-p (flag)

Returns T if FLAG indicates that the read’s mate was mapped to a reference, or NIL otherwise.

Package

sam.

Alias for

mate-mapped-p.

Function: normalise-regions (regions ref-meta)

Returns a list of REGIONS, normalised according to the BAM reference metadata REF-META. Reference names in REGIONS are converted to their corresponding reference ID and REGIONS are sorted first by the reference order in the BAM file, then by region start and finally by region end. Overlapping REGIONS are merged.

Package

sam.

Source

bam-reader.lisp.

Function: parse-digits (bytes start end)
Package

sam.

Source

external-bam-sort.lisp.

Function: parse-hd-tag (str)
Package

sam.

Source

sam.lisp.

Function: parse-pg-tag (str)
Package

sam.

Source

sam.lisp.

Function: parse-rg-tag (str)
Package

sam.

Source

sam.lisp.

Function: parse-sq-tag (str)
Package

sam.

Source

sam.lisp.

Function: partition-by-type (headers)

Collects all the header-records in HEADERS by header-type, sorts them and returns 4 values that are lists of the collected :hd , :sq , :rg and :pg header-records, respectively. Does not modify HEADERS.

Package

sam.

Source

sam.lisp.

Function: partition-regions (regions)

Partitions a list of normalised REGIONS into lists, each pertaining to a specific reference sequence. The overall order of the REGIONS is maintained.

Package

sam.

Source

bam-reader.lisp.

Function: print-aln (aln stream)
Package

sam.

Source

bam.lisp.

Function: print-bin (bin stream)

Prints a string representation of BIN to STREAM.

Package

sam.

Source

bam-index.lisp.

Function: print-chunk (chunk stream)

Prints a string representation of CHUNK to STREAM.

Package

sam.

Source

bam-index.lisp.

Function: print-ref-index (ref-index stream)

Prints a string representation of REF-INDEX to STREAM.

Package

sam.

Source

bam-index.lisp.

Function: print-region (region stream)

Prints a string representation of RANGE to STREAM.

Package

sam.

Source

bam-index.lisp.

Function: print-samtools-ref-index (ref-index stream)

Prints a string representation of REF-INDEX to STREAM.

Package

sam.

Source

bam-index.lisp.

Function: read-bgz-member (stream buffer)

Reads one BGZ member from STREAM, using BUFFER to hold integers as they are read.

Arguments:

- stream (octet input-stream): An open stream.
- buffer (simple-octet-vector): A re-usable read buffer which must be able to contain at least 4 bytes.

Returns:

- A BGZ structure, or NIL.

Package

sam.

Source

bgzf-reader.lisp.

Function: read-bin (stream)

Reads an index bin from STREAM.

Package

sam.

Source

bam-index-reader.lisp.

Function: read-binning-index (num-bins stream)

Reads NUM-BINS bins from STREAM, returning a vector of bins, sorted by increasing bin number.

Package

sam.

Source

bam-index-reader.lisp.

Function: read-bytes (bgzf n &key buffer)
Package

sam.

Source

bgzf-reader.lisp.

Function: read-index-magic (stream)

Reads the BAI magic number from STREAM and returns T if it is valid or raises a {define-condition malformed-file-error} if not.

Package

sam.

Source

bam-index-reader.lisp.

Function: read-linear-index (num-intervals stream)

Reads NUM-INTERVALS linear bin intervals from STREAM, returning them in a vector. Identical intervals are run-length compressed.

Package

sam.

Source

bam-index-reader.lisp.

Function: read-ref-index (reference-id stream)

Reads an index for a single reference sequence from STREAM.

Package

sam.

Source

bam-index-reader.lisp.

Function: read-string (bgzf n &key null-terminated)

Reads N characters from handle BGZF and returns them as a Lisp string. The NULL-TERMINATED keyword is used to indicate whether the C string is null-terminated so that the terminator may be consumed.

Package

sam.

Source

bgzf-reader.lisp.

Reader: ref-index-id (instance)
Package

sam.

Source

bam-index.lisp.

Target Slot

id.

Function: ref-index-p (object)
Package

sam.

Source

bam-index.lisp.

Function: region (ref start end)
Package

sam.

Source

bam-index.lisp.

Reader: region-end (instance)
Writer: (setf region-end) (instance)
Package

sam.

Source

bam-index.lisp.

Target Slot

end.

Function: region-p (object)
Package

sam.

Source

bam-index.lisp.

Reader: region-ref (instance)
Writer: (setf region-ref) (instance)
Package

sam.

Source

bam-index.lisp.

Target Slot

ref.

Reader: region-start (instance)
Writer: (setf region-start) (instance)
Package

sam.

Source

bam-index.lisp.

Target Slot

start.

Function: region-to-bin (start end)

Returns a bin number given a 0-based range.

Package

sam.

Source

bam-index.lisp.

Function: region-to-bins (start end)

Returns a bit vector with the bits for relevant bins set, given a 0-based range. Each bin may span 2^29, 2^26, 2^23, 2^20, 2^17 or 2^14 bp. Bin 0 spans a 512 Mbp region, bins 1-8 span 64 Mbp, 9-72 8 Mbp, 73-584 1 Mbp, 585-4680 128 Kbp and bins 4681-37449 span 16 Kbp regions.

Package

sam.

Source

bam-index.lisp.

Function: region-to-interval (coord)

Given a coordinate COORD, returns the array index of its interval in the BAM linear index.

Package

sam.

Source

bam-index.lisp.

Function: run-length-encode (intervals)

Returns a run-length encoded list representing INTERVALS, a BGZF linear index. Each element of the list has a car of the run-length and a cdr of the BGZF file position. Used in printing text representations of the index.

Package

sam.

Source

bam-index.lisp.

Function: samtools-bam-index-p (object)
Package

sam.

Source

bam-index.lisp.

Function: samtools-bam-index-refs (instance)
Package

sam.

Source

bam-index.lisp.

Function: (setf samtools-bam-index-refs) (instance)
Package

sam.

Source

bam-index.lisp.

Reader: samtools-bam-index-unassigned (instance)
Writer: (setf samtools-bam-index-unassigned) (instance)
Package

sam.

Source

bam-index.lisp.

Target Slot

unassigned.

Function: samtools-ref-index-bins (instance)
Package

sam.

Source

bam-index.lisp.

Function: (setf samtools-ref-index-bins) (instance)
Package

sam.

Source

bam-index.lisp.

Reader: samtools-ref-index-end (instance)
Writer: (setf samtools-ref-index-end) (instance)
Package

sam.

Source

bam-index.lisp.

Target Slot

end.

Function: samtools-ref-index-id (instance)
Package

sam.

Source

bam-index.lisp.

Function: samtools-ref-index-intervals (instance)
Package

sam.

Source

bam-index.lisp.

Function: (setf samtools-ref-index-intervals) (instance)
Package

sam.

Source

bam-index.lisp.

Reader: samtools-ref-index-mapped (instance)
Writer: (setf samtools-ref-index-mapped) (instance)
Package

sam.

Source

bam-index.lisp.

Target Slot

mapped.

Function: samtools-ref-index-p (object)
Package

sam.

Source

bam-index.lisp.

Reader: samtools-ref-index-start (instance)
Writer: (setf samtools-ref-index-start) (instance)
Package

sam.

Source

bam-index.lisp.

Target Slot

start.

Reader: samtools-ref-index-unmapped (instance)
Writer: (setf samtools-ref-index-unmapped) (instance)
Package

sam.

Source

bam-index.lisp.

Target Slot

unmapped.

Function: simplify-records (records header-tag)

Returns a simplified list of header-records copied from
RECORDS. The RECORDS must all be of the same type. The simplifications are: removal of perfect duplicates, grouping of header-records by HEADER-TAG value and subsequent merging of header-records that share that HEADER-TAG value. RECORDS may be an empty list.

Package

sam.

Source

sam.lisp.

Function: sort-bam-alignments (bgzf-in bgzf-out predicate &key key buffer-size)

Sorts alignments from block gzip input stream BGZF-IN and writes them to block gzip output stream BGZF-OUT, sorted by PREDICATE. A function KEY may be supplied to transform alignments into arguments for PREDICATE. The BUFFER-SIZE argument declares the maximum number of alignments that will be sorted in memory at any time, defaulting to 1000000.

Package

sam.

Source

external-bam-sort.lisp.

Function: stream-view-sam (bam &optional stream)

Writes the binary BAM records from BGZF stream BAM to STREAM, in SAM text format.

Package

sam.

Source

cl-sam.lisp.

Function: update-pg-records (current-records new-record)

Returns a copy of CURRENT-RECORDS with NEW-RECORD added.

Package

sam.

Source

sam.lisp.

Function: user-header-tag-p (tag)

Returns T if TAG is a SAM 1.4 user-defined header tag. User-defined tags are recognised by containing lower case letters.

Package

sam.

Source

sam.lisp.

Function: valid-header-tags (header-type)

Returns a list of the valid tags for SAM header HEADER-TYPE. Both HEADER-TYPE and the returned tags are represented as symbols.

Package

sam.

Source

sam.lisp.

Function: valid-read-name-p (str)

Returns T if STR is a valid read name matching the regex [!-?A-~]1,255 , or NIL otherwise. The length limit is implicit in the BAM format, there being 8 bits to store the read name length. This function is not used as it is not clear that this check is accepted by other implementations.

Package

sam.

Source

bam.lisp.

Function: voffset-merge-p (voffset1 voffset2)

Returns T if BGZF virtual offsets are close enough to save disk seeks. Continuing to read from the current position may be faster than seeking forward a short distance.

Package

sam.

Source

bam-index.lisp.

Function: write-bgz-member (bgz stream buffer)

Writes one BGZ member to STREAM.

Arguments:

- bgz (bgz member): A bgz member to write.
- stream (octet output-stream): An open stream.
- buffer (simple-octet-vector): A re-usable read buffer which must be able to contain at least 4 bytes.

Returns:

- The number of bytes written.

Package

sam.

Source

bgzf-writer.lisp.

Function: write-bin (bin stream)
Package

sam.

Source

bam-index-writer.lisp.

Function: write-binning-index (bins stream)
Package

sam.

Source

bam-index-writer.lisp.

Function: write-bytes (bgzf bytes n &key compress mtime)

Write N elements from vector BYTES to stream BGZF.

Key:

- compress (boolean): If T, compress at current BGZF compression level when the current block becomes full. Defaults to T.
- mtime (uint32): The zlib mtime. Defaults to 0.

Returns:

- The number of bytes written.

Package

sam.

Source

bgzf-writer.lisp.

Function: write-chunked-bytes (bgzf bytes n &key compress mtime)
Package

sam.

Source

bgzf-writer.lisp.

Function: write-cigar (alignment-record index num-bytes &optional stream)

Writes the CIGAR string of ALIGNMENT-RECORD at INDEX as NUM-BYTES bytes, to STREAM.

Package

sam.

Source

sam-writer.lisp.

Function: write-index-magic (stream)
Package

sam.

Source

bam-index-writer.lisp.

Function: write-linear-index (intervals stream)
Package

sam.

Source

bam-index-writer.lisp.

Function: write-quality-string (alignment-record index num-bytes &optional stream)

Writes the quality string of ALIGNMENT-RECORD at INDEX as NUM-BYTES, to STREAM.

Package

sam.

Source

sam-writer.lisp.

Function: write-seq-string (alignment-record index num-bytes &optional stream)

Writes the sequence string of ALIGNMENT-RECORD at INDEX as NUM-BYTES bytes, to STREAM.

Package

sam.

Source

sam-writer.lisp.

Function: write-tag-values (alignment-record index &optional stream)

Writes the auxilliary data of ALIGNMENT-RECORD at INDEX to STREAM.

Package

sam.

Source

sam-writer.lisp.


6.2.5 Generic functions

Generic Reader: bgzf-of (condition)
Package

sam.

Methods
Reader Method: bgzf-of ((condition bgzf-io-error))
Source

conditions.lisp.

Target Slot

bgzf.

Generic Reader: buffer-of (object)
Package

sam.

Methods
Reader Method: buffer-of ((bam-merge-stream bam-merge-stream))

automatically generated reader method

Source

external-bam-sort.lisp.

Target Slot

buffer.

Generic Function: encode-alignment-tag (value tag vector index)

Performs binary encoding of VALUE into VECTOR under TAG at INDEX, returning VECTOR.

Package

sam.

Source

bam.lisp.

Methods
Method: encode-alignment-tag (value (tag (eql :xt)) aln index)
Method: encode-alignment-tag (value (tag (eql :xs)) aln index)
Method: encode-alignment-tag (value (tag (eql :xo)) aln index)
Method: encode-alignment-tag (value (tag (eql :xn)) aln index)
Method: encode-alignment-tag (value (tag (eql :xm)) aln index)
Method: encode-alignment-tag (value (tag (eql :xg)) aln index)
Method: encode-alignment-tag (value (tag (eql :xf)) aln index)
Method: encode-alignment-tag (value (tag (eql :xe)) aln index)
Method: encode-alignment-tag (value (tag (eql :xc)) aln index)
Method: encode-alignment-tag (value (tag (eql :xa)) aln index)
Method: encode-alignment-tag (value (tag (eql :x1)) aln index)
Method: encode-alignment-tag (value (tag (eql :x0)) aln index)
Method: encode-alignment-tag (value (tag (eql :zf)) aln index)
Method: encode-alignment-tag (value (tag (eql :za)) aln index)
Method: encode-alignment-tag (value (tag (eql :uq)) aln index)
Method: encode-alignment-tag (value (tag (eql :u2)) aln index)
Method: encode-alignment-tag (value (tag (eql :tc)) aln index)
Method: encode-alignment-tag (value (tag (eql :sq)) aln index)
Method: encode-alignment-tag (value (tag (eql :sm)) aln index)
Method: encode-alignment-tag (value (tag (eql :s2)) aln index)
Method: encode-alignment-tag (value (tag (eql :sa)) aln index)
Method: encode-alignment-tag (value (tag (eql :rt)) aln index)
Method: encode-alignment-tag (value (tag (eql :rg)) aln index)
Method: encode-alignment-tag (value (tag (eql :r2)) aln index)
Method: encode-alignment-tag (value (tag (eql :qt)) aln index)
Method: encode-alignment-tag (value (tag (eql :q2)) aln index)
Method: encode-alignment-tag (value (tag (eql :pu)) aln index)
Method: encode-alignment-tag (value (tag (eql :pt)) aln index)
Method: encode-alignment-tag (value (tag (eql :pq)) aln index)
Method: encode-alignment-tag (value (tag (eql :pg)) aln index)
Method: encode-alignment-tag (value (tag (eql :oq)) aln index)
Method: encode-alignment-tag (value (tag (eql :op)) aln index)
Method: encode-alignment-tag (value (tag (eql :oc)) aln index)
Method: encode-alignment-tag (value (tag (eql :nm)) aln index)
Method: encode-alignment-tag (value (tag (eql :nh)) aln index)
Method: encode-alignment-tag (value (tag (eql :mq)) aln index)
Method: encode-alignment-tag (value (tag (eql :mf)) aln index)
Method: encode-alignment-tag (value (tag (eql :md)) aln index)
Method: encode-alignment-tag (value (tag (eql :ih)) aln index)
Method: encode-alignment-tag (value (tag (eql :hi)) aln index)
Method: encode-alignment-tag (value (tag (eql :h2)) aln index)
Method: encode-alignment-tag (value (tag (eql :h1)) aln index)
Method: encode-alignment-tag (value (tag (eql :h0)) aln index)
Method: encode-alignment-tag (value (tag (eql :lb)) aln index)
Method: encode-alignment-tag (value (tag (eql :gq)) aln index)
Method: encode-alignment-tag (value (tag (eql :gs)) aln index)
Method: encode-alignment-tag (value (tag (eql :gc)) aln index)
Method: encode-alignment-tag (value (tag (eql :fz)) aln index)
Method: encode-alignment-tag (value (tag (eql :fs)) aln index)
Method: encode-alignment-tag (value (tag (eql :fi)) aln index)
Method: encode-alignment-tag (value (tag (eql :e2)) aln index)
Method: encode-alignment-tag (value (tag (eql :ct)) aln index)
Method: encode-alignment-tag (value (tag (eql :cs)) aln index)
Method: encode-alignment-tag (value (tag (eql :cq)) aln index)
Method: encode-alignment-tag (value (tag (eql :cp)) aln index)
Method: encode-alignment-tag (value (tag (eql :co)) aln index)
Method: encode-alignment-tag (value (tag (eql :cm)) aln index)
Method: encode-alignment-tag (value (tag (eql :cc)) aln index)
Method: encode-alignment-tag (value (tag (eql :bq)) aln index)
Method: encode-alignment-tag (value (tag (eql :bc)) aln index)
Method: encode-alignment-tag (value (tag (eql :as)) aln index)
Method: encode-alignment-tag (value (tag (eql :am)) aln index)
Method: encode-alignment-tag (value tag vector index)
Generic Reader: errno-of (condition)
Package

sam.

Methods
Reader Method: errno-of ((condition bgzf-io-error))
Source

conditions.lisp.

Target Slot

errno.

Generic Reader: position-of (condition)
Package

sam.

Methods
Reader Method: position-of ((condition bam-sort-error))
Source

conditions.lisp.

Target Slot

position.

Generic Reader: prev-position-of (condition)
Package

sam.

Methods
Reader Method: prev-position-of ((condition bam-sort-error))
Source

conditions.lisp.

Target Slot

prev-position.

Generic Reader: prev-reference-of (condition)
Package

sam.

Methods
Reader Method: prev-reference-of ((condition bam-sort-error))
Source

conditions.lisp.

Target Slot

prev-reference.

Generic Reader: reference-of (condition)
Package

sam.

Methods
Reader Method: reference-of ((condition bam-sort-error))
Source

conditions.lisp.

Target Slot

reference.

Generic Function: write-ref-index (ref-index stream)
Package

sam.

Source

bam-index-writer.lisp.

Methods
Method: write-ref-index ((ref-index ref-index) stream)
Method: write-ref-index ((ref-index samtools-ref-index) stream)

6.2.6 Structures

Structure: alignment
Package

sam.

Source

bam.lisp.

Direct superclasses

structure-object.

Direct methods

print-object.

Direct slots
Slot: bin
Type

uk.co.deoxybyte-utilities:uint16

Initform

0

Readers

aln-bin.

Writers

(setf aln-bin).

Slot: flag
Type

uk.co.deoxybyte-utilities:uint16

Initform

0

Readers

aln-flag.

Writers

(setf aln-flag).

Slot: pos
Type

uk.co.deoxybyte-utilities:int32

Initform

sam::+unknown-position+

Readers

aln-pos.

Writers

(setf aln-pos).

Slot: mate-pos
Type

uk.co.deoxybyte-utilities:int32

Initform

sam::+unknown-position+

Readers

aln-mate-pos.

Writers

(setf aln-mate-pos).

Slot: ref-id
Type

uk.co.deoxybyte-utilities:int32

Initform

sam::+unknown-reference+

Readers

aln-ref-id.

Writers

(setf aln-ref-id).

Slot: mate-ref-id
Type

uk.co.deoxybyte-utilities:int32

Initform

sam::+unknown-reference+

Readers

aln-mate-ref-id.

Writers

(setf aln-mate-ref-id).

Slot: ref-len
Type

fixnum

Initform

0

Readers

aln-ref-len.

Writers

(setf aln-ref-len).

Slot: map-qual
Type

uk.co.deoxybyte-utilities:uint8

Initform

0

Readers

aln-map-qual.

Writers

(setf aln-map-qual).

Slot: insert-length
Type

uk.co.deoxybyte-utilities:int32

Initform

0

Readers

aln-insert-length.

Writers

(setf aln-insert-length).

Slot: read-name
Type

simple-string

Initform

"*"

Readers

aln-read-name.

Writers

(setf aln-read-name).

Slot: seq-str
Type

simple-string

Initform

"*"

Readers

aln-seq-str.

Writers

(setf aln-seq-str).

Slot: qual-str
Type

simple-string

Initform

"*"

Readers

aln-qual-str.

Writers

(setf aln-qual-str).

Slot: cigar
Type

list

Readers

aln-cigar.

Writers

(setf aln-cigar).

Slot: record
Type

uk.co.deoxybyte-utilities:simple-octet-vector

Initform

(make-array 0 :element-type (quote uk.co.deoxybyte-utilities:octet))

Readers

aln-record.

Writers

(setf aln-record).

Structure: bgz-member

A block-gzip data chunk; a gzip member with extensions, as defined
by RFC1952. The extensions are described in RFC1952 and the SAM format specification.

- sf1: RCF1952 first extra SubField.
- sf2: RCF1952 second extra SubField.
- slen: RFC1952 Subfield LENgth.
- bsize: SAM spec total Block (member) SIZE. The serialized value is (1- bsize). - udata: Uncompressed DATA.

Package

sam.

Source

bgzf.lisp.

Direct superclasses

gz-member.

Direct slots
Slot: sf1
Type

uk.co.deoxybyte-utilities:uint8

Initform

sam::+sf1+

Readers

bgz-member-sf1.

Writers

This slot is read-only.

Slot: sf2
Type

uk.co.deoxybyte-utilities:uint8

Initform

sam::+sf2+

Readers

bgz-member-sf2.

Writers

This slot is read-only.

Slot: slen
Type

uk.co.deoxybyte-utilities:uint16

Initform

sam::+slen+

Readers

bgz-member-slen.

Writers

This slot is read-only.

Slot: bsize
Type

uk.co.deoxybyte-utilities:uint16

Initform

0

Readers

bgz-member-bsize.

Writers

(setf bgz-member-bsize).

Slot: udata
Type

uk.co.deoxybyte-utilities:simple-octet-vector

Initform

(make-array 0 :element-type (quote uk.co.deoxybyte-utilities:octet))

Readers

bgz-member-udata.

Writers

(setf bgz-member-udata).

Structure: region

A range of bases over a reference sequence. A region is expressed in zero-based, half-open, interbase coordinates.

Package

sam.

Source

bam-index.lisp.

Direct superclasses

structure-object.

Direct methods

print-object.

Direct slots
Slot: ref
Readers

region-ref.

Writers

(setf region-ref).

Slot: start
Type

fixnum

Initform

0

Readers

region-start.

Writers

(setf region-start).

Slot: end
Type

fixnum

Initform

0

Readers

region-end.

Writers

(setf region-end).

Structure: samtools-bam-index

A samtools-specific index containing extra, undocumented data: - unassigned: number of unmapped reads not assigned to a reference

Package

sam.

Source

bam-index.lisp.

Direct superclasses

bam-index.

Direct methods

write-bam-index.

Direct slots
Slot: unassigned
Type

(unsigned-byte 64)

Initform

0

Readers

samtools-bam-index-unassigned.

Writers

(setf samtools-bam-index-unassigned).

Structure: samtools-ref-index

A samtools-specific reference index containing extra, undocumented data:

- start: the start offset of the reference
- end: the end offset of the reference
- mapped: number of reads mapped to the reference
- unmapped: number of unmapped reads assigned to the reference by magic

Package

sam.

Source

bam-index.lisp.

Direct superclasses

ref-index.

Direct methods
Direct slots
Slot: start
Type

(unsigned-byte 64)

Initform

0

Readers

samtools-ref-index-start.

Writers

(setf samtools-ref-index-start).

Slot: end
Type

(unsigned-byte 64)

Initform

0

Readers

samtools-ref-index-end.

Writers

(setf samtools-ref-index-end).

Slot: mapped
Type

(unsigned-byte 64)

Initform

0

Readers

samtools-ref-index-mapped.

Writers

(setf samtools-ref-index-mapped).

Slot: unmapped
Type

(unsigned-byte 64)

Initform

0

Readers

samtools-ref-index-unmapped.

Writers

(setf samtools-ref-index-unmapped).


6.2.7 Classes

Class: bam-merge-stream
Package

sam.

Source

external-bam-sort.lisp.

Direct superclasses
  • merge-stream.
  • wrapped-stream-mixin.
Direct methods
Direct slots
Slot: buffer
Initform

(make-array 4 :element-type (quote uk.co.deoxybyte-utilities:octet) :initial-element 0)

Readers

buffer-of.

Writers

This slot is read-only.

Class: bam-sort-input-stream
Package

sam.

Source

external-bam-sort.lisp.

Direct superclasses
Direct methods
Class: bam-sort-output-stream
Package

sam.

Source

external-bam-sort.lisp.

Direct superclasses
Direct methods

stream-write-element.

Class: bgzf-handle-mixin
Package

sam.

Source

bgzip-stream.lisp.

Direct subclasses
Direct slots
Slot: bgzf

The BGZF file handle.

Initargs

:bgzf


6.2.8 Types

Type: bgzip-buffer ()

Buffer type for {defclass bgzip-input-stream} internal buffer.

Package

sam.

Source

bgzip-stream.lisp.

Type: bgzip-buffer-index ()

Index type for {defclass bgzf-input-stream} internal buffer.

Package

sam.

Source

bgzip-stream.lisp.


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   %   (  
A   B   C   D   E   F   G   H   I   L   M   N   P   Q   R   S   U   V   W  
Index Entry  Section

%
%encode-string-tag: Private ordinary functions
%make-bam-index: Private ordinary functions
%make-ref-index: Private ordinary functions
%read-bam-alignment: Private ordinary functions
%stream-read-sequence: Private ordinary functions
%write-int32: Private ordinary functions
%write-int64: Private ordinary functions

(
(setf aln-bin): Private ordinary functions
(setf aln-cigar): Private ordinary functions
(setf aln-flag): Private ordinary functions
(setf aln-insert-length): Private ordinary functions
(setf aln-map-qual): Private ordinary functions
(setf aln-mate-pos): Private ordinary functions
(setf aln-mate-ref-id): Private ordinary functions
(setf aln-pos): Private ordinary functions
(setf aln-qual-str): Private ordinary functions
(setf aln-read-name): Private ordinary functions
(setf aln-record): Private ordinary functions
(setf aln-ref-id): Private ordinary functions
(setf aln-ref-len): Private ordinary functions
(setf aln-seq-str): Private ordinary functions
(setf bam-index-refs): Public ordinary functions
(setf bgz-member-bsize): Private ordinary functions
(setf bgz-member-cdata): Private ordinary functions
(setf bgz-member-cend): Private ordinary functions
(setf bgz-member-crc32): Private ordinary functions
(setf bgz-member-flg): Private ordinary functions
(setf bgz-member-isize): Private ordinary functions
(setf bgz-member-mtime): Private ordinary functions
(setf bgz-member-os): Private ordinary functions
(setf bgz-member-udata): Private ordinary functions
(setf bgz-member-xfl): Private ordinary functions
(setf bgz-member-xlen): Private ordinary functions
(setf bgzf-buffer): Private ordinary functions
(setf bgzf-compression): Private ordinary functions
(setf bgzf-eof): Private ordinary functions
(setf bgzf-load-seek): Private ordinary functions
(setf bgzf-loaded-p): Private ordinary functions
(setf bgzf-offset): Private ordinary functions
(setf bgzf-pathname): Private ordinary functions
(setf bgzf-pointer): Private ordinary functions
(setf bgzf-position): Private ordinary functions
(setf bgzf-stream): Private ordinary functions
(setf bgzf-util-buffer): Private ordinary functions
(setf bin-chunks): Public ordinary functions
(setf chunk-end): Public ordinary functions
(setf chunk-start): Public ordinary functions
(setf ref-index-bins): Public ordinary functions
(setf ref-index-intervals): Public ordinary functions
(setf region-end): Private ordinary functions
(setf region-ref): Private ordinary functions
(setf region-start): Private ordinary functions
(setf samtools-bam-index-refs): Private ordinary functions
(setf samtools-bam-index-unassigned): Private ordinary functions
(setf samtools-ref-index-bins): Private ordinary functions
(setf samtools-ref-index-end): Private ordinary functions
(setf samtools-ref-index-intervals): Private ordinary functions
(setf samtools-ref-index-mapped): Private ordinary functions
(setf samtools-ref-index-start): Private ordinary functions
(setf samtools-ref-index-unmapped): Private ordinary functions

A
add-pg-record: Public ordinary functions
adjacentp: Private ordinary functions
alignment-bin: Public ordinary functions
alignment-cigar: Public ordinary functions
alignment-core: Public ordinary functions
alignment-core-alist: Public ordinary functions
alignment-flag: Public ordinary functions
alignment-flag-alist: Public ordinary functions
alignment-generator: Public ordinary functions
alignment-indices: Private ordinary functions
alignment-name-natural<: Private ordinary functions
alignment-name<: Public ordinary functions
alignment-not-primary-p: Public ordinary functions
alignment-orphanizer: Public ordinary functions
alignment-p: Private ordinary functions
alignment-position: Public ordinary functions
alignment-primary-p: Private ordinary functions
alignment-read-length: Private ordinary functions
alignment-record<: Public ordinary functions
alignment-reference-end: Public ordinary functions
alignment-reference-length: Private ordinary functions
alignment-tag-bytes: Private ordinary functions
alignment-tag-documentation: Public generic functions
alignment-tag-documentation: Public generic functions
alignment-tag-documentation: Public generic functions
alignment-tag-documentation: Public generic functions
alignment-tag-documentation: Public generic functions
alignment-tag-documentation: Public generic functions
alignment-tag-documentation: Public generic functions
alignment-tag-documentation: Public generic functions
alignment-tag-documentation: Public generic functions
alignment-tag-documentation: Public generic functions
alignment-tag-documentation: Public generic functions
alignment-tag-documentation: Public generic functions
alignment-tag-documentation: Public generic functions
alignment-tag-documentation: Public generic functions
alignment-tag-documentation: Public generic functions
alignment-tag-documentation: Public generic functions
alignment-tag-documentation: Public generic functions
alignment-tag-documentation: Public generic functions
alignment-tag-documentation: Public generic functions
alignment-tag-documentation: Public generic functions
alignment-tag-documentation: Public generic functions
alignment-tag-documentation: Public generic functions
alignment-tag-documentation: Public generic functions
alignment-tag-documentation: Public generic functions
alignment-tag-documentation: Public generic functions
alignment-tag-documentation: Public generic functions
alignment-tag-documentation: Public generic functions
alignment-tag-documentation: Public generic functions
alignment-tag-documentation: Public generic functions
alignment-tag-documentation: Public generic functions
alignment-tag-documentation: Public generic functions
alignment-tag-documentation: Public generic functions
alignment-tag-documentation: Public generic functions
alignment-tag-documentation: Public generic functions
alignment-tag-documentation: Public generic functions
alignment-tag-documentation: Public generic functions
alignment-tag-documentation: Public generic functions
alignment-tag-documentation: Public generic functions
alignment-tag-documentation: Public generic functions
alignment-tag-documentation: Public generic functions
alignment-tag-documentation: Public generic functions
alignment-tag-documentation: Public generic functions
alignment-tag-documentation: Public generic functions
alignment-tag-documentation: Public generic functions
alignment-tag-documentation: Public generic functions
alignment-tag-documentation: Public generic functions
alignment-tag-documentation: Public generic functions
alignment-tag-documentation: Public generic functions
alignment-tag-documentation: Public generic functions
alignment-tag-documentation: Public generic functions
alignment-tag-documentation: Public generic functions
alignment-tag-documentation: Public generic functions
alignment-tag-documentation: Public generic functions
alignment-tag-documentation: Public generic functions
alignment-tag-documentation: Public generic functions
alignment-tag-documentation: Public generic functions
alignment-tag-documentation: Public generic functions
alignment-tag-documentation: Public generic functions
alignment-tag-documentation: Public generic functions
alignment-tag-documentation: Public generic functions
alignment-tag-documentation: Public generic functions
alignment-tag-documentation: Public generic functions
alignment-tag-documentation: Public generic functions
alignment-tag-documentation: Public generic functions
alignment-tag-values: Public ordinary functions
aln-bin: Private ordinary functions
aln-cigar: Private ordinary functions
aln-flag: Private ordinary functions
aln-insert-length: Private ordinary functions
aln-map-qual: Private ordinary functions
aln-mate-pos: Private ordinary functions
aln-mate-ref-id: Private ordinary functions
aln-pos: Private ordinary functions
aln-qual-str: Private ordinary functions
aln-read-name: Private ordinary functions
aln-record: Private ordinary functions
aln-ref-id: Private ordinary functions
aln-ref-len: Private ordinary functions
aln-seq-str: Private ordinary functions

B
bam-index-p: Private ordinary functions
bam-index-refs: Public ordinary functions
bam-meta-size: Private ordinary functions
bam-meta-size2: Private ordinary functions
bam-sort-error: Public ordinary functions
bgz-member-bsize: Private ordinary functions
bgz-member-cdata: Private ordinary functions
bgz-member-cend: Private ordinary functions
bgz-member-cm: Private ordinary functions
bgz-member-crc32: Private ordinary functions
bgz-member-flg: Private ordinary functions
bgz-member-id1: Private ordinary functions
bgz-member-id2: Private ordinary functions
bgz-member-isize: Private ordinary functions
bgz-member-mtime: Private ordinary functions
bgz-member-os: Private ordinary functions
bgz-member-p: Private ordinary functions
bgz-member-sf1: Private ordinary functions
bgz-member-sf2: Private ordinary functions
bgz-member-slen: Private ordinary functions
bgz-member-udata: Private ordinary functions
bgz-member-xfl: Private ordinary functions
bgz-member-xlen: Private ordinary functions
bgzf-buffer: Private ordinary functions
bgzf-close: Public ordinary functions
bgzf-coffset: Private ordinary functions
bgzf-compression: Private ordinary functions
bgzf-empty-p: Private ordinary functions
bgzf-eof: Private ordinary functions
bgzf-eof-p: Public ordinary functions
bgzf-flush: Private ordinary functions
bgzf-load-seek: Private ordinary functions
bgzf-loaded-p: Private ordinary functions
bgzf-of: Private generic functions
bgzf-of: Private generic functions
bgzf-offset: Private ordinary functions
bgzf-open: Public ordinary functions
bgzf-open-p: Public ordinary functions
bgzf-p: Private ordinary functions
bgzf-pathname: Private ordinary functions
bgzf-pointer: Private ordinary functions
bgzf-position: Private ordinary functions
bgzf-seek: Public ordinary functions
bgzf-stream: Private ordinary functions
bgzf-tell: Public ordinary functions
bgzf-uoffset: Private ordinary functions
bgzf-util-buffer: Private ordinary functions
bgzip-open: Public ordinary functions
bin-chunk: Public ordinary functions
bin-chunks: Public ordinary functions
bin-num: Public ordinary functions
bin-p: Private ordinary functions
block-sizes: Private ordinary functions
buffer-empty-p: Private ordinary functions
buffer-of: Private generic functions
buffer-of: Private generic functions

C
chunk-end: Public ordinary functions
chunk-p: Private ordinary functions
chunk-start: Public ordinary functions
cigar-length: Public ordinary functions
coordinate-sorted-p: Public ordinary functions
copy-alignment: Private ordinary functions
copy-alignment-record: Public ordinary functions
copy-bam-index: Private ordinary functions
copy-bgz-member: Private ordinary functions
copy-bgzf: Private ordinary functions
copy-bin: Private ordinary functions
copy-chunk: Private ordinary functions
copy-ref-index: Private ordinary functions
copy-region: Private ordinary functions
copy-samtools-bam-index: Private ordinary functions
copy-samtools-ref-index: Private ordinary functions

D
decode-cigar: Private ordinary functions
decode-quality-string: Private ordinary functions
decode-read-name: Private ordinary functions
decode-seq-string: Private ordinary functions
decode-tag-values: Private ordinary functions
default-orphanizer-test: Private ordinary functions
default-qual-string: Private ordinary functions
default-seq-string: Private ordinary functions
define-alignment-tag: Public macros
define-header-tag-parser: Private macros
deflate-bgz-member: Private ordinary functions

E
empty-bin-p: Public ordinary functions
encode-alignment-tag: Private generic functions
encode-alignment-tag: Private generic functions
encode-alignment-tag: Private generic functions
encode-alignment-tag: Private generic functions
encode-alignment-tag: Private generic functions
encode-alignment-tag: Private generic functions
encode-alignment-tag: Private generic functions
encode-alignment-tag: Private generic functions
encode-alignment-tag: Private generic functions
encode-alignment-tag: Private generic functions
encode-alignment-tag: Private generic functions
encode-alignment-tag: Private generic functions
encode-alignment-tag: Private generic functions
encode-alignment-tag: Private generic functions
encode-alignment-tag: Private generic functions
encode-alignment-tag: Private generic functions
encode-alignment-tag: Private generic functions
encode-alignment-tag: Private generic functions
encode-alignment-tag: Private generic functions
encode-alignment-tag: Private generic functions
encode-alignment-tag: Private generic functions
encode-alignment-tag: Private generic functions
encode-alignment-tag: Private generic functions
encode-alignment-tag: Private generic functions
encode-alignment-tag: Private generic functions
encode-alignment-tag: Private generic functions
encode-alignment-tag: Private generic functions
encode-alignment-tag: Private generic functions
encode-alignment-tag: Private generic functions
encode-alignment-tag: Private generic functions
encode-alignment-tag: Private generic functions
encode-alignment-tag: Private generic functions
encode-alignment-tag: Private generic functions
encode-alignment-tag: Private generic functions
encode-alignment-tag: Private generic functions
encode-alignment-tag: Private generic functions
encode-alignment-tag: Private generic functions
encode-alignment-tag: Private generic functions
encode-alignment-tag: Private generic functions
encode-alignment-tag: Private generic functions
encode-alignment-tag: Private generic functions
encode-alignment-tag: Private generic functions
encode-alignment-tag: Private generic functions
encode-alignment-tag: Private generic functions
encode-alignment-tag: Private generic functions
encode-alignment-tag: Private generic functions
encode-alignment-tag: Private generic functions
encode-alignment-tag: Private generic functions
encode-alignment-tag: Private generic functions
encode-alignment-tag: Private generic functions
encode-alignment-tag: Private generic functions
encode-alignment-tag: Private generic functions
encode-alignment-tag: Private generic functions
encode-alignment-tag: Private generic functions
encode-alignment-tag: Private generic functions
encode-alignment-tag: Private generic functions
encode-alignment-tag: Private generic functions
encode-alignment-tag: Private generic functions
encode-alignment-tag: Private generic functions
encode-alignment-tag: Private generic functions
encode-alignment-tag: Private generic functions
encode-alignment-tag: Private generic functions
encode-alignment-tag: Private generic functions
encode-alignment-tag: Private generic functions
encode-char-tag: Private ordinary functions
encode-cigar: Private ordinary functions
encode-float-tag: Private ordinary functions
encode-hex-tag: Private ordinary functions
encode-int-tag: Private ordinary functions
encode-phred-quality: Private ordinary functions
encode-quality-string: Private ordinary functions
encode-read-name: Private ordinary functions
encode-seq-string: Private ordinary functions
encode-string-tag: Private ordinary functions
encode-unknown-quality: Private ordinary functions
ensure-mandatory-header-tags: Public ordinary functions
ensure-order: Private ordinary functions
ensure-sam-version: Private ordinary functions
ensure-unique-tag-values: Private ordinary functions
ensure-valid-flag: Private ordinary functions
ensure-valid-header-tags: Public ordinary functions
ensure-valid-programs: Public ordinary functions
ensure-valid-read-name: Private ordinary functions
ensure-valid-reference-name: Private ordinary functions
ensure-valid-region: Private ordinary functions
errno-of: Private generic functions
errno-of: Private generic functions

F
fails-platform-qc-p: Public ordinary functions
fill-buffer: Private ordinary functions
find-bam-index: Public ordinary functions
find-bins: Public ordinary functions
find-duplicate-header-tags: Private ordinary functions
find-duplicate-records: Private ordinary functions
find-interval: Private ordinary functions
first-frag-p: Public ordinary functions
first-in-pair-p: Public ordinary functions
flag-bits: Public ordinary functions
flag-symbol: Private ordinary functions
flag-validation-error: Private ordinary functions
flagstat: Public ordinary functions
frag-forward-p: Public ordinary functions
frag-mapped-p: Public ordinary functions
frag-reverse-p: Public ordinary functions
frag-unmapped-p: Public ordinary functions
Function, %encode-string-tag: Private ordinary functions
Function, %make-bam-index: Private ordinary functions
Function, %make-ref-index: Private ordinary functions
Function, %read-bam-alignment: Private ordinary functions
Function, %stream-read-sequence: Private ordinary functions
Function, %write-int32: Private ordinary functions
Function, %write-int64: Private ordinary functions
Function, (setf aln-bin): Private ordinary functions
Function, (setf aln-cigar): Private ordinary functions
Function, (setf aln-flag): Private ordinary functions
Function, (setf aln-insert-length): Private ordinary functions
Function, (setf aln-map-qual): Private ordinary functions
Function, (setf aln-mate-pos): Private ordinary functions
Function, (setf aln-mate-ref-id): Private ordinary functions
Function, (setf aln-pos): Private ordinary functions
Function, (setf aln-qual-str): Private ordinary functions
Function, (setf aln-read-name): Private ordinary functions
Function, (setf aln-record): Private ordinary functions
Function, (setf aln-ref-id): Private ordinary functions
Function, (setf aln-ref-len): Private ordinary functions
Function, (setf aln-seq-str): Private ordinary functions
Function, (setf bam-index-refs): Public ordinary functions
Function, (setf bgz-member-bsize): Private ordinary functions
Function, (setf bgz-member-cdata): Private ordinary functions
Function, (setf bgz-member-cend): Private ordinary functions
Function, (setf bgz-member-crc32): Private ordinary functions
Function, (setf bgz-member-flg): Private ordinary functions
Function, (setf bgz-member-isize): Private ordinary functions
Function, (setf bgz-member-mtime): Private ordinary functions
Function, (setf bgz-member-os): Private ordinary functions
Function, (setf bgz-member-udata): Private ordinary functions
Function, (setf bgz-member-xfl): Private ordinary functions
Function, (setf bgz-member-xlen): Private ordinary functions
Function, (setf bgzf-buffer): Private ordinary functions
Function, (setf bgzf-compression): Private ordinary functions
Function, (setf bgzf-eof): Private ordinary functions
Function, (setf bgzf-load-seek): Private ordinary functions
Function, (setf bgzf-loaded-p): Private ordinary functions
Function, (setf bgzf-offset): Private ordinary functions
Function, (setf bgzf-pathname): Private ordinary functions
Function, (setf bgzf-pointer): Private ordinary functions
Function, (setf bgzf-position): Private ordinary functions
Function, (setf bgzf-stream): Private ordinary functions
Function, (setf bgzf-util-buffer): Private ordinary functions
Function, (setf bin-chunks): Public ordinary functions
Function, (setf chunk-end): Public ordinary functions
Function, (setf chunk-start): Public ordinary functions
Function, (setf ref-index-bins): Public ordinary functions
Function, (setf ref-index-intervals): Public ordinary functions
Function, (setf region-end): Private ordinary functions
Function, (setf region-ref): Private ordinary functions
Function, (setf region-start): Private ordinary functions
Function, (setf samtools-bam-index-refs): Private ordinary functions
Function, (setf samtools-bam-index-unassigned): Private ordinary functions
Function, (setf samtools-ref-index-bins): Private ordinary functions
Function, (setf samtools-ref-index-end): Private ordinary functions
Function, (setf samtools-ref-index-intervals): Private ordinary functions
Function, (setf samtools-ref-index-mapped): Private ordinary functions
Function, (setf samtools-ref-index-start): Private ordinary functions
Function, (setf samtools-ref-index-unmapped): Private ordinary functions
Function, add-pg-record: Public ordinary functions
Function, adjacentp: Private ordinary functions
Function, alignment-bin: Public ordinary functions
Function, alignment-cigar: Public ordinary functions
Function, alignment-core: Public ordinary functions
Function, alignment-core-alist: Public ordinary functions
Function, alignment-flag: Public ordinary functions
Function, alignment-flag-alist: Public ordinary functions
Function, alignment-generator: Public ordinary functions
Function, alignment-indices: Private ordinary functions
Function, alignment-name-natural<: Private ordinary functions
Function, alignment-name<: Public ordinary functions
Function, alignment-not-primary-p: Public ordinary functions
Function, alignment-orphanizer: Public ordinary functions
Function, alignment-p: Private ordinary functions
Function, alignment-position: Public ordinary functions
Function, alignment-primary-p: Private ordinary functions
Function, alignment-read-length: Private ordinary functions
Function, alignment-record<: Public ordinary functions
Function, alignment-reference-end: Public ordinary functions
Function, alignment-reference-length: Private ordinary functions
Function, alignment-tag-bytes: Private ordinary functions
Function, alignment-tag-values: Public ordinary functions
Function, aln-bin: Private ordinary functions
Function, aln-cigar: Private ordinary functions
Function, aln-flag: Private ordinary functions
Function, aln-insert-length: Private ordinary functions
Function, aln-map-qual: Private ordinary functions
Function, aln-mate-pos: Private ordinary functions
Function, aln-mate-ref-id: Private ordinary functions
Function, aln-pos: Private ordinary functions
Function, aln-qual-str: Private ordinary functions
Function, aln-read-name: Private ordinary functions
Function, aln-record: Private ordinary functions
Function, aln-ref-id: Private ordinary functions
Function, aln-ref-len: Private ordinary functions
Function, aln-seq-str: Private ordinary functions
Function, bam-index-p: Private ordinary functions
Function, bam-index-refs: Public ordinary functions
Function, bam-meta-size: Private ordinary functions
Function, bam-meta-size2: Private ordinary functions
Function, bam-sort-error: Public ordinary functions
Function, bgz-member-bsize: Private ordinary functions
Function, bgz-member-cdata: Private ordinary functions
Function, bgz-member-cend: Private ordinary functions
Function, bgz-member-cm: Private ordinary functions
Function, bgz-member-crc32: Private ordinary functions
Function, bgz-member-flg: Private ordinary functions
Function, bgz-member-id1: Private ordinary functions
Function, bgz-member-id2: Private ordinary functions
Function, bgz-member-isize: Private ordinary functions
Function, bgz-member-mtime: Private ordinary functions
Function, bgz-member-os: Private ordinary functions
Function, bgz-member-p: Private ordinary functions
Function, bgz-member-sf1: Private ordinary functions
Function, bgz-member-sf2: Private ordinary functions
Function, bgz-member-slen: Private ordinary functions
Function, bgz-member-udata: Private ordinary functions
Function, bgz-member-xfl: Private ordinary functions
Function, bgz-member-xlen: Private ordinary functions
Function, bgzf-buffer: Private ordinary functions
Function, bgzf-close: Public ordinary functions
Function, bgzf-coffset: Private ordinary functions
Function, bgzf-compression: Private ordinary functions
Function, bgzf-empty-p: Private ordinary functions
Function, bgzf-eof: Private ordinary functions
Function, bgzf-eof-p: Public ordinary functions
Function, bgzf-flush: Private ordinary functions
Function, bgzf-load-seek: Private ordinary functions
Function, bgzf-loaded-p: Private ordinary functions
Function, bgzf-offset: Private ordinary functions
Function, bgzf-open: Public ordinary functions
Function, bgzf-open-p: Public ordinary functions
Function, bgzf-p: Private ordinary functions
Function, bgzf-pathname: Private ordinary functions
Function, bgzf-pointer: Private ordinary functions
Function, bgzf-position: Private ordinary functions
Function, bgzf-seek: Public ordinary functions
Function, bgzf-stream: Private ordinary functions
Function, bgzf-tell: Public ordinary functions
Function, bgzf-uoffset: Private ordinary functions
Function, bgzf-util-buffer: Private ordinary functions
Function, bgzip-open: Public ordinary functions
Function, bin-chunk: Public ordinary functions
Function, bin-chunks: Public ordinary functions
Function, bin-num: Public ordinary functions
Function, bin-p: Private ordinary functions
Function, block-sizes: Private ordinary functions
Function, buffer-empty-p: Private ordinary functions
Function, chunk-end: Public ordinary functions
Function, chunk-p: Private ordinary functions
Function, chunk-start: Public ordinary functions
Function, cigar-length: Public ordinary functions
Function, coordinate-sorted-p: Public ordinary functions
Function, copy-alignment: Private ordinary functions
Function, copy-alignment-record: Public ordinary functions
Function, copy-bam-index: Private ordinary functions
Function, copy-bgz-member: Private ordinary functions
Function, copy-bgzf: Private ordinary functions
Function, copy-bin: Private ordinary functions
Function, copy-chunk: Private ordinary functions
Function, copy-ref-index: Private ordinary functions
Function, copy-region: Private ordinary functions
Function, copy-samtools-bam-index: Private ordinary functions
Function, copy-samtools-ref-index: Private ordinary functions
Function, decode-cigar: Private ordinary functions
Function, decode-quality-string: Private ordinary functions
Function, decode-read-name: Private ordinary functions
Function, decode-seq-string: Private ordinary functions
Function, decode-tag-values: Private ordinary functions
Function, default-orphanizer-test: Private ordinary functions
Function, default-qual-string: Private ordinary functions
Function, default-seq-string: Private ordinary functions
Function, deflate-bgz-member: Private ordinary functions
Function, empty-bin-p: Public ordinary functions
Function, encode-char-tag: Private ordinary functions
Function, encode-cigar: Private ordinary functions
Function, encode-float-tag: Private ordinary functions
Function, encode-hex-tag: Private ordinary functions
Function, encode-int-tag: Private ordinary functions
Function, encode-phred-quality: Private ordinary functions
Function, encode-quality-string: Private ordinary functions
Function, encode-read-name: Private ordinary functions
Function, encode-seq-string: Private ordinary functions
Function, encode-string-tag: Private ordinary functions
Function, encode-unknown-quality: Private ordinary functions
Function, ensure-mandatory-header-tags: Public ordinary functions
Function, ensure-order: Private ordinary functions
Function, ensure-sam-version: Private ordinary functions
Function, ensure-unique-tag-values: Private ordinary functions
Function, ensure-valid-flag: Private ordinary functions
Function, ensure-valid-header-tags: Public ordinary functions
Function, ensure-valid-programs: Public ordinary functions
Function, ensure-valid-read-name: Private ordinary functions
Function, ensure-valid-reference-name: Private ordinary functions
Function, ensure-valid-region: Private ordinary functions
Function, fails-platform-qc-p: Public ordinary functions
Function, fill-buffer: Private ordinary functions
Function, find-bam-index: Public ordinary functions
Function, find-bins: Public ordinary functions
Function, find-duplicate-header-tags: Private ordinary functions
Function, find-duplicate-records: Private ordinary functions
Function, find-interval: Private ordinary functions
Function, first-frag-p: Public ordinary functions
Function, first-in-pair-p: Public ordinary functions
Function, flag-bits: Public ordinary functions
Function, flag-symbol: Private ordinary functions
Function, flag-validation-error: Private ordinary functions
Function, flagstat: Public ordinary functions
Function, frag-forward-p: Public ordinary functions
Function, frag-mapped-p: Public ordinary functions
Function, frag-reverse-p: Public ordinary functions
Function, frag-unmapped-p: Public ordinary functions
Function, generate-bam-file: Public ordinary functions
Function, generate-reference-file: Public ordinary functions
Function, group-by-tag: Private ordinary functions
Function, hd-record: Public ordinary functions
Function, header-record: Private ordinary functions
Function, header-records: Public ordinary functions
Function, header-tags: Public ordinary functions
Function, header-type: Public ordinary functions
Function, header-value: Public ordinary functions
Function, index-bam-file: Public ordinary functions
Function, inflate-bgz-member: Private ordinary functions
Function, insert-length: Public ordinary functions
Function, last-frag-p: Public ordinary functions
Function, last-programs: Public ordinary functions
Function, make-alignment: Private ordinary functions
Function, make-alignment-record: Public ordinary functions
Function, make-aln: Private ordinary functions
Function, make-bam-chunks: Private ordinary functions
Function, make-bam-full-scan-input: Private ordinary functions
Function, make-bam-index: Private ordinary functions
Function, make-bam-index-input: Private ordinary functions
Function, make-bam-output: Public ordinary functions
Function, make-bam-scan-input: Private ordinary functions
Function, make-bgz-member: Private ordinary functions
Function, make-bgzf: Private ordinary functions
Function, make-bin: Private ordinary functions
Function, make-chunk: Private ordinary functions
Function, make-header-record: Public ordinary functions
Function, make-header-string: Private ordinary functions
Function, make-ref-index: Private ordinary functions
Function, make-reference-table: Public ordinary functions
Function, make-region: Private ordinary functions
Function, make-region<: Private ordinary functions
Function, make-sam-header: Public ordinary functions
Function, make-samtools-bam-index: Private ordinary functions
Function, make-samtools-ref-index: Private ordinary functions
Function, mandatory-header-tags: Private ordinary functions
Function, mapped-proper-pair-p: Public ordinary functions
Function, mapping-quality: Public ordinary functions
Function, mate-alignment-position: Public ordinary functions
Function, mate-forward-p: Public ordinary functions
Function, mate-mapped-p: Public ordinary functions
Function, mate-reference-id: Public ordinary functions
Function, mate-reverse-p: Public ordinary functions
Function, mate-unmapped-p: Public ordinary functions
Function, max-bin-num: Private ordinary functions
Function, medial-frag-p: Public ordinary functions
Function, merge-chunks: Private ordinary functions
Function, merge-header-records: Public ordinary functions
Function, merge-sam-headers: Public ordinary functions
Function, multiple-frags-p: Public ordinary functions
Function, name-sorted-p: Public ordinary functions
Function, next-forward-p: Private ordinary functions
Function, next-mapped-p: Private ordinary functions
Function, next-reverse-p: Public ordinary functions
Function, next-unmapped-p: Public ordinary functions
Function, normalise-regions: Private ordinary functions
Function, parse-digits: Private ordinary functions
Function, parse-hd-tag: Private ordinary functions
Function, parse-pg-tag: Private ordinary functions
Function, parse-region-string: Public ordinary functions
Function, parse-rg-tag: Private ordinary functions
Function, parse-sq-tag: Private ordinary functions
Function, partition-by-type: Private ordinary functions
Function, partition-regions: Private ordinary functions
Function, pcr/optical-duplicate-p: Public ordinary functions
Function, pg-record: Public ordinary functions
Function, previous-programs: Public ordinary functions
Function, print-aln: Private ordinary functions
Function, print-bin: Private ordinary functions
Function, print-chunk: Private ordinary functions
Function, print-ref-index: Private ordinary functions
Function, print-region: Private ordinary functions
Function, print-samtools-ref-index: Private ordinary functions
Function, proper-aligned-frags-p: Public ordinary functions
Function, quality-string: Public ordinary functions
Function, query-forward-p: Public ordinary functions
Function, query-mapped-p: Public ordinary functions
Function, query-reverse-p: Public ordinary functions
Function, query-unmapped-p: Public ordinary functions
Function, read-alignment: Public ordinary functions
Function, read-bam-header: Public ordinary functions
Function, read-bam-index: Public ordinary functions
Function, read-bam-magic: Public ordinary functions
Function, read-bam-meta: Public ordinary functions
Function, read-bam-terminator: Public ordinary functions
Function, read-bgz-member: Private ordinary functions
Function, read-bin: Private ordinary functions
Function, read-binning-index: Private ordinary functions
Function, read-bytes: Private ordinary functions
Function, read-index-magic: Private ordinary functions
Function, read-length: Public ordinary functions
Function, read-linear-index: Private ordinary functions
Function, read-name: Public ordinary functions
Function, read-name-length: Public ordinary functions
Function, read-num-references: Public ordinary functions
Function, read-ref-index: Private ordinary functions
Function, read-reference-meta: Public ordinary functions
Function, read-string: Private ordinary functions
Function, ref-index: Public ordinary functions
Function, ref-index-bin: Public ordinary functions
Function, ref-index-bins: Public ordinary functions
Function, ref-index-id: Private ordinary functions
Function, ref-index-intervals: Public ordinary functions
Function, ref-index-p: Private ordinary functions
Function, reference-id: Public ordinary functions
Function, region: Private ordinary functions
Function, region-end: Private ordinary functions
Function, region-p: Private ordinary functions
Function, region-ref: Private ordinary functions
Function, region-start: Private ordinary functions
Function, region-to-bin: Private ordinary functions
Function, region-to-bins: Private ordinary functions
Function, region-to-interval: Private ordinary functions
Function, repair-mapping-flags: Public ordinary functions
Function, rg-record: Public ordinary functions
Function, run-length-encode: Private ordinary functions
Function, samtools-bam-index-p: Private ordinary functions
Function, samtools-bam-index-refs: Private ordinary functions
Function, samtools-bam-index-unassigned: Private ordinary functions
Function, samtools-ref-index-bins: Private ordinary functions
Function, samtools-ref-index-end: Private ordinary functions
Function, samtools-ref-index-id: Private ordinary functions
Function, samtools-ref-index-intervals: Private ordinary functions
Function, samtools-ref-index-mapped: Private ordinary functions
Function, samtools-ref-index-p: Private ordinary functions
Function, samtools-ref-index-start: Private ordinary functions
Function, samtools-ref-index-unmapped: Private ordinary functions
Function, second-in-pair-p: Public ordinary functions
Function, seq-string: Public ordinary functions
Function, sequenced-pair-p: Public ordinary functions
Function, simplify-records: Private ordinary functions
Function, sort-bam-alignments: Private ordinary functions
Function, sort-bam-file: Public ordinary functions
Function, sq-record: Public ordinary functions
Function, stream-view-sam: Private ordinary functions
Function, subst-group-order: Public ordinary functions
Function, subst-sam-version: Public ordinary functions
Function, subst-sort-order: Public ordinary functions
Function, unknown-frag-p: Public ordinary functions
Function, update-pg-records: Private ordinary functions
Function, user-header-tag-p: Private ordinary functions
Function, valid-flag-p: Public ordinary functions
Function, valid-header-tags: Private ordinary functions
Function, valid-mapped-pair-p: Public ordinary functions
Function, valid-mapped-proper-pair-p: Public ordinary functions
Function, valid-read-name-p: Private ordinary functions
Function, valid-reference-name-p: Public ordinary functions
Function, valid-sam-version-p: Public ordinary functions
Function, view-sam: Public ordinary functions
Function, voffset-merge-p: Private ordinary functions
Function, write-alignment: Public ordinary functions
Function, write-bam-header: Public ordinary functions
Function, write-bam-magic: Public ordinary functions
Function, write-bam-meta: Public ordinary functions
Function, write-bgz-member: Private ordinary functions
Function, write-bin: Private ordinary functions
Function, write-binning-index: Private ordinary functions
Function, write-bytes: Private ordinary functions
Function, write-chunked-bytes: Private ordinary functions
Function, write-cigar: Private ordinary functions
Function, write-header-record: Public ordinary functions
Function, write-index-magic: Private ordinary functions
Function, write-linear-index: Private ordinary functions
Function, write-num-references: Public ordinary functions
Function, write-quality-string: Private ordinary functions
Function, write-reference-meta: Public ordinary functions
Function, write-sam-alignment: Public ordinary functions
Function, write-sam-header: Public ordinary functions
Function, write-seq-string: Private ordinary functions
Function, write-tag-values: Private ordinary functions

G
generate-bam-file: Public ordinary functions
generate-reference-file: Public ordinary functions
Generic Function, alignment-tag-documentation: Public generic functions
Generic Function, bgzf-of: Private generic functions
Generic Function, buffer-of: Private generic functions
Generic Function, encode-alignment-tag: Private generic functions
Generic Function, errno-of: Private generic functions
Generic Function, position-of: Private generic functions
Generic Function, prev-position-of: Private generic functions
Generic Function, prev-reference-of: Private generic functions
Generic Function, reference-of: Private generic functions
Generic Function, write-bam-index: Public generic functions
Generic Function, write-ref-index: Private generic functions
group-by-tag: Private ordinary functions

H
hd-record: Public ordinary functions
header-record: Private ordinary functions
header-records: Public ordinary functions
header-tags: Public ordinary functions
header-type: Public ordinary functions
header-value: Public ordinary functions

I
index-bam-file: Public ordinary functions
inflate-bgz-member: Private ordinary functions
initialize-instance: Public standalone methods
insert-length: Public ordinary functions

L
last-frag-p: Public ordinary functions
last-programs: Public ordinary functions

M
Macro, define-alignment-tag: Public macros
Macro, define-header-tag-parser: Private macros
Macro, with-bam: Public macros
Macro, with-bam-index: Public macros
Macro, with-bgzf: Public macros
Macro, with-open-bgzip: Public macros
make-alignment: Private ordinary functions
make-alignment-record: Public ordinary functions
make-aln: Private ordinary functions
make-bam-chunks: Private ordinary functions
make-bam-full-scan-input: Private ordinary functions
make-bam-index: Private ordinary functions
make-bam-index-input: Private ordinary functions
make-bam-output: Public ordinary functions
make-bam-scan-input: Private ordinary functions
make-bgz-member: Private ordinary functions
make-bgzf: Private ordinary functions
make-bin: Private ordinary functions
make-chunk: Private ordinary functions
make-header-record: Public ordinary functions
make-header-string: Private ordinary functions
make-merge-stream: Public standalone methods
make-ref-index: Private ordinary functions
make-reference-table: Public ordinary functions
make-region: Private ordinary functions
make-region<: Private ordinary functions
make-sam-header: Public ordinary functions
make-samtools-bam-index: Private ordinary functions
make-samtools-ref-index: Private ordinary functions
mandatory-header-tags: Private ordinary functions
mapped-proper-pair-p: Public ordinary functions
mapping-quality: Public ordinary functions
mate-alignment-position: Public ordinary functions
mate-forward-p: Public ordinary functions
mate-mapped-p: Public ordinary functions
mate-reference-id: Public ordinary functions
mate-reverse-p: Public ordinary functions
mate-unmapped-p: Public ordinary functions
max-bin-num: Private ordinary functions
medial-frag-p: Public ordinary functions
merge-chunks: Private ordinary functions
merge-header-records: Public ordinary functions
merge-sam-headers: Public ordinary functions
Method, alignment-tag-documentation: Public generic functions
Method, alignment-tag-documentation: Public generic functions
Method, alignment-tag-documentation: Public generic functions
Method, alignment-tag-documentation: Public generic functions
Method, alignment-tag-documentation: Public generic functions
Method, alignment-tag-documentation: Public generic functions
Method, alignment-tag-documentation: Public generic functions
Method, alignment-tag-documentation: Public generic functions
Method, alignment-tag-documentation: Public generic functions
Method, alignment-tag-documentation: Public generic functions
Method, alignment-tag-documentation: Public generic functions
Method, alignment-tag-documentation: Public generic functions
Method, alignment-tag-documentation: Public generic functions
Method, alignment-tag-documentation: Public generic functions
Method, alignment-tag-documentation: Public generic functions
Method, alignment-tag-documentation: Public generic functions
Method, alignment-tag-documentation: Public generic functions
Method, alignment-tag-documentation: Public generic functions
Method, alignment-tag-documentation: Public generic functions
Method, alignment-tag-documentation: Public generic functions
Method, alignment-tag-documentation: Public generic functions
Method, alignment-tag-documentation: Public generic functions
Method, alignment-tag-documentation: Public generic functions
Method, alignment-tag-documentation: Public generic functions
Method, alignment-tag-documentation: Public generic functions
Method, alignment-tag-documentation: Public generic functions
Method, alignment-tag-documentation: Public generic functions
Method, alignment-tag-documentation: Public generic functions
Method, alignment-tag-documentation: Public generic functions
Method, alignment-tag-documentation: Public generic functions
Method, alignment-tag-documentation: Public generic functions
Method, alignment-tag-documentation: Public generic functions
Method, alignment-tag-documentation: Public generic functions
Method, alignment-tag-documentation: Public generic functions
Method, alignment-tag-documentation: Public generic functions
Method, alignment-tag-documentation: Public generic functions
Method, alignment-tag-documentation: Public generic functions
Method, alignment-tag-documentation: Public generic functions
Method, alignment-tag-documentation: Public generic functions
Method, alignment-tag-documentation: Public generic functions
Method, alignment-tag-documentation: Public generic functions
Method, alignment-tag-documentation: Public generic functions
Method, alignment-tag-documentation: Public generic functions
Method, alignment-tag-documentation: Public generic functions
Method, alignment-tag-documentation: Public generic functions
Method, alignment-tag-documentation: Public generic functions
Method, alignment-tag-documentation: Public generic functions
Method, alignment-tag-documentation: Public generic functions
Method, alignment-tag-documentation: Public generic functions
Method, alignment-tag-documentation: Public generic functions
Method, alignment-tag-documentation: Public generic functions
Method, alignment-tag-documentation: Public generic functions
Method, alignment-tag-documentation: Public generic functions
Method, alignment-tag-documentation: Public generic functions
Method, alignment-tag-documentation: Public generic functions
Method, alignment-tag-documentation: Public generic functions
Method, alignment-tag-documentation: Public generic functions
Method, alignment-tag-documentation: Public generic functions
Method, alignment-tag-documentation: Public generic functions
Method, alignment-tag-documentation: Public generic functions
Method, alignment-tag-documentation: Public generic functions
Method, alignment-tag-documentation: Public generic functions
Method, alignment-tag-documentation: Public generic functions
Method, bgzf-of: Private generic functions
Method, buffer-of: Private generic functions
Method, encode-alignment-tag: Private generic functions
Method, encode-alignment-tag: Private generic functions
Method, encode-alignment-tag: Private generic functions
Method, encode-alignment-tag: Private generic functions
Method, encode-alignment-tag: Private generic functions
Method, encode-alignment-tag: Private generic functions
Method, encode-alignment-tag: Private generic functions
Method, encode-alignment-tag: Private generic functions
Method, encode-alignment-tag: Private generic functions
Method, encode-alignment-tag: Private generic functions
Method, encode-alignment-tag: Private generic functions
Method, encode-alignment-tag: Private generic functions
Method, encode-alignment-tag: Private generic functions
Method, encode-alignment-tag: Private generic functions
Method, encode-alignment-tag: Private generic functions
Method, encode-alignment-tag: Private generic functions
Method, encode-alignment-tag: Private generic functions
Method, encode-alignment-tag: Private generic functions
Method, encode-alignment-tag: Private generic functions
Method, encode-alignment-tag: Private generic functions
Method, encode-alignment-tag: Private generic functions
Method, encode-alignment-tag: Private generic functions
Method, encode-alignment-tag: Private generic functions
Method, encode-alignment-tag: Private generic functions
Method, encode-alignment-tag: Private generic functions
Method, encode-alignment-tag: Private generic functions
Method, encode-alignment-tag: Private generic functions
Method, encode-alignment-tag: Private generic functions
Method, encode-alignment-tag: Private generic functions
Method, encode-alignment-tag: Private generic functions
Method, encode-alignment-tag: Private generic functions
Method, encode-alignment-tag: Private generic functions
Method, encode-alignment-tag: Private generic functions
Method, encode-alignment-tag: Private generic functions
Method, encode-alignment-tag: Private generic functions
Method, encode-alignment-tag: Private generic functions
Method, encode-alignment-tag: Private generic functions
Method, encode-alignment-tag: Private generic functions
Method, encode-alignment-tag: Private generic functions
Method, encode-alignment-tag: Private generic functions
Method, encode-alignment-tag: Private generic functions
Method, encode-alignment-tag: Private generic functions
Method, encode-alignment-tag: Private generic functions
Method, encode-alignment-tag: Private generic functions
Method, encode-alignment-tag: Private generic functions
Method, encode-alignment-tag: Private generic functions
Method, encode-alignment-tag: Private generic functions
Method, encode-alignment-tag: Private generic functions
Method, encode-alignment-tag: Private generic functions
Method, encode-alignment-tag: Private generic functions
Method, encode-alignment-tag: Private generic functions
Method, encode-alignment-tag: Private generic functions
Method, encode-alignment-tag: Private generic functions
Method, encode-alignment-tag: Private generic functions
Method, encode-alignment-tag: Private generic functions
Method, encode-alignment-tag: Private generic functions
Method, encode-alignment-tag: Private generic functions
Method, encode-alignment-tag: Private generic functions
Method, encode-alignment-tag: Private generic functions
Method, encode-alignment-tag: Private generic functions
Method, encode-alignment-tag: Private generic functions
Method, encode-alignment-tag: Private generic functions
Method, encode-alignment-tag: Private generic functions
Method, errno-of: Private generic functions
Method, initialize-instance: Public standalone methods
Method, make-merge-stream: Public standalone methods
Method, position-of: Private generic functions
Method, prev-position-of: Private generic functions
Method, prev-reference-of: Private generic functions
Method, print-object: Public standalone methods
Method, print-object: Public standalone methods
Method, print-object: Public standalone methods
Method, print-object: Public standalone methods
Method, print-object: Public standalone methods
Method, print-object: Public standalone methods
Method, reference-of: Private generic functions
Method, stream-close: Public standalone methods
Method, stream-element-type: Public standalone methods
Method, stream-file-position: Public standalone methods
Method, stream-merge: Public standalone methods
Method, stream-read-byte: Public standalone methods
Method, stream-read-element: Public standalone methods
Method, stream-read-sequence: Public standalone methods
Method, stream-write-element: Public standalone methods
Method, write-bam-index: Public generic functions
Method, write-bam-index: Public generic functions
Method, write-ref-index: Private generic functions
Method, write-ref-index: Private generic functions
multiple-frags-p: Public ordinary functions

N
name-sorted-p: Public ordinary functions
next-forward-p: Private ordinary functions
next-mapped-p: Private ordinary functions
next-reverse-p: Public ordinary functions
next-unmapped-p: Public ordinary functions
normalise-regions: Private ordinary functions

P
parse-digits: Private ordinary functions
parse-hd-tag: Private ordinary functions
parse-pg-tag: Private ordinary functions
parse-region-string: Public ordinary functions
parse-rg-tag: Private ordinary functions
parse-sq-tag: Private ordinary functions
partition-by-type: Private ordinary functions
partition-regions: Private ordinary functions
pcr/optical-duplicate-p: Public ordinary functions
pg-record: Public ordinary functions
position-of: Private generic functions
position-of: Private generic functions
prev-position-of: Private generic functions
prev-position-of: Private generic functions
prev-reference-of: Private generic functions
prev-reference-of: Private generic functions
previous-programs: Public ordinary functions
print-aln: Private ordinary functions
print-bin: Private ordinary functions
print-chunk: Private ordinary functions
print-object: Public standalone methods
print-object: Public standalone methods
print-object: Public standalone methods
print-object: Public standalone methods
print-object: Public standalone methods
print-object: Public standalone methods
print-ref-index: Private ordinary functions
print-region: Private ordinary functions
print-samtools-ref-index: Private ordinary functions
proper-aligned-frags-p: Public ordinary functions

Q
quality-string: Public ordinary functions
query-forward-p: Public ordinary functions
query-mapped-p: Public ordinary functions
query-reverse-p: Public ordinary functions
query-unmapped-p: Public ordinary functions

R
read-alignment: Public ordinary functions
read-bam-header: Public ordinary functions
read-bam-index: Public ordinary functions
read-bam-magic: Public ordinary functions
read-bam-meta: Public ordinary functions
read-bam-terminator: Public ordinary functions
read-bgz-member: Private ordinary functions
read-bin: Private ordinary functions
read-binning-index: Private ordinary functions
read-bytes: Private ordinary functions
read-index-magic: Private ordinary functions
read-length: Public ordinary functions
read-linear-index: Private ordinary functions
read-name: Public ordinary functions
read-name-length: Public ordinary functions
read-num-references: Public ordinary functions
read-ref-index: Private ordinary functions
read-reference-meta: Public ordinary functions
read-string: Private ordinary functions
ref-index: Public ordinary functions
ref-index-bin: Public ordinary functions
ref-index-bins: Public ordinary functions
ref-index-id: Private ordinary functions
ref-index-intervals: Public ordinary functions
ref-index-p: Private ordinary functions
reference-id: Public ordinary functions
reference-of: Private generic functions
reference-of: Private generic functions
region: Private ordinary functions
region-end: Private ordinary functions
region-p: Private ordinary functions
region-ref: Private ordinary functions
region-start: Private ordinary functions
region-to-bin: Private ordinary functions
region-to-bins: Private ordinary functions
region-to-interval: Private ordinary functions
repair-mapping-flags: Public ordinary functions
rg-record: Public ordinary functions
run-length-encode: Private ordinary functions

S
samtools-bam-index-p: Private ordinary functions
samtools-bam-index-refs: Private ordinary functions
samtools-bam-index-unassigned: Private ordinary functions
samtools-ref-index-bins: Private ordinary functions
samtools-ref-index-end: Private ordinary functions
samtools-ref-index-id: Private ordinary functions
samtools-ref-index-intervals: Private ordinary functions
samtools-ref-index-mapped: Private ordinary functions
samtools-ref-index-p: Private ordinary functions
samtools-ref-index-start: Private ordinary functions
samtools-ref-index-unmapped: Private ordinary functions
second-in-pair-p: Public ordinary functions
seq-string: Public ordinary functions
sequenced-pair-p: Public ordinary functions
simplify-records: Private ordinary functions
sort-bam-alignments: Private ordinary functions
sort-bam-file: Public ordinary functions
sq-record: Public ordinary functions
stream-close: Public standalone methods
stream-element-type: Public standalone methods
stream-file-position: Public standalone methods
stream-merge: Public standalone methods
stream-read-byte: Public standalone methods
stream-read-element: Public standalone methods
stream-read-sequence: Public standalone methods
stream-view-sam: Private ordinary functions
stream-write-element: Public standalone methods
subst-group-order: Public ordinary functions
subst-sam-version: Public ordinary functions
subst-sort-order: Public ordinary functions

U
unknown-frag-p: Public ordinary functions
update-pg-records: Private ordinary functions
user-header-tag-p: Private ordinary functions

V
valid-flag-p: Public ordinary functions
valid-header-tags: Private ordinary functions
valid-mapped-pair-p: Public ordinary functions
valid-mapped-proper-pair-p: Public ordinary functions
valid-read-name-p: Private ordinary functions
valid-reference-name-p: Public ordinary functions
valid-sam-version-p: Public ordinary functions
view-sam: Public ordinary functions
voffset-merge-p: Private ordinary functions

W
with-bam: Public macros
with-bam-index: Public macros
with-bgzf: Public macros
with-open-bgzip: Public macros
write-alignment: Public ordinary functions
write-bam-header: Public ordinary functions
write-bam-index: Public generic functions
write-bam-index: Public generic functions
write-bam-index: Public generic functions
write-bam-magic: Public ordinary functions
write-bam-meta: Public ordinary functions
write-bgz-member: Private ordinary functions
write-bin: Private ordinary functions
write-binning-index: Private ordinary functions
write-bytes: Private ordinary functions
write-chunked-bytes: Private ordinary functions
write-cigar: Private ordinary functions
write-header-record: Public ordinary functions
write-index-magic: Private ordinary functions
write-linear-index: Private ordinary functions
write-num-references: Public ordinary functions
write-quality-string: Private ordinary functions
write-ref-index: Private generic functions
write-ref-index: Private generic functions
write-ref-index: Private generic functions
write-reference-meta: Public ordinary functions
write-sam-alignment: Public ordinary functions
write-sam-header: Public ordinary functions
write-seq-string: Private ordinary functions
write-tag-values: Private ordinary functions


A.3 Variables

Jump to:   *   +  
B   C   E   F   I   L   M   N   O   P   Q   R   S   U  
Index Entry  Section

*
*bam-index-file-type*: Private special variables
*bam-index-magic*: Private special variables
*bam-magic*: Private special variables
*default-compression*: Private special variables
*empty-bgz-record*: Private special variables
*invalid-read-name-chars*: Private special variables
*mandatory-header-tags*: Private special variables
*sam-version*: Public special variables
*tree-deepening-boundaries*: Private special variables
*valid-group-orders*: Private special variables
*valid-header-tags*: Private special variables
*valid-header-types*: Private special variables
*valid-sort-orders*: Private special variables
*voffset-merge-distance*: Private special variables

+
+alignment-size-tag+: Private constants
+bgz-max-payload-length+: Private constants
+bgzip-buffer-size+: Private constants
+linear-bin-size+: Private constants
+max-num-bins+: Private constants
+member-footer-length+: Private constants
+member-header-length+: Private constants
+null-byte+: Private constants
+samtools-kludge-bin+: Private constants
+sf1+: Private constants
+sf2+: Private constants
+slen+: Private constants
+tag-size+: Private constants
+unknown-position+: Private constants
+unknown-quality+: Private constants
+unknown-reference+: Private constants
+xlen+: Private constants

B
bgzf: Public conditions
bgzf: Private classes
bin: Private structures
bins: Public structures
bsize: Private structures
buffer: Public structures
buffer: Public classes
buffer: Private classes

C
chunks: Public structures
cigar: Private structures
compression: Public structures
Constant, +alignment-size-tag+: Private constants
Constant, +bgz-max-payload-length+: Private constants
Constant, +bgzip-buffer-size+: Private constants
Constant, +linear-bin-size+: Private constants
Constant, +max-num-bins+: Private constants
Constant, +member-footer-length+: Private constants
Constant, +member-header-length+: Private constants
Constant, +null-byte+: Private constants
Constant, +samtools-kludge-bin+: Private constants
Constant, +sf1+: Private constants
Constant, +sf2+: Private constants
Constant, +slen+: Private constants
Constant, +tag-size+: Private constants
Constant, +unknown-position+: Private constants
Constant, +unknown-quality+: Private constants
Constant, +unknown-reference+: Private constants
Constant, +xlen+: Private constants

E
end: Public structures
end: Private structures
end: Private structures
eof: Public structures
errno: Public conditions

F
flag: Private structures

I
id: Public structures
insert-length: Private structures
intervals: Public structures

L
load-seek: Public structures
loaded-p: Public structures

M
map-qual: Private structures
mapped: Private structures
mate-pos: Private structures
mate-ref-id: Private structures

N
num: Public structures
num-bytes: Public classes

O
offset: Public structures
offset: Public classes

P
pathname: Public structures
pointer: Public structures
pos: Private structures
position: Public conditions
position: Public structures
prev-position: Public conditions
prev-reference: Public conditions

Q
qual-str: Private structures

R
read-name: Private structures
record: Private structures
ref: Private structures
ref-id: Private structures
ref-len: Private structures
reference: Public conditions
refs: Public structures

S
seq-str: Private structures
sf1: Private structures
sf2: Private structures
slen: Private structures
Slot, bgzf: Public conditions
Slot, bgzf: Private classes
Slot, bin: Private structures
Slot, bins: Public structures
Slot, bsize: Private structures
Slot, buffer: Public structures
Slot, buffer: Public classes
Slot, buffer: Private classes
Slot, chunks: Public structures
Slot, cigar: Private structures
Slot, compression: Public structures
Slot, end: Public structures
Slot, end: Private structures
Slot, end: Private structures
Slot, eof: Public structures
Slot, errno: Public conditions
Slot, flag: Private structures
Slot, id: Public structures
Slot, insert-length: Private structures
Slot, intervals: Public structures
Slot, load-seek: Public structures
Slot, loaded-p: Public structures
Slot, map-qual: Private structures
Slot, mapped: Private structures
Slot, mate-pos: Private structures
Slot, mate-ref-id: Private structures
Slot, num: Public structures
Slot, num-bytes: Public classes
Slot, offset: Public structures
Slot, offset: Public classes
Slot, pathname: Public structures
Slot, pointer: Public structures
Slot, pos: Private structures
Slot, position: Public conditions
Slot, position: Public structures
Slot, prev-position: Public conditions
Slot, prev-reference: Public conditions
Slot, qual-str: Private structures
Slot, read-name: Private structures
Slot, record: Private structures
Slot, ref: Private structures
Slot, ref-id: Private structures
Slot, ref-len: Private structures
Slot, reference: Public conditions
Slot, refs: Public structures
Slot, seq-str: Private structures
Slot, sf1: Private structures
Slot, sf2: Private structures
Slot, slen: Private structures
Slot, start: Public structures
Slot, start: Private structures
Slot, start: Private structures
Slot, stream: Public structures
Slot, udata: Private structures
Slot, unassigned: Private structures
Slot, unmapped: Private structures
Slot, util-buffer: Public structures
Special Variable, *bam-index-file-type*: Private special variables
Special Variable, *bam-index-magic*: Private special variables
Special Variable, *bam-magic*: Private special variables
Special Variable, *default-compression*: Private special variables
Special Variable, *empty-bgz-record*: Private special variables
Special Variable, *invalid-read-name-chars*: Private special variables
Special Variable, *mandatory-header-tags*: Private special variables
Special Variable, *sam-version*: Public special variables
Special Variable, *tree-deepening-boundaries*: Private special variables
Special Variable, *valid-group-orders*: Private special variables
Special Variable, *valid-header-tags*: Private special variables
Special Variable, *valid-header-types*: Private special variables
Special Variable, *valid-sort-orders*: Private special variables
Special Variable, *voffset-merge-distance*: Private special variables
start: Public structures
start: Private structures
start: Private structures
stream: Public structures

U
udata: Private structures
unassigned: Private structures
unmapped: Private structures
util-buffer: Public structures


A.4 Data types

Jump to:   A   B   C   E   F   M   P   R   S   T  
Index Entry  Section

A
alignment: Private structures

B
bam-error: Public conditions
bam-index: Public structures
bam-index-reader.lisp: The cl-sam/cl-sam/bam-index-reader․lisp file
bam-index-writer.lisp: The cl-sam/cl-sam/bam-index-writer․lisp file
bam-index.lisp: The cl-sam/cl-sam/bam-index․lisp file
bam-indexer.lisp: The cl-sam/cl-sam/bam-indexer․lisp file
bam-merge-stream: Private classes
bam-reader.lisp: The cl-sam/cl-sam/bam-reader․lisp file
bam-sort-error: Public conditions
bam-sort-input-stream: Private classes
bam-sort-output-stream: Private classes
bam-utilities.lisp: The cl-sam/cl-sam/bam-utilities․lisp file
bam-writer.lisp: The cl-sam/cl-sam/bam-writer․lisp file
bam.lisp: The cl-sam/cl-sam/bam․lisp file
bgz-member: Private structures
bgzf: Public structures
bgzf-ffi: The bgzf-ffi package
bgzf-handle-mixin: Private classes
bgzf-io-error: Public conditions
bgzf-reader.lisp: The cl-sam/cl-sam/bgzf-reader․lisp file
bgzf-writer.lisp: The cl-sam/cl-sam/bgzf-writer․lisp file
bgzf.lisp: The cl-sam/cl-sam/bgzf․lisp file
bgzip-buffer: Private types
bgzip-buffer-index: Private types
bgzip-input-stream: Public classes
bgzip-stream: Public classes
bgzip-stream.lisp: The cl-sam/cl-sam/bgzip-stream․lisp file
bin: Public structures

C
chunk: Public structures
cl-sam: The cl-sam system
cl-sam: The cl-sam/cl-sam module
cl-sam.asd: The cl-sam/cl-sam․asd file
cl-sam.lisp: The cl-sam/cl-sam/cl-sam․lisp file
Class, bam-merge-stream: Private classes
Class, bam-sort-input-stream: Private classes
Class, bam-sort-output-stream: Private classes
Class, bgzf-handle-mixin: Private classes
Class, bgzip-input-stream: Public classes
Class, bgzip-stream: Public classes
Condition, bam-error: Public conditions
Condition, bam-sort-error: Public conditions
Condition, bgzf-io-error: Public conditions
conditions.lisp: The cl-sam/cl-sam/conditions․lisp file

E
external-bam-sort.lisp: The cl-sam/cl-sam/external-bam-sort․lisp file

F
File, bam-index-reader.lisp: The cl-sam/cl-sam/bam-index-reader․lisp file
File, bam-index-writer.lisp: The cl-sam/cl-sam/bam-index-writer․lisp file
File, bam-index.lisp: The cl-sam/cl-sam/bam-index․lisp file
File, bam-indexer.lisp: The cl-sam/cl-sam/bam-indexer․lisp file
File, bam-reader.lisp: The cl-sam/cl-sam/bam-reader․lisp file
File, bam-utilities.lisp: The cl-sam/cl-sam/bam-utilities․lisp file
File, bam-writer.lisp: The cl-sam/cl-sam/bam-writer․lisp file
File, bam.lisp: The cl-sam/cl-sam/bam․lisp file
File, bgzf-reader.lisp: The cl-sam/cl-sam/bgzf-reader․lisp file
File, bgzf-writer.lisp: The cl-sam/cl-sam/bgzf-writer․lisp file
File, bgzf.lisp: The cl-sam/cl-sam/bgzf․lisp file
File, bgzip-stream.lisp: The cl-sam/cl-sam/bgzip-stream․lisp file
File, cl-sam.asd: The cl-sam/cl-sam․asd file
File, cl-sam.lisp: The cl-sam/cl-sam/cl-sam․lisp file
File, conditions.lisp: The cl-sam/cl-sam/conditions․lisp file
File, external-bam-sort.lisp: The cl-sam/cl-sam/external-bam-sort․lisp file
File, package.lisp: The cl-sam/cl-sam/package․lisp file
File, sam-writer.lisp: The cl-sam/cl-sam/sam-writer․lisp file
File, sam.lisp: The cl-sam/cl-sam/sam․lisp file

M
Module, cl-sam: The cl-sam/cl-sam module

P
Package, bgzf-ffi: The bgzf-ffi package
Package, sam: The sam package
package.lisp: The cl-sam/cl-sam/package․lisp file

R
ref-index: Public structures
region: Private structures

S
sam: The sam package
sam-writer.lisp: The cl-sam/cl-sam/sam-writer․lisp file
sam.lisp: The cl-sam/cl-sam/sam․lisp file
samtools-bam-index: Private structures
samtools-ref-index: Private structures
Structure, alignment: Private structures
Structure, bam-index: Public structures
Structure, bgz-member: Private structures
Structure, bgzf: Public structures
Structure, bin: Public structures
Structure, chunk: Public structures
Structure, ref-index: Public structures
Structure, region: Private structures
Structure, samtools-bam-index: Private structures
Structure, samtools-ref-index: Private structures
System, cl-sam: The cl-sam system

T
Type, bgzip-buffer: Private types
Type, bgzip-buffer-index: Private types