Package Elprep - external symbols

See internal symbols too
A library for efficiently executing sequencing pipelines on SAM/BAM/CRAM files, taking advantage of modern multi-core processors.

Modifications to headers and alignments are expressed as filters. The library comes with a number of commonly used pre-defined filters, but you can also define and use your own filters. A pipeline can be executed with run-pipeline, which accepts SAM/BAM/CRAM files as input and/or output sources, but can also operate on an in-memory representation of such files. run-pipeline can be extended to also operate on other input/output sources, such as databases.

Refer to the documentation of run-pipeline as a starting point.
Package Elprep uses the packages Cl-Date-Time-Parser, Common-Lisp, Stream and String-Case. It has 928 total symbols and 152 external ones.

Class

samA complete SAM data set that can be contained in a SAM file.
See http://samtools.github.io/hts...
sam-alignmentA single read alignment with mandatory and optional fields that can be contained in a SAM file al...
sam-headerThe information stored in the header section of a SAM file.
See http://samtools.github.io/hts...

Variable

*number-of-threads*The number of threads used by run-pipeline and run-pipeline-in-situ to parallelize the filtering ...
*reference-fai*The reference FAI that samtools may need for generating a CRAM file.
*reference-fasta*The reference FASTA that samtools may need for generating a CRAM file.
*sam-alignment-line-output-length-factor*Default factor for increase in length of the string representing a sam-alignment instance after a...
*sam-file-format-date*The date of the SAM file format version supported by this library.
See http://samtools.github....
*sam-file-format-version*The SAM file format version string supported by this library.
This is entered by default in a ...

Constant

+default-chunk-size+The number of alignments to read from an input source at a time.
Default is 8192.
+duplicate+Bit value for sam-alignment-flag: PCR or optical duplicate.
See http://samtools.github.io/hts-...
+first+Bit value for sam-alignment-flag: the first segment in the template.
See http://samtools.githu...
+last+Bit value for sam-alignment-flag: the last segment in the template.
See http://samtools.github...
+multiple+Bit value for sam-alignment-flag: template having multiple segments in sequencing.
See http://...
+next-reversed+Bit value for sam-alignment-flag: SEQ of the next segment in the template being reversed.
See ...
+next-unmapped+Bit value for sam-alignment-flag: next segment in the template unmapped.
See http://samtools.g...
+proper+Bit value for sam-alignment-flag: each segment properly aligned according to the aligner.
See ...
+qc-failed+Bit value for sam-alignment-flag: not passing quality controls.
See http://samtools.github.io/...
+reversed+Bit value for sam-alignment-flag: SEQ being reversed complemented.
See http://samtools.github....
+secondary+Bit value for sam-alignment-flag: secondary alignment.
See http://samtools.github.io/hts-specs...
+supplementary+Bit value for sam-alignment-flag: supplementary alignment.
See http://samtools.github.io/hts-s...
+unmapped+Bit value for sam-alignment-flag: segment unmapped.
See http://samtools.github.io/hts-specs/SA...

Function

add-or-replace-read-groupA filter for adding or replacing the read group both in sam-header and each sam-alignment.
add-pg-lineA filter for adding a @PG tag to a sam-header, and ensuring that it is the first one in the chain...
add-refidA filter for adding the refid (index in the reference sequence dictionary) to sam-alignment insta...
check-refid-typeEnsure that value is probably an int32.
check-stdinReturn true if pathname represents stdin.
check-stdoutReturn true if pathname represents stdout.
chunk-output-loopAbstract loop for writing chunks of alignments. Each chunk has a sequence number prepended to it....
clean-samA filter for soft-clipping a sam-alignment at the end of a reference sequence, and set MAPQ to 0 ...
close-samClose the stream for a SAM/BAM/CRAM file, and the optional process representation for samtools.
...
compose-global-filtersCompose global (header) filters, and return thread-local filters, a global initialization thunk, ...
compose-thread-filtersCompose thread-local filters, and return alignment filters, a thread-local initialization thunk, ...
compute-phred-scoreSum the adapted Phred qualities of a sam-alignment.
compute-unclipped-positionCompute unclipped position of a sam-alignment, based on its POS and CIGAR string.
coordinate<Compare two alignments according to their coordinate.
See http://samtools.github.io/hts-specs/...
effective-sorting-orderDetermine effective sorting order: Some filters may destroy the sorting order recorded in the inp...
elprep-scriptCommand line script for elPrep.
estimate-sam-alignment-output-lengthMake an estimate how much longer the string will be representing this sam-alignment instance,
...
explain-flagReturn a symbolic representation of the FLAG entry in a SAM file alignment line.
This is prima...
filter-duplicate-readsA filter for removing duplicate sam-alignment instances, based on FLAG.
filter-optional-header-infoA filter for removing header entries that represent optional information in elPrep.
filter-optional-readsA filter for removing sam-alignment instances that represent optional information in elPrep.
filter-unmapped-readsA filter for removing unmapped sam-alignment instances, based on FLAG.
filter-unmapped-reads-strictA filter for removing unmapped sam-alignment instances, based on FLAG, or POS=0, or RNAME=*.
format-samWrite a complete SAM file.
See http://samtools.github.io/hts-specs/SAMv1.pdf - Section 1.
format-sam-alignmentWrite a SAM file read alignment line.
See http://samtools.github.io/hts-specs/SAMv1.pdf - Sect...
format-sam-byte-arrayWrite a SAM file TAG of type byte array.
See http://samtools.github.io/hts-specs/SAMv1.pdf - S...
format-sam-commentsWrite the @CO lines in a SAM file header section.
See http://samtools.github.io/hts-specs/SAMv...
format-sam-datetimeWrite a SAM file TAG of type date/time.
See http://samtools.github.io/hts-specs/SAMv1.pdf - Se...
format-sam-headerWrite a SAM file header section.
See http://samtools.github.io/hts-specs/SAMv1.pdf - Section 1...
format-sam-header-lineWrite an @HD line in a SAM file header section.
See http://samtools.github.io/hts-specs/SAMv1....
format-sam-header-user-tagWrite a user-defined SAM file TAG of type string.
format-sam-integerWrite a SAM file TAG of type integer.
format-sam-programsWrite the @PG lines in a SAM file header section.
See http://samtools.github.io/hts-specs/SAMv...
format-sam-read-groupsWrite the @RG lines in a SAM file header section.
See http://samtools.github.io/hts-specs/SAMv...
format-sam-reference-sequence-dictionaryWrite the @SQ lines in a SAM file header section.
See http://samtools.github.io/hts-specs/SAMv...
format-sam-stringWrite a SAM file TAG of type string.
format-sam-tagWrite a SAM file TAG, dispatching on actual type of the given value.
See http://samtools.githu...
format-sam-user-tagsWrite the user-defined header lines.
See http://samtools.github.io/hts-specs/SAMv1.pdf - Secti...
get-samtoolsDetermine location of the samtools binary.
invoke-with-open-samCall a function and pass it a stream for reading or writing a SAM file.
make-samDefault constructor for struct sam.
make-sam-alignmentDefault constructor for struct sam-alignment.
make-sam-headerDefault constructor for struct sam-header.
make-scannerCreate a scanner to scan/parse strings of type simple-base-string. Takes an optional string to sc...
mark-duplicatesA filter for marking duplicate sam-alignment instances. Depends on the add-refid filter being cal...
merge-sorted-files-split-per-chromosomeA function for merging files that were split with elPrep and sorted in coordinate order.
open-samOpen a SAM file for :input or :output. If the file is .bam or .cram, use samtools view for input ...
open-temporary-samOpen a temporary SAM file for :output in the same folder as the sibling file. If the file is .bam...
parse-read-group-from-stringParse an @RG line in a string.
See http://samtools.github.io/hts-specs/SAMv1.pdf - Section 1.3...
parse-samParse a complete SAM file.
See http://samtools.github.io/hts-specs/SAMv1.pdf - Section 1.
parse-sam-alignmentParse a SAM file read alignment line.
See http://samtools.github.io/hts-specs/SAMv1.pdf - Sect...
parse-sam-byte-arrayParse a byte array in a SAM file.
See http://samtools.github.io/hts-specs/SAMv1.pdf - Section ...
parse-sam-commentParse an @CO line in a SAM file.
See http://samtools.github.io/hts-specs/SAMv1.pdf - Section 1...
parse-sam-headerParse a SAM file header section.
See http://samtools.github.io/hts-specs/SAMv1.pdf - Section 1...
parse-sam-header-lineParse an @HD line in a SAM file.
See http://samtools.github.io/hts-specs/SAMv1.pdf - Section 1...
parse-sam-numeric-arrayParse a numeric array in a SAM file.
See http://samtools.github.io/hts-specs/SAMv1.pdf - Secti...
parse-sam-programParse an @PG line in a SAM file.
See http://samtools.github.io/hts-specs/SAMv1.pdf - Section 1...
parse-sam-read-groupParse an @RG line in a SAM file.
See http://samtools.github.io/hts-specs/SAMv1.pdf - Section 1...
parse-sam-reference-sequence-dictionary-entryParse an @SQ line in a SAM file.
See http://samtools.github.io/hts-specs/SAMv1.pdf - Section 1...
replace-reference-sequence-dictionaryA filter for replacing the reference sequence dictionary in a sam-header.
replace-reference-sequence-dictionary-from-sam-fileA filter for replacing the reference sequence dictionary in a sam-header with one parsed from the...
sam-alignment-cigarAccess the sam-alignment CIGAR string of type base-string.
sam-alignment-duplicate-pCheck for PCR or optical duplicate in sam-alignment-flag.
See http://samtools.github.io/hts-sp...
sam-alignment-first-pCheck for being the first segment in the template in sam-alignment-flag.
See http://samtools.g...
sam-alignment-flagAccess the sam-alignment bitwise FLAG of type fixnum.
sam-alignment-flag-everyCheck for every bit in flag being set in sam-alignment-flag.
sam-alignment-flag-notanyCheck for not any bit in flag being set in sam-alignment-flag.
sam-alignment-flag-noteveryCheck for not every bit in flag being set in sam-alignment-flag.
sam-alignment-flag-someCheck for some bits in flag being set in sam-alignment-flag.
sam-alignment-last-pCheck for being the last segment in the template in sam-alignment-flag.
See http://samtools.gi...
sam-alignment-mapqAccess the sam-alignment MAPping quality of type fixnum.
sam-alignment-multiple-pCheck for template having multiple segments in sequencing in sam-alignment-flag.
See http://sa...
sam-alignment-next-reversed-pCheck for SEQ of the next segment in the template being reversed in sam-alignment-flag.
See ht...
sam-alignment-next-unmapped-pCheck for next segment in the template unmapped in sam-alignment-flag.
See http://samtools.git...
sam-alignment-pDefault predicate for struct sam-alignment.
sam-alignment-pnextAccess the sam-alignment 1-based leftmost mapping Position of the mate/NEXT read of type int32.
sam-alignment-posAccess the sam-alignment 1-based leftmost mapping POSition of type int32.
sam-alignment-proper-pCheck for each segment being properly aligned according to the aligner in sam-alignment-flag.
...
sam-alignment-qc-failed-pCheck for not passing quality controls in sam-alignment-flag.
See http://samtools.github.io/ht...
sam-alignment-qnameAccess the sam-alignment Query template NAME of type base-string.
sam-alignment-qualAccess the sam-alignment ASCII of Phred-scaled base QUALity+33 of type base-string.
sam-alignment-refidAccess the commonly used REFID temporary field in the sam-alignment.
sam-alignment-reversed-pCheck for SEQ being reversed complemented in sam-alignment-flag.
See http://samtools.github.io...
sam-alignment-rgAccess the read group optional field of a sam-alignment.
sam-alignment-rnameAccess the sam-alignment Reference sequence NAME of type base-string.
sam-alignment-rnextAccess the sam-alignment Reference sequence name of the mate/NEXT read of type base-string.
sam-alignment-secondary-pCheck for secondary alignment in sam-alignment-flag.
See http://samtools.github.io/hts-specs/S...
sam-alignment-seqAccess the sam-alignment segment SEQuence of type base-string.
sam-alignment-supplementary-pCheck for supplementary alignment in sam-alignment-flag.
See http://samtools.github.io/hts-spe...
sam-alignment-tagAccess a sam-alignment optional field in the sam-alignment.
sam-alignment-tagsAccess the sam-alignment optional fields of type property list.
sam-alignment-tempAccess a sam-alignment temporary value in the sam-alignment.
sam-alignment-tempsAccess the sam-alignment temporary values of type property list.
sam-alignment-tlenAccess the sam-alignment observed Template LENgth of type int32.
sam-alignment-unmapped-pCheck for segment unmapped in sam-alignment-flag.
See http://samtools.github.io/hts-specs/SAMv...
sam-alignmentsAccess the sam list of sam-alignment instances.
sam-file-kindDetermine whether the file is :bam for .bam, :cram for .cram, or :sam in all other cases.
sam-headerAccess the sam header of type sam-header.
sam-header-coAccess the sam-header @CO lines of type list of strings.
sam-header-ensure-hdEnsure an @HD line is present in the given sam-header.
See http://samtools.github.io/hts-specs...
sam-header-hdAccess the sam-header @HD line of type property list.
sam-header-pDefault predicate for struct sam-header.
sam-header-pgAccess the sam-header @PG lines of type list of property lists.
sam-header-rgAccess the sam-header @RG lines of type list of property lists.
sam-header-sqAccess the sam-header @SQ lines of type list of property lists.
sam-header-user-tagAccess a sam-header user tag.
sam-header-user-tag-pDoes this tag string represent a user-defined tag?
sam-header-user-tagsAccess the sam-header user-defined header lines of type property list.
sam-pDefault predicate for struct sam.
scan-cigar-stringConvert a cigar string to an association 'list or 'vector.
See http://samtools.github.io/hts-s...
scan-floatScan a floating point number from scanner. Returns either an integer or a single-float.
scan-integerScan an integer from scanner.
scan-stringRead a tab-delimited entry as string from scanner.
setup-standard-streamsBind standard streams to standard error.
skip-sam-headerSkip the SAM file header section.
split-file-per-chromosomeA function for splitting a sam file into : a file containing all unmapped reads, a file containin...

Generic-Function

create-chunk-filterCombines an optional alignment input mapper, a list of alignment filters, and an optional output ...
get-output-functionsSets up the output thread, feeds the given header to the output data set, and returns four functi...
run-pipelineReads a SAM data set from input, applies filters to the header and the alignments,
and writes...
run-pipeline-in-situApplies filters destructively and returns the first argument.
This is like run-pipeline, exce...

Macro

with-alignment-filtersMacro version of compose-thread-filters.
with-chunk-outputMacro version of chunk-output-loop.
with-open-samMacro version of invoke-with-open-sam.
with-output-functionsMacro for receiving results from get-output-functions.
with-thread-filtersMacro version of compose-global-filters.