icbi-lab / NeoFuse

NeoFuse is a user-friendly pipeline for the prediction of fusion neoantigens from tumor RNA-seq data.
GNU General Public License v3.0
17 stars 9 forks source link

Questions with STAR index buliding #19

Closed bobojin46 closed 9 months ago

bobojin46 commented 9 months ago

Hi, I am trying to run neofuse and I am having trouble with building STAR index. So I was wondering if you could help me with this.

Firstly, I have pulled the icbi/neofuse image successfully and then I mount my local directory to the /mnt/out using "docker run -t -i -v /home/bobojin/genomics/04neofuse:/mnt/out icbi/neofuse"

After entering the docker, the attempt to use "NeoFuse -R -o ./reference -V GRCh38 --docker" recieve no responce. Then I copy a STAR index created previously (maybe different version of STAR from NeoFuse) and run the NeoFuse command but got error.

command "NeoFuse -o ./output/ -1 Patient02_T_RNA_1.fq.gz -2 Patient02_T_RNA_2.fq.gz -s ./GRCh38_index/ -g ./GRCh38_index/Homo_sapiens.GRCh38.dna.primary_assembly.fa -a ./GRCh38_index/Homo_sapiens.GRCh38.107.gtf -m 8 -M 11 --docker -C 02hla.txt"

error `[02:28:35] Paired End (PE) Reads detected: commencing processing [02:28:35] Processing files Patient02_T_RNA_1.fq.gz - Patient02_T_RNA_2.fq.gz [02:28:35] STAR Run started [02:28:35] Arriba Run started

EXITING: FATAL INPUT ERROR: unrecognized parameter name "genomeType" in input "genomeParameters.txt" SOLUTION: use correct parameter name (check the manual)

Dec 07 02:28:35 ...... FATAL ERROR, exiting`

It may caused by different STAR version. So I think I can't just skip the index building step in the tutorial.

And it would be great if you can also tell me what should be put after -C parameter, (I have run Optitype Previously and got the result of HLA typing).02hla.txt Is this format ok?

abyssum commented 9 months ago

Hello @bobojin46 ,

First of all, thank you for using NeoFuse. As a side note, we are currently migrating NeoFuse to nextflow DSL2 and there will be an official release in the next few months (with updated STAR versions and MHC II support). In case you are interested, I will update the NeoFuse repo with information and the corresponding link as soon as the pipeline is released.

Now, for your questions, the error you are getting is most probably due to the different STAR versions.

Use-case 1: default way to build NeoFuse indexes NeoFuse should build the appropriate index with the following command (you don't need to launch the image, mount the paths, etc. and the same goes for the rest of the commands as NeoFuse does that automatically):

$ /path/to/NeoFuse -R -o </path/to/output_folder> -n [cores] -V [genome version] --docker

Use-case 2: build NeoFuse index from within the Docker image If for some reason you need to first launch the image in order to build the index, then you should do so with the following commands:

$ docker run -it -v /home/bobojin/genomics/04neofuse:/mnt/out_icbi/neofuse

(in general, try not to use white-spaces in the paths, instead opt for underscores as shown above)

$ NeoFuse-download -o /mnt/out_icbi/neofuse` -t [cores]  -v [genome version] 

(the above command will build the STAR index under /mnt/out_icbi/neofuse if you want the index to be built in a different /dir make sure to first mount it and then use the appropriate path)

Use-case 3: build custom NeoFuse index from within the Docker image (not tested) By default, NeoFuse will build an index for GENECODE's GRCh38 v21 release. If you want to build a custom STAR index (different version, etc.), you can do so by running the following commands:

$ docker run -it -v /home/bobojin/genomics/04neofuse:/mnt/out_icbi/neofuse
STAR --runMode genomeGenerate --runThreadN [cores] --genomeDir /mnt/out_icbi/neofuse \
    --genomeFastaFiles /path/to/genome.fa" \
    --sjdbGTFfile /path/to/annotation.gtf

(the above command will build the STAR index under /mnt/out_icbi/neofuse if you want the index to be built in a different /dir make sure to first mount it and then use the appropriate path)

As for the HLA file, it looks fine.

Let me know if that helps.

bobojin46 commented 9 months ago

It works! Thank you for you explanation! But I got another error An error occured while filtering the final output files, check /mnt/out/output/ocker/LOGS/ocker.final.log for more details .

The detailed error is usage: filter.py [-h] -i {/path/to/tmp/input/} -o {/path/to/output/} -t {affinity threshold} -T {rank threshold} -c {confidence level}) filter.py: error: argument -t/--AffinityThreshold: expected one argument

So can you tell me where is the filter.py path , so I can rerun this step. In /mnt/out directory, it shows python: can't open file 'filter.py': [Errno 2] No such file or directory

And also, I have decided -C paremeter with a txt involving HLA typing messages. But It turned out the pipeline still ran optitype.

abyssum commented 9 months ago

This is a weird behavior and I have never encountered before. The first error usage: filter.py [-h] -i {/path/to/tmp/input/} -o {/path/to/output/} -t {affinity threshold} -T {rank threshold} -c {confidence level}) filter.py: error: argument -t/--AffinityThreshold: expected one argument shows that no binding affinity threshold was declared, which cannot be as NeoFuse uses 500 nM IC50 as threshold by default (if the user does not specify otherwise).

Then the second error, on the other hand python: can't open file 'filter.py': [Errno 2] No such file or directory shows that the script filter.py was not found, which is by default installed under /usr/local/bin/source/ in the docker (and the pipeline should find it automatically).

Finally, the fact that NeoFuse performed HLA typing while you provided a custom HLA file means that the -C flag was not read during runtime and the HLA prediction step was set to "true", which again should not happen.

Just to clarify, did you first launch the NeoFuse image and then run the command from within the container or did you call NeoFuse from the command line directly? Since NeoFuse is designed to run as a command line tool, running the commands from within the docker image environment will cause erroneous results (in the manual it is specified that all the commands should be ran from the command line and not from the docker environment). If the first case is true, then try running the following command without launching the image:

/path/to/NeoFuse -1 Patient02_T_RNA_1.fq.gz -2 Patient02_T_RNA_2.fq.gz -s ./GRCh38_index/ -g ./GRCh38_index/Homo_sapiens.GRCh38.dna.primary_assembly.fa -a ./GRCh38_index/Homo_sapiens.GRCh38.107.gtf -m 8 -M 11 -C 02hla.txt -o ./output/ --docker

(make sure that all the paths are correct) Otherwise, all the executable scripts can be found under /usr/local/bin/source/ in the docker image.

bobojin46 commented 9 months ago

Yes, I first launch the NeoFuse image and then run the command within the container. So I have tried to use command directly but got permission denied error just like issue #17.

I am running at a cluster node as a user.

error

Then I tried to run the above command adding sudo, but still got permission denied. Then I use su root to run the command as a root user but got the same error.

And this is the permission of this directory.

permission

We have no bioinformatics core I can turn to, but I can log in as root user. So could you please tell me what can I do or any keywords to search on Google to solve that. Thanks agian!

bobojin46 commented 9 months ago

Also the permission error is gone when run docker run -it -u root -v /home/bobojin/genomics/04neofuse:/mnt/out icbi/neofuse first.

root
abyssum commented 9 months ago

Can you paste the output from the following cmds?

sudo docker run -it -v /home/bobojin/genomics/04neofuse:/mnt/out icbi/neofuse
cd /mnt/out
mkdir test
ls -la

And also check which Docker version you are running on your machine. $ docker version

I have tried to reproduce the error on two separate machines (Debian and Ubuntu OS) with docker versions v23.0.3 and v24.0.7 respectively but both $ sudo NeoFuse <cmd>and $ su sudo worked with no issues. If this is not a Docker version issue, I suspect that this error has to do with the settings of your cluster.

I will try to find a workaround but for now I can only suggest:

  1. Installing singularity (as you have sudo permissions) and running NeoFuse with the --singularity flag (as stated in #17 ).
  2. Modifying the NeoFuse executable on lines https://github.com/icbi-lab/NeoFuse/blob/08b43b51fc3666ffcd49d03fa642afc8bd7e8169/NeoFuse#L367-L369 by adding docker run --rm -u root. I have not tested this so I would not know if this resolves your issue.

Try it and let me know how it goes.

bobojin46 commented 9 months ago

I have tried the following cmds , but "mkdir test" still got permission denied. And My docker version is v24.0.5.

I haven't used singularity Because modifying the NeoFuse executable seems works for now and I am waiting for the result. Thank you so much for your early and helpful responce. Really appreciate it!

abyssum commented 9 months ago

I am glad it worked out for you.

I am closing the issue for now, feel free to open it again if something comes up.