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

Further changes to human pipelines #155

Merged
merged 10 commits into from
Sep 19, 2023
2 changes: 1 addition & 1 deletion bu_isciii/drylab_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def get_request(
if req.status_code > 201:
if safe:
log.info(
"Resolution id does not exist. Status code: " + req.status_code
f"Resolution id does not exist. Status code: {req.status_code}"
)
sys.exit()
else:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ sed -i "s|OUTPUT_FOLDER|${output_folder}|g" ./exomiser_configfile.yml

# THE FILE "spring.log" MUST BE DELETED IN THE CORRESPONDING NODE
echo "java -Xms2g -Xmx4g -jar exomiser-cli-13.0.0.jar --analysis ${scratch_dir}/exomiser_configfile.yml; rm /tmp/spring.log" > aux_06_exomiser_exome.sh
echo "srun --partition short_idx --mem 100G --time 2:00:00 --chdir /data/bi/pipelines/exomiser/exomiser-cli-13.0.0 --output logs/EXOMISER.log --job-name EXOMISER bash aux_06_exomiser_exome.sh" > _06_exomiser_exome.sh
echo "srun --partition short_idx --mem 100G --time 2:00:00 --chdir /data/bi/pipelines/exomiser/exomiser-cli-13.0.0 --output logs/EXOMISER.log --job-name EXOMISER bash ${scratch_dir}/aux_06_exomiser_exome.sh" > _06_exomiser_exome.sh

# annot_all table is huge, lets shrink it a little bit
echo "srun --partition short_idx --chdir ${scratch_dir} --output logs/COMPRESS_ALL.log --job-name COMPRESS_ANNOT_ALL gzip variants_annot_all.tab &" >> _07_gzip_table.sh
4 changes: 2 additions & 2 deletions bu_isciii/templates/exomeeb/ANALYSIS/ANALYSIS01_EXOME/lablog
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# module load Nextflow/22.10.1 singularity

ln -s ../00-reads/ .
ln -s ../samples_id.txt .

Expand All @@ -6,8 +8,6 @@ cat samples_id.txt | xargs -I % echo -e "%,XY,0,%,1,00-reads/%_R1.fastq.gz,00-re

mkdir -p 02-postprocessing 03-annotation 99-stats

#module load Nextflow singularity

scratch_dir=$(echo $PWD | sed "s/\/data\/bi\/scratch_tmp/\/scratch/g")

cat <<EOF > sarek.sbatch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ sed -i "s|OUTPUT_FOLDER|${output_folder}|g" ./exomiser_configfile.yml

# THE FILE "spring.log" MUST BE DELETED IN THE CORRESPONDING NODE
echo "java -Xms2g -Xmx4g -jar exomiser-cli-13.0.0.jar --analysis ${scratch_dir}/exomiser_configfile.yml; rm /tmp/spring.log" > aux_04_exomiser_exome.sh
echo "srun --partition short_idx --mem 100G --time 2:00:00 --chdir /data/bi/pipelines/exomiser/exomiser-cli-13.0.0 --output logs/EXOMISER.log --job-name EXOMISER bash aux_04_exomiser_exome.sh" > _04_exomiser_exome.sh
echo "srun --partition short_idx --mem 100G --time 2:00:00 --chdir /data/bi/pipelines/exomiser/exomiser-cli-13.0.0 --output logs/EXOMISER.log --job-name EXOMISER bash ${scratch_dir}/aux_04_exomiser_exome.sh &" > _04_exomiser_exome.sh

#---------------------------------------------------------------------------------------------------------

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# module load Nextflow/22.10.1 singularity

ln -s ../00-reads/ .
ln -s ../samples_id.txt .

Expand All @@ -22,13 +24,10 @@ do

done < ./samples_id.txt


echo -e "patient,sex,status,sample,lane,fastq_1,fastq_2" > samplesheet.csv
cat samples_id.txt | xargs -I % echo -e "%,XY,0,%,1,00-reads/%_R1.fastq.gz,00-reads/%_R2.fastq.gz" >> samplesheet.csv
mkdir -p 02-postprocessing 03-annotation 99-stats

#module load Nextflow singularity

scratch_dir=$(echo $PWD | sed "s/\/data\/bi\/scratch_tmp/\/scratch/g")

cat <<EOF > sarek.sbatch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,9 @@ echo "rm variants_annot_filterAF.tab" >> aux_03_awk.sh
#---------------------------------------------------------------------------------------------------------------------------------

## 7. Running exomiser
## NOTE: CHANGE HERE THE NODES
EXOMISER_FULL_NODE="ideafix04"
EXOMISER_EXOME_NODE="ideafix06"
EXOMISER_GENES_NODE="ideafix10"


vcf_file=$(realpath ../02-postprocessing/variants_fil.vcf | sed "s/\/data\/bi\/scratch_tmp/\/scratch/g")
ped_file=$(realpath ../../../DOC/family.ped | sed "s/\/data\/bi\/scratch_tmp/\/scratch/g")
proband=$(awk 'BEGIN{FS="\t"} $6 == 2 {print $2}' ../../../DOC/family.ped)
Expand All @@ -77,7 +74,8 @@ sed -i "s|PROBAND|${proband}|g" ./exomiser_configfile.yml
#sed -i "s|BED_FILE|${bed_file}|g" ./exomiser_configfile.yml
sed -i "s|OUTPUT_FOLDER|${output_folder}|g" ./exomiser_configfile.yml

echo "srun --partition short_idx --nodelist ${EXOMISER_FULL_NODE} --mem 350G --time 12:00:00 --chdir /data/bi/pipelines/exomiser/exomiser-cli-13.0.0 --output logs/EXOMISER.log --job-name EXOMISER java -Xms300g -Xmx300g -jar exomiser-cli-13.0.0.jar --analysis ${scratch_dir}/exomiser_configfile.yml &" > _04_exomiser_ALL.sh
echo "java -Xms300g -Xmx300g -jar exomiser-cli-13.0.0.jar --analysis ${scratch_dir}/exomiser_configfile.yml; rm /tmp/spring.log" > aux1_04_exomiser_ALL.sh
echo "srun --partition short_idx --mem 350G --time 12:00:00 --chdir /data/bi/pipelines/exomiser/exomiser-cli-13.0.0 --output logs/EXOMISER.log --job-name EXOMISER bash ${scratch_dir}/aux1_04_exomiser_ALL.sh &" > _04_exomiser_ALL.sh

## 8. Running exomiser_exome

Expand All @@ -93,7 +91,8 @@ sed -i "s|PROBAND|${proband}|g" ./exomiser_configfile_exome.yml
sed -i "s|BED_FILE|${bed_file}|g" ./exomiser_configfile_exome.yml
sed -i "s|OUTPUT_FOLDER|${output_folder}|g" ./exomiser_configfile_exome.yml

echo "srun --partition short_idx --nodelist ${EXOMISER_EXOME_NODE} --mem 350G --time 12:00:00 --chdir /data/bi/pipelines/exomiser/exomiser-cli-13.0.0 --output logs/EXOMISER_exome.log --job-name EXOMISER java -Xms300g -Xmx300g -jar exomiser-cli-13.0.0.jar --analysis ${scratch_dir}/exomiser_configfile_exome.yml &" >> _04_exomiser_ALL.sh
echo "java -Xms300g -Xmx300g -jar exomiser-cli-13.0.0.jar --analysis ${scratch_dir}/exomiser_configfile_exome.yml; rm /tmp/spring.log" > aux2_04_exomiser_exome.sh
echo "srun --partition short_idx --mem 350G --time 12:00:00 --chdir /data/bi/pipelines/exomiser/exomiser-cli-13.0.0 --output logs/EXOMISER_exome.log --job-name EXOMISER bash ${scratch_dir}/aux2_04_exomiser_exome.sh &" >> _04_exomiser_ALL.sh

## 9. Running exomiser_genes

Expand All @@ -109,23 +108,16 @@ sed -i "s|PROBAND|${proband}|g" ./exomiser_configfile_genes.yml
sed -i "s|BED_FILE|${bed_file}|g" ./exomiser_configfile_genes.yml
sed -i "s|OUTPUT_FOLDER|${output_folder}|g" ./exomiser_configfile_genes.yml

echo "srun --partition short_idx --nodelist ${EXOMISER_GENES_NODE} --mem 350G --time 12:00:00 --chdir /data/bi/pipelines/exomiser/exomiser-cli-13.0.0 --output logs/EXOMISER_genes.log --job-name EXOMISER java -Xms300g -Xmx300g -jar exomiser-cli-13.0.0.jar --analysis ${scratch_dir}/exomiser_configfile_genes.yml &" >> _04_exomiser_ALL.sh
echo "java -Xms300g -Xmx300g -jar exomiser-cli-13.0.0.jar --analysis ${scratch_dir}/exomiser_configfile_genes.yml; rm /tmp/spring.log" > aux3_04_exomiser_genes.sh
echo "srun --partition short_idx --mem 350G --time 12:00:00 --chdir /data/bi/pipelines/exomiser/exomiser-cli-13.0.0 --output logs/EXOMISER_genes.log --job-name EXOMISER bash ${scratch_dir}/aux3_04_exomiser_genes.sh &" >> _04_exomiser_ALL.sh

#--------------------------------------------------------------------------------------------------------

## 9.1 Exomiser leaves some ugly spring.log that must be deleted for other users to run exomizer
## so we do that here

echo "srun --chdir /tmp --partition short_idx --nodelist ${EXOMISER_FULL_NODE} rm spring.log &" > _05_filter_heritance_ALL.sh
echo "srun --chdir /tmp --partition short_idx --nodelist ${EXOMISER_EXOME_NODE} rm spring.log &" >> _05_filter_heritance_ALL.sh
echo "srun --chdir /tmp --partition short_idx --nodelist ${EXOMISER_GENES_NODE} rm spring.log &" >> _05_filter_heritance_ALL.sh


#10. Lablog to modify the output reported by exomiser and create a final file with a personalized format. For each exomiser analysis (whole genome, exome, genes)

# Grep variant id for each inheritance model

cat inheritance_types.txt | xargs -I % echo "grep 'PASS' ./exomiser/exomiser/exomiser_%.variants.tsv | awk '{print \$1\"_\"\$2\"_\"\$3\"_\"\$4}' > ./filter_heritance/filter_heritance/id_%.txt " >> _05_filter_heritance_ALL.sh
cat inheritance_types.txt | xargs -I % echo "grep 'PASS' ./exomiser/exomiser/exomiser_%.variants.tsv | awk '{print \$1\"_\"\$2\"_\"\$3\"_\"\$4}' > ./filter_heritance/filter_heritance/id_%.txt " > _05_filter_heritance_ALL.sh
cat inheritance_types.txt | xargs -I % echo "grep 'PASS' ./exomiser/exomiser_genes/exomiser_genes_%.variants.tsv | awk '{print \$1\"_\"\$2\"_\"\$3\"_\"\$4}' > ./filter_heritance/filter_heritance_genes/id_%_genes.txt " >> _05_filter_heritance_ALL.sh
cat inheritance_types.txt | xargs -I % echo "grep 'PASS' ./exomiser/exomiser_exome/exomiser_exome_%.variants.tsv | awk '{print \$1\"_\"\$2\"_\"\$3\"_\"\$4}' > ./filter_heritance/filter_heritance_exome/id_%_exome.txt " >> _05_filter_heritance_ALL.sh

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# module load Nextflow/22.10.1 singularity

ln -s ../00-reads/ .
ln -s ../samples_id.txt .
Expand Down Expand Up @@ -28,7 +29,6 @@ echo -e "patient,sex,status,sample,lane,fastq_1,fastq_2" > samplesheet.csv
cat samples_id.txt | xargs -I % echo -e "%,XY,0,%,1,00-reads/%_R1.fastq.gz,00-reads/%_R2.fastq.gz" >> samplesheet.csv
mkdir -p 02-postprocessing 03-annotation 99-stats

#module load Nextflow singularity

scratch_dir=$(echo $PWD | sed "s/\/data\/bi\/scratch_tmp/\/scratch/g")

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
mkdir 00-reads
ls ../RAW/*.gz | cut -d "/" -f3 | cut -d "_" -f 1 | sort -u | grep -v "md5" > samples_id.txt
mkdir -p 00-reads
mkdir -p $(date '+%Y%m%d')_ANALYSIS01_GENOME
mv ANALYSIS01_GENOME $(date '+%Y%m%d')_ANALYSIS01_GENOME
cd 00-reads; cat ../samples_id.txt | xargs -I % echo "ln -s ../../RAW/%_*R1*.fastq.gz %_R1.fastq.gz" | bash; cd -
cd 00-reads; cat ../samples_id.txt | xargs -I % echo "ln -s ../../RAW/%_*R2*.fastq.gz %_R2.fastq.gz" | bash; cd -
Loading