Accessing and modifying annotations
Feature
Features (genes) can be added using addgene!
. A feature must have a feature name and a locus (position), and can have any number of additional qualifiers associated with it (see next section).
GenomicAnnotations.addgene!
— Functionaddgene!(chr::Record, feature, locus; kw...)
Add gene to chr
. locus
can be an AbstractLocus
, a String, a UnitRange, or a StepRange (for decreasing ranges, which will be annotated on the complementary strand).
Example
addgene!(chr, "CDS", 1:756;
locus_tag = "gene0001",
- product = "Chromosomal replication initiator protein dnaA")
After adding a new feature, sort!
can be used to make sure that the annotations are stored (and printed) in the order in which they occur on the chromosome:
sort!(chr)
Existing features can be removed using delete!
:
Base.delete!
— Methoddelete!{T}(h::MutableBinaryHeap{T}, i::Int)
Deletes the element with handle i
from heap h
.
delete!(collection, key)
Delete the mapping for the given key in a collection, and return the collection.
Examples
julia> d = RobinDict("a"=>1, "b"=>2)
+ product = "Chromosomal replication initiator protein dnaA")
After adding a new feature, sort!
can be used to make sure that the annotations are stored (and printed) in the order in which they occur on the chromosome:
sort!(chr)
Existing features can be removed using delete!
:
Base.delete!
— Methoddelete!{T}(h::MutableBinaryHeap{T}, i::Int)
Deletes the element with handle i
from heap h
.
delete!(collection, key)
Delete the mapping for the given key in a collection, and return the collection.
Examples
julia> d = RobinDict("a"=>1, "b"=>2)
RobinDict{String,Int64} with 2 entries:
"b" => 2
"a" => 1
julia> delete!(d, "b")
RobinDict{String,Int64} with 1 entry:
- "a" => 1
delete!(tree::RBTree, key)
Deletes key
from tree
, if present, else returns the unmodified tree.
delete!(gene::AbstractGene)
Delete gene
from parent(gene)
. Warning: does not work when broadcasted! Use delete!(::AbstractVector{Gene}) instead.
Base.delete!
— Methoddelete!(genes::AbstractArray{Gene, 1})
Delete all genes in genes
from parent(genes[1])
.
Example
delete!(@genes(chr, length(gene) <= 60))
Qualifiers
Features can have multiple qualifiers, which can be modified using Julia's property syntax:
# Remove newspace from gene product descriptions
+ "a" => 1