Questions tagged [pset6-dna]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
21 views

How to get the index of iteration from the 'for' loop?

I've been trying to solve pset6 (DNA in specific). I finished all of its parts but stuck on the part of comparing two lists. A list of lists containing the STR repetitions of each person (sth like ...
0
votes
0answers
13 views

Pset6 [DNA] . Works when I check by hand, but doesn't correctly identify names with check50.(doesn't return anything)

import sys import csv def main(): if len(sys.argv) != 3: print("Should be 3 command-line arguments ") sys.exit(1) with open(sys.argv[2], 'r') as f: for line ...
0
votes
1answer
29 views

What does "consecutively" mean in pset6 DNA?

I am working on pset6 DNA and I'm not sure I understand the terms of the problem. The objective is to write a program that matches a DNA sequence to a person in a DNA database based on the largest ...
0
votes
1answer
26 views

Pset6 DNA. How to use a list in re.findall?

In pset6 DNA I'm using re.findall to find the nucleotides sequences but I'm only hardcoding the keys like this: re.findall(r'(?:TATC)+', sequence) So it's not working in the "large" database ...
0
votes
0answers
7 views

Week 6: DNA, variable not updating properly

So this is code: import sys import csv if len(sys.argv) != 3: sys.exit("Incorrect number of arguments.") #Load STR, and suspect's info into lists STRs = {} suspects = [] with open(sys....
0
votes
1answer
63 views

DNA Max Sequence Bug | Working on small.csv but not on large.csv

This is the complete code: """ - open csv file and sequence , read contents - for each str, compute longest chain - compare str counts aganist ech row in csv file """...
1
vote
1answer
40 views

DNA: Excluding a column from my dict iteration

Logic: I'm trying to do this in such a way that I check the database first, then I check the DNA sequence to see if that information corresponds to any of the information in my database. I want to ...
0
votes
1answer
76 views

Pset 6 - Dna - My outputs are slightly incorrect. Could someone help me figure out what might be the problem here?

I've been stuck on this question for a week. After countless hours of debugs, I decided to post it here. Please refer to images and code snippets below and kindly explain to me what might be the ...
0
votes
1answer
72 views

Minor change in pset6/dna required, need some help or hint

I am really really close to completing pset/dna. But there seems to be some problem in the 'if statement'. Somebody please guide. Before the line of underscores in the terminal, I have printed the ...
0
votes
1answer
52 views

PSET6 DNA Think I'm getting an infinite loop which is apparent when testing with every txt file after 4.txt

Hi all I'm having trouble for PSET6 DNA. My code works fine for everything up until and including 4.txt but whenever I go to check the large.csv file and thus 5.txt, 6.txt, 7.txt and so on I seem to ...
0
votes
1answer
68 views

pset6 - DNA - works for small.csv but not large.csv

import csv import sys with open(sys.argv[1], 'r') as file: # stores data from small.csv in both dict and list form dna_names_dict = csv.DictReader(file) ...
0
votes
1answer
20 views

Index to integer

How do i convert an index to an integer? I tried int(index), that didnt work. For example; S = [a,b,c,d] For index in S: n = int(index) print (n) break print ()
0
votes
1answer
49 views

check50 gives different output than my own for "18.txt" sequence. All others pass. Any thoughts/suggestions are appreciated

from sys import argv import csv import re # Only run if argc is 3 if len(argv) == 3: STRs = ["AGATC", "TTTTTTCT", "TCTAG", "GATA", "TATC", "...
0
votes
0answers
54 views

CS50 PSET 6 DNA Just Returns First Name

I've been working on DNA for a while now and thought I was done, but there's a problem with my code. Everytime I run it, the program just prints the first name on the database, so either 'Albus' or '...
0
votes
1answer
143 views

PSET 6 DNA - Computing STRs

I am trying to compute the most repeated STR for each sequence in a dictionary called str_dict. # compute STRs i = 0 # stablish length of the sequence length_seq = len(sequence) # iterate through all ...
0
votes
3answers
71 views

Program for dna not printing anything

I have written a program for DNA, but it's not printing anything. Code: import csv from sys import * if len(argv) != 2: print("Usage: python dna.py data.csv sequence.txt") def maxcount(...
0
votes
1answer
91 views

Computing consecutive STR is sometimes off by a little (Spoiler!)

My code works fine for the small csv file; however, when I get to the big csv file, my counts for the number of consecutive STR are less than the actual value by about 1 or 2. Here is my code: import ...
0
votes
1answer
130 views

pset6 count STR in the DNA sequence issues

so i m a bit confused...i have been testing my code using the small database and what i have so far produced what i expected .... more specifically the STRcounts (i marked that part #?????). it is ...