Skip to content
Snippets Groups Projects
Commit 045957fc authored by Dr. Mohamed Mohamed Hefny Salim's avatar Dr. Mohamed Mohamed Hefny Salim
Browse files

firt script

parents
No related branches found
No related tags found
No related merge requests found
#!/bin/bash
################################################################################
# TrimAndCompare #
# #
# xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx. Place a short #
# description of the script here. #
# #
# Copyright (C) 2020 Rahma Amen (Potsdam University) #
# LinuxGeek46@both.org #
# #
# Change History #
# 16/07/2020 Rahma Amen created the script (inspired from Johanna Krger) #
# #
# #
################################################################################
######
### Trimming
######
ODIR=/home/mohamed/work/RAHMA/Analysis/
IDIR=/home/mohamed/work/RAHMA/RUN/
fqcdir=/home/mohamed/work/RAHMA/fastqc_analysis/
#ODIR=/home/bsdb2425/Rahma/temp/trimmed_capture-v1/
#IDIR=/home/bsdb2425/Rahma/temp/
ADAPTER_FWD=AGATCGGAAGAGCACACGTCTGAACTCCAGTCACNNNNNNNNATCTCGTATGCCGTCTTCTGCTTG
ADAPTER_REV=TTACTATGCCGCTGGTGGCTCTAGATGTGNNNNNNNTGTGAGAAAGGGATGTGCTGCGAGAAGG
TSeqfile=/home/mohamed/work/RAHMA/fastqc_analysis/TotalSeq_report
mkdir -p $ODIR
mkdir -p $fqcdir
#for file in `ls $INDIR/*R1*.fastq`
for fastqf in $IDIR/*R1_001.fastq.gz
do
# file stem (without extension or path)
fstem=$(echo $fastqf | sed 's/.*\///' | sed 's/1_001.fastq.gz//')
# fastq file names (original and trimmed)
f1o=$IDIR$fstem"1_001.fastq.gz"
f1t=$ODIR$fstem"1_001_trimmed.fastq.gz"
f2o=$IDIR$fstem"2_001.fastq.gz"
f2t=$ODIR$fstem"2_001_trimmed.fastq.gz"
cutadapt -a $ADAPTER_FWD -A $ADAPTER_REV -q 20 -m 30 -o $f1t -p $f2t $f1o $f2o
# fastqc for all files
fastqc --extract --outdir=$fqcdir $f1o $f2o $f1t $f2t
# fastqc --extract --outdir=$fqcdir $f1o $f1t
# remove zip files
rm $fqcdir/$fstem*.zip
f1oqc=$fqcdir$fstem"1_001_fastqc/fastqc_data.txt"
TotalSeq1o=`grep "Total Seq" $f1oqc | sed 's/Total Sequences //' `
echo $TotalSeq1o
f1tqc=$fqcdir$fstem"1_001_trimmed_fastqc/fastqc_data.txt"
TotalSeq1t=`grep "Total Seq" $f1tqc | sed 's/Total Sequences //' `
echo $TotalSeq1t
f2oqc=$fqcdir$fstem"2_001_fastqc/fastqc_data.txt"
TotalSeq2o=`grep "Total Seq" $f2oqc | sed 's/Total Sequences //' `
f2tqc=$fqcdir$fstem"2_001_trimmed_fastqc/fastqc_data.txt"
TotalSeq2t=`grep "Total Seq" $f2tqc | sed 's/Total Sequences //' `
echo "${fstem}1_001: $TotalSeq1o $TotalSeq1t" > $TSeqfile
echo "${fstem}2_001: $TotalSeq2o $TotalSeq2t" >> $TSeqfile
done
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment