├── .DS_Store ├── .gitignore ├── LinkData ├── .DS_Store ├── __init__.py ├── __pycache__ │ ├── __init__.cpython-37.pyc │ ├── __init__.cpython-38.pyc │ ├── admin.cpython-37.pyc │ ├── admin.cpython-38.pyc │ ├── models.cpython-37.pyc │ ├── models.cpython-38.pyc │ ├── statannot.cpython-38.pyc │ └── tasks.cpython-38.pyc ├── admin.py ├── apps.py ├── forms.py ├── migrations │ ├── 0001_initial.py │ ├── 0002_remove_datacollect_dataset_id.py │ ├── 0003_datacollect_dataset_id.py │ ├── 0004_auto_20200418_1852.py │ ├── 0005_auto_20200419_2023.py │ ├── 0006_uploadgenefile.py │ ├── 0007_datacollect_celltype.py │ ├── 0008_auto_20200603_2139.py │ ├── 0009_datacollect_primary.py │ ├── 0010_auto_20200625_1302.py │ ├── 0011_auto_20200703_0603.py │ ├── 0012_auto_20200703_0630.py │ ├── __init__.py │ └── __pycache__ │ │ ├── 0001_initial.cpython-37.pyc │ │ ├── 0001_initial.cpython-38.pyc │ │ ├── 0002_delete_runinfo.cpython-37.pyc │ │ ├── 0002_delete_runinfo.cpython-38.pyc │ │ ├── 0002_remove_datacollect_dataset_id.cpython-38.pyc │ │ ├── 0003_datacollect_dataset_id.cpython-38.pyc │ │ ├── 0003_runinfo.cpython-37.pyc │ │ ├── 0003_runinfo.cpython-38.pyc │ │ ├── 0004_auto_20200418_1852.cpython-38.pyc │ │ ├── 0004_delete_runinfo.cpython-37.pyc │ │ ├── 0004_delete_runinfo.cpython-38.pyc │ │ ├── 0005_auto_20200419_2023.cpython-38.pyc │ │ ├── 0006_uploadgenefile.cpython-38.pyc │ │ ├── 0007_datacollect_celltype.cpython-38.pyc │ │ ├── 0008_auto_20200603_2139.cpython-38.pyc │ │ ├── 0009_auto_20200621_0938.cpython-38.pyc │ │ ├── 0009_datacollect_primary.cpython-38.pyc │ │ ├── 0010_auto_20200621_0940.cpython-38.pyc │ │ ├── 0010_auto_20200625_1302.cpython-38.pyc │ │ ├── 0011_auto_20200621_0946.cpython-38.pyc │ │ ├── 0011_auto_20200703_0603.cpython-38.pyc │ │ ├── 0012_auto_20200703_0630.cpython-38.pyc │ │ ├── __init__.cpython-37.pyc │ │ └── __init__.cpython-38.pyc ├── models.py ├── statannot.py ├── tasks.py ├── tests.py └── views.py ├── RASC ├── __init__.py ├── __pycache__ │ ├── __init__.cpython-37.pyc │ ├── __init__.cpython-38.pyc │ ├── celery.cpython-37.pyc │ ├── celery.cpython-38.pyc │ ├── settings.cpython-37.pyc │ ├── settings.cpython-38.pyc │ ├── urls.cpython-37.pyc │ ├── urls.cpython-38.pyc │ ├── view.cpython-37.pyc │ ├── view.cpython-38.pyc │ ├── wsgi.cpython-37.pyc │ └── wsgi.cpython-38.pyc ├── celery.py ├── settings.py ├── urls.py ├── view.py └── wsgi.py ├── README.md ├── code ├── .DS_Store ├── 0_GEO_Parser │ ├── .DS_Store │ ├── README.md │ ├── dc2 │ │ ├── datacollection │ │ │ ├── __init__.py │ │ │ ├── admin.py │ │ │ ├── apps.py │ │ │ ├── migrations │ │ │ │ ├── 0001_initial.py │ │ │ │ ├── __init__.py │ │ │ │ └── __pycache__ │ │ │ │ │ ├── 0001_initial.cpython-38.pyc │ │ │ │ │ └── __init__.cpython-38.pyc │ │ │ ├── models.py │ │ │ ├── tests.py │ │ │ └── views.py │ │ ├── dc2 │ │ │ ├── __init__.py │ │ │ ├── asgi.py │ │ │ ├── settings.py │ │ │ ├── urls.py │ │ │ └── wsgi.py │ │ └── manage.py │ ├── downloadSuppGSE.py │ ├── env.py │ ├── getGEOSamples_byType_gse.py │ ├── platform.txt │ ├── pubmed.py │ ├── requirement.yaml │ ├── run.sh │ ├── scrna_parser_detail_gse.py │ ├── scrna_parser_from_gse.py │ ├── scrna_parser_runner.py │ ├── singleCell_parser_annotation_reference.sql │ └── sup_info_gse_local.py ├── 1_MAESTRO_AnalysisPipeline │ ├── .DS_Store │ ├── Example │ │ ├── UCEC_GSE139555.R │ │ └── UCEC_GSE139555.sh │ ├── MAESTRO_AnalysisPipeline.sh │ └── inferCNV │ │ ├── inferCNV.R │ │ └── inferCNV_gene_order_file.txt ├── 2_Annotation │ ├── .DS_Store │ ├── Annotation_level1.R │ ├── Annotation_level3.R │ └── Signature │ │ ├── DC_subset_signature.txt │ │ └── Tcell_subset_signature.txt ├── 3_GSEA │ ├── .DS_Store │ ├── gmt │ │ ├── c2.cp.kegg.v7.1.symbols.gmt │ │ ├── c2.cp.kegg.v7.1.symbols_mouse.gmt │ │ ├── h.all.v7.1.symbols.gmt │ │ └── h.all.v7.1.symbols_mouse.gmt │ └── src │ │ ├── .DS_Store │ │ ├── cluster_level │ │ ├── TISCH_cluster_level_GSEA_heatmap.R │ │ ├── cluster_cell_DE.R │ │ ├── run_cluster_GSEA.sh │ │ ├── submit_cluster_cell_DE.sh │ │ └── submit_run_GSEA.sh │ │ └── meta_level │ │ ├── TISCH_meta_level_GSEA_heatmap.R │ │ ├── meta_cluster_DE.R │ │ ├── meta_cluster_GSEA.sh │ │ ├── submit_meta_DE.sh │ │ └── submit_meta_GSEA.sh ├── 4_Prepare_TISCHFile │ ├── 4.1_Generate_Exprmat.R │ ├── 4.2_Migrate_File.py │ ├── 4.3_Generate_UMAP_Meta.py │ ├── 4.4_Generate_DownloadFile.py │ └── 4.5_Generate_UMAP_Gene.py ├── 5_rsync.sh └── README.md ├── manage.py ├── media └── .DS_Store ├── scRNA_DC_mannual_latest_beta.txt ├── static ├── commondata │ ├── Celltype_abbr.json │ ├── Human_mouse_gene.json │ └── Mouse_human_gene.json ├── css │ ├── ion.rangeSlider.css │ ├── main.css │ ├── rSlider.min.css │ ├── select2-bootstrap.css │ └── selectize.bootstrap4.css ├── image │ ├── Celltype_annotation.png │ ├── TISCH.gif │ ├── TISCH.png │ ├── TISCH_2.gif │ ├── TISCH_data_summary.png │ ├── TISCH_workflow.png │ ├── background.svg │ ├── document │ │ ├── dataset_filter.png │ │ ├── dataset_gene.png │ │ ├── dataset_gene_violin.png │ │ ├── dataset_gsea.png │ │ ├── dataset_multiple.png │ │ ├── dataset_return.png │ │ ├── dataset_single.png │ │ ├── gene_result.png │ │ ├── gene_search.png │ │ ├── home_cancer.png │ │ └── home_gene.png │ ├── loading.gif │ └── tissue │ │ ├── Humanbody.png │ │ ├── bladder.png │ │ ├── bladder.svg │ │ ├── blood.png │ │ ├── blood.svg │ │ ├── bone.png │ │ ├── bone.svg │ │ ├── brain.png │ │ ├── brain.svg │ │ ├── breast.png │ │ ├── breast.svg │ │ ├── colon.png │ │ ├── colon.svg │ │ ├── eye.png │ │ ├── eye.svg │ │ ├── head.png │ │ ├── head.svg │ │ ├── human.png │ │ ├── kidney.png │ │ ├── kidney.svg │ │ ├── liver.png │ │ ├── liver.svg │ │ ├── lung.png │ │ ├── lung.svg │ │ ├── lymphnode.png │ │ ├── lymphnode.svg │ │ ├── nerve.png │ │ ├── nerve.svg │ │ ├── pancreas.png │ │ ├── pancreas.svg │ │ ├── pelvic.png │ │ ├── pelvic.svg │ │ ├── skin.png │ │ ├── skin.svg │ │ ├── soft.png │ │ ├── stomach.png │ │ └── stomach.svg └── js │ ├── jquery-3.4.1.min.js │ ├── plot.js │ └── rSlider.min.js ├── templates ├── data.html ├── dataset.html ├── dataset_gene.html ├── dataset_gene_0.html ├── doc.html ├── gallery.html ├── gallery_0.html ├── gallery_gene.html ├── gallery_gene_0.html ├── gene.html ├── gene_0.html ├── index.html └── statistics.html ├── tisch_beta.sql └── webserver_environment_latest.yml /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/.DS_Store -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | -------------------------------------------------------------------------------- /LinkData/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/LinkData/.DS_Store -------------------------------------------------------------------------------- /LinkData/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/LinkData/__init__.py -------------------------------------------------------------------------------- /LinkData/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/LinkData/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /LinkData/__pycache__/__init__.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/LinkData/__pycache__/__init__.cpython-38.pyc -------------------------------------------------------------------------------- /LinkData/__pycache__/admin.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/LinkData/__pycache__/admin.cpython-37.pyc -------------------------------------------------------------------------------- /LinkData/__pycache__/admin.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/LinkData/__pycache__/admin.cpython-38.pyc -------------------------------------------------------------------------------- /LinkData/__pycache__/models.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/LinkData/__pycache__/models.cpython-37.pyc -------------------------------------------------------------------------------- /LinkData/__pycache__/models.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/LinkData/__pycache__/models.cpython-38.pyc -------------------------------------------------------------------------------- /LinkData/__pycache__/statannot.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/LinkData/__pycache__/statannot.cpython-38.pyc -------------------------------------------------------------------------------- /LinkData/__pycache__/tasks.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/LinkData/__pycache__/tasks.cpython-38.pyc -------------------------------------------------------------------------------- /LinkData/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /LinkData/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class LinkdataConfig(AppConfig): 5 | name = 'LinkData' 6 | -------------------------------------------------------------------------------- /LinkData/forms.py: -------------------------------------------------------------------------------- 1 | from django import forms 2 | 3 | class ViewOptions(): 4 | -------------------------------------------------------------------------------- /LinkData/migrations/0001_initial.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.0.4 on 2020-04-03 16:47 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | initial = True 9 | 10 | dependencies = [ 11 | ] 12 | 13 | operations = [ 14 | migrations.CreateModel( 15 | name='DataCollect', 16 | fields=[ 17 | ('dataset_name', models.CharField(db_column='Dataset Name', max_length=100, primary_key=True, serialize=False)), 18 | ('dataset_id', models.CharField(db_column='Dataset ID', max_length=50)), 19 | ('cancer', models.CharField(db_column='Cancer Type', max_length=50)), 20 | ('platform', models.CharField(db_column='Platform', max_length=50)), 21 | ('patient', models.IntegerField(db_column='Patient Number')), 22 | ('cell', models.IntegerField(db_column='Cell Number')), 23 | ('publication', models.CharField(db_column='Publication', max_length=100)), 24 | ('pmid', models.CharField(db_column='PMID', max_length=20)), 25 | ], 26 | ), 27 | migrations.CreateModel( 28 | name='ExpLISA', 29 | fields=[ 30 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 31 | ('dataset', models.CharField(db_column='Dataset ID', max_length=50)), 32 | ('cancer', models.CharField(db_column='Cancer Type', max_length=50)), 33 | ('subcluster', models.CharField(db_column='Subcluster', max_length=50)), 34 | ('tf', models.CharField(db_column='Transcription Factor', max_length=20)), 35 | ('expression', models.DecimalField(db_column='Expression', decimal_places=2, max_digits=5)), 36 | ('regscore', models.DecimalField(db_column='Regulatory Score', decimal_places=2, max_digits=5)), 37 | ('cluster', models.CharField(db_column='Cluster', max_length=50)), 38 | ('highexprsc', models.SmallIntegerField(db_column='HighExprSC')), 39 | ('highrp', models.SmallIntegerField(db_column='HighRP')), 40 | ('highexprlm22', models.SmallIntegerField(db_column='HighExprLM22')), 41 | ('highexprgse60424', models.SmallIntegerField(db_column='HighExprGSE60424')), 42 | ('highexprcomb', models.SmallIntegerField(db_column='HighExprComb')), 43 | ], 44 | ), 45 | migrations.CreateModel( 46 | name='tsnePath', 47 | fields=[ 48 | ('cancer', models.CharField(db_column='Cancer Type', max_length=50)), 49 | ('dataset', models.CharField(db_column='Dataset ID', max_length=50, primary_key=True, serialize=False)), 50 | ('original', models.CharField(db_column='Original tsne', max_length=300)), 51 | ('annotate', models.CharField(db_column='Annotated tsne', max_length=300)), 52 | ], 53 | ), 54 | ] 55 | -------------------------------------------------------------------------------- /LinkData/migrations/0002_remove_datacollect_dataset_id.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.0.4 on 2020-04-03 16:52 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('LinkData', '0001_initial'), 10 | ] 11 | 12 | operations = [ 13 | migrations.RemoveField( 14 | model_name='datacollect', 15 | name='dataset_id', 16 | ), 17 | ] 18 | -------------------------------------------------------------------------------- /LinkData/migrations/0003_datacollect_dataset_id.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.0.4 on 2020-04-03 16:54 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('LinkData', '0002_remove_datacollect_dataset_id'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='datacollect', 15 | name='dataset_id', 16 | field=models.CharField(db_column='Dataset ID', default='id', max_length=50), 17 | preserve_default=False, 18 | ), 19 | ] 20 | -------------------------------------------------------------------------------- /LinkData/migrations/0004_auto_20200418_1852.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.0.4 on 2020-04-18 18:52 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('LinkData', '0003_datacollect_dataset_id'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='datacollect', 15 | name='dataset_type', 16 | field=models.CharField(choices=[('TME', 'TME'), ('ICB', 'ICB')], db_column='Dataset Type', default='TME', max_length=20), 17 | ), 18 | migrations.AddField( 19 | model_name='datacollect', 20 | name='species', 21 | field=models.CharField(choices=[('Human', 'Human'), ('Mouse', 'Mouse')], db_column='Species', default='Human', max_length=20), 22 | ), 23 | migrations.AddField( 24 | model_name='datacollect', 25 | name='treatment', 26 | field=models.CharField(db_column='Treatment', default='None', max_length=50), 27 | ), 28 | ] 29 | -------------------------------------------------------------------------------- /LinkData/migrations/0005_auto_20200419_2023.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.0.4 on 2020-04-19 20:23 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('LinkData', '0004_auto_20200418_1852'), 10 | ] 11 | 12 | operations = [ 13 | migrations.DeleteModel( 14 | name='ExpLISA', 15 | ), 16 | migrations.DeleteModel( 17 | name='tsnePath', 18 | ), 19 | ] 20 | -------------------------------------------------------------------------------- /LinkData/migrations/0006_uploadgenefile.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.0.4 on 2020-04-19 20:32 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('LinkData', '0005_auto_20200419_2023'), 10 | ] 11 | 12 | operations = [ 13 | migrations.CreateModel( 14 | name='UploadGeneFile', 15 | fields=[ 16 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 17 | ('genefile', models.FileField(db_column='Gene File', upload_to='upload/')), 18 | ], 19 | ), 20 | ] 21 | -------------------------------------------------------------------------------- /LinkData/migrations/0007_datacollect_celltype.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.0.4 on 2020-05-20 17:02 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('LinkData', '0006_uploadgenefile'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='datacollect', 15 | name='celltype', 16 | field=models.CharField(db_column='Cell Type', default='None', max_length=1000), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /LinkData/migrations/0008_auto_20200603_2139.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.0.4 on 2020-06-03 21:39 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('LinkData', '0007_datacollect_celltype'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AlterField( 14 | model_name='datacollect', 15 | name='patient', 16 | field=models.IntegerField(db_column='Patient Number', null=True), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /LinkData/migrations/0009_datacollect_primary.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.0.4 on 2020-06-21 09:49 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('LinkData', '0008_auto_20200603_2139'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='datacollect', 15 | name='primary', 16 | field=models.CharField(db_column='Primary', default='None', max_length=50), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /LinkData/migrations/0010_auto_20200625_1302.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.0.4 on 2020-06-25 13:02 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('LinkData', '0009_datacollect_primary'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AlterField( 14 | model_name='datacollect', 15 | name='dataset_type', 16 | field=models.CharField(choices=[('TME', 'TME'), ('ICB', 'ICB'), ('Normal', 'Normal')], db_column='Dataset Type', default='TME', max_length=20), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /LinkData/migrations/0011_auto_20200703_0603.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.0.4 on 2020-07-03 06:03 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('LinkData', '0010_auto_20200625_1302'), 10 | ] 11 | 12 | operations = [ 13 | migrations.RemoveField( 14 | model_name='datacollect', 15 | name='treatment', 16 | ), 17 | migrations.AddField( 18 | model_name='datacollect', 19 | name='therapy', 20 | field=models.CharField(db_column='Therapy', default='None', max_length=50), 21 | ), 22 | migrations.AddField( 23 | model_name='datacollect', 24 | name='therapy_detailed', 25 | field=models.CharField(db_column='Detailed Therapy', default='None', max_length=50), 26 | ), 27 | ] 28 | -------------------------------------------------------------------------------- /LinkData/migrations/0012_auto_20200703_0630.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.0.4 on 2020-07-03 06:30 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('LinkData', '0011_auto_20200703_0603'), 10 | ] 11 | 12 | operations = [ 13 | migrations.RemoveField( 14 | model_name='datacollect', 15 | name='therapy', 16 | ), 17 | migrations.RemoveField( 18 | model_name='datacollect', 19 | name='therapy_detailed', 20 | ), 21 | migrations.AddField( 22 | model_name='datacollect', 23 | name='treatment', 24 | field=models.CharField(db_column='Treatment', default='None', max_length=50), 25 | ), 26 | migrations.AddField( 27 | model_name='datacollect', 28 | name='treatment_detailed', 29 | field=models.CharField(db_column='Detailed Treatment', default='None', max_length=50), 30 | ), 31 | ] 32 | -------------------------------------------------------------------------------- /LinkData/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/LinkData/migrations/__init__.py -------------------------------------------------------------------------------- /LinkData/migrations/__pycache__/0001_initial.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/LinkData/migrations/__pycache__/0001_initial.cpython-37.pyc -------------------------------------------------------------------------------- /LinkData/migrations/__pycache__/0001_initial.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/LinkData/migrations/__pycache__/0001_initial.cpython-38.pyc -------------------------------------------------------------------------------- /LinkData/migrations/__pycache__/0002_delete_runinfo.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/LinkData/migrations/__pycache__/0002_delete_runinfo.cpython-37.pyc -------------------------------------------------------------------------------- /LinkData/migrations/__pycache__/0002_delete_runinfo.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/LinkData/migrations/__pycache__/0002_delete_runinfo.cpython-38.pyc -------------------------------------------------------------------------------- /LinkData/migrations/__pycache__/0002_remove_datacollect_dataset_id.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/LinkData/migrations/__pycache__/0002_remove_datacollect_dataset_id.cpython-38.pyc -------------------------------------------------------------------------------- /LinkData/migrations/__pycache__/0003_datacollect_dataset_id.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/LinkData/migrations/__pycache__/0003_datacollect_dataset_id.cpython-38.pyc -------------------------------------------------------------------------------- /LinkData/migrations/__pycache__/0003_runinfo.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/LinkData/migrations/__pycache__/0003_runinfo.cpython-37.pyc -------------------------------------------------------------------------------- /LinkData/migrations/__pycache__/0003_runinfo.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/LinkData/migrations/__pycache__/0003_runinfo.cpython-38.pyc -------------------------------------------------------------------------------- /LinkData/migrations/__pycache__/0004_auto_20200418_1852.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/LinkData/migrations/__pycache__/0004_auto_20200418_1852.cpython-38.pyc -------------------------------------------------------------------------------- /LinkData/migrations/__pycache__/0004_delete_runinfo.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/LinkData/migrations/__pycache__/0004_delete_runinfo.cpython-37.pyc -------------------------------------------------------------------------------- /LinkData/migrations/__pycache__/0004_delete_runinfo.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/LinkData/migrations/__pycache__/0004_delete_runinfo.cpython-38.pyc -------------------------------------------------------------------------------- /LinkData/migrations/__pycache__/0005_auto_20200419_2023.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/LinkData/migrations/__pycache__/0005_auto_20200419_2023.cpython-38.pyc -------------------------------------------------------------------------------- /LinkData/migrations/__pycache__/0006_uploadgenefile.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/LinkData/migrations/__pycache__/0006_uploadgenefile.cpython-38.pyc -------------------------------------------------------------------------------- /LinkData/migrations/__pycache__/0007_datacollect_celltype.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/LinkData/migrations/__pycache__/0007_datacollect_celltype.cpython-38.pyc -------------------------------------------------------------------------------- /LinkData/migrations/__pycache__/0008_auto_20200603_2139.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/LinkData/migrations/__pycache__/0008_auto_20200603_2139.cpython-38.pyc -------------------------------------------------------------------------------- /LinkData/migrations/__pycache__/0009_auto_20200621_0938.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/LinkData/migrations/__pycache__/0009_auto_20200621_0938.cpython-38.pyc -------------------------------------------------------------------------------- /LinkData/migrations/__pycache__/0009_datacollect_primary.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/LinkData/migrations/__pycache__/0009_datacollect_primary.cpython-38.pyc -------------------------------------------------------------------------------- /LinkData/migrations/__pycache__/0010_auto_20200621_0940.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/LinkData/migrations/__pycache__/0010_auto_20200621_0940.cpython-38.pyc -------------------------------------------------------------------------------- /LinkData/migrations/__pycache__/0010_auto_20200625_1302.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/LinkData/migrations/__pycache__/0010_auto_20200625_1302.cpython-38.pyc -------------------------------------------------------------------------------- /LinkData/migrations/__pycache__/0011_auto_20200621_0946.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/LinkData/migrations/__pycache__/0011_auto_20200621_0946.cpython-38.pyc -------------------------------------------------------------------------------- /LinkData/migrations/__pycache__/0011_auto_20200703_0603.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/LinkData/migrations/__pycache__/0011_auto_20200703_0603.cpython-38.pyc -------------------------------------------------------------------------------- /LinkData/migrations/__pycache__/0012_auto_20200703_0630.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/LinkData/migrations/__pycache__/0012_auto_20200703_0630.cpython-38.pyc -------------------------------------------------------------------------------- /LinkData/migrations/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/LinkData/migrations/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /LinkData/migrations/__pycache__/__init__.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/LinkData/migrations/__pycache__/__init__.cpython-38.pyc -------------------------------------------------------------------------------- /LinkData/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | # Create your models here. 4 | class DataCollect(models.Model): 5 | dataset_type_choice = [('TME','TME'), ('ICB', 'ICB'), ('Normal', 'Normal')] 6 | species_choice = [('Human', 'Human'), ('Mouse', 'Mouse')] 7 | 8 | dataset_name = models.CharField(max_length = 100, db_column = 'Dataset Name', primary_key = True) 9 | dataset_id = models.CharField(max_length = 50, db_column = 'Dataset ID') 10 | dataset_type = models.CharField(max_length = 20, db_column = 'Dataset Type', choices = dataset_type_choice, default = "TME") 11 | treatment = models.CharField(max_length = 50, db_column = 'Treatment', default = "None") 12 | treatment_detailed = models.CharField(max_length = 50, db_column = 'Detailed Treatment', default = "None") 13 | species = models.CharField(max_length = 20, db_column = 'Species', choices = species_choice, default = "Human") 14 | cancer = models.CharField(max_length = 50, db_column = 'Cancer Type') 15 | celltype = models.CharField(max_length = 1000, db_column = 'Cell Type', default = "None") 16 | primary = models.CharField(max_length = 50, db_column = 'Primary', default = "None") 17 | platform = models.CharField(max_length = 50, db_column = 'Platform') 18 | patient = models.IntegerField(db_column = 'Patient Number', null = True) 19 | cell = models.IntegerField(db_column = 'Cell Number') 20 | publication = models.CharField(max_length = 100, db_column = 'Publication') 21 | pmid = models.CharField(max_length = 20, db_column = 'PMID') 22 | 23 | # class ExpLISA(models.Model): 24 | # dataset = models.CharField(max_length = 50, db_column = 'Dataset ID') 25 | # cancer = models.CharField(max_length = 50, db_column = 'Cancer Type') 26 | # subcluster = models.CharField(max_length = 50, db_column = 'Subcluster') 27 | # tf = models.CharField(max_length = 20, db_column = 'Transcription Factor') 28 | # expression = models.DecimalField(max_digits = 5, decimal_places = 2, db_column = 'Expression') 29 | # regscore = models.DecimalField(max_digits = 5, decimal_places = 2, db_column = 'Regulatory Score') 30 | # cluster = models.CharField(max_length = 50, db_column = 'Cluster') 31 | # highexprsc = models.SmallIntegerField(db_column = 'HighExprSC') 32 | # highrp = models.SmallIntegerField(db_column = 'HighRP') 33 | # highexprlm22 = models.SmallIntegerField(db_column = 'HighExprLM22') 34 | # highexprgse60424 = models.SmallIntegerField(db_column = 'HighExprGSE60424') 35 | # highexprcomb = models.SmallIntegerField(db_column = 'HighExprComb') 36 | 37 | # class tsnePath(models.Model): 38 | # cancer = models.CharField(max_length = 50, db_column = 'Cancer Type') 39 | # dataset = models.CharField(max_length = 50, db_column = 'Dataset ID', primary_key = True) 40 | # original = models.CharField(max_length = 300, db_column = 'Original tsne') 41 | # annotate = models.CharField(max_length = 300, db_column = 'Annotated tsne') 42 | 43 | class UploadGeneFile(models.Model): 44 | genefile = models.FileField(upload_to = "upload/", db_column = 'Gene File') -------------------------------------------------------------------------------- /LinkData/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /LinkData/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render 2 | 3 | # Create your views here. 4 | -------------------------------------------------------------------------------- /RASC/__init__.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import, unicode_literals 2 | 3 | # This will make sure the app is always imported when 4 | # Django starts so that shared_task will use this app. 5 | from .celery import app as celery_app 6 | 7 | __all__ = ('celery_app',) -------------------------------------------------------------------------------- /RASC/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/RASC/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /RASC/__pycache__/__init__.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/RASC/__pycache__/__init__.cpython-38.pyc -------------------------------------------------------------------------------- /RASC/__pycache__/celery.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/RASC/__pycache__/celery.cpython-37.pyc -------------------------------------------------------------------------------- /RASC/__pycache__/celery.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/RASC/__pycache__/celery.cpython-38.pyc -------------------------------------------------------------------------------- /RASC/__pycache__/settings.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/RASC/__pycache__/settings.cpython-37.pyc -------------------------------------------------------------------------------- /RASC/__pycache__/settings.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/RASC/__pycache__/settings.cpython-38.pyc -------------------------------------------------------------------------------- /RASC/__pycache__/urls.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/RASC/__pycache__/urls.cpython-37.pyc -------------------------------------------------------------------------------- /RASC/__pycache__/urls.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/RASC/__pycache__/urls.cpython-38.pyc -------------------------------------------------------------------------------- /RASC/__pycache__/view.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/RASC/__pycache__/view.cpython-37.pyc -------------------------------------------------------------------------------- /RASC/__pycache__/view.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/RASC/__pycache__/view.cpython-38.pyc -------------------------------------------------------------------------------- /RASC/__pycache__/wsgi.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/RASC/__pycache__/wsgi.cpython-37.pyc -------------------------------------------------------------------------------- /RASC/__pycache__/wsgi.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/RASC/__pycache__/wsgi.cpython-38.pyc -------------------------------------------------------------------------------- /RASC/celery.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import, unicode_literals 2 | import os 3 | from celery import Celery 4 | 5 | # set the default Django settings module for the 'celery' program. 6 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'RASC.settings') 7 | 8 | app = Celery('RASC') 9 | 10 | # Using a string here means the worker doesn't have to serialize 11 | # the configuration object to child processes. 12 | # - namespace='CELERY' means all celery-related configuration keys 13 | # should have a `CELERY_` prefix. 14 | app.config_from_object('django.conf:settings', namespace='CELERY') 15 | 16 | # Load task modules from all registered Django app configs. 17 | app.autodiscover_tasks() 18 | 19 | 20 | @app.task(bind=True) 21 | def debug_task(self): 22 | print('Request: {0!r}'.format(self.request)) -------------------------------------------------------------------------------- /RASC/settings.py: -------------------------------------------------------------------------------- 1 | """ 2 | Django settings for RASC project. 3 | 4 | Generated by 'django-admin startproject' using Django 2.1.7. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/2.1/topics/settings/ 8 | 9 | For the full list of settings and their values, see 10 | https://docs.djangoproject.com/en/2.1/ref/settings/ 11 | """ 12 | 13 | import os 14 | 15 | # Build paths inside the project like this: os.path.join(BASE_DIR, ...) 16 | BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 17 | 18 | 19 | # Quick-start development settings - unsuitable for production 20 | # See https://docs.djangoproject.com/en/2.1/howto/deployment/checklist/ 21 | 22 | # SECURITY WARNING: keep the secret key used in production secret! 23 | SECRET_KEY = 'u+xm*3x#txfeucq728i9jh=z^s&1^5mh-o4_r$hw6ua(i$4%b*' 24 | 25 | # SECURITY WARNING: don't run with debug turned on in production! 26 | DEBUG = True 27 | 28 | ALLOWED_HOSTS = ['cistrome.org','155.52.218.90','localhost','127.0.0.1', '10.10.140.189', '54.180.163.127', 'tisch.comp-genomics.org','tisch.beta.comp-genomics.org', '0.0.0.0:8000', 'ec2-54-180-163-127.ap-northeast-2.compute.amazonaws.com'] 29 | 30 | 31 | # Application definition 32 | 33 | INSTALLED_APPS = [ 34 | 'django.contrib.admin', 35 | 'django.contrib.auth', 36 | 'django.contrib.contenttypes', 37 | 'django.contrib.sessions', 38 | 'django.contrib.messages', 39 | 'django.contrib.staticfiles', 40 | 'django_celery_results', 41 | 'LinkData', 42 | ] 43 | 44 | MIDDLEWARE = [ 45 | 'django.middleware.security.SecurityMiddleware', 46 | 'django.contrib.sessions.middleware.SessionMiddleware', 47 | 'django.middleware.common.CommonMiddleware', 48 | 'django.middleware.csrf.CsrfViewMiddleware', 49 | 'django.contrib.auth.middleware.AuthenticationMiddleware', 50 | 'django.contrib.messages.middleware.MessageMiddleware', 51 | 'django.middleware.clickjacking.XFrameOptionsMiddleware', 52 | ] 53 | 54 | ROOT_URLCONF = 'RASC.urls' 55 | 56 | TEMPLATES = [ 57 | { 58 | 'BACKEND': 'django.template.backends.django.DjangoTemplates', 59 | 'DIRS': [BASE_DIR+"/templates",], 60 | 'APP_DIRS': True, 61 | 'OPTIONS': { 62 | 'context_processors': [ 63 | 'django.template.context_processors.debug', 64 | 'django.template.context_processors.request', 65 | 'django.template.context_processors.media', 66 | 'django.contrib.auth.context_processors.auth', 67 | 'django.contrib.messages.context_processors.messages', 68 | ], 69 | }, 70 | }, 71 | ] 72 | 73 | WSGI_APPLICATION = 'RASC.wsgi.application' 74 | 75 | 76 | # Database 77 | # https://docs.djangoproject.com/en/2.1/ref/settings/#databases 78 | 79 | DATABASES = { 80 | 'default': { 81 | 'ENGINE': 'django.db.backends.mysql', 82 | 'NAME': 'tisch_beta', 83 | 'PASSWORD': '1122345Mm', 84 | 'USER': 'dongqing', 85 | 'HOST': '127.0.0.1', 86 | 'AUTOCOMMIT': True, 87 | } 88 | } 89 | 90 | 91 | # Password validation 92 | # https://docs.djangoproject.com/en/2.1/ref/settings/#auth-password-validators 93 | 94 | AUTH_PASSWORD_VALIDATORS = [ 95 | { 96 | 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', 97 | }, 98 | { 99 | 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', 100 | }, 101 | { 102 | 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', 103 | }, 104 | { 105 | 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', 106 | }, 107 | ] 108 | 109 | 110 | # Internationalization 111 | # https://docs.djangoproject.com/en/2.1/topics/i18n/ 112 | 113 | LANGUAGE_CODE = 'en-us' 114 | 115 | TIME_ZONE = 'UTC' 116 | 117 | USE_I18N = True 118 | 119 | USE_L10N = True 120 | 121 | USE_TZ = True 122 | 123 | 124 | # Static files (CSS, JavaScript, Images) 125 | # https://docs.djangoproject.com/en/2.1/howto/static-files/ 126 | 127 | STATIC_URL = '/static/' 128 | STATIC_ROOT = os.path.join(BASE_DIR, 'static/') 129 | STATICFILES_DIRS = [ 130 | ("css", os.path.join(STATIC_ROOT, 'css')), 131 | ("image", os.path.join(STATIC_ROOT, 'image')), 132 | ("js", os.path.join(STATIC_ROOT, 'js')), 133 | ("data", os.path.join(STATIC_ROOT, 'data')) 134 | ] 135 | 136 | MEDIA_URL = '/media/' 137 | MEDIA_ROOT = os.path.join(BASE_DIR, 'media/') 138 | 139 | # celery 140 | CELERY_BROKER_URL = 'amqp://127.0.0.1:5672//' 141 | CELERY_ACCEPT_CONTENT = ['json'] 142 | CELERY_TASK_SERIALIZER = 'json' 143 | CELERY_RESULT_BACKEND = 'django-db' 144 | CELERY_TIMEZONE = 'UTC' 145 | CELERY_CACHE_BACKEND = 'django-cache' 146 | CELERY_TRACK_STARTED = True 147 | 148 | EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' 149 | 150 | EMAIL_USE_SSL = True 151 | EMAIL_HOST = 'smtp.163.com' 152 | EMAIL_PORT = 465 153 | EMAIL_HOST_USER = 'winterdongqing96@163.com' 154 | EMAIL_HOST_PASSWORD = '1122345Mm' 155 | DEFAULT_FROM_EMAIL = EMAIL_HOST_USER 156 | 157 | -------------------------------------------------------------------------------- /RASC/urls.py: -------------------------------------------------------------------------------- 1 | """RASC URL Configuration 2 | 3 | The `urlpatterns` list routes URLs to views. For more information please see: 4 | https://docs.djangoproject.com/en/2.1/topics/http/urls/ 5 | Examples: 6 | Function views 7 | 1. Add an import: from my_app import views 8 | 2. Add a URL to urlpatterns: path('', views.home, name='home') 9 | Class-based views 10 | 1. Add an import: from other_app.views import Home 11 | 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') 12 | Including another URLconf 13 | 1. Import the include() function: from django.urls import include, path 14 | 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) 15 | """ 16 | from django.conf.urls import * 17 | from django.urls import path 18 | from RASC import view, settings 19 | from django.views.static import serve 20 | 21 | urlpatterns = [ 22 | path('', view.home), 23 | path('home/', view.home), 24 | path('data/', view.data, name = "data"), 25 | # path('search-cancer/', view.search_cancer), 26 | path('search-gene/', view.search_gene), 27 | path('gallery/', view.select_dataset), 28 | path('documentation/', view.doc), 29 | path('statistics/', view.statistics), 30 | # path('run-lisa/', view.run_lisa), 31 | # path('run-success/', view.run_success), 32 | # path('run-result/', view.run_result), 33 | # path('link-dataset/', view.link_dataset, name = "link_dataset"), 34 | # path('images/tSNE/', serve, {'document_root': '/data/home/chenfei/public_html/RASC/images/tSNE/'}), 35 | path('download/', serve, {'document_root': settings.MEDIA_ROOT + "download/"}), 36 | path('media/tmp/', serve, {'document_root': settings.MEDIA_ROOT + "tmp/"}), 37 | # path('scRNA/Data/', serve, {'document_root': '/Users/dongqing/Documents/Project/SingleCell/scRNA/Data/'}) 38 | ] 39 | -------------------------------------------------------------------------------- /RASC/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for RASC project. 3 | 4 | It exposes the WSGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/2.1/howto/deployment/wsgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.wsgi import get_wsgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'RASC.settings') 15 | 16 | # os.environ['DJANGO_SETTINGS_MODULE'] = 'RASC.settings' 17 | 18 | application = get_wsgi_application() 19 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # TISCH 2 | [Tumor Immune Single-cell Hub (TISCH)](http://tisch.comp-genomics.org/home/) is a scRNA-seq database, which focuses on tumor microenvironment (TME). TISCH provides detailed cell-type annotation for all curated datasets, enabling the exploration of TME across different cancer types. 3 | 4 | ## Release 1 - July 11th, 2020 5 | ### Data statistics 6 | - **28 cancer types**. 7 | - **79 datasets:** 15 datasets with ICB treatment (10 for human and 5 for mouse), 61 non-ICB datasets and 3 PBMC datasets. 8 | - **2,045,746 cells:** 378,392 malignant cells and 1,667,354 non-malignant cells. 9 | 10 | ### Features 11 | - **Gene module:** Search a gene across species and cancer types. 12 | - **Single-dataset exploration:** 1. Overview of dataset; 2. Gene expression visualization at both single-cell level (UMAP plot) and cluster level (violin plot); 3. Functional enrichment analysis (GSEA); 4. Download files (cluster-level expression matrices, DE gene table and meta information). 13 | - **Multiple-dataset comparison:** Compare expression of genes across multiple datasets. 14 | -------------------------------------------------------------------------------- /code/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/code/.DS_Store -------------------------------------------------------------------------------- /code/0_GEO_Parser/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/code/0_GEO_Parser/.DS_Store -------------------------------------------------------------------------------- /code/0_GEO_Parser/README.md: -------------------------------------------------------------------------------- 1 | # singleCell_gse_parser 2 | single cell data parser from GEO 3 | 4 | **Clone the repository and do as follow:** 5 | 1. make sure that MySQL is isntalled in your device, and you have the account to create a new database, 6 | if no, install one, or contact your manager 7 | 2. install a miniconda3, then create a environment by doing: 8 | ``` 9 | conda env create -n py3_geo -f requirement.yaml 10 | conda activate py3_geo 11 | ``` 12 | 3. create a mysql database (named by yourself), and fill in the SQL file 13 | 4. revise the database name and password in in ./dc2/dc2/setting.py, using the one you just set 14 | 5. test your environment deploy, it is ok, if no error report when you run: 15 | ``` 16 | python env.py 17 | ``` 18 | 6. run parser: 19 | ``` 20 | python scrna_parser_runner.py -h 21 | ``` 22 | examples can be found in run.sh file 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /code/0_GEO_Parser/dc2/datacollection/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/code/0_GEO_Parser/dc2/datacollection/__init__.py -------------------------------------------------------------------------------- /code/0_GEO_Parser/dc2/datacollection/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /code/0_GEO_Parser/dc2/datacollection/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class DatacollectionConfig(AppConfig): 5 | name = 'datacollection' 6 | -------------------------------------------------------------------------------- /code/0_GEO_Parser/dc2/datacollection/migrations/0001_initial.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.0.6 on 2020-05-21 11:56 2 | 3 | from django.db import migrations, models 4 | import django.db.models.deletion 5 | 6 | 7 | class Migration(migrations.Migration): 8 | 9 | initial = True 10 | 11 | dependencies = [ 12 | ] 13 | 14 | operations = [ 15 | migrations.CreateModel( 16 | name='CellLines', 17 | fields=[ 18 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 19 | ('name', models.CharField(blank=True, default='', max_length=255, null=True)), 20 | ('status', models.CharField(blank=True, choices=[('new', 'newly imported'), ('ok', 'validated')], default='new', max_length=255, null=True)), 21 | ('comments', models.CharField(blank=True, default='', max_length=255, null=True)), 22 | ('aliases', models.CharField(blank=True, default=None, max_length=255, null=True)), 23 | ], 24 | options={ 25 | 'verbose_name_plural': 'cell lines', 26 | }, 27 | ), 28 | migrations.CreateModel( 29 | name='CellPops', 30 | fields=[ 31 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 32 | ('name', models.CharField(blank=True, default='', max_length=255, null=True)), 33 | ('status', models.CharField(blank=True, choices=[('new', 'newly imported'), ('ok', 'validated')], default='new', max_length=255, null=True)), 34 | ('comments', models.CharField(blank=True, default='', max_length=255, null=True)), 35 | ('aliases', models.CharField(blank=True, default=None, max_length=255, null=True)), 36 | ], 37 | options={ 38 | 'verbose_name_plural': 'cell populations', 39 | }, 40 | ), 41 | migrations.CreateModel( 42 | name='CellTypes', 43 | fields=[ 44 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 45 | ('name', models.CharField(blank=True, default='', max_length=255, null=True)), 46 | ('status', models.CharField(blank=True, choices=[('new', 'newly imported'), ('ok', 'validated')], default='new', max_length=255, null=True)), 47 | ('comments', models.CharField(blank=True, default='', max_length=255, null=True)), 48 | ('aliases', models.CharField(blank=True, default=None, max_length=255, null=True)), 49 | ], 50 | options={ 51 | 'verbose_name_plural': 'cell types', 52 | }, 53 | ), 54 | migrations.CreateModel( 55 | name='DiseaseStates', 56 | fields=[ 57 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 58 | ('name', models.CharField(blank=True, default='', max_length=255, null=True)), 59 | ('comments', models.CharField(blank=True, default='', max_length=255, null=True)), 60 | ('status', models.CharField(blank=True, choices=[('new', 'newly imported'), ('ok', 'validated')], default='new', max_length=255, null=True)), 61 | ('aliases', models.CharField(blank=True, default=None, max_length=255, null=True)), 62 | ], 63 | options={ 64 | 'verbose_name_plural': 'disease states', 65 | }, 66 | ), 67 | migrations.CreateModel( 68 | name='Journals', 69 | fields=[ 70 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 71 | ('name', models.CharField(blank=True, default='', max_length=255, null=True)), 72 | ('issn', models.CharField(blank=True, default='', max_length=9, null=True)), 73 | ('impact_factor', models.FloatField(default=0.0, null=True)), 74 | ], 75 | options={ 76 | 'verbose_name_plural': 'journals', 77 | }, 78 | ), 79 | migrations.CreateModel( 80 | name='TissueTypes', 81 | fields=[ 82 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 83 | ('name', models.CharField(blank=True, default='', max_length=255, null=True)), 84 | ('status', models.CharField(blank=True, choices=[('new', 'newly imported'), ('ok', 'validated')], default='new', max_length=255, null=True)), 85 | ('comments', models.CharField(blank=True, default='', max_length=255, null=True)), 86 | ('aliases', models.CharField(blank=True, default=None, max_length=255, null=True)), 87 | ], 88 | options={ 89 | 'verbose_name_plural': 'tissues', 90 | }, 91 | ), 92 | migrations.CreateModel( 93 | name='Papers', 94 | fields=[ 95 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 96 | ('pmid', models.IntegerField(blank=True, default=None, null=True)), 97 | ('unique_id', models.CharField(blank=True, default='', max_length=255, null=True)), 98 | ('title', models.CharField(blank=True, default='', max_length=255, null=True)), 99 | ('reference', models.CharField(blank=True, default='', max_length=255, null=True)), 100 | ('abstract', models.TextField(blank=True, default='', null=True)), 101 | ('pub_date', models.DateField(blank=True, default=None, null=True)), 102 | ('date_collected', models.DateTimeField(blank=True, default=None, null=True)), 103 | ('authors', models.CharField(blank=True, default='', max_length=1000, null=True)), 104 | ('last_auth_email', models.EmailField(blank=True, default=None, max_length=254, null=True)), 105 | ('status', models.CharField(blank=True, choices=[('imported', 'paper entered awaiting datasets'), ('datasets', 'datasets imported awaiting download'), ('transfer', 'datasets download in progress'), ('downloaded', 'datasets downloaded awaiting analysis'), ('complete', 'analysis complete/complete'), ('error', 'error/hold- see comments')], default='imported', max_length=255, null=True)), 106 | ('comments', models.TextField(blank=True, default='', null=True)), 107 | ('lab', models.CharField(blank=True, default='', max_length=1000, null=True)), 108 | ('pub_summary', models.CharField(blank=True, default='', max_length=1000, null=True)), 109 | ('journal', models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.CASCADE, to='datacollection.Journals')), 110 | ], 111 | options={ 112 | 'verbose_name_plural': 'papers', 113 | }, 114 | ), 115 | ] 116 | -------------------------------------------------------------------------------- /code/0_GEO_Parser/dc2/datacollection/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/code/0_GEO_Parser/dc2/datacollection/migrations/__init__.py -------------------------------------------------------------------------------- /code/0_GEO_Parser/dc2/datacollection/migrations/__pycache__/0001_initial.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/code/0_GEO_Parser/dc2/datacollection/migrations/__pycache__/0001_initial.cpython-38.pyc -------------------------------------------------------------------------------- /code/0_GEO_Parser/dc2/datacollection/migrations/__pycache__/__init__.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/code/0_GEO_Parser/dc2/datacollection/migrations/__pycache__/__init__.cpython-38.pyc -------------------------------------------------------------------------------- /code/0_GEO_Parser/dc2/datacollection/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /code/0_GEO_Parser/dc2/datacollection/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render 2 | 3 | # Create your views here. 4 | -------------------------------------------------------------------------------- /code/0_GEO_Parser/dc2/dc2/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/code/0_GEO_Parser/dc2/dc2/__init__.py -------------------------------------------------------------------------------- /code/0_GEO_Parser/dc2/dc2/asgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | ASGI config for dc2 project. 3 | 4 | It exposes the ASGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.0/howto/deployment/asgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.asgi import get_asgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'dc2.settings') 15 | 16 | application = get_asgi_application() 17 | -------------------------------------------------------------------------------- /code/0_GEO_Parser/dc2/dc2/settings.py: -------------------------------------------------------------------------------- 1 | """ 2 | Django settings for dc2 project. 3 | 4 | Generated by 'django-admin startproject' using Django 3.0.6. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.0/topics/settings/ 8 | 9 | For the full list of settings and their values, see 10 | https://docs.djangoproject.com/en/3.0/ref/settings/ 11 | """ 12 | 13 | import os 14 | 15 | # Build paths inside the project like this: os.path.join(BASE_DIR, ...) 16 | BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 17 | 18 | 19 | # Quick-start development settings - unsuitable for production 20 | # See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/ 21 | 22 | # SECURITY WARNING: keep the secret key used in production secret! 23 | SECRET_KEY = '2uf3*y58!l0(lqoogw#a2thtsav+r+mvgk(gbdaeaip+i#6m^(' 24 | 25 | # SECURITY WARNING: don't run with debug turned on in production! 26 | DEBUG = True 27 | 28 | ALLOWED_HOSTS = [] 29 | 30 | 31 | # Application definition 32 | 33 | INSTALLED_APPS = [ 34 | 'django.contrib.admin', 35 | 'django.contrib.messages', 36 | 'datacollection', 37 | 'django.contrib.contenttypes', 38 | 'django.contrib.auth' 39 | ] 40 | 41 | #INSTALLED_APPS = [ 42 | # 'django.contrib.admin', 43 | # 'django.contrib.auth', 44 | # 'django.contrib.contenttypes', 45 | # 'django.contrib.sessions', 46 | # 'django.contrib.messages', 47 | # 'django.contrib.staticfiles', 48 | #] 49 | # 50 | MIDDLEWARE = [ 51 | 'django.middleware.security.SecurityMiddleware', 52 | 'django.contrib.sessions.middleware.SessionMiddleware', 53 | 'django.middleware.common.CommonMiddleware', 54 | 'django.middleware.csrf.CsrfViewMiddleware', 55 | 'django.contrib.auth.middleware.AuthenticationMiddleware', 56 | 'django.contrib.messages.middleware.MessageMiddleware', 57 | 'django.middleware.clickjacking.XFrameOptionsMiddleware', 58 | ] 59 | 60 | ROOT_URLCONF = 'dc2.urls' 61 | 62 | TEMPLATES = [ 63 | { 64 | 'BACKEND': 'django.template.backends.django.DjangoTemplates', 65 | 'DIRS': [], 66 | 'APP_DIRS': True, 67 | 'OPTIONS': { 68 | 'context_processors': [ 69 | 'django.template.context_processors.debug', 70 | 'django.template.context_processors.request', 71 | 'django.contrib.auth.context_processors.auth', 72 | 'django.contrib.messages.context_processors.messages', 73 | ], 74 | }, 75 | }, 76 | ] 77 | 78 | WSGI_APPLICATION = 'dc2.wsgi.application' 79 | 80 | 81 | # Database 82 | # https://docs.djangoproject.com/en/3.0/ref/settings/#databases 83 | 84 | #DATABASES = { 85 | # 'default': { 86 | # 'ENGINE': 'django.db.backends.sqlite3', 87 | # 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), 88 | # } 89 | #} 90 | 91 | DATABASES = { 92 | 'default': { 93 | 'ENGINE': 'django.db.backends.mysql', 94 | 'NAME': 'singleCell', 95 | 'USER': 'rongbinzheng', 96 | 'PASSWORD': '123456', 97 | 'HOST': '', 98 | 'PORT': '', 99 | 'OPTIONS': {'init_command': 'SET default_storage_engine=InnoDB;'}, 100 | 'DEFAULT_STORAGE_ENGINE': 'INNODB' 101 | }, 102 | } 103 | 104 | 105 | # Password validation 106 | # https://docs.djangoproject.com/en/3.0/ref/settings/#auth-password-validators 107 | 108 | AUTH_PASSWORD_VALIDATORS = [ 109 | { 110 | 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', 111 | }, 112 | { 113 | 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', 114 | }, 115 | { 116 | 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', 117 | }, 118 | { 119 | 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', 120 | }, 121 | ] 122 | 123 | 124 | # Internationalization 125 | # https://docs.djangoproject.com/en/3.0/topics/i18n/ 126 | 127 | LANGUAGE_CODE = 'en-us' 128 | 129 | TIME_ZONE = 'UTC' 130 | 131 | USE_I18N = True 132 | 133 | USE_L10N = True 134 | 135 | USE_TZ = True 136 | 137 | 138 | # Static files (CSS, JavaScript, Images) 139 | # https://docs.djangoproject.com/en/3.0/howto/static-files/ 140 | 141 | STATIC_URL = '/static/' 142 | -------------------------------------------------------------------------------- /code/0_GEO_Parser/dc2/dc2/urls.py: -------------------------------------------------------------------------------- 1 | """dc2 URL Configuration 2 | 3 | The `urlpatterns` list routes URLs to views. For more information please see: 4 | https://docs.djangoproject.com/en/3.0/topics/http/urls/ 5 | Examples: 6 | Function views 7 | 1. Add an import: from my_app import views 8 | 2. Add a URL to urlpatterns: path('', views.home, name='home') 9 | Class-based views 10 | 1. Add an import: from other_app.views import Home 11 | 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') 12 | Including another URLconf 13 | 1. Import the include() function: from django.urls import include, path 14 | 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) 15 | """ 16 | from django.contrib import admin 17 | from django.urls import path 18 | 19 | urlpatterns = [ 20 | path('admin/', admin.site.urls), 21 | ] 22 | -------------------------------------------------------------------------------- /code/0_GEO_Parser/dc2/dc2/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for dc2 project. 3 | 4 | It exposes the WSGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.0/howto/deployment/wsgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.wsgi import get_wsgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'dc2.settings') 15 | 16 | application = get_wsgi_application() 17 | -------------------------------------------------------------------------------- /code/0_GEO_Parser/dc2/manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """Django's command-line utility for administrative tasks.""" 3 | import os 4 | import sys 5 | 6 | from django.core.management.base import BaseCommand, CommandError 7 | 8 | def main(): 9 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'dc2.settings') 10 | try: 11 | from django.core.management import execute_from_command_line 12 | except ImportError as exc: 13 | raise ImportError( 14 | "Couldn't import Django. Are you sure it's installed and " 15 | "available on your PYTHONPATH environment variable? Did you " 16 | "forget to activate a virtual environment?" 17 | ) from exc 18 | execute_from_command_line(sys.argv) 19 | 20 | 21 | if __name__ == '__main__': 22 | main() 23 | -------------------------------------------------------------------------------- /code/0_GEO_Parser/downloadSuppGSE.py: -------------------------------------------------------------------------------- 1 | import pandas as pd 2 | import os 3 | import sys 4 | import xml.etree.ElementTree as ET 5 | import urllib.request 6 | import time 7 | 8 | 9 | 10 | def merge_extract_result(result_table, name, index, col): 11 | ori_value = result_table.loc[index, col] 12 | result = result_table.copy() 13 | if isinstance(ori_value,str): 14 | result.loc[index,col] = ori_value + ",[RAW]%s" % name 15 | else: 16 | result.loc[index,col] = "[RAW]%s" % name 17 | return result 18 | 19 | def findSuppleDataXml(xml): 20 | root = ET.fromstring(xml) 21 | file_list = [] 22 | for file in root.iter('file'): 23 | filename = file.text.strip() 24 | file_list.append(filename) 25 | return file_list 26 | 27 | parser_result_table = "txt/parse_gse.txt" 28 | folder = "0710_collection" 29 | series_list = ["GSE111458","GSE103867","GSE148345","GSE115501","GSE132465","GSE127888","GSE112271","GSE126131","GSE150321","GSE124898","GSE140430","GSE142116","GSE128822","GSE113336","GSE109085","GSE125680","GSE128933","GSE76312","GSE129845","GSE107747","GSE103866","GSE144735","GSE111896","GSE109308","GSE146026","GSE132065","GSE111065","GSE149614","GSE122703","GSE145896","GSE133094","GSE61844","GSE119630","GSE140819","GSE123476","GSE110680","GSE132257","GSE126068","GSE97930","GSE74450","GSE137941","GSE134577","GSE81076","GSE134570","SE120221","GSE130804","GSE102580","GSE100618","GSE146763","GSE110973","GSE71318","GSE125970","GSE143214","GSE143669","GSE130560","GSE98011","GSE148371","GSE147104","GSE85241","GSE128992","GSE123028","GSE67835","GSE131409","GSE109822","GSE111822","GSE119969","GSE138002","GSE130784","GSE136831","GSE133854","GSE109205","GSE110154","GSE147457","GSE116500","GSE141238","GSE131882","GSE131434","GSE113931","GSE118209","GSE113046","GSE100501","GSE116106","GSE149100","GSE81233","GSE136447","GSE140231","GSE142538","GSE113675","GSE100866","GSE135922","GSE130148","GSE133181","GSE122970","GSE133345","GSE117837","GSE104995","GSE115982","GSE144568","GSE110791","GSE76234","GSE128991","GSE105142","GSE130228","GSE130117","GSE126250","GSE129611","GSE106888","GSE128518","GSE114961","GSE145843","GSE116683","GSE83501","GSE109555","GSE111404","GSE150728","GSE62408","GSE145838","GSE143417","GSE133894","GSE85534","GSE130888","GSE132950","GSE136103","GSE119807","GSE112438","GSE113036","GSE136871","GSE144434","GSE130473","GSE130973","GSE143567","GSE142449","GSE90734","GSE107794","GSE111301","GSE121477","GSE97104","GSE142637","GSE130289","GSE87195","GSE134576","GSE137877","GSE115639","GSE148665","GSE138680","GSE130882"] 30 | 31 | table = pd.read_csv(parser_result_table, sep="\t") 32 | result = table[table["gseid"].isin(series_list)] 33 | 34 | # download function 35 | # some series only provided bw files, and too large to download 36 | # so I changed to get gse from web page 37 | for i in result.index: 38 | gseid = result.loc[i,"gseid"] 39 | path = "%s/%s" % (folder,gseid) 40 | print(path) 41 | url_list = result.loc[i,:].tolist() 42 | url_group = [] 43 | for url_str in url_list: 44 | if isinstance(url_str,str): 45 | url_item = url_str.split(",") 46 | url_group = url_group + url_item 47 | else: 48 | continue 49 | url_group = url_group[1:] 50 | print(url_group) 51 | try: 52 | os.makedirs(path) 53 | except: 54 | print("%s has created!" % path) 55 | for url in url_group: 56 | filename = url.split("/")[-1] 57 | if not os.path.exists("%s/%s" % (path, filename)): 58 | os.system("wget %s -O %s/%s" % (url, path, filename)) 59 | print("finish download") 60 | else: 61 | print("file existed!") 62 | series_matrix_link = "https://ftp.ncbi.nlm.nih.gov/geo/series/%snnn/%s/matrix/%s_series_matrix.txt.gz" % (gseid[0:6],gseid,gseid) 63 | os.system("wget %s -O %s/%s" % (series_matrix_link, path, series_matrix_link.split("/")[-1])) 64 | # file_list = os.listdir(path) 65 | 66 | 67 | 68 | 69 | 70 | # result.to_csv("single_cell_supplementary_file_after_extraction.txt", index=None, sep="\t") 71 | 72 | -------------------------------------------------------------------------------- /code/0_GEO_Parser/env.py: -------------------------------------------------------------------------------- 1 | """ 2 | use this to enable the mysql interaction in python 3 | basically, set up django through correct settings.py file 4 | """ 5 | import os, sys 6 | import django 7 | p=os.getcwd() 8 | sys.path.append(p+'/dc2/') 9 | sys.path = sys.path[::-1] 10 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "dc2.settings") 11 | django.setup() 12 | from datacollection import models 13 | -------------------------------------------------------------------------------- /code/0_GEO_Parser/platform.txt: -------------------------------------------------------------------------------- 1 | Smart-seq2 smartseq2 2 | Smart-seq2 smartseq 2 3 | Smart-seq smartseq 4 | 10X Genomics 10x genomics 5 | scTrio-seq2 sctrioseq2 6 | MARS-seq marsseq 7 | inDrop indrop 8 | Microwell-seq microwellseq 9 | Microwell-seq microwell 10 | CellRanger cellranger 11 | Seurat seurat 12 | -------------------------------------------------------------------------------- /code/0_GEO_Parser/pubmed.py: -------------------------------------------------------------------------------- 1 | """Library to interface with Pubmed""" 2 | 3 | import os 4 | import re 5 | import sys 6 | import urllib.request, urllib.parse, urllib.error 7 | import traceback 8 | import datetime 9 | import subprocess 10 | 11 | import xml.etree.ElementTree as ET 12 | from xml.dom.minidom import parseString 13 | 14 | #AUTO-load classifiers 15 | #a trick to get the current module 16 | _modname = globals()['__name__'] 17 | _this_mod = sys.modules[_modname] 18 | 19 | _ppath = "/".join(_this_mod.__file__.split("/")[:-1]) 20 | 21 | # #CAN drop this if this is an app! 22 | # DEPLOY_DIR="/home/lentaing/envs/newdc1.4/src" 23 | # sys.path.insert(0, DEPLOY_DIR) 24 | # from django.core.management import setup_environ 25 | # from django.utils.encoding import smart_str 26 | # import settings 27 | # setup_environ(settings) 28 | import env 29 | models = env.models 30 | 31 | def getPubmedXML(accession): 32 | """our PUBMED XML librarian! 33 | Given an accession #, tries to look for the record locally, 34 | IF not found, then makes a remote call to fetch it using the following 35 | query: 36 | http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?id=20442865&db=pubmed&mode=xml 37 | 38 | Returns the pubmed record as xml string 39 | """ 40 | docString = None 41 | path = os.path.join(_ppath, "pubmed") 42 | if not os.path.exists(path): 43 | os.mkdir(path) 44 | subdir = os.path.join(path, accession[:5]) 45 | if not os.path.exists(subdir): 46 | os.mkdir(subdir) 47 | path = os.path.join(subdir, "%s.xml" % accession) 48 | 49 | if os.path.exists(path): 50 | f = open(path) 51 | docString = f.read() 52 | f.close() 53 | else: 54 | URL = "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?id=%s&db=pubmed&mode=xml" % accession 55 | try: 56 | urlf = urllib.request.urlopen(URL) 57 | docString = urlf.read() 58 | docString = docString.decode('utf-8', errors = 'ignore') 59 | urlf.close() 60 | #write to file 61 | f = open(path, "w") 62 | f.write(docString) 63 | f.close() 64 | except: 65 | print("Exception in user code:") 66 | print('-'*60) 67 | traceback.print_exc(file=sys.stdout) 68 | print('-'*60) 69 | docString = None 70 | 71 | return docString 72 | 73 | def pubmedToGDS(pmid): 74 | """Given a pubmed id, will try to reverse-look up the corresponding 75 | GSE that is associated 76 | """ 77 | ret = None 78 | path = os.path.join(_ppath, "GSE_PUB") 79 | proc=subprocess.Popen(['grep','-R', pmid, path], 80 | stdout=subprocess.PIPE) 81 | out, err = proc.communicate() 82 | m = re.findall("(\d+)\.txt", out.decode('utf-8')) 83 | if m: 84 | #NOTE: mutliple GSEs can be associated with a pubmed--we return all 85 | ret = ",".join(m) 86 | return ret 87 | 88 | def getOrCreatePaper(pmid): 89 | """Given a pubmed id, tries to look for a django Paper obj; 90 | IF not found, will create a new Paper obj and return it 91 | """ 92 | ret = None 93 | tmp = models.Papers.objects.filter(pmid=pmid) 94 | # tmp = None 95 | print(tmp) 96 | print("Bitcher") 97 | if tmp: 98 | #return the first hit 99 | ret = tmp[0] 100 | else: 101 | #create a new paper- 102 | #print "creating paper" 103 | p = models.Papers() 104 | # p = models.Papers.objects.get_or_create(pmid=pmid) 105 | #set ids 106 | p.pmid = pmid 107 | p.unique_id = pubmedToGDS(pmid) 108 | p.status = "new" 109 | 110 | #fill the fields 111 | docString = getPubmedXML(pmid) 112 | root = ET.fromstring(docString) 113 | article = root.findall("PubmedArticle/MedlineCitation/Article") 114 | 115 | if article: 116 | article = article[0] 117 | title = article.findall("ArticleTitle") 118 | if title: 119 | p.title = ''.join(title[0].itertext()) 120 | # if title[0].text and title[0].getchildren()[0]: 121 | # p.title = ''.join(title[0].itertext()) 122 | # elif (not title[0].text) and title[0].getchildren()[0]: 123 | # c = title[0].getchildren()[0].tag 124 | # p.title = title[0].findall('%s'%c)[0].text.strip() 125 | # p.title = title[0].text.strip() 126 | # elif (not title[0].text) and (not title[0].getchildren()[0]): 127 | # p.title = None 128 | # else: # children tag exists 129 | # p.title = title[0].text.strip() 130 | 131 | abstract = article.findall("Abstract/AbstractText") 132 | if abstract: 133 | p.abstract = abstract[0].text.strip() 134 | 135 | #GET authors 136 | ls = [] 137 | authors = article.findall("AuthorList/Author") 138 | if authors: 139 | for a in authors: 140 | lastn = list(a)[0].text.strip() 141 | #first= a._children[1].text.strip() 142 | if len(list(a)) > 2: 143 | inits = list(a)[2].text.strip() 144 | else: 145 | inits = "" 146 | ls.append("%s %s" % (lastn, inits)) 147 | p.authors = ",".join(ls) 148 | if len(p.authors) > 1000: 149 | p.authors = ",".join(ls[-3:-1]) 150 | journal = article.findall("Journal") 151 | if journal: 152 | journal = journal[0] 153 | #try to find the journal 154 | params = {} 155 | jname = journal.findall("ISOAbbreviation") 156 | if jname: 157 | params['name'] = jname[0].text.strip() 158 | #DISABLING auto-ISSN 159 | #issn = journal.findall("ISSN") 160 | #if issn: 161 | # params['issn'] = issn[0].text.strip() 162 | 163 | j,created = models.Journals.objects.get_or_create(**params) 164 | p.journal = j 165 | 166 | 167 | pub_date = root.findall("PubmedArticle/MedlineCitation/DateCreated") 168 | if pub_date: 169 | pub_date = pub_date[0] 170 | year = pub_date.findall("Year")[0].text.strip() 171 | month = pub_date.findall("Month")[0].text.strip() 172 | day = pub_date.findall("Day")[0].text.strip() 173 | p.pub_date = datetime.date(int(year), int(month), int(day)) 174 | 175 | p.date_collected = datetime.datetime.now() 176 | 177 | #final bits 178 | try: 179 | p.save() 180 | except: 181 | print(p.authors) 182 | print('-'*60) 183 | traceback.print_exc(file=sys.stdout) 184 | print('-'*60) 185 | sys.exit(1) 186 | 187 | ret = p 188 | 189 | return ret 190 | 191 | -------------------------------------------------------------------------------- /code/0_GEO_Parser/requirement.yaml: -------------------------------------------------------------------------------- 1 | name: py3_geo 2 | channels: 3 | - defaults 4 | - conda-forge 5 | - bioconda 6 | dependencies: 7 | - python>=3 8 | - asgiref=3.2.7 9 | - beautifulsoup4=4.9.1 10 | - certifi=2020.4.5.1 11 | - configparser=5.0.0 12 | - Django=3.0.6 13 | - django-appconf=1.0.4 14 | - django-cors-headers=3.2.1 15 | - future=0.18.2 16 | - h5py=2.10.0 17 | - mysqlclient=1.4.6 18 | - numpy=1.18.4 19 | - Pillow=7.1.2 20 | - python-dateutil=2.8.0 21 | - pytz=2020.1 22 | - six=1.14.0 23 | - soupsieve=2.0.1 24 | - sqlparse=0.3.1 25 | - unicodecsv=0.14.1 26 | - xlrd=1.2.0 27 | - xlwt=1.3.0 28 | -------------------------------------------------------------------------------- /code/0_GEO_Parser/run.sh: -------------------------------------------------------------------------------- 1 | python scrna_parser_runner.py parser -d 2020/04/23-2020/05/21 -el ../geo_gse_collection.txt 2 | 3 | #python scrna_parser_runner.py known -i need_gse.txt -gc 0 -p ./geo_gse/ -o geo_gse_scrna_collection_all_new2.txt 4 | 5 | #python scrna_parser_runner.py local -p ./geo_gse -o geo_gse_scrna_collection.txt 6 | -------------------------------------------------------------------------------- /code/0_GEO_Parser/sup_info_gse_local.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | # ================================ 4 | # @auther: Xin Dong 5 | # @email: xindong9511@gmail.com 6 | # @date: Apr 2020 7 | # ================================ 8 | 9 | ''' 10 | Parse by GSE 11 | 12 | this script is used to parse all supplementary files from GEO 13 | 14 | (local version) -- only check local downloaded xml 15 | 16 | with the purpose of single cell collection 17 | 18 | judge the file type whether it is barcodes or tpm or others 19 | 20 | generate a table with download links 21 | 22 | ''' 23 | 24 | 25 | import os 26 | import sys 27 | import urllib.request 28 | import re 29 | import argparse 30 | import xml.etree.ElementTree as ET 31 | import time 32 | 33 | 34 | def judgeType(link_dic): 35 | file_type_dic = {} 36 | file_type_dic["raw"] = [] 37 | file_type_dic["barcode"] = [] 38 | file_type_dic["count"] = [] 39 | file_type_dic["tpm"] = [] 40 | file_type_dic["gene"] = [] 41 | file_type_dic["other"] = [] 42 | for name in link_dic.keys(): 43 | if "barcode" in name.lower(): 44 | file_type_dic["barcode"].append(link_dic[name]) 45 | elif "count" in name.lower(): 46 | file_type_dic["count"].append(link_dic[name]) 47 | elif "tpm" in name.lower() or "matrix" in name.lower(): 48 | file_type_dic["tpm"].append(link_dic[name]) 49 | elif "gene" in name.lower(): 50 | file_type_dic["gene"].append(link_dic[name]) 51 | elif "raw" in name.lower(): 52 | file_type_dic["raw"].append(link_dic[name]) 53 | else: 54 | file_type_dic["other"].append(link_dic[name]) 55 | return file_type_dic 56 | 57 | def findSuppleDataXml(xml): 58 | tree = ET.parse(xml) 59 | root = tree.getroot() 60 | link_dic = {} 61 | for file in root.iter('{http://www.ncbi.nlm.nih.gov/geo/info/MINiML}Supplementary-Data'): 62 | filelink = file.text.strip() 63 | filename = filelink.split("/")[-1] 64 | link_dic[filename] = filelink 65 | return link_dic 66 | 67 | 68 | def findSuppleData(gsm_html): 69 | filename_regexp = re.compile(r'.*') 70 | filename_infor = filename_regexp.findall(gsm_html) 71 | link_regexp = re.compile(r'.*href=.*>\(ftp\)') 72 | link_infor = link_regexp.findall(gsm_html) 73 | link_dic = {} 74 | if filename_infor: 75 | if len(filename_infor) == len(link_infor): 76 | for i in range(len(filename_infor)): 77 | name = re.sub(r'','',filename_infor[i]).replace('','') 78 | link = re.sub(r'.*href="','',link_infor[i]).replace('">(ftp)','') 79 | link_dic[name] = link 80 | return link_dic 81 | else: 82 | print("some files miss links") 83 | return {} 84 | else: 85 | print("no link") 86 | return {} 87 | 88 | 89 | def getGsmHtml(gsm): 90 | try: 91 | gsm_url = 'http://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=%s'%gsm 92 | gsm_html = urllib.request.urlopen(gsm_url).read().decode('utf-8') 93 | return gsm_html 94 | except: 95 | print("retry......") 96 | time.sleep(10) 97 | gsm_url = 'http://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=%s'%gsm 98 | gsm_html = urllib.request.urlopen(gsm_url).read().decode('utf-8') 99 | return gsm_html 100 | 101 | 102 | def main(): 103 | class MyParser(argparse.ArgumentParser): 104 | def error(self, message): 105 | sys.stderr.write('error: %s\n' % message) 106 | self.print_help() 107 | sys.exit(2) 108 | 109 | parser = MyParser() 110 | parser.add_argument('-l', '--local', action='store_true',help='local file flag', default=False) 111 | parser.add_argument('-i', '--id', help='GSM id for online search') 112 | parser.add_argument('-x', '--xmlfolder', help='path to folder which saved xml files') 113 | parser.add_argument('-L', '--list', help='path to gsm list file') 114 | parser.add_argument('-o', '--output', help='path to output') 115 | args = parser.parse_args() 116 | 117 | gsm = args.id 118 | local_flag = args.local 119 | xml_path = args.xmlfolder 120 | input_list = args.list 121 | output = args.output 122 | 123 | 124 | if local_flag: 125 | header = "\t".join(["gseid","raw","barcode","count","tpm","gene","other"])+"\n" 126 | dict_gse = {} 127 | content = "" 128 | for i in os.listdir(xml_path): 129 | for j in os.listdir(xml_path+"/"+i): 130 | link_dic = findSuppleDataXml(xml_path+"/"+i+"/"+j) 131 | gse = j.split("/")[-1].split(".")[0] 132 | print(gse) 133 | file_type_dic = judgeType(link_dic) 134 | content = content + "\t".join([gse,",".join(file_type_dic["raw"]), 135 | ",".join(file_type_dic["barcode"]),",".join(file_type_dic["count"]),",".join(file_type_dic["tpm"]), 136 | ",".join(file_type_dic["gene"]),",".join(file_type_dic["other"])]) + "\n" 137 | with open(output,"w+") as output_file: 138 | output_file.write(header + content) 139 | 140 | 141 | # file_type_dic = judgeType(link_dic) 142 | # print(file_type_dic) 143 | else: 144 | # if input_list: 145 | # try: 146 | # if os.path.getsize(output) == 0: 147 | # with open(output,"a+") as output_file: 148 | # output_file.write("\t".join(["gsmID","barcode","count","tpm","gene","others"]) + "\n") 149 | # except FileNotFoundError: 150 | # with open(output,"a+") as output_file: 151 | # output_file.write("\t".join(["gsmID","barcode","count","tpm","gene","others"]) + "\n") 152 | # with open(input_list, "r+") as input_file: 153 | # id_list = input_file.readlines() 154 | # for i in id_list: 155 | # gsmid = i.strip() 156 | # print(gsmid) 157 | # gsm_html = getGsmHtml(gsmid) 158 | # print("Got the page.") 159 | # link_dic = findSuppleData(gsm_html) 160 | # file_type_dic = judgeType(link_dic) 161 | # with open(output,"a+") as output_file: 162 | # output_file.write("\t".join([gsmid,file_type_dic["barcode"],file_type_dic["count"],file_type_dic["tpm"], 163 | # file_type_dic["gene"],",".join(file_type_dic["other"])])+"\n") 164 | # print("wait for 10 secs.") 165 | # time.sleep(10) 166 | 167 | 168 | # else: 169 | # os.system('echo %s' % gsm) 170 | # gsm_html = getGsmHtml(gsm) 171 | # link_dic = findSuppleData(gsm_html) 172 | # print(link_dic) 173 | # file_type_dic = judgeType(link_dic) 174 | # print(file_type_dic) 175 | pass 176 | 177 | 178 | if __name__ == "__main__": 179 | main() 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | -------------------------------------------------------------------------------- /code/1_MAESTRO_AnalysisPipeline/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/code/1_MAESTRO_AnalysisPipeline/.DS_Store -------------------------------------------------------------------------------- /code/1_MAESTRO_AnalysisPipeline/Example/UCEC_GSE139555.sh: -------------------------------------------------------------------------------- 1 | # @Author: Dongqing Sun 2 | # @Date: 2020-04-25 04:55:38 3 | # @Last Modified by: Dongqing Sun 4 | # @Last Modified time: 2020-07-12 19:35:04 5 | 6 | 7 | # Sample type: LECR(Lung, Endometrial, Colon, Renal) 8 | # Genome build: hg38 9 | # Celltype: CD45+ (select from all, CD45+, CD3+) 10 | # Meta data: yes 11 | 12 | # pre-process meta data 13 | awk 'BEGIN{FS="\t"; OFS="\t"} {print $1,$5,$6,$7}' Data/LECR_GSE139555_metadata.txt | sed 's/_/@/g' > Data/LECR_GSE139555_meta.txt 14 | 15 | # run analysis pipeline 16 | MAESTRO scrna-analysis --format h5 --matrix Data/LECR_GSE139555_UCEC_gene_count.h5 \ 17 | --meta-file Data/LECR_GSE139555_meta.txt --meta-sep tab --meta-cell 1 \ 18 | --count-cutoff 1000 --gene-cutoff 500 --assembly GRCh38 \ 19 | --directory . --outprefix UCEC_GSE139555 20 | -------------------------------------------------------------------------------- /code/1_MAESTRO_AnalysisPipeline/MAESTRO_AnalysisPipeline.sh: -------------------------------------------------------------------------------- 1 | # @Author: Dongqing Sun 2 | # @Date: 2020-04-24 01:06:00 3 | # @Last Modified by: dongqing 4 | # @Last Modified time: 2020-05-24 16:16:32 5 | 6 | 7 | # Note: 8 | # The analysis pipeline starts from a count matrix, which can be MTX, HDF5 or plain text formatted, and then perform QC, clustering and cell-type annotation. 9 | # The analysis pipeline generates a R script which can be modified, clustering and annotated UMAP plots and a Seurat object which can be readable and writable. 10 | # Meta data is optional, not required. 11 | 12 | 13 | # activate conda environment 14 | source activate /mnt/Storage/home/sundongqing/miniconda3/envs/MAESTRO_latest 15 | 16 | # run the following command for detailed usage of MAESTRO 17 | MAESTRO --help 18 | MAESTRO scrna-analysis --help 19 | 20 | 21 | # the following commands can be used for format conversion 22 | MAESTRO mtx-to-h5 # Convert 10X mtx format matrix to HDF5 format. 23 | MAESTRO mtx-to-count # Convert 10X mtx format matrix to plain text count table. 24 | MAESTRO count-to-h5 # Convert plain text count table to HDF5 format. 25 | MAESTRO h5-to-count # Convert HDF5 format to plain text count table. 26 | MAESTRO merge-h5 # Merge 10X HDF5 files. 27 | 28 | 29 | # Note: 30 | # If there're multiple samples (count matrices) in one dataset, usually we convert the count matrices to HDF5 format firstly. 31 | # Then we merge these h5 matrices to a big h5 matrix and take it as the input of the analysis pipeline. 32 | # If meta table is provided, users should make sure the barcodes in the meta data are consistent with those in the count matrix. 33 | # Because in the big merged matix, the cell barcodes may have prefix (added through the parameter --cellprefix in MAESTRO merge-h5). 34 | 35 | 36 | # Examples: 37 | # run analysis pipeline (mtx data) 38 | MAESTRO scrna-analysis --format mtx --matrix Data/GSE140228_UMI_counts_Droplet.mtx \ 39 | --feature Data/GSE140228_UMI_counts_Droplet_genes_noheader.tsv --gene-column 2 --barcode Data/GSE140228_UMI_counts_Droplet_barcodes.tsv \ 40 | --meta-file Data/GSE140228_Droplet_cellinfo.tsv --meta-sep tab --meta-cell 1 \ 41 | --count-cutoff 1000 --gene-cutoff 500 --assembly GRCh38 \ 42 | --directory . --outprefix LIHC_GSE140228_10X 43 | 44 | # run analysis pipeline (h5 data) 45 | MAESTRO scrna-analysis --format h5 --matrix Data/GSE140228_Smartseq2_counts.h5 \ 46 | --meta-file Data/GSE140228_Smartseq2_cellinfo.tsv --meta-sep tab --meta-cell 1 \ 47 | --count-cutoff 1000 --gene-cutoff 500 --assembly GRCh38 \ 48 | --directory . --outprefix LIHC_GSE140228_Smartseq2 49 | 50 | # run analysis pipeline (plain text) 51 | MAESTRO scrna-analysis --format plain --matrix Data/GSE108989_CRC.TCell.S11138.count_nogeneid.txt --separator tab \ 52 | --count-cutoff 1000 --gene-cutoff 500 --assembly GRCh37 \ 53 | --directory . --outprefix COAD_GSE108989 54 | -------------------------------------------------------------------------------- /code/1_MAESTRO_AnalysisPipeline/inferCNV/inferCNV.R: -------------------------------------------------------------------------------- 1 | library("infercnv") 2 | library(Seurat) 3 | #Running InferCNV 4 | ##Creating an InferCNV object based on your three required inputs: the read count matrix, cell type annotations, and the gene ordering file: 5 | setwd("/mnt/Storage2/home/wangjin/scTumor_Data/MM_GSE141299/Data/Infercnv_result") 6 | 7 | ###10x raw counts matrix 8 | #SeuratObj <- readRDS("/mnt/Storage2/home/wangjin/scTumor_Data/MM_GSE141299/MM_GSE141299_res.rds") #10x 9 | infercnv_obj = CreateInfercnvObject(raw_counts_matrix= "MM_GSE141299_10x.txt", 10 | annotations_file= "cell.anno.txt", 11 | delim="\t", 12 | gene_order_file= "inferCNV_gene_order_file.txt", 13 | ref_group_names=NULL) 14 | 15 | # perform infercnv operations to reveal cnv signal 16 | infercnv_obj = infercnv::run(infercnv_obj, 17 | cutoff=0.1, # use 1 for smart-seq/Fluidigm C1, 0.1 for 10x-genomics/SNRS/MARS-Seq/Microwell/Drop-seq 18 | out_dir="k2.c1", # dir is auto-created for storing outputs 19 | cluster_by_groups=FALSE, # cluster 20 | k_obs_groups = 2, 21 | denoise=T) -------------------------------------------------------------------------------- /code/2_Annotation/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/code/2_Annotation/.DS_Store -------------------------------------------------------------------------------- /code/2_Annotation/Annotation_level1.R: -------------------------------------------------------------------------------- 1 | library(MAESTRO) 2 | library(Seurat) 3 | library(ggplot2) 4 | file_path="/mnt/Storage2/home/wangjin/scTumor_Data/" 5 | file_names=list.files(file_path,recursive=T) 6 | Seurat_file=Seurat_file[grep("_res.rds",Seurat_file)] 7 | Seurat_file=paste0(file_path,Seurat_file) 8 | result = sapply(Seurat_file, Level1_RNAAnnotateCelltype) 9 | 10 | Level1_RNAAnnotateCelltype<-function(file_name, min.score = 0){ 11 | seurat_object <- readRDS(file_name) 12 | dir_name=dirname(file_name) 13 | setwd(dir_name) 14 | 15 | if("assign.curated" %in% colnames(seurat_object$RNA@meta.data)){ 16 | cluster_id=as.integer(unique(seurat_object$RNA@meta.data$seurat_clusters))-1 17 | level1_annotation=data.frame(cbind(cluster_id,seurat_object$RNA@meta.data$assign.curated[match(cluster_id,seurat_object$RNA@meta.data$seurat_clusters)])) 18 | names(level1_annotation)=c("cluster_id","level2_anno") 19 | 20 | level2_immu=c("B","CD4Tconv","CD8T","CD8Tex","DC","Mast","Mono/Macro","TMKI67","Neutrophils","NK","Plasma","Treg","pDC","EryPro","GMP","Progenitor","Promonocyte","HSC","ILC","hematopoietic stem/progenitor cell") 21 | malignant_cell=c("Malignant","OPC-like Malignant","AC-like Malignant","OC-like Malignant","NB-like Malignant","Pvalb-like Maligant","Vip-like Malignant","Astro-like Malignant","Endo-like Malignant") 22 | others_cell=c("Oligodendrocyte","Oligodendrocytes","Neuron","OPC","Alveolar", "Endocrine","Others","Stellate","Astocyte","Acinar","Ductal","Astrocytes","Acinar cells","Microglia","Oligo Opalin") 23 | 24 | level1_annotation=as.matrix(level1_annotation) 25 | level1_annotation[which(!(level1_annotation[,2] %in% c(level2_immu,malignant_cell,others_cell))),2]="Stromal cells" 26 | level1_annotation[which(level1_annotation[,2] %in% level2_immu),2]="Immune cells" 27 | level1_annotation[which(level1_annotation[,2] %in% malignant_cell ),2]="Malignant cells" 28 | level1_annotation[which(level1_annotation[,2] %in% others_cell),2]="Others" 29 | level2_ann=seurat_object$RNA@meta.data$assign.curated[match(cluster_id,seurat_object$RNA@meta.data$seurat_clusters)] 30 | print(cbind(level1_annotation,level2_ann)) 31 | 32 | current.cluster.ids = level1_annotation[,1] 33 | new.cluster.ids = level1_annotation[,2] 34 | seurat_object$RNA@meta.data$assign.level1_anno = Idents(seurat_object$RNA)[rownames(seurat_object$RNA@meta.data)] 35 | seurat_object$RNA@meta.data$assign.level1_anno = plyr::mapvalues(x = seurat_object$RNA@meta.data$assign.level1_anno, 36 | from = current.cluster.ids, to = new.cluster.ids) 37 | 38 | p = DimPlot(object = seurat_object$RNA, group = "assign.level1_anno", label = TRUE, pt.size = 0.1) 39 | ggsave(file.path(paste0(seurat_object$RNA@project.name, "_", "annotated_level1", ".png")), p, width=7, height=5) 40 | saveRDS(seurat_object, paste0(seurat_object$RNA@project.name,"_res.rds")) 41 | } 42 | } -------------------------------------------------------------------------------- /code/2_Annotation/Annotation_level3.R: -------------------------------------------------------------------------------- 1 | library(MAESTRO) 2 | library(Seurat) 3 | library(ggplot2) 4 | file_path="/mnt/Storage2/home/wangjin/scTumor_Data/" 5 | file_names=list.files(file_path,recursive=T) 6 | Seurat_file=Seurat_file[grep("_res.rds",Seurat_file)] 7 | Seurat_file=paste0(file_path,Seurat_file) 8 | 9 | result = sapply(Seurat_file, Level3_RNAAnnotateCelltype) 10 | 11 | Level3_Tcell_RNAAnnotateCelltype <- function(subset_Tcell){ 12 | signatures = read.table("Signature/Tcell_subset_signature.txt",header = F,sep="\t") 13 | 14 | celltypes <- as.character(unique(signatures[,1])) 15 | signature_list <- sapply(1:length(celltypes),function(x){ 16 | return(toupper(as.character(signatures[which(signatures[,1]==celltypes[x]),2]))) 17 | }) 18 | names(signature_list) <- celltypes 19 | 20 | cluster_celltypes = sapply(as.numeric(as.vector(unlist(subset_Tcell$cluster_id))), function(x){ 21 | if(subset_Tcell[match(x,as.numeric(as.vector(unlist(subset_Tcell$cluster_id)))),2] %in% c("CD4Tconv")){ 22 | temp_signature_list=signature_list[c(2,5,7,10:12)] 23 | }else{ 24 | temp_signature_list=signature_list[c(1,3,4,6,8)] 25 | } 26 | 27 | idx = genes$cluster==x 28 | avglogFC = genes$avg_logFC[idx] 29 | names(avglogFC) = toupper(genes$gene[idx]) 30 | score_cluster = sapply(temp_signature_list, function(y){ 31 | score = sum(avglogFC[y], na.rm = TRUE) / log2(length(y)) 32 | return(score) 33 | }) 34 | 35 | if(max(score_cluster, na.rm = TRUE)>0){ 36 | cluster_celltypes = names(score_cluster)[which.max(score_cluster)] 37 | }else{ 38 | index=which(seurat_object$RNA@meta.data$seurat_clusters == x)[1] 39 | cluster_celltypes = seurat_object$RNA@meta.data$assign.curated[index]} 40 | }) 41 | 42 | return(cbind(as.numeric(as.vector(unlist(subset_Tcell$cluster_id))),cluster_celltypes)) 43 | } 44 | 45 | 46 | Level3_DC_RNAAnnotateCelltype <- function(subset_DC){ 47 | signatures = read.table("Signature/DC_subset_signature.txt",header = F,sep="\t") 48 | 49 | celltypes <- as.character(unique(signatures[,1])) 50 | signature_list <- sapply(1:length(celltypes),function(x){ 51 | return(toupper(as.character(signatures[which(signatures[,1]==celltypes[x]),2]))) 52 | }) 53 | names(signature_list) <- celltypes 54 | signature_list=signature_list[1:5]#exclude pDC 55 | cluster_celltypes = sapply(as.integer(unique(subset_DC$seurat_clusters))-1, function(x){ 56 | idx = genes$cluster==x 57 | avglogFC = genes$avg_logFC[idx] 58 | names(avglogFC) = toupper(genes$gene[idx]) 59 | score_cluster = sapply(signature_list, function(y){ 60 | score = sum(avglogFC[y], na.rm = TRUE) / log2(length(y)) 61 | return(score) 62 | }) 63 | if(max(score_cluster, na.rm = TRUE)>0){ 64 | cluster_celltypes = names(score_cluster)[which.max(score_cluster)] 65 | }else{ 66 | index=which(seurat_object$RNA@meta.data$seurat_clusters == x)[1] 67 | cluster_celltypes = seurat_object$RNA@meta.data$assign.curated[index]} 68 | }) 69 | 70 | return(cbind(as.integer(unique(subset_DC$seurat_clusters))-1,cluster_celltypes)) 71 | } 72 | 73 | 74 | Level3_RNAAnnotateCelltype<-function(file_name){ 75 | seurat_object<-readRDS(file_name) 76 | genes<-seurat_object$genes 77 | dir_name=dirname(file_name) 78 | setwd(dir_name) 79 | 80 | if(length(seurat_object$RNA@meta.data$assign.curated) > 0){ 81 | cluster_id=as.integer(unique(seurat_object$RNA@meta.data$seurat_clusters))-1 82 | level3_annotation=data.frame(cbind(cluster_id,seurat_object$RNA@meta.data$assign.curated[match(cluster_id,seurat_object$RNA@meta.data$seurat_clusters)])) 83 | names(level3_annotation)=c("cluster_id","level2_anno") 84 | 85 | subset_Tcell=subset(level3_annotation,level2_anno %in% c("CD8T","CD4Tconv")) 86 | Tcell_annotation=Level3_Tcell_RNAAnnotateCelltype(subset_Tcell) 87 | 88 | subset_DC=subset(seurat_object$RNA@meta.data,assign.curated %in% c("Mono/Macro","DC")) 89 | DC_Mo_annotation=Level3_DC_RNAAnnotateCelltype(subset_DC) 90 | 91 | level3_anno=rbind(Tcell_annotation,DC_Mo_annotation) 92 | level3_annotation=as.matrix(level3_annotation) 93 | if(dim(level3_anno)[1] > 1){ 94 | level3_anno=matrix(unlist(level3_anno),byrow=F,ncol=2) 95 | level3_annotation[match(level3_anno[,1],level3_annotation[,1]),2]=level3_anno[,2] 96 | }else{ 97 | level3_annotation[match(unlist(level3_anno[1]),level3_annotation[,1]),2]=unlist(level3_anno[2]) 98 | } 99 | 100 | current.cluster.ids = level3_annotation[,1] 101 | new.cluster.ids = level3_annotation[,2] 102 | seurat_object$RNA@meta.data$assign.level3_anno = Idents(seurat_object$RNA)[rownames(seurat_object$RNA@meta.data)] 103 | seurat_object$RNA@meta.data$assign.level3_anno = plyr::mapvalues(x = seurat_object$RNA@meta.data$assign.level3_anno, 104 | from = current.cluster.ids, to = new.cluster.ids) 105 | 106 | p = DimPlot(object = seurat_object$RNA, group = "assign.level3_anno", label = TRUE, pt.size = 0.1) 107 | ggsave(file.path(paste0(seurat_object$RNA@project.name, "_", "annotated_level3", ".png")), p, width=6.5, height=5) 108 | saveRDS(seurat_object, paste0(seurat_object$RNA@project.name,"_res.rds")) 109 | } 110 | } -------------------------------------------------------------------------------- /code/2_Annotation/Signature/DC_subset_signature.txt: -------------------------------------------------------------------------------- 1 | cDC1 BATF3 cDC1 BTLA cDC1 CADM1 cDC1 CD226 cDC1 CLEC9A cDC1 DPP4 cDC1 ID2 cDC1 IRF8 cDC1 THBD cDC1 TLR3 cDC1 XCR1 cDC1 CCL22 cDC1 FLT3 cDC1 CD8A cDC1 CD207 cDC1 ITGAE cDC2 CCL22 cDC2 CD209 cDC2 CCL17 cDC2 HSD11B1 cDC2 CCL13 cDC2 PPFIBP2 cDC2 NPR1 cDC2 CD1B cDC2 VASH1 cDC2 F13A1 cDC2 CD1E cDC2 MMP12 cDC2 FABP4 cDC2 CLEC10A cDC2 SYT17 cDC2 MS4A6A cDC2 CTNS cDC2 GUCA1A cDC2 CARD9 cDC2 ABCG2 cDC2 CD1A cDC2 PPARG cDC2 RAP1GAP cDC2 SLC7A8 cDC2 GSTT1 cDC2 PDXK cDC2 FZD2 cDC2 CSF1R cDC2 HS3ST2 cDC2 CH25H cDC2 LMAN2L cDC2 SLC26A6 cDC2 BLVRB cDC2 NUDT9 cDC2 PREP cDC2 TM7SF4 cDC2 TACSTD2 cDC2 CD1C cDC2 CCL1 cDC2 EBI3 cDC2 INDO cDC2 LAMP3 cDC2 OAS3 cDC2 IL3RA M1 SIGLEC1 M1 CCR5 M1 CD33 M1 CD40 M1 CD63 M1 CD68 M1 CD80 M1 CD86 M1 CLEC7A M1 CXCL10 M1 CXCL11 M1 CXCL2 M1 CXCL9 M1 ENG M1 FCGR1A M1 FCGR1B M1 FCGR1C M1 FCGR2A M1 FCGR2B M1 FCGR3A M1 FCGR3B M1 FUT4 M1 IDO M1 LILRA4 M1 MerTK M1 NOS2 M1 SOCS1 M1 SOCS3 M1 TLR2 M1 TLR4 M1 TREM1 M1 FCER1G M1 FCER2A M1 HLA-DRA M2 SIGLEC1 M2 ARG1 M2 CCL22 M2 CCR5 M2 CD163 M2 CD200R1 M2 CD209 M2 CD33 M2 CD40 M2 CD63 M2 CD68 M2 CD80 M2 CD86 M2 CXCL10 M2 CXCL11 M2 CXCL2 M2 CXCL9 M2 ENG M2 FCER2 M2 FUT4 M2 ITGAM M2 JUN M2 LILRA4 M2 MRC1 M2 MSR1 M2 PPARG M2 TGM2 M2 TLR2 M2 TLR4 M2 TREM1 M2 TREM2 M2 FCER1G M2 FCER2A M2 HLA-DRA Monocyte SIGLEC1 Monocyte CCR5 Monocyte CD14 Monocyte CD33 Monocyte CD40 Monocyte CD63 Monocyte CD68 Monocyte CD80 Monocyte CD86 Monocyte CD93 Monocyte CSF1R Monocyte CXCL10 Monocyte CXCL11 Monocyte CXCL2 Monocyte CXCL9 Monocyte ENG Monocyte FCGR3A Monocyte FUT4 Monocyte ITGA5 Monocyte ITGAM Monocyte ITGAX Monocyte LILRA4 Monocyte S100A9 Monocyte TLR2 Monocyte TLR4 Monocyte TREM1 Monocyte S100A8 pDC CD123 pDC CD14 pDC CD19 pDC CD1A pDC CLEC4C pDC DR6 pDC FECR1 pDC GZMB pDC HLA-DRA pDC IFNA1 pDC IFNB1 pDC IL10 pDC IL3RA pDC IL6 pDC ILT3 pDC ILT7 pDC IRF4 pDC IRF7 pDC IRF8 pDC ITGAX pDC LILRB4 pDC MS4A1 pDC NCAM1 pDC NRP1 pDC PTPRC pDC Siglech pDC SPIB pDC TCF4 pDC TLR7 pDC TLR9 pDC TNF pDC ZEB2 pDC FLT3 Plasma ABCB9 Plasma AMPD1 Plasma ANGPT4 Plasma ATXN8OS Plasma C11orf80 Plasma CCR10 Plasma CD27 Plasma CD38 Plasma CD79A Plasma DENND5B Plasma EAF2 Plasma FCRL2 Plasma GNG7 Plasma GPR25 Plasma GUSBP11 Plasma HIST1H2AE Plasma HIST1H2BG Plasma HLA-DOB Plasma IGHD Plasma IGHE Plasma IGHM Plasma IGKC Plasma IGLL3P Plasma KCNA3 Plasma KCNG2 Plasma LIME1 Plasma LOC100130100 Plasma MAN1A1 Plasma MANEA Plasma MAST1 Plasma MROH7 Plasma MZB1 Plasma P2RX5 Plasma PAX7 Plasma PDK1 Plasma PNOC Plasma RASGRP3 Plasma REN Plasma RGS13 Plasma RPL3P7 Plasma SIK1 Plasma SPAG4 Plasma ST6GALNAC4 Plasma TGM5 Plasma TMEM156 Plasma TNFRSF17 Plasma UGT2B17 Plasma ZBP1 Plasma ZNF165 -------------------------------------------------------------------------------- /code/2_Annotation/Signature/Tcell_subset_signature.txt: -------------------------------------------------------------------------------- 1 | CD8Tcm BCL6 CD8Tcm BCL6B CD8Tcm BMI1 CD8Tcm CCL5 CD8Tcm CCR7 CD8Tcm CD27 CD8Tcm CD28 CD8Tcm CD3D CD8Tcm CD3E CD8Tcm CD3G CD8Tcm CD44 CD8Tcm CD8A CD8Tcm CD8B CD8Tcm CXCR3 CD8Tcm EOMES CD8Tcm GPR183 CD8Tcm GZMA CD8Tcm GZMK CD8Tcm IL15RA CD8Tcm IL2RB CD8Tcm IL2RG CD8Tcm IL7R CD8Tcm MBD2 CD8Tcm PRF1 CD8Tcm S1PR1 CD8Tcm SELL CD8Tcm TRD CD8Tcm TRG CD4Teff CD3D CD4Teff CD3E CD4Teff CD3G CD4Teff CD4 CD4Teff CTSW CD4Teff CX3CR1 CD4Teff GNLY CD4Teff GZMH CD4Teff KLRG1 CD4Teff NKG7 CD4Teff PRF1 CD4Teff S1PR1 CD4Teff S1PR5 CD4Teff TBX21 CD8Teff CD3D CD8Teff CD3E CD8Teff CD3G CD8Teff CD8A CD8Teff CD8B CD8Teff CX3CR1 CD8Teff EOMES CD8Teff FCGR3A CD8Teff FGFBP2 CD8Teff FOS CD8Teff GZMH CD8Teff IFNG CD8Teff JUN CD8Teff KLRG1 CD8Teff PRF1 CD8Teff S1PR1 CD8Teff S1PR5 CD8Teff TBX21 CD8Teff TNF CD8Tem CCR7 CD8Tem CD3D CD8Tem CD3E CD8Tem CD3G CD8Tem CD44 CD8Tem CD8A CD8Tem CD8B CD8Tem CXCR3 CD8Tem CXCR4 CD8Tem FGFBP2 CD8Tem GZMK CD8Tem IL15RA CD8Tem IL2RB CD8Tem IL2RG CD8Tem IL7R CD8Tem KLRD1 CD8Tem KLRG1 CD8Tem PRDM1 CD8Tem TRD CD8Tem TRG Tfh BCL6 Tfh BLTA Tfh CD200 Tfh CD3D Tfh CD3E Tfh CD3G Tfh CD4 Tfh CD40LG Tfh CXCR3 Tfh CXCR5 Tfh ICA1 Tfh ICOS Tfh IL21R Tfh IL6ST Tfh MAGEH1 Tfh PDCD1 Tfh PTPN13 Tfh SLAM Tfh STAT3 Tfh TNFSF4 Tfh TOX Tfh TOX2 MAIT CD3D MAIT CD3E MAIT CD3G MAIT CD8A MAIT CD8B MAIT KLRB1 MAIT NCR3 MAIT RORA MAIT RORC MAIT SLC4A10 MAIT ZBTB16 CD4Tn CCR7 CD4Tn CD27 CD4Tn CD28 CD4Tn CD3D CD4Tn CD3E CD4Tn CD3G CD4Tn CD4 CD4Tn LEF1 CD4Tn RUNX3 CD4Tn S1PR1 CD4Tn SELL CD4Tn TCF7 CD4Tn ZBTB7B CD8Tn CCR7 CD8Tn CD27 CD8Tn CD28 CD8Tn CD3D CD8Tn CD3E CD8Tn CD3G CD8Tn CD8A CD8Tn CD8B CD8Tn IL7R CD8Tn LEF1 CD8Tn RUNX3 CD8Tn S1PR1 CD8Tn SELL CD8Tn TCF7 CD8Tn ZBTB7B Treg CD3D Treg CD3E Treg CD3G Treg CD4 Treg CDC25B Treg CTLA4 Treg FOXO1 Treg FOXO3 Treg FOXP3 Treg IKZF2 Treg IL10RA Treg IL2RA Treg RTKN2 Treg S1PR4 Treg STAT5A Treg STAT5B Th1 BHLHE40 Th1 CCR1 Th1 CCR5 Th1 CD3D Th1 CD3E Th1 CD3G Th1 CD4 Th1 CD94 Th1 CXCL13 Th1 CXCR3 Th1 CXCR6 Th1 GZMB Th1 HAVCR2 Th1 ICOS Th1 IFNG Th1 IFNGR1 Th1 IFNGR2 Th1 IGFLR1 Th1 IL12RB1 Th1 IL12RB2 Th1 IL18R1 Th1 ITGAE Th1 PDCD1 Th1 STAT1 Th1 STAT4 Th1 TBX21 Th1 TNFSF11 Th17 CAPG Th17 CCR6 Th17 CD3D Th17 CD3E Th17 CD3G Th17 CD4 Th17 CTSH Th17 FURIN Th17 IL23R Th17 IL17A Th17 IL1R1 Th17 IL1R2 Th17 IL26 Th17 ITGAE Th17 KLRB1 Th17 RORA Th17 RORC Th17 STAT3 Th2 BHLHE41 Th2 CCR4 Th2 CCR8 Th2 CD3D Th2 CD3E Th2 CD3G Th2 CD4 Th2 CXCR4 Th2 GATA3 Th2 GPR44 Th2 HAVCR1 Th2 IL17RB Th2 IL1RL1 Th2 IL4R Th2 MAF Th2 PTGDR2 Th2 STAT6 -------------------------------------------------------------------------------- /code/3_GSEA/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/code/3_GSEA/.DS_Store -------------------------------------------------------------------------------- /code/3_GSEA/src/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/code/3_GSEA/src/.DS_Store -------------------------------------------------------------------------------- /code/3_GSEA/src/cluster_level/cluster_cell_DE.R: -------------------------------------------------------------------------------- 1 | library(MAESTRO) 2 | library(dplyr) 3 | library(optparse) 4 | 5 | option_list <- list( 6 | make_option(c("-i", "--input"), type="character", 7 | help="Input file of seurat object"), 8 | make_option(c("-o", "--output"), type="character", 9 | help="Ouput path of count data and meta data. [Required]") 10 | ) 11 | opt_parser <- OptionParser(option_list=option_list,add_help_option = FALSE); 12 | opts <- parse_args(opt_parser); 13 | 14 | input <- opts$input 15 | output <- opts$output 16 | 17 | ### read in rds file 18 | rds <- readRDS(input) 19 | name <- gsub("_CCA","", rds$RNA@project.name) 20 | 21 | ##do DE analysis in cluster level for PreRanked GSEA 22 | cluster.genes <- FindAllMarkersMAESTRO(object = rds$RNA, min.pct = 0.1, logfc.threshold = 0, test.use = "presto", only.pos = FALSE) 23 | write.table(cluster.genes,paste(output, name, "_cluster_DE.txt",sep = ""), quote = FALSE, sep = "\t") 24 | 25 | ### save result recording cluster and corresponding cell type 26 | cluster_cell <- data.frame(cluster=as.character(rds$RNA@meta.data$seurat_clusters), 27 | cell_level1=as.character(rds$RNA@meta.data$assign.level1_anno), 28 | cell_level2=as.character(rds$RNA@meta.data$assign.curated), 29 | cell_level3=as.character(rds$RNA@meta.data$assign.level3_anno), 30 | cell_maestro=as.character(rds$RNA@meta.data$assign.ident)) 31 | cluster_cell_uiq <- cluster_cell[!duplicated(cluster_cell),] 32 | write.table(cluster_cell_uiq,paste(output, name, "_cluster_cell.txt", sep = ""), quote = FALSE, sep = "\t", row.names = FALSE) 33 | 34 | -------------------------------------------------------------------------------- /code/3_GSEA/src/cluster_level/run_cluster_GSEA.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ###script of generating prerank files from single cell DE analysis and run GSEA on KEGG and hallmark 4 | 5 | gsea_path="/mnt/Storage2/home/wangjin/tools/gsea/GSEA_Linux_4.0.3/" 6 | hs_hallmark_gmt="/mnt/Storage2/home/wangjin/tools/gsea/GSEA_Linux_4.0.3/h.all.v7.1.symbols.gmt" 7 | hs_kegg_gmt="/mnt/Storage2/home/wangjin/tools/gsea/GSEA_Linux_4.0.3/c2.cp.kegg.v7.1.symbols.gmt" 8 | mm_hallmark_gmt="/mnt/Storage2/home/wangjin/tools/gsea/GSEA_Linux_4.0.3/h.all.v7.1.symbols_mouse.gmt" 9 | mm_kegg_gmt="/mnt/Storage2/home/wangjin/tools/gsea/GSEA_Linux_4.0.3/c2.cp.kegg.v7.1.symbols_mouse.gmt" 10 | 11 | ###split DE analysis results into cell types and generate preranked rnk file 12 | echo "generating rnk file" 13 | cd ${1} 14 | cp ${1}_cluster_DE.txt tmp 15 | # sed -i "s/Mono\/Macro/Mono-Macro/g" tmp 16 | awk -F "\t" 'NR!=1{print>"cluster_"$7}' tmp; for file in $(ls | grep ^cluster_); do awk -F "\t" '{print $8"\t"$3}' OFS="\t" $file | sort -k2gr > $file"_preranked.rnk"; done 17 | 18 | 19 | ###GSEA analysis for each rnk file using hallmark and kegg gene sets 20 | mkdir -p ${1}_cluster_DE_GSEA/hallmark 21 | mkdir -p ${1}_cluster_DE_GSEA/kegg 22 | 23 | for rnk in $(ls | grep preranked.rnk | grep ^cluster_) 24 | do 25 | if echo ${1} | grep "mouse"; then 26 | echo "$rnk for GSEA using $hallmark_gmt"; 27 | $gsea_path/gsea-cli.sh GSEAPreranked -rnk $rnk -gmx $mm_hallmark_gmt -rpt_label $rnk"_hallmark" -out ./ > gsea.log 28 | echo "$rnk for GSEA using $kegg_gmt" 29 | $gsea_path/gsea-cli.sh GSEAPreranked -rnk $rnk -gmx $mm_kegg_gmt -rpt_label $rnk"_kegg" -out ./ >> gsea.log 30 | else 31 | echo "$rnk for GSEA using $hallmark_gmt"; 32 | $gsea_path/gsea-cli.sh GSEAPreranked -rnk $rnk -gmx $hs_hallmark_gmt -rpt_label $rnk"_hallmark" -out ./ > gsea.log 33 | echo "$rnk for GSEA using $kegg_gmt" 34 | $gsea_path/gsea-cli.sh GSEAPreranked -rnk $rnk -gmx $hs_kegg_gmt -rpt_label $rnk"_kegg" -out ./ >> gsea.log 35 | fi 36 | done 37 | 38 | ####merger hallmark results for all cell types 39 | echo "merge all hallmark gsea reports of cell types together " 40 | for file in $(find ./*hallmark* -name "gsea_report_for_na_*xls") 41 | do 42 | prefix=$(echo $file | awk -F "_" '{print "cluster_"$2}'); 43 | fname=$(basename ${file}); 44 | cp $file ./${1}_cluster_DE_GSEA/hallmark/$prefix"_hallmark_"$fname; 45 | done 46 | 47 | ####merger kegg results for all cell types 48 | echo "merge all kegg gsea reports of cell types together " 49 | for file in $(find ./*kegg* -name "gsea_report_for_na_*xls") 50 | do 51 | prefix=$(echo $file | awk -F "_" '{print "cluster_"$2}'); 52 | fname=$(basename ${file}); 53 | cp $file ./${1}_cluster_DE_GSEA/kegg/$prefix"_kegg_"$fname; 54 | done 55 | 56 | ###delete temporary file 57 | rm tmp 58 | 59 | 60 | -------------------------------------------------------------------------------- /code/3_GSEA/src/cluster_level/submit_cluster_cell_DE.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | cat DE_input.tmp | while read input output 5 | do 6 | while true 7 | do 8 | sleep 3s 9 | CURRENT=$(ps -u wangjin | grep -E "R" | wc -l) 10 | if [ ${CURRENT} -lt 10 ];then 11 | mkdir -p $output 12 | nohup Rscript cluster_cell_DE.R --input $input --output $output & 13 | break 14 | fi 15 | done 16 | done 17 | -------------------------------------------------------------------------------- /code/3_GSEA/src/cluster_level/submit_run_GSEA.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | cat GSEA_input.tmp | while read input 5 | do 6 | while true 7 | do 8 | sleep 3s 9 | CURRENT=$(ps -u wangjin | grep -E "java" | wc -l) 10 | if [ ${CURRENT} -lt 8 ];then 11 | nohup ./run_cluster_GSEA.sh $input & 12 | break 13 | fi 14 | done 15 | done 16 | -------------------------------------------------------------------------------- /code/3_GSEA/src/meta_level/meta_cluster_DE.R: -------------------------------------------------------------------------------- 1 | library(Seurat) 2 | library(jsonlite) 3 | library(dplyr) 4 | library(stringr) 5 | library(utils) 6 | library(optparse) 7 | library(future) 8 | plan("multiprocess", workers = 8) 9 | options(future.globals.maxSize = 10*1024^3) 10 | 11 | option_list <- list( 12 | make_option(c("-i", "--input"), type="character", 13 | help="Input file of seurat object"), 14 | make_option(c("-o", "--output"), type="character", 15 | help="Ouput path of count data and meta data. [Required]"), 16 | make_option(c("-j", "--json"), type="character", 17 | help="json file"), 18 | make_option(c("-m", "--meta"), type="character", 19 | help="meta file") 20 | ) 21 | opt_parser <- OptionParser(option_list=option_list,add_help_option = FALSE); 22 | opts <- parse_args(opt_parser); 23 | 24 | input <- opts$input 25 | output <- opts$output 26 | json_file <- opts$json 27 | meta <- opts$meta 28 | 29 | 30 | ### read in seurat object 31 | RNA.res <- readRDS(input) 32 | name <- gsub("_CCA","", RNA.res$RNA@project.name) 33 | 34 | ### save result recording cluster and corresponding cell type 35 | cluster_cell <- data.frame(cluster=as.character(RNA.res$RNA@meta.data$seurat_clusters), 36 | cell_level1=as.character(RNA.res$RNA@meta.data$assign.level1_anno), 37 | cell_level2=as.character(RNA.res$RNA@meta.data$assign.curated), 38 | cell_level3=as.character(RNA.res$RNA@meta.data$assign.level3_anno), 39 | cell_maestro=as.character(RNA.res$RNA@meta.data$assign.CIBERSORT)) 40 | cluster_cell_uiq <- cluster_cell[!duplicated(cluster_cell),] 41 | write.table(cluster_cell_uiq,paste(output, name, "_cluster_cell.txt", sep = ""), quote = FALSE, sep = "\t", row.names = FALSE) 42 | 43 | #### extract the specific meta column in the rds file 44 | json <- fromJSON(json_file, flatten=TRUE) 45 | json <- as.data.frame(json) 46 | json.df <- subset(json, select=colnames(json)[! colnames(json) %in% c("UMAP_1","UMAP_2","Cluster", "Celltype_general", "Celltype_curated", "Celltype_subtype")]) 47 | uniq_val <- sort(unique(as.character(json.df[,meta]))) 48 | map_col <- unlist(lapply(colnames(RNA.res$RNA@meta.data), function(col){ 49 | ori_val <- sort(unique(as.character(RNA.res$RNA@meta.data[,col]))) 50 | ori_val <- ori_val[ori_val != "NA"] 51 | if(setequal(uniq_val, ori_val)){return(col)} 52 | })) 53 | print(paste("The corresponding meta column of ",meta," in rds is ",map_col ,sep = "")) 54 | 55 | 56 | ### create a new identity for recording cluster and conditions 57 | conditions <- gsub(" ","",(gsub("/","|",gsub("-","",RNA.res$RNA[[map_col]][,1])))) # remove specific character in meta condition 58 | RNA.res$RNA$cluster.condition <- paste(Idents(RNA.res$RNA), conditions, sep = "_") 59 | Idents(RNA.res$RNA) <- "cluster.condition" 60 | 61 | ### extract all combinations for different conditions in each cluster (make sure each condition has >3 cells in each cluster) 62 | cd_cell <- table(RNA.res$RNA$cluster.condition)[table(RNA.res$RNA$cluster.condition) >= 3] 63 | cluster <- data.frame(do.call("rbind",strsplit(names(cd_cell), "\\_"))) 64 | colnames(cluster) <- c("cl","cd") 65 | cluster_df <- cluster %>% group_by(cl) %>% summarise(conts = paste(cd, collapse = ",")) %>% mutate(n = str_count(conts,",")+1) %>% filter(n > 1) 66 | print(cluster_df) 67 | 68 | for(c in cluster_df$cl){ 69 | cds <- unlist(subset(cluster_df, cl == c, select = "conts")) 70 | cds <- strsplit(cds, ",")[[1]] 71 | comb <- combn(cds,2) 72 | print(c) 73 | for(gr in 1:ncol(comb)){ 74 | compare <- c(comb[1,gr], comb[2,gr]) 75 | compare <- sort(compare, decreasing = TRUE) 76 | c1 <- paste(c, compare[1], sep = "_") 77 | c2 <- paste(c, compare[2], sep = "_") 78 | print(paste("perform differential analysis on ", c1," VS ", c2, " in cluster ", c,sep = "")) 79 | condition.cluster.genes <- FindMarkersMAESTRO(RNA.res$RNA, ident.1 = c1, ident.2 = c2, verbose = FALSE, 80 | min.pct = 0.1, min.cells.group = 3, logfc.threshold = 0, slot = "data", only.pos = FALSE) 81 | condition.cluster.genes$gene <- rownames(condition.cluster.genes) 82 | print(dim(condition.cluster.genes)) 83 | write.table(condition.cluster.genes, paste(output, name, "_",meta,"_C",c,"_",compare[1],"VS",compare[2],"_DE.txt",sep = ""), quote = FALSE, row.names = FALSE, sep = "\t") 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /code/3_GSEA/src/meta_level/meta_cluster_GSEA.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ###script of generating prerank files from single cell DE analysis and run GSEA on KEGG and hallmark 4 | 5 | gsea_path="/mnt/Storage2/home/wangjin/tools/gsea/GSEA_Linux_4.0.3/" 6 | hs_hallmark_gmt="/mnt/Storage2/home/wangjin/tools/gsea/GSEA_Linux_4.0.3/h.all.v7.1.symbols.gmt" 7 | hs_kegg_gmt="/mnt/Storage2/home/wangjin/tools/gsea/GSEA_Linux_4.0.3/c2.cp.kegg.v7.1.symbols.gmt" 8 | mm_hallmark_gmt="/mnt/Storage2/home/wangjin/tools/gsea/GSEA_Linux_4.0.3/h.all.v7.1.symbols_mouse.gmt" 9 | mm_kegg_gmt="/mnt/Storage2/home/wangjin/tools/gsea/GSEA_Linux_4.0.3/c2.cp.kegg.v7.1.symbols_mouse.gmt" 10 | 11 | ###split DE analysis results into cell types and generate preranked rnk file 12 | echo "generating rnk file" 13 | cd ${1} 14 | name=$(echo ${1}"_") 15 | # awk -F "\t" -v condition=${2} 'NR!=1{gsub(/ /,"",$7);print>condition"_"$7}' ${2}_tmp; 16 | for file in $(ls | grep ${2}.*DE.txt$); do fname=$(echo $file | sed "s/${name}//g");awk 'NR!=1{print $6"\t"$2}' OFS="\t" $file | sort -k2gr > $fname"_preranked.rnk"; done 17 | 18 | ###GSEA analysis for each rnk file using hallmark and kegg gene sets 19 | mkdir -p ${1}_${2}_DE_GSEA/hallmark 20 | mkdir -p ${1}_${2}_DE_GSEA/kegg 21 | 22 | for rnk in $(ls | grep preranked.rnk | grep ^${2}) 23 | do 24 | if echo ${1} | grep "mouse"; then 25 | echo "$rnk for GSEA using $hallmark_gmt"; 26 | $gsea_path/gsea-cli.sh GSEAPreranked -rnk $rnk -gmx $mm_hallmark_gmt -rpt_label $rnk"_hallmark" -out ./ > gsea.log 27 | echo "$rnk for GSEA using $kegg_gmt" 28 | $gsea_path/gsea-cli.sh GSEAPreranked -rnk $rnk -gmx $mm_kegg_gmt -rpt_label $rnk"_kegg" -out ./ >> gsea.log 29 | else 30 | echo "$rnk for GSEA using $hallmark_gmt"; 31 | $gsea_path/gsea-cli.sh GSEAPreranked -rnk $rnk -gmx $hs_hallmark_gmt -rpt_label $rnk"_hallmark" -out ./ > gsea.log 32 | echo "$rnk for GSEA using $kegg_gmt" 33 | $gsea_path/gsea-cli.sh GSEAPreranked -rnk $rnk -gmx $hs_kegg_gmt -rpt_label $rnk"_kegg" -out ./ >> gsea.log 34 | fi 35 | done 36 | 37 | ####merger hallmark results for all cell types 38 | echo "merge all hallmark gsea reports of cell types together " 39 | for file in $(find ./${2}*hallmark* -name "gsea_report_for_na_*xls") 40 | do 41 | prefix=$(echo $file | awk -F "_" '{print $1"_"$2"_"$3}'); 42 | fname=$(basename ${file}); 43 | cp $file ./${1}_${2}_DE_GSEA/hallmark/$prefix"_hallmark_"$fname; 44 | done 45 | 46 | ####merger kegg results for all cell types 47 | echo "merge all kegg gsea reports of cell types together " 48 | for file in $(find ./${2}*kegg* -name "gsea_report_for_na_*xls") 49 | do 50 | prefix=$(echo $file | awk -F "_" '{print $1"_"$2"_"$3}'); 51 | fname=$(basename ${file}); 52 | cp $file ./${1}_${2}_DE_GSEA/kegg/$prefix"_kegg_"$fname; 53 | done 54 | 55 | ###delete temporary file 56 | # rm ${2}_tmp 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /code/3_GSEA/src/meta_level/submit_meta_DE.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | cat meta_cluster_DE.tmp | while read input output json meta 5 | do 6 | while true 7 | do 8 | sleep 3s 9 | CURRENT=$(ps -u wangjin | grep -E "R" | wc -l) 10 | if [ ${CURRENT} -lt 10 ];then 11 | mkdir -p $output 12 | nohup Rscript meta_cluster_DE.R --input $input --output $output --json $json --meta $meta > $output".log" & 13 | break 14 | fi 15 | done 16 | done 17 | -------------------------------------------------------------------------------- /code/3_GSEA/src/meta_level/submit_meta_GSEA.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | 5 | cat GSEA_input.tmp | while read input meta 6 | do 7 | while true 8 | do 9 | sleep 3s 10 | CURRENT=$(ps -u wangjin | grep -E "java" | wc -l) 11 | if [ ${CURRENT} -lt 8 ];then 12 | nohup ./meta_cluster_GSEA.sh $input $meta & 13 | break 14 | fi 15 | done 16 | done 17 | 18 | -------------------------------------------------------------------------------- /code/4_Prepare_TISCHFile/4.1_Generate_Exprmat.R: -------------------------------------------------------------------------------- 1 | library(Seurat) 2 | library(rjson) 3 | 4 | setwd("/home1/wangchenfei/Project/TIRA/scTumor_Data") 5 | 6 | PercentAbove <- function(x, threshold) { 7 | return(length(x = x[x > threshold]) / length(x = x)) 8 | } 9 | 10 | AverageExpressionMAESTRO <- function(RNA){ 11 | cluster_cell_list = split(names(Idents(RNA)), Idents(RNA)) 12 | expr = GetAssayData(object = RNA, assay="RNA", slot = "data") 13 | 14 | # # if expm1, the result will be equal to AverageExpression 15 | # expr = expm1(GetAssayData(object = RNA, assay="RNA", slot = "data")) 16 | cluster_avg_expr <- sapply(names(cluster_cell_list), function(x){ 17 | return(Matrix::rowMeans(expr[, cluster_cell_list[[x]]])) 18 | }) 19 | } 20 | 21 | 22 | dirs = c("PBMC_60K_10X", "PBMC_30K_10X", "PBMC_8K_10X") 23 | dirs = c("BLCA_GSE145281_aPD1", "MM_GSE141299", "KIRC_GSE145281_aPD1") 24 | for (dir in dirs) { 25 | objects = list.files(dir, "_res.rds") 26 | if (length(which(grepl("CCA", objects))) > 0){ 27 | objects = objects[grepl("CCA", objects)] 28 | } 29 | for (i in objects){ 30 | SeuratObj = readRDS(file.path(dir,i)) 31 | 32 | project.name = gsub("_CCA","", SeuratObj$RNA@project.name) 33 | 34 | # umap info 35 | umap.df = as.data.frame(SeuratObj$RNA@reductions$umap@cell.embeddings) 36 | umap.df$Celltype_general = as.character(SeuratObj$RNA@meta.data$assign.level1_anno) 37 | umap.df$Celltype_curated = as.character(SeuratObj$RNA@meta.data$assign.curated) 38 | umap.df$Celltype_subtype = as.character(SeuratObj$RNA@meta.data$assign.level3_anno) 39 | 40 | umap.df$Cell = rownames(umap.df) 41 | umap.df = umap.df[order(umap.df$Celltype_curated),c(6,1:5)] 42 | # umap.list = as.list(umap.df) 43 | # umap_json = file.path(dir, paste0(project.name, "_umap.json")) 44 | # write(toJSON(umap.list), umap_json) 45 | 46 | # average expression 47 | Idents(object = SeuratObj$RNA) <- 'assign.curated' 48 | RNA.mean = AverageExpressionMAESTRO(SeuratObj$RNA) 49 | RNA.mean = round(RNA.mean, 5) 50 | expr_file = file.path(dir, paste0(project.name, "_expression_Celltype_majorlineage.txt")) 51 | write.table(RNA.mean, expr_file, sep="\t", quote=F) 52 | 53 | Idents(object = SeuratObj$RNA) <- 'assign.level1_anno' 54 | RNA.mean = AverageExpressionMAESTRO(SeuratObj$RNA) 55 | RNA.mean = round(RNA.mean, 5) 56 | expr_file = file.path(dir, paste0(project.name, "_expression_Celltype_malignancy.txt")) 57 | write.table(RNA.mean, expr_file, sep="\t", quote=F) 58 | 59 | Idents(object = SeuratObj$RNA) <- 'assign.level3_anno' 60 | RNA.mean = AverageExpressionMAESTRO(SeuratObj$RNA) 61 | RNA.mean = round(RNA.mean, 5) 62 | expr_file = file.path(dir, paste0(project.name, "_expression_Celltype_minorlineage.txt")) 63 | write.table(RNA.mean, expr_file, sep="\t", quote=F) 64 | 65 | Idents(object = SeuratObj$RNA) <- 'seurat_clusters' 66 | RNA.mean = AverageExpressionMAESTRO(SeuratObj$RNA) 67 | RNA.mean = round(RNA.mean, 5) 68 | expr_file = file.path(dir, paste0(project.name, "_expression_Cluster.txt")) 69 | write.table(RNA.mean, expr_file, sep="\t", quote=F) 70 | 71 | # expression matrix 72 | matrix <- GetAssayData(object = SeuratObj$RNA, slot = "data", assay = "RNA") 73 | matrix = matrix[,umap.df$Cell] 74 | mtx_file = file.path(dir, paste0(project.name, "_matrix.mtx")) 75 | gene_file = file.path(dir, paste0(project.name, "_genes.tsv")) 76 | barcode_file = file.path(dir, paste0(project.name, "_barcodes.tsv")) 77 | Matrix::writeMM(matrix, mtx_file) 78 | write.table(rownames(matrix), gene_file, col.names = FALSE, row.names = FALSE, quote = FALSE) 79 | write.table(colnames(matrix), barcode_file, col.names = FALSE, row.names = F, quote = FALSE) 80 | 81 | # expression matrix to h5 82 | cmd = paste0("MAESTRO mtx-to-h5 --type Gene --matrix ", mtx_file, 83 | " --feature ", gene_file, " --gene-column 1 --barcode ", barcode_file, 84 | " --species GRCh38 --directory " ,dir, " --outprefix ", project.name) 85 | system(cmd) 86 | 87 | # # percentage of expressed genes 88 | # Idents(object = SeuratObj$RNA) <- 'assign.curated' 89 | # cluster_cell_list = split(colnames(SeuratObj$RNA), SeuratObj$RNA[["assign.curated"]]) 90 | # cluster_gene_pct <- sapply(names(cluster_cell_list), function(x){ 91 | # gene_mat = GetAssayData(object = SeuratObj$RNA, slot = "data", assay = "RNA")[, cluster_cell_list[[x]]] 92 | # pct.exp <- apply(X = gene_mat, MARGIN = 1, FUN = PercentAbove, threshold = 0) 93 | # }) 94 | # pct_file = file.path(dir, paste0(project.name, "_percent_curated.txt")) 95 | # write.table(cluster_gene_pct, pct_file, sep="\t", quote=F) 96 | 97 | message(i) 98 | } 99 | } 100 | 101 | -------------------------------------------------------------------------------- /code/4_Prepare_TISCHFile/4.2_Migrate_File.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # @Author: Dongqing Sun 3 | # @E-mail: Dongqingsun96@gmail.com 4 | # @Date: 2020-07-12 13:54:23 5 | # @Last Modified by: Dongqing Sun 6 | # @Last Modified time: 2020-07-13 11:38:52 7 | 8 | 9 | import os, shutil 10 | 11 | source_path = "/home1/wangchenfei/Project/TIRA/scTumor_Data" 12 | dest_path = "/home1/wangchenfei/Project/TIRA/TISCH_data_new" 13 | dir_list = os.listdir(source_path) 14 | dir_list = sorted(dir_list) 15 | for i in dir_list[0:1]: 16 | file_list = os.listdir(os.path.join(source_path, i)) 17 | file_need = [] 18 | for j in file_list: 19 | if j.endswith("_umap.json"): 20 | file_need.append(j) 21 | if j.endswith("_genes.tsv"): 22 | file_need.append(j) 23 | if j.endswith("_gene_count.h5"): 24 | file_need.append(j) 25 | if j.endswith("_expression_Celltype_majorlineage.txt"): 26 | file_need.append(j) 27 | if j.endswith("_expression_Celltype_malignancy.txt"): 28 | file_need.append(j) 29 | if j.endswith("_expression_Celltype_minorlineage.txt"): 30 | file_need.append(j) 31 | if j.endswith("_expression_Cluster.txt"): 32 | file_need.append(j) 33 | if j.endswith("_AllDiffGenes.tsv"): 34 | file_need.append(j) 35 | file_need = sorted(file_need) 36 | m = 0 37 | while m < int(len(file_need)/8): 38 | dataset_name = file_need[m*8].split("_AllDiffGenes.tsv")[0] 39 | target_path = os.path.join(dest_path, dataset_name) 40 | if os.path.exists(target_path): 41 | pass 42 | else: 43 | os.makedirs(target_path) 44 | for n in range(8): 45 | source_file = os.path.join(source_path, i, file_need[m*8 + n]) 46 | shutil.copy(source_file, target_path) 47 | m = m + 1 48 | 49 | -------------------------------------------------------------------------------- /code/4_Prepare_TISCHFile/4.4_Generate_DownloadFile.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # @Author: Dongqing Sun 3 | # @E-mail: Dongqingsun96@gmail.com 4 | # @Date: 2020-07-12 13:36:54 5 | # @Last Modified by: Dongqing Sun 6 | # @Last Modified time: 2020-07-12 13:53:19 7 | 8 | 9 | import pandas as pd 10 | import numpy as np 11 | import os 12 | import json 13 | 14 | # DE gene table/json 15 | path = "/home/ubuntu/projects/TISCH/static/data" 16 | dir_list = os.listdir(path) 17 | dir_list = sorted(dir_list) 18 | 19 | for dataset in dir_list: 20 | print(dataset) 21 | diff_gene_file = "./static/data/%s/%s_AllDiffGenes.tsv" %(dataset, dataset) 22 | umap_file = "./static/data/%s/%s_umap.json" %(dataset, dataset) 23 | umap_dict = json.load(open(umap_file, "r")) 24 | umap_df = pd.DataFrame(umap_dict) 25 | cluster_annotation_df = umap_df[["Cluster", "Celltype_general", "Celltype_curated", "Celltype_subtype"]] 26 | cluster_annotation_df = cluster_annotation_df.drop_duplicates() 27 | cluster_annotation_df["Cluster"] = [int(i) for i in cluster_annotation_df["Cluster"]] 28 | diff_gene_df = pd.read_csv(diff_gene_file, sep = "\t") 29 | diff_gene_df = diff_gene_df.merge(cluster_annotation_df, left_on='cluster', right_on='Cluster') 30 | diff_gene_df = diff_gene_df.iloc[:,[7, 8, 9, 10, 6, 1, 2, 4]] 31 | diff_gene_df["avg_logFC"] = diff_gene_df["avg_logFC"].round(2) 32 | diff_gene_df["pct.1"] = (diff_gene_df["pct.1"]*100).round(2) 33 | diff_gene_df["p_val_adj"] = diff_gene_df["p_val_adj"].map(lambda x: "%.3g" % x) 34 | diff_gene_list = diff_gene_df.values.tolist() 35 | diff_gene_dict = {"data": diff_gene_list} 36 | diff_gene_umap_file = "./static/data/%s/%s_AllDiffGenes_table.json" %(dataset, dataset) 37 | json.dump(diff_gene_dict, open(diff_gene_umap_file, "w")) 38 | diff_gene_df.columns = ["Cluster", "Celltype (malignancy)", "Celltype (major-lineage)", "Celltype (minor-lineage)", "Gene", "log2FC", "Percentage (%)", "Adjusted p-value"] 39 | diff_gene_umap_file = "./static/data/%s/%s_AllDiffGenes_table.tsv" %(dataset, dataset) 40 | diff_gene_df.to_csv(diff_gene_umap_file, sep = "\t", index = False) 41 | 42 | 43 | # Cell-level meta information 44 | path = "/home/ubuntu/projects/TISCH/static/data" 45 | dir_list = os.listdir(path) 46 | dir_list = sorted(dir_list) 47 | 48 | for dataset in dir_list: 49 | print(dataset) 50 | umap_file = "%s/%s/%s_umap.json" %(path, dataset, dataset) 51 | umap_dict = json.load(open(umap_file, "r")) 52 | umap_df = pd.DataFrame(umap_dict) 53 | columns = umap_df.columns.tolist() 54 | columns[columns.index("Celltype_general")] = "Celltype (malignancy)" 55 | columns[columns.index("Celltype_curated")] = "Celltype (major-lineage)" 56 | columns[columns.index("Celltype_subtype")] = "Celltype (minor-lineage)" 57 | if "Celltype_paper" in columns: 58 | columns[columns.index("Celltype_paper")] = "Celltype (original)" 59 | umap_df.columns = columns 60 | cell_umap_file = "%s/%s/%s_CellMetainfo_table.tsv" %(path, dataset, dataset) 61 | umap_df.to_csv(cell_umap_file, sep = "\t", index = False) 62 | 63 | 64 | # Cluster-level expression matrix 65 | source_path = "/home/ubuntu/projects/TISCH/static/data/" 66 | dir_list = os.listdir(source_path) 67 | dir_list = sorted(dir_list) 68 | for i in dir_list: 69 | dest_path = os.path.join(source_path, i, "%s_Expression" %(i)) 70 | if os.path.exists(dest_path): 71 | pass 72 | else: 73 | os.makedirs(dest_path) 74 | object_dir = os.path.join(source_path, i) 75 | allfiles = os.listdir(object_dir) 76 | pattern = "\S*_expression_\S*" 77 | for file in allfiles: 78 | if re.match(pattern, file): 79 | shutil.copy(os.path.join(source_path, i, file), dest_path) 80 | else: 81 | pass 82 | expr_path = "%s_Expression" %(i) 83 | expr_file = "%s_Expression.zip" %(i) 84 | os.chdir(os.path.join(source_path, i)) 85 | cmd = "zip -r %s %s" %(expr_file, expr_path) 86 | os.system(cmd) 87 | -------------------------------------------------------------------------------- /code/4_Prepare_TISCHFile/4.5_Generate_UMAP_Gene.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # @Author: Dongqing Sun 3 | # @E-mail: Dongqingsun96@gmail.com 4 | # @Date: 2020-05-22 17:54:43 5 | # @Last Modified by: Dongqing Sun 6 | # @Last Modified time: 2020-06-29 12:11:09 7 | 8 | from MAESTRO.scATAC_H5Process import read_10X_h5 9 | import matplotlib.pyplot as plt 10 | import seaborn as sns 11 | import pandas as pd 12 | import numpy as np 13 | import matplotlib 14 | import os 15 | import json 16 | 17 | # generate sequential palette 18 | bottom = [0.83, 0.83, 0.83, 1.0] 19 | top = [0.11, 0.0, 0.52, 1.0] 20 | 21 | palettecolors = [] 22 | n = 50 23 | sep = [0]*4 24 | for i in range(4): 25 | sep[i] = (bottom[i] - top[i])/n 26 | 27 | for i in range(n+1): 28 | palettecolors.append([bottom[j]-i*sep[j] for j in range(4)]) 29 | 30 | palettecolors = np.array(palettecolors) 31 | newcmp = matplotlib.colors.ListedColormap(palettecolors, name='DefaultSequentialPalette') 32 | 33 | path = "/home1/wangchenfei/Project/TIRA/TISCH_data_new" 34 | dir_list = os.listdir(path) 35 | dir_list = sorted(dir_list) 36 | 37 | for dataset in dir_list[-5:-4]: 38 | print(dataset) 39 | out_dir = os.path.join(path, dataset, "Gene") 40 | os.makedirs(out_dir) 41 | h5_file = os.path.join(path, "%s/%s_gene_count.h5" %(dataset, dataset)) 42 | umap_file = os.path.join(path, "%s/%s_umap.json" %(dataset, dataset)) 43 | # read umap json file 44 | umap_dict = json.load(open(umap_file, "r")) 45 | umap_df = pd.DataFrame(umap_dict) 46 | # read h5 47 | mat = read_10X_h5(h5_file) 48 | rawmatrix = mat.matrix 49 | features = mat.names.tolist() 50 | barcodes = mat.barcodes.tolist() 51 | invalid_gene = "THRA1/BTR" 52 | if invalid_gene.encode() in features: 53 | invalid_ind = features.index(invalid_gene.encode()) 54 | gene_ind = list(range(len(features))) 55 | gene_ind.pop(invalid_ind) 56 | else: 57 | gene_ind = range(len(features)) 58 | for i in gene_ind: 59 | gene = features[i].decode() 60 | out_file = os.path.join(out_dir, "%s_%s_umap.png" %(dataset, gene)) 61 | gene_exp_list = rawmatrix[i,:].toarray().flatten().tolist() 62 | umap_df["Expression"] = gene_exp_list 63 | # draw the gene umap plot 64 | sns.set(style="whitegrid") 65 | f, ax = plt.subplots(figsize=(8, 6.5)) 66 | points = plt.scatter(x=umap_df["UMAP_1"], 67 | y=umap_df['UMAP_2'], 68 | c = umap_df['Expression'], 69 | alpha=1, s = 1, cmap=newcmp) 70 | xlabel = ax.set_xticklabels([]) 71 | ylabel = ax.set_yticklabels([]) 72 | plt.box(False) 73 | colorbar = plt.colorbar(aspect = 15) 74 | ax.grid(linewidth = 0.8, color = "#DBDBDB") 75 | plottitle = plt.title(label = gene, fontsize = 25, pad = 20) 76 | plt.savefig(out_file, dpi = 200, bbox_inches = "tight") 77 | plt.close(f) 78 | plt.clf() 79 | 80 | -------------------------------------------------------------------------------- /code/5_rsync.sh: -------------------------------------------------------------------------------- 1 | # @Author: Dongqing Sun 2 | # @Date: 2020-07-12 18:37:18 3 | # @Last Modified by: Dongqing Sun 4 | # @Last Modified time: 2020-07-12 18:37:24 5 | 6 | 7 | # From tongji to aws 8 | rsync -ravP -e 'ssh -i login_seoul.pem' /home1/wangchenfei/Project/SingleCell/WebServer/TISCH/static/data ubuntu@ec2-54-180-163-127.ap-northeast-2.compute.amazonaws.com:/home/ubuntu/projects/TISCH/static/ 9 | 10 | # Form aws to tongji 11 | rsync -ravP -e 'ssh -i login_seoul.pem' ubuntu@ec2-54-180-163-127.ap-northeast-2.compute.amazonaws.com:/home/ubuntu/projects/TISCH/static/data /home1/wangchenfei/Project/SingleCell/WebServer/TISCH/static/ 12 | 13 | # From tongji to ali 14 | rsync -ravP -e 'ssh ' /home1/wangchenfei/Project/SingleCell/WebServer/TISCH/static/data dongqing@39.101.160.221:/data/dongqing/TISCH/static/ -------------------------------------------------------------------------------- /manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import os 3 | import sys 4 | 5 | if __name__ == '__main__': 6 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'RASC.settings') 7 | try: 8 | from django.core.management import execute_from_command_line 9 | except ImportError as exc: 10 | raise ImportError( 11 | "Couldn't import Django. Are you sure it's installed and " 12 | "available on your PYTHONPATH environment variable? Did you " 13 | "forget to activate a virtual environment?" 14 | ) from exc 15 | execute_from_command_line(sys.argv) 16 | -------------------------------------------------------------------------------- /media/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/media/.DS_Store -------------------------------------------------------------------------------- /static/commondata/Celltype_abbr.json: -------------------------------------------------------------------------------- 1 | {"AC-like Malignant":"AC-like Malignant (Astrocyte-like Malignant Cells)","Acinar":"Acinar (Acinar Cells)","Alveolar":"Alveolar (Alveolar Cells)","Astrocyte":"Astrocyte (Astrocytes)","B":"B (B Cells)","CD4Tconv":"CD4Tconv (Conventional CD4 T Cells)","CD8T":"CD8T (CD8 T Cells)","CD8Tex":"CD8Tex (Exhausted CD8 T Cells)","DC":"DC (Dendritic Cells)","Ductal":"Ductal (Ductal Cells)","Endocrine":"Endocrine (Endocrine Cells)","Endothelial":"Endothelial (Endothelial Cells)","Epithelial":"Epithelial (Epithelial Cells)","EryPro":"EryPro (Erythroid Progenitor Cells)","Erythrocytes":"Erythrocytes (Erythrocytes)","Fibroblasts":"Fibroblasts (Fibroblasts)","Gland mucous":"Gland mucous (Gland Mucous Cells)","GMP":"GMP (Granulocyte-macrophage Progenitor Cells)","Hepatic progenitor":"Hepatic progenitor (Hepatic progenitor Cells)","HSC":"HSC (Hematopoietic Stem Cells)","ILC":"ILC (Innate Lymphoid Cells)","Keratinocytes":"Keratinocytes (Keratinocytes)","Malignant":"Malignant (Malignant Cells)","Mast":"Mast (Mast Cells)","Melanocytes":"Melanocytes (Melanocytes)","Microglia":"Microglia (Microglia Cells)","Mono/Macro":"Mono/Macro (Monocytes or Macrophages)","Myfibroblasts":"Myfibroblasts (Myfibroblasts)","Myocyte":"Myocyte (Myocyte)","Myofibroblasts":"Myofibroblasts (Myofibroblasts)","NB-like Malignant":"NB-like Malignant (Neuroblast-like Malignant Cells)","Neuron":"Neuron (Neurons)","Neutrophils":"Neutrophils (Neutrophils)","NK":"NK (Natural Killer Cells)","OC-like Malignant":"OC-like Malignant (Oligodendrocyte-like Malignant Cells)","Oligodendrocyte":"Oligodendrocyte (Oligodendrocytes)","OPC":"OPC (Oligodendrocyte Precursor Cells)","OPC-like Malignant":"OPC-like Malignant (Oligodendrocyte-precursor-cell-like Malignant Cells)","Others":"Others (Other Cells)","pDC":"pDC (Plasmacytoid Dendritic Cells)","Pericytes":"Pericytes (Pericytes)","Pit mucous":"Pit mucous (Pit Mucous Cells)","Plasma":"Plasma (Plasma Cells)","Progenitor":"Progenitor (Progenitor Cells)","Promonocyte":"Promonocyte (Promonocytes)","Secretory glandular":"Secretory glandular (Secretory Glandular Cells)","SMC":"SMC (Smooth Muscle Cells)","Stellate":"Stellate (Stellate Cells)","TMKI67":"TMKI67 (Proliferating T Cells)","Treg":"Treg (Regulatory T Cells)","Vascular":"Vascular (Vascular Cells)"} 2 | -------------------------------------------------------------------------------- /static/css/main.css: -------------------------------------------------------------------------------- 1 | .nav-link { 2 | padding-right: 1rem; 3 | padding-left: 1rem; 4 | } 5 | 6 | .btn-outline-tisch { 7 | color: #54aced; 8 | border-color: #54aced 9 | } 10 | 11 | .btn-outline-tisch:hover { 12 | color: #fff; 13 | background-color: #54aced; 14 | border-color: #54aced 15 | } 16 | 17 | .btn-tisch { 18 | color:#fff; 19 | background-color: #54aced; 20 | border-color: #54aced 21 | } 22 | 23 | .btn-tisch:hover { 24 | color: #fff; 25 | background-color: #52A7ED; 26 | border-color: #52A7ED 27 | } 28 | 29 | .nav-link { 30 | font-family: Avenir-black,Arial,sans-serif; 31 | font-size: 1.2rem; 32 | color: #495057; 33 | 34 | } 35 | 36 | .nav-tabs .nav-link.active { 37 | color: #54aced; 38 | background-color: $nav-tabs-link-active-bg; 39 | border-color: $nav-tabs-link-active-border-color; 40 | } 41 | } 42 | 43 | 44 | .page-link { 45 | color: #54aced; 46 | } 47 | 48 | .page-item.active .page-link { 49 | background-color: #54aced; 50 | border-color: #54aced 51 | } 52 | 53 | a { 54 | color: #54aced 55 | } 56 | 57 | .sidebar { 58 | position: fixed; 59 | top: 0; 60 | bottom: 0; 61 | left: 0; 62 | z-index: 100; /* Behind the navbar */ 63 | padding: 48px 0 0; /* Height of navbar */ 64 | box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1); 65 | } 66 | 67 | .dropdown-item.active { 68 | color: #fff; 69 | text-decoration: none; 70 | background-color: #54aced; 71 | } 72 | 73 | #advanced-gene-dropdown:hover path{ 74 | fill: #54aced; 75 | } 76 | 77 | #cancer { 78 | -webkit-appearance: none; 79 | -webkit-border-radius: 0px; 80 | } 81 | 82 | .tooltip-inner { 83 | text-align:left; 84 | background-color: rgb(233,236,239); 85 | color: #000; 86 | max-width:250px; 87 | } 88 | 89 | .tooltip > p { 90 | text-align:left; 91 | } 92 | 93 | #loading { 94 | position: fixed; 95 | top: 0; 96 | left: 0; 97 | width: 100%; 98 | height: 100%; 99 | background: rgba(0, 0, 0, 0.3); 100 | z-index: 15000; 101 | } 102 | 103 | #loading img { 104 | position: absolute; 105 | top: 50%; 106 | left: 50%; 107 | width: 80px; 108 | height: 80px; 109 | margin-top: -15px; 110 | margin-left: -15px; 111 | } 112 | 113 | .lds-spinner { 114 | color: official; 115 | display: inline-block; 116 | position: relative; 117 | width: 80px; 118 | height: 80px; 119 | } 120 | .lds-spinner div { 121 | transform-origin: 40px 40px; 122 | animation: lds-spinner 1.2s linear infinite; 123 | } 124 | .lds-spinner div:after { 125 | content: " "; 126 | display: block; 127 | position: absolute; 128 | top: 3px; 129 | left: 37px; 130 | width: 6px; 131 | height: 18px; 132 | border-radius: 20%; 133 | background: #A6A6A6; 134 | } 135 | .lds-spinner div:nth-child(1) { 136 | transform: rotate(0deg); 137 | animation-delay: -1.1s; 138 | } 139 | .lds-spinner div:nth-child(2) { 140 | transform: rotate(30deg); 141 | animation-delay: -1s; 142 | } 143 | .lds-spinner div:nth-child(3) { 144 | transform: rotate(60deg); 145 | animation-delay: -0.9s; 146 | } 147 | .lds-spinner div:nth-child(4) { 148 | transform: rotate(90deg); 149 | animation-delay: -0.8s; 150 | } 151 | .lds-spinner div:nth-child(5) { 152 | transform: rotate(120deg); 153 | animation-delay: -0.7s; 154 | } 155 | .lds-spinner div:nth-child(6) { 156 | transform: rotate(150deg); 157 | animation-delay: -0.6s; 158 | } 159 | .lds-spinner div:nth-child(7) { 160 | transform: rotate(180deg); 161 | animation-delay: -0.5s; 162 | } 163 | .lds-spinner div:nth-child(8) { 164 | transform: rotate(210deg); 165 | animation-delay: -0.4s; 166 | } 167 | .lds-spinner div:nth-child(9) { 168 | transform: rotate(240deg); 169 | animation-delay: -0.3s; 170 | } 171 | .lds-spinner div:nth-child(10) { 172 | transform: rotate(270deg); 173 | animation-delay: -0.2s; 174 | } 175 | .lds-spinner div:nth-child(11) { 176 | transform: rotate(300deg); 177 | animation-delay: -0.1s; 178 | } 179 | .lds-spinner div:nth-child(12) { 180 | transform: rotate(330deg); 181 | animation-delay: 0s; 182 | } 183 | @keyframes lds-spinner { 184 | 0% { 185 | opacity: 1; 186 | } 187 | 100% { 188 | opacity: 0; 189 | } 190 | } 191 | -------------------------------------------------------------------------------- /static/css/rSlider.min.css: -------------------------------------------------------------------------------- 1 | .rs-container *{box-sizing:border-box;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.rs-container{font-family:Arial,Helvetica,sans-serif;height:45px;position:relative}.rs-container .rs-bg,.rs-container .rs-selected{background-color:#eee;border:1px solid #ededed;height:10px;left:0;position:absolute;top:5px;width:100%;border-radius:3px}.rs-container .rs-selected{background-color:#00b3bc;border:1px solid #00969b;transition:all .2s linear;width:0}.rs-container.disabled .rs-selected{background-color:#ccc;border-color:#bbb}.rs-container .rs-pointer{background-color:#fff;border:1px solid #bbb;border-radius:4px;cursor:pointer;height:20px;left:-10px;position:absolute;top:0;transition:all .2s linear;width:30px;box-shadow:inset 0 0 1px #FFF,inset 0 1px 6px #ebebeb,1px 1px 4px rgba(0,0,0,.1)}.rs-container.disabled .rs-pointer{border-color:#ccc;cursor:default}.rs-container .rs-pointer::after,.rs-container .rs-pointer::before{content:'';position:absolute;width:1px;height:9px;background-color:#ddd;left:12px;top:5px}.rs-container .rs-pointer::after{left:auto;right:12px}.rs-container.sliding .rs-pointer,.rs-container.sliding .rs-selected{transition:none}.rs-container .rs-scale{left:0;position:absolute;top:5px;white-space:nowrap}.rs-container .rs-scale span{float:left;position:relative}.rs-container .rs-scale span::before{background-color:#ededed;content:"";height:8px;left:0;position:absolute;top:10px;width:1px}.rs-container.rs-noscale span::before{display:none}.rs-container.rs-noscale span:first-child::before,.rs-container.rs-noscale span:last-child::before{display:block}.rs-container .rs-scale span:last-child{margin-left:-1px;width:0}.rs-container .rs-scale span ins{color:#333;display:inline-block;font-size:12px;margin-top:20px;text-decoration:none}.rs-container.disabled .rs-scale span ins{color:#999}.rs-tooltip{color:#333;width:auto;min-width:60px;height:30px;background:#fff;border:1px solid #00969b;border-radius:3px;position:absolute;transform:translate(-50%,-35px);left:13px;text-align:center;font-size:13px;padding:6px 10px 0}.rs-container.disabled .rs-tooltip{border-color:#ccc;color:#999} -------------------------------------------------------------------------------- /static/image/Celltype_annotation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/static/image/Celltype_annotation.png -------------------------------------------------------------------------------- /static/image/TISCH.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/static/image/TISCH.gif -------------------------------------------------------------------------------- /static/image/TISCH.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/static/image/TISCH.png -------------------------------------------------------------------------------- /static/image/TISCH_2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/static/image/TISCH_2.gif -------------------------------------------------------------------------------- /static/image/TISCH_data_summary.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/static/image/TISCH_data_summary.png -------------------------------------------------------------------------------- /static/image/TISCH_workflow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/static/image/TISCH_workflow.png -------------------------------------------------------------------------------- /static/image/background.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 23 | 25 | 27 | 29 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 41 | 42 | 44 | 46 | 48 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 61 | 63 | 65 | 67 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /static/image/document/dataset_filter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/static/image/document/dataset_filter.png -------------------------------------------------------------------------------- /static/image/document/dataset_gene.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/static/image/document/dataset_gene.png -------------------------------------------------------------------------------- /static/image/document/dataset_gene_violin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/static/image/document/dataset_gene_violin.png -------------------------------------------------------------------------------- /static/image/document/dataset_gsea.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/static/image/document/dataset_gsea.png -------------------------------------------------------------------------------- /static/image/document/dataset_multiple.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/static/image/document/dataset_multiple.png -------------------------------------------------------------------------------- /static/image/document/dataset_return.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/static/image/document/dataset_return.png -------------------------------------------------------------------------------- /static/image/document/dataset_single.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/static/image/document/dataset_single.png -------------------------------------------------------------------------------- /static/image/document/gene_result.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/static/image/document/gene_result.png -------------------------------------------------------------------------------- /static/image/document/gene_search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/static/image/document/gene_search.png -------------------------------------------------------------------------------- /static/image/document/home_cancer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/static/image/document/home_cancer.png -------------------------------------------------------------------------------- /static/image/document/home_gene.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/static/image/document/home_gene.png -------------------------------------------------------------------------------- /static/image/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/static/image/loading.gif -------------------------------------------------------------------------------- /static/image/tissue/Humanbody.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/static/image/tissue/Humanbody.png -------------------------------------------------------------------------------- /static/image/tissue/bladder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/static/image/tissue/bladder.png -------------------------------------------------------------------------------- /static/image/tissue/blood.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/static/image/tissue/blood.png -------------------------------------------------------------------------------- /static/image/tissue/blood.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 11 | 12 | 18 | 26 | 27 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /static/image/tissue/bone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/static/image/tissue/bone.png -------------------------------------------------------------------------------- /static/image/tissue/bone.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 10 | 11 | 12 | 13 | 18 | 19 | 30 | 40 | 41 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 60 | 65 | 66 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /static/image/tissue/brain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/static/image/tissue/brain.png -------------------------------------------------------------------------------- /static/image/tissue/brain.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 10 | 12 | 42 | 70 | 71 | -------------------------------------------------------------------------------- /static/image/tissue/breast.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/static/image/tissue/breast.png -------------------------------------------------------------------------------- /static/image/tissue/breast.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 10 | 12 | 14 | 21 | 30 | 31 | -------------------------------------------------------------------------------- /static/image/tissue/colon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/static/image/tissue/colon.png -------------------------------------------------------------------------------- /static/image/tissue/eye.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/static/image/tissue/eye.png -------------------------------------------------------------------------------- /static/image/tissue/eye.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 11 | 13 | 14 | 15 | 20 | 27 | 29 | 30 | 31 | 32 | 33 | 36 | 37 | -------------------------------------------------------------------------------- /static/image/tissue/head.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/static/image/tissue/head.png -------------------------------------------------------------------------------- /static/image/tissue/head.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 11 | 13 | 17 | 18 | 24 | 25 | -------------------------------------------------------------------------------- /static/image/tissue/human.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/static/image/tissue/human.png -------------------------------------------------------------------------------- /static/image/tissue/kidney.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/static/image/tissue/kidney.png -------------------------------------------------------------------------------- /static/image/tissue/kidney.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 10 | 11 | 23 | 28 | 33 | 34 | -------------------------------------------------------------------------------- /static/image/tissue/liver.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/static/image/tissue/liver.png -------------------------------------------------------------------------------- /static/image/tissue/liver.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 10 | 12 | 16 | 20 | 54 | 55 | -------------------------------------------------------------------------------- /static/image/tissue/lung.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/static/image/tissue/lung.png -------------------------------------------------------------------------------- /static/image/tissue/lung.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 10 | 12 | 20 | 27 | 41 | 42 | -------------------------------------------------------------------------------- /static/image/tissue/lymphnode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/static/image/tissue/lymphnode.png -------------------------------------------------------------------------------- /static/image/tissue/lymphnode.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 10 | 12 | 38 | 62 | 63 | -------------------------------------------------------------------------------- /static/image/tissue/nerve.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/static/image/tissue/nerve.png -------------------------------------------------------------------------------- /static/image/tissue/pancreas.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/static/image/tissue/pancreas.png -------------------------------------------------------------------------------- /static/image/tissue/pancreas.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 10 | 12 | 23 | 37 | 49 | 58 | 66 | 67 | -------------------------------------------------------------------------------- /static/image/tissue/pelvic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/static/image/tissue/pelvic.png -------------------------------------------------------------------------------- /static/image/tissue/skin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/static/image/tissue/skin.png -------------------------------------------------------------------------------- /static/image/tissue/skin.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 12 | 13 | 18 | 37 | 39 | 41 | 43 | 45 | 47 | 49 | 54 | 55 | -------------------------------------------------------------------------------- /static/image/tissue/soft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/static/image/tissue/soft.png -------------------------------------------------------------------------------- /static/image/tissue/stomach.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DongqingSun96/TISCH/5826a9de1920b4dd2b2e38c80885b59db63cd1f8/static/image/tissue/stomach.png -------------------------------------------------------------------------------- /static/image/tissue/stomach.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 11 | 13 | 18 | 23 | 26 | 52 | 53 | -------------------------------------------------------------------------------- /static/js/rSlider.min.js: -------------------------------------------------------------------------------- 1 | !function(){"use strict";var t=function(t){this.input=null,this.inputDisplay=null,this.slider=null,this.sliderWidth=0,this.sliderLeft=0,this.pointerWidth=0,this.pointerR=null,this.pointerL=null,this.activePointer=null,this.selected=null,this.scale=null,this.step=0,this.tipL=null,this.tipR=null,this.timeout=null,this.valRange=!1,this.values={start:null,end:null},this.conf={target:null,values:null,set:null,range:!1,width:null,scale:!0,labels:!0,tooltip:!0,step:null,disabled:!1,onChange:null},this.cls={container:"rs-container",background:"rs-bg",selected:"rs-selected",pointer:"rs-pointer",scale:"rs-scale",noscale:"rs-noscale",tip:"rs-tooltip"};for(var i in this.conf)t.hasOwnProperty(i)&&(this.conf[i]=t[i]);this.init()};t.prototype.init=function(){return"object"==typeof this.conf.target?this.input=this.conf.target:this.input=document.getElementById(this.conf.target.replace("#","")),this.input?(this.inputDisplay=getComputedStyle(this.input,null).display,this.input.style.display="none",this.valRange=!(this.conf.values instanceof Array),!this.valRange||this.conf.values.hasOwnProperty("min")&&this.conf.values.hasOwnProperty("max")?this.createSlider():console.log("Missing min or max value...")):console.log("Cannot find target element...")},t.prototype.createSlider=function(){return this.slider=i("div",this.cls.container),this.slider.innerHTML='
',this.selected=i("div",this.cls.selected),this.pointerL=i("div",this.cls.pointer,["dir","left"]),this.scale=i("div",this.cls.scale),this.conf.tooltip&&(this.tipL=i("div",this.cls.tip),this.tipR=i("div",this.cls.tip),this.pointerL.appendChild(this.tipL)),this.slider.appendChild(this.selected),this.slider.appendChild(this.scale),this.slider.appendChild(this.pointerL),this.conf.range&&(this.pointerR=i("div",this.cls.pointer,["dir","right"]),this.conf.tooltip&&this.pointerR.appendChild(this.tipR),this.slider.appendChild(this.pointerR)),this.input.parentNode.insertBefore(this.slider,this.input.nextSibling),this.conf.width&&(this.slider.style.width=parseInt(this.conf.width)+"px"),this.sliderLeft=this.slider.getBoundingClientRect().left,this.sliderWidth=this.slider.clientWidth,this.pointerWidth=this.pointerL.clientWidth,this.conf.scale||this.slider.classList.add(this.cls.noscale),this.setInitialValues()},t.prototype.setInitialValues=function(){if(this.disabled(this.conf.disabled),this.valRange&&(this.conf.values=s(this.conf)),this.values.start=0,this.values.end=this.conf.range?this.conf.values.length-1:0,this.conf.set&&this.conf.set.length&&n(this.conf)){var t=this.conf.set;this.conf.range?(this.values.start=this.conf.values.indexOf(t[0]),this.values.end=this.conf.set[1]?this.conf.values.indexOf(t[1]):null):this.values.end=this.conf.values.indexOf(t[0])}return this.createScale()},t.prototype.createScale=function(t){this.step=this.sliderWidth/(this.conf.values.length-1);for(var e=0,s=this.conf.values.length;ethis.conf.values.length-1&&(i=this.conf.values.length-1),this.conf.range?(this.activePointer===this.pointerL&&(this.values.start=i),this.activePointer===this.pointerR&&(this.values.end=i)):this.values.end=i,this.setValues()}},t.prototype.drop=function(){this.activePointer=null},t.prototype.setValues=function(t,i){var e=this.conf.range?"start":"end";return t&&this.conf.values.indexOf(t)>-1&&(this.values[e]=this.conf.values.indexOf(t)),i&&this.conf.values.indexOf(i)>-1&&(this.values.end=this.conf.values.indexOf(i)),this.conf.range&&this.values.start>this.values.end&&(this.values.start=this.values.end),this.pointerL.style.left=this.values[e]*this.step-this.pointerWidth/2+"px",this.conf.range?(this.conf.tooltip&&(this.tipL.innerHTML=this.conf.values[this.values.start],this.tipR.innerHTML=this.conf.values[this.values.end]),this.input.value=this.conf.values[this.values.start]+","+this.conf.values[this.values.end],this.pointerR.style.left=this.values.end*this.step-this.pointerWidth/2+"px"):(this.conf.tooltip&&(this.tipL.innerHTML=this.conf.values[this.values.end]),this.input.value=this.conf.values[this.values.end]),this.values.end>this.conf.values.length-1&&(this.values.end=this.conf.values.length-1),this.values.start<0&&(this.values.start=0),this.selected.style.width=(this.values.end-this.values.start)*this.step+"px",this.selected.style.left=this.values.start*this.step+"px",this.onChange()},t.prototype.onClickPiece=function(t){if(!this.conf.disabled){var i=Math.round((t.clientX-this.sliderLeft)/this.step);return i>this.conf.values.length-1&&(i=this.conf.values.length-1),i<0&&(i=0),this.conf.range&&i-this.values.start<=this.values.end-i?this.values.start=i:this.values.end=i,this.slider.classList.remove("sliding"),this.setValues()}},t.prototype.onChange=function(){var t=this;this.timeout&&clearTimeout(this.timeout),this.timeout=setTimeout(function(){if(t.conf.onChange&&"function"==typeof t.conf.onChange)return t.conf.onChange(t.input.value)},500)},t.prototype.onResize=function(){return this.sliderLeft=this.slider.getBoundingClientRect().left,this.sliderWidth=this.slider.clientWidth,this.updateScale()},t.prototype.disabled=function(t){this.conf.disabled=t,this.slider.classList[t?"add":"remove"]("disabled")},t.prototype.getValue=function(){return this.input.value},t.prototype.destroy=function(){this.input.style.display=this.inputDisplay,this.slider.remove()};var i=function(t,i,e){var s=document.createElement(t);return i&&(s.className=i),e&&2===e.length&&s.setAttribute("data-"+e[0],e[1]),s},e=function(t,i,e){for(var s=i.split(" "),n=0,l=s.length;n 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | TISCH 13 | 14 | 15 | 16 | 46 | 47 |
48 |
49 | 50 |
51 |
52 | 53 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /webserver_environment_latest.yml: -------------------------------------------------------------------------------- 1 | name: webserver 2 | channels: 3 | - conda-forge 4 | - defaults 5 | dependencies: 6 | - _libgcc_mutex=0.1=conda_forge 7 | - _openmp_mutex=4.5=0_gnu 8 | - ca-certificates=2020.1.1=0 9 | - certifi=2020.4.5.1=py38_0 10 | - cycler=0.10.0=py_2 11 | - dbus=1.13.6=he372182_0 12 | - expat=2.2.9=he1b5a44_2 13 | - fontconfig=2.13.1=h86ecdb6_1001 14 | - freetype=2.10.1=he06d7ca_0 15 | - gettext=0.19.8.1=hc5be6a0_1002 16 | - glib=2.64.3=h6f030ca_0 17 | - gst-plugins-base=1.14.5=h0935bb2_2 18 | - gstreamer=1.14.5=h36ae1b5_2 19 | - h5py=2.10.0=nompi_py38h513d04c_102 20 | - hdf5=1.10.5=nompi_h3c11f04_1104 21 | - icu=64.2=he1b5a44_1 22 | - jpeg=9c=h14c3975_1001 23 | - kiwisolver=1.1.0=py38hbf85e49_1 24 | - ld_impl_linux-64=2.34=h53a641e_0 25 | - libblas=3.8.0=14_openblas 26 | - libcblas=3.8.0=14_openblas 27 | - libclang=9.0.1=default_hde54327_0 28 | - libffi=3.2.1=he1b5a44_1007 29 | - libgcc-ng=9.2.0=h24d8f2e_2 30 | - libgfortran-ng=7.3.0=hdf63c60_5 31 | - libgomp=9.2.0=h24d8f2e_2 32 | - libiconv=1.15=h516909a_1006 33 | - liblapack=3.8.0=14_openblas 34 | - libllvm9=9.0.1=he513fc3_1 35 | - libopenblas=0.3.7=h5ec1e0e_6 36 | - libpng=1.6.37=hed695b0_1 37 | - libstdcxx-ng=9.2.0=hdf63c60_2 38 | - libuuid=2.32.1=h14c3975_1000 39 | - libxcb=1.13=h14c3975_1002 40 | - libxkbcommon=0.10.0=he1b5a44_0 41 | - libxml2=2.9.10=hee79883_0 42 | - matplotlib=3.2.1=0 43 | - matplotlib-base=3.2.1=py38h2af1d28_0 44 | - mysql-connector-c=6.1.11=hc9bbbdd_1005 45 | - mysqlclient=1.4.6=py38h950e882_1 46 | - ncurses=6.1=hf484d3e_1002 47 | - nspr=4.25=he1b5a44_0 48 | - nss=3.47=he751ad9_0 49 | - numpy=1.18.1=py38h8854b6b_1 50 | - openssl=1.1.1g=h7b6447c_0 51 | - pandas=1.0.3=py38hcb8c335_0 52 | - patsy=0.5.1=py_0 53 | - pcre=8.44=he1b5a44_0 54 | - pip=20.0.2=py_2 55 | - pthread-stubs=0.4=h14c3975_1001 56 | - pyparsing=2.4.6=py_0 57 | - pyqt=5.12.3=py38ha8c2ead_3 58 | - python=3.8.2=h8356626_5_cpython 59 | - python-dateutil=2.8.1=py_0 60 | - python_abi=3.8=1_cp38 61 | - pytz=2019.3=py_0 62 | - qt=5.12.5=hd8c4c69_1 63 | - readline=8.0=hf8c457e_0 64 | - scipy=1.4.1=py38h18bccfc_2 65 | - seaborn=0.10.1=py_0 66 | - setuptools=46.1.3=py38h32f6830_0 67 | - six=1.14.0=py_1 68 | - sqlite=3.30.1=hcee41ef_0 69 | - statsmodels=0.11.1=py38h1e0a361_1 70 | - tk=8.6.10=hed695b0_0 71 | - tornado=6.0.4=py38h1e0a361_1 72 | - wheel=0.34.2=py_1 73 | - xorg-libxau=1.0.9=h14c3975_0 74 | - xorg-libxdmcp=1.1.3=h516909a_0 75 | - xz=5.2.4=h516909a_1002 76 | - zlib=1.2.11=h516909a_1006 77 | - pip: 78 | - adjusttext==0.7.3 79 | - amqp==2.5.2 80 | - asgiref==3.2.7 81 | - billiard==3.6.3.0 82 | - celery==4.4.2 83 | - django==3.0.4 84 | - django-celery-results==1.2.1 85 | - kombu==4.6.8 86 | - maestro==1.1.0 87 | - numexpr==2.7.1 88 | - pyqt5-sip==4.19.18 89 | - pyqtchart==5.12 90 | - pyqtwebengine==5.12.1 91 | - sqlparse==0.3.1 92 | - tables==3.6.1 93 | - vine==1.3.0 94 | prefix: /home/ubuntu/miniconda3/envs/webserver 95 | 96 | --------------------------------------------------------------------------------