Question: Using multiple filters in BiomaRt's getSequence
0
gravatar for spiral01
2.3 years ago by
spiral01100
spiral01100 wrote:

Hi. I have a data frame of ensembl gene IDs and their corresponding canonical transcript IDs. Below is a small subset of this data frame:

             geneID    transcriptID
ENSG00000186092 ENST00000335137
ENSG00000187634 ENST00000420190
ENSG00000187642 ENST00000341290
ENSG00000188157 ENST00000379370
ENSG00000186891 ENST00000379265

I would like to retrieve the protein coding sequences for these genes using the R package biomaRt. Using the code below I can do this:

mart <- useMart("ensembl", dataset="hsapiens_gene_ensembl")
seq = getSequence(id =  "ENSG00000186092",
                  type = c("ensembl_gene_id"),
                  seqType = "coding",
                  mart = mart)

My issue is that I would like to add a second filter of transcript ID so that I am only getting the gene sequence for the specific transcript. However, I am not sure how to do this for the getSequence function. I have tried to add a value argument (as with getBM) but this gives the unused argument error message. Does anyone know how to do this?

ensembl biomart R • 1.1k views
ADD COMMENTlink modified 2.3 years ago by Emily_Ensembl20k • written 2.3 years ago by spiral01100
1
gravatar for Emily_Ensembl
2.3 years ago by
Emily_Ensembl20k
EMBL-EBI
Emily_Ensembl20k wrote:

Change your filter so that you're filtering by the Ensembl transcript ID:

seq = getSequence(id =  "ENST00000335137",
               type = c("ensembl_transcript_id"),
               seqType = "coding",
               mart = mart)
ADD COMMENTlink written 2.3 years ago by Emily_Ensembl20k

Hi Emily, thanks that does help. However is it actually possible to use two different filters?

ADD REPLYlink written 2.3 years ago by spiral01100

You can filter by multiple types of ID, but you can filter by a list of IDs, plus a biotype or something.

ADD REPLYlink written 2.3 years ago by Emily_Ensembl20k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 2087 users visited in the last hour