forked from maxrwjones/Uauy_Lab_RNAseq_mapping_pipeline
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fastp_kallisto.sh
78 lines (58 loc) · 2.13 KB
/
fastp_kallisto.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/bin/bash
################################################################################
##### USER INPUTS #####
#######################
### Step 1) Define a base directory for pipeline outputs
base_dir=/your/base/directory
### Step 2) Define the two mate pair gzipped FASTQ files and a sample name
mate1=/path/to/file/filename1.fq.gz
mate2=/path/to/file/filename2.fq.gz
sample_name="name_of_sample" # No spaces allowed
### Step 3) Provide the path and filename of a kallisto index of the target
### reference genome
index=/path/to/index/index_name.k31
### Step 4) Set the minimum read length. Reads shorter than "min_len" after
### trimming will be discarded. The default value for fastp is 15 bp.
min_len=15
### Step 5) Set the number of threads to use per sample pair. I have found one
### thread is adequate for the wheat genome. Must be an integer.
threads=1
### Step 6) Ensure your bash implementation (whether on your local machine or
### a cluster environment) can access a copy of Fastp (>=v0.20.0) and Kallisto
### (>=v0.42.2). You may also convert this script into a batch script for your
### cluster's job handler, e.g. SLURM.
################################################################################
##### SETUP #####
#################
date
echo
### Set up directories for pipeline
out_dir=$base_dir/outputs
mkdir -p $base_dir
mkdir -p $out_dir
mkdir -p $out_dir/fastp_reports
################################################################################
##### RUN SCRIPTS #####
#######################
fastp -i $mate1 \
-I $mate2 \
-o $out_dir/${sample_name}_trimmed_1.fq.gz \
-O $out_dir/${sample_name}_trimmed_2.fq.gz \
-h $out_dir/fastp_reports/${sample_name}_fastp_report.html \
-j $out_dir/fastp_reports/${sample_name}_fastp_report.json \
--detect_adapter_for_pe \
--length_required $min_len \
--thread $threads
echo
echo "Fastp trimming and clean-up complete"
echo
kallisto quant --index $index \
--output-dir $out_dir/$sample_name \
--bootstrap-samples=30 \
--bias \
--threads $threads \
$out_dir/${sample_name}_trimmed_1.fq.gz \
$out_dir/${sample_name}_trimmed_2.fq.gz
echo "Kallisto pseudoalignment complete"
echo
date