Entering edit mode
Mao Jianfeng
▴
290
@mao-jianfeng-3598
Last seen 10.2 years ago
Dear all,
# (1) my problem:
*I would like to get your helps on how to convert GGtools object
(generated
by vcf2sm) to snpMatrix class or other class (like classes used in R
packages adegenet and genetics)*. Are there already anything
functionalities
implemented in R or bioconductor.
# (2) background
I am working on VCF format for population genomic studies. I would
like to
take advantage of R/bioconductor.
Under helps from bioconductor, I have now can covert my VCF files to a
SnpMatrix by using vcf2sm in GGtools package.
# (3) my VCF data
my VCF data are not normal genotypic data, they are haplotypic data
(like
SNP data from X or Y chromosomes of human).
# (4) codes I have ever used
library(GGtools)
library(snpMatrix)
vcf2sm.test<-vcf2sm(gzpath="/ebio/abt6_projects5/backup/data/solexa_an
alysis/Lyrata/F1_seq_sam/non_heterozygous/merged_data/euro_head.vcf.gz
",
chrom="1",
tabixcmd="/ebio/abt6_projects/backup/solexa_tools/tabix/tabix-0.2.3/ta
bix")
> vcf2sm.test
A SnpMatrix with 20 rows and 1985 columns
Row names: AL23C2_3 ... AL34C1-2
Col names: chr1:69 ... chr1:83679
> str(vcf2sm.test)
Formal class 'SnpMatrix' [package "snpStats"] with 1 slots
..@ .Data: raw [1:20, 1:1985] 02 02 02 02 ...
.. ..- attr(*, "dimnames")=List of 2
.. .. ..$ : chr [1:20] "AL23C2_3" "AL23C2_1" "AL14C5P2-2"
"AL10C3-P1-1"
...
.. .. ..$ : chr [1:1985] "chr1:69" "chr1:87" "chr1:88" "chr1:116"
...
> single.snp.tests(vcf2sm.test)
Error in class(object) : 'object' is missing
> snpsum<-col.summary(vcf2sm.test)
Error in col.summary(vcf2sm.test) : not a snp.matrix object
Thanks in advance.
Best
Jian-Feng,
[[alternative HTML version deleted]]