On Thu, May 5, 2011 at 6:44 AM, Michael Lawrence <michafla@gene.com> wrote:

>
>
> On Thu, May 5, 2011 at 5:00 AM, Fabrice Tourre <fabrice.ciup@gmail.com>wrote:
>
>> Dear list,
>>
>> I have 8,000 snps. Each snp it has chromosome and genome position
>> information. I want to know which genes these snps located separately.
>> Does anyone have suggestion how can I get this information?
>>
>> I think GenomicFeatures packages is hard to do this.
>>
>>
> Actually, it's not so hard.
>
> Say you have a TranscriptDb object from e.g. makeTranscriptDbFromUCSC(),
> then you can just get the transcripts:
>
> tx <- transcripts(txdb, columns = "gene_id")
>
> And match the SNPs to them:
>
> values(snps)$gene_id <- values(tx)$gene_id[match(snps, tx)]
>
> Your SNPs should be a GRanges, RangedData or RangesList.
>
>

Correction: snps must be a GRanges the way I wrote that. For a RangedData,
it would be:
snps$gene_id <- values(tx)$gene_id[match(snps, tx)]


> Thank you very much.
>>
>> _______________________________________________
>> 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
>>
>
>

	[[alternative HTML version deleted]]

