This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
count_to = function(x = 5){ | |
current = 0 | |
function(){ | |
if(i >= x) | |
return(NULL) | |
i <<- i+1 | |
i | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#' sra.r | |
#' | |
#' Function for a programatical access to a SRA and GEO databases | |
#' | |
#' depends on rentrez, matrittr and xml packages | |
#' externally depends on sratools, all sratools must be available in path | |
import::here("magrittr", "%>%") | |
import::here("xml2", "read_xml", "as_list") | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | |
<beast namespace="beast.core:beast.evolution.alignment:beast.evolution.tree.coalescent:beast.core.util:beast.evolution.nuc:beast.evolution.operators:beast.evolution.sitemodel:beast.evolution.substitutionmodel:beast.evolution.likelihood" required="" version="2.6"> | |
<data id="test" dataType="standard"> | |
<sequence taxon="A">0325001134145320315521441333450540150340142324031053552343434540345422555515404425225332030455334311</sequence> | |
<sequence taxon="B">3303111402245533434135501501430403113451242121243211312030250523440504251354554250554133235411202323</sequence> | |
<sequence taxon="C">0203545342141415331211042134245105533321245534032452154450211324241122021354024412103533542044452213</sequence> | |
<sequence taxon="D">5321401114230445532511142242040052431341215151200525030545523403103545524535302424314202314031013500</sequence> | |
<sequence taxon="E">00433510520542445013055315141311044142443015520443332013354310110010033533343440431233501314422223 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
turn_of_casting = function(spell_fatigue, reinvigoration, turn_max=100){ | |
tcast = c() | |
fatigue = 0 | |
for(turn in seq_len(turn_max)){ | |
if(fatigue < 100){ | |
# cast spell | |
fatigue = fatigue + spell_fatigue | |
tcast = c(tcast, turn) | |
} else { |