Archive

Coding Bits

A while ago, I learned about this neat trick from Harry.

You can write your resume in Markdown and convert them to PDF using Pandoc!

Since Markdown is plain text, you can version control it with git and create branches for whatever company you’re applying to. You can even share the repository with someone you trust, and they can do review the commits on GitHub.

Pandoc uses Latex to render the PDF, so they look very “textbook formal”.

All you have to do is:

pandoc resume.md -s -o resume.pdf

pandoc

Try it out!

You can do this for all sorts of documents, not just resumes.

Much like how you should use a csv library to generate csv files, you should use a library to generate GenBank files.

In Python, you can use Biopython!

Here’s a small recipe you get to started. It creates a GenBank from a sequence, and even includes an annotation.

from Bio import SeqIO
from Bio.Seq import Seq
from Bio.SeqRecord import SeqRecord
from Bio.Alphabet import IUPAC
from Bio.SeqFeature import SeqFeature, FeatureLocation

# Create a sequence
sequence_string = "ggggaaaattttaaaaccccaaaa"
sequence_object = Seq(sequence_string, IUPAC.unambiguous_dna)

# Create a record
record = SeqRecord(sequence_object,
                   id='123456789', # random accession number
                   name='Example',
                   description='An example GenBank file generated by BioPython')

# Add annotation
feature = SeqFeature(FeatureLocation(start=3, end=12), type='misc_feature')
record.features.append(feature)

# Save as GenBank file
output_file = open('example.gb', 'w')
SeqIO.write(record, output_file, 'genbank')

The output:

LOCUS       Example                   24 bp    DNA              UNK 01-JAN-1980
DEFINITION  An example GenBank file generated by BioPython
ACCESSION   123456789
VERSION     123456789
KEYWORDS    .
SOURCE      .
  ORGANISM  .
            .
FEATURES             Location/Qualifiers
     misc_feature    4..12
ORIGIN
        1 ggggaaaatt ttaaaacccc aaaa
//

Check out the really good Biopython documentation for more details!

PyCon 2016 just ended! I had a far more relaxing time this year, since I didn’t have to give a talk.

Highlights:

Ned gave an amazing machete-mode debugging talk this year.

machete

I’ve seen a couple of his talks over the past years, and this one is my favorite.

pyladies

I bought a super cute PyLadies Seattle tshirt, featuring plaid hair!

motorcycle

Lars gave an incredible keynote! It was also great to see him again. 😀

excited

I’m not sure if it was the talks or the general atmosphere, but I felt excited/inspired about software development in a way that I hadn’t been for a while.

I also got to see a lot of friends I don’t usually get to see, which was great.

Until next year, PyCon!