Skip to content
Snippets Groups Projects
Commit 51ad2c96 authored by Brandi Cantarel's avatar Brandi Cantarel
Browse files

adding checkmate bash script

parent b3fce91f
No related merge requests found
#!/bin/bash
#checkmate.sh
usage() {
echo "-h Help documentation for checkmate"
echo "-r --Path to Reference Genome with the file genome.fa"
echo "-p --Prefix for output file name"
echo "-c --Path to Reference GenomeNGS Checkmate SNP BED file"
echo "Example: bash checkmate.sh -p prefix -r /path/GRCh38 -c /path/NGSCheckMate.bed -f"
exit 1
}
OPTIND=1 # Reset OPTIND
while getopts :r:l:n:c:b:p:fh opt
do
case $opt in
r) index_path=$OPTARG;;
p) pair_id=$OPTARG;;
b) sbam=$OPTARG;;
n) normal=$OPTARG;;
f) filter=1;;
c) capture=$OPTARG;;
h) usage;;
esac
done
function join_by { local IFS="$1"; shift; echo "$*"; }
shift $(($OPTIND -1))
baseDir="`dirname \"$0\"`"
# Check for mandatory options
source /etc/profile.d/modules.sh
export PATH=/project/shared/bicf_workflow_ref/seqprg/bin:/usr/local/bin/:$PATH
module load samtools/gcc/1.8 bcftools/gcc/1.8
if [[ -z $capture ]]
then
capture="${index_path}/NGSCheckMate.bed"
fi
if [[ -f "${index_path}/genome.fa" ]]
then
reffa="${index_path}/genome.fa"
fi
for i in *.bam; do
prefix="${i%.bam}"
echo ${prefix}
bcftools mpileup -A -d 1000000 -C50 -Ou --gvcf 0 -f ${reffa} -T ${capture} $i | bcftools call -m --gvcf 0 -Ov | bcftools convert --gvcf2vcf -f ${reffa} -Ov -o ${prefix}.vcf
done
if [[ -f /project/shared/bicf_workflow_ref/seqprg/bin/ncm.py ]]
then
ncm=/project/shared/bicf_workflow_ref/seqprg/bin/ncm.py
elif [[ -f /usr/local/bin/ncm.py ]]
then
ncm=/usr/local/bin/ncm.py
else
echo "ncm missing"
fi
python $ncm -V -d ./ -bed $capture -O ./ -N ${pair_id}
perl $baseDir/sequenceqc_somatic.pl -i ${pair_id}_all.txt -o ${pair_id}.sequence.stats.txt
#!/usr/bin/perl -w
#uploadqc.pl
use Getopt::Long qw(:config no_ignore_case no_auto_abbrev);
my %opt = ();
my $results = GetOptions (\%opt,'input|i=s','output|o=s','help|h');
open MATE, "<$opt{input}" or die $!;
while (my $line = <MATE>) {
chomp($line);
my ($sam1,$pf,$sam2,$corr,$depth) = split(/\t/,$line);
$sam1 = (split(/\./,$sam1))[0];
$sam2 = (split(/\./,$sam2))[0];
open OUT, ">$opt{output}" or die $!;
my $status= 'PASS';
$status='FAIL' if($pf eq 'unmatched');
print OUT join("\n","Sample_1\t".$sam1,"Sample_2\t".$sam2,"Correlation\t".$corr,
"Depth\t".$depth,"Status\t".$status),"\n";
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment