Difference between revisions of "SAV Command Line Interface"
(Created page with "The sav application is a command line Interface for manipulating sav genotype files. [https://github.com/statgen/savvy| Github repo]") |
m (Lefaivej moved page SAV Command LIne Interface to SAV Command Line Interface: Typo) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
The sav application is a command line Interface for manipulating [[SAV File Format | sav]] genotype files. | The sav application is a command line Interface for manipulating [[SAV File Format | sav]] genotype files. | ||
− | [https://github.com/statgen/savvy| Github repo] | + | ==Usage== |
+ | Running <code>sav --help</code> will list available subcommands. Each subcommand also has its own help page. When installed into systems paths, <code>man sav</code> will also bring up documentation. | ||
+ | |||
+ | ===import=== | ||
+ | The <code>import</code> subcommand imports from BCF or VCF to SAV file format. Indexing, sorting, subsetting, etc. can all be applied during import. GT is the default data format imported. HDS (haplotype dosages) can be enabled with <code>-d HDS</code>. | ||
+ | |||
+ | <syntaxhighlight lang="shell"> | ||
+ | # imports BCF file and indexes output. | ||
+ | sav import --index file.bcf file.sav | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | ===export=== | ||
+ | The <code>export</code> subcommand will export a SAV file to either plain text or bgzipped VCF format. The exported data format can be GT, HDS, GP or DS. | ||
+ | <syntaxhighlight lang="shell"> | ||
+ | # exports region and sample subset to stdout | ||
+ | sav export file.sav \ | ||
+ | --regions chr1,chr2:10000-20000 \ | ||
+ | --sample-ids ID1,ID2,ID3 | less -S | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | <syntaxhighlight lang="shell"> | ||
+ | # exports sample subset as dosages excluding monomorphic sites to bgzf file. | ||
+ | sav export file.sav file.vcf.gz \ | ||
+ | --filter "AC>0;AC!=AN" \ | ||
+ | --data-format DS \ | ||
+ | --sample-ids ID1,ID2,ID3 | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | ===stat-index=== | ||
+ | The <code>stat-index</code> subcommand can be used to quickly pull metrics about the call set (eg. number of variants) via the S1R index. | ||
+ | |||
+ | <syntaxhighlight lang="shell"> | ||
+ | sav stat-index file.sav.s1r | ||
+ | > chromosome 18 20 | ||
+ | > block count 4813 3421 | ||
+ | > marker count 9855090 8835691 | ||
+ | > tree height 2 2 | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | ==External links== | ||
+ | [https://github.com/statgen/savvy| Github repo] (source code) |
Latest revision as of 09:34, 22 May 2018
The sav application is a command line Interface for manipulating sav genotype files.
Usage
Running sav --help
will list available subcommands. Each subcommand also has its own help page. When installed into systems paths, man sav
will also bring up documentation.
import
The import
subcommand imports from BCF or VCF to SAV file format. Indexing, sorting, subsetting, etc. can all be applied during import. GT is the default data format imported. HDS (haplotype dosages) can be enabled with -d HDS
.
# imports BCF file and indexes output.
sav import --index file.bcf file.sav
export
The export
subcommand will export a SAV file to either plain text or bgzipped VCF format. The exported data format can be GT, HDS, GP or DS.
# exports region and sample subset to stdout
sav export file.sav \
--regions chr1,chr2:10000-20000 \
--sample-ids ID1,ID2,ID3 | less -S
# exports sample subset as dosages excluding monomorphic sites to bgzf file.
sav export file.sav file.vcf.gz \
--filter "AC>0;AC!=AN" \
--data-format DS \
--sample-ids ID1,ID2,ID3
stat-index
The stat-index
subcommand can be used to quickly pull metrics about the call set (eg. number of variants) via the S1R index.
sav stat-index file.sav.s1r
> chromosome 18 20
> block count 4813 3421
> marker count 9855090 8835691
> tree height 2 2
External links
Github repo (source code)