Entering edit mode
Tim Smith
★
1.1k
@tim-smith-1532
Last seen 10.3 years ago
Apologies if this seems like a trivial question.
I wanted to have a consistent set of locations and wanted to all the
locations to begin from the 5' end. How can I convert locations that
are given for the '-' strand?
For example:
-----------------------------
library(biomaRt)
mart.obj <- useMart(biomart = 'ensembl', dataset =
'hsapiens_gene_ensembl')
atb <- c('ensembl_gene_id', 'chromosome_name', 'start_position',
'end_position', 'strand')
mir.locs <- getBM(attributes=atb, filters="biotype", values="miRNA",
mart=mart.obj)
mir.locs[1:5,]
> ensembl_gene_id chromosome_name start_position end_position strand
1 ENSG00000222732 5 171706206 171706319 1
2 ENSG00000207864 9 97847727 97847823 1
3 ENSG00000221173 9 129338809 129338909 -1
4 ENSG00000222961 5 32379501 32379581 -1
5 ENSG00000221058 18 51612956 51613026 -1
----------------------------
Is there a quick way that I can convert the last 3 rows so that they
reflect positions from the 5' strand?
many thanks!
[[alternative HTML version deleted]]
Hi Hervé, Thanks for the explanation. I am a bit confused about the conventions used by Ensembl. In some cases (insertions), the coordinates in biomart are represented like this:
ID Chr start end strand
rs1554119750 1 5 156594898 156594897 1
Which convention is used in this case? Why is start > end?
Thanks in advance