Hi,

best is to use the csi index (provided the file is indexed): 

bcftools index -s file.bcf

The command also prints the chromosome lengths and the number of
records

Petr


On Tue, 2018-09-18 at 10:16 +0200, sebastien letort wrote:
> Hi,
> 
> In order to do some parallelization, i wanted to get the list of 
> chromosomes from my bcf file, but I couldn't find a command to do
> that.
> 
> My only guess is :
> 
> bcftools view -h my_file.bcf | perl -lne 'if( /^##contig=<ID=(.+)>/
> ){ 
> print $1; }'
> 
> any better solution ?
> 
> Sébastien L.
> 
> 
> _______________________________________________
> Samtools-help mailing list
> Samtools-help@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/samtools-help


-- 
 The Wellcome Sanger Institute is operated by Genome Research 
 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. 


_______________________________________________
Samtools-help mailing list
Samtools-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/samtools-help

Reply via email to