vcf.utils
cloud.vcf.utils
Functions
| Name | Description |
|---|---|
| create_index_file | Create a VCF index file in the current working directory. |
| find_index | Find the index file for a VCF file or None if not found. |
| get_record_count | Return the record count in a VCF file. |
| get_sample_name | Returns the sample name in a VCF file. |
| is_bgzipped | Returns True if the VCF file is bgzipped. |
| sort_and_bgzip | Sort and bgzip a VCF file storing the result in the tmp space. |
create_index_file
cloud.vcf.utils.create_index_file(vcf_uri)Create a VCF index file in the current working directory.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| vcf_uri | str | URI of the VCF file | required |
Returns
| Name | Type | Description |
|---|---|---|
| str | index file name |
find_index
cloud.vcf.utils.find_index(vcf_uri)Find the index file for a VCF file or None if not found.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| vcf_uri | str | URI of the VCF file | required |
Returns
| Name | Type | Description |
|---|---|---|
| Optional[str] | URI of the index file |
get_record_count
cloud.vcf.utils.get_record_count(vcf_uri, index_uri)Return the record count in a VCF file.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| vcf_uri | str | URI of the VCF file | required |
| index_uri | str | URI of the VCF index file | required |
Returns
| Name | Type | Description |
|---|---|---|
| Optional[int] | record count or None if there is an error |
get_sample_name
cloud.vcf.utils.get_sample_name(vcf_uri)Returns the sample name in a VCF file.
If there are multiple samples, return a comma-separated list of sample names.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| vcf_uri | str | URI of the VCF file | required |
Returns
| Name | Type | Description |
|---|---|---|
| str | sample name |
is_bgzipped
cloud.vcf.utils.is_bgzipped(vcf_uri)Returns True if the VCF file is bgzipped.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| vcf_uri | str | URI of the VCF file | required |
Returns
| Name | Type | Description |
|---|---|---|
| bool | True if the VCF file is bgzipped |
sort_and_bgzip
cloud.vcf.utils.sort_and_bgzip(vcf_uri, *, tmp_space='.')Sort and bgzip a VCF file storing the result in the tmp space.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| vcf_uri | str | URI of the VCF file | required |
| tmp_space | str | tmp space URI, defaults to the current directory | '.' |
Returns
| Name | Type | Description |
|---|---|---|
| str | URI of bgzipped VCF |