Skip to content

Commit

Permalink
Collection of bash scripts used throughout the pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam-Sims committed Jun 1, 2021
1 parent fc9f33a commit 407d545
Show file tree
Hide file tree
Showing 10 changed files with 153 additions and 0 deletions.
61 changes: 61 additions & 0 deletions bash-scripts/download_rnaseq.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#!/bin/bash
#SBATCH [email protected]
#SBATCH --mail-type=END
cat accessions.txt | while read line
do
echo "Reading ${line}"
if [ ! -f /gpfs/home/naa17jnu/scratch/seq_runs/${line}.fastq.gz ] # check if file doesnt already exist
then
echo "File ${line} doesnt exist - downloading"
if wget --spider ftp://ftp.sra.ebi.ac.uk/vol1/fastq/SRR838/000/${line}/${line}.fastq.gz 2>/dev/null
then
echo "Found ${line}.fastq.gz on 000"
wget ftp://ftp.sra.ebi.ac.uk/vol1/fastq/SRR838/000/${line}/${line}.fastq.gz -P /gpfs/home/naa17jnu/scratch/seq_runs
fi
if wget --spider ftp://ftp.sra.ebi.ac.uk/vol1/fastq/SRR838/001/${line}/${line}.fastq.gz 2>/dev/null
then
echo "Found ${line}.fastq.gz on 001"
wget ftp://ftp.sra.ebi.ac.uk/vol1/fastq/SRR838/001/${line}/${line}.fastq.gz -P /gpfs/home/naa17jnu/scratch/seq_runs
fi
if wget --spider ftp://ftp.sra.ebi.ac.uk/vol1/fastq/SRR838/002/${line}/${line}.fastq.gz 2>/dev/null
then
echo "Found ${line}.fastq.gz on 002"
wget ftp://ftp.sra.ebi.ac.uk/vol1/fastq/SRR838/002/${line}/${line}.fastq.gz -P /gpfs/home/naa17jnu/scratch/seq_runs
fi
if wget --spider ftp://ftp.sra.ebi.ac.uk/vol1/fastq/SRR838/003/${line}/${line}.fastq.gz 2>/dev/null
then
echo "Found ${line}.fastq.gz on 003"
wget ftp://ftp.sra.ebi.ac.uk/vol1/fastq/SRR838/003/${line}/${line}.fastq.gz -P /gpfs/home/naa17jnu/scratch/seq_runs
fi
if wget --spider ftp://ftp.sra.ebi.ac.uk/vol1/fastq/SRR838/004/${line}/${line}.fastq.gz 2>/dev/null
then
echo "Found ${line}.fastq.gz on 004"
wget ftp://ftp.sra.ebi.ac.uk/vol1/fastq/SRR838/004/${line}/${line}.fastq.gz -P /gpfs/home/naa17jnu/scratch/seq_runs
fi
if wget --spider ftp://ftp.sra.ebi.ac.uk/vol1/fastq/SRR838/005/${line}/${line}.fastq.gz 2>/dev/null
then
echo "Found ${line}.fastq.gz on 005"
wget ftp://ftp.sra.ebi.ac.uk/vol1/fastq/SRR838/005/${line}/${line}.fastq.gz -P /gpfs/home/naa17jnu/scratch/seq_runs
fi
if wget --spider ftp://ftp.sra.ebi.ac.uk/vol1/fastq/SRR838/006/${line}/${line}.fastq.gz 2>/dev/null
then
echo "Found ${line}.fastq.gz on 006"
wget ftp://ftp.sra.ebi.ac.uk/vol1/fastq/SRR838/006/${line}/${line}.fastq.gz -P /gpfs/home/naa17jnu/scratch/seq_runs
fi
if wget --spider ftp://ftp.sra.ebi.ac.uk/vol1/fastq/SRR838/007/${line}/${line}.fastq.gz 2>/dev/null
then
echo "Found ${line}.fastq.gz on 007"
wget ftp://ftp.sra.ebi.ac.uk/vol1/fastq/SRR838/007/${line}/${line}.fastq.gz -P /gpfs/home/naa17jnu/scratch/seq_runs
fi
if wget --spider ftp://ftp.sra.ebi.ac.uk/vol1/fastq/SRR838/008/${line}/${line}.fastq.gz 2>/dev/null
then
echo "Found ${line}.fastq.gz on 008"
wget ftp://ftp.sra.ebi.ac.uk/vol1/fastq/SRR838/008/${line}/${line}.fastq.gz -P /gpfs/home/naa17jnu/scratch/seq_runs
fi
if wget --spider ftp://ftp.sra.ebi.ac.uk/vol1/fastq/SRR838/009/${line}/${line}.fastq.gz 2>/dev/null
then
echo "Found ${line}.fastq.gz on 008"
wget ftp://ftp.sra.ebi.ac.uk/vol1/fastq/SRR838/009/${line}/${line}.fastq.gz -P /gpfs/home/naa17jnu/scratch/seq_runs
fi
fi
done
6 changes: 6 additions & 0 deletions bash-scripts/fastqdump.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
#SBATCH [email protected]
#SBATCH --mail-type=END

source activate icshape-pipe
fasterq-dump SRR11164866 -O /gpfs/home/naa17jnu/scratch/fastq_output
9 changes: 9 additions & 0 deletions bash-scripts/runR.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
#SBATCH [email protected]
#SBATCH --mail-type=END
#SBATCH --mem=80G
#SBATCH -p compute-24-96

export PATH=/gpfs/home/naa17jnu/.conda/envs/r-env/bin:$PATH
source activate r-env
Rscript sleuth-new.R
10 changes: 10 additions & 0 deletions bash-scripts/run_fastp.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
#SBATCH [email protected]
#SBATCH --mail-type=END

cat accessions.txt | while read line
do
echo "Cleaning ${line}"
./fastp -i /gpfs/home/naa17jnu/scratch/seq_runs/${line}.fastq.gz -o /gpfs/home/naa17jnu/scratch/fastp/${line}_clean.fastq.gz -Q -L -j ${line}.json - h ${line}.html -R "${line}"
echo "Done"
done
13 changes: 13 additions & 0 deletions bash-scripts/run_fastqc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
#SBATCH [email protected]
#SBATCH --mail-type=END


# MUST DO module load fastqc/0.11.9 before running
module load fastqc/0.11.9
cat accessions.txt | while read line
do
echo "Cleaning ${line}"
fastqc /gpfs/home/naa17jnu/scratch/seq_runs/${line}.fastq.gz --outdir /gpfs/home/naa17jnu/scratch/fastqc_analysis
echo "Done"
done
7 changes: 7 additions & 0 deletions bash-scripts/run_format.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
cat input_mirs.txt | while read line
do
echo "Reading ${line}"
python miR-Search.py format -i sleuth_output/sleuth_results_${line}.csv mir_search_output/${line}.csv -o ${line}.csv
echo "Done"
done
7 changes: 7 additions & 0 deletions bash-scripts/run_format_shape.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
cat input_mirs.txt | while read line
do
echo "Reading ${line}"
python mir-search ggplot-format -s "sleuth_output_transcript/condition${line} .csv" icshape-align_out_flanking/${line}.pickle -o ${line}.csv
echo "Done"
done
7 changes: 7 additions & 0 deletions bash-scripts/run_icshape_align.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
cat input_mirs.txt | while read line
do
echo "Reading ${line}"
python mir-search icshape-align -s /home/sammy/Documents/MSc_Research_Project/9.transSHAPE/final.shape -t mir_search_output/${line}.csv -u final_trans.fasta -f 10
echo "Done"
done
26 changes: 26 additions & 0 deletions bash-scripts/run_kallisto.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash
#SBATCH [email protected]
#SBATCH --mail-type=END

#Before running generate index file - kallisto index -i filename

# DO module load kallisto/0.46.1
module load kallisto/0.46.1
line=$1
echo "Reading ${line}"
if [ -f /gpfs/home/naa17jnu/scratch/fastp/${line}_clean.fastq.gz ] # check clean file actually exists
then
echo "File exists at /gpfs/home/naa17jnu/scratch/fastp/${line}_clean.fastq.gz"
if [ ! -f ${line}_block ] # check kallisto isnt in progress
then
echo "Running kallisto on ${line}"
touch ${line}_block
kallisto quant -i /gpfs/home/naa17jnu/scratch/kallisto/homo_sapiens_GRCh38 --single --fragment-length=180 --sd=20 --bias -b 100 -o /gpfs/home/naa17jnu/scratch/kallisto/${line}_kallisto /gpfs/home/naa17jnu/scratch/fastp/${line}_clean.fastq.gz 2>&1 | tee ${line}_stdout.txt
else
echo "Block file found - is kallisto running already?"
fi
else
echo "Cleaned file not found"
fi
rm -f ${line}_block
done
7 changes: 7 additions & 0 deletions bash-scripts/run_mir_search.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
cat input_mirs.txt | while read line
do
echo "Reading ${line}"
python mir-search mir-search -m -i ${line} final_trans.fasta
echo "Done"
done

0 comments on commit 407d545

Please sign in to comment.