дядя Боря
kiwifarms.net
- Joined
- Mar 21, 2019
Have you considered suicide?
I have, I think that everyone else should totally do it, perhaps on the same day, soon.
zomg, programmer born with a vagina! It's a mirage!
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Have you considered suicide?
I think you should go outside from time to time.I have, I think that everyone else should totally do it, perhaps on the same day, soon.
zomg, programmer born with a vagina! It's a mirage!
>some bullshit here
MAARTHCSWERPLMKDE
>some more bullshit here
MTSWEDFHGIPEEDVMQ
>some more more bullshit here
MKRTYQVPLYIGEQASMNDE
...
...
...
>header
(Sequence of amino acids or nucleic acids)
M: 4533
Q: 5654
V: 3229
etc.
If line.startswith('>'):
continue
How to print the number of instances of a letter in a FASTA file (by populating a dictionary).I'm sorry, was there a question in there? Or were you just journaling?
Fair enough, I did tinker with my own code. Here's what I have so far.Okay, and which part are you struggling with? Reading the file? Populating the dictionary? Printing the output?
Or do you just want us to do do your homework for you? Questions like that tend not to go over well on programming-related forums.
#Specify the FASTA file to use.
#Version 7: Altered indentation of second for loop.
fasta = open("./fakefasta.faa")
counts = {}
for line in fasta:
if line[0] == ">":
continue
for aa in line:
if aa not in counts:
counts[aa] = 1
else:
counts[aa] += 1
print(counts)
{'M': 5, '\n': 7, 'I': 10, 'W': 2, 'G': 15, 'P': 9, 'S': 8, 'L': 50}
#Specify the FASTA file to use.
#Version 11.03: Altered value in last print statement to become a str.
fasta = open("./fakefasta.faa")
counts = {}
for line in fasta:
if line[0] == ">":
continue
for aa in line.rstrip("\n"):
if aa not in counts:
counts[aa] = 1
else:
counts[aa] += 1
for key, value in counts.items():
print(key +": " + str(value))
M: 5
I: 10
W: 2
G: 15
P: 9
S: 8
L: 50
Without seeing your input, it looks like your code is working. Again, did you have a question? If so, please be specific.Now, to evaluate this script I used an input file where the ">" line is a descriptive sentence followed by the exact sequence. That is, the first sequence in the FASTA is called "five methionines" and immediately below it is 5x M's.
Incoming wall of text. Please bear with me; it'll be worth it.What is the general courtesy in the professional world for git commits? For personal projects I usually use a shitload of commits basically like you would save in a video game and push commits for one line code changes because I do want to try to keep records of what I'm actually doing, I'm on my first professional job and asked the lead developer about this and offered to squash commits but he seemed to not care, though I put in a merge request for like a 50 commit branch and I think he's a bit cranky about it.
git bisect start
, then check out that commit form two weeks ago and do git bisect good
, then you check out HEAD and do git bisect bad
. Now git will automatically check out a commit right in the middle between the good and bad commits. You test the code and see if the bug is there at that commit, and run git bisect good
or git bisect bad
accordingly. Depending on your answer, git will again choose a commit halfway between the latest bad and the earliest good commit, so you test again, and so on, until you and git eventually narrow down exactly which commit introduced the bug. From there you can look at the diff for that commit and shame the person that committed it and (or, if it was you, quickly fix it before anybody else notices).git bisect skip
, but you'll end up with worthless or inconclusive results if you end up having to do that often while bisecting.)Thanks for the informative response, I still like to commit bullshit like "Halfway done (untested)" at the end of the day but it sounds like it's a good idea to at least squash those before I push them.snip
People often say there's a huge market for coders who can write in legacy languages like COBOL, how long is that going to be the case? I understand it's a herculean task but I would figure all the banks and government departments that run on that stuff would want to update to something newer eventually.I mostly use C++ for many projects, but I have a thing for writing programs in dead programming languages such as Cobal, and Fortran.
I just like messing around with old useless shit. But doesn't the government have a track record for being out of touch and inefficient?Thanks for the informative response, I still like to commit bullshit like "Halfway done (untested)" at the end of the day but it sounds like it's a good idea to at least squash those before I push them.
We are doing pull requests, he mentioned that it's harder to comment on code when there's a bunch of commits but I don't really get how so I wonder if he has some other bug up his ass or if I'm just being self conscious
People often say there's a huge market for coders who can write in legacy languages like COBOL, how long is that going to be the case? I understand it's a herculean task but I would figure all the banks and government departments that run on that stuff would want to update to something newer eventually.
People often say there's a huge market for coders who can write in legacy languages like COBOL, how long is that going to be the case? I understand it's a herculean task but I would figure all the banks and government departments that run on that stuff would want to update to something newer eventually.
I just like messing around with old useless shit. But doesn't the government have a track record for being out of touch and inefficient?
#!/usr/bin/python3
vowels = ["a", "e", "i", "o", "u"]
punct = ["!", "'", '"', ".", ",", "?", ";", "-", ":"]
number = [n for n in range(0,9)]
word = input("Please enter a string. \n")
for i in word:
if i.lower() in vowels:
print(i + " is a vowel.")
elif i == " ":
continue
elif i in punct:
print(i + " is a punctuation mark.")
elif i in str(number):
print(i + " is a number.")
else:
print(i + " is a consonant.")
Please enter a string.
A 3-balled tomcat.
A is a vowel.
3 is a number.
- is a punctuation mark.
b is a consonant.
a is a vowel.
l is a consonant.
l is a consonant.
e is a vowel.
d is a consonant.
t is a consonant.
o is a vowel.
m is a consonant.
c is a consonant.
a is a vowel.
t is a consonant.
. is a punctuation mark.