Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mitoz is not working in different directory #176

Closed
asifratul opened this issue Dec 27, 2022 · 12 comments
Closed

Mitoz is not working in different directory #176

asifratul opened this issue Dec 27, 2022 · 12 comments
Labels
enhancement New feature or request

Comments

@asifratul
Copy link

MitoZ version?

3.4

How did you install MitoZ? (e.g. Docker, Udocker, Singularity, Conda-Pack, Conda, or source code)

conda-pack (cannot dockers are showing some issues)

Did you run a test after your installation, and was the test run okay?

yes. I make a test folder inside the home directory.
and it worked well. when I mount in another directory, the test dataset is not working.

The command you used?

source ~/mitoz3.4/bin/activate
cd /mnt/e/AsifAnalysis/mitoZ/test
mitoz all --fq1 test.1.fq.gz --fq2 test.2.fq.gz --outprefix ttt --clade Arthropoda --data_size_for_mt_assembly 0 --assembler megahit --requiring_taxa Arthropoda

Problem description

HI,

I am getting problem frequently. I install the conda-pack, as the dockers are not being installed in my ubuntu 18.02.5 (installed on windows). When I first ran the soft for test data, it work well in home directory. But when I change the directory to separate folder, it is giving errors.

I assume, there might be issues in different directory.
I then copy my fastq files in the test folder in home directory, but it is also giving same errors.
can you please let me know, what can I do?

Log messages from MitoZ (stdout and stderr)

mitoz.log

@asifratul
Copy link
Author

Seeming, spades assembler is working! anyway to fix the megahit issue?

mitoz.log

@linzhi2013
Copy link
Owner

Hi Asifratul,

About the Megahit, can you excute the command within the enviroment?

megahit  --out-dir ./megahit_out  --num-cpu-threads 8 --k-list 21,29,39,59,79,99,119,141 --memory 500000000000.0 -1 /mnt/e/AsifAnalysis/mitoZ/test/clean_data/ttt.clean_R1.fq.gz -2 /mnt/e/AsifAnalysis/mitoZ/test/clean_data/ttt.clean_R2.fq.gz  >megahit.log 2>megahit.err

and see what is in megahit.log and megahit.err.

@asifratul
Copy link
Author

Getting the same errors!

megahit.err.txt

@linzhi2013
Copy link
Owner

Getting the same errors!

megahit.err.txt

thanks!

Seems to be related to your file system. Similar problems have been raised on nmquijada/tormes#21 and voutcn/megahit#303 and https://groups.google.com/g/3d-genomics/c/UQLyV2nDISQ

On the third link, they suggest

It's possible that your environment is configured to use a different temp directory instead of "/tmp" so try to find it using "env |grep -i tmp" command. If you see an environment variable defined like TMPDIR (or something similar) then use "--tmp-dir $TMPDIR" instead of "--tmp-dir /tmp"

@asifratul
Copy link
Author

Hi @linzhi2013,

adding "--tmp-dir /tmp" within the maghit command works perfectly! Many thanks, much appreciated.
Is there any way to add this temp directory command within "mitoz all" command ?

ASIF

@linzhi2013
Copy link
Owner

linzhi2013 commented Dec 27, 2022

Hi ASIF,

that's great.

You can find the megahit commands in the assembly.py file:
image

    if resume:
        command = "megahit --continue --out-dir ./megahit_out "
        runcmd(command, logger=logger)
    else:
        if fq1 and fq2:
            command = "megahit " +\
                " --out-dir ./megahit_out "+\
                " --num-cpu-threads " + thread_number +\
                " --k-list " + kmers +\
                " --memory " + str(memory) +\
                " -1 " + fq1 +\
                " -2 " + fq2
        else:
            command = "megahit " +\
                " --out-dir ./megahit_out " +\
                " --num-cpu-threads " + thread_number +\
                " --k-list " + kmers +\
                " --memory " + str(memory) +\
                " --read " + fq1
        runcmd(command, logger=logger)

And then add --tmp-dir ./megahit_tmp to the above megahit commands.

Or

use --tmp-dir $TMPDIR, but define the $TMPDIR variable before using the mitoz command, like:

export TMPDIR=/some/dir/ && mitoz all XXXXX

@linzhi2013
Copy link
Owner

I will incorporate such an option into MitoZ in subsequent releases. thanks again for your reporting!

@linzhi2013 linzhi2013 added the enhancement New feature or request label Dec 27, 2022
@asifratul
Copy link
Author

Hi @linzhi2013 ,

Thanks for the code. I have incorporated your codes in assembly.py. but still, it is giving the same error!

image

@linzhi2013
Copy link
Owner

linzhi2013 commented Dec 27, 2022

I see. Maybe you have used the wrong way because the google group says defined like TMPDIR (or something similar) then use "--tmp-dir $TMPDIR" instead of --tmp-dir /tmp". See my updated answer.

@asifratul
Copy link
Author

Hi @linzhi2013,

I might not get your suggestion properly. what I have done is -

a. added your megahit codes in assembly.py file, with --temp-dir $TMPDIR (see below).
b. then run --> export TMPDIR=./megatemp && mitoz all --fq1 test.1.fq.gz --fq2 test.2.fq.gz --outprefix ttt --clade Arthropoda --data_size_for_mt_assembly 0 --assembler megahit --requiring_taxa Arthropoda

but still getting the same error! Am I doing something wrong?

ASIF

mitoz.log

image

@linzhi2013
Copy link
Owner

linzhi2013 commented Dec 28, 2022

I don't know if you have to create the TMPDIR directory before using it (I suppose you need to).

The another thing I am not so sure is if the TMPDIR variable can be passed to the megahit command with MitoZ using the above method.

I would suggest not use the TMPDIR variable method, but using thehard-code way:

Firstly, create the path of a tmp directory:

mkdir -p /your/custom/tmp/path

Then replace the --tmp-dir $TMPDIR in the assembly.py file with --tmp-dir /your/custom/tmp/path.

Also don't forget to do the same thing with
image

@linzhi2013
Copy link
Owner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants