diff options
author | David Runge <david.runge@frqrec.com> | 2014-05-22 01:29:09 +0200 |
---|---|---|
committer | David Runge <david.runge@frqrec.com> | 2014-05-22 01:29:09 +0200 |
commit | dd19201605dbd4ea386739a1ddfa0592369e2f8c (patch) | |
tree | eef8eecbf38cc94418422aefc13dbd63916fda11 | |
parent | 8f3c6ff1bb266bc6878c779c84f5af88da739c30 (diff) | |
download | thesoundofpeople-dd19201605dbd4ea386739a1ddfa0592369e2f8c.tar.gz thesoundofpeople-dd19201605dbd4ea386739a1ddfa0592369e2f8c.tar.bz2 thesoundofpeople-dd19201605dbd4ea386739a1ddfa0592369e2f8c.tar.xz thesoundofpeople-dd19201605dbd4ea386739a1ddfa0592369e2f8c.zip |
Retab of document
-rw-r--r-- | SNP.sc | 98 |
1 files changed, 49 insertions, 49 deletions
@@ -1,54 +1,54 @@ SNP{//TODO: use vectorial represntations only, strip chromosome (redundant, as stored in SNPDict already), - var <chromosome;//chromosome as Symbol - var <vecChromosome;//corresponding number - var <id;//rsid of the SNP - var <position;//position of SNP on own chromosome - var <base;//base of the SNP (single or pair) - var <vecBase;//vectorial representation of the base (pair) - var <>resolver;//the other (two) combination(s) of the position - var <vecResolver;//vectorial representation of the other combination(s) + var <chromosome;//chromosome as Symbol + var <vecChromosome;//corresponding number + var <id;//rsid of the SNP + var <position;//position of SNP on own chromosome + var <base;//base of the SNP (single or pair) + var <vecBase;//vectorial representation of the base (pair) + var <>resolver;//the other (two) combination(s) of the position + var <vecResolver;//vectorial representation of the other combination(s) - *new{ - arg aChromosome, aPosition = 0, aId, aBase, aResolver; - ^super.new.init(aChromosome, aPosition, aId, aBase, aResolver); - } + *new{ + arg aChromosome, aPosition = 0, aId, aBase, aResolver; + ^super.new.init(aChromosome, aPosition, aId, aBase, aResolver); + } - init{ - arg aChromosome, aPosition, aId, aBase, aResolver; - chromosome = aChromosome.asSymbol; - vecChromosome = SNPInfo.convertChromosome(chromosome); - position = aPosition.asFloat; - id = aId.asSymbol; - base = aBase.asSymbol; - resolver = aResolver.asArray; - vecBase = SNPInfo.baseToVec(base); - vecResolver = SNPInfo.baseToVec(resolver); - } - - hasResolver{//check if this SNP has a resolver - var resolved = true; - if(resolver.isArray,{ - resolver.do({ - arg item,i; - if(item==\none,{ - resolved = false - }); - }); - ^resolved; - },{ - if(resolver!=\none,{ - ^true; - },{ - ^false; - }); - }); - } + init{ + arg aChromosome, aPosition, aId, aBase, aResolver; + chromosome = aChromosome.asSymbol; + vecChromosome = SNPInfo.convertChromosome(chromosome); + position = aPosition.asFloat; + id = aId.asSymbol; + base = aBase.asSymbol; + resolver = aResolver.asArray; + vecBase = SNPInfo.baseToVec(base); + vecResolver = SNPInfo.baseToVec(resolver); + } - updateResolver{//update a resolver and its vector representation - arg newResolver; - if(newResolver!=resolver,{ - resolver = newResolver; - vecResolver = SNPInfo.baseToVec(resolver); - }); - } + hasResolver{//check if this SNP has a resolver + var resolved = true; + if(resolver.isArray,{ + resolver.do({ + arg item,i; + if(item==\none,{ + resolved = false + }); + }); + ^resolved; + },{ + if(resolver!=\none,{ + ^true; + },{ + ^false; + }); + }); + } + + updateResolver{//update a resolver and its vector representation + arg newResolver; + if(newResolver!=resolver,{ + resolver = newResolver; + vecResolver = SNPInfo.baseToVec(resolver); + }); + } } |