[BioC] convert GGtools object (generated by vcf2sm) to snpMatrix class or other class
Vincent Carey
stvjc at channing.harvard.edu
Sun Jun 12 17:08:47 CEST 2011
you didn't give sessionInfo() result. but see below
On Sun, Jun 12, 2011 at 6:33 AM, Mao Jianfeng <jianfeng.mao at gmail.com> wrote:
> 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_analysis/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/tabix")
>
>> 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
that's because this is not a valid call to single.snp.tests -- read
the doc on that function
>
>> snpsum<-col.summary(vcf2sm.test)
> Error in col.summary(vcf2sm.test) : not a snp.matrix object
this one is more difficult. we need to see your sessionInfo() result
-- col.summary should
not be asking for snp.matrix instance, but if you have chopsticks or
an old snpMatrix package
attached you could have such issues
>
>
> Thanks in advance.
>
> Best
> Jian-Feng,
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at r-project.org
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor
>
More information about the Bioconductor
mailing list