Skip to content

Commit 6aa01d6

Browse files
committed
Document the meaning of fields better
1 parent 9a8f79f commit 6aa01d6

File tree

2 files changed

+24
-29
lines changed

2 files changed

+24
-29
lines changed

docs/src/index.md

Lines changed: 23 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -82,34 +82,27 @@ Note that `Base.getproperty` is overloaded for `PAFRecord`, so the properties
8282
are public and stable across major versions, but may not reflect the actual
8383
underlying fields as they are stored in the `PAFRecord`.
8484

85-
A description of the properties of `PAFRecord`s can be found in the docstring of
86-
`PAFRecord`, but here is a list of them:
87-
88-
```jldoctest record; output = false
89-
properties = [
90-
(:qname, StringView),
91-
(:qlen, Int),
92-
(:qstart, Int),
93-
(:qend, Int),
94-
(:tname, StringView),
95-
(:tlen, Int),
96-
(:tstart, Int),
97-
(:tend, Int),
98-
(:matches, Int),
99-
(:alnlen, Int),
100-
(:mapq, Union{Int, Nothing}),
101-
(:is_rc, Bool),
102-
]
103-
104-
@assert length(propertynames(record)) == length(properties)
105-
106-
for (property, type) in properties
107-
@assert getproperty(record, property) isa type
108-
end
109-
110-
# output
111-
112-
```
85+
### Fields of `PAFRecord`
86+
* `qname::StringView{A}`. `A` is an implementation detail.
87+
Names of the query sequences
88+
When the sequences are from a FASTA file, this is typically the _identifier_ of the
89+
FASTA records, i.e. the part of the header before the first space.
90+
* `tname::Union{Nothing, StringView{A}}`. Same as `qname`, but for the target (i.e. subject)
91+
sequence. May be `nothing` if the record is unmapped.
92+
* `qlen` and `tlen`. Of type `Int`. Length of the full query and target sequence.
93+
* `qstart` and `tstart`. Of type `Int`. Leftmost (i.e. lowest) position of the alignment
94+
in the query and target, respectively. This does not take strandedness into account.
95+
* `qend` and `tend`. Of type `Int`. Rightmost (i.e. highest) position of the alignment
96+
in the query and target, respectively. This does not take strandedness into account.
97+
As such, we always have `record.qend - record.qtart) >= 0`, and likewise for the target.
98+
* `alnlen::Int`. Length of alignment. That includes gaps in query and target, and may therefore
99+
not match either `qend - qstart + 1`, or that of the target.
100+
* `matches::Int`. Number of residue matches (not mismatches) in the alignment.
101+
`matches / alnlen` is the alignment identity and is between 0 and 1.
102+
* `mapq::Union{Int, Nothing}`. Mapping quality, from 0:254, where 254 is the better quality.
103+
When calibrated, the probability the mapping is correct should be 10^(-mapq / 10).
104+
A value of `nothing` indicates the mapping quality is unavailable.
105+
* `is_rc::Union{Bool, Nothing}` indicates whether the alignment matches the target on the forward (`false`) or reverse-complement `true` strand. A missing alignment is `nothing`.
113106

114107
The PAF format does not contain fields for alignment identity, query coverage
115108
or target coverage.
@@ -290,6 +283,7 @@ true
290283

291284
## Reference
292285
```@docs
286+
PairwiseMappingFormat.PairwiseMappingFormat
293287
PAFReader
294288
PAFRecord
295289
aux_data
@@ -298,6 +292,7 @@ query_coverage
298292
target_coverage
299293
try_next!
300294
is_mapped
295+
PairwiseMappingFormat.Errors
301296
PairwiseMappingFormat.try_parse
302297
PairwiseMappingFormat.ParserException
303298
```

src/PairwiseMappingFormat.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ julia> print(PAF.Errors.InvalidZero)
305305
InvalidZero
306306
```
307307
308-
See also: [`ParserException`](@ref)
308+
See also: [`PairwiseMappingFormat.ParserException`](@ref)
309309
"""
310310
module Errors
311311
public Err

0 commit comments

Comments
 (0)