Skip to content
Snippets Groups Projects
Commit 112f3c32 authored by Gervaise Henry's avatar Gervaise Henry :cowboy:
Browse files

Add code to create and analize Continual Integreation test data

parent cf1fb9f8
Branches
Tags
No related merge requests found
#!/bin/bash
#
# CREATED USING THE BIOHPC PORTAL on Thu Nov 30 2017 16:16:26 GMT-0600 (Central Standard Time)
#
# This file is batch script used to run commands on the BioHPC cluster.
# The script is submitted to the cluster using the SLURM `sbatch` command.
# Lines starting with # are comments, and will not be run.
# Lines starting with #SBATCH specify options for the scheduler.
# Lines that do not start with # or #SBATCH are commands that will run.
# Name for the job that will be visible in the job queue and accounting tools.
#SBATCH --job-name R_CIAnalysis
# Name of the SLURM partition that this job should run on.
#SBATCH -p super # partition (queue)
# Number of nodes required to run this job
#SBATCH -N 1
# Time limit for the job in the format Days-H:M:S
# A job that reaches its time limit will be cancelled.
# Specify an accurate time limit for efficient scheduling so your job runs promptly.
#SBATCH -t 7-0:0:0
# The standard output and errors from commands will be written to these files.
# %j in the filename will be replace with the job number when it is submitted.
#SBATCH -o job_%j.out
#SBATCH -e job_%j.err
# Send an email when the job status changes, to the specfied address.
#SBATCH --mail-type ALL
#SBATCH --mail-user gervaise.henry@utsouthwestern.edu
module load R/3.3.2-gccmkl
# COMMAND GROUP 1
Rscript ../r.scripts/sc_Demultiplex.R
Rscript ../r.scritps/sc_D-SampleReorder.R
Rscript ../r.scripts/sc_Seurat.Score.CellCycle.R
Rscript ../r.scripts/sc_QC.R
Rscript ../r.scripts/sc_Cluster.R
Rscript ../r.scripts/sc_PC.Score.Stress.R --sv=NA
Rscript ../r.scripts/sc_QuSAGE.Lineage.R --s=NA
Rscript ../r.scripts/sc_LineageSubClust.R
Rscript ../r.scripts/sc_QuSAGE_EpiSubClust.R --s=NA --r=0.2
Rscript ../r.scripts/sc_QuSAGE_StSubClust.R --s=NA --r=0.2
Rscript ../r.scripts/sc_MergeSubClust.R --r=0.2
Rscript ../r.scripts/sc_PC.Score.NE.R --sv=NA
Rscript ../r.scripts/sc_DEG.R
Rscript ../r.scripts/sc_Tables.R
# END OF SCRIPT
#!/bin/bash
mkdir ../analysis
mkdir ../analysis/DATA
ln -s /work/urology/ghenry/RNA-Seq/SingleCell/PIPELINE/DATA/"$1"/10x/filtered_gene_bc_matrices_mex/GRCh38/* ../analysis/DATA/
ln -s /work/urology/ghenry/RNA-Seq/SingleCell/PIPELINE/DATA/ANALYSIS/"$1"/sc10x.Pr.ALL.cluster.NOStress.IDepi+st+ne.Merge.Rda ../analysis/DATA/sc10x.data.Rda
mkdir ../analysis/CI.TestData.downsample
mkdir ../analysis/CI.TestData.downsample/10x
mkdir ../analysis/CI.TestData.downsample/10x/filtered_gene_bc_matrices_mex
mkdir ../analysis/CI.TestData.downsample/10x/filtered_gene_bc_matrices_mex/GRCh38
cp /work/urology/ghenry/RNA-Seq/SingleCell/PIPELINE/DATA/"$1"/"$1"-demultiplex.csv ../analysis/CI.TestData.downsample/"$1"-demultiplex.csv
cp /work/urology/ghenry/RNA-Seq/SingleCell/PIPELINE/DATA/"$1"/10x/"$1"-aggr.csv ../analysis/CI.TestData.downsample/10x/"$1"-aggr.csv
\ No newline at end of file
gc()
.libPaths("/home2/ghenry/R/x86_64-pc-linux-gnu-library/3.3")
library(readr)
library(Matrix)
library(Seurat)
setwd("../")
genes <- read_delim("./analysis/DATA/genes.tsv","\t",escape_double=FALSE,col_names=FALSE,trim_ws=TRUE)
barcodes <- read_delim("./analysis/DATA/barcodes.tsv","\t",escape_double=FALSE,col_names=FALSE,trim_ws=TRUE)
matrix <- readMM("./analysis/DATA/matrix.mtx")
load("./analysis/DATA/sc10x.data.Rda")
sc10x.Group <- SetAllIdent(object=sc10x.Group,id="SubClust.ID+NE")
barcodes.NE <- names(sc10x.Group@ident[sc10x.Group@ident=="NE"])
genes.rnd <- 1:nrow(genes)
#genes.rnd <- sample(genes.rnd,2500)
barcodes.rnd <- 1:nrow(barcodes)
barcodes.NE.index <- c()
for (i in 1:length(barcodes.NE)){
barcodes.NE.index <- c(barcodes.NE.index,which(barcodes==barcodes.NE[i]))
}
barcodes.rnd <- barcodes.rnd[!barcodes.rnd %in% barcodes.NE.index]
barcodes.rnd <- sample(barcodes.rnd,(2500-length(barcodes.NE)))
barcodes.rnd <- c(barcodes.rnd,barcodes.NE.index)
genes.sample <- genes[genes.rnd,]
barcodes.sample <- barcodes[barcodes.rnd,]
matrix.sample <- matrix[genes.rnd,barcodes.rnd]
if (!dir.exists("./analysis/CI.TestData.downsample")){
dir.create("./analysis/CI.TestData.downsample")
}
if (!dir.exists("./analysis/CI.TestData.downsample/10x")){
dir.create("./analysis/CI.TestData.downsample/10x")
}
if (!dir.exists("./analysis/CI.TestData.downsample/10x/filtered_gene_bc_matrices_mex")){
dir.create("./analysis/CI.TestData.downsample/10x/filtered_gene_bc_matrices_mex")
}
if (!dir.exists("./analysis/CI.TestData.downsample/10x/filtered_gene_bc_matrices_mex/GRCh38")){
dir.create("./analysis/CI.TestData.downsample/10x/filtered_gene_bc_matrices_mex/GRCh38")
}
write.table(genes.sample,file="./analysis/CI.TestData.downsample/10x/filtered_gene_bc_matrices_mex/GRCh38/genes.tsv",row.names=FALSE,col.names=FALSE,append=FALSE,sep="\t",quote=FALSE)
write.table(barcodes.sample,file="./analysis/CI.TestData.downsample/10x/filtered_gene_bc_matrices_mex/GRCh38/barcodes.tsv",row.names=FALSE,col.names=FALSE,append=FALSE,sep="\t",quote=FALSE)
writeMM(matrix.sample,file="./analysis/CI.TestData.downsample/10x/filtered_gene_bc_matrices_mex/GRCh38/matrix.mtx")
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment