Skip to content

Commit

Permalink
Create funGCcontent.js
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasalmeida authored Feb 6, 2024
1 parent ae756c3 commit 3e32f00
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions functions/funGCcontent.js
Original file line number Diff line number Diff line change
@@ -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}`
}

0 comments on commit 3e32f00

Please sign in to comment.