Skip to content

Instantly share code, notes, and snippets.

View wenjie1991's full-sized avatar

Wenjie Sun wenjie1991

  • Institut Curie
  • Paris
View GitHub Profile
@wenjie1991
wenjie1991 / process_kindle_clippings.raku
Last active February 19, 2024 21:19
Transform kindle clippings to markdowns
#!/usr/bin/env raku
use v6.d;
#####################################
## Process kindle clippings file
## Author: Wenjie SUN
## Date: 2024-2-19
## Email: sunwjie at gmail.com
## Input: My Clippings - Kindle.txt
@wenjie1991
wenjie1991 / pan_cancer_exp.Rmd
Created July 13, 2020 16:02
PAN cancer gene expression
---
output:
html_document:
toc: true
theme: united
number_sections: true
always_allow_html: yes
---
```{r echo=F}
@wenjie1991
wenjie1991 / comparing_igor_model.R
Last active July 7, 2020 11:49
Comparing Igor model
library(data.table)
library(readr)
library(magrittr)
library(dplyr)
library(plotly)
library(lambda.tools)
read_model_data = function(model_file) {
# @params model_file the Igor model files
@wenjie1991
wenjie1991 / README.md
Last active May 9, 2022 09:28
Pathway Enrichment

This script is used for pathway enrichment analysis of paper: Paracrine signalling between intestinal epithelial and tumour cells induces a regenerative programme eLife2022;11:e76541 DOI: https://doi.org/10.7554/eLife.76541

Licence

pathway_enrichment.R - Pathway enrichment analysis Written in 2019 by Wenjie SUN sunwjie@gmail.com

To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty.

@wenjie1991
wenjie1991 / README.md
Last active May 9, 2022 09:31
THBS1 in Colon cancer

This script is used for cancer gene expression analysis of paper: Paracrine signalling between intestinal epithelial and tumour cells induces a regenerative programme eLife2022;11:e76541 DOI: https://doi.org/10.7554/eLife.76541

Licence

TCGA_expression.Rmd - TCGA gene expression analysis Written in 2022 by Wenjie SUN sunwjie@gmail.com

To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty.

@wenjie1991
wenjie1991 / snippet_scrublet_seurat.Rmd
Created May 12, 2020 10:28
scrublet in seurat pipeline
```{r}
library(reticulate)
# You can set the conda environment
use_condaenv("scrublet", required = T)
```
```{python}
import scrublet as scr
import scipy.io
import matplotlib.pyplot as plt
@wenjie1991
wenjie1991 / gist:2a6a09316ea5d07d7820c64a24a8ab96
Created March 30, 2020 19:21
prototype RNAscope statistics
f1 = "../data/graph_pixel/ROI_170220-40x-tumorR2-405DAPI-488pLgr5-561mTomato-642pThbs1.20_MERGED.tif_Z#44C#1_Simple Segmentation.tif.txt"
f2 = "../data/graph_pixel/ROI_170220-40x-tumorR2-405DAPI-488pLgr5-561mTomato-642pThbs1.20_MERGED.tif_Z#44C#2_Simple Segmentation.tif.txt"
d1 = fread(f1)
d2 = fread(f2)
d1[, channel := "channel1"]
d2[, channel := "channel2"]
d = rbind(d1, d2)
ggplot(d, aes(x = V1, y = V2) ) + geom_point(aes(fill = channel, col = channel), alpha = 0.4) + theme_bw()
ggplot(d, aes(x = V1, y = V2) ) + geom_point(aes(fill = channel, col = channel), alpha = 0.1, size = 5) + theme_bw()
ggplot(d, aes(x = V1, y = V2) ) + geom_point(aes(fill = channel, col = channel), alpha = 0.1, size = 15) + theme_bw()
@wenjie1991
wenjie1991 / variantCall.sh
Last active March 17, 2020 13:26
Joint variation calling
## Variant call
## Input files
gatk_jar=gatk3.jar # https://console.cloud.google.com/storage/browser/gatk-software/package-archive/gatk/?pli=1
refseq=genome.fa
rmdupN=normal.bam ## aligned & duplication removed bam file
rmdupP1=primary1.bam
rmdupP2=primary2.bam
rmdupM1=metastasis1.bam
rmdupM2=metastasis2.bam
## download and install package
# source("http://bioconductor.org/biocLite.R")
# biocLite("oligo")
library(oligo)
## read cel files
dir <- tcltk::tk_choose.dir(caption = "Please choose input fold contain cel")
raw <- list.celfiles(dir, full.names=TRUE)
affyGeneFS <- read.celfiles(raw)
@wenjie1991
wenjie1991 / gist:549e287126a8076fc7ab56e59256010e
Last active July 17, 2018 15:06
Extract Gene frequency from Pubmed XML files
#################################################
# Input:
input = "./pubmed_result.xml"
#################################################
# Output:
output = "./abstract.xls"
# install.packages("pubmed.mineR")