Skip to content

Commit

Permalink
Housekeep and clean files
Browse files Browse the repository at this point in the history
  • Loading branch information
camilogarciabotero committed Jul 30, 2024
1 parent b6a0843 commit 5ca0a4d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 27 deletions.
45 changes: 21 additions & 24 deletions src/types.jl
Original file line number Diff line number Diff line change
@@ -1,27 +1,9 @@
import GenomicFeatures: first, last, length, strand, groupname, metadata

export RBS, ORF
export ORF
export features, sequence, source
export groupname, finder, frame, score, strand, STRAND_BOTH, STRAND_NEG, STRAND_POS, STRAND_NA

# #### Ribosome Binding Site (RBS) struct ####

struct RBS
motif::BioRegex{DNA}
offset::UnitRange{Int64} # offset
score::Float64

function RBS(motif::BioRegex{DNA}, offset::UnitRange{Int64}, score::Float64)
return new(motif, offset, score)
end
# rbsinst = RBS(biore"RRR"dna, 3:4, 1.0)
end

# seq[orf.first-bin01.offset.start:orf.first-1]

# motifs = [dna"GGA", dna"GAG", dna"AGG"]

####### End of RBS struct #######

"""
struct ORF{N,F} <: GenomicFeatures.AbstractGenomicInterval{F}
Expand Down Expand Up @@ -183,10 +165,6 @@ function frame(i::ORF{N,F}) where {N,F}
return i.frame
end

function score(i::ORF{N,F}) where {N,F}
return i.features[:score]
end

function strand(i::ORF{N,F}) where {N,F}
return i.strand
end
Expand All @@ -211,4 +189,23 @@ end
# orf::ORF
# coding::Bool
# join::Bool
# end
# end

# #### Ribosome Binding Site (RBS) struct ####

# struct RBS
# motif::BioRegex{DNA}
# offset::UnitRange{Int64} # offset
# score::Float64

# function RBS(motif::BioRegex{DNA}, offset::UnitRange{Int64}, score::Float64)
# return new(motif, offset, score)
# end
# # rbsinst = RBS(biore"RRR"dna, 3:4, 1.0)
# end

# seq[orf.first-bin01.offset.start:orf.first-1]

# motifs = [dna"GGA", dna"GAG", dna"AGG"]

####### End of RBS struct #######
6 changes: 3 additions & 3 deletions src/utils.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export hasprematurestop, _varname, _varsymbol, _orfseq #fasta2bioseq
export _hasprematurestop, _varname, _varsymbol, _orfseq #fasta2bioseq

# General purposes methods supporting main functions
# General purposes private methods supporting main functions

"""
hasprematurestop(seq::LongNucOrView{4})::Bool
Expand All @@ -9,7 +9,7 @@ Determine whether the `sequence` of type `LongSequence{DNAAlphabet{4}}` contains
Returns a boolean indicating whether the `sequence` has more than one stop codon.
"""
function hasprematurestop(seq::NucleicSeqOrView{DNAAlphabet{N}})::Bool where {N}
function _hasprematurestop(seq::NucleicSeqOrView{DNAAlphabet{N}})::Bool where {N}

stopcodons = [LongDNA{4}("TAA"), LongDNA{4}("TAG"), LongDNA{4}("TGA")] # Create a set of stop codons
length(seq) % 3 == 0 || error("The sequence is not divisible by 3")
Expand Down

0 comments on commit 5ca0a4d

Please sign in to comment.