Questions tagged [dna]

The tag has no usage guidance.

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

Pset6 DNA Not matching to names in the database

The print statements seem to turn out what I hoped for up until trying to compare the STR counts to the database STR counts. I would just appreciate any pointers of where I'm going wrong thanks. ...
0
votes
1answer
223 views

Pset6 DNA help - trouble calculating STR repeats with long database

I have really tried to just solve this one myself but after a few weeks this seems futile without guidance. I am having trouble getting a for loop to calculate the maximum consecutive occurrences of ...
0
votes
1answer
61 views

Desperately need help with DNA Python! please help!

Desperately need help with my DNA python code. I get the correct sequence printed out but I can't seem to find a working comparison code. Please someone take a look: https://pastebin.com/DCdxtxMx
0
votes
1answer
57 views

Help with Python DNA!

Here is the code I have an issue with: https://i.ibb.co/0VrvCqj/code2.jpg It works for small databases but not the big ones. Here the code works and shows Albus when it should show Lavander. As you ...
0
votes
0answers
45 views

How can I compare 2 dataframes on DNA?

obtained 2 data frames but I really don't know how can I compare them. Do you have any ideas? ~/pset6/dna/ $ python dna.py databases/small.csv sequences/1.txt name AGATC AATG TATC 0 0 4 1 ...
0
votes
1answer
144 views

PS6 - DNA (Python) Weird problem counting STRs

Which part of the problem are you working on? I am at a very early stage of the problem, trying to scan a specific sequence for STRs, counting how many times they show up and storing this count as a ...
0
votes
1answer
105 views

Else is ruining my code in dna and I don't get why

I'm trying to record the longest run of each STR I need and I'm close. Without the final "else" the code works fine with small dictionary and almost fine with long (because the count I ...
0
votes
1answer
416 views

PSET6: DNA returns "no match"

import csv import sys def maxrepeats(sequences, substring): # calculate maximum consecutive frequency for each STR repeats = [0] * (len(sequences)+1) for i in range(len(sequences)-len(...
0
votes
1answer
100 views

pset6 DNA - range() not working as expected

DNA was a breeze until I got to the part where I have to check the dna sequences for patterns. Regardless of wich file I pass to the program it always detects only 1 repetition for every pattern. ...
0
votes
1answer
195 views

PSet 6: DNA gives correct as well as wrong ouput

Problem Set 6: DNA gives output No Match No Match No Match No Match No Match No Match No Match No Match No Match No Match Lavender No Match No Match No Match No Match No Match No Match No Match No ...
0
votes
0answers
111 views

DNA is good for the small database but not for the large database - CS50 Pset6

I'm currently developing the small and the large database functions separately and I wonder why in the large one it does not keep track of the STR repetitions. Here is my code from both functions: ...
0
votes
0answers
92 views

Need help with Iteration & Compare DNA - CS50

I need help building code to iterate through the DNA sequence and then compare it with Names in CSV. Can anyone please guide me on how to proceed from the code written below with proper comment ...
0
votes
1answer
94 views

Python pset6 - should a file be closed at the end of the program or in the middle?

I'm slowly working through DNA on pset6 and I am running into some issues with the opening/closing of CSVs. I open the CSV using with open(database, "r") as csv_file: csv_reader = csv.DictReader(...
0
votes
1answer
427 views

Kind of lost in pset6 dna, How to compare the max number of occurrences of the STR's with the database?

I'm kind of lost I don't know how I can compare the max number of occurrences with the database. My program here can get the max number of it stored in a list called counts to get it I used a function ...
0
votes
1answer
127 views

pset6 DNA: check50 ran into an error while running checks! at checking 'dna.py exists!'

The code runs for all 20 sequences on the terminal but during submit50/check50, it runs into an error with the following log: the code is attached for reference. import csv import sys if __name__ ==...
0
votes
2answers
110 views

cs50 pset6 takes too long to run

I am trying to improve my code for pset6, it works but currently takes a few minutes for the larges files. Can I get some help as to how to improve performance? from sys import argv, exit import csv ...
0
votes
1answer
214 views

My DNA code works with the small database but not the large one

My code works perfectly fine with the small database but gives "No Match" for the large one and I can't figure out why. Any help would be appreciated! import csv from sys import argv, exit def main()...
0
votes
1answer
394 views

PSET 6 DNA.py wrong output [spoiler]

I am a beginner in cs50 and I have a problem with the DNA problem that gives the wrong result for most of the queries. I wonder if anyone could point where is the mistake. ie. python dna.py databases/...
0
votes
1answer
2k views

cs50 pset 6 DNA. How to compare my results with the databse to print out the answer?

I got to a point in this problem where my code was working alright for the small csv, but it was clumsy and repetitive, so I tried to make it more elegant by making more complicated nested loops to ...
0
votes
1answer
650 views

pset6 DNA. My code passes all tests but this one: python dna.py databases/large.csv sequences/18.txt

from sys import argv, exit import pandas as pd # Checks if the number of files is correct if len(argv) != 3: print("Usage: python dna.py data.csv sequence.txt") exit(1) # Reads the text file ...
0
votes
0answers
2k views

PSET6 DNA need some help and hints

I started to do DNA and I dont't have any idea what to do next. Having done the first part with opening a file and checking command line I don't know how to check number of repetitions. I tried to use ...
0
votes
1answer
172 views

cs50 pset6 dna error while reading two file 8.txt and 9.txt

import sys import csv AATG, GATA, TATC, TCTG, AGATC, GAAA, TCTAG = 1, 1, 1, 1, 1, 1, 1 TTTTTTCT = 1 temp = 0 if int(len(sys.argv)) > 3 or int(len(sys.argv)) < 3: print("Usage: python dna.py ...
0
votes
1answer
305 views

My code solves for small csv but not for large. Could you guys help?

import csv from sys import argv if len(argv) != 3: print("Usage: python dna.py arg1.csv arg2.txt") exit(1) database = open(argv[1]) sequence = open(argv[2]) s = sequence.read() csv = csv....
0
votes
1answer
903 views

Pset6: DNA - Check50 timeout

tl;dr: Code seems to run perfectly, check50/Submit50, however, is timing out before a response is provided. I have manually checked all test cases provided on the Pset page: small.csv 1.txt through ...
0
votes
1answer
913 views

PSET6 - DNA - Code fails to compare STRs to DNA text file

I have updated my code after making a number of amendments but am still a bit stuck! I don't think my STR_check_count is working properly as it always seems to return 0s and I'm also not sure if I'm ...
0
votes
1answer
712 views

PSET6 DNA Sumbit50 not matching with usual output

Hello, After a lots of effort I was finally able to implement DNA and it works correctly ! but Submit50 shows correct output for text file (1-5) but incorrect for rest The text file which have ...
0
votes
1answer
66 views

DNA pset6 My code works fine in small csv, but not large (Spoiler)

The problem happens with the count when i try to count STRs, it counts some str right and some wrong, which is strange for me, and when i deal with small csv all works fine. can someone help me in ...

1
2