This commit is contained in:
commit
568474d52f
1591 files changed
+528213
No files matched your search
@@ -0,0 +1,12 @@
|
||||
// GCContent: the fraction of the letters of S that are G or C. Other letters
|
||||
// (N for an unknown base, lowercase) count in the length and not in the count.
|
||||
FUNCTION GCContent(S : STRING) RETURNS FLOAT
|
||||
REQUIRE LENGTH(S) > 0
|
||||
DECLARE Count : INTEGER <- 0
|
||||
FOR I <- 0 TO LENGTH(S)
|
||||
IF S[I] == 'G' OR S[I] == 'C' THEN
|
||||
Count <- Count + 1
|
||||
ENDIF
|
||||
NEXT I
|
||||
RETURN Count / LENGTH(S)
|
||||
ENDFUNCTION
|
||||
Reference in new issue
Block a user