no bins added in bins directory

Issue #122 resolved
Saraswati Awasthi created an issue

Hi

I am trying to bin my contigs. My assembles contigs are from a cosmid contaminated with E.coli bacteria and I was just trying to get my data separated into different bins so that I can find out the contamination. after running metabat2 it says it formed 5 bins but I did not find any bin.fa inside bins directory.

metabat2 -i /home/rsharma/SARASWATI/ASSEMBLY/A5A9/A5A9.fa -o /home/rsharma/SARASWATI/ASSEMBLY/metabat2bins/ -m 1500 --minClsSize 10000
MetaBAT 2 (v2.12.1) using minContig 1500, minCV 1.0, minCVSum 1.0, maxP 95%, minS 60, and maxEdges 200.
5 bins (4521918 bases in total) formed.

Comments (7)

  1. Rob Egan

    Hi Saraswati,

    First, it looks like you are running with a very old version and I would suggest upgrading it.

    But it does look like if metabat cannot write to the output directory it does silently ignore the error. I suspect that this is the case for you. Please double check that the output path is a valid one where you have write permissions (and the filesystem is not full, etc).

    I’ll fix the latest version of metabat to notify the user when there is an error when writing the outputs.

  2. Karolina Mercoulia

    Hi Rob,

    I am having the same error as above. I’ve run it a few time and it appears to work but I have no bins in my output folder.

    metabat2 -i AUSMDU00067635/flye_polished.fasta -a AUSMDU00067635/AUSMDU00067635_depth.txt -o AUSMDU00067635/metabat2_bins/ -v

    MetaBAT 2 (2.15 (Bioconda)) using minContig 2500, minCV 1.0, minCVSum 1.0, maxP 95%, minS 60, maxEdges 200 and minClsSize 200000. with random seed=1652848463
    [00:00:00] Executing with 72 threads
    [00:00:00] Parsing abundance file
    [00:00:00] Parsing assembly file
    [00:00:00] Number of large contigs >= 2500 are 970. 
    [00:00:00] Reading abundance file
    [00:00:00] Finished reading 1020 contigs and 1 coverages from AUSMDU00067635/AUSMDU00067635_depth.txt
    [00:00:00] Number of target contigs: 712 of large (>= 2500) and 17 of small ones (>=1000 & <2500). 
    [00:00:00] Start TNF calculation. nobs = 712
    [00:00:00] Finished TNF calculation.                                  
    [00:00:00] Finished Preparing TNF Graph Building [pTNF = 82.80]                                             
    [00:00:00] Finished Building TNF Graph (24480 edges) [69.9Gb / 377.5Gb]                                          
    [00:00:00] Applying coverage correlations to TNF graph with 24480 edges
    [00:00:00] Traversing graph with 712 nodes and 24480 edges
    [00:00:00] Building SCR Graph and Binning (69 vertices and 53 edges) [P = 9.50%; 69.9Gb / 377.5Gb]                           
    [00:00:00] Building SCR Graph and Binning (137 vertices and 173 edges) [P = 19.00%; 69.9Gb / 377.5Gb]                           
    [00:00:00] Building SCR Graph and Binning (203 vertices and 351 edges) [P = 28.50%; 69.9Gb / 377.5Gb]                           
    [00:00:00] Building SCR Graph and Binning (271 vertices and 728 edges) [P = 38.00%; 69.9Gb / 377.5Gb]                           
    [00:00:00] Building SCR Graph and Binning (339 vertices and 1255 edges) [P = 47.50%; 69.9Gb / 377.5Gb]                           
    [00:00:00] Building SCR Graph and Binning (406 vertices and 1864 edges) [P = 57.00%; 69.9Gb / 377.5Gb]                           
    [00:00:00] Building SCR Graph and Binning (474 vertices and 3310 edges) [P = 66.50%; 69.9Gb / 377.5Gb]                           
    [00:00:00] Building SCR Graph and Binning (475 vertices and 3358 edges) [P = 76.00%; 69.9Gb / 377.5Gb]                           
    [00:00:00] Rescuing singleton large contigs
    [00:00:00] There are 40 bins already
    [00:00:00] Outputting bins
    [00:00:01] 91.02% (76240238 bases) of large (>=2500) and 0.00% (0 bases) of small (<2500) contigs were binned.
    40 bins (76240238 bases in total) formed.
    [00:00:01] Finished
    

    I’m very new to command line so I may have completely missed something.

    Thanks,

    K

  3. Rob Egan

    This looked like it ran fine and outputted 40 files in the relative path: AUSMDU00067635/metabat2_bins/

    MetaBAT should have reported an error if it could not make that directory, so are you positive the files are not there?

    The other possibility is that the path already exists but for some reason you cannot write to that directory. I just tested this and metabat does NOT throw an error in that situation, which I will fix in a later version. So please check the file permissions and your ability to write files in that output directory… Apparently checking whether the file closed properly after writing to the std::ofstream, is an insufficient test if the file never was opened.

  4. 宋泽伟(Zewei Song)

    I think this is because you need to provide path and file prefix to the -o options, instead of just a path.

    I’ve got in the the same situation. If we use -o the/path/to/my/bins/, then all files are named with no prefix! They will start with '.', i.e. such as .9.fa, .10.fa, .11.fa, et al. Since by default these files are hidden.

    You can see if you got these bins using

    ls -a
    

    Good luck!

    Zewei

  5. Rob Egan

    Thanks Zewei,

    That is exactly correct the -o option just blindly appends .#.fa to that parameter for each bin # that is created. So, yes if you do not ls with -a that command will ignore any file that begins with a '.'.

    Metabat will create a new directory, if necessary, but you can also remove the '/' from the -o option parameter and the new bins will be created in the current working directory.

    -Rob

  6. Log in to comment