lanadelrea / Katmon

Pipeline for detecting coinfection of SARS-CoV-2 variants.
3 stars 3 forks source link

Problem with concat #4

Closed josephhughes closed 5 months ago

josephhughes commented 5 months ago

It doesn't seem to find the files to concatenate:

nextflow run CoPi --in_dir Samples --outdir Results

OUTPUT

N E X T F L O W  ~  version 23.04.0
Launching `CoPi/main.nf` [compassionate_avogadro] DSL2 - revision: 9a59f5b6be
executor >  local (7)
executor >  local (7)
[4a/ca6e2f] process > concat (Concatenating fasta files into all_sequences.fasta)                              [100%] 1 of 1, failed: 1 ✘
[-        ] process > pangolin                                                                                 -
[-        ] process > nextclade                                                                                -
[-        ] process > lineage_assignment                                                                       -
[-        ] process > bammix                                                                                   -
[-        ] process > bam_filter                                                                               -
[a5/106bd9] process > virstrain (Identifying lineage assignment for barcode08 using Virstrain)                 [100%] 1 of 1, failed: 1
[-        ] process > freyja (Identifying relative lineage abundances of samples to see potential coinfection) -
[-        ] process > freyja_demix                                                                             -
[-        ] process > freyja_aggregate                                                                         -
[-        ] process > freyja_plot                                                                              -
[-        ] process > makevcf                                                                                  -
[-        ] process > bammixplot                                                                               -
[-        ] process > aafplot_mutations                                                                        -
[-        ] process > aafplot_amplicons                                                                        -
[-        ] process > ampliconsorting_DeltaReads                                                               -
[-        ] process > ampliconsorting_OmicronReads                                                             -
[-        ] process > ampliconsorting_samtools                                                                 -
[-        ] process > ampliconsorting_bgzip                                                                    -
[-        ] process > ampliconsorting_fasta                                                                    -
[-        ] process > ampliconsorting_lineageAssignment_Pangolin                                               -
[-        ] process > ampliconsorting_lineageAssignment_Nextclade                                              -
[-        ] process > report                                                                                   -
WARN: Access to undefined parameter `out_dir` -- Initialise it to a default value eg. `params.out_dir = some_value`
ERROR ~ Error executing process > 'concat (Concatenating fasta files into all_sequences.fasta)'

Caused by:
  Process `concat (Concatenating fasta files into all_sequences.fasta)` terminated with an error exit status (1)

Command executed:

  cat Samples/*.fasta > all_sequences.fasta

Command exit status:
  1

Command output:
  (empty)

Command error:
  cat: 'Samples/*.fasta': No such file or directory

Work dir:
  /home1/jh212a/test_adel/work/4a/ca6e2f7adc1b5a2aa17f3e2e2ef066

Tip: you can try to figure out what's wrong by changing to the process work dir and showing the script file named `.command.sh`

 -- Check '.nextflow.log' file for details

There are fasta files in the directory: ls Samples/

OUTPUT:

barcode07.bam barcode07.bam.bai barcode07.fasta barcode07.fastq barcode08.bam barcode08.bam.bai barcode08.fasta barcode08.fastq barcode09.bam barcode09.bam.bai barcode09.fasta barcode09.fastq

josephhughes commented 5 months ago

It worked with the complete path. I suggest you modify your readme to make it clear to the user that they must use the fullpath of the input and output directory, in my case:

nextflow run CoPi --in_dir /home1/jh212a/test_adel/Samples --outdir /home1/jh212a/test_adel/Results

abulenciamiguel commented 5 months ago

Got the same error. @josephhughes' suggestion is safer but you can still use the relative path using this command instead cat ${PWD}/${params.in_dir}/*.fasta > all_sequences.fasta on line17

lanadelrea commented 5 months ago

Hi @josephhughes and @abulenciamiguel, I edited the line cat ${PWD}/${params.in_dir}/*.fasta > all_sequences.fasta as suggested to account for relative path.