10XGenomics/subset-bam

Compiling error

murphy1111 opened this issue · 2 comments

Hi,

I'm receiving the following error when trying to run cargo build --release:

C:\Users\user.cargo\subset-bam-master>cargo build --release
Compiling rust-htslib v0.20.0
error: failed to run custom build command for rust-htslib v0.20.0
process didn't exit successfully: C:\Users\user\.cargo\subset-bam-master\target\release\build\rust-htslib-2ffb4fd63700591d\build-script-build (exit code: 101)
--- stderr
thread 'main' panicked at 'called Result::unwrap() on an Err value: Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." }', src\libcore\result.rs:997:5
note: Run with RUST_BACKTRACE=1 environment variable to display a backtrace.

Can you assist? This is my first time trying to use Rust so please let me know if you need additional information. Thanks!

Running rustc 1.35.0 (3c235d560 2019-05-20)

ghuls commented

Very likely, Windows is not supported.

Very similar functionality was quite recently added to samtools itself:
samtools/samtools#1001

# Number of threads to use for samtools.
samtools_nbr_threads=1

# Filename with cell barcodes to extract (each barcode should be listed on a separate line, separated by a newline ('\n' only).
cell_barcodes_file=your_file_with_cell_bar_codes.txt

# Only keep reads for requested subset of cell barcodes
samtools view \
        -O BAM \
        -@ "${samtools_nbr_threads}" \
        -D "CB:${cell_barcodes_file}" \
        -o "${filtered_single_cell_output_bam_file}"
        "${single_cell_input_bam_file}"

Thanks!