Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

PCR simulations are wrong. #279

Closed
Koeng101 opened this issue Oct 19, 2022 · 8 comments · Fixed by #378
Closed

PCR simulations are wrong. #279

Koeng101 opened this issue Oct 19, 2022 · 8 comments · Fixed by #378
Assignees
Labels
bug Something isn't working high priority High priority - something is broken or missing that is critical for users or developers. intermediate Will take some time to fix
Milestone

Comments

@Koeng101
Copy link
Contributor

package main

import (
	"fmt"
	"github.com/TimothyStiles/poly/primers/pcr"
)

func main() {
	gene := "aataattacaccgagataacacatcatggataaaccgatactcaaagattctatgaagctatttgaggcacttggtacgatcaagtcgcgctcaatgtttggtggcttcggacttttcgctgatgaaacgatgtttgcactggttgtgaatgatcaacttcacatacgagcagaccagcaaacttcatctaacttcgagaagcaagggctaaaaccgtacgtttataaaaagcgtggttttccagtcgttactaagtactacgcgatttccgacgacttgtgggaatccagtgaacgcttgatagaagtagcgaagaagtcgttagaacaagccaatttggaaaaaaagcaacaggcaagtagtaagcccgacaggttgaaagacctgcctaacttacgactagcgactgaacgaatgcttaagaaagctggtataaaatcagttgaacaacttgaagagaaaggtgcattgaatgcttacaaagcgatacgtgactctcactccgcaaaagtaagtattgagctactctgggctttagaaggagcgataaacggcacgcactggagcgtcgttcctcaatctcgcagagaagagctggaaaatgcgctttcttaa"

	fragments, _ := pcr.Simulate([]string{gene}, 55.0, false, []string{"TATATGGTCTCTTCATTTAAGAAAGCGCATTTTCCAGC", "TTATAGGTCTCATACTAATAATTACACCGAGATAACACATCATGG", "CTGCAGGTCGACTCTAG"})

	// Now let's make sure it only amplified our target.
	fmt.Println(fragments[0])

}

Output:

TATATGGTCTCTTCATTTACACCGAGATAACACATCATGGATAAACCGATACTCAAAGATTCTATGAAGCTATTTGAGGCACTTGGTACGATCAAGTCGCGCTCAATGTTTGGTGGCTTCGGACTTTTCGCTGATGAAACGATGTTTGCACTGGTTGTGAATGATCAACTTCACATACGAGCAGACCAGCAAACTTCATCTAACTTCGAGAAGCAAGGGCTAAAACCGTACGTTTATAAAAAGCGTGGTTTTCCAGTCGTTACTAAGTACTACGCGATTTCCGACGACTTGTGGGAATCCAGTGAACGCTTGATAGAAGTAGCGAAGAAGTCGTTAGAACAAGCCAATTTGGAAAAAAAGCAACAGGCAAGTAGTAAGCCCGACAGGTTGAAAGACCTGCCTAACTTACGACTAGCGACTGAACGAATGCTTAAGAAAGCTGGTATAAAATCAGTTGAACAACTTGAAGAGAAAGGTGCATTGAATGCTTACAAAGCGATACGTGACTCTCACTCCGCAAAAGTAAGTATTGAGCTACTCTGGGCTTTAGAAGGAGCGATAAACGGCACGCACTGGAGCGTCGTTCCTCAATCTCGCAGAGAAGAGCTGGAAAATGCGCTTTCTTAAATGAAGAGACCATATA

Check here - https://pkg.go.dev/github.com/TimothyStiles/poly@v0.21.1/primers/pcr

TTATAGGTCTCATACTAATAATTACACCGAGATAACACATCATGG anneals to the beginning of the sequence, NOT TATATGGTCTCTTCATTTAAGAAAGCGCATTTTCCAGC. There is no reason why the beginning of the output sequence should be TATA

@TimothyStiles This is a fairly critical bug we should figure out.

@TimothyStiles TimothyStiles added the high priority High priority - something is broken or missing that is critical for users or developers. label Oct 19, 2022
@Koeng101
Copy link
Contributor Author

Sequence should be TTATAGGTCTCATACTAATAATTACACCGAGATAACACATCATGGATAAACCGATACTCAAAGATTCTATGAAGCTATTTGAGGCACTTGGTACGATCAAGTCGCGCTCAATGTTTGGTGGCTTCGGACTTTTCGCTGATGAAACGATGTTTGCACTGGTTGTGAATGATCAACTTCACATACGAGCAGACCAGCAAACTTCATCTAACTTCGAGAAGCAAGGGCTAAAACCGTACGTTTATAAAAAGCGTGGTTTTCCAGTCGTTACTAAGTACTACGCGATTTCCGACGACTTGTGGGAATCCAGTGAACGCTTGATAGAAGTAGCGAAGAAGTCGTTAGAACAAGCCAATTTGGAAAAAAAGCAACAGGCAAGTAGTAAGCCCGACAGGTTGAAAGACCTGCCTAACTTACGACTAGCGACTGAACGAATGCTTAAGAAAGCTGGTATAAAATCAGTTGAACAACTTGAAGAGAAAGGTGCATTGAATGCTTACAAAGCGATACGTGACTCTCACTCCGCAAAAGTAAGTATTGAGCTACTCTGGGCTTTAGAAGGAGCGATAAACGGCACGCACTGGAGCGTCGTTCCTCAATCTCGCAGAGAAGAGCTGGAAAATGCGCTTTCTTAAATGAAGAGACCATATA

@TimothyStiles
Copy link
Collaborator

@Koeng101 was this ever resolved?

@Koeng101
Copy link
Contributor Author

No. I fixed it in bioscript but not here. I'll port the fix when I get the chance.

@carreter
Copy link
Collaborator

What's the status of this? @Koeng101 need help with it?

@Koeng101
Copy link
Contributor Author

Yes, this is actually pretty high priority as well, and I should have fixed it earlier (and haven't used this part of poly since I haven't fixed it yet)

@carreter carreter added bug Something isn't working intermediate Will take some time to fix labels Sep 16, 2023
@carreter carreter added this to the v1.0 milestone Sep 23, 2023
@carreter
Copy link
Collaborator

Will take a crack at this as a break from #297 /administrative stuff.

@carreter carreter assigned carreter and unassigned Koeng101 and TimothyStiles Sep 23, 2023
@Koeng101
Copy link
Contributor Author

Great! This is very important.

carreter added a commit to carreter/poly that referenced this issue Sep 26, 2023
@carreter carreter mentioned this issue Sep 26, 2023
6 tasks
@carreter
Copy link
Collaborator

Sneaky little bug...

func generatePcrFragments(sequence string, forwardLocation int, reverseLocation int, forwardPrimerIndxs []int, reversePrimerIndxs []int, minimalPrimers []string, primerList []string) []string {
	var pcrFragments []string
	for forwardPrimerIndex := range forwardPrimerIndxs { // We were iterating over indexes of forwardPrimerIndxs rather than the values themselves, which is what we actually want!
		minimalPrimer := minimalPrimers[forwardPrimerIndex]
		fullPrimerForward := primerList[forwardPrimerIndex]
		for _, reversePrimerIndex := range reversePrimerIndxs {
			fullPrimerReverse := transform.ReverseComplement(primerList[reversePrimerIndex])
			pcrFragment := fullPrimerForward[:len(fullPrimerForward)-len(minimalPrimer)] + sequence[forwardLocation:reverseLocation] + fullPrimerReverse
			pcrFragments = append(pcrFragments, pcrFragment)
		}
	}
	return pcrFragments
}

@carreter carreter moved this from Todo to In Progress in poly development roadmap Sep 26, 2023
TimothyStiles pushed a commit that referenced this issue Sep 26, 2023
@github-project-automation github-project-automation bot moved this from In Progress to Done in poly development roadmap Sep 26, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working high priority High priority - something is broken or missing that is critical for users or developers. intermediate Will take some time to fix
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants