Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
98 commits
Select commit Hold shift + click to select a range
d8df6b1
Fix bug on custom path
VergaJU Jul 7, 2023
38ba530
Merge pull request #1 from VergaJU/fix_path
GuerreroVazquez Feb 5, 2024
14e56ee
Merge pull request #2 from Kathyren/master
GuerreroVazquez Feb 13, 2024
aa9d308
networks data
GuerreroVazquez Jun 25, 2024
e195e5b
networks data_adding TF data
GuerreroVazquez Jun 25, 2024
dd42e41
Update main_pipeline.py
GuerreroVazquez Jun 25, 2024
ff1748f
Add direction to network and evaluate nodes and edges
GuerreroVazquez Jun 26, 2024
0f60c4c
add the pathways to the nodes
GuerreroVazquez Jun 26, 2024
2fbc653
add_pathways_to_nodes
GuerreroVazquez Jun 26, 2024
a4443ab
add TF to network
GuerreroVazquez Jun 26, 2024
8e06f4d
add_DDS_data
GuerreroVazquez Jun 27, 2024
4b0ed2d
Weigth mirna must be negative
GuerreroVazquez Jun 27, 2024
f402cbb
network_style cytoscape
GuerreroVazquez Jul 2, 2024
65a5e37
Update main_pipeline.py
GuerreroVazquez Jul 2, 2024
f4a16c1
random_walk
GuerreroVazquez Jul 2, 2024
5c47c5e
notebooks
GuerreroVazquez Jul 4, 2024
ae51be1
generat_more_pr_filter_network
GuerreroVazquez Jul 4, 2024
9a3a3a9
Update .gitignore
GuerreroVazquez Jul 4, 2024
b9bc7e7
select_next_valid_node
GuerreroVazquez Jul 4, 2024
8f9c988
Update test_network.py
GuerreroVazquez Jul 4, 2024
be150e1
Update requirements.txt
GuerreroVazquez Jul 4, 2024
401cbb7
walking_network_to_pick_mirs
GuerreroVazquez Jul 4, 2024
aa2f11c
n
GuerreroVazquez Jul 16, 2024
19baaea
prepate funtons for noteboods
GuerreroVazquez Jul 19, 2024
abe3e82
process
GuerreroVazquez Jul 20, 2024
697eeba
Update Tissue-DE-Network.ipynb
GuerreroVazquez Jul 23, 2024
494b580
a lot
GuerreroVazquez Aug 2, 2024
0e4f0e5
Update main_pipeline.py
GuerreroVazquez Aug 2, 2024
9332e33
Update jupyter_functions.py
GuerreroVazquez Nov 14, 2024
cf4a198
looking at the network weights noteboks
GuerreroVazquez Jan 10, 2025
f67b6a0
missed from previous commit
GuerreroVazquez Jan 10, 2025
b6c9330
network processing does not need the main, but it does need a test
GuerreroVazquez Jan 10, 2025
140d7ab
New network analysis
GuerreroVazquez Jan 14, 2025
0c70e83
Network before refactor
GuerreroVazquez Feb 25, 2025
9a89688
Update .gitignore
GuerreroVazquez Feb 25, 2025
a7728be
Update .gitignore
GuerreroVazquez Feb 25, 2025
14dd02f
Delete graph1_Analysis_Sarcopenia.cyjs.png
GuerreroVazquez Feb 25, 2025
e757d79
Update main_pipeline.py
GuerreroVazquez Feb 25, 2025
2e17f3a
Modify tissue to work with cell as well
GuerreroVazquez Feb 25, 2025
339a600
Get the parameters dinalically
GuerreroVazquez Feb 25, 2025
4af3ab6
Addind the dinamic paths_removing hard code
GuerreroVazquez Feb 25, 2025
6c4d13e
Testing with an old pkl for now. Need to remove it
GuerreroVazquez Feb 25, 2025
70720b8
refactor of test for network, ready to apply and test changes
GuerreroVazquez Feb 27, 2025
a1342c2
Dock strings
GuerreroVazquez Feb 27, 2025
e0d8865
add the option to open en cytoscape at the end
GuerreroVazquez Feb 27, 2025
0cdaec9
open w cytoscape
GuerreroVazquez Feb 27, 2025
886360e
Check for the correct properties of the node
GuerreroVazquez Feb 27, 2025
714f06b
Test for the integrity of the nodes (relevant to add better the meta…
GuerreroVazquez Feb 27, 2025
cb563a3
Add metadata
GuerreroVazquez Mar 2, 2025
8379558
Weigth
GuerreroVazquez Mar 2, 2025
d5d2cc9
Summing everything up
GuerreroVazquez Mar 2, 2025
63a7c29
Update main_pipeline.py
GuerreroVazquez Mar 10, 2025
53066bc
Change weight edges
GuerreroVazquez Mar 10, 2025
c058c6c
Update metadata.yml
GuerreroVazquez Mar 10, 2025
600caaa
Update test_networks_integrity.py
GuerreroVazquez Mar 10, 2025
b517928
Configuring to better network
GuerreroVazquez Mar 10, 2025
b6c963a
mirna_scoring
GuerreroVazquez Mar 10, 2025
d264b71
Preparing the testings
GuerreroVazquez Mar 11, 2025
5d77893
Update Muscle_wasting.iml
GuerreroVazquez Mar 11, 2025
3f77445
Update .gitignore
GuerreroVazquez Mar 11, 2025
fe40e67
testing mirnas score
GuerreroVazquez Mar 11, 2025
9fd6824
Update test_mirna_impact.py
GuerreroVazquez Mar 12, 2025
7525976
Changing the path scoring
GuerreroVazquez Mar 12, 2025
d6a9a1f
Getting the scorings for mirnas
GuerreroVazquez Mar 14, 2025
eb87848
evalaute mirnas
GuerreroVazquez Mar 15, 2025
58818be
valuate the mirnas
GuerreroVazquez Mar 18, 2025
b6d98e0
Normalized dds, tf and pathway enrichment
GuerreroVazquez Mar 18, 2025
af4c221
impacts
GuerreroVazquez Mar 18, 2025
d7626ec
get the scores mirnas
GuerreroVazquez Mar 18, 2025
188cb59
Move unnecessary functions
GuerreroVazquez Mar 19, 2025
52ba8fa
Display mini network
GuerreroVazquez Mar 19, 2025
7c09327
printing the subnetwork
GuerreroVazquez Mar 19, 2025
86b890c
finish scoring
GuerreroVazquez Mar 20, 2025
f7075f4
mirkitten
GuerreroVazquez Mar 24, 2025
1106e15
show_scorings
GuerreroVazquez Mar 24, 2025
8d2eac1
Add distance consideration
GuerreroVazquez Mar 24, 2025
bff4581
Update test_networks_integrity.py
GuerreroVazquez Mar 24, 2025
c9f8327
Finishing scoring
GuerreroVazquez Mar 26, 2025
42c29b1
Update .gitignore
GuerreroVazquez Apr 4, 2025
a5b971f
Clossing
GuerreroVazquez Apr 4, 2025
a82a7c3
Create plot_TF.py
GuerreroVazquez Jun 13, 2025
03718a9
TF individually run
GuerreroVazquez Jun 13, 2025
a256f38
delete files
GuerreroVazquez Jun 13, 2025
a39e509
cleaning my changes
GuerreroVazquez Jun 13, 2025
da049c3
Delete mirnas_influence_REPORT.ipynb
GuerreroVazquez Jun 13, 2025
6395203
Add the option to get the DEG
GuerreroVazquez Jun 18, 2025
e2bc4f0
Add files via upload
GuerreroVazquez Jun 18, 2025
19f626f
Create README.md
GuerreroVazquez Jun 18, 2025
c8082b6
logging
GuerreroVazquez Jun 19, 2025
89f1c4a
more logging and details
GuerreroVazquez Jun 19, 2025
26420e3
Update README.md
GuerreroVazquez Jun 19, 2025
8363292
Update README.md
GuerreroVazquez Jun 19, 2025
ada9ab8
Just to have a script also for scoring
GuerreroVazquez Jun 19, 2025
858bf79
Hact to run and count outside of the pipeline
GuerreroVazquez Jun 19, 2025
84cdade
RUn all the configuration I set up for the test
GuerreroVazquez Jun 24, 2025
46bbe0e
Fixed some errors on paths
GuerreroVazquez Jun 24, 2025
15c4e7e
Adding personalization to the DDS
GuerreroVazquez Jun 24, 2025
2643d95
Adding the socring as well
GuerreroVazquez Jun 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,39 @@ network/graph1_STRING_Magagnes20092default node.csv
.idea/misc.xml
.idea/Muscle_wasting.iml
*.bkp
*.sif
network/Sessions/*
*.png
*.gif
*.png
network/.ipynb_checkpoints/*
network/.ipynb_checkpoints/mirnas_influence_01-checkpoint.ipynb
network/.ipynb_checkpoints/mirnas_influence_02-checkpoint.ipynb
network/.ipynb_checkpoints/mirnas_influence_03_90-checkpoint.ipynb
.virtual_documents/*
network/data/inmune_genes_symbol.txt
network/.virtual_documents/Untitled.ipynb
.idea/Muscle_wasting.iml
.ipynb_checkpoints/Untitled-checkpoint.ipynb
*.tsv
*.txt
database_analysis/sql_operations.py
*.jpg
*.png
*-checkpoint.ipynb
mirna_scoring/notebooks/.virtual_documents/*
*#
*.html
UseCases/*
*.ipynb
*.js
*.svg
*.ods
*.css
*.ipynb
mirna_scoring/.ipynb_checkpoints/mirna_influence_plots-checkpoint.py
mirna_scoring/.ipynb_checkpoints/jupyter_functions-checkpoint.py
mirna_scoring/.ipynb_checkpoints/mirna_impact-checkpoint.py
mirkitten/.ipynb_checkpoints/run_pathway-checkpoint.py
mirkitten/.ipynb_checkpoints/Pathway-checkpoint.py
mirkitten/data/.ipynb_checkpoints/dds_files-checkpoint.yml
2 changes: 1 addition & 1 deletion .idea/Muscle_wasting.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

273 changes: 273 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,273 @@

<body>

<h1>miRKat: microRNA Toolkit for Muscle Wasting and Aging</h1>

<p><strong>miRKat</strong> is a modular toolkit designed to explore, evaluate, and prioritize microRNAs (miRNAs) in muscle-related contexts, such as wasting (sarcopenia), regeneration, and aging. This pipeline integrates transcriptomic data, transcriptional networks, pathway analysis, and miRNA impact evaluation to identify key regulatory hotspots.</p>

<h2>🧭 Overview</h2>

<p>miRKat is built with three main modules:</p>

<ol>
<li>Pre-processing (mirkitten)</li>
<li>miRKat Network</li>
<li>miRKat Scoring</li>
</ol>

<h2>1. Pre-processing (mirkitten/)</h2>

<p>This module focuses on generating networks by combining differential expression analysis (DEA), transcription factor (TF) inference, and pathway enrichment analysis. The goal is to build a comprehensive network that captures the relationships between genes, TFs, and miRNAs.</p>

<ul>
<li><code>run_DDS.py</code>: Combines results from differential expression analysis.</li>
<li><code>run_DEG.py</code>: Identifies differentially expressed genes (DEGs).</li>
<li><code>run_TF.py</code>: Ranks transcription factors based on their activity.</li>
<li><code>run_pathway.py</code>: Performs pathway enrichment analysis to identify relevant biological pathways.</li>
<li><code>run_network_creation.py</code>: Generates the gene-TF-miRNA network by integrating the results from the previous steps.</li>
</ul>

<p>These scripts can be run individually or as a complete pipeline using the <code>run_network_creation.py</code> script.</p>

<h2>2. Network Evaluation (network/)</h2>

<p>The network evaluation module focuses on selecting relevant subnetworks from the larger network generated in the pre-processing step. This is achieved by defining specific criteria in a YAML configuration file or through command-line options. The module includes filters for pathways, TFs, and gene-level scores to refine the network and focus on the most relevant interactions.</p>

<ul>
<li><code>main_pipeline.py</code>: Selects relevant subnetworks based on user-defined criteria.</li>
</ul>

<h3>⚙️ <code>create_network</code> Parameters</h3>

<p>The <code>create_network</code> function (used by <code>main_pipeline.py</code>) accepts customizable parameters via command-line arguments or a YAML configuration file. These parameters define how the network is built, filtered, and enriched.</p>

<table>
<thead>
<tr>
<th>Parameter</th>
<th>Description</th>
<th>Example</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>dds_threshold</code></td>
<td>Minimum expression fold-change (log2) for gene filtering.</td>
<td><code>2</code></td>
</tr>
<tr>
<td><code>top_n_deg</code></td>
<td>Number of top differentially expressed genes to retain.</td>
<td><code>300</code></td>
</tr>
<tr>
<td><code>tf_score_cutoff</code></td>
<td>Minimum score for keeping transcription factors (used after TF ranking).</td>
<td><code>0.3</code></td>
</tr>
<tr>
<td><code>pathway_keywords</code></td>
<td>List of keywords used to select enriched biological pathways.</td>
<td><code>["MUSCLE", "MITO", "APOPTOSIS"]</code></td>
</tr>
<tr>
<td><code>include_mirna</code></td>
<td>Whether to include microRNAs in the network.</td>
<td><code>true</code></td>
</tr>
<tr>
<td><code>cutoff_score</code></td>
<td>Filter for edge confidence or importance in the final network.</td>
<td><code>0.95</code></td>
</tr>
<tr>
<td><code>input_deg_file</code></td>
<td>Path to a CSV file containing pre-computed DEGs (instead of running DEA).</td>
<td><code>"data/deg_results.csv"</code></td>
</tr>
<tr>
<td><code>expression_profiles</code></td>
<td>Path to expression matrix (tissue/cell-specific filtering).</td>
<td><code>"data/protein_atlas_tissue.csv"</code></td>
</tr>
<tr>
<td><code>cell_type_expression</code></td>
<td>Cell-type expression data (optional).</td>
<td><code>"data/muscle_cell_atlas.csv"</code></td>
</tr>
<tr>
<td><code>save_path</code></td>
<td>Output path to save the resulting network object (.pkl).</td>
<td><code>"Networks_pkl/network_case5.pkl"</code></td>
</tr>
<tr>
<td><code>usecase_name</code></td>
<td>Label to group outputs from the same run.</td>
<td><code>"UseCase_5"</code></td>
</tr>
</tbody>
</table>

<p>Parameters can be passed in a YAML config like:</p>

<pre><code>dds_threshold: 2
top_n_deg: 300
tf_score_cutoff: 0.3
pathway_keywords:
- MUSCLE
- MITO
- APOPTOSIS
include_mirna: true
cutoff_score: 0.95
save_path: network/Networks_pkl/case5_network.pkl
usecase_name: UseCase_5
</code></pre>

<p>To get the dynamic DE threshold for all the comparisons using stat:</p>

<pre><code>python mirkitten/run_network_creation.py --dds_files UseCases/UseCase0/dds_files.yml --save_name UseCases/UseCase0/usecase0.cyjs --only_DE True
</code></pre>

<p>To get the dynamic DE threshold for all the comparisons using log2FoldChange:</p>

<pre><code>python mirkitten/run_network_creation.py --dds_files UseCases/UseCase0/dds_files.yml --save_name UseCases/UseCase0/usecase0.cyjs --only_DE True --interest log2FoldChange
</code></pre>

<h2>3. miRNA Scoring (mirna_scoring/)</h2>

<p>The miRNA scoring module focuses on analyzing the influence of miRNAs using a combination of graph structure, differential expression, pathway associations, and clustering. The scoring functions are callable via Python, providing flexibility in how the miRNA influence is evaluated.</p>

<p>Usage examples can be found in the following notebook:</p>

<p><a href="https://github.com/GuerreroVazquez/Muscle_wasting/blob/GuerreroVazquez-master/network/mirnas_influence_00.ipynb" target="_blank">mirnas_influence_00.ipynb</a></p>

<h3>miRKAt Network Details</h3>

<p>This module generates a biologically relevant network connecting miRNAs, mRNAs, and transcription factors (TFs) by integrating curated interactions, differential expression data, pathway associations, tissue specificity, and scoring strategies. The network is built on a Cytoscape-compatible <code>.cyjs</code> base file, annotates nodes with relevant biological metadata, scores interactions based on relevance to the experimental context, and filters the network based on user-defined thresholds.</p>

<h4>Parameters</h4>

<table>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td><code>--input_cyjs</code></td>
<td>str</td>
<td>Path to the base network in <code>.cyjs</code> format.</td>
</tr>
<tr>
<td><code>--tissue</code></td>
<td>str</td>
<td>Target tissue or cell type for annotation (e.g., "Vastus Lateralis").</td>
</tr>
<tr>
<td><code>--pathway_db</code></td>
<td>str</td>
<td>Pathway database to use for scoring relevance (e.g., KEGG, Reactome).</td>
</tr>
<tr>
<td><code>--expression_file</code></td>
<td>str</td>
<td>CSV file with differential expression scores (gene or miRNA-level).</td>
</tr>
<tr>
<td><code>--score_weights</code></td>
<td>dict</td>
<td>User-defined weights for scoring features (e.g., pathway match, DEG status).</td>
</tr>
<tr>
<td><code>--tf_database</code></td>
<td>str</td>
<td>Optional TF annotation file (if not in SQL backend).</td>
</tr>
<tr>
<td><code>--filter_threshold</code></td>
<td>float</td>
<td>Cutoff value to retain nodes based on their final score.</td>
</tr>
<tr>
<td><code>--output_name</code></td>
<td>str</td>
<td>Prefix for output files (e.g., "VL_miRNet").</td>
</tr>
</table>

<h4>Usage Example</h4>

<pre><code>python main_pipeline.py \
--input_cyjs base_network.cyjs \
--tissue "Vastus Lateralis" \
--pathway_db reactome.db \
--expression_file VL_DEG_scores.csv \
--score_weights '{"deg": 1.5, "pathway": 1.0, "tissue": 1.2}' \
--tf_database tf_data.csv \
--filter_threshold 2.0 \
--output_name VL_miRNet
</code></pre>

<h4>Output Description</h4>

<ul>
<li><code>VL_miRNet_filtered.cyjs</code>: Cytoscape-ready filtered and weighted network.</li>
<li><code>VL_miRNet_scores.csv</code>: CSV file with node and edge scores and metadata annotations.</li>
<li><code>VL_miRNet_report.txt</code>: Summary log with counts of nodes, edges, filtering steps, and key statistics.</li>
<li>Optional visualizations (if enabled): subnetwork plots, score distributions, or TF–miRNA–gene hubs.</li>
</ul>

<h3>miRKAt Scoring Details</h3>

<p>In the final module, after personalizing the data and creating a smaller network, the focus shifts to identifying the microRNAs that most significantly impact your interests. Random walks can be performed to calculate the impact of miRNAs on the network, and clustering can help identify redundancy among the miRNAs.</p>

<p>Results can be generated in HTML format for separate viewing. An example of use can be seen in:</p>

<p><a href="https://github.com/GuerreroVazquez/Muscle_wasting/blob/GuerreroVazquez-master/mirna_scoring/notebooks/Evaluate_mirs/UseCase_n.ipynb">UseCase_n.ipynb</a></p>

<h3>📊 Optional DEA</h3>

<p>While DEA (Differential Expression Analysis) based on age groups (young, middle-aged, old) can be performed with <code>run_DEA.py</code>, it is <em>not</em> a required step for using miRKat. It is included to support aging-related use cases, such as muscle aging clocks.</p>

<h3>🔍 Customization</h3>

<p>miRKat supports personalisation through user-provided expression data for tissues and cell types:</p>

<ul>
<li>Tissue data: <a href="https://www.proteinatlas.org/humanproteome/tissue" target="_blank">Human Protein Atlas</a></li>
<li>Muscle cell types: <a href="https://www.muscleageingcellatlas.org/" target="_blank">Human Muscle Cell Atlas</a></li>
</ul>

<h3>📁 Repository Structure</h3>

<ul>
<li><code>mirkitten/</code>: Pre-processing scripts</li>
<li><code>network/</code>: Evaluation of subnetworks and filtering</li>
<li><code>mirna_scoring/</code>: Analysis and scoring of miRNA influence</li>
<li><code>UseCases/</code>: YAML configs and examples for running workflows</li>
</ul>

<h3>📌 Example Usage for miRNA Scoring</h3>

<pre><code># Load and evaluate a network
import mirna_scoring.mirna_impact as mis
from network.network_processing import load_graph

network = load_graph("network/Networks_pkl/complete_n_tf_mirnas__UseCase5_cutoff_0.95.pkl")
evaluation = mis.mirna_evaluation(mis.mirna_network(network), session_name='UseCase_5')

# Score miRNAs
evaluation_df = evaluation.score(steps=10, sample_size=10, dds_threshold=2,
pathway_keywords=["MUSCLE", "MITO", "APOPTOSIS"])

# Cluster and plot
evaluation.cluster_mirnas(n_clusters=len(evaluation.get_all_mirnas())//3)
</code></pre>

<p>See the notebook for full visualization steps using UMAP, pathway enrichment, and final reporting.</p>

<h2>📜 License</h2>
<p>MIT License</p>

</body>
</html>
33 changes: 33 additions & 0 deletions Untitled.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"id": "486d047d-301c-4b20-adb0-e8d658f5bc87",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.7"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Loading