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
import yaml | |
from os.path import join | |
with open('cluster_partition.conf', 'r') as f: | |
partitions = yaml.safe_load(f) | |
def get_partition(rule_name): | |
return partitions[rule_name] if rule_name in partitions else partitions['__default__'] | |
sim_save_dir = config['sim_save_dir'] |
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
getEffLen <- function(txp_len, max_len=1000, mean = 200, sd = 25) | |
{ | |
if(txp_len > max_len) | |
return(txp_len-mean) | |
new_mean = mean(truncnorm::rtruncnorm(n=10000, b=txp_len, mean=mean, sd=sd)) | |
return(ifelse(txp_len-new_mean > 0,txp_len-new_mean, new_mean-txp_len)) | |
} |
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
computeWeightedLFC <- function(y, tNodes) { | |
compLFC <- function(reps, conds) { | |
mC1 <- rowMeans(reps[,conds==1]) ##mean condition 1 | |
mC2 <- rowMeans(reps[,conds==2]) ##mean condition 2 | |
lfc <- log2(mC2+1) - log2(mC1+1) | |
return(lfc) | |
} | |
lfcCounts <- compLFC(assays(y)[["counts"]], colData(y)[["condition"]]) ## count LFC | |
varThresh <- log2(exp(1))^2*(1/rowMeans(assays(y)[["counts"]][,colData(y)[["condition"]]==1]) + 1/rowMeans(assays(y)[["counts"]][,colData(y)[["condition"]]==2])) ## threshold for variance |
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
### Keybase proof | |
I hereby claim: | |
* I am npsdc on github. | |
* I am noorpratap (https://keybase.io/noorpratap) on keybase. | |
* I have a public key ASDT4ICFn2-6S5XHPwliTVntQR_QQJLrOS-QRZ6MJYFwPgo | |
To claim this, I am signing this object: |
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
### Keybase proof | |
I hereby claim: | |
* I am npsdc on github. | |
* I am noorpratap (https://keybase.io/noorpratap) on keybase. | |
* I have a public key ASDT4ICFn2-6S5XHPwliTVntQR_QQJLrOS-QRZ6MJYFwPgo | |
To claim this, I am signing this object: |