This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Unable to use biomaRt getSequence() query to get sequences using genomic coordinates

After trying to download sequences through biomaRt using the getSequence() query with MGI IDs with some problems of duplicate IDs (please see: biomaRt duplicates some unique IDs during getSequence() query but not others) for additional information), I am trying a different approach where I strictly use genomic coordinates of the sequences I would like to download and ultimately export them in FASTA format for motif analyses.

However, I am now running into issues where I can not use seqType=genomic, even though the biomaRt package (http://www.bioconductor.org/packages/release/bioc/manuals/biomaRt/man/biomaRt.pdf) reference guide lists it as a possible parameter. I am working with vectors containing: chromosomes, start positions, end positions, and IDs I would like to use as FASTA headers. After trying getSequence with MGI IDs before, and now direct genomic coordinates, can anyone help me to find an approach that might work?

Thanks in advance.

biomart bioconductor r

Can you post the code you are using and error message?

library("biomaRt")
ensembl<-useMart("ensembl",dataset="mmusculus_gene_ensembl")
filters<-listFilters(ensembl)
attributes<-listAttributes(ensembl)
geneIDs<-readLines(“/home/ed/RWD/germ_cell/TXT/IDs.txt”)
chr<-readLines(“/home/ed/RWD/germ_cell/TXT/chr.txt”)
startpos<-readLines(“/home/ed/RWD/germ_cell/TXT/start.txt”)
endpos<-readLines(“/home/ed/RWD/germ_cell/TXT/end.txt”)
seqs<-getSequence(id=geneIDs, chromosome=chr, start=startpos, end=endpos, seqType=genomic, mart=ensembl)

Error in match(x, table, nomatch = 0L) : object 'genomic' not found

1 answer

You need to put "genomic" in quotes:

seqs<-getSequence(id=geneIDs, chromosome=chr, start=startpos, end=endpos, seqType="genomic", mart=ensembl

Hi Sean. I tried that and got this as the output:

Please specify the type of sequence that needs to be retrieved when using biomaRt in web service mode. Choose either gene_exon, transcript_exon, transcript_exon_intron, gene_exon_intron, cdna, coding, coding_transcript_flank, coding_gene_flank, transcript_flank, gene_flank, peptide, 3utr or 5utr

Log in to answer this question.