Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add bcftools sort step before tabix index #432

Merged
merged 2 commits into from
Jan 20, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions bin/concatenateVCFs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,16 @@ then
tail -n +$((L+1)) ${vcf}
done
done
) | bgzip -@${cpus} > rawcalls.vcf.gz
tabix rawcalls.vcf.gz
) | bgzip -@${cpus} > rawcalls.unsorted.vcf.gz
else
VCF=$(ls no_intervals*.vcf)
cp $VCF rawcalls.vcf
bgzip -@${cpus} rawcalls.vcf
tabix rawcalls.vcf.gz
cp $VCF rawcalls.unsorted.vcf
bgzip -@${cpus} rawcalls.unsorted.vcf
fi

bcftools sort rawcalls.unsorted.vcf.gz | bgzip > rawcalls.vcf.gz
tabix -p vcf rawcalls.vcf.gz

set +u

# Now we have the concatenated VCF file, check for WES/panel targets, and generate a subset if there is a BED provided
Expand All @@ -102,5 +103,5 @@ if [ ! -z ${targetBED+x} ]; then
tabix ${outputFile}.gz
else
# Rename the raw calls as WGS results
for f in rawcalls*; do mv -v $f ${outputFile}${f#rawcalls.vcf}; done
for f in rawcalls.vcf*; do mv -v $f ${outputFile}${f#rawcalls.vcf}; done
fi