Documentation
¶
Overview ¶
Package filters defines filters for .sam/.bam/.cram sequencing pipelines.
Index ¶
- Variables
- func AddOrReplaceReadGroup(readGroup utils.StringMap) sam.Filter
- func AddPGLine(newPG utils.StringMap) sam.Filter
- func AddREFID(header *sam.Header) sam.AlignmentFilter
- func CleanSam(header *sam.Header) sam.AlignmentFilter
- func KeepOptionalFields(tags []string) sam.Filter
- func MarkDuplicates(deterministic bool) sam.Filter
- func RemoveDuplicateReads(_ *sam.Header) sam.AlignmentFilter
- func RemoveMappingQualityLessThan(mq int) sam.Filter
- func RemoveNonExactMappingReads(_ *sam.Header) sam.AlignmentFilter
- func RemoveNonExactMappingReadsStrict(header *sam.Header) sam.AlignmentFilter
- func RemoveNonOverlappingReads(bed *bed.Bed) sam.Filter
- func RemoveOptionalFields(tags []string) sam.Filter
- func RemoveOptionalReads(header *sam.Header) sam.AlignmentFilter
- func RemoveUnmappedReads(_ *sam.Header) sam.AlignmentFilter
- func RemoveUnmappedReadsStrict(_ *sam.Header) sam.AlignmentFilter
- func RenameChromosomes(header *sam.Header) sam.AlignmentFilter
- func ReplaceReferenceSequenceDictionary(dict []utils.StringMap) sam.Filter
- func ReplaceReferenceSequenceDictionaryFromSamFile(samFile string) (f sam.Filter, err error)
Constants ¶
This section is empty.
Variables ¶
var ( X0 = utils.Intern("X0") X1 = utils.Intern("X1") XM = utils.Intern("XM") XO = utils.Intern("XO") XG = utils.Intern("XG") )
Symbols for optional fields used for determining exact matches. See http://samtools.github.io/hts-specs/SAMv1.pdf - Section 1.5.
Functions ¶
func AddOrReplaceReadGroup ¶
AddOrReplaceReadGroup returns a filter for adding or replacing the read group both in the Header and in each Alignment.
func AddPGLine ¶
AddPGLine returns a filter for adding a @PG tag to a Header, and ensuring that it is the first one in the chain.
func AddREFID ¶
func AddREFID(header *sam.Header) sam.AlignmentFilter
AddREFID is a filter for adding the refid (index in the reference sequence dictionary) to alignments as temporary values.
func CleanSam ¶
func CleanSam(header *sam.Header) sam.AlignmentFilter
CleanSam is a filter for soft-clipping an alignment at the end of a reference sequence, and set MAPQ to 0 if unmapped.
func KeepOptionalFields ¶
KeepOptionalFields returns a filter for removing all but a list of given optional fields in an alignment.
func MarkDuplicates ¶
MarkDuplicates returns a filter for marking duplicate alignments. Depends on the AddREFID filter being called before to fill in the refid.
Duplicate marking is based on an adapted Phred score. In case of ties, if deterministic is true, the QNAME is used as a tie-breaker. Otherwise duplicate marking is random for alignments tied for best score.
func RemoveDuplicateReads ¶
func RemoveDuplicateReads(_ *sam.Header) sam.AlignmentFilter
RemoveDuplicateReads is a filter for removing duplicate sam-alignment instances, based on FLAG.
func RemoveMappingQualityLessThan ¶
RemoveMappingQualityLessThan is a filter for removing reads that do not match or exceed the given mapping quality.
func RemoveNonExactMappingReads ¶
func RemoveNonExactMappingReads(_ *sam.Header) sam.AlignmentFilter
RemoveNonExactMappingReads is a filter that removes all reads that are not exact matches with the reference (soft-clipping ok), based on CIGAR string (only M and S allowed).
func RemoveNonExactMappingReadsStrict ¶
func RemoveNonExactMappingReadsStrict(header *sam.Header) sam.AlignmentFilter
RemoveNonExactMappingReadsStrict is a filter that removes all reads that are not exact matches with the reference, based on the optional fields X0=1 (unique mapping), X1=0 (no suboptimal hit), XM=0 (no mismatch), XO=0 (no gap opening), XG=0 (no gap extension).
func RemoveNonOverlappingReads ¶
RemoveNonOverlappingReads returns a filter for removing all reads that do not overlap with a set of regions specified by a bed file.
func RemoveOptionalFields ¶
RemoveOptionalFields returns a filter for removing optional fields in an alignment.
func RemoveOptionalReads ¶
func RemoveOptionalReads(header *sam.Header) sam.AlignmentFilter
RemoveOptionalReads is a filter for removing alignments that represent optional information in elPrep.
func RemoveUnmappedReads ¶
func RemoveUnmappedReads(_ *sam.Header) sam.AlignmentFilter
RemoveUnmappedReads is a filter for removing unmapped sam-alignment instances, based on FLAG.
func RemoveUnmappedReadsStrict ¶
func RemoveUnmappedReadsStrict(_ *sam.Header) sam.AlignmentFilter
RemoveUnmappedReadsStrict is a filter for removing unmapped sam-alignment instances, based on FLAG, or POS=0, or RNAME=*.
func RenameChromosomes ¶
func RenameChromosomes(header *sam.Header) sam.AlignmentFilter
RenameChromosomes is a filter for prepending "chr" to the reference sequence names in a Header, and in RNAME and RNEXT in each Alignment.
func ReplaceReferenceSequenceDictionary ¶
ReplaceReferenceSequenceDictionary returns a filter for replacing the reference sequence dictionary in a Header.
func ReplaceReferenceSequenceDictionaryFromSamFile ¶
ReplaceReferenceSequenceDictionaryFromSamFile returns a filter for replacing the reference sequence dictionary in a Header with one parsed from the given SAM/DICT file.
Types ¶
This section is empty.