diff --git a/functions/funGCcontent.js b/functions/funGCcontent.js new file mode 100644 index 0000000..88eda95 --- /dev/null +++ b/functions/funGCcontent.js @@ -0,0 +1,9 @@ +function funGCcontent(parms){ + parms = parms||{ + sequence:'AGAAGGAAAACGGGAAACTTCACAATTAGTGAATATTTAAAAACAGACTCTTAAGAAACCAAAGGATCAAGGAAGATACCACAGGGAAAAATAGAGAATA' + } + // calculate GC funGCcontent + let GClength = parms.sequence.toUpperCase().split('').filter(x=>(x=='G'|x=='C')).length + let seqLength = parms.sequence.length + return `GC content is ${GClength}/${seqLength} = ${GClength/seqLength}` +}