Blogs_tips from old site


Table of Contents

Subset bamfile with chromosome names and convert into paired fastq

sambamba usages should refer to

#using star output bamfile as example 
#extract reads aligned to chr2
sambamba view -F "ref_id==1" -f bam $bamin -o ${bamin%%Aligned.sortedByCoord.out.bam}_chr2.bam
#sort reads by names if not presorted by software
sambamba sort -n ${bamin%%Aligned.sortedByCoord.out.bam}_chr2.bam -o ${bamin%%Aligned.sortedByCoord.out.bam}_chr2.sort.bam
bam2fastx -PANQ -o ${bamin%%Aligned.sortedByCoord.out.bam}_chr2.fq.gz ${bamin%%Aligned.sortedByCoord.out.bam}_chr2.sort.bam

PS: the numbers specified in ref_id means the ref order list in header from bamfle, which can be checked by samtools view -H your.bam if samtools was installed.

Cluster management

    1. shudown system Shut down computational node

      for i in `seq 1 3`
      ssh cu0$i "hostname;init 0"

      umount storage

      umount /home

      shutdown login node


      R code for ploting nomograph from competing risk survival analysis model

      ```R library(cmprsk) library(rms)

      add path

      setwd(“C:\Users\hh\Desktop\nomo”) rt<-read.csv(“Stomach.csv”) rt View(rt) attach(rt) #change variable names

cov<-cbind(sexC, Age, AJCC_T,AJCC_N,AJCC_M,Surgery) for (i in 1:6) { cov[,i]<-factor(cov[,i]) } status<-factor(status) z <- crr(time,status,cov) z.p <- predict(z,cov) n=60#suppose I want to predict the probability of event at time 60(an order) df<-data.frame(y=z.p[n,-1],cov) ddist <- datadist(df)
options(datadist=‘ddist’) lmod<-ols(y~(sexC)+(Age)+(AJCC_T)+(AJCC_N)+(AJCC_M)+(Surgery),data=df)# nom<-nomogram(lmod) plot(nom,lplabel=paste(“prob. of incidence T”,round(z.p[n,1],2),sep=“=”))

## Setting docker download mirror site 
Sometimes you may find that it's extrimely painfull to pull docker image from in china. So this tip can help you to set a mirror site locally in your docker pull command.  
* 1. First, find the file `/etc/docker/daemon.json` and modify it with root authority.
  "registry-mirrors": [""]
    1. Secondly, restart your docker service.

      Install bioconductor R package using VPS.

    proxychains4 Rscript -e ‘source(“"); biocLite(“BSgenome”)’

install bioconductor R package using mirror at UTSC.

biocLite("your package")

Tips for using Tianhe super computer

comments powered by Disqus