importClass(Packages.fr.inserm.umr915.core.db.Database);
database=new Database();
var variations = database.variations;
var samples = database.samples;
for(i=0;i< variations.size();++i)
{
var variation=variations.get(i),
for(j=0;j< samples.size();++j)
{
var sample=samples.get(j),
println(variation.chrom+" "+variation.position+" "+sample.name+" "+ variation.getCalls(sample) );
}
}
database.close();
I also wrote a java web application to browse the results and a custom JSP Tag displaying the context of a BAM file at a given location. This tag (source code) uses the Picard Library (samtools for java) to read the Bam files. When this tag is invoked in a JSP file, it needs the path of the BAM file on the server and the segment (chromosome,start,end) to be printed.database=new Database();
var variations = database.variations;
var samples = database.samples;
for(i=0;i< variations.size();++i)
{
var variation=variations.get(i),
for(j=0;j< samples.size();++j)
{
var sample=samples.get(j),
println(variation.chrom+" "+variation.position+" "+sample.name+" "+ variation.getCalls(sample) );
}
}
database.close();
<u:bam file="${bam.file}" chrom="${variation.chrom}" start="${variation.position-10}" end="${variation.position+10}" highlight="${variation.position}"/>
The custom tag will produce something like this:------+---------+-----
C GCAGTTCGTACTATACC
CT CAGTTTGTACTATACC
CTC AGTTTGTACTATACC
CTC AGTTCGTACTATACC
CTCTT AGTTCGTACTATACC
CTCTTG GTTTGTACTATACC
CTCTTGC TTCGTACTATACC
TTCTGCAG TGTACTATACC
CTCTTGCA TTGTACTATACC
CTCTTGCA GTACTATACC
CTCTTGCAG GTACTATACC
CTCTTGAAG TACTATACC
CTCTTGCAG ACTATACC
C GCAGTTCGTACTATACC
CT CAGTTTGTACTATACC
CTC AGTTTGTACTATACC
CTC AGTTCGTACTATACC
CTCTT AGTTCGTACTATACC
CTCTTG GTTTGTACTATACC
CTCTTGC TTCGTACTATACC
TTCTGCAG TGTACTATACC
CTCTTGCA TTGTACTATACC
CTCTTGCA GTACTATACC
CTCTTGCAG GTACTATACC
CTCTTGAAG TACTATACC
CTCTTGCAG ACTATACC
That's it
Pierre
No comments:
Post a Comment