Monday, May 4, 2015

Looking for CpG site enrichment

I had a seemingly easy bioinformatics task - find out if a given set of genomics region are enriched for some genomic feature - like CTCF binding (in comparison to a background set).

The below is from fumbling through a bunch of help pages online.. the first page was this one that lists a bunch of tools (I ended up using bedtools fisher)
  1. dump out genomic locations for target and background set (I was using CpG sites in gene bodies on the 450k array).
    1. sort the bed files using ./sortbed -i from bedtools. 
  2. create a genome file and sort it: "
    1. mysql --user=genome --host=genome-mysql.cse.ucsc.edu -A -e "select chrom, size from hg19.chromInfo"  > hg19.genome 
      • thanks to Samad's post
    2. then sort that file with plain sort
  3. download the tract of interest from usc genome table browser in bed format (from biostars)
    1. http://genome-test.cse.ucsc.edu/cgi-bin/hgTables?command=start
    2. select bed format
    3. sort the bed files using ./sortbed -i from bedtools again
  4. run 
    1. bedtools fisher -a target -b download_tract -g hg19.sorted.genome
    2. bedtools fisher -a background -b download_tract -g hg19.sorted.genome
    3. use the output to compute a p-value that takes into account the background results (using hypergeometric test)
It would be nice if there was an app that would do this for me, and iterate a bunch of tracts. There is tools like GREAT but those seem to be gene centric.

This was in part inspired by this work on distal SNP-CpG relations - Lemire et al. describe there methods in the "SNP and CpG site annotations" section.

This Galaxy based tool - genomic hyperbrowser might be an easier way of doing things.

Update: the Forge tool seems to do what I want but for DNAse I sites only

Monday, February 9, 2015

Nexus 4 with dead zone on screen

I recently fought with a android nexus 4 that had water damage to the digitizer. So touches would not register for the bottom part of the screen a (a cm or more).

I tried many things but in the end I ended up flashing to android 4.4, rooting it and then using xposed framework to increase the size of the navigation bar using it's dimens module. xposed doesn't work yet on lolipop / android 5.0  but maybe it will soon. Also, with xposed - you need to take a few steps to make sure it's installed and the dimens module is checked on.

During the process I found that the screen rotation app helped alot. Specifically set orientation  -I forget the setting, but getting that installed is key. Also handy soft keys helped a lot.

So now my navigation bar is so big that it blocks out the dead part of the touch screen.. but I loose screen real esatate though.. also the back button seems to trigger search for some reason.. not sure why.

Tuesday, December 2, 2014

Setting up RMINC on mac osx 10.6.8

It was a bit of a pain setting up RMINC on my old version of osx but here's my notes:

#install 1.01 version of minc tools for mac

Then it fails to find a library, so I renamed a file: 
sudo cp /opt/minc/lib/libminc2.2.3.00.dylib /opt/minc/lib/libminc2.2.dylib

Add these lines to .profile
source /opt/minc/minc-toolkit-config.sh
export LD_LIBRARY_PATH=/opt/minc/lib/
export DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH}:/opt/minc/lib:/opt/minc/lib/InsightToolkit

Then install it after grabbing it from github (I can't install git for this mac osx version)
R CMD INSTALL /Users/lfrench/Downloads/rminc/RMINC-master --configure-args='--with-build-path=/opt/minc/'


I guess I should update my osx version... after this I can only load up the library in a R ran from the terminal (maybe it will work in rstudio after a reboot). They key error was that it can't find netcdf

Sunday, June 9, 2013

Best place to buy twinings tea online

I'm a fan of twinings tea, but it's pretty pricey in the Toronto stores. Also, I can never find a pack of earl grey with more than 20.

After looking online I found out that walmart.ca is the best place to buy - free shipping and reasonable prices. Twinings.ca has it too but they charge for shipping.

Monday, April 8, 2013

Maven setup for uploading jar file to server

Here's some code I use for setting up a maven project that can create a single jar file and upload it to a server when you do mvn deploy. Just fill in the ... and <server> parts with the expected info..

Once it is done you can login to the server and just do a java -jar on the file.



 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  
      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">  
      <modelVersion>4.0.0</modelVersion>  
      <groupId>...</groupId>  
      <artifactId>...</artifactId>  
      <version>0.0.1-SNAPSHOT</version>  
      <dependencies>  
      ...  
      </dependencies>  
      <build>  
           <plugins>  
                <plugin>  
                     <artifactId>maven-assembly-plugin</artifactId>  
                     <version>2.4</version>  
                     <configuration>  
                          <descriptorRefs>  
                               <descriptorRef>jar-with-dependencies</descriptorRef>  
                          </descriptorRefs>  
                          <archive>  
                               <manifest>  
                                    <mainClass>...</mainClass>  
                               </manifest>  
                          </archive>  
                     </configuration>  
                     <executions>  
                          <execution>  
                               <id>make-assembly</id> <!-- this is used for inheritance merges -->  
                               <phase>package</phase> <!-- bind to the packaging phase -->  
                               <goals>  
                                    <goal>single</goal>  
                               </goals>  
                          </execution>  
                     </executions>  
                </plugin>  
                <plugin>  
                     <groupId>org.codehaus.mojo</groupId>  
                     <artifactId>wagon-maven-plugin</artifactId>  
                     <version>1.0-beta-4</version>  
                     <executions>  
                          <execution>  
                               <id>upload-javadoc</id>  
                               <phase>deploy</phase>  
                               <goals>  
                                    <goal>upload</goal>  
                               </goals>  
                               <configuration>  
                                    <fromDir>target</fromDir>  
                                    <includes>  
                                         *SNAPSHOT-jar-with-dependencies.jar  
                                    </includes>  
                                    <excludes>pom.xml</excludes>  
                                    <url>scpexe://<server></url>  
                                    <toDir>...</toDir>  
                               </configuration>  
                          </execution>  
                     </executions>  
                </plugin>  
                <!-- deploy only the jar with dependencies -->  
                <plugin>  
                     <groupId>org.apache.maven.plugins</groupId>  
                     <artifactId>maven-deploy-plugin</artifactId>  
                     <version>2.7</version>  
                     <configuration>  
                          <skip>true</skip>  
                     </configuration>  
                </plugin>  
           </plugins>  
           <extensions>  
                <extension>  
                     <groupId>org.apache.maven.wagon</groupId>  
                     <artifactId>wagon-ssh-external</artifactId>  
                     <version>1.0-beta-6</version>  
                </extension>  
           </extensions>  
      </build>  
      <distributionManagement>  
           <repository>  
                <id>ssh-repository</id>  
                <url>scpexe://...</url>  
           </repository>  
      </distributionManagement>  
 </project>