Questions tagged [pset6-dna]

The tag has no usage guidance.

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

PSET6: DNA check50 expecting no match on txt18 ,but my program returns harry

my code works for all the other tests on check50 besides the one for txt18. I checked the Large.csv file and the return value of longest_match function (both provided by cs50) and they match up yet ...
1 vote
1 answer
95 views

cs50 dna pset6 2022. My code works on small database but not on large database

This is my solution to CS50 pset6 DNA problem in python. It works fine on small database but gives this traceback and error: File "E:\CS50x\pset6-dna\dna.py", line 35, in main STR_match[...
0 votes
0 answers
185 views

pset6 DNA problem with sequence 18

I have solved all the cases but sequences 18.txt always gives me "Harry" result but needs to have "No Match" result! I tried to debug but always the same results. Here is my code: ...
2 votes
1 answer
1k views

CS50 PSET6 DNA problem. Need advices to make my code more pythonic

I need some advises how i can improve my code and make it more pythonic. Cause i feel like my code is too long. This is my solution to cs50 DNA problem: import sys import csv if len(sys.argv) != 3: ...
0 votes
1 answer
65 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
1 answer
48 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
1 answer
84 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
1 answer
53 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
1 answer
97 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
1 answer
154 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
1 answer
75 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 ...
  • 1
0 votes
1 answer
105 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) ...
  • 5
0 votes
1 answer
22 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
1 answer
87 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
1 answer
169 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 ...
  • 15
0 votes
3 answers
95 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(...
's user avatar
0 votes
1 answer
97 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
1 answer
157 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 ...
  • 109