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

Merge branch 'master' of git.biohpc.swmed.edu:BICF/Astrocyte/process_scripts

parents b54812cf ba64b4b1
Branches
Tags
No related merge requests found
...@@ -12,7 +12,7 @@ usage() { ...@@ -12,7 +12,7 @@ usage() {
exit 1 exit 1
} }
OPTIND=1 # Reset OPTIND OPTIND=1 # Reset OPTIND
while getopts :r:x:y:p:u:h opt while getopts :r:x:y:p:uh opt
do do
case $opt in case $opt in
r) index_path=$OPTARG;; r) index_path=$OPTARG;;
......
...@@ -34,7 +34,7 @@ if [[ -z $pair_id ]] || [[ -z $fq1 ]]; then ...@@ -34,7 +34,7 @@ if [[ -z $pair_id ]] || [[ -z $fq1 ]]; then
fi fi
source /etc/profile.d/modules.sh source /etc/profile.d/modules.sh
module load samtools/gcc/1.6 picard/2.10.3 module load samtools/1.6 picard/2.10.3
baseDir="`dirname \"$0\"`" baseDir="`dirname \"$0\"`"
if [[ -z $SLURM_CPUS_ON_NODE ]] if [[ -z $SLURM_CPUS_ON_NODE ]]
then then
...@@ -62,13 +62,14 @@ else ...@@ -62,13 +62,14 @@ else
else else
hisat2 -p $SLURM_CPUS_ON_NODE --rg-id ${pair_id} --rg LB:tx --rg PL:illumina --rg PU:barcode --rg SM:${pair_id} --add-chrname --no-unal --dta -x ${index_path}/hisat_index/genome -U $fq1 -S out.sam --summary-file ${pair_id}.alignerout.txt hisat2 -p $SLURM_CPUS_ON_NODE --rg-id ${pair_id} --rg LB:tx --rg PL:illumina --rg PU:barcode --rg SM:${pair_id} --add-chrname --no-unal --dta -x ${index_path}/hisat_index/genome -U $fq1 -S out.sam --summary-file ${pair_id}.alignerout.txt
fi fi
samtools view -1 --threads $SLURM_CPUS_ON_NODE -o output.bam out.sam if [[ $umi==1 ]]
fi then
if [[ $umi==1 ]] python ${baseDir}/add_umi_sam.py -s out.sam -o output.bam
then else
python ${baseDir}/add_umi_bam.py -b output.bam -o output.unsort2.bam samtools view -1 --threads $SLURM_CPUS_ON_NODE -o output.bam out.sam
mv output.unsort2.bam output.bam fi
fi fi
samtools sort -@ $SLURM_CPUS_ON_NODE -O BAM -n -o output.nsort.bam output.bam samtools sort -@ $SLURM_CPUS_ON_NODE -O BAM -n -o output.nsort.bam output.bam
java -jar $PICARD/picard.jar FixMateInformation ASSUME_SORTED=TRUE SORT_ORDER=coordinate ADD_MATE_CIGAR=TRUE I=output.nsort.bam O=${pair_id}.bam java -jar $PICARD/picard.jar FixMateInformation ASSUME_SORTED=TRUE SORT_ORDER=coordinate ADD_MATE_CIGAR=TRUE I=output.nsort.bam O=${pair_id}.bam
samtools index -@ $SLURM_CPUS_ON_NODE ${pair_id}.bam samtools index -@ $SLURM_CPUS_ON_NODE ${pair_id}.bam
...@@ -21,6 +21,8 @@ done ...@@ -21,6 +21,8 @@ done
shift $(($OPTIND -1)) shift $(($OPTIND -1))
index_path='/project/shared/bicf_workflow_ref/GRCh38/clinseq_prj/'
# Check for mandatory options # Check for mandatory options
if [[ -z $pair_id ]] || [[ -z $sbam ]]; then if [[ -z $pair_id ]] || [[ -z $sbam ]]; then
usage usage
...@@ -33,13 +35,13 @@ baseDir="`dirname \"$0\"`" ...@@ -33,13 +35,13 @@ baseDir="`dirname \"$0\"`"
source /etc/profile.d/modules.sh source /etc/profile.d/modules.sh
module load cnvkit/0.9.0 module load cnvkit/0.9.0
cnvkit.py coverage ${sbam} /project/shared/bicf_workflow_ref/GRCh38/UTSWV2.cnvkit_targets.bed -o ${pair_id}.targetcoverage.cnn cnvkit.py coverage ${sbam} ${index_path}/UTSWV2.cnvkit_targets.bed -o ${pair_id}.targetcoverage.cnn
cnvkit.py coverage ${sbam} /project/shared/bicf_workflow_ref/GRCh38/UTSWV2.cnvkit_antitargets.bed -o ${pair_id}.antitargetcoverage.cnn cnvkit.py coverage ${sbam} ${index_path}/UTSWV2.cnvkit_antitargets.bed -o ${pair_id}.antitargetcoverage.cnn
if [[ $umi == 'umi' ]] if [[ $umi == 'umi' ]]
then then
cnvkit.py fix ${pair_id}.targetcoverage.cnn ${pair_id}.antitargetcoverage.cnn /project/shared/bicf_workflow_ref/GRCh38/UTSWV2.uminormals.cnn -o ${pair_id}.cnr cnvkit.py fix ${pair_id}.targetcoverage.cnn ${pair_id}.antitargetcoverage.cnn ${index_path}/UTSWV2.uminormals.cnn -o ${pair_id}.cnr
else else
cnvkit.py fix ${pair_id}.targetcoverage.cnn ${pair_id}.antitargetcoverage.cnn /project/shared/bicf_workflow_ref/GRCh38/UTSWV2.normals.cnn -o ${pair_id}.cnr cnvkit.py fix ${pair_id}.targetcoverage.cnn ${pair_id}.antitargetcoverage.cnn ${index_path}/UTSWV2.normals.cnn -o ${pair_id}.cnr
fi fi
cnvkit.py segment ${pair_id}.cnr -o ${pair_id}.cns cnvkit.py segment ${pair_id}.cnr -o ${pair_id}.cns
......
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