User:Lindenb/Notebook/UMR915/20100713

=alter database: basic_mutations=

CREATE TABLE `basic_mutation` ( `id` int(10) unsigned NOT NULL auto_increment,  `variation_id` int(10) unsigned NOT NULL,  `meta` text,  `creation` datetime default NULL,  `modified` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,  `wild_aa` char(1) default NULL,  `mut_aa` char(1) default NULL,  `synonymous` tinyint(4) NOT NULL,  `stop_gained` tinyint(4) NOT NULL,  `stop_lost` tinyint(4) NOT NULL,  `splicing_acceptor` tinyint(4) NOT NULL,  `splicing_donor` tinyint(4) NOT NULL,  PRIMARY KEY  (`id`),  KEY `variation_id` (`variation_id`),  CONSTRAINT `basic_mutation_ibfk_1` FOREIGN KEY (`variation_id`) REFERENCES `variation` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=latin1;

and wrote a program to fill this table:

/home/lindenb/src/code915/tools/src/java/fr/inserm/umr915/tools/DumpBasicMutations.java =many differences for "alt" alles between sls2 and me= mysql -N -u anonymous -D umr915  -e 'select V.chrom, V.position, V.ref,V.alt  from variation as V,vcf_call as C1 where  C1.variation_id=V.id and C1.input_id=4 and C1.sample_id=1 ' | sort > ~/jeter1.txt mysql -N -u anonymous -D umr915  -e 'select V.chrom, V.position, V.ref,V.alt  from variation as V,vcf_call as C1 where  C1.variation_id=V.id and C1.input_id=27 and C1.sample_id=1 and C1.depth>=4' | grep -v '\+' | grep -v '\-' | sort > ~/jeter2.txt

chrZ	105932293	T	C			     |	chrZ	105932293	T	Y chrZ	105957402	A	C			     |	chrZ	105957402	A	M chrZ	106065070	G	A			     |	chrZ	106065070	G	R chrZ	106114649	G	T			     |	chrZ	106114649	G	K

in the case of 	chrZ:105932293 is is because Y=C+T. Makes sense. =calcul ratio transition/transversion= run JSCRIPT:

${JAVA_HOME}/bin/jrunscript -f transistions.js -cp dist/lib915.jar:/usr/local/package/mysql-connector-java-5.1.12/mysql-connector-java-5.1.12-bin.jar

with:

importClass(Packages.fr.inserm.umr915.core.db.UMR915DB); database=new UMR915DB; samples=database.samples; for(i=0;i1200 || (call.rmsQuality!=null && call.rmsQuality < 25) || call.snpQuality<25 ) continue; var variation=call.variation; if(variation.isTransition) nTransition++; if( variation.isTransversion) nTransversion++; nTotal++; }               out.println(sample.name+"\t"+input.filename+"\t"+" "+(nTransition/(1.0*nTransversion))); }       }  database.close;