SAM/BAM and reference sequence

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

SAM/BAM and reference sequence

Walter, Mathias
Hi,

is there any way to set up the SAM/BAM database configuration to
retrieve the reference sequence from the MySQL SeqStore database
rather than from an additional fasta file?

The Bio::DB::Sam module accepts a method/object for the -fasta
parameter which supports this use case, at least theoretically.
Unfortunately, I could not find an example for GBrowse2.

Does anybody know how to configure this use case or give me a hint how
to implement this functionality, if not present?

I'm using GBrowse 2.54 with Bio-SamTools 1.38.

--
Kind regards,
Mathias

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Gmod-gbrowse mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-gbrowse
Reply | Threaded
Open this post in threaded view
|

Re: SAM/BAM and reference sequence

Timothy Parnell
I learned this trick from an older post a couple years ago. I can't find it now. But here it is.

[8833p_bam:database]
db_adaptor     = Bio::DB::Sam
db_args        = sub {
                  require Bio::DB::SeqFeature::Store;
                  ( -fasta => Bio::DB::SeqFeature::Store->new(
                              -adaptor => 'DBI::mysql',
                              -dsn     => 'cerevisiae_test',
                              -user    => 'nobody',
                              -pass    => 'hello',
                     ),
                     -bam  => '/Users/Shared/BAM_data/8833p.sorted.bam',
                  )
                 }

Tim


On Jul 4, 2013, at 4:35 PM, "Walter, Mathias" <[hidden email]> wrote:

> Hi,
>
> is there any way to set up the SAM/BAM database configuration to
> retrieve the reference sequence from the MySQL SeqStore database
> rather than from an additional fasta file?
>
> The Bio::DB::Sam module accepts a method/object for the -fasta
> parameter which supports this use case, at least theoretically.
> Unfortunately, I could not find an example for GBrowse2.
>
> Does anybody know how to configure this use case or give me a hint how
> to implement this functionality, if not present?
>
> I'm using GBrowse 2.54 with Bio-SamTools 1.38.
>
> --
> Kind regards,
> Mathias
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by Windows:
>
> Build for Windows Store.
>
> http://p.sf.net/sfu/windows-dev2dev
> _______________________________________________
> Gmod-gbrowse mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gmod-gbrowse


------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Gmod-gbrowse mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-gbrowse
Reply | Threaded
Open this post in threaded view
|

Re: SAM/BAM and reference sequence

Walter, Mathias
Thanks Tim! It works like a charm!

--
Mathias

2013/7/9 Timothy Parnell <[hidden email]>:

> I learned this trick from an older post a couple years ago. I can't find it now. But here it is.
>
> [8833p_bam:database]
> db_adaptor     = Bio::DB::Sam
> db_args        = sub {
>                   require Bio::DB::SeqFeature::Store;
>                   ( -fasta => Bio::DB::SeqFeature::Store->new(
>                               -adaptor => 'DBI::mysql',
>                               -dsn     => 'cerevisiae_test',
>                               -user    => 'nobody',
>                               -pass    => 'hello',
>                      ),
>                      -bam  => '/Users/Shared/BAM_data/8833p.sorted.bam',
>                   )
>                  }
>
> Tim
>
>
> On Jul 4, 2013, at 4:35 PM, "Walter, Mathias" <[hidden email]> wrote:
>
>> Hi,
>>
>> is there any way to set up the SAM/BAM database configuration to
>> retrieve the reference sequence from the MySQL SeqStore database
>> rather than from an additional fasta file?
>>
>> The Bio::DB::Sam module accepts a method/object for the -fasta
>> parameter which supports this use case, at least theoretically.
>> Unfortunately, I could not find an example for GBrowse2.
>>
>> Does anybody know how to configure this use case or give me a hint how
>> to implement this functionality, if not present?
>>
>> I'm using GBrowse 2.54 with Bio-SamTools 1.38.
>>
>> --
>> Kind regards,
>> Mathias
>>
>> ------------------------------------------------------------------------------
>> This SF.net email is sponsored by Windows:
>>
>> Build for Windows Store.
>>
>> http://p.sf.net/sfu/windows-dev2dev
>> _______________________________________________
>> Gmod-gbrowse mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/gmod-gbrowse
>

------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Gmod-gbrowse mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-gbrowse
Reply | Threaded
Open this post in threaded view
|

Re: SAM/BAM and reference sequence

Keiran Raine
In reply to this post by Walter, Mathias
Hi Mathias,

If possible you'd be better off ensuring that the BAM file has MD tags calculated.  The MD tag encodes how the read sequence differs from the reference.  With this in place there is no need to consult an additional source and the rendering is significantly faster.  I'm pretty sure this is the default behaviour, but the generation of the MD tag is dependent on the mapping algorithm (BWA adds it automatically).

samtools calmd in.bam ref.fa > new.bam

Regards,

Keiran Raine
Principal Bioinformatician
Cancer Genome Project
Wellcome Trust Sanger institute

Tel:+44 (0)1223 834244 Ext: 7703
Office: H204

On 4 Jul 2013, at 23:35, "Walter, Mathias" <[hidden email]> wrote:

Hi,

is there any way to set up the SAM/BAM database configuration to
retrieve the reference sequence from the MySQL SeqStore database
rather than from an additional fasta file?

The Bio::DB::Sam module accepts a method/object for the -fasta
parameter which supports this use case, at least theoretically.
Unfortunately, I could not find an example for GBrowse2.

Does anybody know how to configure this use case or give me a hint how
to implement this functionality, if not present?

I'm using GBrowse 2.54 with Bio-SamTools 1.38.

--
Kind regards,
Mathias

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Gmod-gbrowse mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-gbrowse


-- The Wellcome Trust Sanger Institute is operated by Genome Rese arch Limited, a charity registered in England with number 1021457 and a company registered in England with number 2742969, whose registered office is 215 Euston Road, London, NW1 2BE.

------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Gmod-gbrowse mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-gbrowse