Elementolab/ApiAP2

From Icbwiki

Jump to: navigation, search

back to publications

back to Elemento lab

ApiAP2 supplementary data and scripts

  • How-to
    • Generate motif matches
mkdir MATCHES
for f in `cat PBMCORES/AP2_PBM_list`
do 
echo $f
MYSCANACE/MyScanACE -jb PBMCORES/$f -z pf_u_2000_0_masked.fa -c 2 -g 0.131 > MATCHES/$f.matches.txt
done
    • Generate input files combining motif matches and expression
perl MyScanACE_make_count_and_expression_matrices_for_regression.pl --expdata=IDCvarnorm.txt --motifdir=MATCHES \
 --mult=0 --weight=1 --suffix=".weighted" --genelist=pf_u_2000_0_masked.fa.genenames

The above command will create two linked files, IDCvarnorm.txt.expcount.exp.weighted and IDCvarnorm.txt.expcount.mot.weighted.

    • Estimate ApiAP2 activity using Elastic Net regression
mkdir TARGETS_W   # will store target genes

In R

e <- data.frame(read.csv("IDCvarnorm.txt.expcount.exp.weighted", sep="\t", row.names=1, header=T))
m <- as.matrix(read.csv("IDCvarnorm.txt.expcount.mot.weighted", sep="\t", row.names=1, header=T))     
library(glmnet)
source("lasso.R")
coefs <- PBM.glmnet.getCoefs(e, m)
as.matrix(coefs[ order(coefs), ])
# more analyses
PBM.drawCoefHeatMap(coefs, sortrowsbymax=1, file="AP2-coefs.txt")
PBM.glmnet.getFit(e, m)
dev.copy2eps(file="fit-cores-enet-weighted.eps")
par(cex=0.8)
PBM.writeTargetFiles(coefs, e, m, fdr=0.01, outdir="TARGETS_W")    # fdr=0.01 is stringent; in many cases, 
                                                                   # eg if you have few expression timepoint, 
                                                                   # you can relax it down to fdr=0.2 (or higher but be careful of potential FP)
PBM.plotAP2CoefVSExp(coefs, e, m)
Personal tools