Skip to content

Commit

Permalink
Include sample accession in submission.
Browse files Browse the repository at this point in the history
  • Loading branch information
davidyuyuan committed Feb 21, 2022
1 parent 8c518cd commit 9b6173e
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions nanopore_nextflow.nf
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,15 @@ process map_to_reference {
container 'davidyuyuan/ena-sars-cov2-nanopore:1.0'

input:
tuple val(run_accession), file(input_file)
tuple val(run_accession), val(sample_accession), file(input_file)
path(sars2_fasta)
path(sars2_fasta_fai)
path(projects_accounts_csv)
val(study_accession)

output:
val(run_accession)
val(sample_accession)
file("${run_accession}_output.tar.gz")
file("${run_accession}_filtered.vcf.gz")
file("${run_accession}_consensus.fasta.gz")
Expand Down Expand Up @@ -91,6 +92,7 @@ process ena_analysis_submit {

input:
val(run_accession)
val(sample_accession)
file(output_tgz)
file(filtered_vcf_gz)
file(consensus_fasta_gz)
Expand All @@ -112,13 +114,13 @@ process ena_analysis_submit {
mkdir -p ${run_accession}_output/${study_accession}
cp nextflow-bin/config.yaml ${run_accession}_output/${study_accession}
if [ "${study_accession}" = 'PRJEB45555' ]; then
analysis_submission.py -t -o ${run_accession}_output/${study_accession} -p PRJEB43947 -r ${run_accession} -f ${output_tgz} -a PATHOGEN_ANALYSIS -au \${webin_id} -ap \${webin_password}
analysis_submission.py -t -o ${run_accession}_output/${study_accession} -p PRJEB45554 -r ${run_accession} -f ${filtered_vcf_gz} -a COVID19_FILTERED_VCF -au \${webin_id} -ap \${webin_password}
analysis_submission.py -t -o ${run_accession}_output/${study_accession} -p PRJEB45619 -r ${run_accession} -f ${consensus_fasta_gz} -a COVID19_CONSENSUS -au \${webin_id} -ap \${webin_password}
analysis_submission.py -t -o ${run_accession}_output/${study_accession} -p PRJEB43947 -s ${sample_accession} -r ${run_accession} -f ${output_tgz} -a PATHOGEN_ANALYSIS -au \${webin_id} -ap \${webin_password}
analysis_submission.py -t -o ${run_accession}_output/${study_accession} -p PRJEB45554 -s ${sample_accession} -r ${run_accession} -f ${filtered_vcf_gz} -a COVID19_FILTERED_VCF -au \${webin_id} -ap \${webin_password}
analysis_submission.py -t -o ${run_accession}_output/${study_accession} -p PRJEB45619 -s ${sample_accession} -r ${run_accession} -f ${consensus_fasta_gz} -a COVID19_CONSENSUS -au \${webin_id} -ap \${webin_password}
else
analysis_submission.py -t -o ${run_accession}_output/${study_accession} -p ${study_accession} -r ${run_accession} -f ${output_tgz} -a PATHOGEN_ANALYSIS -au \${webin_id} -ap \${webin_password}
analysis_submission.py -t -o ${run_accession}_output/${study_accession} -p ${study_accession} -r ${run_accession} -f ${filtered_vcf_gz} -a COVID19_FILTERED_VCF -au \${webin_id} -ap \${webin_password}
analysis_submission.py -t -o ${run_accession}_output/${study_accession} -p ${study_accession} -r ${run_accession} -f ${consensus_fasta_gz} -a COVID19_CONSENSUS -au \${webin_id} -ap \${webin_password}
analysis_submission.py -t -o ${run_accession}_output/${study_accession} -p ${study_accession} -s ${sample_accession} -r ${run_accession} -f ${output_tgz} -a PATHOGEN_ANALYSIS -au \${webin_id} -ap \${webin_password}
analysis_submission.py -t -o ${run_accession}_output/${study_accession} -p ${study_accession} -s ${sample_accession} -r ${run_accession} -f ${filtered_vcf_gz} -a COVID19_FILTERED_VCF -au \${webin_id} -ap \${webin_password}
analysis_submission.py -t -o ${run_accession}_output/${study_accession} -p ${study_accession} -s ${sample_accession} -r ${run_accession} -f ${consensus_fasta_gz} -a COVID19_CONSENSUS -au \${webin_id} -ap \${webin_password}
fi
mv ${output_tgz} ${filtered_vcf_gz} ${consensus_fasta_gz} ${run_accession}_output/${study_accession}
"""
Expand All @@ -132,7 +134,7 @@ workflow {
data = Channel
.fromPath(params.INDEX)
.splitCsv(header:true, sep:'\t')
.map{ row-> tuple(row.run_accession, 'ftp://' + row.fastq_ftp) }
.map{ row-> tuple(row.run_accession, row.sample_accession, 'ftp://' + row.fastq_ftp) }

map_to_reference(data, params.SARS2_FA, params.SARS2_FA_FAI, params.SECRETS, params.STUDY)
ena_analysis_submit(map_to_reference.out, params.SECRETS, params.STUDY)
Expand Down

0 comments on commit 9b6173e

Please sign in to comment.