BioFSharp icon indicating copy to clipboard operation
BioFSharp copied to clipboard

[BUG] Using pretty printers on BioSeq after translation results in an empty source sequence

Open kMutagene opened this issue 4 years ago • 5 comments

Describe the bug Using pretty printers on BioSeq results in an empty source sequence

To Reproduce

create BioSeq, pretty print it

#r "nuget: BioFSharp, 2.0.0-beta6"
#r "nuget: BioFSharp.IO, 2.0.0-beta6"

open BioFSharp
open BioFSharp.IO

let myGene = 
    BioSeq.ofNucleotideString "ATGGCTAGATCGATCGATCGGCTAACGTAA"
    |> BioSeq.complement
    |> BioSeq.transcribeTemplateStrand
    |> BioSeq.translate 0
  
myGene |> Seq.length //10
  
myGene |> FSIPrinters.prettyPrintBioCollection

myGene |> Seq.length //0

and investigate the original sequence afterwards

Expected behavior myGene stays the same after the printer

Additional information

BioArray works as expected, so the problem seems to lie in the intternals of BioSeq:

#r "nuget: BioFSharp, 2.0.0-beta6"
#r "nuget: BioFSharp.IO, 2.0.0-beta6"

open BioFSharp
open BioFSharp.IO

let myGene = 
    BioArray.ofNucleotideString "ATGGCTAGATCGATCGATCGGCTAACGTAA"
    |> BioArray.complement
    |> BioArray.transcribeTemplateStrand
    |> BioArray.translate 0
  
myGene.Length
  
myGene |> FSIPrinters.prettyPrintBioCollection

myGene.Length

Leaving out |> BioSeq.translate 0 also leaves things unaffected, so the problem seems to be in the translate function

kMutagene avatar Sep 23 '21 13:09 kMutagene

That are a whole set of reasons bytes disappears. For now, evidence were received about quantum effects decrease data size while pretty print state is measured.

olegvolovoda avatar Jun 02 '23 11:06 olegvolovoda

That are a whole set of reasons bytes disappears. For now, evidence were received about quantum effects decrease data

size while pretty print state is measured.

u ok?

kMutagene avatar Jun 02 '23 11:06 kMutagene

Without proper lab issue examination, it's too early to make distinct statements about the 'pretty print relativity' effect. Although other data eliminating factors could be electrical and magnetic fields.

пт, 2 июн. 2023 г. в 14:20, Kevin Schneider @.***>:

That are a whole set of reasons bytes disappears. For now, evidence were received about quantum effects decrease data

size while pretty print state is measured.

u ok?

— Reply to this email directly, view it on GitHub https://github.com/CSBiology/BioFSharp/issues/122#issuecomment-1573573628, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALGY4CXV7Y3JUXQWGZDQDDXJHD77ANCNFSM5ETV3GPA . You are receiving this because you commented.Message ID: @.***>

olegvolovoda avatar Jun 02 '23 12:06 olegvolovoda

I appreciate your correspondence. It is imperative to underscore that in the absence of a comprehensive appraisal pertaining to the laboratory-specific concerns associated with the phenomenon known as the 'pretty print relativity' effect, it would be premature, if not altogether imprudent, to assert categorical assertions regarding its nature. Nonetheless, it behooves us to entertain the possibility of alternative variables capable of confounding data elimination processes, including but not limited to the influence of electrical and magnetic fields. It is incumbent upon us to undertake further rigorous scrutiny and rigorous analysis in order to procure a more lucid comprehension of the matter at hand.

kMutagene avatar Jun 02 '23 12:06 kMutagene

That are a whole set of reasons bytes disappears. For now, evidence were received about quantum effects decrease data size while pretty print state is measured.

Without proper lab issue examination, it's too early to make distinct statements about the 'pretty print relativity' effect. Although other data eliminating factors could be electrical and magnetic fields.

If I understood you correctly, you want to state that bytes have disappeared due to cosmic radiation – which may even be correct. However, such effects only occur very rarely (especially not with adequately shielded RAMs) and usually only affect individual bits. That such a thing would lead to such specific effects and not to a system crash (much more probable) is so extremely unlikely that it can be neglected. The assumption of a programmatic error is preferable.

omaus avatar Jun 02 '23 13:06 omaus