SANBI-SA / studyGroup

Gather together a group to skill-share, co-work, and create community
http://mozillascience.github.io/studyGroup/
Other
0 stars 9 forks source link

Session 14: converting some Perl to Python #23

Open pvanheus opened 6 years ago

pvanheus commented 6 years ago

Our starting point for this session is @kamzune's Perl script calculate_nuc.pl. The challenge: convert this to Python (with some BioPython as well I expect).

pvanheus commented 6 years ago

The original code can be found here: https://github.com/kamzune/nucleotide-frequencies

pvanheus commented 6 years ago

The resultant code is in https://github.com/SANBI-SA/studyGroupWork/tree/master/session14 .

We started with calculate_nuc.pl and did a pretty straightforward conversion to calculate_nuc.py.orig and then switched to using BioPython (installed via conda install -y biopython because my Anaconda install has bioconda channels) for calculate_nuc.py.bioperl and finally added a nicer command line interface with click to get calculate_nuc.py. Try it with:

python calculate_nuc.py seq.fasta