Donnerstag, 6. August 2015

Converting sql database schemas

After some thinkering I believe the best way to cope with various DB providers is to use an ORM.
I did try python SQLAlchemy.
At every corner I run into performance problems with python.



I might post an update on it in the near future.

mysql -> sqlite3
postgre -> sqlite3

CREATE  TABLE IF NOT EXISTS `pyMS`.`feature` (
  `feature_id` VARCHAR(40) NOT NULL ,
  `intensity` DOUBLE NOT NULL ,
  `overallquality` DOUBLE NOT NULL ,
  `quality` DOUBLE NOT NULL ,
  `charge` INT NOT NULL ,
  `content` VARCHAR(45) NOT NULL ,
  `msrun_msrun_id` INT NOT NULL ,
  PRIMARY KEY (`feature_id`, `msrun_msrun_id`) ,
  UNIQUE INDEX `id_UNIQUE` (`feature_id` ASC) ,
  INDEX `fk_feature_msrun1` (`msrun_msrun_id` ASC) ,
  CONSTRAINT `fk_feature_msrun1`
    FOREIGN KEY (`msrun_msrun_id` )
    REFERENCES `pyMS`.`msrun` (`msrun_id` )
    ON DELETE NO ACTION
    ON UPDATE NO ACTION)
ENGINE = InnoDB;


CREATE  TABLE IF NOT EXISTS `feature` (
  `feature_id` VARCHAR(40) NOT NULL ,
  `intensity` DOUBLE NOT NULL ,
  `overallquality` DOUBLE NOT NULL ,
  `quality` DOUBLE NOT NULL ,
  `charge` INT NOT NULL ,
  `content` VARCHAR(45) NOT NULL ,
  `msrun_msrun_id` INT NOT NULL,
  CONSTRAINT `fk_feature_msrun1`
    FOREIGN KEY (`msrun_msrun_id` )
    REFERENCES `msrun` (`msrun_id` )
    ON DELETE NO ACTION
    ON UPDATE NO ACTION);
CREATE UNIQUE INDEX `id_UNIQUE` ON `feature` (`feature_id` ASC);
CREATE INDEX `fk_feature_msrun1` ON `feature` (`msrun_msrun_id` ASC);



Sonntag, 2. August 2015

R plotting also with d3.js

R and d3.js

ggplot cheat sheet

Scatterplots with lattice

http://www.stat.ubc.ca/~jenny/STAT545A/block09_xyplotLattice.html

interesting links


http://blog.ae.be/combining-the-power-of-r-and-d3-js/
https://plot.ly
http://dimplejs.org/

If you are comfortable with GitHub, I wrote this tutorial about configuring GitHub to display webpages without using a third party site as supporting material for another course

https://github.com/thoughtfulbloke/appleorange
http://bl.ocks.org/

http://rawgit.com/