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

updating hisat-genotype paired vs single end

parent 5a94d6d7
Branches
Tags
No related merge requests found
......@@ -41,19 +41,21 @@ module load bwakit/0.7.15 bwa/intel/0.7.15 samtools/1.6 picard/2.10.3
baseDir="`dirname \"$0\"`"
if [[ $fq1 == $fq2 ]]
diff $fq1 $fq2 > difffile
if [ -s difffile ]
then
bwa mem -M -t $SLURM_CPUS_ON_NODE -R "@RG\tID:${pair_id}\tLB:tx\tPL:illumina\tPU:barcode\tSM:${pair_id}" ${index_path}/genome.fa ${fq1} > out.sam
else
bwa mem -M -t $SLURM_CPUS_ON_NODE -R "@RG\tID:${pair_id}\tLB:tx\tPL:illumina\tPU:barcode\tSM:${pair_id}" ${index_path}/genome.fa ${fq1} ${fq2} > out.sam
else
bwa mem -M -t $SLURM_CPUS_ON_NODE -R "@RG\tID:${pair_id}\tLB:tx\tPL:illumina\tPU:barcode\tSM:${pair_id}" ${index_path}/genome.fa ${fq1} > out.sam
fi
if [[ $umi == 'umi' ]]
then
k8 /cm/shared/apps/bwakit/0.7.15/bwa-postalt.js -p ${pair_id}.hla ${index_path}/genome.fa.alt out.sam | python ${baseDir}/add_umi_sam.py -s - -o output.unsort.bam
k8 /cm/shared/apps/bwakit/0.7.15/bwa-postalt.js -p tmphla ${index_path}/genome.fa.alt out.sam | python ${baseDir}/add_umi_sam.py -s - -o output.unsort.bam
elif [[ $index_path == '/project/shared/bicf_workflow_ref/GRCh38' ]]
then
k8 /cm/shared/apps/bwakit/0.7.15/bwa-postalt.js -p ${pair_id}.hla ${index_path}/genome.fa.alt out.sam| samtools view -1 - > output.unsort.bam
k8 /cm/shared/apps/bwakit/0.7.15/bwa-postalt.js -p tmphla ${index_path}/genome.fa.alt out.sam| samtools view -1 - > output.unsort.bam
else
samtools view -1 -o output.unsort.bam out.sam
fi
......
#!/bin/bash
#hlatyping.sh
usage() {
echo "-h Help documentation for dnaseqalign.sh"
echo "-r --Reference Genome: GRCh38 or GRCm38"
echo "-x --FastQ R1"
echo "-y --FastQ R2"
echo "-p --Prefix for output file name"
echo "Example: bash hisat_genotype.sh -p prefix"
exit 1
}
OPTIND=1 # Reset OPTIND
while getopts :r:x:y:p:uh opt
do
case $opt in
r) index_path=$OPTARG;;
x) fq1=$OPTARG;;
y) fq2=$OPTARG;;
u) umi='umi';;
p) pair_id=$OPTARG;;
h) usage;;
esac
done
shift $(($OPTIND -1))
# Check for mandatory options
if [[ -z $pair_id ]] || [[ -z $index_path ]]; then
usage
fi
if [[ -z $SLURM_CPUS_ON_NODE ]]
then
SLURM_CPUS_ON_NODE=1
fi
source /etc/profile.d/modules.sh
module load hisat-genotype/1.0.1
diff $fq1 $fq2 > difffile
if [ -s difffile ]
then
hisatgenotype_extract_reads.py -p 16 --database-list hla --base /project/shared/bicf_workflow_ref/hisat_genotype_hla/genotype_genome -1 $fq1 -2 $fq2 --out-dir hisatgeno_out
else
hisatgenotype_extract_reads.py -p 16 --database-list hla --base /project/shared/bicf_workflow_ref/hisat_genotype_hla/genotype_genome -U $fq1 --out-dir hisatgeno_out
fi
hisatgenotype_locus_samples.py -p 16 --region-list hla.A,hla.B,hla.C,hla.DQA1,hla.DQB1,hla.DRB1,hla.DPB1 --assembly --read-dir hisatgeno_out --out-dir ${pair_id}.hisat_hla > ${pair_id}.hisat_hla.txt
tar cf ${pair_id}.hisat_hla.tar ${pair_id}.hisat_hla
gzip ${pair_id}.hisat_hla.tar
......@@ -41,7 +41,7 @@ then
SLURM_CPUS_ON_NODE=1
fi
diff $fq1 $fq2 > difffile.out
diff $fq1 $fq2 > difffile
if [ $algo == 'star' ]
then
......
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