[BioRuby] samtools-ruby

Michal mictadlo at gmail.com
Sat May 28 23:47:49 UTC 2011


Hello,
how is it possible to get the following pileup output with bioruby-samtools?

coverage at base 99 = 1
base in read EAS56_57:6:190:289:82 = A

coverage at base 100 = 1
base in read EAS56_57:6:190:289:82 = G

coverage at base 101 = 1
base in read EAS56_57:6:190:289:82 = G

coverage at base 102 = 2
base in read EAS56_57:6:190:289:82 = G
base in read EAS51_64:3:190:727:308 = G

I have found only a this python code :
import pysam
samfile = pysam.Samfile("ex1.bam", "rb" )
for pileupcolumn in samfile.pileup( 'chr1', 100, 120):
   print
   print 'coverage at base %s = %s' % (pileupcolumn.pos , pileupcolumn.n)
   for pileupread in pileupcolumn.pileups:
     print '\tbase in read %s = %s' % (pileupread.alignment.qname, 
pileupread.alignment.seq[pileupread.qpos])
samfile.close()

But do not know how to do it with Ruby.

Thank you in advance.



On 02/04/2011 11:57 PM, Raoul Bonnal wrote:
> In these days, w.e. too, I have no time for sam tools. From the next 
> week I could spend  more time on this project and improve test, 
> usability and platform supports.
>
>
>
> On 04/feb/2011, at 14.13, Michal wrote:
>
>> Hi,
>> I would be happy if would find out how to get on a particular 
>> position the alignment and then I could give feedback.
>>
>> Pysam http://code.google.com/p/pysam/ contains all files and tests.
>> ~/Downloads/pysam-0.3.1/tests$ ls
>> 00README.txt  ex4.sam  ex8.sam             Makefile
>> ex1.fa        ex5.sam  example.gtf.gz      pysam_test.py
>> ex1.sam.gz    ex6.sam  example.gtf.gz.tbi  segfault_tests.py
>> ex3.sam       ex7.sam  example.py          tabix_test.py
>>
>> Maybe it would be possible to test bioruby-samtools in the same way. 
>> Pysam is ship out with samtools source code and maybe could be used 
>> it for bioruby-samtools.
>>
>> Thank you in advance.
>>
>> Michal
>>
>>
>> On 02/04/2011 10:26 PM, Tomoaki NISHIYAMA wrote:
>>> Hi,
>>>
>>>> What I have forgotten to do?
>>>
>>> Now, you are at the point I reached yesterday and
>>> I don't think you have forgotten anything.
>>>
>>> From yesterday's mail:
>>>>   1) Failure:
>>>> test: BioSamtools should probably rename this file and start 
>>>> testing for real. (TestBioSamtools) [test/test_bio-samtools.rb:5]:
>>>> hey buddy, you should probably rename this file and start testing 
>>>> for real
>>>>
>>>> Loading seems ok.
>>>> I'm not sure if this is bad or ok.
>>>
>>> You could look at test/test_bio-samtools.rb
>>> $ cat test/test_bio-samtools.rb
>>> require 'helper'
>>>
>>> class TestBioSamtools < Test::Unit::TestCase
>>>   should "probably rename this file and start testing for real" do
>>>     flunk "hey buddy, you should probably rename this file and start 
>>> testing for real"
>>>   end
>>> end
>>>
>>> and guess what it means.
>>>
>>> My guess is that this is test not implemented yet.
>>> So, this error does not tell if the library function well or can not 
>>> used at all.
>>> You might just try what you wanted to do and see if it works.
>>>
>>>> I understand how difficult it is to keep track and it is a good 
>>>> idea to ship bioruby-samtools
>>>> with a working samtools version like Raoul does it.
>>>
>>> My view is the opposite.
>>> Since it potentially has many bugs and changes rapidly, bundled 
>>> shipping is ineffective.
>>> With the lack of test code, we cannot even tell which is a good 
>>> working version.
>>> --
>>> Tomoaki NISHIYAMA
>>>
>>> Advanced Science Research Center,
>>> Kanazawa University,
>>> 13-1 Takara-machi,
>>> Kanazawa, 920-0934, Japan
>>>
>>
>
> --
> R.J.P.B.
>
>
>




More information about the BioRuby mailing list