Issue 210 bigwig support

New datasource class for bigwig format files (http://genome.ucsc.edu/goldenpath/help/bigWig.html).

This class uses the ngslib python library to fetch continuous scores from a bigwig file.  For queries spanning a genomic range, the median of scores across the range are returned.


Does ngslib use a look ahead cache?  These results look really good.  How
much RAM was used?  It looks like it loaded everything into RAM or was very
good at its lookahead cache.  If this is the case, can it do tsv?  vcf?

Also, can you rename BigWig.py to BigWigDatasource.py.  And keep the class
name as BigWigDatasource.  In other words, the same as the other datasource
classes.

On Wed, Nov 5, 2014 at 12:48 PM, Alex Ramos <notifications@github.com>
wrote:

> In oncotator/datasources/BigWig.py:
>
> > +    def __init__(self, src_file, title='', version=None):
> > +        super(BigWigDatasource, self).__init__(src_file, title=title, version=version)
> > +
> > +        self.output_headers = [title + '_score']
> > +        self.bigwig_fh = BigWigFile(src_file)
> > +        self.has_chr = True if self.bigwig_fh.chroms[0].startswith('chr') else False
> > +
> > +    def annotate_mutation(self, mutation):
> > +        if self.has_chr and not mutation.chr.startswith('chr'):
> > +            chrn = 'chr' + mutation.chr
> > +        else:
> > +            chrn = mutation.chr
> > +
> > +        variant_start, variant_end = int(mutation.start) - 1, int(mutation.end) #start - 1 because bigwig format is zero-based coords
> > +
> > +        scores = [r.score for r in self.bigwig_fh.fetch(chrom=chrn, start=variant_start, stop=variant_end)]
>
>
> /home/unix/aramos/documents/bigwig_support/benchmarks/old/100000/profile_stats.txt
>
> /home/unix/aramos/documents/bigwig_support/benchmarks/old2/100000/profile_stats.txt
>
> /home/unix/aramos/documents/bigwig_support/benchmarks/old3/100000/profile_stats.txt
>
> /home/unix/aramos/documents/bigwig_support/benchmarks/new/100000/profile_stats.txt
>
> /home/unix/aramos/documents/bigwig_support/benchmarks/new2/100000/profile_stats.txt
>
> /home/unix/aramos/documents/bigwig_support/benchmarks/new3/100000/profile_stats.txt
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/broadinstitute/oncotator/pull/230/files#r19891035>.
>



-- 
Lee Lichtenstein
Broad Institute
415 Main Street, Room 4041
Cambridge, MA 02142
617 714 8632