Questions tagged [pset6-dna]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
63 views

DNA Week 6 | Issues

I have been working on this DNA problem for a while now, and I do not understand what causes the many problems. Right now there are just some technical problems, for example saying "No match"...
Berra Eylül Toprak's user avatar
0 votes
1 answer
22 views

My code look correct and work correctly for all other sequence but check50 says sequence/18 is wrong, expected "No match" not harry

import csv import sys global y def main(): y = 0 x = 0 t = 0 # Check for command-line usage if len(sys.argv) != 3: sys.exit("Usage: python dna.py data.csv sequence....
Michael's user avatar
0 votes
1 answer
23 views

PSET6 DNA storing STR subsequences in a dictionary

I am working on one of the TODOs where the longest match of each short tandem repeat (STR) needs to be found from the DNA sequence read—written as just "sequence" in this code. To check ...
Jae-Min's user avatar
0 votes
1 answer
21 views

PSET 6 - DNA - Checking the equality of STRs

This is my loop to check the equality of STR counts, csv list is a list storing data of the csv file and STRlist is a list storing all the STRs. It prints the wrong name, I guess it has something to ...
Ronit Kumar Singh's user avatar
1 vote
1 answer
257 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 ...
ITz_tact1cz's user avatar
1 vote
1 answer
966 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[...
Prateek Chaturvedi's user avatar
2 votes
1 answer
2k 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: ...
TomOrrow's user avatar
0 votes
1 answer
78 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 ...
Eystein Thanisch's user avatar
0 votes
1 answer
61 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 ...
Kley Halisson's user avatar
0 votes
1 answer
100 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 """...
Agnij Moitra's user avatar
1 vote
1 answer
63 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 ...
user13641095's user avatar
0 votes
1 answer
109 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 ...
Orbey Paltaci's user avatar
0 votes
1 answer
172 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 ...
Raghav Gupta's user avatar
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 ...
M-J -Y's user avatar
  • 1
0 votes
1 answer
124 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) ...
Anon's user avatar
  • 5
0 votes
1 answer
24 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 ()
Olhuwhorlhey's user avatar
0 votes
1 answer
109 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", "...
James Olivier's user avatar
0 votes
1 answer
174 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 ...
Jaime's user avatar
  • 15
0 votes
3 answers
133 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(...
user avatar
0 votes
1 answer
99 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 ...
dillon__nguyen's user avatar
0 votes
1 answer
163 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 ...
andream's user avatar
  • 109