Hi Dror,

You're misunderstanding what the portion before the decimal does. It's the
seed to the RNG, it doesn't specify the portion to subsample. The portion
after the decimal says what portion to subsample (after all, a subsample
can't be more than the input sample...by definition). So -s 1.5, -s 0.5,
and -s 100.5 will all subsample ~50% of the original file, but with
different starting seeds (1, 0, and 100, respectively).

file1/file2 will only differ if they have a different starting seed. If you
tried:

samtools view -s 0.5 foo > foo1
samtools view -s 1.5 foo > foo2

then you'd find that they have similar numbers of alignments (as expected,
you're subsampling ~50% of the reads in each case) but that they're not
identical (due to seeding the RNG with 0 and 1, respectively).

BTW, 0.1.19 is two versions behind the current release.

Devon

--
Devon Ryan, Ph.D.
Email: dpr...@dpryan.com
Laboratory for Molecular and Cellular Cognition
German Centre for Neurodegenerative Diseases (DZNE)
Ludwig-Erhard-Allee 2
53175 Bonn
Germany
<devon.r...@dzne.de>

On Tue, Oct 28, 2014 at 12:05 PM, Dror Hibsh <dro...@gmail.com> wrote:

> Hi guys,
>
> My samtools version is: 0.1.19-44428cd
>
> I am trying to use the '-s' option..
>
> My bam file has:
> samtools view Example.bam  | wc -l
> 2000000
>
> samtools view -s 0.5 Example.bam  | wc -l
> 1001528
> samtools view -s 1.5 Example.bam  | wc -l
> 998410
> samtools view -s 2.5 Example.bam  | wc -l
> 998744
>
> I cant understand the results..
> -s 0.5 should produce exactly 1000000 reads
> and 1.5 should be 3000000 etc..
>
> Am i missing somthing?
> Moreover,
> samtools view -s 0.5 Example.bam > file1
> samtools view -s 0.5 Example.bam > file2
> file1 file2 are identical.. Isnt -s should be random subsampling???
>
> Actually i saw this issue in some threads as solved, but it doesnt solve
> for me..
> https://github.com/samtools/samtools/issues/160  (for example)
>
>
> Thanks,
> Pap
>
>
>
>
>
>
>
> --
> -----------------
> Dror Hibsh
> 0507-669599
> ------------------
>
>
> ------------------------------------------------------------------------------
>
> _______________________________________________
> Samtools-help mailing list
> Samtools-help@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/samtools-help
>
>
------------------------------------------------------------------------------
_______________________________________________
Samtools-help mailing list
Samtools-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/samtools-help

Reply via email to