Private API Reference

FASTX.FASTA.RecordMethod
FASTX.FASTA.Record(ps::Pseudoread; prefix::AbstractString="", is_consensus::Bool=false)

Specialized constructor for outputting Pseudoreads to FASTA.Records that can be written to files.

Arguments

  • ps::Pseudoread: The modified sequence and read window to be converted into the sequence of the new record

Keywords

  • prefix::AbstractString="": A string to start the sequence identifier with, usually based on the reference sequence of ps
  • is_consensus::Bool=false: Normally, the new identifier of the record is a combination of the prefix and the SHA1 hash of the alternate sequence. Set is_consensus to true to instead use the word "CONSENSUS" in place of the hash
source
SequenceVariation.HaplotypeMethod
SequenceVariation.Haplotype(
    query::Union{SAM.Record,BAM.Record}, reference::NucleotideSeq
) -> SequenceVariation.Haplotype

Specialized constructor that allows converting the alignment in a XAM.Record into a Haplotype.

source
HapLink._cigar_betweenMethod
_cigar_between(x::Variation{S,T}, y::Variation{S,T}) where {S,T}

Returns a CIGAR operation for the (assumed) matching bases between x and y.

See also _cigar

source
HapLink._indexed_readerMethod
_indexed_reader(bam::Union{AbstractPath,AbstractString}, int::Interval)

Provides an iterator over records in bam that overlap with int. Note that if no index file is available for bam, then the return value will fall back to an iterator of all records in bam.

source
HapLink._lendiffMethod
_lendiff(ps::Pseudoread)

Gets the difference between the number of bases within the read window of ps on the reference sequence from the number of bases within the read window on the mutated sequence, taking into account insertions and deletions.

source
HapLink._phrederrorMethod
_phrederror(quality::Number)

Converts a PHRED33-scaled error number into the expected fractional error of basecall

source
HapLink._pos_to_edgeMethod
_pos_to_edge(pos::Number)

Converts pos from a number between 0 (beginning) and 1 (end) to a number ranging from 0 (beginning) to 1 (middle) to 0 (end), i.e. convert a relative position to a relative distance from the edge.

source
HapLink._posinMethod
_posin(ps::Pseudoread, v::Variation)

Determines if the positions that make up v are wholly contained by ps

source
HapLink._push_filter!Function
_push_filter!(
    vc::VariationCall,
    label::Char,
    value::Union{Nothing,Number},
    filter::Function=(var, val) -> true,
)

Adds a FILTER entry to vc of the form "$label$value" if filter returns true.

Arguments

  • vc::VariationCall: The VariationCall to annotate
  • label::Char: The first character of the filter text to add
  • value::Union{Nothing,Number}: The value to compare vc against, and to append to the filter text. If set to nothing, _push_filter! will return without evaluating or adding any filters, which may be useful for processing multiple inputs
  • filter::Function=(var, val) -> true: A function handle to determine if a filter should be applied or not. Note that this function must return true if and only if the filter should be added to vc. The function will be passed vc and value. Defaults to always applying filters regardless of the values of vc and value.
source
HapLink.magnitudeMethod
magnitude(x::UnitRange)

Gets the difference between the last and first elements of x

Example

julia> using HapLink: magnitude

julia> magnitude(0:10)
10
source
HapLink.overlapMethod
overlap(x::UnitRange{S}, y::UnitRange{S}) where {S}

Finds the inclusive overlap interval of x and y

Example

julia> using HapLink: overlap

julia> overlap(1:5, 3:10)
3:5

julia> overlap(2:4, 6:8)
6:5

julia> overlap(1:10, 2:9)
2:9
source
HapLink.findsetFunction
findset(lst::AbstractArray{T}, comparator::Function) where {T}

Finds every possible set of items in lst where comparator returns true for the set.

Example

function divisible_by_same_number(x, i)
    for j in 2:i
        if all(y -> y % j == 0, x)
            return true
        end
    end
    return false
end
findset(1:12, x -> divisible_by_same_number(x, 5))

# output
6-element Vector{Vector{Int64}}:
 [2, 4, 6, 8, 10, 12]
 [6, 3, 9, 12]
 [5, 10]
 [1]
 [7]
 [11]
source