Skip to main content

Posts

Showing posts from August, 2012

C/C++ header file inlcude "" OR<> how to use std ?

Suppose your project current directory is 0.   /home/myproj/ Let assume include foder are 1. /home/include1/ 2. /home/include2/ ==>  # include "myhead.h"    search for directory in order 0 , then 1 , then 2 AS IT SEARCH CURRENT DIR FIRST, USUALLY user defined headers used in this way. ==>  # include    search for directory in order 1 , then 2 , then 0 AS IT SEARCH INCLUDE DIR FIRST,  standard headers used in this way. Header file extension: ================== In C : In early days it was .hxx, .hpp . Then it was .h     #include myheader.hxx     #include myheader.hp     #include myheader.hpp In C++ : No extension. They are included in namespaces.    #include    using namespace std; // use original namespace you can also use it in code as std::stringfunction

linux configuration file : bash_profile / bash_logout / bashrc

see also : http://www.troubleshooters.com/linux/prepostpath.htm source : http://www.hypexr.org/bash_tutorial.php#whatis In your home directory, 3 files have a special meaning to Bash, allowing you to set up your environment automatically when you log in and when you invoke another Bash shell, and allow you to execute commands when you log out. These files may exist in your home directory, but that depends largely on the Linux distro you're using and how your sysadmin (if not you) has set up your account. If they're missing, Bash defaults to /etc/profile . You can easily create these files yourself using your favorite texteditor. They are: .bash_profile : read and the commands in it executed by Bash every time you log in to the system .bashrc : read and executed by Bash every time you start a subshell .bash_logout : read and executed by Bash every time a login shell exits Bash allows 2 synonyms for .bash_profile : .bash_login and

Sun Grid Engine : SGE : Basic Commands

http://www.ats.ucla.edu/clusters/common/computing/batch/sge.htm http://web.njit.edu/topics/HPC/basement/sge/SGE.html http://star.mit.edu/cluster/docs/0.92rc2/guides/sge.html 0. First see available q : qstat -g c 1. ALWAYS USE -q queuename 2. To use any particular node use -l hostname (  -l hostname=himem03 ) qsub   -q  normal.q   -e pythonTeswt.err -o pythonTeswt.out   -cwd -S /bin/bash   -l hostname=himem03  testSingledataprep.sh ## using specific node qsub   -q  normal.q   -e pythonTeswt.err -o pythonTeswt.out   -cwd -l hostname=himem03  -S /bin/bash   -l hostname=himem03  testSingledataprep.sh python mafParser.py $mafRoot  $dataRoot  $fNameSpecies $fNameSubEXONLncrna  $fnmStatCount $fnmStatPrcnt $fnmStatSub $fnmSUBEXONStatDETECT  $fnapslncBed /// check my submitted jobs qstat // alluser qstat -u "*" ///// all details of user and nodes userstat /// details of queues qstat -g c // delete jobs qdel jobID // node informations qh

code p-value calculation

  pvalue/p-value calculation HYPERGEOMETRIC TEST http://mengnote.blogspot.com/2012/12/calculate-correct-hypergeometric-p.html # x, q     vector of quantiles representing the number of white balls drawn without replacement from an urn which contains both black and white balls. # m     the number of white balls in the urn. # n     the number of black balls in the urn. # k     the number of balls drawn from the urn. # phyper(q, m, n, k, lower.tail = TRUE, log.p = FALSE) sucessDrawn=1 sucessTotal=2 sampleSize=24 populatonSizeWithoutSample=1751-sampleSize phyper(sucessDrawn-1, sucessTotal, populatonSizeWithoutSample, sampleSize, lower.tail = FALSE, log.p = FALSE) FISHER EXACT TEST Bonferroni correction: Pvalue* (#of test cases) http://www.une.edu.au/WebStat/unit_materials/c7_anova/oneway_bonferroni_adjust.htm http://www.langsrud.com/stat/fisher.htm Code done by  Benoit Marchand /*  * pvalcalc.cpp  *      Author:  Benoit Marchand  */ #include #include     /*   

Python tutorial

How to install different packages: In MAC, use pip pip install -U numpy scipy scikit-learn How to see where the package is installed In MAC: pip show numpy Import all ============ import className OR from package import className Code Structure ======================== 1.  just write script one line by one print "ab" print "cd" 2. Use function (Here you must need a main function ): def myfunc():     print "Inside fnc ab" if __name__ == '__main__':     pass     myfunc()     objUtil = Utilities.printString("Hello world") 3. Use like java, class + function +main myclass.py -------------------- class LncRNA(object):     def __init__(self,chr , chrStart , chrEnd):         self.chr = chr         self.chrStart = chrStart         self.chrEnd = chrEnd           def classfunction():         sOut='';         sOut+= str(self.chr) + '\t' + str(self.chrStart) + '\t' + str