Skip to content

Commit

Permalink
Add script for translating MSU ID to KEGG transcript ID
Browse files Browse the repository at this point in the history
  • Loading branch information
memgonzales committed May 4, 2023
1 parent f7b51c6 commit 35a5fec
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions enrichment_analysis/msu-to-transcript-id.r
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
library(data.table)
library(riceidconverter)

all_genes <- read.table("data/all_genes.txt")
all_genes <- all_genes[[1]]

all_transcript <- c()
na_all_transcript <- c()

for (gene in all_genes) {
transcript_id <- RiceIDConvert(gene, fromType = 'MSU', toType = 'TRANSCRIPTID')
transcript_id_list <- c()
transcript_id_list <- append(transcript_id_list, gene)

for (id in transcript_id$TRANSCRIPTID) {
if (is.na(id)) {
print(gene)
na_all_transcript <- append(na_all_transcript, gene)
} else {
transcript_id_list <- append(transcript_id_list, id)
}
}

all_transcript <- append(all_transcript, list(transcript_id_list))
}

lapply(na_all_transcript, write, 'data/temp/all-na-transcript-id.txt', append = T, sep = '\n')
lapply(all_transcript, write, 'data/temp/all-transcript-id.txt', append = T, sep = '\n')

0 comments on commit 35a5fec

Please sign in to comment.