Python 3 DNA Concensus Sequence
up vote
-5
down vote
favorite
It's just I have a project for my programming class that requires me to create a Python program that reads DNA sequences from an input file and generates a consensus sequence. I already made a function to open and store the data from the file. What I'm struggling with is to loop over the letters from the sequences to count the nucleotides from each column of each sequence. I was told to use nested loops to process every character in every sequence. I was also recommended this: Use outer loop for columns (characters) and inner loop for rows (sequences) here is my code so far in he image I provided (BTW the file name does not appear because I'm not supposed to prompt the user for a file, the program is designed to try to open a specific file)
python python-3.x python-2.7 python-3.7
add a comment |
up vote
-5
down vote
favorite
It's just I have a project for my programming class that requires me to create a Python program that reads DNA sequences from an input file and generates a consensus sequence. I already made a function to open and store the data from the file. What I'm struggling with is to loop over the letters from the sequences to count the nucleotides from each column of each sequence. I was told to use nested loops to process every character in every sequence. I was also recommended this: Use outer loop for columns (characters) and inner loop for rows (sequences) here is my code so far in he image I provided (BTW the file name does not appear because I'm not supposed to prompt the user for a file, the program is designed to try to open a specific file)
python python-3.x python-2.7 python-3.7
5
Don't post pictures of code.
– khelwood
Nov 7 at 20:55
4
Hi, welcome to StackOverflow. Since you're new, check out the help center. Questions should provide all relevant code as formatted text in the question itself. Links to code, especially links to images of code, are not useful. Please edit your question to address this. Thanks.
– juanpa.arrivillaga
Nov 7 at 20:55
1
Welcome to StackOverflow. Please read and follow the posting guidelines in the help documentation, as suggested when you created this account. Minimal, complete, verifiable example applies here. We cannot effectively help you until you post your MCVE code and accurately describe the problem. We should be able to paste your posted code into a text file and reproduce the problem you described.
– Prune
Nov 7 at 21:04
add a comment |
up vote
-5
down vote
favorite
up vote
-5
down vote
favorite
It's just I have a project for my programming class that requires me to create a Python program that reads DNA sequences from an input file and generates a consensus sequence. I already made a function to open and store the data from the file. What I'm struggling with is to loop over the letters from the sequences to count the nucleotides from each column of each sequence. I was told to use nested loops to process every character in every sequence. I was also recommended this: Use outer loop for columns (characters) and inner loop for rows (sequences) here is my code so far in he image I provided (BTW the file name does not appear because I'm not supposed to prompt the user for a file, the program is designed to try to open a specific file)
python python-3.x python-2.7 python-3.7
It's just I have a project for my programming class that requires me to create a Python program that reads DNA sequences from an input file and generates a consensus sequence. I already made a function to open and store the data from the file. What I'm struggling with is to loop over the letters from the sequences to count the nucleotides from each column of each sequence. I was told to use nested loops to process every character in every sequence. I was also recommended this: Use outer loop for columns (characters) and inner loop for rows (sequences) here is my code so far in he image I provided (BTW the file name does not appear because I'm not supposed to prompt the user for a file, the program is designed to try to open a specific file)
python python-3.x python-2.7 python-3.7
python python-3.x python-2.7 python-3.7
edited Nov 7 at 22:09
SPYBUG96
4411522
4411522
asked Nov 7 at 20:52
Fernando Bermúdez
11
11
5
Don't post pictures of code.
– khelwood
Nov 7 at 20:55
4
Hi, welcome to StackOverflow. Since you're new, check out the help center. Questions should provide all relevant code as formatted text in the question itself. Links to code, especially links to images of code, are not useful. Please edit your question to address this. Thanks.
– juanpa.arrivillaga
Nov 7 at 20:55
1
Welcome to StackOverflow. Please read and follow the posting guidelines in the help documentation, as suggested when you created this account. Minimal, complete, verifiable example applies here. We cannot effectively help you until you post your MCVE code and accurately describe the problem. We should be able to paste your posted code into a text file and reproduce the problem you described.
– Prune
Nov 7 at 21:04
add a comment |
5
Don't post pictures of code.
– khelwood
Nov 7 at 20:55
4
Hi, welcome to StackOverflow. Since you're new, check out the help center. Questions should provide all relevant code as formatted text in the question itself. Links to code, especially links to images of code, are not useful. Please edit your question to address this. Thanks.
– juanpa.arrivillaga
Nov 7 at 20:55
1
Welcome to StackOverflow. Please read and follow the posting guidelines in the help documentation, as suggested when you created this account. Minimal, complete, verifiable example applies here. We cannot effectively help you until you post your MCVE code and accurately describe the problem. We should be able to paste your posted code into a text file and reproduce the problem you described.
– Prune
Nov 7 at 21:04
5
5
Don't post pictures of code.
– khelwood
Nov 7 at 20:55
Don't post pictures of code.
– khelwood
Nov 7 at 20:55
4
4
Hi, welcome to StackOverflow. Since you're new, check out the help center. Questions should provide all relevant code as formatted text in the question itself. Links to code, especially links to images of code, are not useful. Please edit your question to address this. Thanks.
– juanpa.arrivillaga
Nov 7 at 20:55
Hi, welcome to StackOverflow. Since you're new, check out the help center. Questions should provide all relevant code as formatted text in the question itself. Links to code, especially links to images of code, are not useful. Please edit your question to address this. Thanks.
– juanpa.arrivillaga
Nov 7 at 20:55
1
1
Welcome to StackOverflow. Please read and follow the posting guidelines in the help documentation, as suggested when you created this account. Minimal, complete, verifiable example applies here. We cannot effectively help you until you post your MCVE code and accurately describe the problem. We should be able to paste your posted code into a text file and reproduce the problem you described.
– Prune
Nov 7 at 21:04
Welcome to StackOverflow. Please read and follow the posting guidelines in the help documentation, as suggested when you created this account. Minimal, complete, verifiable example applies here. We cannot effectively help you until you post your MCVE code and accurately describe the problem. We should be able to paste your posted code into a text file and reproduce the problem you described.
– Prune
Nov 7 at 21:04
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53197635%2fpython-3-dna-concensus-sequence%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
5
Don't post pictures of code.
– khelwood
Nov 7 at 20:55
4
Hi, welcome to StackOverflow. Since you're new, check out the help center. Questions should provide all relevant code as formatted text in the question itself. Links to code, especially links to images of code, are not useful. Please edit your question to address this. Thanks.
– juanpa.arrivillaga
Nov 7 at 20:55
1
Welcome to StackOverflow. Please read and follow the posting guidelines in the help documentation, as suggested when you created this account. Minimal, complete, verifiable example applies here. We cannot effectively help you until you post your MCVE code and accurately describe the problem. We should be able to paste your posted code into a text file and reproduce the problem you described.
– Prune
Nov 7 at 21:04