Newer
Older
#!/bin/bash
#PBS -l walltime=24:00:00
#PBS -l ncpus=1,mem=2gb
#PBS -q uv2000
#PBS -N trio_whole_exome_archive_project
#PBS -j oe
# Expects environment variables to be set
# PROJECT_ID - e.g. 12345_LastnameFirstname
# PRIORITY_DIRS - e.g. 05122019,07122019 (colon delimited if more than one)
# CONFIG_SH - absolute path to configuration script setting environment variables
# Source the configuration file
source $CONFIG_SH
# Move to the output directory
cd $OUTPUT_DIR
# Copy bcbio output files
for family_dir in *_$PROJECT_ID*
do
rsync -av --exclude '*.bam*' $family_dir $ARCHIVE_DIR/
done
# Copy qc files
cd qc
mkdir -p $ARCHIVE_DIR/qc
# Copy prioritization files
cd ../prioritization
mkdir -p $ARCHIVE_DIR/prioritization
DIRS=$(echo $PRIORITY_DIRS | tr ":" "\n")
for dir in $DIRS
do
rsync -av $dir.md5sum.txt $ARCHIVE_DIR/prioritization/
done
# move to the archive area and check the md5s
cd $ARCHIVE_DIR
do
cd $family_dir
md5sum --check md5sum.txt
cd ..
done
cd qc
md5sum --check ${PROJECT_ID}_qc_report.md5sum.txt
cd ../prioritization
for dir in $DIRS
do
cd $dir
md5sum --check ../$dir.md5sum.txt
cd ..
done