Skip to content

Instantly share code, notes, and snippets.

@hepcat72
Created January 8, 2020 22:18
Show Gist options
  • Save hepcat72/df8fe2186286b1eca323787699f1a541 to your computer and use it in GitHub Desktop.
Save hepcat72/df8fe2186286b1eca323787699f1a541 to your computer and use it in GitHub Desktop.
#!/bin/bash
#Run once for each sample to gather sequences from multiple sequencing runs that belong to that sample. Sample name must be exactly the same as in each sequencing run.
#USAGE: ./splitseq_combine.sh run1 v1 reference_directory "splitseq_all_out_directories" "sample_name A1:B6"
all_args=("$@")
run_id=$1
chemistry=$2 #v1 or v2
ssrefdir=$3
libdirs="$4"
sample_wells=("${all_args[@]:4}")
splitseq_venv="/Genomics/grid/users/rleach/local/splitseq"
splitseq_runs="${splitseq_venv}/splitseq_runs"
cd "${splitseq_venv}"
mkdir "${splitseq_runs}"
set -eu
. /usr/share/Modules/init/sh
module load STAR/2.7.3a
module load samtools/1.10
module load python/3.6.4
mkdir "${splitseq_runs}/${run_id}"
echo ./bin/python ./bin/split-seq combine \
--output_dir "${splitseq_runs}/${run_id}" \
--sublibraries ${libdirs} \
--chemistry "${chemistry}" \
--genome_dir "${ssrefdir}" \
--sample ${sample_wells}
./bin/python ./bin/split-seq combine \
--output_dir "${splitseq_runs}/${run_id}" \
--sublibraries ${libdirs} \
--chemistry "${chemistry}" \
--genome_dir "${ssrefdir}" \
--sample ${sample_wells}
echo
echo Done.
echo "Output sample is located in:"
echo "${splitseq_runs}/${run_id}"
#!/bin/bash
#USAGE: ./splitseq_mkref.sh "genome names" "fasta files" "gtf files"
genome_names=$1 #space-delimited, e.g. "hg38 mm10"
fastas=$2 #space-delimited, e.g. "hg38.fa mm10.fa"
gtfs=$3 #space-delimited, e.g. "hg38.gtf mm10.gtf"
splitseq_venv="/Genomics/grid/users/rleach/local/splitseq"
splitseq_refs="${splitseq_venv}/splitseq_refs"
refdir="${splitseq_refs}/"`echo "${genome_names}" | perl -pne 's/ /_/g;'`
cd "${splitseq_venv}"
mkdir "${splitseq_refs}"
set -eu
. /usr/share/Modules/init/sh
module load STAR/2.7.3a
module load samtools/1.10
module load python/3.6.4
mkdir "${refdir}"
echo ./bin/python ./bin/split-seq mkref \
--genome ${genome_names} \
--fasta ${fastas} \
--genes ${gtfs} \
--output_dir "${refdir}" \
--nthreads 16
./bin/python ./bin/split-seq mkref \
--genome ${genome_names} \
--fasta ${fastas} \
--genes ${gtfs} \
--output_dir "${refdir}" \
--nthreads 16
echo
echo Done.
echo "Output reference (to supply to split-seq all) is located in:"
echo "${refdir}"
#!/bin/bash
#USAGE: ./splitseq_run.sh run1 mrna.fq bcumi.fq v1 reference_directory "sample_name A1:B6" "sample2_name B7:C12" ...
all_args=("$@")
run_id=$1
mrna_fq=$2
bcumi_fq=$3
chemistry=$4 #v1 or v2
ssrefdir=$5
raw_samples=("${all_args[@]:5}")
#Build the sample arguments, e.g. `--sample name A1:B6 --sample B7:C12`
sample_args=""
for n in "${raw_samples[@]}"
do
sample_args="${sample_args} --sample ${n}"
done
splitseq_venv="/Genomics/grid/users/rleach/local/splitseq"
splitseq_runs="${splitseq_venv}/splitseq_runs"
cd "${splitseq_venv}"
mkdir "${splitseq_runs}"
set -eu
. /usr/share/Modules/init/sh
module load STAR/2.7.3a
module load samtools/1.10
module load python/3.6.4
mkdir "${splitseq_runs}/${run_id}"
echo ./bin/python ./bin/split-seq all \
--fq1 "${mrna_fq}" \
--fq2 "${bcumi_fq}" \
--output_dir "${splitseq_runs}/${run_id}" \
--chemistry "${chemistry}" \
--genome_dir "${ssrefdir}" \
--nthreads 16 \
${sample_args}
./bin/python ./bin/split-seq all \
--fq1 "${mrna_fq}" \
--fq2 "${bcumi_fq}" \
--output_dir "${splitseq_runs}/${run_id}" \
--chemistry "${chemistry}" \
--genome_dir "${ssrefdir}" \
--nthreads 16 \
${sample_args}
echo
echo Done.
echo "Output library (to supply to split-seq combine) is located in:"
echo "${splitseq_runs}/${run_id}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment