Skip to content

Commit

Permalink
Import accession using the original file list
Browse files Browse the repository at this point in the history
  • Loading branch information
tcezard committed Oct 26, 2023
1 parent 3d03aa4 commit f771b22
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
13 changes: 9 additions & 4 deletions eva_submission/nextflow/accession_and_load.nf
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,13 @@ workflow {
.map{row -> tuple(file(row.vcf_file), file(row.fasta), row.analysis_accession, row.db_name, row.vep_version, row.vep_cache_version, row.vep_species, row.aggregation)}
load_vcf(annotated_vcfs)

if (is_human_study) {
import_accession(sort_and_compress_vcf.out.compressed_vcf, load_vcf.out.variant_load_complete)
if (!is_human_study) {
vcf_files_dbname = Channel.fromPath(params.valid_vcfs)
.splitCsv(header:true)
.map{row -> tuple(file(row.vcf_file), row.db_name)}
// the vcf_files_dbname give the link between input file and compressed_vcf is to ensure the accessioning has
// been completed
import_accession(vcf_files_dbname, sort_and_compress_vcf.out.compressed_vcf, load_vcf.out.variant_load_complete)
}
}

Expand Down Expand Up @@ -176,7 +181,6 @@ process sort_and_compress_vcf {
path tmp_file

output:
// used by csi indexing process
path "*.gz", emit: compressed_vcf

"""
Expand Down Expand Up @@ -219,7 +223,7 @@ process csi_index_vcf {
"""
cd $params.public_dir
# remove the uncompressed accessioned vcf file
rm ${accessioned_vcfs.join(' ')}
rm -f ${accessioned_vcfs.join(' ')}
rsync -va * ${params.public_ftp_dir}/${params.project_accession}
ls -l ${params.public_ftp_dir}/${params.project_accession}/*
"""
Expand Down Expand Up @@ -296,6 +300,7 @@ process import_accession {

input:
tuple val(vcf_file), val(db_name)
path compressed_vcf
val variant_load_output

memory '5 GB'
Expand Down
3 changes: 2 additions & 1 deletion tests/nextflow-tests/run_tests_accession_and_variant_load.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ nextflow run ${SOURCE_DIR}/accession_and_load.nf -params-file test_ingestion_con
--public_dir ${SCRIPT_DIR}/project/public
# check for public files and logs
printf "\e[32m====== Files made public ======\e[0m\n"
ls project/public
for f in test1 test2 test3; do ls project/public/${f}.accessioned.vcf.gz project/public/${f}.accessioned.vcf.gz.csi; done
ls project/public/ | wc -l
printf "\n\e[32m======== Commands run ========\e[0m\n"
find work/ \( -name '*.out' -o -name '*.err' \) -exec cat {} \;

Expand Down

0 comments on commit f771b22

Please sign in to comment.