A /sci/entist wrote this code for some protein modeling thingy. What would you rate it out of 10?

A /sci/entist wrote this code for some protein modeling thingy. What would you rate it out of 10?

Attached: 1545844311154.png (1009x599, 63K)

Other urls found in this thread:

hastebin.com/adejefafix.cpp
fold.it/portal/
twitter.com/NSFWRedditImage

10/10 production ready

That is some dog shit code.

This is why Scala developers exist.

Not too shabby

10/10 robust enterprise code

It's ass. Someone post a better version that does the same thing. I'm too tired and lazy to do it myself.

/sci/entist spotted

Isn't this par these days?

>go on npm
>module for testing if a number is even or odd
>has over 100 dependencies
>over 1,000,000 other packages depend on it

>Scala developers
What does Scala have to do with this? Scala isn't even one of the popular beginner languages that then has a lot of terrible code.

Could use some better formatting for readability of the cases
Other than that, sure why not

I work with some "biology scientists", and they have pretty much the same style.
Also what infuriates me is they put ALL these codes in ONE bigass file. For fuck sake, separate the functions into different file and make next file which has the real fucking workflow. I don't want to scroll down a 1 km long file everytime.
Also there's a post doc fag, and I saw it's computer screen once. It was "how to join strings in Python" in Google. And he's a PhD from compsci coming to biology. Not that I'm any better but well...

Been a while since I've used Java, but don't && and || have the same precedence, unless you use parentheses to define how each section of the boolean expression should be validated?

nothing wrong with that if he hadn't used python before, it's not the same in every language

yeah but can you join strings in O(n!) time, now that will take a PhD

yeah I was about to ask this same thing, I think you're correct. OP's code is wrong.

Niggerlicious/10

I’ll make sure to tell him

deadline in minus 2 hours/10.

put it in the college degree meme

I like it. I'd hire him.
It is more readable, than any other code I've seen.

Does it work? 10/10
Does it work and it's for his own personal use? 11/10

>Isn't this par these days?
Yes.

What the fuck is wrong with "programmers" today? Why is this a fucking meme? Can anyone actually write code today or is it all just one big Pajeet copy/paste circle jerk?

Based on this alone, I'd say the person doesn't understand how to use data structures of any kind.

Like fuck, use some kind of hash map

No one can write code. It’s a problem going forward. All of these huge code repositories and programs and critical shit and no one will know what the fuck they’re doing in ten years

and that's why they are scientists and not programmers

best lookup table I've ever seen

duno, no wana bully him. maybe he had to write a more verbose code for some reason.

>protein modeling thingy
>it's just a translation table
He did nothing wrong t b h that's just how it be

noone supposes this mundane program is the OUTPUT of a more elegant program, some sort of compiler for a computational biology language?

Attached: sci.png (2454x1014, 651K)

Stop fucking with the 15 year olds, it upsets their tummies.

Unreadable drivel. More dense and heavy that a neutron star.

Would have been better if he made a const 3D array of strings with x, y, and z being the 3 indexes. Would have also been a lot faster.

print(array[x][y][z])

10/10 if it works.

better yet, a 1D array of -Pro -Thr -Gly etc. indexed by one random value.

>ALL these codes
I hate when shitskins mangle the English language.

If you claim that you don't occasionally have to google "how to X in Y" for some simple things periodically you're fucking lying.

Scientists don't program because it makes their autism penis hard or to be read by a hundred other barely literate pajeets.

Store proteins in data structure, indexed by name.
Loop over them.
Would only need 1 call to System.out.print, and maybe 1 or 2 if statements.
Give better names for x/y/z variables too, not just a single letter.
Comment the code.

...

Would this be better?
Looking at ops code it seems some amino acids have a higher chance of being generated than others, is this intentional?

Attached: sciop.png (1153x488, 90K)

>Does it work?
No. x=3, y=3, x=3 results in both -Gly and -Ala being output.

>x=3, y=3, x=3
x=3, y=3, z=3
I'm almost as bad as he is, but at least I caught my mistake.

baste

needs ternary operators / 10

>t. doesn't hire people

>Someone post a better version that does the same thing.
That would require a programmer actually understanding what that "same thing" is that is being done here, or rather understanding protein modeling and why convenient mathematical shortcuts can't be used to group specific strands for a model, which is why anyone criticizing the code here is too dumbfuck to do it and don't even know what they are criticizing.

The problem is that his program doesn't do that.
Read the /sci/ thread.

You don’t have to know what it does to understand that it’d be much clearer what the relationships are if you just had 2d arrays representing the outputs for different xyz combinations. Almost all of that “code” is noise

this, it's an instant giveaway. pajeets GET OUT

10/10
Enterprise Grade
Cloud scalable.

I've seen worse/10

OP's version but with 'else if' clauses is literally the fastest implementation of the algorithm.
Honestly if you prefer pic related, go be a professor somewhere else.

Attached: Untitled.png (1023x667, 42K)

run
[info] Running whatever.AminoAcidThing
Tyr-Thr-Val-His-Ala-Val-Pro-Val-Asp-Phe-Val-Arg-Phe-Trp-Pro-Arg-Leu-Asn-Leu-Ser-stop
UAUACCGUCCAUGCAGUACCAGUCGACUUUGUAAGGUUUUGGCCCCGGUUGAAUCUCUCUUAG
[success] Total time: 0 s, completed Dec 26, 2018 11:02:37 PM

Attached: amino.png (915x999, 73K)

Honestly, I can't even make heads or tails of the code until someone formats it correctly into paragraphs and chunks. As it is it literally looks like something he poorly copy pasted from online and then just tweaked a few things here and there just so that it's not blatantly copied from somewhere.

Aha! He did make a mistake in Ala!

>generating the table at runtime

Attached: img.jpg (2000x1200, 128K)

First, there a lot of redundant conditional logic here.
Second, code like this shouldn't be written anyway but generated. The first mark of a programmer is their ability to quickly automate.

This is way more complex than it needs to be, even if it is designed to go further than this random generation of amino acid strings.

based

I don't expect scientists to know how to program. If they can automate their task even slightly better than by hand, it's still good enough.
Better if they could collaborate with an engineer but whatever if they want or have to do it themselves.

Probably should write 'biochemistry' on the diploma though.

Doesn't matter what diploma he is getting.

should be 3 == x
and so on...

>CS graduate meme
>Doesn't matter that he's not a CS graduate

Ok, how about this?
I know the symbols are nonsense, but I wanted to try them out.

Attached: new amino.png (813x662, 39K)

Should have made an [x,y,z] array and then checked it using a switch statement.

Better.

Try this one.

Attached: tiny amino.png (791x305, 18K)

Don't get cocky.

>The first mark of a programmer is their ability to quickly automate.
>writes script to generate 1,000 dependencies for a web page
>"I programmer now."
>t. Pajeet

Guarantee this guy also shitposts about how CS students are brainlets.

Attached: 51OIRoxklRL.jpg (500x500, 47K)

No comments 0/10

>t. Doesn't understand either but acts like the psuedo-intellectual that he is
Back to plebbit with you.

hastebin.com/adejefafix.cpp
glorious C implementation arrives!

good enough. I don't see how one can improve it (that is make it more readable)

Who cares, it's a bunch of integers, boo hoo. The code is now readable by humans tho.

10/10 just werks™

I see a lot of people are in favor of the massive if statement block.

If you wanted to go with that for ((muh readability)) wouldn't it still be better to branch the if statements? That would be more efficient and you could even break the function after it finds the correct permutation.

if x==1:
if y==2:
...
if x==2:
if y==1:
...

Attached: 1542068544425.jpg (514x530, 27K)

Jamie, you are fired. I didn't hire you to publish my work online and ridicule me on sites like this.

You can get your things Monday 7th.

if x==1:

:0

Guy who wrote the program here.

It's a program that randomly generates an amino acid sequence. One codon at a time, the peptide bond chain is generated.

There are four nucleotides. A codon is composed of three nucleotides. Therefore, there are 64 unique codons.

There are 19 amino acids and 1 imino acid. For simplicity, it's said there are 20 amino acids. Each codon generates one amino acid.

The program I created assumes all codons have an equal probability of being generated. Three codons are stop codons. The program terminates when a stop codon is generated.

Now, the next logical step is to create a program that randomly generates an alpha helix or beta-pleated sheet. However, to do this, I need to know which sequences of amino acids fold into an alpha helix and which peptide bond chains fold into a beat-pleated sheet.

I've read many books about proteins and peptides, nanotechnology, and molecular biology but no book has provided the necessary information. So I'm wondering: is there a book or database which provides a list of amino acid sequences which fold into an alpha helix or beta-pleated sheet?

If not all possible configurations have been tested, is there at least conjecture which would be helpful? For example, suppose polar amino acids tend to fold one way. Suppose cystine tends to make the the polypeptide chain fold another way. Suppose the size of the amino acid also determines which of the two possible secondary protein structures form.

Note, the only type of structure I'm interested in right now is the secondary structure. Different rules apply to how polypetide chains fold in protein domains, tertiary structures, and quaternary structures.

Attached: 1512950174697.jpg (222x293, 19K)

as I said before what you have is simply a lookup table with a set number of permutations based on 3 parameters.

so if you wanna use your current logic then you could still branch the if statements by the shared x, y, and then z values if the compiler isn't already doing that for you.

the other suggestions like storing the table as an array is pretty gud

the other suggestions like storing the names as lowercase and then calling an uppercase method is dumb

you really going to fire Jaimie over this?

He's complaining about how slow it is in comparison to if/else statements when what he is doing is absolutely retarded.
Instead of giving the application a filled data structure so that it has it at the moment it runs, it has an empty data structure and fills it while it is running.
Why do you think one is slower than the other?

Look at one of the many pseudocode alternatives.

Doesn't work, there is a bug that I have pointed out.

Fix your damn bug.

>Look at one of the many pseudocode alternatives.
yeah, I guess this would be the way to go then?

At least for the readability part (and maybe better performance too)

Attached: images.png (211x239, 9K)

Slightly better. Pretty simple but not elegant, will be fast and should be easier to spot mistakes.

you know about this? I don't know what you are talking about but it might be relevant

fold.it/portal/

Why are you niggers so concerned about performance? This is probably a script the guy will run once after he gets it working the way he wants.

fuck off stupid faggot

Attached: 1542290494180.png (700x700, 658K)

>codegolf

I don't know how it is anywhere else, but there is not a single coding related course in our molecular-/microbiology curriculum. Those skills are usually handed down via: "Hey, I know you're very busy with your masters thesis, but can you teach that bachelor guy Python?" I imagine OP is the result of something similar.

Then again, there are BioInfo people who could not outline the central dogma of molecular biology if their life depended on it.

>Why are you niggers so concerned about performance?
It's not so much about performance but more about readability and efficiency in creation.
I mean, I have already pointed out in this thread a mistake in that block of code that will result in garbage output. Can you find it without finding my post first?

One of the problems you have to deal with in programming is ensuring the output you are getting is what you SHOULD BE getting. The fact that it "works" can be completely irrelevant.
Making your code as easy as possible to review so you can check it will do what you want is a desirable aspect. It saves YOU time and it can save you a lot of trouble if somewhere down the line you have to come back and work out where you are getting garbage data from that's screwing up your later work.

I agree completely.

0 separation between code and data out of 10