User:Lindenb/Notebook/UMR915/20100713

From OpenWetWare

Jump to: navigation, search

20100712        Top        20100716       


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;i<samples.size();++i)
       {
       var sample= samples.get(i);
       //println(sample.name);
       var inputs= sample.inputs;
 
       var iter=inputs.iterator();
       while(iter.hasNext())
               {
               var nTransition=0;
               var nTransversion=0;
               var nTotal=0;
               var input= iter.next();
               var calls = input.getCalls(sample);
               for(j=0;j< calls.size();++j)
                       {
                       var call=calls.get(j);
 
                       if(call.depth<10 || call.depth>1200 || (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();
Personal tools