BioSequences.jl icon indicating copy to clipboard operation
BioSequences.jl copied to clipboard

BioSequences.RE.RegexMatch behaves nothing like Base.RegexMatch

Open estragon0 opened this issue 6 years ago • 1 comments

BioSequences.RE.RegexMatch lacks the "match" and "offset" fields of Base.RegexMatch, which not only makes it considerably less useful, but is somewhat difficult to debug because their print() representation is identical.

Code:

string_seq = "ARNDCEQG"
aa_seq = aa"ARNDCEQG"

string_match = match(r"DCE", string_seq)
aa_match = match(biore"DCE"aa, aa_seq)

println(string_match)
println(aa_match)

println(fieldnames(typeof(string_match)))
println(fieldnames(typeof(aa_match)))

Result:

RegexMatch("DCE")
RegexMatch("DCE")
(:match, :captures, :offset, :offsets, :regex)
(:seq, :captured)

estragon0 avatar Sep 07 '18 03:09 estragon0

Thanks. I may need to reconsider the design of these tools.

bicycle1885 avatar Sep 07 '18 03:09 bicycle1885