VariantAnnotation package with snp location
1
0
Entering edit mode
@fabrice-tourre-4394
Last seen 10.2 years ago
Dear list, I am using VariantAnnotation package to annotated a list of snps. But I only have the snp coordinate information. It seems VariantAnnotation only works with VCF format. I am not family with VCF format. How can I use VariantAnnotation with my snp list? It is not vcf format. Thank you very much in advance. Best wishes,
SNP VariantAnnotation VariantAnnotation SNP VariantAnnotation VariantAnnotation • 1.5k views
ADD COMMENT
1
Entering edit mode
Tim Triche ★ 4.2k
@tim-triche-3561
Last seen 4.2 years ago
United States
suppose you have your SNPs in a data.frame named 'SNPs' with columns 'chrom' and 'location', and suppose they're called against hg19. Say, SNPs <- data.frame(chrom=c('chr1','chr9'), location=c(123, 456)) ## To use locateVariants easily, you'll want to turn them into a GRanges. library(GenomicRanges) SNPs.gr <- GRanges( seqnames=SNPs$chrom, IRanges(start=SNPs$location, width=1) ) genomeSNPs.gr) <- 'hg19' ## always record your genome, always always ## Then: library(Homo.sapiens) library(VariantAnnotation) vars <- locateVariantsSNPs.gr, ## the following is from Homo.sapiens TxDb.Hsapiens.UCSC.hg19.knownGene, AllVariants()) values(vars)[, c(1,2,3,5,6,7)] ## so that it fits in an email :-) ## DataFrame with 2 rows and 4 columns ## LOCATION GENEID PRECEDEID FOLLOWID ## 1 intergenic NA 79501 653635 ## 2 intergenic NA 81704 100287171 ## As the above are both intergenic, you might like to know what they're near: ## unlist(mget(vars$PRECEDEID, org.Hs.egSYMBOL)) ## from Homo.sapiens ## 79501 81704 ## "OR4F5" "DOCK8" unlist(mget(vars$FOLLOWID, org.Hs.egSYMBOL)) ## from Homo.sapiens ## 653635 100287171 ## "WASH7P" "WASH1" Does this make sense? It is a tremendously useful package (thanks much to Valerie, Martin, Michael and Stephanie). On Fri, Feb 8, 2013 at 9:29 AM, Fabrice Tourre <fabrice.ciup@gmail.com>wrote: > Dear list, > > I am using VariantAnnotation package to annotated a list of snps. But > I only have the snp coordinate information. It seems VariantAnnotation > only works with VCF format. I am not family with VCF format. > > How can I use VariantAnnotation with my snp list? It is not vcf format. > > > Thank you very much in advance. > > Best wishes, > > _______________________________________________ > Bioconductor mailing list > Bioconductor@r-project.org > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: > http://news.gmane.org/gmane.science.biology.informatics.conductor > -- *A model is a lie that helps you see the truth.* * * Howard Skipper<http: cancerres.aacrjournals.org="" content="" 31="" 9="" 1173.full.pdf=""> [[alternative HTML version deleted]]
ADD COMMENT
0
Entering edit mode
Minor derp: values(vars)[, c(1,2,3,5,6,7)] ## so that it fits in an email :-) ## was actually run as values(vars)[, c(1,5,6,7)] ## my bad On Fri, Feb 8, 2013 at 9:50 AM, Tim Triche, Jr. <tim.triche@gmail.com>wrote: > suppose you have your SNPs in a data.frame named 'SNPs' with columns > 'chrom' and 'location', and suppose they're called against hg19. Say, > > SNPs <- data.frame(chrom=c('chr1','chr9'), location=c(123, 456)) > > ## To use locateVariants easily, you'll want to turn them into a GRanges. > > library(GenomicRanges) > SNPs.gr <- GRanges( seqnames=SNPs$chrom, > IRanges(start=SNPs$location, > width=1) ) > genomeSNPs.gr) <- 'hg19' ## always record your genome, always always > > ## Then: > > library(Homo.sapiens) > library(VariantAnnotation) > > vars <- locateVariantsSNPs.gr, ## the following is from Homo.sapiens > TxDb.Hsapiens.UCSC.hg19.knownGene, > AllVariants()) > > values(vars)[, c(1,2,3,5,6,7)] ## so that it fits in an email :-) > ## DataFrame with 2 rows and 4 columns > ## LOCATION GENEID PRECEDEID FOLLOWID > ## 1 intergenic NA 79501 653635 > ## 2 intergenic NA 81704 100287171 > > ## As the above are both intergenic, you might like to know what they're > near: > ## > unlist(mget(vars$PRECEDEID, org.Hs.egSYMBOL)) ## from Homo.sapiens > ## 79501 81704 > ## "OR4F5" "DOCK8" > > unlist(mget(vars$FOLLOWID, org.Hs.egSYMBOL)) ## from Homo.sapiens > ## 653635 100287171 > ## "WASH7P" "WASH1" > > Does this make sense? > > It is a tremendously useful package (thanks much to Valerie, Martin, > Michael and Stephanie). > > > On Fri, Feb 8, 2013 at 9:29 AM, Fabrice Tourre <fabrice.ciup@gmail.com>wrote: > >> Dear list, >> >> I am using VariantAnnotation package to annotated a list of snps. But >> I only have the snp coordinate information. It seems VariantAnnotation >> only works with VCF format. I am not family with VCF format. >> >> How can I use VariantAnnotation with my snp list? It is not vcf format. >> >> >> Thank you very much in advance. >> >> Best wishes, >> >> _______________________________________________ >> Bioconductor mailing list >> Bioconductor@r-project.org >> https://stat.ethz.ch/mailman/listinfo/bioconductor >> Search the archives: >> http://news.gmane.org/gmane.science.biology.informatics.conductor >> > > > > -- > *A model is a lie that helps you see the truth.* > * > * > Howard Skipper<http: cancerres.aacrjournals.org="" content="" 31="" 9="" 1173.full.pdf=""> > -- *A model is a lie that helps you see the truth.* * * Howard Skipper<http: cancerres.aacrjournals.org="" content="" 31="" 9="" 1173.full.pdf=""> [[alternative HTML version deleted]]
ADD REPLY
0
Entering edit mode
Tim, Thank you very much. It is really helpful to me. I learn a lot from your reply. Best wishes, On Fri, Feb 8, 2013 at 12:51 PM, Tim Triche, Jr. <tim.triche at="" gmail.com=""> wrote: > Minor derp: > > values(vars)[, c(1,2,3,5,6,7)] ## so that it fits in an email :-) > > ## was actually run as > > values(vars)[, c(1,5,6,7)] > > ## my bad > > > > > On Fri, Feb 8, 2013 at 9:50 AM, Tim Triche, Jr. <tim.triche at="" gmail.com=""> > wrote: >> >> suppose you have your SNPs in a data.frame named 'SNPs' with columns >> 'chrom' and 'location', and suppose they're called against hg19. Say, >> >> SNPs <- data.frame(chrom=c('chr1','chr9'), location=c(123, 456)) >> >> ## To use locateVariants easily, you'll want to turn them into a GRanges. >> >> library(GenomicRanges) >> SNPs.gr <- GRanges( seqnames=SNPs$chrom, >> IRanges(start=SNPs$location, >> width=1) ) >> genomeSNPs.gr) <- 'hg19' ## always record your genome, always always >> >> ## Then: >> >> library(Homo.sapiens) >> library(VariantAnnotation) >> >> vars <- locateVariantsSNPs.gr, ## the following is from Homo.sapiens >> TxDb.Hsapiens.UCSC.hg19.knownGene, >> AllVariants()) >> >> values(vars)[, c(1,2,3,5,6,7)] ## so that it fits in an email :-) >> ## DataFrame with 2 rows and 4 columns >> ## LOCATION GENEID PRECEDEID FOLLOWID >> ## 1 intergenic NA 79501 653635 >> ## 2 intergenic NA 81704 100287171 >> >> ## As the above are both intergenic, you might like to know what they're >> near: >> ## >> unlist(mget(vars$PRECEDEID, org.Hs.egSYMBOL)) ## from Homo.sapiens >> ## 79501 81704 >> ## "OR4F5" "DOCK8" >> >> unlist(mget(vars$FOLLOWID, org.Hs.egSYMBOL)) ## from Homo.sapiens >> ## 653635 100287171 >> ## "WASH7P" "WASH1" >> >> Does this make sense? >> >> It is a tremendously useful package (thanks much to Valerie, Martin, >> Michael and Stephanie). >> >> >> On Fri, Feb 8, 2013 at 9:29 AM, Fabrice Tourre <fabrice.ciup at="" gmail.com=""> >> wrote: >>> >>> Dear list, >>> >>> I am using VariantAnnotation package to annotated a list of snps. But >>> I only have the snp coordinate information. It seems VariantAnnotation >>> only works with VCF format. I am not family with VCF format. >>> >>> How can I use VariantAnnotation with my snp list? It is not vcf format. >>> >>> >>> Thank you very much in advance. >>> >>> Best wishes, >>> >>> _______________________________________________ >>> 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 >> >> >> >> >> -- >> A model is a lie that helps you see the truth. >> >> Howard Skipper > > > > > -- > A model is a lie that helps you see the truth. > > Howard Skipper
ADD REPLY

Login before adding your answer.

Traffic: 531 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6