cgroza / GraffiTE

GraffiTE is a pipeline that finds polymorphic transposable elements in genome assemblies and/or long reads, and genotypes the discovered polymorphisms in read sets using genome-graphs.
Other
121 stars 6 forks source link

GraffiTE exiting at minimap due to "Unknown option: --no-home" #26

Closed jamesdgalbraith closed 3 months ago

jamesdgalbraith commented 6 months ago

I've been trying to run GraffiTE on a cluster and am having it fail at the alignment step. Do you have any pointers on how I can getting it running? I'm not sure if this is a bug with Nextflow/Singularity or with GraffiTE.

Here's the command I've used with the test data, and the log output below

nextflow run /ceph/users/jgalbraith/Programs/GraffiTE/main.nf \
   --reference hs37d5.chr22.fa --assemblies assemblies.csv --reads reads.csv --TE_library human_DFAM3.6.fasta \
   --cores 40 -with-singularity /ceph/users/jgalbraith/Programs/GraffiTE/graffite_latest.sif
N E X T F L O W  ~  version 23.10.1
Launching `/ceph/users/jgalbraith/Programs/GraffiTE/main.nf` [fabulous_mccarthy] DSL2 - revision: 20270181eb

▄████  ██▀███   ▄▄▄        █████▒ █████▒██▓▄▄▄█████▓▓█████
██▒ ▀█▒▓██ ▒ ██▒▒████▄    ▓██   ▒▓██           ██▒ ▓▒▓█   ▀
▒██░▄▄▄░▓██ ░▄█ ▒▒██  ▀█▄  ▒████ ░▒████ ░▒██▒▒ ▓██░ ▒░▒███
░▓█  ██▓▒██▀▀█▄  ░██▄▄▄▄██ ░▓█▒  ░░▓█▒  ░░██░░ ▓██▓ ░ ▒▓█  ▄
░▒▓███▀▒░██▓ ▒██▒  █   ▓██▒░▒█░   ░▒█░   ░██░  ▒██▒ ░ ░▒████▒
░▒   ▒ ░ ▒▓ ░▒▓░ ▒▒   ▓▒█░ ▒ ░    ▒ ░   ░▓    ▒ ░░   ░░ ▒░ ░
░   ░   ░▒ ░ ▒░  ▒   ▒▒ ░ ░      ░      ▒ ░    ░     ░ ░  ░
░ ░   ░   ░░   ░   ░   ▒    ░ ░    ░ ░    ▒ ░  ░         ░
░    ░           ░  ░               ░              ░  ░

V . null

Find and Genotype Transposable Elements Insertion Polymorphisms
in Genome Assemblies using a Pangenomic Approach

Authors: Cristian Groza and Clément Goubert
Bug/issues: https://github.com/cgroza/GraffiTE/issues

[-        ] process > map_asm        -
[-        ] process > svim_asm       -
[-        ] process > survivor_merge -
[-        ] process > repeatmask_VCF -
[-        ] process > tsd_prep       -
[-        ] process > tsd_search     -
[-        ] process > tsd_report     -
[-        ] process > pangenie       -
[-        ] process > merge_VCFs     -

executor >  local (1)
[ef/f8e87c] process > map_asm (1)    [  0%] 0 of 1
[-        ] process > svim_asm       -
[-        ] process > survivor_merge -
[-        ] process > repeatmask_VCF -
[-        ] process > tsd_prep       -
[-        ] process > tsd_search     -
[-        ] process > tsd_report     -
[-        ] process > pangenie       -
[-        ] process > merge_VCFs     -

executor >  local (1)
[ef/f8e87c] process > map_asm (1)    [  0%] 0 of 1
[-        ] process > svim_asm       -
[-        ] process > survivor_merge -
[-        ] process > repeatmask_VCF -
[-        ] process > tsd_prep       -
[-        ] process > tsd_search     -
[-        ] process > tsd_report     -
[-        ] process > pangenie       -
[-        ] process > merge_VCFs     -
ERROR ~ Error executing process > 'map_asm (1)'

Caused by:
  Process `map_asm (1)` terminated with an error exit status (1)

Command executed:

  minimap2 -a -x asm5 --cs -r2k -t 40 -K 500M hs37d5.chr22.fa HG002.mat.cur.20211005_chr22.fasta.gz | samtools sort -m4G -@4 -o asm.sorted.bam -

Command exit status:
  1

Command output:
  (B

Command error:
  ERROR: Unknown option: --no-home
  (B

Work dir:
  /ceph/users/jgalbraith/Programs/GraffiTE/test/GraffiTE_testset/work/ef/f8e87c34a7cc24ce498d825f4b43f8

Tip: you can replicate the issue by changing to the process work dir and entering the command `bash .command.run`

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

executor >  local (1)
[ef/f8e87c] process > map_asm (1)    [100%] 1 of 1, failed: 1 ✘
[-        ] process > svim_asm       -
[-        ] process > survivor_merge -
[-        ] process > repeatmask_VCF -
[-        ] process > tsd_prep       -
[-        ] process > tsd_search     -
[-        ] process > tsd_report     -
[-        ] process > pangenie       -
[-        ] process > merge_VCFs     -
ERROR ~ Error executing process > 'map_asm (1)'

Caused by:
  Process `map_asm (1)` terminated with an error exit status (1)

Command executed:

  minimap2 -a -x asm5 --cs -r2k -t 40 -K 500M hs37d5.chr22.fa HG002.mat.cur.20211005_chr22.fasta.gz | samtools sort -m4G -@4 -o asm.sorted.bam -

Command exit status:
  1

Command output:
  (B

Command error:
  ERROR: Unknown option: --no-home
  (B

Work dir:
  /ceph/users/jgalbraith/Programs/GraffiTE/test/GraffiTE_testset/work/ef/f8e87c34a7cc24ce498d825f4b43f8

Tip: you can replicate the issue by changing to the process work dir and entering the command `bash .command.run`

 -- Check '.nextflow.log' file for details
clemgoub commented 6 months ago

Hello,

I'm sorry you are encountering an issue with GraffiTE. This looks unusual... It looks like the --no-home argument stems from Singularity. I have the feeling that the --no-home option is somehow passed to the minimap2 command. I would like to hear what @cgroza thinks about it however, If you have the possibility to discuss with your system admin whether this could be due to a specific configuration of Singularity on your cluster, and maybe be turned off that would be worth a try.

Maybe you can also check what version of Singularity you are using, and perhaps check if you could upgrade to Apptainer (maybe you already are on Apptainer).

Let's see what Cristian says =)

Cheers,

Clément

cgroza commented 6 months ago

Hi

The argument is not being passed to minimap2. It's nextflow trying to invoke singularity with that parameter and getting an error. You might need to check your singularity version or installation.

-------- Original Message -------- On 5/8/24 12:31 PM, Clément Goubert wrote:

Hello,

I'm sorry you are encountering an issue with GraffiTE. This looks unusual... It looks like the --no-home argument stems from Singularity. I have the feeling that the --no-home option is somehow passed to the minimap2 command. I would like to hear what @.***(https://github.com/cgroza) thinks about it however, If you have the possibility to discuss with your system admin whether this could be due to a specific configuration of Singularity on your cluster, and maybe be turned off that would be worth a try.

Maybe you can also check what version of Singularity you are using, and perhaps check if you could upgrade to Apptainer (maybe you already are on Apptainer).

Let's see what Cristian says =)

Cheers,

Clément

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

jamesdgalbraith commented 6 months ago

Thanks guys, I had to install Singulariy using conda as the server doesn't have it installed on it at present, so I think the version may be the issue. I'll try a fresh conda environment with Apptainer instead of Singularity and see if that works. Just in case that doesn't work, is there is a version of the main.nf workflow as a bash script hiding somewhere?

clemgoub commented 6 months ago

Yes, indeed I feel that this could be the issue. Let us know if it works with Appatainer. You may want to look how to avoid this --no-home parameter to be passed by default. I am not savvy on using Apptainer/Singularity through conda; if you have a chance to see with a system admin if it can be installed directly, that may be better.

Unfortunately, there is no other version of the workflow than the code present in the main.nf however, you can look into the code how each step (each process) calls the dependencies with bash commands. Some dependencies are either installed in the Apptainer/Singularity image, or are present in the bin/ folder. Let us know of course if you have any question!

Cheers,

Clément

jamesdgalbraith commented 6 months ago

Hi again, Thanks for getting back so fast. With a new conda environment with only nextflow and apptainer installed into it I manage to successfully run the test data through, but my own data is now getting at a later step.

I'm now calling the script with the following command:

nextflow run /ceph/users/jgalbraith/Programs/GraffiTE/main.nf \
   --TE_library ${TE_LIBRARY} \
   --reference ${GENOME} --make_graph_time "12h"\
   --graph_method graphaligner \
   --longreads GraffiTE_reads.csv \
   --reads GraffiTE_reads.csv \
   --cores 40 -with-singularity /ceph/users/jgalbraith/Programs/GraffiTE/graffite_latest.sif

I added the --make_graph_time "12h", as without it make_graph failed early on with the error

WARN: Access to undefined parameter `make_graph_time` -- Initialise it to a default value eg. `params.make_graph_time = some_value`

I've followed the instructions about ammending the a writable location to the nextflow.config file (i.e. changed the runOptions line to singularity.runOptions = '--contain --bind /scratch/jgalbraith/tmp:/tmp')

All the stages from map_longreads through to tsd_report completed successfully. Here's the section of the log where it's failing now:

May-09 17:48:52.137 [Task monitor] ERROR nextflow.processor.TaskProcessor - Error executing process > 'make_graph (1)'

Caused by:
  Process `make_graph (1)` terminated with an error exit status (255)

Command executed:

  bcftools sort -Oz -o sorted.vcf.gz pangenome.vcf
  tabix sorted.vcf.gz
  mkdir index

      export TMPDIR=/scratch/jgalbraith/GraffiTE
      vg construct -a  -r male.ragtag.scaffold.fasta -v pangenome.vcf -m 1024 > index/index.vg

  vg snarls index/index.vg > index/index.pb

Command exit status:
  255

Command output:
  (empty)

Command error:
  INFO:    Environment variable SINGULARITYENV_TMP is set, but APPTAINERENV_TMP is preferred
  INFO:    Environment variable SINGULARITYENV_TMPDIR is set, but APPTAINERENV_TMPDIR is preferred
  INFO:    Environment variable SINGULARITYENV_NXF_TASK_WORKDIR is set, but APPTAINERENV_NXF_TASK_WORKDIR is preferred
  INFO:    squashfuse not found, will not be able to mount SIF or other squashfs files
  INFO:    fuse2fs not found, will not be able to mount EXT3 filesystems
  INFO:    gocryptfs not found, will not be able to use gocryptfs
  INFO:    Converting SIF file to temporary sandbox...
  mkdtemp(/scratch/261089.1.main.q/bcftools.WR6TOr) failed: No such file or directory
  INFO:    Cleaning up image...

Work dir:
  /scratch/jgalbraith/GraffiTE/work/8f/1750dcd855bb8c2b75cc36254200bd

I believe it's this command which is causing it to stop: mkdtemp(/scratch/261089.1.main.q/bcftools.WR6TOr) failed: No such file or directory, as I don't have write access to /scratch/, only the daughter directory /scratch/jgalbraith/.

Thanks again, James.

cgroza commented 6 months ago

Seems that bcftools is picking up an environmental variable, and trying to use that as a temporary directory inside the container where it's not mounted. Try adding --cleanenv after --contain in the nextflow.config.

clemgoub commented 6 months ago

Hello @jamesdgalbraith,

Just checking in if you had solve your issue?

Cheers,

Clément

jamesdgalbraith commented 6 months ago

Hi Clément,

Sorry for the delay in getting back to you. I managed to get around the first part of the issue by moving the setting of the temporary directory (export TMPDIR=$PWD) in make_graph process of main.nf to occur before the bcftools sort -Oz -o sorted.vcf.gz ${vcf} command.

Unfortunately it's now getting stuck in the graph_align_reads process, with the error:

ERROR ~ Error executing process > 'graph_align_reads (1)'

Caused by:
  Process exceeded running time limit (12h)

Command executed:

  GraphAligner -t 40 -x vg -g index/index.vg -f m84140_231030_142528_s2.hifi_reads.default.fastq.gz -a germline.gam

  vg pack -x index/index.vg -g germline.gam -o germline.pack -Q 0

Command exit status:
  -

I haven't had time to get around to trying to bugfix until today, so I'll extend the params.graph_align_time in main.nf to 48 hours and see if it'll finish.

Thanks again,

James.

clemgoub commented 5 months ago

Hello James,

Thanks for your answer. Let me know if you are still stuck with it!

Cheers,

Clément

jamesdgalbraith commented 4 months ago

Hi Clement,

Sorry for the delay in communication. I managed to get that step to run by going into the temporary folder Singularity created in the work folder and running bash .command.run. I haven't since tried to resume the run as I realised that the data I was using likely wasn't suitable as it was pooled sequence data from 200 individuals rather than from a single individual.

Thankyou for all the help, and I'll let you know if I have any issues if I end up running it on more appropriate data.

Thanks, James.