Use python to find the fraction of Cs and Gs in the nucleotide records for your gene. If PyCrust is installed, use it by funding it with Spotlight (upper right hand corner of the desktop). To read a file, for example one named 'HumanG6PD.fasta' on the desktop, you would begin by typing f = file('/Users/lab_user/Desktop/HumanG6PD.fasta','r')
If it is a Fasta file, we don't care about the header line so we read that off first: f.readline()
Now to read the rest of the file into a string called 'bases' you could do: bases = f.read()
Lets close the file now: f.close()
We don't want to count extraneous characters such as newlines, so lets strip them out: bases = bases.replace('\n','')
Finally we can find the number of total bases, the number of Cs and Gs, and compute the fraction: total = len(bases)
CNumber = bases.count('C')
GNumber = bases.count('G')
CGfraction = float(CNumber + GNumber)/total
We have to force python to use floating point numbers instead of integers, since otherwise it would round the fraction down to 0.
Record the respective percentages.