Reads biallelic SNP data in different representations into pre-allocated matrices.
VCF_read_snp_diplo_bial_int_altpresence( vcffh , mat )
VCF_read_snp_diplo_bial_int_nuclcodes( vcffh , mat )
VCF_read_snp_diplo_bial_str_01( vcffh , mat )
VCF_read_snp_diplo_bial_str_allelechars( vcffh , mat )
VCF_read_snp_diplo_bial_str_nuclcodes( vcffh , mat )
Prerequisites are: - a valid, open VCF file handle, passed as vcffh - a valid sample selection (vcf_getsamples,vcf_getselectedsamples,vcf_selectsmaples) - a properly set region (vcf_setregion) - and a result matrix, mat.
The matrix will be filled with allele data in one of 4 encodings and needs to be of either integer or character data type, both depending on the called function (VCF_..._int_... or VCF_..._str_...) . Each column corresponds to a SNP locus and each row to a sample. The number of matrix columns determines the maximum number of SNP loci that are parsed from the VCF. Column names are set to the position of the SNP, the row names are named after the samples they represent. There must be at least as many rows as selected samples. Unused rows will be filled with default (N) data. If there are not enough SNPs to fill all columns, the unused columns will be numbered with -1 and filled with N or -1.
VCF data is required to be diploid.
Representations:
VCF_snpmat_diplo_bial_geno_filtered
warning("These functions are obsolete! Consult VCF_snpmat_diplo_bial_geno_filtered etc.")
Run the code above in your browser using DataLab