r/learnpython 16h ago

Bioinformatics graduate who can understand Python code but can’t write it from scratch — how should I actually learn?

I have a Master’s in Data Science with a previous background in wet-lab biology. My programming experience mainly came through my MSc, so I don’t have a traditional CS background.
At this point, I can usually **understand Python code when I see it**, explain what it is doing, and modify parts of it. But if you give me a problem and ask me to write the solution from scratch, I struggle — and I often rely on ChatGPT to get started.
I’m trying to figure out what the right way to overcome this is.
Should I:
go back and systematically learn Python/CS fundamentals through tutorials first, then start projects?
or keep building bioinformatics projects and use ChatGPT as a tutor/coding assistant while gradually becoming more independent?
I find learning programming purely through tutorials quite difficult and passive, especially because I’ve never studied CS formally.
**For people who came into bioinformatics from biology rather than CS: how did you actually learn to code independently? What should I be able to do before I consider myself “good enough” at Python for a junior bioinformatics role?**

0 Upvotes

4 comments sorted by

2

u/lakseol 15h ago

If you can understand python when you read it there isn't any reason why you should start at the beginning again. You should write code because that's where you are weak. At the beginning maybe use AI to hint how to solve a problem, but try to avoid that if you can. You can always ask for advice and hints here. It doesn't matter what sort of problem you tackle, you have to learn how to solve a problem with python whether it's bioinformatics or something else.

2

u/jaiagreen 14h ago

If you can understand code, build on that rather than starting from the bottom. Take some old code and delete a few lines here and there. After giving yourself time to forget, can you fill in those lines? (You can also ask AI to make examples like this for you.) Once you're pretty good at that, delete bigger chunks of code. Then just start with an outline. Tada, now you can write from scratch.

1

u/TheRNGuy 8h ago

Think of what task you need, then break it to smaller steps. 

1

u/Wuthering_depths 4h ago edited 4h ago

I only learn by doing. I've floundered in the past with java and few other things because I didn't have a reason to really make use of it (at work). Python is different because I'm able to convert a bunch of old SSIS packages to it...so the motivation is there, the requirements are there, and it's productive.

Granted you may not have ready-made projects, if not then maybe come up with some. Because each project has requirements, I'm basically just learning what I need to as I go. One may import a csv to a database, another might pull data, create a file and FTP it, etc. I started using pandas only when I needed to work with datasets. I wouldn't retain much if I tried to learn everything up front and then only use it afterward...I'd just have to look up each thing again anyway.

Another nice thing about data analyst work and learning is that we aren't building apps for people to use...ours are relatively simple and short. What I'm saying is, if you try to build something too complex up front it may just stop you from getting it done...this happened to me when I tried to build a text adventure game with java. Way too much planning needed to do such a thing without knowledge of the language, and eventually I just got frustrated.

As I say, we focus on data but not everyone does. Even simple things like copying and renaming a file are very useful things for us. Things like that would be really short simple projects...e.g. grab all the txt files from folder A, rename them with today's date in the name and move them to folder B. Boring, sure, useful, yes :)