Giter Site home page Giter Site logo

Comments (2)

ekg avatar ekg commented on August 19, 2024

It looks like path naming is partly broken. I think your post includes everything I'll need to test.

from vg.

ekg avatar ekg commented on August 19, 2024

First I set things up in the same way:

test git:(master) ✗ vg construct -r tiny/tiny.fa >t.vg                                                                     
➜  test git:(master) ✗ vg index -s -k 11 t.vg            

It looks like the problem is that introducing the SNP into the first few bases of the read doesn't result in an alignment that detects the SNP. Note that the first edit in the mapping has "to_length" : 2. "from_length" : 0 is implied. This is equivalent to an insertion, but when we have it at the start or end of the alignment it means "soft clip".

test git:(master) ✗ vg map -s CGAATAAGGCTTGGAAATTTTCTGGAGTTCTATTATATTCCAACTCTCTT -Q new t.vg | vg view -a - | jq .
{
  "sequence": "CGAATAAGGCTTGGAAATTTTCTGGAGTTCTATTATATTCCAACTCTCTT",
  "path": {
    "mapping": [
      {
        "position": {
          "offset": 2,
          "node_id": 1
        },
        "edit": [
          {
            "to_length": 2
          },
          {
            "from_length": 47,
            "to_length": 47
          },
          {
            "to_length": 1
          }
        ]
      }
    ]
  },
  "name": "new",
  "score": 94
}

So there isn't any variation reported by the alignment. This is typical and actually a big part of why single reference-based alignment has problems for stuff like allele specific expression.

Inclusion will work provided we can align through the variant. So, I insert a SNP later on in the read.

test git:(master) ✗ vg construct -r tiny/tiny.fa >t.vg                                                                     
➜  test git:(master) ✗ vg index -s -k 11 t.vg            
➜  test git:(master) ✗ vg map -s CAAATAAGGCTTGGAAATGTTCTGGAGTTCTATTATATTCCAACTCTCTT -Q new t.vg | vg mod -i - t.vg | vg view -
H       HVN:Z:1.0
S       2       CAAATAAGGCTTGGAAAT
P       2       x       +       18M
L       2       -       4       +       0M
L       2       -       6       +       0M
S       4       T
P       4       x       +       1M
L       4       -       5       +       0M
S       5       TTCTGGAGTTCTATTATATTCCAACTCTCTG
P       5       x       +       31M
S       6       G
P       6       new     +       1M
L       6       -       5       +       0M

from vg.

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.