Vina 的虚拟筛选

git clone https://github.com/daizao/Do_virtual_screening
# 根据需要修改自己文件
perl run.pl
发表在 Perl, Quantum Chemical Calculation | 留下评论

Git 入门命令

#local
git init
git status
git add file/doc
git commit -m "..."
git commit -a -m "..."
git status
git log


git show ... #一串哈希符号

#remote
git remote -v
git remote add origin https:.......
git remote -v
git push origin master #输入用户名和密码,将本地文件push到远程


git pull origin master #将远程的文件拽到本地



git clone https:...... #将远程的文件拽到本地
git remote -v #clone的仓库直接和远程仓库建立了联系
git commit -a -m "add daizao char" #将修改记录信息
git push
发表在 Linux | 留下评论

Autodock vina 源码编译安装

sudo yum install imake #install makedepend
sudo yum install libicu-devel #install unicode/icu for boostregex
sudo yum install openmpi openmpi-devel  #install opemnpi
sudo yum install glibc-static

tar -zxf boost_1_41_0.tar.gz
cd boost_1_41_0
./bootstrap.sh --prefix=/opt/sysoft/boost-1.41.0
./bjam install
cd ..
rm -rf boost_1_41_0

tar -zxf autodock_vina_1_1_2.tgz
cd /home/train/autodock_vina_1_1_2/build/linux/release
vim Makefile
#chang the path of g++ and base path
#BASE=/opt/sysoft/boost-1.41.0
#GPP=/usr/bin/g++
export LIBRARY_PATH=/opt/sysoft/boost-1.41.0/lib:$LIBRARY_PATH
export CPLUS_INCLUDE_PATH=/opt/sysoft/boost-1.41.0/include:$CPLUS_INCLUDE_PATH
#make depend
make
mv autodock_vina_1_1_2 /opt/biosoft/
mkdir /opt/biosoft/autodock_vina_1_1_2/bin
cp /opt/biosoft/autodock_vina_1_1_2/build/linux/release/vina* /opt/biosoft/autodock_vina_1_1_2/bin/
发表在 Linux, Molecular Dynamics | 留下评论

PyClone 源码安装

#由于0.13.1版本numba依赖关系作者描述不清不建议使用
#PyClone 0.13.0 install
git clone -b 0.2.3 https://github.com/Roth-Lab/pydp.git
cd pydp/
pip install . --prefix=/opt/sysoft/pydp-0.2.3
echo 'export PYTHONPATH=/opt/sysoft/pydp-0.2.3/lib/python2.7/site-packages:$PYTHONPATH' >> ~/.bashrc.pydp-0.2.3
cd ..
rm -rf pydp/

pip install 'matplotlib>=1.2.0'
pip install 'numpy>=1.6.2'
pip install 'pandas>=0.11'
pip install 'scipy>=0.11'
pip install 'seaborn>=0.6.0'

wget -c https://bitbucket.org/aroth85/pyclone/downloads/PyClone-0.13.0.tar.gz
tar -zxf PyClone-0.13.0.tar.gz
cd PyClone-0.13.0/
pip install . --prefix=/opt/biosoft/pyclone-0.13.0
echo 'export PATH=/opt/biosoft/pyclone-0.13.0/bin:$PATH' >> ~/.bashrc.pyclone-0.13.0
echo 'export PYTHONPATH=/opt/biosoft/pyclone-0.13.0/lib/python2.7/site-packages:$PYTHONPATH' >> ~/.bashrc.pyclone-0.13.0
echo 'source ~/.bashrc.pydp-0.2.3' >> ~/.bashrc.pyclone-0.13.0
发表在 NGS_analysis | 留下评论

R expression使用

text(20,150,adj=0,"Tumour: N = 252; ",col=c("#E51718"),cex=1)    
text(40,150,adj=0,as.expression(substitute(rho == tumor_cor,list(tumor_cor=as.character(format(round(t.cor$estimate,2)))))),col=c("#E51718"),cex=1)
text(50,150,adj=0,as.expression(substitute(italic(P) == tumor_pvalue,list(tumor_pvalue=as.character(format(t.cor$p.value))))),col=c("#E51718"),cex=1)
发表在 R | 留下评论

ABSOLUTE肿瘤纯度分析测试

library(data.table)
library(foreach)
library(doMC)
library(ABSOLUTE)

setwd("/home/train/data/ABSOLUTE_test/Tumor_purity")

DoAbsolute <- function(scan,input) {
#  registerDoSEQ()  #多核心计算时候,需要注释掉
  library(ABSOLUTE)
  plate.name <- "test" #可以根据需要修改
  genome <- "hg18"
  platform <- c("SNP_6.0", "Illumina_WES", "SNP_250K_STY")
  sample.name <- scan
  primary.disease = "NA"
  sigma.p <- 0
  max.sigma.h <- 0.02
  min.ploidy <- 0.95
  max.ploidy <- 10
  max.as.seg.count <- 1500
  max.non.clonal <- 0
  max.neg.genome <- 0
  copy_num_type <- "total"
  seg.dat.fn <- input
  results.dir <- file.path(".", "output", scan, "absolute")
  print(paste("Starting scan", scan, "at", results.dir))
  log.dir <- file.path(".", "output", "abs_logs")
  if (!file.exists(log.dir)) {
     dir.create(log.dir, recursive=TRUE)
  }
  dz <- lapply(results.dir,function(x){
    if(!file.exists(x)){
      dir.create(x, recursive=TRUE)
    }
  })
  rm(dz)
  sink(file=file.path(log.dir, paste(scan, ".abs.out.txt", sep="")))
  RunAbsolute(seg.dat.fn, sigma.p, max.sigma.h, min.ploidy, max.ploidy, primary.disease, 
              platform, sample.name, results.dir, max.as.seg.count, max.non.clonal, 
              max.neg.genome, copy_num_type, verbose=TRUE)
  sink()
}


registerDoMC(20)    #对每组数据调用线程池

arrays.txt <- "SNP6_solid_tumor.seg.txt"

input_data <- "test.txt"
scans <- unique(as.data.frame(fread(arrays.txt))$Sample)
foreach (scan=scans, .combine=c) %dopar% {
  DoAbsolute(scan,input=input_data)
}

obj.name <- "test_summary"
results.dir <- file.path(".", "output", "abs_summary")
absolute.files <- file.path(".", "output",
                            scans, "absolute",
                            paste(scans, ".ABSOLUTE.RData", sep=""))


CreateReviewObject(obj.name, absolute.files, results.dir, "total", verbose=TRUE)

calls.path = file.path("output", "abs_summary", "test_summary.PP-calls_tab.txt")
modes.path = file.path("output", "abs_summary", "test_summary.PP-modes.data.RData")
output.path = file.path("output", "abs_extract")
ExtractReviewedResults(calls.path, "test", modes.path, output.path, "absolute", "total")


# doabsolute包更好使用,需要根据输入数据调整格式暂时分步处理,今后有时间写成pipline可以无缝对接doabsolute进行批量处理

mkdir T1_5
mkdir total
mv T1_5.cr.igv.seg T1_5
mv T1_5_absolute.maf T1_5
cd T1_5/
mv T1_5.cr.igv.seg tumor.seg
mv ../T1_3/step1_Xto23.sh .
bash step1_Xto23.sh 
cp ../T1_3/step2_MafFilebalance.pl .
perl step2_MafFilebalance.pl T1_5_absolute.maf
cp ../T1_3/step3_SegFilebalance.pl .
perl step3_SegFilebalance.pl new_tumor.seg
cp ../T1_3/step4_rebalance_seg_and_maf.R .
Rscript step4_rebalance_seg_and_maf.R
cp ../T1_3/step5_get_seperate_file.R .
Rscript step5_get_seperate_file.R
cp ../T1_3/step6_prepare_doabsolute.pl .
perl step6_prepare_doabsolute.pl ./seperate_file/
cp ../T1_3/step6.5_prepare_doabsolute.sh .
#修改step6.5中的文件名为T1_5
bash step6.5_prepare_doabsolute.sh

cd ..
mkdir total
cd total/
mkdir seperate_file
cp ../T1_3/seperate_file/*.maf seperate_file/
cp ../T1_3/seperate_file/new_T1_3.seg seperate_file/
cp ../T1_4/seperate_file/*.maf seperate_file/
cp ../T1_4/seperate_file/new_T1_4.seg seperate_file/
cp ../T1_5/seperate_file/*.maf seperate_file/
cp ../T1_5/seperate_file/new_T1_5.seg seperate_file/
cp ../T1_3/new_final.seg .
cat ../T1_4/new_final.seg | awk 'NR>1' >> new_final.seg
cat ../T1_5/new_final.seg | awk 'NR>1' >> new_final.seg
cp ../T1_3/step7_doabsolute.R .
#注意修改路径
Rscript step7_doabsolute.R
发表在 R | 留下评论