Solved

# calculate and plot the percentage....

Posted on 2009-03-30

Consider a sequence below...

ATGCATGCCTTGCCGGCCTATA

The user should enter the window size ranges from 10 - 20000 in HTML

Suppose if the user has entered 10 and pressed the enter button ....

then GC% must be calculated ...

For 10 take first 10 alphabets in sequence...i.e., ATGCATGCCT Here it contains 2 G's and 3 C's

so total GC's is 5 i.e, 5/10 so GC% is 0.5

so values are

10 0.5

next step increase length by 1 ..i.e., now take position from 2 to 11 i.e., window size must be 10 at all time.... now the sequence to be considered is TGCATGCCTT

here GC's are 5/10 so GC% is still 0.5

so values are

11 0.5

similarly next time it is from 3 to 12 ... i.e., sequence is GCATGCCTTG ....

Here GC's are 6 out of total 10 i.e., 6/10 ...so GC% is 0.6

so values are

12 0.6

continue untill the end of sequence keeping the window size fixed......as entered by user....

finally I want to plot a graph with values

10 0.5

11 0.5

12 0.6

......

.....

22 0.545

The above values are for this sequence....

// user enters the window size in some HTML or PHP

// calculate GC% based on window size ... as mentioned above until the end of sequence...

// plot the values... as graph....LINE GRAPH...