r3fang / SnapATAC

Analysis Pipeline for Single Cell ATAC-seq
GNU General Public License v3.0
301 stars 125 forks source link

runCluster error #3

Closed sam-morris closed 5 years ago

sam-morris commented 5 years ago

Hi, when I try to find clusters using 'runCluster', I get the following error: File "/Users/smorris/snaptools/bin/snaptools", line 36, in from snaptools.parser import parse_args ImportError: No module named snaptools.parser Error in runCluster.default(x.sp, pca_dims = 1:10, k = 30, resolution = 1, : 'runCluster' call failed

r3fang commented 5 years ago

Hi thank you for trying out our method and sorry for not documenting this clearly. We are still testing the method internally. In order to run this step, you will need to install ‘snaptools’ 1.2.5 by ‘pip install —install snaptools==1.2.5’ which requires python2.7. After installing snaptools, when running runCluster, set the tag ‘path_to_snaptools’ to the excutable snaptools file. Please let me know if it still does not work.

r3fang commented 5 years ago

Can you make sure

/Users/smorris/snaptools/bin/snaptools

Is an excutable? This error may be raised because the python version is not 2.7 or because snaptools version is not 1.2.5. If it’s snaptools installation failed. Please feel free to let me know if snaptools installation failed

sam-morris commented 5 years ago

Thanks very much for making the method available! Yes, it is an executable. I downgraded to python version 2.7 and snaptools seems to be working - it doesn't look like it failed

r3fang commented 5 years ago

Thanks! if it is still not working. Do you mind existing R and running the following command in bash

$ /Users/smorris/snaptools/bin/snaptools

does it output the following message?

usage: snaptools [-h]  ...

Program: snaptools (A module for working with snap files in Python)
Version: 1.2.5
Contact: Rongxin Fang
E-mail:  r4fang@gmail.com

optional arguments:
  -h, --help        show this help message and exit

functions:

    dex-fastq       Decomplex fastq file.
    index-genome    Index reference genome.
    align-paired-end
                    Align paired-end reads.
    align-single-end
                    Align single-end reads.
    snap-pre        Create a snap file from bam or bed file.
    snap-add-bmat   Add cell x bin count matrix to snap file.
    snap-add-pmat   Add cell x peak count matrix to snap file.
    snap-add-gmat   Add cell x gene count matrix to snap file.
    dump-fragment   Dump fragments of selected barcodes from a snap file.
    dump-barcode    Dump barcodes from a snap file.
    call-peak       Call peak using selected barcodes.
    louvain         Louvain communities finding.
sam-morris commented 5 years ago

Yes, it does output that message

r3fang commented 5 years ago

Sorry for the bug. this never happened before. my suspicion is that you probably have python of different version installed, the environment where you are running SnapATAC, python3 is still the default version (for example, maybe you have opened a new screen). This is only my guess. Anyway, I am working on removing runCluster's dependency on snaptools now, will keep you posted once it is done (later today). Meanwhile, you can still proceed to the rest of the analysis which does not require clustering result. Thanks!

r3fang commented 5 years ago

hey, I have updated SnapATAC, please reinstall it by install_github(r3fang/SnapATAC). After installation, for runCluster, by default it now uses igraph cluster_louvain for indentifying clusters but this does not support resolution. Alternatively you can still set path_to_snaptools to snaptools which allows for different resolutions. This can serve as a temporary solution.

sam-morris commented 5 years ago

Works great now - thanks very much for your help!

r3fang commented 5 years ago

FYI, we have updated the pipeline to a new version which 1) solves the problem for runClsuter; 2) reduces the memory usage; 3) offers better visualization options; 4) allows for combining multiple samples.

sam-morris commented 5 years ago

I'll try it out - thanks very much!