jguhlin / minimap2-rs

Rust bindings to minimap2 library
Other
51 stars 11 forks source link

no output #47

Closed 70m43 closed 4 months ago

70m43 commented 10 months ago

Hi thank you for your work.

This example code gives me [] as output

use minimap2::Aligner;
use std::path::Path;

fn main() {
    let ref_path = "/home/thomas/NGS/ref/hg19.fa";

    let mut aligner = Aligner::builder()
        .map_ont()
        .with_threads(8)
        .with_cigar()
        .with_index(ref_path, None)
        .expect("Unable to build index");

    let seq: Vec<u8> = b"ACTGACTCACATCGACTACGACTACTAGACACTAGACTATCGACTACTGACATCGA".to_vec();
    let alignment = aligner
        .map(&seq, false, false, None, None)
        .expect("Unable to align");
    println!("{:?}", alignment);
}

my Toml configuration is :

[package]
name = "desc_seq_2"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
minimap2 = "0.1.16+minimap2.2.26"

cargo 1.74.0-nightly (d5336f813 2023-09-14)

jguhlin commented 10 months ago

Ah, that's the example in the docs. My fault. For such a short sequence you'll need .short() or .sr() instead of .map_ont().

70m43 commented 10 months ago

Thank you but neither changing for .short() nor .sr() nor a longer sequence solve the issue.

jguhlin commented 10 months ago

It's possible there is no match for your sequence? Does the cli produce an output. If there are no matches the vector is empty.

On Tue, 19 Sept 2023, 8:32 pm 70m43, @.***> wrote:

Thank you but neither changing for .short() nor .sr() nor a longer sequence solve the issue.

— Reply to this email directly, view it on GitHub https://github.com/jguhlin/minimap2-rs/issues/47#issuecomment-1725060341, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAOA2CFQIPPFNZ7RLTPOHOLX3FKDRANCNFSM6AAAAAA44NXHBE . You are receiving this because you commented.Message ID: @.***>

70m43 commented 10 months ago

It's the same with the sequence from samtools faidx /home/thomas/NGS/ref/hg19.fa chr17:18573597-18573711

70m43 commented 10 months ago

I removed with_cigar() and now it works...

Thank you for your help and work !

jianshu93 commented 2 months ago

Hello All,

Is this problem solved? I do need Cigar for calculating identities, but the default PAF also works for me. Just wonder whether the Cigar functionality also works.

Thanks,

Jianshu