Newer
Older
#!/usr/bin/env bash
fastqc *.gz
for file in *_1.fastq.gz
do
trim_galore --cores 8 --gzip --fastqc --max_n 2 --output_dir Trimmed_Data/ --paired $file ${file%_1.fastq.gz}_2.fastq.gz
done
hisat2-build -p 8 ./Homo_sapiens/UCSC/hg38/Sequence/WholeGenomeFasta/genome.fa index
for file in Trimmed_Data/*_1_val_1.fq.gz
do
out_file=${file#Trimmed_Data/}
out_file=${out_file%_1_val_1.fq.gz}.sam
hisat2 -x index -1 $file -2 ${file%_1_val_1.fq.gz}_2_val_2.fq.gz -S $out_file
done
for file in *.sam
do
samtools sort -@ 8 -o ${file%.sam}.bam $file
done
mkdir ./htseq_counts
for file in *.bam
do
htseq-count -r name -s no -f bam $file ./Homo_sapiens/UCSC/hg38/Annotation/Genes/genes.gtf > htseq_counts/${file%.bam}_count.txt
done
Rscript htseq-merge_all.R htseq_counts/ count_matrix
sed '/^__/d' htseq_counts/count_matrix.txt > count_matrix_cleaned.txt
Rscript count_analysis.r