Update polyRAD so that genotypes can be exported to VCF.
The locTable slot of RADdata objects can now have a column called Ref that indicates the reference allele sequence, which may or may not be one of the sequences present in alleleNucleotides.
The python scripts for variant calling in allopolyploids, and the readProcessIsoloci function, were updated to extract reference haplotype sequences from the SAM file (using CIGAR and MD fields) and import those into polyRAD. They were also edited to trim haplotypes to the first endpoint out of all haplotypes for a locus, to avoid missing data at SNPs within the haplotypes. This necessitated creation of the MergeIdenticalHaplotypes function.
The VCF2RADdata function was updated to import reference allele sequences.
The internal Rcpp function Hap2SNP was created. It converts haplotype-based alleles into SNP and indel alleles suitable for VCF export. Allele sequences and positions are calculated, and a conversion matrix is also output that can convert genotype or depth matrices from being haplotype-based to SNP-based.
The RADdata2VCF function was created. It uses an internal Rcpp function PrepVCFexport to reformat the data, then uses the VariantAnnotation package to export to VCF.
Update polyRAD so that genotypes can be exported to VCF.
locTable
slot ofRADdata
objects can now have a column calledRef
that indicates the reference allele sequence, which may or may not be one of the sequences present inalleleNucleotides
.readProcessIsoloci
function, were updated to extract reference haplotype sequences from the SAM file (using CIGAR and MD fields) and import those into polyRAD. They were also edited to trim haplotypes to the first endpoint out of all haplotypes for a locus, to avoid missing data at SNPs within the haplotypes. This necessitated creation of theMergeIdenticalHaplotypes
function.VCF2RADdata
function was updated to import reference allele sequences.Hap2SNP
was created. It converts haplotype-based alleles into SNP and indel alleles suitable for VCF export. Allele sequences and positions are calculated, and a conversion matrix is also output that can convert genotype or depth matrices from being haplotype-based to SNP-based.RADdata2VCF
function was created. It uses an internal Rcpp functionPrepVCFexport
to reformat the data, then uses the VariantAnnotation package to export to VCF.