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
88474808
Commit
88474808
authored
1 year ago
by
aakan96
Browse files
Options
Downloads
Patches
Plain Diff
Update 2 files
- /02_MultiMIR/MultiMiR.R - /04_Cytoscape/extract_mrna_names_from_mirna.R
parent
f9b1c074
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
02_MultiMIR/MultiMiR.R
+16
-4
16 additions, 4 deletions
02_MultiMIR/MultiMiR.R
04_Cytoscape/extract_mrna_names_from_mirna.R
+25
-5
25 additions, 5 deletions
04_Cytoscape/extract_mrna_names_from_mirna.R
with
41 additions
and
9 deletions
02_MultiMIR/MultiMiR.R
+
16
−
4
View file @
88474808
library
(
readxl
)
# Load required libraries
library
(
multiMiR
)
library
(
readxl
)
# For reading data from Excel files
library
(
writexl
)
library
(
multiMiR
)
# For querying validated miRNA-mRNA interactions
library
(
writexl
)
# For writing data to Excel files
# Read data from an Excel file named "miRNAmRNA.xlsx" and store it in the "new_list" variable.
new_list
<-
read_excel
(
"miRNAmRNA.xlsx"
,
header
=
TRUE
)
new_list
<-
read_excel
(
"miRNAmRNA.xlsx"
,
header
=
TRUE
)
# Get validated miRNA-mRNA interactions using the "multiMiR" package.
# In this case, the interactions are queried for human (hsa) miRNAs (mirnames) from the "validated" table.
# The results will be summarized and stored in the "multimir_results" variable.
multimir_results
<-
get_multimir
(
org
=
'hsa'
,
multimir_results
<-
get_multimir
(
org
=
'hsa'
,
mirna
=
mirnames
,
mirna
=
mirnames
,
table
=
'validated'
,
table
=
'validated'
,
summary
=
TRUE
)
summary
=
TRUE
)
# Display the first few rows of the "multimir_results" data to get an overview of the miRNA-mRNA interactions.
head
(
multimir_results
@
data
)
head
(
multimir_results
@
data
)
# Extract the results of miRNA-mRNA interactions from the "multimir_results" variable and store them in the "targets" variable.
targets
<-
multimir_results
@
data
targets
<-
multimir_results
@
data
# Specify the Excel file name where the results will be saved.
excel_file
<-
"multimir_results.xlsx"
excel_file
<-
"multimir_results.xlsx"
write_xlsx
(
targets
,
path
=
excel_file
)
\ No newline at end of file
# Write the "targets" data to an Excel file with the specified file name.
write_xlsx
(
targets
,
path
=
excel_file
)
This diff is collapsed.
Click to expand it.
04_Cytoscape/extract_mrna_names_from_mirna.R
+
25
−
5
View file @
88474808
library
(
readxl
)
# Load required libraries
library
(
multiMiR
)
library
(
readxl
)
# For reading data from Excel files
library
(
writexl
)
library
(
multiMiR
)
# For querying validated miRNA-mRNA interactions
library
(
writexl
)
# For writing data to Excel files
# Read data from an Excel file named "miRNAmRNA.xlsx" and store it in the "new_list" variable.
new_list
<-
read_excel
(
"C:/Users/Emre/Desktop/miRNAmRNA.xlsx"
,
header
=
TRUE
)
new_list
<-
read_excel
(
"C:/Users/Emre/Desktop/miRNAmRNA.xlsx"
,
header
=
TRUE
)
# Get validated miRNA-mRNA interactions using the "multiMiR" package.
# In this case, the interactions are queried for human (hsa) miRNAs (mirnames) from the "validated" table.
# The results will be summarized and stored in the "multimir_results" variable.
multimir_results
<-
get_multimir
(
org
=
'hsa'
,
multimir_results
<-
get_multimir
(
org
=
'hsa'
,
mirna
=
mirnames
,
mirna
=
mirnames
,
table
=
'validated'
,
table
=
'validated'
,
summary
=
TRUE
)
summary
=
TRUE
)
# Display the first few rows of the "multimir_results" data to get an overview of the miRNA-mRNA interactions.
head
(
multimir_results
@
data
)
head
(
multimir_results
@
data
)
# Extract the results of miRNA-mRNA interactions from the "multimir_results" variable and store them in the "targets" variable.
targets
<-
multimir_results
@
data
targets
<-
multimir_results
@
data
# Specify the Excel file path where the results will be saved.
excel_file
<-
"C:/Users/Emre/Desktop/Bioinformatik/Bioinformatik 2.Semester Master/Data Science in the Life Sciences/Project/multimir_results.xlsx"
excel_file
<-
"C:/Users/Emre/Desktop/Bioinformatik/Bioinformatik 2.Semester Master/Data Science in the Life Sciences/Project/multimir_results.xlsx"
write_xlsx
(
targets
,
path
=
excel_file
)
# Write the "targets" data to an Excel file with the specified file path.
write_xlsx
(
targets
,
path
=
excel_file
)
# Read data from the "multimir_results_cyto.xlsx" file into the "df" variable.
df
<-
read_excel
(
"C:/Users/Emre/Desktop/multimir_results_cyto.xlsx"
)
df
<-
read_excel
(
"C:/Users/Emre/Desktop/multimir_results_cyto.xlsx"
)
# Read data from the "mRNAs.xlsx" file into the "mrna" variable.
mrna
<-
read_excel
(
"C:/Users/Emre/Desktop/mRNAs.xlsx"
)
mrna
<-
read_excel
(
"C:/Users/Emre/Desktop/mRNAs.xlsx"
)
# Extract the external gene names from the "mrna" data and store them in the "mrna_genes" variable.
mrna_genes
<-
mrna
$
external_gene_name
mrna_genes
<-
mrna
$
external_gene_name
# Filter the "df" data based on whether the "target_symbol" column contains gene names present in the "mrna_genes" variable.
filtered_df
<-
df
[
df
$
target_symbol
%in%
mrna_genes
|
duplicated
(
df
$
target_symbol
)
%in%
mrna_genes
,
]
filtered_df
<-
df
[
df
$
target_symbol
%in%
mrna_genes
|
duplicated
(
df
$
target_symbol
)
%in%
mrna_genes
,
]
# Print the filtered data.
print
(
filtered_df
)
print
(
filtered_df
)
output_file
<-
(
"C:/Users/Emre/Desktop/cytoscape.xlsx"
)
# Specify the output Excel file path where the filtered data will be saved.
output_file
<-
"C:/Users/Emre/Desktop/cytoscape.xlsx"
# Write the filtered data to an Excel file with the specified file path.
write_xlsx
(
filtered_df
,
output_file
)
write_xlsx
(
filtered_df
,
output_file
)
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