profile

Chatomics! — The Bioinformatics Newsletter

AI ported 6,000+ lines of Python in 8 hours. Here’s the catch


Hello Bioinformatics lovers,

AI is eating the world. I have been using it for my bioinformatics coding for a while.

I want to share my experiences.

Eight hours. That’s how long it took me to port an entire bioinformatics package from Python 2 to Python 3 using AI.

Over 6,000 lines of code. Multiple modules. Complex functionality for ChIP-seq and RNA-seq integration.

Could I have done it manually? Sure. probably in weeks.

But here’s what you really need to know: AI didn’t just save me time.

It changed how I think about what’s worth automating—and what still needs a human brain.

The Python Win: Faster Than You’d Think

I used AI to resurrect BETA, a package for integrating ChIP-seq and RNA-seq data that was abandoned in Python 2.

Eight hours from start to working Python 3 code.

Why so fast? Python is AI’s sweet spot. Massive training data. Consistent patterns. Clear upgrade paths.

What the AI handled well:

- Syntax conversion (print statements, dict methods, iterators)

- Standard library updates (urllib, pickle, input/raw_input)

- Exception handling syntax changes

- Basic dependency modernization

What I still did:

- understand how the package works

- figure out the input when it does not work (e.g, The gene expression input first line should start with #)

- The py2 to py3 translation is not perfect, so I had to do a few iterations (somehow it missed the punctuations)

- Made sure scientific accuracy wasn’t compromised.

I used the AR ChIP-seq and RNA-seq data to do a sanity check.
I know KLK2 and KLK3 should be top top-ranking genes for AR targets. and the result passed my eye test!

Full porting story here.

The real value: AI turned “ugh, this will take all week” into “I can ship this today.” That’s a different kind of productivity.

The R Disappointment: Verbose and Behind the Times

R code from AI tools? Still not there.

Both GitHub Copilot and Claude Code generate functional but outdated R.

You’ll get code that runs, but it often:

- Uses base R when tidyverse would be cleaner. It has a lot of cat() statement (verbose).

- Misses vectorization opportunities

- Ignores modern package ecosystems - Writes like it’s 2010

Example: Ask for data batch processing and you might get nested loops instead of purrr::map().

It works, but it’s not how you’d write it.

Why? Less training data, more fragmented community styles, and R’s multiple paradigms (base, tidyverse, data.table) confuse the models.

What to do: Use AI-generated R as a starting template only.

Budget time to refactor into modern idioms. (or my prompting skills need to be better for generating the R code compared to the Python code).

You can tell specifically in the prompt that you want modern solutions, such as the tidyverse.

Where AI Actually Shines: Refactoring Your Mess

Here’s the underrated use case: taking working-but-ugly code and making it maintainable.

Got a 500-line script that “just works”? AI can:

- Break it into logical functions

- Add proper error handling

- Generate documentation

- Suggest better variable names

Why this works: The AI isn’t inventing logic—just restructuring what you’ve already validated.

Much lower risk of introducing bugs.

Time saved: Hours of tedious refactoring work you’d keep postponing.

Documentation: The Secret Productivity Hack

Writing READMEs and tutorials? This is where AI crushes it.

I used it for the BETA documentation. Within minutes, I had:

- Clear installation instructions

- Usage examples with actual code

- Quick-start guide

- Parameter explanations

Why it excels: Documentation follows predictable patterns. AI has seen thousands of good examples. It knows the structure.

Your ROI: What used to take half a day now takes 30 minutes (you need to understand what a good README looks like and who your audience is for the package).

In the BETA README, you will notice I tell why this tool is useful for biology.

AI as Learning Accelerator (Not Shortcut)

Controversial take: AI makes you learn faster, not lazier—if you use it right.

The trap: Copy-pasting solutions without understanding them.

The opportunity: Using AI as an on-demand tutor who:

- Explains why an approach works

- Shows you alternative solutions

- Helps you debug with context

- Teaches idioms through examples

The key: Stay curious. Ask “why?” Test your understanding. Verify claims.

I tell my students: There’s never been a better time to learn to code.

But AI doesn’t eliminate the learning—it changes how you struggle.

The struggle is still the point. AI just makes your struggling time more productive.

My Field-Tested Recommendations

Use AI confidently for:

1. Python code modernization (with testing)

2. Documentation and tutorials

3. Refactoring working code

4. Learning new concepts interactively

5. Getting starter templates

Use AI carefully for:

1. R code (expect to rewrite significantly)

2. Statistical logic (verify everything)

3. Novel algorithms (high error rate)

Don’t trust AI for:

1. Final code without human review

2. Complex domain-specific logic

3. Replacing your learning process

The reality: AI won’t write perfect bioinformatics code.

But it can compress a week-long port into 8 hours—if you know when to trust it and when to verify.


Your turn: What’s your experience with AI coding? What worked? What failed? Hit reply—I read every response.

And if this saved you some pain, forward it to a colleague still on the fence about AI tools.

Happy Learning!

Tommy aka, crazyhottommy

PS:

If you want to learn Bioinformatics, there are other ways that I can help:

  1. My free YouTube Chatomics channel, make sure you subscribe to it.
  2. I have many resources collected on my github here.
  3. I have been writing blog posts for over 10 years https://divingintogeneticsandgenomics.com/

Stay awesome!

Chatomics! — The Bioinformatics Newsletter

Why Subscribe?✅ Curated by Tommy Tang, a Director of Bioinformatics with 100K+ followers across LinkedIn, X, and YouTube✅ No fluff—just deep insights and working code examples✅ Trusted by grad students, postdocs, and biotech professionals✅ 100% free

Share this page