Skip to content
Snippets Groups Projects
Commit 5c292b04 authored by Alessandro Vullo's avatar Alessandro Vullo
Browse files

Merge pull request #79 from willmclaren/feature/faidx

Replace Bio::DB::Fasta with faidx_xs
parents 77d5c67e 3e7a481e
No related branches found
No related tags found
1 merge request!81Update LD endpoint documentation
......@@ -32,6 +32,17 @@ before_install:
- cd ensembl-variation/C_code/
- make
- cd ../../
- git clone --branch master --depth 1 https://github.com/samtools/htslib.git
- cd htslib
- make
- cd ../
- git clone --branch master --depth 1 https://github.com/Ensembl/faidx_xs.git
- cd faidx_xs
- perl Makefile.PL
- make
- cp lib/Faidx.pm ..
- cp blib/arch/auto/Faidx/Faidx.so ..
- cd ../
install:
- cpanm -v --installdeps --with-recommends --notest --cpanfile ensembl/cpanfile .
......
......@@ -81,7 +81,7 @@ jsonp=1
</Controller::Overlap>
<Controller::VEP>
fasta = __path_to(t/test-genome-DBs/testdata/human_vep/7.fa)__
fasta = __path_to(t/test-genome-DBs/testdata/human_vep/7.fa.gz)__
dir = __path_to(t/test-genome-DBs/testdata/human_vep)__
cache_region_size = 1000000
chunk_size = 50000
......
......@@ -21,7 +21,7 @@ use Moose;
use Bio::EnsEMBL::Variation::VariationFeature;
use namespace::autoclean;
use Data::Dumper;
use Bio::DB::Fasta;
use Faidx;
use Bio::EnsEMBL::Variation::Utils::VEP qw(get_all_consequences parse_line validate_vf read_cache_info @REG_FEAT_TYPES);
use Bio::EnsEMBL::Slice;
use Bio::EnsEMBL::Utils::Sequence qw(reverse_comp);
......@@ -39,7 +39,7 @@ BEGIN {
}
has 'fasta_db' => (
isa => 'Bio::DB::Fasta',
isa => 'Faidx',
is => 'ro',
lazy => 1,
builder => '_find_fasta_cache',
......@@ -156,7 +156,7 @@ sub _give_POST_to_VEP {
# Overwrite Slice->seq method to use a local disk cache when using Human
my $consequences;
if ($c->stash->{species} eq 'homo_sapiens' && defined($config->{fasta})) {
$c->log->debug('Farming human out to Bio::DB');
$c->log->debug('Farming human out to Faidx');
no warnings 'redefine';
local *Bio::EnsEMBL::Slice::seq = $self->_new_slice_seq();
$consequences = $self->get_consequences($c, $config, \@vfs);
......@@ -409,7 +409,8 @@ sub _build_vf {
sub _find_fasta_cache {
my $self = shift;
my $fasta_db = Bio::DB::Fasta->new($self->fasta);
my $fasta_db = Faidx->new($self->fasta);
return $fasta_db;
}
......@@ -419,7 +420,8 @@ sub _new_slice_seq {
my $fasta_db = $self->fasta_db;
return sub {
my $self = shift;
my $seq = $fasta_db->seq( $self->seq_region_name, $self->start => $self->end );
my $location_string = $self->seq_region_name.":".$self->start."-".$self->end ;
my ($seq, $length) = $fasta_db->get_sequence($location_string);
$seq ||= 'N' x $self->length();
reverse_comp( \$seq ) if $self->strand < 0;
# default to a string of Ns if we couldn't get sequence
......
This diff is collapsed.
File added
chromosome:GRCh37:7:86000000:87000000:1 1000001 54 60 61
File added
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment