Commit 84b7d4a3 authored by Gonzalo S Nido's avatar Gonzalo S Nido
Browse files

Merge branch 'master' into 'scp-sample'

# Conflicts:
#   prepare_vm.sh
parents 0a35040a 10abca86
......@@ -4,7 +4,7 @@ echo "#### Updating Ubuntu dist..."
sudo apt update && sudo apt -y upgrade
echo "#### Installing some Ubuntu packages..."
sudo apt -y install unzip build-essential libncurses5-dev zlib1g-dev libbz2-dev liblzma-dev p7zip-full
sudo apt -y install unzip build-essential libncurses5-dev zlib1g-dev libbz2-dev liblzma-dev p7zip-full pigz
sudo apt -y install neovim
echo "#### Installing samtools 1.10..."
......
......@@ -2,7 +2,7 @@
# Some variables
MT_chr_name="chrM"
LAMBDA_chr_name="chrL"
LAMBDA_chr_name="NC_001416.1"
# Get pipeline folder
PIPELINEPATH="$( cd "$(dirname "$0")" > /dev/null 2>&1 ; pwd -P )"
......@@ -43,7 +43,23 @@ SUBSET_READS=false
########################################
# Check that both MT chromosome and lambda are present in the reference
if ! grep -m1 -q "^>${MT_chr_name}" ${b38_ref}/Bisulfite_Genome/CT_conversion/genome_mfa.CT_conversion.fa; then
echo "ERROR: \"${MT_chr_name}\" does not exist in ${b38_ref}"
exit 1
fi
if grep -m1 -q "^>${MT_chr_name}" ${nuc_ref}/Bisulfite_Genome/CT_conversion/genome_mfa.CT_conversion.fa; then
echo "ERROR: \"${MT_chr_name}\" is present in the nuclear-only reference: ${nuc_ref}"
exit 1
fi
if ! grep -m1 -q "^>${MT_chr_name}" ${mt_ref}/Bisulfite_Genome/CT_conversion/genome_mfa.CT_conversion.fa; then
echo "ERROR: \"${MT_chr_name}\" does not exist in ${mt_ref}"
exit 1
fi
if ! grep -m1 -q "^>${LAMBDA_chr_name}" ${b38_ref}/Bisulfite_Genome/CT_conversion/genome_mfa.CT_conversion.fa; then
echo "ERROR: \"${LAMBDA_chr_name}\" does not exist in ${b38_ref}"
exit 1
fi
# Exit when any command fails
......@@ -291,23 +307,24 @@ else
echo "DONE"
fi
echo -ne " 1.5 Extracting MT and Lambda methylation... "
CMD="cat ${output_dir}/CpG_context_b38_${sample_id}.dedup.txt | python3 ${ext_chr_srt} ${MT_chr_name} | gzip -nc > \
CMD="cat ${output_dir}/CpG_context_b38_${sample_id}.dedup.txt | python3 ${ext_chr_srt} ${MT_chr_name} | pigz -nc > \
${output_dir}/CpG_context_chrM_${sample_id}.dedup.txt.gz && \
cat ${output_dir}/CpG_context_b38_${sample_id}.dedup.txt | python3 ${ext_chr_srt} ${LAMBDA_chr_name} | gzip -nc > \
cat ${output_dir}/CpG_context_b38_${sample_id}.dedup.txt | python3 ${ext_chr_srt} ${LAMBDA_chr_name} | pigz -nc > \
${output_dir}/CpG_context_LAMBDA_${sample_id}.dedup.txt.gz && \
gzip ${output_dir}/CpG_context_b38_${sample_id}.dedup.txt \n\
cat ${output_dir}/CHH_context_b38_${sample_id}.dedup.txt | python3 ${ext_chr_srt} ${MT_chr_name} | gzip -nc > \
pigz ${output_dir}/CpG_context_b38_${sample_id}.dedup.txt \n\
cat ${output_dir}/CHH_context_b38_${sample_id}.dedup.txt | python3 ${ext_chr_srt} ${MT_chr_name} | pigz -nc > \
${output_dir}/CHH_context_chrM_${sample_id}.dedup.txt.gz && \
cat ${output_dir}/CHH_context_b38_${sample_id}.dedup.txt | python3 ${ext_chr_srt} ${LAMBDA_chr_name} | gzip -nc > \
cat ${output_dir}/CHH_context_b38_${sample_id}.dedup.txt | python3 ${ext_chr_srt} ${LAMBDA_chr_name} | pigz -nc > \
${output_dir}/CHH_context_LAMBDA_${sample_id}.dedup.txt.gz && \
gzip ${output_dir}/CHH_context_b38_${sample_id}.dedup.txt \n\
cat ${output_dir}/CHG_context_b38_${sample_id}.dedup.txt | python3 ${ext_chr_srt} ${MT_chr_name} | gzip -nc > \
pigz ${output_dir}/CHH_context_b38_${sample_id}.dedup.txt \n\
cat ${output_dir}/CHG_context_b38_${sample_id}.dedup.txt | python3 ${ext_chr_srt} ${MT_chr_name} | pigz -nc > \
${output_dir}/CHG_context_chrM_${sample_id}.dedup.txt.gz && \
cat ${output_dir}/CHG_context_b38_${sample_id}.dedup.txt | python3 ${ext_chr_srt} ${LAMBDA_chr_name} | gzip -nc > \
cat ${output_dir}/CHG_context_b38_${sample_id}.dedup.txt | python3 ${ext_chr_srt} ${LAMBDA_chr_name} | pigz -nc > \
${output_dir}/CHG_context_LAMBDA_${sample_id}.dedup.txt.gz && \
gzip ${output_dir}/CHG_context_b38_${sample_id}.dedup.txt \n\
pigz ${output_dir}/CHG_context_b38_${sample_id}.dedup.txt \n\
zcat ${output_dir}/C??_context_LAMBDA_${sample_id}.dedup.txt.gz | python3 ${meth_prop} > \
${output_dir}/Lambda_meth_prop_${sample_id}.txt"
echo -e ${CMD} > ${log_dir}/1_5_extract_MT.cmd
......
Markdown is supported
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