This is a test version of Biostars. For the public version, visit https://www.biostars.org.
IndexError in nucAlign[p][k]
    enter code h t = open("CodonUsage.txt","r")
    N=0
    c=t.read(1)
    while(c!='\n'):
        N+=1
        c=t.read(1)
    #print(N)
    #print("\t")
    #print(N)
    t.close()
    print(N)

    N1 =11
    nucCount=([[0 for i in range(N)]for j in range(5)])
    g=0
    nucAlign=([['\0' for i in range(N)]for j in range(N1)])
    t = open("CodonUsage.txt","r")
    p=0

    #print(c)
    counter=[0  for i in range(10) ]
#    for i in range(10):
#        counter[i]=0
#        
    c=t.read(1)
    while(c!=''):
        k=0

        while(c!='\n'):

                nucAlign[p][k]=c

            #print(p,k,c)
            if  c=='T' or c=='u' or c == 't' or c=='U':
                nucCount[0][k] +=1
                #counter[p] +=1
            elif  c=='c' or c=='C' :
                nucCount[1][k] +=1
                #counter[p] +=1

            elif  c=='a' or c=='A':
                nucCount[2][k] +=1
                #counter[p] +=1

            elif  c=='g' or c=='G':
                nucCount[3][k] +=1
                #counter[p] +=1

#            else:
#                nucCount[4][k] +=1
                #counter[p] +=1
            c=t.read(1)
            k +=1

        p +=1

        c=t.read(1)ere
alignment blog

This is a Q&A board. Your post does not contain a question.

Hello wingsoffire72!

We believe that this post does not fit the main topic of this site.

Closed until OP elaborates on their question.

For this reason we have closed your question. This allows us to keep the site focused on the topics that the community can help with.

If you disagree please tell us why in a reply below, we'll be happy to talk about it.

Cheers!

0 answers

No answers yet.

Log in to answer this question.