Skip to main content

Posts

Showing posts from 2015

SVN tutorial

SVN cheat sheet: http://www.cheatography.com/davechild/cheat-sheets/subversion/ For more useful svn commands, check the following tutorial: http://openoffice.apache.org/ svn -basics.html Server : Create a  SVN repository svn co https://svn.apache.org/repos/asf/openoffice/trunk  mySVNrepository Local machine: Make a repository and connect with server Just on your local machine, run the following command: svn checkout svn +ssh:// login.cbrc.kaust. edu.sa/data/snapdragon/ soufanom/DREAM-DRUG-Challenge/ ChallengeScripts Then, all current testing scripts will be added to your local machine.  Add and commit your changes to server: In order to share with us your work, inside your own folder (e.g. ChallengeScripts/Wail ), create any folder, file or scripts and do: 1- svn add folder1 2- svn commit folder1 -m "Comments of your changes"

Linux Tips and Tricks

Collected from CBRC wiki: Original source: http://dragon.cbrc.kaust.edu.sa/wiki/index.php/Linux_Tips_and_Tricks Linux Tips and Tricks Jump to: navigation , search Contents 1 Useful commands 1.1 General commands 1.2 Directories processing 1.3 Files processing 1.4 Find/Replace 1.5 Processes 2 File System /Disk Management 2.1 Disk space report 2.2 Resizing Shared Memory (/dev/shm) 2.3 Resizing partitions CentOS 2.4 Disk crash recovery 2.5 Mounting WebDAV Share 2.5.1 Installing and configuring WebDAV for non-sudo on Ubuntu Useful commands General commands find Linux version $ cat / etc / issue Directories processing $ # recursively delete backup files $ find . / -name '*~' | xargs rm   $ # Process all files in a directory $ ls dir_path /* .xml | xargs -n 1 MyProcessingProgram   $ # gzip/guznip directory: $ tar czvf myfile.tar.gz mydir /* $ tar xzvf filename.tar.gz ( or: tar xz

GIT tutorial

Tutorial:  http://gitready.com/ http://blog.osteele.com/posts/2008/05/my-git-workflow/ Basic structure Image from: From : http://blog.osteele.com/posts/2008/05/my-git-workflow/ Following tips are collected from CBRC git (Thanks to John and Craig) Original LInk: http://dragon.cbrc.kaust.edu.sa/wiki/index.php/Cbrcgit Cbrcgit Jump to: navigation , search Contents 1 What is git 2 CBRC git server 3 Quick start 4 Using git 5 Creating a new remote repository 6 Creating a new local git repository 7 Project repository 8 See also What is git http://en.wikipedia.org/wiki/Git_%28software%29 Git is a free distributed revision control, or software source code management, project with an emphasis on being fast. Git was initially designed and developed by Linus Torvalds for Linux kernel development. Every Git working directory is a full-fledged repository with complete history and full revision tracking capabilities, not d

MicroRNA database : Mirbase naming convension ; Target Database

MirTarBase V 4.5   http://mirtarbase.mbc.nctu.edu.tw/php/download.php?ver=4.5&opt=show For human, It has  targets for 596 mature microRNA from mirBase. Mirbase 20 Number of precursor micorRNA:  1871 ID , 1870 Name (mir-511 has two id) Number of mature micorRNA:   2794 ID , 2576 Name. ID  Each precursor and mature microRNA has unique ID. If you work on ID that would be fine.  Name  -- > ID P recursor microRNA For each primary ID  there is 1 primary name, except one case hsa-mir-511. This name is common for two primary transcript chr10    .    miRNA_primary_transcript    17887107    17887193    .    +    .    ID=MI0003127;Alias=MI0003127;Name=hsa-mir-511 chr10    .    miRNA_primary_transcript    18134036    18134122    .    +    .    ID=MI0003127_2;Alias=MI0003127;Name=hsa-mir-511 mature microRNA For each mature name there can be N mature RNA ID . Target of matureRNA -> target of Precursor microRNA Option 1 1. map matrueRNA name   : to matur

GO Term analysis

1. Repository for annotation of  GO ID against genes download file (gene_association.goa_human.gz) from link: http://geneontology.org/gene-associations/gene_association.goa_human.gz http://geneontology.org/page/download-annotations 2. How to extract GO names/description from database from GO ID Option 1 : use the file   http://purl.obolibrary.org/obo/go.obo from   http://geneontology.org/page/download-ontology Option 2 :  use R package # load the GO library  library(GO.db)   write.table( goterms, sep="\t", file="goterms.txt") 3. How to do get all GO terms for a gene Option 1: Use the annotation database [BEST option you can dowload updated file and parse it based on UNIPROT ACC No ] http://geneontology.org/gene-associations/gene_association.goa_human.gz Option 2 : R package Ontologyzer [It can be used to show annotation at child and parent level also , scrool down below to check command] http://compbio.charite.de/ contao/
How to clone a repository 1. Go to the repository 2. click Fork 3. In local machine , type following command (her tanviralambd   = user name) git clone https://github.com/tanviralambd/intermine.git

JAVA directory operation : List files in a folder , copy files and folder creation

List files in a folder  import java.io.*; public static Vector listFiles_Files_Dir(String absPathFolder)     {         Vector vectAllFiles = new Vector ();         File folder = new File(absPathFolder);         File[] listOfFiles = folder.listFiles();         for (int i = 0; i < listOfFiles.length; i++) {             if (listOfFiles[i].isFile()) {                                 System.out.println("File: " + listOfFiles[i].getName());                 vectAllFiles.add(listOfFiles[i].getName() );                             } else if (listOfFiles[i].isDirectory()) {                                 System.out.println("Directory: " + listOfFiles[i].getName());                 vectAllFiles.add(listOfFiles[i].getName() );                             }         }         return vectAllFiles;     } Create folder      import java.io.*;      public static void create_new_folder(String absPathFolder)     {         File theDir = new File(absPathFolder);        

ngsplot ngs.plot tutorial

#!/bin/sh # #SBATCH --job-name=testJob #SBATCH --time=24:00:00 #SBATCH --nodes=1 #SBATCH --ntasks=1 #SBATCH --partition=dragon-default #SBATCH --ntasks-per-node=1 #SBATCH --mem=8192 # # Display all variables set by slurm env | grep "^SLURM" | sort ## run with command: sbatch NGSPLOT_test.sh #module load gcc/4.7.4 #module load  compilers-extra #module load samtools/1.1 #module load bwtool/1.0 module purge module load slurm module load gcc/4.7.4 module load R/3.1.1 module load ngsplot dataDir="/home/alamt/HMCan_test/" workDir=/home/alamt/NGSPLOT/ cd $workDir hg19size=hg19.chrom.sizes tfName="MEF_2A" bedFile="F5_robust_DPI_TSS_500_upstream_500_downstream_nonCoding_only.bed" ############################### ##### 1. Run ngs.plot.r ##### Mandatory parameters: #  -G   Genome name. Use ngsplotdb.py list to show available genomes. #  -R   Genomic regions to plot: tss, tes, genebody, exon, cgi, enhancer, dhs or bed #  -C   Indexed bam file or a configur

ggplot ggplot2 tutorial

Data format processing for ggplot2 You have to make data frame to work with ggplot2 http://mundosubmundo.kaiux.com/?p=346 START WITH THIS SITE http://www.cookbook-r.com/Graphs/Bar_and_line_graphs_%28ggplot2%29/  Official web site http://docs.ggplot2.org/current/ Practical Tips http://www.ceb-institute.org/bbs/wp-content/uploads/2011/09/handout_ggplot2.pdf 3 Steps to make any ggplot graph (Tanvir's 3 step approach; it will work on 90 percent graph)   1. Make a data frame 2. Make a ggplot object with aes ( group =.. , color=.. , x = .. , y= ..) Here for all plot don't require both x and y. For example, density plot only requires x , so for density provide only x for aes (). For boxplot it requires y value and x-value to show different group. so provide both x- and y-value in aes(). 3. Use different function to make different type of plot ##### Step -1  NoA = 10 u = rnorm(NoA) NoB = 20 v = rnorm(NoB) myfm =data.frame(genegroup = factor(

SLURM tutorial : Basic commands

Main website for learning SLRUM http://slurm.schedmd.com/tutorials.html Submit a job with name and outputfile name(This will overwrite the parameters in shell file header ) sbatch   -J   job1  -o   job1.out  --partition=batch    myscript.sh   Basic shell script for job #!/bin/sh # #SBATCH --job-name=testJob #SBATCH --time=01:00:00 #SBATCH --nodes=1 #SBATCH --ntasks=1 #SBATCH --partition=dragon-default # # Display all variables set by slurm env | grep "^SLURM" | sort # cd /projects/dragon/FANTOM5/processed_data_feature ## All my commands for job will go here date;time; mkdir t1 How to submit a batch job sbatch myscript.sh How to check the list of jobs of a user squeue -u user1 squeue -u user1 -l # it will show in details   How to check the whole history and status of a job   scontrol show job=JOBID   How to use one particular node in interactive mode. Useful when all jobs are pending and you need to run a job srun --pty --time