How to resolve the algorithm Bioinformatics/base count step by step in the AutoHotkey programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm Bioinformatics/base count step by step in the AutoHotkey programming language

Table of Contents

Problem Statement

Given this string representing ordered DNA bases:

Let's start with the solution:

Step by Step solution about How to resolve the algorithm Bioinformatics/base count step by step in the AutoHotkey programming language

Source code in the autohotkey programming language

test := "CGTAAAAAATTACAACGTCCTTTGGCTATCTCTTAAACTCCTGCTAAATGCTCGTGCTTTCCAATTATGTAAGCGTTCCGAGACGGGGTGGTCGATTCTGAGGACAAAGGTCAAGATGGAGCGCATCGAACGCAATAAGGATCATTTGATGGGACGTTTCGTCGACAAAGTCTTGTTTCGAGAGTAACGGCTACCGTCTTCGATTCTGCTTATAACACTATGTTCTTATGAAATGGATGTTCTGAGTTGGTCAGTCCCAATGTGCGGGGTTTCTTTTAGTACGTCGGGAGTGGTATTATATTTAATTTTTCTATATAGCGATCTGTATTTAAGCAATTCATTTAGGTTATCGCCGCGATGCTCGGTTCGGACCGCCAAGCATCTGGCTCCACTGCTAGTGTCCTAAATTTGAATGGCAAACACAAATAAGATTTAGCAATTCGTGTAGACGACCGGGGACTTGCATGATGGGAGCAGCTTTGTTAAACTACGAACGTAAT"
tek := 1, bases := " "
loop,parse,test
	{
	if (A_LoopField = "A")
		countA += 1
	else if (A_LoopField = "C")
		countC += 1
	else if (A_LoopField = "G")
		countG += 1
	else if (A_LoopField = "T")
		countT += 1
	if (mod(a_index,50) = 0)
		{
			bases .= a_index . " -> " . substr(test,tek,50) . "`n"
			tek += 50
		}
	}
MsgBox % bases "`nA: " countA "`nC: " countC "`nG: " countG "`nT: " countT "`nTotal = " countA+countC+countG+countT
ExitApp


  

You may also check:How to resolve the algorithm Copy a string step by step in the Modula-3 programming language
You may also check:How to resolve the algorithm Nonoblock step by step in the C programming language
You may also check:How to resolve the algorithm Towers of Hanoi step by step in the SETL programming language
You may also check:How to resolve the algorithm Generic swap step by step in the Sidef programming language
You may also check:How to resolve the algorithm System time step by step in the Oforth programming language