diff --git a/QC_metrics/QC_vln_plots.R b/QC_metrics/QC_vln_plots.R index cde75ac..e555630 100644 --- a/QC_metrics/QC_vln_plots.R +++ b/QC_metrics/QC_vln_plots.R @@ -4,6 +4,9 @@ library(stringr) library(rlang) library(rlist) +### title: Plotting violin plots of quality metrics for all datasets +### author: Yiping Wang date: 11/08/2022 + #define list of s3 folders to download data from, names of each dataset, and alternate names that replace dashes with underscores foldersList = c("s3://fresh-vs-frozen-comparison-ohio/BI5/scrna-seq", "s3://fresh-vs-frozen-comparison-ohio/BI5/snrna-seq", diff --git a/QC_metrics/load_stress_sigs.R b/QC_metrics/load_stress_sigs.R index 40f3cf5..87f6f1c 100644 --- a/QC_metrics/load_stress_sigs.R +++ b/QC_metrics/load_stress_sigs.R @@ -1,3 +1,6 @@ +### title: Load lists of stress signature genes to calculate strength of these signatures across all datasets +### author: Yiping Wang date: 11/08/2022 + #hardcoded list of stress signature genes, from either van den Brink 2017 or Denisenko 2020 papers stress_sig_dysfunctional_cd8 = c("LAG3","HAVCR2","PDCD1","PTMS","FAM3C","IFNG","AKAP5","CD7","PHLDA1","ENTPD1","SNAP47","TNS3","CXCL13","RDH10","DGKH","KIR2DL4","LYST","MIR155HG","RAB27A","CSF1","CTLA4","TNFRSF9","CD27","CCL3","ITGAE","PAG1","TNFRSF1B","GALNT1","GBP2","MYO7A") stress_sig_nmeth_celseq = c("FOS","HSPA1A","JUN","FOSB","JUNB","EGR1","HSPA1B","UBC","ZFP36","HSPB1","HSP90AA1","MT2","DNAJB1","BTG2","NR4A1","CEBPD","HSPA8","MT1","IER2","DNAJA1","SOCS3","ATF3","JUND","CEBPB","ID3","PPP1R15A","HSPE1","CXCL1","DUSP1","HSP90AB1","NFKBIA","HSPH1") diff --git a/QC_metrics/rename_sample_IDs.R b/QC_metrics/rename_sample_IDs.R index 174838d..a084b70 100644 --- a/QC_metrics/rename_sample_IDs.R +++ b/QC_metrics/rename_sample_IDs.R @@ -1,3 +1,6 @@ +### title: Rename sample IDs in rds objects across all datasets to human-readable format for plotting +### author: Yiping Wang date: 11/08/2022 + #given a Seurat object integrated_rds and the name of a dataset, rename the orig.ident field of integrated_rds to more human-readable names rename_IDs <- function(integrated_rds, dataset_name) { if (dataset_name=="Mel" || dataset_name=="BI5") diff --git a/TCR_analyses/TCR_circos.R b/TCR_analyses/TCR_circos.R index 1b744b8..f5b3d02 100644 --- a/TCR_analyses/TCR_circos.R +++ b/TCR_analyses/TCR_circos.R @@ -11,6 +11,9 @@ library(limma) library(reshape2) library(circlize) +### title: Create circos plots showing overlap in TCR clonotypes between fresh and frozen samples in cutaneous melanoma, NSCLC, and uveal primary datasets +### author: Yiping Wang date: 11/08/2022 + #load in sample names for either ribas dataset, or cutaneous melanoma, uveal primary, and NSCLC datasets #create array of colors corresponding to either fresh or frozen samples to label circos plots useRibas = FALSE diff --git a/TCR_analyses/TCR_clonality_umaps.R b/TCR_analyses/TCR_clonality_umaps.R index 3d4aad9..f6acd59 100644 --- a/TCR_analyses/TCR_clonality_umaps.R +++ b/TCR_analyses/TCR_clonality_umaps.R @@ -4,6 +4,9 @@ library(Seurat) library(infercnv) library(stringr) +### title: Create umaps of T cells with TCR clonality plotted in different colors according to frequency, for cutaneous melanoma, uveal melanoma primary, uveal melanoma metastasis, and sequential cutaneous melanoma samples under pembrolizumab therapy +### author: Yiping Wang date: 11/08/2022 + #load list of rds objects corresponding to each dataset foldersList = c("", "", diff --git a/TCR_analyses/assign_TCR_clonality.R b/TCR_analyses/assign_TCR_clonality.R index 657830f..dfae171 100644 --- a/TCR_analyses/assign_TCR_clonality.R +++ b/TCR_analyses/assign_TCR_clonality.R @@ -1,3 +1,6 @@ +### title: Assign TCR clonality information to T cells to rds files for a particular dataset +### author: Yiping Wang date: 11/08/2022 + assign_TCR_clonality <- function(seu, dataset_name) { #rename orig.ident to more human-readable names seu$orig.ident[seu$orig.ident=="ribas_310_on"] = "ribas1_on_tcr_S36_L004" diff --git a/cell_type_annotation/cell_type_annotation.R b/cell_type_annotation/cell_type_annotation.R index 5d41299..b716a81 100644 --- a/cell_type_annotation/cell_type_annotation.R +++ b/cell_type_annotation/cell_type_annotation.R @@ -5,6 +5,9 @@ library(rlang) library(rlist) library(dplyr) +### title: Annotate cell types manually across all datasets based on Seurat clustering and marker gene expression +### author: Yiping Wang date: 11/08/2022 + #load in BI5 cutaneous melanoma scrna and snrna-seq samples, integrate, cluster, and store in rds file integrate_BI5 = TRUE if (integrate_BI5) { diff --git a/cell_type_annotation/cell_type_annotation_heatmap.R b/cell_type_annotation/cell_type_annotation_heatmap.R index 6ec6e43..3384671 100644 --- a/cell_type_annotation/cell_type_annotation_heatmap.R +++ b/cell_type_annotation/cell_type_annotation_heatmap.R @@ -5,6 +5,9 @@ library(rlang) library(rlist) library(dplyr) +### title: Create heatmap of top 10 markers in each seurat cluster for each dataset +### author: Yiping Wang date: 11/08/2022 + #load list of folders for each datasets, depending on whether samples were processed by slyper protocol or not using_slyper = FALSE if (using_slyper) { diff --git a/cell_type_annotation/cell_type_barplots.R b/cell_type_annotation/cell_type_barplots.R index 9be46c2..941f279 100644 --- a/cell_type_annotation/cell_type_barplots.R +++ b/cell_type_annotation/cell_type_barplots.R @@ -6,6 +6,9 @@ library(viridis) library(seriation) library(RColorBrewer) +### title: Create barplots of cell type frequency, immune and non-immune simpson diversity, and malignant cell fractions +### author: Yiping Wang date: 11/08/2022 + #load in folder names for each dataset useRibas = FALSE if (useRibas) diff --git a/cell_type_annotation/reannotate_BI5_and_uveal_primary_tcells.R b/cell_type_annotation/reannotate_BI5_and_uveal_primary_tcells.R index 251c7f7..03d06a5 100644 --- a/cell_type_annotation/reannotate_BI5_and_uveal_primary_tcells.R +++ b/cell_type_annotation/reannotate_BI5_and_uveal_primary_tcells.R @@ -9,6 +9,9 @@ library(grid) library(stringr) library(dplyr) +### title: Annotate T cells in cutaneous melanoma sequential samples more finely +### author: Yiping Wang date: 11/08/2022 + #define folder locations for cutaneous melanoma and uveal primary data foldersList = c("", "s3://fresh-vs-frozen-comparison-ohio/cpoi-uvealprimarydata") diff --git a/cell_type_annotation/reannotate_ribas_melanoma_tcells.R b/cell_type_annotation/reannotate_ribas_melanoma_tcells.R index a75433a..109c0ed 100644 --- a/cell_type_annotation/reannotate_ribas_melanoma_tcells.R +++ b/cell_type_annotation/reannotate_ribas_melanoma_tcells.R @@ -8,6 +8,9 @@ library(scales) library(grid) library(stringr) +### title: Annotate T cells in cutaneous melanoma sequential samples more finely +### author: Yiping Wang date: 11/08/2022 + recluster_ribas_tcells = TRUE recluster_ribas_myeloid = FALSE diff --git a/cell_type_annotation/reannotate_uveal_melanoma_tcells.R b/cell_type_annotation/reannotate_uveal_melanoma_tcells.R index cfee8d9..8ff5d54 100644 --- a/cell_type_annotation/reannotate_uveal_melanoma_tcells.R +++ b/cell_type_annotation/reannotate_uveal_melanoma_tcells.R @@ -8,6 +8,9 @@ library(scales) library(grid) library(stringr) +### title: Annotate T cells in uveal melanoma metastatic samples more finely +### author: Yiping Wang date: 11/08/2022 + #load uveal melanoma data, subset to t-cells, and save to rds file seu = readRDS("/data/um_all_integrated.rds") seu <- subset(seu, manual_annotation_label %in% c("T-cells")) diff --git a/cell_type_annotation/reannotate_uveal_melanoma_tcells_nk.R b/cell_type_annotation/reannotate_uveal_melanoma_tcells_nk.R index 062ca17..f0f0b5b 100644 --- a/cell_type_annotation/reannotate_uveal_melanoma_tcells_nk.R +++ b/cell_type_annotation/reannotate_uveal_melanoma_tcells_nk.R @@ -8,6 +8,9 @@ library(scales) library(grid) library(stringr) +### title: Check whether two clusters in integrated uveal melanoma metastatic T-cells data are NK cells, by reclustering them +### author: Yiping Wang date: 11/08/2022 + #load reintegrated data for uveal melanoma t cells, select 2 clusters with possible nk cell gene expression seu = readRDS(paste0("/data/reannotate_uveal_melanoma_tcells_reintegrated_with_1_subclustered_dim_num_25_then_15.rds")) diff --git a/cell_type_annotation/reannotate_uveal_melanoma_tcells_vln_plots.R b/cell_type_annotation/reannotate_uveal_melanoma_tcells_vln_plots.R index 8ea6f88..31c4e12 100644 --- a/cell_type_annotation/reannotate_uveal_melanoma_tcells_vln_plots.R +++ b/cell_type_annotation/reannotate_uveal_melanoma_tcells_vln_plots.R @@ -7,6 +7,9 @@ library(viridis) library(scales) library(grid) +### title: Plotting violin plots of T cell exhaustion signatures in integrated uveal melanoma metastatic T cell data +### author: Yiping Wang date: 11/08/2022 + # colBP <- c('#A80D11', '#008DB8') # colSCSN <- c('#E1AC24', '#288F56') colDC <- c('#DE8C00', '#F564E3', '#7CAE00', '#00B4F0', '#00C08B') diff --git a/correlation_with_wgs/correlate_wgs_and_infercnv.R b/correlation_with_wgs/correlate_wgs_and_infercnv.R index f841c5c..f78a1af 100644 --- a/correlation_with_wgs/correlate_wgs_and_infercnv.R +++ b/correlation_with_wgs/correlate_wgs_and_infercnv.R @@ -7,6 +7,9 @@ library(stringr) library(ggplot2) library(infercnv) +### title: Correlate average arm-level infercnv and whole-genome sequencing copy number alterations in uveal melanoma metastatic dataset +### author: Yiping Wang date: 11/08/2022 + useRollingAverage = FALSE flattenToMedian = FALSE skipIndividualCalc = FALSE diff --git a/geo_submission/geo_submission.R b/geo_submission/geo_submission.R index 99cf475..effc025 100644 --- a/geo_submission/geo_submission.R +++ b/geo_submission/geo_submission.R @@ -5,6 +5,9 @@ library(rlang) library(rlist) library(dplyr) +### title: Print out csv files of count matrices for single-nucleus and single-cell sequencing data across all datasets +### author: Yiping Wang date: 11/08/2022 + # rename_tcr_arr = c("Mel_sc_5_CD45+","Mel_sn_5","UM_sc_5","UM_sc_5_CD45+","UM_sn_5_inhib","NSCLC_sc_5","NSCLC_sn_5","NSCLC_sn_5_inhib","ribas_pre","ribas_on","ribas_on_later","UMEL_1_1","UMEL_1_2","UMEL_2_1","UMEL_2_2","UMEL_2_3","UMEL_3_1","UMEL_3_2","UMEL_3_3","UMEL_4_1","UMEL_4_2","UMEL_5_1","UMEL_5_2","UMEL_5_3","UMEL_6_1","UMEL_6_2","UMEL_6_3","UMEL_7_1","UMEL_7_2","UMEL_7_3") # names(rename_tcr_arr) = c("TCRBI5_S1_L001","bi005-skcm-5snseq-TCR","UMEL-CUUM1-SCRNA-5P-NA-PRIMARY-TCR-F2","UMEL-CUUM1-SCRNA-5P-NA-PRIMARY-TCR-F3","UMEL-CUUM1-SNRNA-5P-WI-PRIMARY-TCR-F9","NSCL_NR001_SCRNA_5P_NA_BRAIN_TCR","NSCL_NR001_SNSEQ_5P_NI_BRAIN_TCR","NSCL_NR001_SNSEQ_5P_WI_BRAIN_TCR","ribas1_pre_tcr_S35_L004","ribas1_on_tcr_S36_L004","ribas_310_on_later_previd_3_TCR","um_07_gk_pre_S4_L001","um_07_gk_on_S8_L001","um_08_ar_pre_S1_L001","um_08_ar_on_S2_L001","um_08_ar_post_S3_L001","um_09_mw_pre_S5_L001","um_09_mw_on_S6_L001","um_09_mw_post_S7_L001","um_11_lc_pre_S12_L002","um_11_lc_on_S16_L002","um_12_ml_pre_S9_L002","um_12_ml_on_S10_L002","um_12_ml_post_S11_L002","um_15_lm_pre_S13_L002","um_15_lm_on_S14_L002","um_15_lm_post_S15_L002","um_16_rs_pre_S17_L003","um_16_rs_on_S18_L003","um_16_rs_post_S19_L003") diff --git a/geo_submission/mbpm_puckdata_printout_info_for_geo_fresh_vs_frozen_comparison.R b/geo_submission/mbpm_puckdata_printout_info_for_geo_fresh_vs_frozen_comparison.R index a6cb7b3..ccc8d93 100644 --- a/geo_submission/mbpm_puckdata_printout_info_for_geo_fresh_vs_frozen_comparison.R +++ b/geo_submission/mbpm_puckdata_printout_info_for_geo_fresh_vs_frozen_comparison.R @@ -3,6 +3,9 @@ library(ggplot2) library(rlist) library(grid) +### title: Print out csv files of count matrices for spatial sequencing data for sequential cutaneous melanoma samples +### author: Yiping Wang date: 11/08/2022 + #pats = c("MPM08_pre_slide","MPM08_on_slide","MPM08_on_later_slide") pats = c("MPM08_on_slide","MPM08_on_later_slide") diff --git a/geo_submission/mbpm_puckdata_printout_info_for_geo_fresh_vs_frozen_comparison.R~ b/geo_submission/mbpm_puckdata_printout_info_for_geo_fresh_vs_frozen_comparison.R~ new file mode 100644 index 0000000..6295bf9 --- /dev/null +++ b/geo_submission/mbpm_puckdata_printout_info_for_geo_fresh_vs_frozen_comparison.R~ @@ -0,0 +1,40 @@ +library(Seurat) +library(ggplot2) +library(rlist) +library(grid) + +pats = c("MBM05_rep1_slide","MBM06_slide","MBM07_slide","MBM08_slide","MBM11_rep1_slide","MBM18_slide","MBM13_slide","MPM08_pre_slide","MPM10_slide","MPM06_slide","MBM05_rep2_slide","MBM11_rep2_slide","puck5","puck6final","puck7_20_feature_threshold","puck8_20_feature_threshold") + +for (pat in pats) { + system(paste0("aws s3 cp s3://uveal-melanoma/figurefolder/mbpm_puckdata_add_rctd_and_sigs/",pat,"_with_rctd_sigs.rds /data/mbpm_puckdata_add_rctd_and_sigs/",pat,"_with_rctd_sigs.rds")) + puck = readRDS(paste0("/data/mbpm_puckdata_add_rctd_and_sigs/",pat,"_with_rctd_sigs.rds")) + system(paste0("rm /data/mbpm_puckdata_add_rctd_and_sigs/",pat,"_with_rctd_sigs.rds")) + out_pat = pat + if (pat=="puck5") + { + output_pat="MPM01_rep1_slide" + } + if (pat=="puck6final") + { + output_pat="MPM01_rep2_slide" + } + if (pat=="puck7_20_feature_threshold") + { + output_pat="MBM05_rep3_slide" + } + if (pat=="puck8_20_feature_threshold") + { + output_pat="MBM11_rep3_slide" + } + out_pat = str_replace(out_pat, "MPM", "ECM") + + spatialdf = data.frame(barcode = colnames(puck), xcoord = puck$image@coordinates$x, ycoord = puck$image@coordinates$y) + + write.csv(spatialdf, paste0("/data/mbpm_puckdata_printout_info_for_geo/",out_pat,"_spatial_coordinates.csv")) + system(paste0("aws s3 cp /data/mbpm_puckdata_printout_info_for_geo/",out_pat,"_spatial_coordinates.csv s3://uveal-melanoma/figurefolder/mbpm_puckdata_printout_info_for_geo/",out_pat,"_spatial_coordinates.csv")) + system(paste0("rm /data/mbpm_puckdata_printout_info_for_geo/",out_pat,"_spatial_coordinates.csv")) + + write.csv(as.data.frame(puck@assays$Spatial@counts),paste0("/data/mbpm_puckdata_printout_info_for_geo/",out_pat,"_raw_counts.csv")) + system(paste0("aws s3 cp /data/mbpm_puckdata_printout_info_for_geo/",out_pat,"_raw_counts.csv s3://uveal-melanoma/figurefolder/mbpm_puckdata_printout_info_for_geo/",out_pat,"_raw_counts.csv")) + system(paste0("rm /data/mbpm_puckdata_printout_info_for_geo/",out_pat,"_raw_counts.csv")) +} \ No newline at end of file diff --git a/infercnv_analyses/fresh_vs_frozen_infercnv_comparison.R b/infercnv_analyses/fresh_vs_frozen_infercnv_comparison.R index bfa8dc9..5aeea5c 100644 --- a/infercnv_analyses/fresh_vs_frozen_infercnv_comparison.R +++ b/infercnv_analyses/fresh_vs_frozen_infercnv_comparison.R @@ -2,6 +2,9 @@ library(rlist) library(ggplot2) library(stringr) +### title: Correlate average arm-level infercnv copy numter alterations in fresh vs. Frozen samples in cutaneous melanoma, uveal primary, and NSCLC datasets +### author: Yiping Wang date: 11/08/2022 + #define lists of sample names, folder locations, cancer cell type annotations, and fresh/frozen status patslist = list(c("CD45negGEXBI5_S1_L001_final_thresh","bi005-skcm-5snseq_final_thresh","skcm-bi005-5pv2-snseq_final_thresh"),c("UMEL-CUUM1-SCRNA-5P-NA-PRIMARY-GEX-E12_final_thresh","UMEL-CUUM1-SCRNA-5P-NA-PRIMARY-GEX-F1_final_thresh","UMEL-CUUM1-SNRNA-5P-WI-PRIMARY-GEX-F12_final_thresh"),c("NSCL_NR001_SCRNA_5P_NA_BRAIN_GEX_final_thresh","NSCL_NR001_SNSEQ_5P_NI_BRAIN_GEX_final_thresh","NSCL_NR001_SNSEQ_5P_WI_BRAIN_GEX_final_thresh","NSCL-NR001-5pv2-snseq_final_thresh"),c("Sarcoma167GEX_final_thresh","Sarcoma322GEX_final_thresh","Sarcoma559GEX_final_thresh","Sarcoma708GEX_final_thresh")) diff --git a/infercnv_analyses/make_infercnv_plots2.R b/infercnv_analyses/make_infercnv_plots2.R index e2aba0f..fb64c19 100644 --- a/infercnv_analyses/make_infercnv_plots2.R +++ b/infercnv_analyses/make_infercnv_plots2.R @@ -6,6 +6,9 @@ library(grid) library(rlist) library(stringr) +### title: Make heatmap plots of infercnv results for all datasets +### author: Yiping Wang date: 11/08/2022 + setwd("/data/") selectstep = 20 diff --git a/infercnv_analyses/r310_infercnv_and_resistance_sig.R b/infercnv_analyses/r310_infercnv_and_resistance_sig.R index 32dffec..eb0b128 100644 --- a/infercnv_analyses/r310_infercnv_and_resistance_sig.R +++ b/infercnv_analyses/r310_infercnv_and_resistance_sig.R @@ -10,6 +10,9 @@ library(infercnv) library(ggpubr) library(rlist) +### title: Print heatmap of infercnv copy number changes, with histogram of immune resistance signature gene density overtop, for each sample in cutaneous melanoma sequential treatment dataset +### author: Yiping Wang date: 11/08/2022 + #download object containing all ribas data from s3, subset to data for 310 sample system("aws s3 cp s3://melanoma-ribas/ribas1/Seurat/integrated/ribas_integrated_titrate_thresh_integrated.rds /data/ribas_integrated_titrate_thresh_integrated.rds") integrated_rds = readRDS("/data/ribas_integrated_titrate_thresh_integrated.rds") diff --git a/initial_processing/Seurat_cellbender_fresh_vs_frozen_comparison.R b/initial_processing/Seurat_cellbender_fresh_vs_frozen_comparison.R index ba6f9b0..0cab614 100644 --- a/initial_processing/Seurat_cellbender_fresh_vs_frozen_comparison.R +++ b/initial_processing/Seurat_cellbender_fresh_vs_frozen_comparison.R @@ -20,6 +20,9 @@ library(scater) library(pheatmap) library(grid) +### title: Creation of Seurat object from Cellbender output, and doublet and QC thresholding, for cutaneous melanoma, uveal melanoma primary, and nsclc samples +### author: Yiping Wang date: 11/08/2022 + #setwd("/home/ubuntu/") # foldersList = c("s3://fresh-vs-frozen-comparison/BI5/scrna-seq", diff --git a/initial_processing/Seurat_cellbender_ribas_melanoma.R b/initial_processing/Seurat_cellbender_ribas_melanoma.R index 84800a0..ff608fc 100644 --- a/initial_processing/Seurat_cellbender_ribas_melanoma.R +++ b/initial_processing/Seurat_cellbender_ribas_melanoma.R @@ -19,6 +19,9 @@ library(SingleCellExperiment) library(scater) library(pheatmap) +### title: Creation of Seurat object from Cellbender output, and doublet and QC thresholding, for cutaneous melanoma samples under pembrolizumab treatment +### author: Yiping Wang date: 11/08/2022 + #setwd("/home/ubuntu/") #pats = c("ribas1_on_5pv2_S27_L004","ribas1_pre_5pv2_S26_L004") diff --git a/initial_processing/Seurat_cellbender_uveal_melanoma_new_samples.R b/initial_processing/Seurat_cellbender_uveal_melanoma_new_samples.R index 23f0c21..dff4175 100644 --- a/initial_processing/Seurat_cellbender_uveal_melanoma_new_samples.R +++ b/initial_processing/Seurat_cellbender_uveal_melanoma_new_samples.R @@ -19,6 +19,9 @@ library(SingleCellExperiment) library(scater) library(pheatmap) +### title: Creation of Seurat object from Cellbender output, and doublet and QC thresholding, for uveal melanoma liver metastasis samples +### author: Yiping Wang date: 11/08/2022 + #setwd("/home/ubuntu/") pats = c("uv003-uvme-snseq-3p-post") diff --git a/initial_processing/Seurat_integrate_fresh_vs_frozen_comparison.R b/initial_processing/Seurat_integrate_fresh_vs_frozen_comparison.R index e1b33e5..08d2ea8 100644 --- a/initial_processing/Seurat_integrate_fresh_vs_frozen_comparison.R +++ b/initial_processing/Seurat_integrate_fresh_vs_frozen_comparison.R @@ -10,6 +10,9 @@ library(cowplot) library(stringr) #library(celldex) +### title: Seurat integration of cutaneous melanoma, uveal melanoma primary, and nsclc samples +### author: Yiping Wang date: 11/08/2022 + # foldersList = c("s3://fresh-vs-frozen-comparison-ohio/BI5/scrna-seq", # "s3://fresh-vs-frozen-comparison-ohio/BI5/snrna-seq", # "s3://fresh-vs-frozen-comparison-ohio/cpoi-uvealprimarydata", diff --git a/initial_processing/Seurat_integrate_uveal_melanoma_new_samples.R b/initial_processing/Seurat_integrate_uveal_melanoma_new_samples.R index c7bd2b6..cb660f9 100644 --- a/initial_processing/Seurat_integrate_uveal_melanoma_new_samples.R +++ b/initial_processing/Seurat_integrate_uveal_melanoma_new_samples.R @@ -9,6 +9,8 @@ library(purrr) library(cowplot) library(stringr) +### title: Seurat integration of uveal melanoma liver metastasis samples +### author: Yiping Wang date: 11/08/2022 outputnamearr = c("um_all_merged")#,"um_on_integrated","um_post_integrated","um_pre_integrated") pat_list_arr = list(c("um_07_gk_on_S8_L001","um_07_gk_pre_S4_L001","um_08_ar_on_S2_L001","um_08_ar_post_S3_L001","um_08_ar_pre_S1_L001","um_09_mw_on_S6_L001","um_09_mw_post_S7_L001","um_09_mw_pre_S5_L001","um_11_lc_on_S16_L002","um_11_lc_pre_S12_L002","um_12_ml_on_S10_L002","um_12_ml_post_S11_L002","um_12_ml_pre_S9_L002","um_15_lm_on_S14_L002","um_15_lm_post_S15_L002","um_15_lm_pre_S13_L002","um_16_rs_on_S18_L003","um_16_rs_post_S19_L003","um_16_rs_pre_S17_L003"))#,c("um_07_gk_on_S8_L001","um_08_ar_on_S2_L001","um_09_mw_on_S6_L001","um_11_lc_on_S16_L002","um_12_ml_on_S10_L002","um_15_lm_on_S14_L002","um_16_rs_on_S18_L003"),c("uv003_uvme_snseq_3p_post","um_08_ar_post_S3_L001","um_09_mw_post_S7_L001","um_12_ml_post_S11_L002","um_15_lm_post_S15_L002","um_16_rs_post_S19_L003"),c("um_07_gk_pre_S4_L001","um_08_ar_pre_S1_L001","um_09_mw_pre_S5_L001","um_11_lc_pre_S12_L002","um_12_ml_pre_S9_L002","um_15_lm_pre_S13_L002","um_16_rs_pre_S17_L003")) diff --git a/sampling_to_uniform_saturation/sampling_to_uniform_saturation.R b/sampling_to_uniform_saturation/sampling_to_uniform_saturation.R index 09cbcec..3f2dd07 100644 --- a/sampling_to_uniform_saturation/sampling_to_uniform_saturation.R +++ b/sampling_to_uniform_saturation/sampling_to_uniform_saturation.R @@ -3,6 +3,9 @@ library(cellranger) library(rlist) library(Seurat) +### title: Downsample UMI counts in cutaneous melanoma and NSCLC datasets, across both slyper and non-slyper protocols, to obtain comparable UMI counts across samples +### author: Yiping Wang date: 11/08/2022 + patsList = list(c("CD45negGEXBI5_S1_L001","CD45posGEXBI5_S1_L001"), c("bi005-skcm-5snseq","bi005-skcm","skcm-bi005-5pv2-snseq"), c("UMEL-CUUM1-SCRNA-5P-NA-PRIMARY-GEX-E12","UMEL-CUUM1-SCRNA-5P-NA-PRIMARY-GEX-F1","UMEL-CUUM1-SNRNA-5P-WI-PRIMARY-GEX-F12"), diff --git a/sampling_to_uniform_saturation/sampling_to_uniform_saturation_vlnplots.R b/sampling_to_uniform_saturation/sampling_to_uniform_saturation_vlnplots.R index 0ad80ea..7dea196 100644 --- a/sampling_to_uniform_saturation/sampling_to_uniform_saturation_vlnplots.R +++ b/sampling_to_uniform_saturation/sampling_to_uniform_saturation_vlnplots.R @@ -4,6 +4,9 @@ library(stringr) library(rlang) library(rlist) +### title: Plotting violin plots of quality metrics for cutaneous melanoma and NSCLC datasets, using data downsampled to obtain comparable UMI counts across samples +### author: Yiping Wang date: 11/08/2022 + integrated_name_arr_underscore = c("BI5","NR1") integrated_name_arr = c("BI5","NR1") fresh_idents = c("CD45negGEXBI5_S1_L001","CD45posGEXBI5_S1_L001","NSCL_NR001_SCRNA_5P_NA_BRAIN_GEX") diff --git a/scenic_analyses/r310_scenic_and_infercnv.R b/scenic_analyses/r310_scenic_and_infercnv.R index 8dea84f..fd2d497 100644 --- a/scenic_analyses/r310_scenic_and_infercnv.R +++ b/scenic_analyses/r310_scenic_and_infercnv.R @@ -7,6 +7,9 @@ library(rlist) library(fgsea) library(stringr) +### title: Determine regulators from scenic analysis that are differentially expressed in clone 2 of sequential cutaneous melanoma dataset +### author: Yiping Wang date: 11/08/2022 + pats = c("ribas_310_on_GEX_5pv2_S27_L004_titrate_thresh_kmeans","ribas_310_on_later_previd_3_GEX_titrate_thresh_kmeans","ribas_310_pre_GEX_5pv2_S26_L004_titrate_thresh_kmeans") cbpats = c("ribas_310_on_GEX_5pv2_S27_L004_titrate_thresh","ribas_310_on_later_previd_3_GEX_titrate_thresh","ribas_310_pre_GEX_5pv2_S26_L004_titrate_thresh") shortpats = c("on","on_later","pre") diff --git a/scenic_analyses/scenic_prep.R b/scenic_analyses/scenic_prep.R index 5f83ab0..7f90596 100644 --- a/scenic_analyses/scenic_prep.R +++ b/scenic_analyses/scenic_prep.R @@ -1,3 +1,6 @@ +### title: Print out csv files of count matrices for sequential cutaneous melanoma samples +### author: Yiping Wang date: 11/08/2022 + system("aws s3 cp s3://melanoma-ribas/ribas1/Seurat/integrated/ribas_integrated_titrate_thresh_integrated.rds /data/ribas_integrated_titrate_thresh_integrated.rds") integrated_rds = readRDS("/data/ribas_integrated_titrate_thresh_integrated.rds") system("rm /data/ribas_integrated_titrate_thresh_integrated.rds") diff --git a/scenic_analyses/scenic_run.py b/scenic_analyses/scenic_run.py index 0e9ebf4..4e4d55e 100644 --- a/scenic_analyses/scenic_run.py +++ b/scenic_analyses/scenic_run.py @@ -18,6 +18,9 @@ from distributed import Client, LocalCluster +### title: Run scenic for each sample in sequential cutaneous melanoma dataset +### author: Yiping Wang date: 11/08/2022 + if __name__=="__main__": tf_names = load_tf_names("hs_hgnc_curated_tfs.txt") diff --git a/trajectory_analysis/t_cell_destiny.R b/trajectory_analysis/t_cell_destiny.R index 4ce027d..1a05af7 100644 --- a/trajectory_analysis/t_cell_destiny.R +++ b/trajectory_analysis/t_cell_destiny.R @@ -10,6 +10,9 @@ library(stringr) library(rlist) library(scRepertoire) +### title: Perform diffusion analysis for T-cells from cutaneous melanoma samples under therapy and uveal melanoma metastatic samples, and plot signatures of T-cell activation and exhaustion on diffusion maps +### author: Yiping Wang date: 11/08/2022 + colDC <- c('#DE8C00', '#F564E3', '#7CAE00', '#00B4F0', '#00C08B') prefix_arr = c("cd8")#"treg_and_tfh","treg","tfh","cd4")#,"cd8") diff --git a/wes_analyses/splitChromosomes.py b/wes_analyses/splitChromosomes.py index cd76aa3..789dfd8 100644 --- a/wes_analyses/splitChromosomes.py +++ b/wes_analyses/splitChromosomes.py @@ -1,3 +1,6 @@ +### title: Split a fastq file containing entire hg19 sequence into fastq files for each chromosome, for use by controlFREEC program +### author: Yiping Wang date: 11/08/2022 + inFI = open("/data/Homo_sapiens_assembly19.fasta") firstline = True for line in inFI: diff --git a/wes_analyses/whole_exome_pipeline.sh b/wes_analyses/whole_exome_pipeline.sh index 1564ff4..c98f269 100644 --- a/wes_analyses/whole_exome_pipeline.sh +++ b/wes_analyses/whole_exome_pipeline.sh @@ -1,3 +1,6 @@ +### title: Download reference files for whole exome analysis, and whole exome sequencing fastq files for cutaneous melanoma sequential therapy samples, map fastq files to generate bam files, and run controlFREEC with these inputs +### author: Yiping Wang date: 11/08/2022 + wget https://storage.googleapis.com/gatk-best-practices/somatic-b37/Homo_sapiens_assembly19.fasta Homo_sapiens_assembly19.fasta wget https://storage.googleapis.com/gatk-best-practices/somatic-b37/Homo_sapiens_assembly19.fasta.fai Homo_sapiens_assembly19.fasta.fai ~/hisat2-2.2.1/hisat2-build -p 16 Homo_sapiens_assembly19.fastq Homo_sapiens_assembly19