Hi Devon, Sure, I see your point. However, I have a simple script that
takes batches of bam files, concatenate them and do something else. One of
the batches is actually a single file so samtools cat fails. The work
around is easy enough, of course, but even easier would have been to have
cat spit out the single file as it is.
Dario
On 3 December 2014 at 12:49, Devon Ryan <dpr...@dpryan.com> wrote:
> Hi Dario,
>
> There's no point to using "samtools cat" with a single file...there'd be
> nothing to concatenate. Just use "samtools view -c test.bam" directly.
>
> BTW, the regular "cat" command is also typically only needed with more
> than one file (otherwise, just use redirection "<" and save typing two
> characters).
>
> Best,
> 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 Wed, Dec 3, 2014 at 1:39 PM, Dario Beraldi <dario.bera...@gmail.com>
> wrote:
>
>> Hello,
>>
>> I realized that samtools cat doesn't work if only one input file is
>> supplied. Is this behavior intentional? I would prefer if one input file
>> was allowed, just like in Unix cat. Example:
>>
>> ## Two files, OK:
>> samtools cat test.bam test.bam | samtools view -c -
>> 352
>>
>> ## One file:
>> samtools cat test.bam
>> Usage: samtools cat [-h header.sam] [-o out.bam] <in1.bam> <in2.bam> [...]
>>
>> samtools --version
>> samtools 1.1
>> Using htslib 1.1
>> Copyright (C) 2014 Genome Research Ltd.
>>
>> Thanks!
>> Dario
>>
>>
>> ------------------------------------------------------------------------------
>> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
>> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
>> with Interactivity, Sharing, Native Excel Exports, App Integration & more
>> Get technology previously reserved for billion-dollar corporations, FREE
>>
>> http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
>> _______________________________________________
>> Samtools-help mailing list
>> Samtools-help@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/samtools-help
>>
>>
>
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
Samtools-help mailing list
Samtools-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/samtools-help