Coder Social home page Coder Social logo

Comments (2)

philres avatar philres commented on August 20, 2024

Hi Mathieu,

Thanks for your feedback.
NextGenMap does take the -i parameter into account. But it is perfectly possible that you simply don't get alignments with an identity below 0.75. Therefore, changing the -i option from 0.65 to 0.55 or 0.75 won't have any effect. If you try changing it to 0.95 you should see an effect.
If you want to check the identity distribution for your dataset(s) you could do the following:

#Map without identity threshold
ngm -r <ref> -q <query> -i 0.0 -o ngm-output.sam
#Extract identity values from sam file
grep -oP "XI:f:[0-9.]+" ngm-output.sam | cut -d ":" -f 3 > ngm-identity-dist.csv

In R:

identDist = read.table("ngm-identity-dist.csv")
hist(identDist$V1)

As an example I attached two images. One from running NextGenMap (version 0.4.10) with -i 0.0 and one for -i 0.85 (both with local alignment).

Please also keep in mind that per default NextGenMap computes a local alignment. So if for example the first 10 bases of a read don't match the reference (but the rest of the read does) NextGenMap will clip the first 10 bases and only align the rest of the read. Thus, the 10 bases that don't match won't be considered for the identity computation.
To prevent NextGenMap from mapping only short parts of the reads we introduced the -R/--min-residues parameters and set the default value to 50% of the read length. Thus, alignments that contain less then 50% of the read will be discarded. So if you aim for a more stringent mapping you can increase this parameter.
If you definitely want the whole read to be aligned you could also tell NextGenMap to compute end-to-end (semi-global) alignments by using the -e/--end-to-end parameter.

I hope this solves your problem. For the case that you have alignments with an identity < 0.75 please report back and include how you run NextGenMap (all parameters) and information about your dataset (read length, etc.)

Best,
Philipp

nextgenmap-0 0
nextgenmap-0 85

from nextgenmap.

mgineste avatar mgineste commented on August 20, 2024

Dear Philipp,

Thanks for this very detailed reply.

My mistake : I indeed didn't dig enough into my data and, tough rather being counter-intuitive regarding my samples, it happened that very few alignments show an identity score below 0.75.

Distribution of identity scores with the default -i parameter value (-i = 0.65) :

summary(ciA_k27ac_ngm_k10_identity$V1)
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
 0.7234  0.8810  0.9268  0.9210  0.9592  1.0000

Distribution of identity scores with -i = 0.75 :

summary(ciA_k27ac_ngm_k10_i75_identity$V1)
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
 0.7500  0.8810  0.9268  0.9210  0.9592  1.0000

The -i parameter filtering in NGM indeed works properly.
Sorry for this wrong alert and thanks again for your time,
Mathieu

from nextgenmap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.