I'm trying to find the amino acid context around a particular position in a protein (5 aa amino acid window on each side).
I used to have some code that works and then biomaRt stopped working. I think some of these issues would be fixed in later versions of biomaRt, but I would have to install a new version of R, which would require me to install a new version of my OS.
require('biomaRt') require('Biostrings') hs_ensembl_mart = useMart(biomart="ENSEMBL_MART_ENSEMBL",dataset="hsapiens_gene_ensembl") gene_names=c('KRAS') aa_affected_loc=12 biomart_query_results=getBM(attributes=c('hgnc_symbol', 'entrezgene','coding'), filters = 'hgnc_symbol', values = gene_names, mart = hs_ensembl_mart) preceding_peptide= substr(as.character(translate(DNAString(biomart_query_results[1,'coding']))),aa_affected_loc-5,aa_affected_loc-1) trailing_peptide= substr(as.character(translate(DNAString(biomart_query_results[1,'coding']))),aa_affected_loc+1,aa_affected_loc+5)
Does anyone have a workaround for this?