Fwd: [Biopython] Thermocycler program file format(ting)

26 views
Skip to first unread message

Bryan Bishop

unread,
May 13, 2015, 8:10:37 AM5/13/15
to diybio, Bryan Bishop, Horea Christian

From: Horea Christian <h....@mail.ru>
Date: Wed, May 13, 2015 at 6:38 AM
Subject: [Biopython] Thermocycler program file format(ting)
To: biop...@mailman.open-bio.org


I would like to store my Thermocycler (pcr) programs on my server to better keep track of them. Do you know any good format/style to do that in? does biopythonhave any thermocycler program objects?

Right now I was thinking of saving this in a normal .csv file, but the entire iterative aspect of PCR seems difficult for me to convey in a concise matter in a .csv file. Would you have any suggestions?


Best Regards,
Christian

--
Horea Christian, M.Sc.
Doctoral Researcher
Institute for Biomedical Engineering
Neuroscience Center Zurich
ETH Zurich and UZH

Email, horea....@gmail.com
Online portal, chymera.eu

_______________________________________________
Biopython mailing list  -  Biop...@mailman.open-bio.org
http://mailman.open-bio.org/mailman/listinfo/biopython



--

John Griessen

unread,
May 13, 2015, 11:31:51 AM5/13/15
to diy...@googlegroups.com
On 05/13/2015 07:10 AM, Bryan Bishop wrote:
> the entire iterative aspect of PCR seems difficult for me to convey in a concise matter in a .csv file. Would you have any
> suggestions?


Are you meaning you would like to capture a dynamic iteration, or just the usual
static number of cycles and time and temp for each?

For the static case, I would use declarative programming's for loop format
with name:value pairs inside the loop.


If you want to get multi variable and dynamic, such as iterate
with one set of cycle parameters until a detector sees fluourescence,
then do "plan b" for a while, then do "plan c", there are two ways to go.

You could stick with declarative and use while loops, or go to
a functional programming language such as verilog. From verilog,
it's easy to choose various ways to implement it depending on your controller
being based on a compiled language, python interpreter, or what have you.

I think functional programming is rare with biologists, so I suggest sticking
with declarative, or "procedural" code, that is traditional, quick to understand.

The straight .csv file would have no possibility of ever iterating "until cooked", only
iterating statically for fixed time periods, and it will be long lists
that definitely are not concise.

Here's an example in pseudo C/Fortran style:

temp_unit="degree Celsius"
time_unit="seconds"
min_ramp_time=15
ramp_time=0
t=0

for i=1,120 (
ramp_time=0
while ramp_time<(3*min_ramp_time)
t=t+ramp_time
temp=95
control_output(t,temp)
done

ramp_time=0
while ramp_time<(5*min_ramp_time)
t=t+ramp_time
temp=46
control_output(t,temp)
done

ramp_time=0
while ramp_time<(4*min_ramp_time)
t=t+ramp_time
temp=72
control_output(t,temp)
done

)



That will generate a temperature control output list at 1 sec intervals.


Cathal (Phone)

unread,
May 13, 2015, 1:38:02 PM5/13/15
to diy...@googlegroups.com
I wrote a parser for OpenPyCR which interprets "Naturally Written" programs and converts them to the YAML used by the device. So, programs are a series of key-colon-value-newline headers for data like name, lid temp, etc, followed by iterations-colon blocks, each of which contains one or more statements of time @ temp - description lines.

Or, for a direct example (from memory):

Title: My best program
Lid: 95°C

1x:
600s @ 95°C; Burn-in
35x:
20s @ 95°C; Melt
12s @ 60°C; Anneal
30s @ 72°C; Extend
1x:
1s @ 15°C; Cool it!


...the parser could probably use rewriting, I've learned much of Python since. An *actual* tokenising parser would be superfluous but maybe cleaner: mine used string methods and was line-wise / stateful.


On 13 May 2015 13:10:30 GMT+01:00, Bryan Bishop <kan...@gmail.com> wrote:

From: Horea Christian <h....@mail.ru>
Date: Wed, May 13, 2015 at 6:38 AM
Subject: [Biopython] Thermocycler program file format(ting)
To: biop...@mailman.open-bio.org


I would like to store my Thermocycler (pcr) programs on my server to better keep track of them. Do you know any good format/style to do that in? does biopythonhave any thermocycler program objects?

Right now I was thinking of saving this in a normal .csv file, but the entire iterative aspect of PCR seems difficult for me to convey in a concise matter in a .csv file. Would you have any suggestions?


Best Regards,
Christian


--
Sent from my Android device with K-9 Mail. Please excuse my brevity.

Ben Sima

unread,
May 14, 2015, 7:15:58 AM5/14/15
to diy...@googlegroups.com, kan...@gmail.com
If these PCR programs are just Python code, then you could just save them in .py files.

Do you have a small example of what you're trying to save?

-Ben

Cathal Garvey

unread,
May 14, 2015, 10:28:59 AM5/14/15
to diy...@googlegroups.com
I think a JSON representation makes more sense, personally; that way,
it's easily consumed by any programme or translated easily back into a
human representation. I may break out the aforementioned OpenPyCR
functionality into a translator from plain->JSON.

Suggested format:

{ "headers": {
"title": "My favourite program",
"created": <unix-timestamp>
},
"program": [
{"type": "step", "title": "Heat Lid", },
{"type": "step", "title": "Hot start", "block_tm":95, "hold":
<seconds>},
{"type": "loop", "steps": [<program steps in same format>]},
]
}

On 13/05/15 15:33, Ben Sima wrote:
> If these PCR programs are just Python code, then you could just save
> them in .py files.
>
> Do you have a small example of what you're trying to save?
>
> -Ben
>
>
> On Wednesday, May 13, 2015 at 8:10:37 AM UTC-4, Bryan Bishop wrote:
>
>
> From: Horea Christian <h....@mail.ru <javascript:>>
> Date: Wed, May 13, 2015 at 6:38 AM
> Subject: [Biopython] Thermocycler program file format(ting)
> To: biop...@mailman.open-bio.org <javascript:>
>
>
> __
> I would like to store my Thermocycler (pcr) programs on my server to
> better keep track of them. Do you know any good format/style to do
> that in? does biopythonhave any thermocycler program objects?
>
> Right now I was thinking of saving this in a normal .csv file, but
> the entire iterative aspect of PCR seems difficult for me to convey
> in a concise matter in a .csv file. Would you have any suggestions?
>
>
> Best Regards,
> Christian
>
> --
> *Horea Christian, M.Sc.*
> Doctoral Researcher
> Institute for Biomedical Engineering
> Neuroscience Center Zurich
> *ETH Zurich and UZH*
>
> Email, horea....@gmail.com <javascript:>
> Online portal, chymera.eu <http://chymera.eu>
>
>
> _______________________________________________
> Biopython mailing list - Biop...@mailman.open-bio.org <javascript:>
> http://mailman.open-bio.org/mailman/listinfo/biopython
> --
> -- You received this message because you are subscribed to the Google
> Groups DIYbio group. To post to this group, send email to
> diy...@googlegroups.com. To unsubscribe from this group, send email to
> diybio+un...@googlegroups.com. For more options, visit this group
> at https://groups.google.com/d/forum/diybio?hl=en
> Learn more at www.diybio.org
> ---
> You received this message because you are subscribed to the Google
> Groups "DIYbio" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to diybio+un...@googlegroups.com
> <mailto:diybio+un...@googlegroups.com>.
> To post to this group, send email to diy...@googlegroups.com
> <mailto:diy...@googlegroups.com>.
> Visit this group at http://groups.google.com/group/diybio.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/diybio/59b18eaa-f49b-4083-bb25-8a15eef3e1b4%40googlegroups.com
> <https://groups.google.com/d/msgid/diybio/59b18eaa-f49b-4083-bb25-8a15eef3e1b4%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.

--
Scientific Director, IndieBio Irish Programme
Now running in Cork, Ireland May->July
Learn more at http://eu.indie.bio and follow along!
Twitter: @onetruecathal
Phone: +353876363185
miniLock: JjmYYngs7akLZUjkvFkuYdsZ3PyPHSZRBKNm6qTYKZfAM
peerio.com: cathalgarvey

Ben Sima

unread,
May 14, 2015, 10:34:05 AM5/14/15
to diy...@googlegroups.com
toml is another format, which I think is better for human readability than JSON

https://github.com/toml-lang/toml

And there is a python parser for it

https://github.com/f03lipe/toml-python

just another suggestion :)



To unsubscribe from this group and stop receiving emails from it, send an email to diybio+un...@googlegroups.com.

To post to this group, send email to diy...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages