<jupyter_start><jupyter_text><NAME> Mini AssignmentCreate a DNA string of 10,000 characters and count the following: A,T, G, C, all combination of two characters, all combinations of three characters.<jupyter_code>L=[x for x in range (100)]
print(L)
import random as rn
R=[rn.choice(['A','B','C','D']) for i in range (100000)]
print(R)
import random as rn
R=[rn.choice(['A','T','G','C']) for i in range(10000)]
DNA=''.join(R)
DNA
DNA.count('AT'), DNA.count('AG'), DNA.count('AC'), DNA.count('TC'), DNA.count('TG'), DNA.count('TA'), DNA.count('GC'), DNA.count('GA'), DNA.count('GT'), DNA.count('TG'), DNA.count('CA'), DNA.count('CT'), DNA.count('CG')
import collections
C = collections.Counter(DNA)
print(C)
from itertools import permutations
from itertools import combinations
str_1='ATGC'#string is the list of characters
print(str_1) #also can be used str_1= ['A','T','G','C']
perm = [] #open empty list
for r in range(1,4):#range of start 1, to 4-1=3
    c = permutations(str_1,r)
    for i in c:
        el = ''.join(list(i)) # join all string of perm
        perm.append(el)
print(perm)
for each in perm:
    print(f'the number of {each} in DNA is {DNA.count(each)}')<jupyter_output>the number of A in DNA is 2559
the number of T in DNA is 2512
the number of G in DNA is 2465
the number of C in DNA is 2464
the number of AT in DNA is 616
the number of AG in DNA is 641
the number of AC in DNA is 636
the number of TA in DNA is 639
the number of TG in DNA is 594
the number of TC in DNA is 641
the number of GA in DNA is 621
the number of GT in DNA is 629
the number of GC in DNA is 605
the number of CA in DNA is 633
the number of CT in DNA is 629
the number of CG in DNA is 620
the number of ATG in DNA is 152
the number of ATC in DNA is 163
the number of AGT in DNA is 166
the number of AGC in DNA is 155
the number of ACT in DNA is 142
the number of ACG in DNA is 153
the number of TAG in DNA is 163
the number of TAC in DNA is 157
the number of TGA in DNA is 156
the number of TGC in DNA is 138
the number of TCA in DNA is 164
the number of TCG in DNA is 159
the number of GAT in DNA is 137
the number of GAC in DNA is 151
the number of GTA in DNA is 159
the number of GTC in DNA[...]<jupyter_text>This is the require result.<jupyter_code>#A Python program to print all#
#permutations using library function
from itertools import permutations
#Get all permutations of [1,2,3]
perm=permutations([1,2,3])
perm
#Print the obtained permutations
for x in list(perm):
    print(x)
#A Python program to print all## permutations of given length
from itertools import permutations
                    #Get all permutations of length 2
                    # and length 2
perm=permutations([1,2,3],2)
                    #Print the obtained permutations
for i in list(perm):
    print(i)<jupyter_output>(1, 2)
(1, 3)
(2, 1)
(2, 3)
(3, 1)
(3, 2)
{'fraction_non_alphanumeric': 0.10274454609429978, 'fraction_numerical': 0.05277973258268825, 'mean_word_length': 3.802364864864865, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '349613', 'license': 'MIT', 'n_tokens_mistral': 1072, 'n_tokens_neox': 929, 'n_words': 463, 'path': 'Home assignment 1.ipynb', 'repo_name': 'Deepen-npl/Home--assignment', 'size': '2854'}