SBIMB / StellarPGx

Calling star alleles in highly polymorphic pharmacogenes (e.g. CYP450 genes) by leveraging genome graph-based variant detection.
MIT License
29 stars 6 forks source link

Problems running #22

Closed anh151 closed 8 months ago

anh151 commented 1 year ago

Hello, I am using the latest version of StellarPGx.

I tried running using the latest version of nextflow using command nextflow run ./bin/StellarPGx/main.nf -profile standard --build b38 --gene cyp2d6 --in_bam 1004524.bam --out_dir stellarpgx_results I get the error below:

N E X T F L O W  ~  version 22.04.5
Launching `./bin/StellarPGx/main.nf` [gigantic_archimedes] DSL2 - revision: 89538b1502
Operator `into` has been deprecated -- it's not available in DSL2 syntax

 -- Check script 'bin/StellarPGx/main.nf' at line: 337 or see '.nextflow.log' file for more details

I tried downgrading to version 18.10.1 since the into operator is deprecated and that's the earliest version the installation page states the StellarPGx supports using the same command and I get the error below:

N E X T F L O W  ~  version 18.10.1
Launching `./bin/StellarPGx/main.nf` [prickly_montalcini] - revision: 89538b1502
ERROR ~ No signature of method: nextflow.Channel$_fromFilePairs0_closure6.call() is applicable for argument types: (sun.nio.fs.UnixPath) values: [/home/jupyter/workspaces/piii03variantfrequencyprojectpgxcontrolled/1004524.bam]
Possible solutions: any(), any(), each(groovy.lang.Closure), tap(groovy.lang.Closure), any(groovy.lang.Closure), each(groovy.lang.Closure)

 -- Check '.nextflow.log' file for details
ERROR ~ No such variable: ref_dir

 -- Check script 'main.nf' at line: 350 or see '.nextflow.log' file for more details

Also tried running the test for each version and I get the same errors as shown below:

N E X T F L O W  ~  version 22.04.5
Launching `main.nf` [focused_varahamihira] DSL2 - revision: 89538b1502
Operator `into` has been deprecated -- it's not available in DSL2 syntax

 -- Check script 'main.nf' at line: 337 or see '.nextflow.log' file for more details
N E X T F L O W  ~  version 18.10.1
Launching `main.nf` [wise_kilby] - revision: 89538b1502
ERROR ~ No such variable: ref_dir

 -- Check script 'main.nf' at line: 350 or see '.nextflow.log' file for more details
twesigomwedavid commented 1 year ago

@anh151 Thanks for raising this. You can use the latest version of StellarPGx -- just need to make sure that your DSL is set to version 1.

Add nextflow.enable.dsl=1 at the beginning of either your main.nf file or your configuration file

anh151 commented 1 year ago

Thanks for the quick response. Ignore my previous post I was running the wrong version. I am getting the error show below.

I was able to install Singularity, but I don't have root access on the system that I am using so I had to manually install it. I'm not too familiar with singularity, but it seems that in order to execute jobs properly there are certain privileges that I would need as a user and it doesn't seem like I have those privileges. Is this something that I can adjust on my end?

N E X T F L O W  ~  version 22.04.5
Launching `main.nf` [insane_hamilton] DSL1 - revision: 036040d1cf
executor >  local (2)
[-        ] process > call_snvs1      [  0%] 0 of 1
[61/4beb42] process > call_snvs2 (1)  [  0%] 0 of 1
executor >  local (2)
[-        ] process > call_snvs1      [  0%] 0 of 1
[61/4beb42] process > call_snvs2 (1)  [100%] 1 of 1, failed: 1 ✘
[7e/7acc63] process > call_sv_del (1) [  0%] 0 of 1
executor >  local (2)
[-        ] process > call_snvs1      [  0%] 0 of 1
[61/4beb42] process > call_snvs2 (1)  [100%] 1 of 1, failed: 1 ✘
[-        ] process > call_sv_del (1) -
[-        ] process > call_sv_dup     [  0%] 0 of 1
[-        ] process > get_depth       [  0%] 0 of 1
[-        ] process > format_snvs     -
[-        ] process > get_core_var    -
[-        ] process > analyse_1       -
[-        ] process > analyse_2       -
[-        ] process > analyse_3       -
[-        ] process > call_stars      -
Error executing process > 'call_snvs2 (1)'
Caused by:
  Process `call_snvs2 (1)` terminated with an error exit status (255)

Command executed:

  graphtyper genotype hg38/chr22_hg38.fasta --sam=SIM001.bam --sams_index=<(echo SIM001.bam.bai) --region=chr22:42126000-42
137500 --output=SIM001_var_2 -a --minimum_extract_score_over_homref=0
  bcftools concat SIM001_var_2/chr22/*.vcf.gz > SIM001_var_2/chr22/042126000-042137500.vcf
  bgzip -f SIM001_var_2/chr22/042126000-042137500.vcf
  tabix -f SIM001_var_2/chr22/042126000-042137500.vcf.gz

Command exit status:
  255Command output:
  (empty)

Command error:
  INFO:    Converting SIF file to temporary sandbox...
  FATAL:   while handling /home/jupyter/workspaces/piii03variantfrequencyprojectpgxcontrolled/bin/StellarPGx/containers/ste
llarpgx-dev.sif: while extracting image: root filesystem extraction failed: extract command failed: ERROR  : Failed to crea
te user namespace: not allowed to create user namespace
  : exit status 1
twesigomwedavid commented 1 year ago

@anh151, Are you working on a computer cluster? It would be better to ask your system admin to install Singularity.

If you're working on a PC, I would recommend you use Docker instead

anh151 commented 1 year ago

I am working on a cluster. I'll have to reach out to the admins then and get it installed properly. Thanks for the help.

anh151 commented 1 year ago

Hey @twesigomwedavid. Just following up on this issue. Admin support said they were able to replicate the issue, but that Singularity should be able to run rootless. https://docs.sylabs.io/guides/latest/admin-guide/user_namespace.html#user-namespace-requirements

My installation code is below. I did set the --without-suid option when installing, but still have the same errors. Is it possible to run StellarPGx rootless?

%%bash
mkdir temp bin
cd bin
git clone https://github.com/SBIMB/StellarPGx.git
cd ../temp
wget https://dl.google.com/go/go1.19.2.linux-amd64.tar.gz
tar -xzf go1.19.2.linux-amd64.tar.gz -C ~/packages/bin
echo 'export PATH=$PATH:/home/jupyter/packages/bin/go/bin' >> ~/.bashrc
source ~/.bashrc
git clone --recurse-submodules https://github.com/sylabs/singularity
cd singularity
git checkout --recurse-submodules v3.10.3
./mconfig --prefix=/home/jupyter/packages --without-seccomp --without-conmon --without-suid
cd builddir
make
make install
cd ..
cd ..
git clone https://github.com/plougher/squashfs-tools
# need to edit the Makefile of squashfstools to point to the right directory for installation
# no config file exists to install in a different path
# line 148 should read INSTALL_PREFIX = /home/jupyter/packages
lines_to_write = []
with open("temp/squashfs-tools/squashfs-tools/Makefile") as f:
    for i, line in enumerate(f, 1):
        if i == 148:
            lines_to_write.append("INSTALL_PREFIX = /home/jupyter/packages\n")
        else:
            lines_to_write.append(line)
with open("temp/squashfs-tools/squashfs-tools/Makefile", 'w') as f:
    for line in lines_to_write:
        f.write(line)
%%bash
cd temp/squashfs-tools/squashfs-tools
make
make install
%%bash
cd bin/StellarPGx
nextflow run -dsl1 main.nf -profile standard,test

Thanks, Andrew

twesigomwedavid commented 1 year ago

@anh151,

Yes, you should be able to run StellarPGx without root access. However, you need to have Singularity installed globally on your system.

I think the easiest solution to this is to ask the admin to install Singularity globally. That way, you and everyone else on your cluster can access it easily. The problem with the user environment installation that you've done is that I can't replicate it on our side.

It also looks like you're trying to incorporate the Go programming language and Squashfs which are not supported currently.

anh151 commented 1 year ago

Squashfs-tools and go are needed to run Singularity. They're not preinstalled so I had to install them manually.

The admins seem hesitant to install Singularity globally. Not sure why. I'll follow up with them again.

anh151 commented 8 months ago

No luck in getting this running in All of Us. I ended up rewriting the nextflow pipeline in Python to get around the environment restrictions.