Skip to content

Commit 8afb102

Browse files
author
Chen Ying
authored
to extract just gene id information
1 parent 29752b8 commit 8afb102

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

R/prepareAnnotations_utilityFunctions.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ prepareAnnotationsFromGTF <- function(file) {
2525
"score", "strand", "frame", "attribute")
2626
data <- data[data$type == "exon", ]
2727
data$strand[data$strand == "."] <- "*"
28-
data$GENEID <- gsub("gene_id (.*?);.*", "\\1", data$attribute)
28+
data$GENEID <- gsub(".*gene_id (.*?);.*", "\\1", data$attribute)
2929
data$TXNAME <- gsub(".*transcript_id (.*?);.*", "\\1", data$attribute)
3030
multiTxCheck <- as_tibble(data) %>% select(seqname, GENEID) %>% distinct() %>% group_by(GENEID) %>%
3131
mutate(n=n(), id=paste0('-',row_number()))

0 commit comments

Comments
 (0)