................................................
I am really bad at PC and programming. Trying to figure-out how Biopython works and Python at the same time.
Discovered existence of Python bindings. I am looking for a small c program (one file) to try to learn how
to call it from Python using ctypes or cython. Any idea ? I am asking for this because the print 'Hello'
isnt usefull to me , no way to pass argument to me and my C is absolutely zero
(asked same question on bioinformatics.stackexchange.com got closed. Hope find more help here)
1 answer
Here's a post where I show how to use Cython to take a very fast reverse complement of a DNA sequence, a task that Biopython is, oddly, not able to do quickly:
My second answer speeds up the original approach further:
I think these two answers should be a decent intro to a basic usage of Cython for a "real-world" bioinformatics application, though you will need to learn a little C to figure out how it works.
no good trying with something that returns value
Maybe use the Github repository that the original poster created to bundle tests of all the different reverse complement approaches:
https://github.com/conchoecia/fastest_rc_python
That should take most of the work out of setting things up, and you can then play with it in more of a "sandbox", if that makes sense.
But I think Joe's advice is pretty solid. You may need a bit of gentler introduction to programming before tackling this. C has a much steeper learning curve than Python, and that can cause some frustration. I'd suggest starting with the basics of Python, and then going from there once you're comfortable.
yep thanks. Fell back to https://realpython.com/python-bindings-overview/#ctypes , the ctypes part. It gave me
an idea of what is like. Was wondering how pymol and chimera are able to handle all the mix flavours they have !!
Log in to answer this question.
If you are as bad at programming as you say, starting out by trying to conflate C (a not very beginner-friendly language in the first place) with another language (python), whilst trying to get in to the weeds of more niche interface layers like cython is not the approach I would take.
Start with something easy like python. Get comfortable with it, then start to explore the wider world.