Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
Datascience-SS2023
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
aakan96
Datascience-SS2023
Commits
9a9ace25
"src/io/vtk.cc" did not exist on "ca0833dd1c009532d538fee786043b08e0ac6143"
Commit
9a9ace25
authored
1 year ago
by
aakan96
Browse files
Options
Downloads
Patches
Plain Diff
Update file biomart_for_annotation.R
parent
d670c9c3
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
05_Data_Annotation/biomart_for_annotation.R
+15
-2
15 additions, 2 deletions
05_Data_Annotation/biomart_for_annotation.R
with
15 additions
and
2 deletions
05_Data_Annotation/biomart_for_annotation.R
+
15
−
2
View file @
9a9ace25
# Load required library for using biomaRt
library
(
biomaRt
)
# Create a connection to the Ensembl database and specify the human gene dataset
ensembl
<-
useMart
(
"ensembl"
,
dataset
=
"hsapiens_gene_ensembl"
)
# Read data from a CSV file named "mrna.csv" and store it in the "mrna" variable.
mrna
<-
read.csv
(
"C:/Users/Emre/Desktop/mrna.csv"
)
# Extract the gene symbols from the "mrna" data and store them in "gene_list".
gene_list
<-
mrna
$
Gene_symbol
# Display the contents of the "gene_list" variable, which contains the gene symbols.
gene_list
# Use biomaRt to retrieve the Ensembl gene IDs and external gene names (gene symbols)
# corresponding to the gene symbols in "gene_list".
ensembl_ids
<-
getBM
(
attributes
=
c
(
"ensembl_gene_id"
,
"external_gene_name"
),
filters
=
"external_gene_name"
,
values
=
gene_list
,
mart
=
ensembl
)
# Print the retrieved Ensembl gene IDs and their corresponding gene symbols.
print
(
ensembl_ids
)
# Load required library for writing data to Excel files
library
(
writexl
)
write_xlsx
(
ensembl_ids
,
path
=
"C:/Users/Emre/Desktop/go.csv"
)
# Write the retrieved Ensembl gene IDs and gene symbols to an Excel file named "go.csv".
write_xlsx
(
ensembl_ids
,
path
=
"C:/Users/Emre/Desktop/go.csv"
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment