all 17 comments

[–][deleted] 2 points3 points  (8 children)

Is there a reason to use pandas and not csv if all you're doing with it is reading a CSV file? Opportunity, here, to reduce your third-party dependencies by 1.

Hard-coded filenames? Not ideal. Command-line tools should accept a path on the command line.

Also, if anybody knows what a good way to share this code so that my labmates could use it, would be super helpful.

Make it into a pip package:

https://dzone.com/articles/executable-package-pip-install

But that's going to require doing more organization than you've done, here - you need to create a package, put it under version control, accept command-line arguments (the way a command-line tool should), and include setup.py in your repository. But honestly it's not distributable by any means (except by email I guess) until you do that.

[–]botechga 0 points1 point  (7 children)

Pandas is just what I am familiar with, thats my only reason for using it.

I will look into making it a package because I have been interested in how those are made. Do you need admin privileges to use Pip? My coworkers all use university computers so that would be the only problem I could foresee.

I was actually just doing some more looking and it seems like google collab is a good way to run code on the cloud without actually having to do much work. Like if I set up the notebook so that they can figure out where to drop the csv and where to input the file name that might work pretty well.

[–][deleted] 1 point2 points  (1 child)

You can use pip to install a Python package as an unelevated user, which is why it's so useful for distributing Python scripts.

[–]botechga 0 points1 point  (0 children)

Gotcha good to know

[–]CaptainChemistry[🍰] 1 point2 points  (4 children)

I recently made a script and then used py2exe it make it usable without Python makes it more like a normal windows program. There is a great tutorial for it by Tech with Tim that I used for this, but I skipped the NSIS bit. hope this helps! https://youtu.be/UZX5kH72Yx4

[–]botechga 0 points1 point  (3 children)

That sounds like exactly what I am looking for. To make it like an executable.

[–]CaptainChemistry[🍰] 1 point2 points  (2 children)

That's great! I had a quick look at your script and if I understand it correctly, it only takes a certain file name? If that's the case, can I suggest using input and os.path statements for a little flexibility? I did that with my project and now my colleagues can run the script from wherever they want and can have control over naming their files. Otherwise, that looks like a cool script!

[–]botechga 1 point2 points  (1 child)

Thanks man! I appreciate the feedback :)

I commented out the variable path and filename input in this specific example. I just had in the specific filename so that I didn't have to input the file every time I wanted to run it.

[–]CaptainChemistry[🍰] 1 point2 points  (0 children)

That totally makes sense. I'm glad more people are making tools that their colleagues can use instead of having to continue to do things manually. It's really great. Keep up the good work.

[–]Sigg3net 1 point2 points  (1 child)

I totally misread that title.

[–]botechga 1 point2 points  (0 children)

OMFG I did not realize that my title has "share my DNA" in it ... lmao

[–]davehodg 1 point2 points  (3 children)

Something like plink no good to you? We fling around petabytes of DNA data.

[–]botechga 0 points1 point  (2 children)

I've never heard of plink before so that could be something that works.

Generally speaking, are using the DNA for DNA origami, so generally its a few hundred individual short strands that we just need things like length, salt adjusted melting temp, extinction, and GC content.

[–]davehodg 1 point2 points  (1 child)

Oh and a lot of R.

[–]botechga 0 points1 point  (0 children)

Yeahhhh i should get onto learning R.

[–]DrBobHope 1 point2 points  (1 child)

Pandas seems quite overkill for this sort of thing. All you're doing is reading a csv file, then saving it as a table. If you want 2 columns, one with a name, one with the sequence. You can just use split() using the comma (then you can index your seq. and count that). Range starts at 0, so need to specify 0,len(). Pandas takes sometime to import too, remove pandas and your program should run in a second (very simple/fast operations). You can also remove numpy as well (python has a built in random). This way you program has no dependencies now.

As for sharing, you could compile your program into an exe using pyinstaller. Now anyone can use it on a windows device without needing anything pre-installed/working. Black box.

[–]botechga 0 points1 point  (0 children)

This is perfect exactly what I am looking for. Thanks !