[Biopython] python advice needed

Kevin Rue kevin.rue at ucdconnect.ie
Wed Apr 16 15:09:53 UTC 2014


Stephane,

"I would first say that your code should first work"

With all due respect, I would be careful how you phrased that, especially
when talking to a beginner in programming. The way I understand it (not
necessarily the way you meant it), this could be one of the worst advice I
have heard.
I would very much rather have a script that does not work is well commented
and documented (making it easier to debug), than a script copied from
StackOverflow that works with obscure syntax and no comment to guide you in
understanding it. Programming 1.0.1 in my opinion.

To me, a script that is "pseudo-coded first", is much more likely to "work
second" (i.e. first after the pseudo-code, excuse my play on words).
Still in my humble opinion, creating a code that "works first" is one of
the best way to write something that works fine in your particular little
ultra-specific scenario. At best, it will need to be copy-pasted and edited
for another scenario, more often you will start from scratch another script
to "work first" in the second scenario.

The PEP8 is a very good advice I forgot to mention. PyCharm is very useful
in that regard as it checks the code for the PEP8 rules while it is typed.

Regards,
Kevin


On 16 April 2014 13:38, Téletchéa Stéphane <stephane.teletchea at inserm.fr>wrote:

> Le 15/04/2014 16:58, Csaba Kiss a écrit :
>
>  Hi!
>> I need some advice how to get better in python. I have written a software
>> package to analyze antibody deep sequencing data. This was my first
>> experience with python and I am not a programmer. The end result works,
>> however, if a professional coder looks at the scripts, it is obvious that
>> it was written by an amateur. I am planning to re-write the code into a
>> better format that is extendable and more user and coder friendly. At the
>> moment the script only relies on biopython to get the sequences and quality
>> values out of sff and fastq files, the rest is custom written. I would like
>> to rely more on biopython and also perhaps extend biopython with new
>> features.
>> The problem I am having is object oriented python and classes. I
>> understand the concept of both, but it's completely different to actually
>> use it. I would like to ask help from scientist who are in a similar
>> situation, as myself. I am a molecular biologist with interest in coding,
>> but little background. Do you have any good tutorials books about python
>> classes and OOP? For example, when I learned python I found the Google
>> python class, extremely valuable. I practically looked at the videos and
>> solved the problems and that sent me on my way to python:
>> https://developers.google.com/edu/python/?csw=1
>>
>> Any help would be appreciated:
>> Csaba
>>
>>
> Dear Csaba,
>
> Being a bioinformatics teacher, I would first say that your code should
> first work :-)
>
> Second, in order to get another version of your code, as mentioned
> earlier, you should use
> a git-like versioning control tool (git or any other, git tends to be
> popular).
>
> Third, concerning python itself, I would recommend following the "PEP8"
> recommandations:
> http://legacy.python.org/dev/peps/pep-0008/
>
> (I also found this page while searching for PEP8 ->
> http://docs.python-guide.org/en/latest/writing/style/)
>
> And last, since we are using biopython, check how biopython is implemented
> (for example):
> https://github.com/biopython/biopython/blob/master/Bio/
> AlignIO/Interfaces.py
>
> Best,
> Stéphane
>
> --
> Equipe DSIMB - Dynamique des Structures et
> des Interactions des Macromolécules Biologiques
> INTS, INSERM-Paris-Diderot UMR_S 1134
> 6 rue Alexandre Cabanel - 75739 Paris cedex 15 - France
> Tél : +33 144 493 057
> Fax : +33 147 347 431
> http://www.dsimb.inserm.fr - http://www.steletch.org
>
>
> _______________________________________________
> Biopython mailing list  -  Biopython at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/biopython
>



-- 
Kévin RUE-ALBRECHT
Wellcome Trust Computational Infection Biology PhD Programme
University College Dublin
Ireland
http://fr.linkedin.com/pub/k%C3%A9vin-rue/28/a45/149/en




More information about the Biopython mailing list