Today I got access to a "new thing", currently in beta testing, called the
GitHub Copilot
, I am using it to answer this question:
first I typed
## how to split RNA-seq into codons
The copilot wrote me the code:
def codons(seq):
codon_list = []
for i in range(0, len(seq), 3):
codon_list.append(seq[i:i+3])
return codon_list
Let's see how it works:
seq = "ACAGUCGACUAGCUUGCACGUAC"
print (codons(seq))
prints:
['ACA', 'GUC', 'GAC', 'UAG', 'CUU', 'GCA', 'CGU', 'AC']
looks good to me, then I wrote:
# count complete and incomplete codons
without batting an eye the Copilot suggested:
def count():
seq = "ACAGUCGACUAGCUUGCACGUAC"
codon_list = codons(seq)
complete = 0
incomplete = 0
for codon in codon_list:
if len(codon) == 3:
complete += 1
else:
incomplete += 1
return complete, incomplete
A new era has begun in computing.
I'll remember this day: Friday, October 29, 2021. It is the day when I realized a new era is upon us.