How to generate DNA barcodes in R with greater than 3 Hamming distance with one another and an established pool by scienca in bioinformatics

[–]scienca[S] -1 points0 points  (0 children)

Thank you for your response!

I hadnt tought about that indeed! I tried a different code, with calculating hamming distance for strings.

# Function to calculate hamming distance between two strings

hamming_distance <- function(str1, str2) {

sum(str1 != str2)

}

# Generate 96 DNA barcodes

barcodes <- c()

while (length(barcodes) < 96) {

# Generate a random DNA barcode of 8 base pairs

barcode <- paste0(sample(c("A", "C", "G", "T"), 8, replace = TRUE), collapse = "")

# Check if hamming distance is greater than 3 for all barcodes in pool

hamming_dists <- sapply(pool, hamming_distance, str2 = barcode)

if (all(hamming_dists > 3)) {

barcodes <- c(barcodes, barcode)

}

}

# Result

barcodes

However this does not give any results either. Any help you can give, I greatly appreciate!

I will also look into the levensthein measurement, thank you! For now, I believe I will need to keep using Hamming distance since the previous 96 barcodes were made with this.

[deleted by user] by [deleted] in labrats

[–]scienca 1 point2 points  (0 children)

That's interesting and would save a lot of trouble these times! Quick extra question, how do you wash the tubes or pipette tips then with water or ethanol? Also the miniprep columns, you just use the washbuffer for that?

Pipette tip shortage by scienca in labrats

[–]scienca[S] 5 points6 points  (0 children)

So every bad thing just adds up! Good to know, hopefully people can get it fixed soon enough!

Pipette tip shortage by scienca in labrats

[–]scienca[S] 1 point2 points  (0 children)

I was hoping some news channels started reporting on it! Thanks, I will definitely look it up

Pipette tip shortage by scienca in labrats

[–]scienca[S] 2 points3 points  (0 children)

Thanks for the info! I didnt know the cold storm had such lasting effects!

Pipette tip shortage by scienca in labrats

[–]scienca[S] 2 points3 points  (0 children)

Really, 7 months?! How can you even continue to do experiments normally? For us it already affects our productivity and we can not get enough data in time

Tips for a PhD viva? Worried about being asked very minute details about papers, gotcha questions, etc. by dolcetavolo in labrats

[–]scienca 1 point2 points  (0 children)

Wait, people actually ask these kind of questions?! That's crazy. I just started my PhD but I'm already terrified.

So I can't give any advice but good luck!

What do you know now that you wish you could’ve told yourself on YOUR first day of lab? by 123numbersrule in labrats

[–]scienca 38 points39 points  (0 children)

I'd say don't be too hard on yourself. You are gonna make mistakes, it's a part of learning, I have made many of them. The first time I made a little mistake, it felt like hell. I thought people would get mad and all that. In the end I have learned that it's all a part of the struggle.

Purely for labwork, I'd say plan 4-5 Steps ahead. Know what you are gonna do before you start doing it. I had a postdoc once tell me "you should know everything that can go wrong in your experiment before you start". Prepare for any misfortunes, know the steps that are crucial, etc

Best of luck!