Giter Club home page Giter Club logo

corgi's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

cgpu emos8710

corgi's Issues

writeRefSection function bug and solution

Hello,

Thanks for developing this tool.
I am trying to run CORGi chromosome-wide with multiple samples but failed to do so. Please see the issue below.

Issue description

The command I ran:
python corgi.py -r ref.fa -b sample1.bam -c chr2 -p 0 $chrEnd -o out/chr2/

First error message:

[formatdb] WARNING: Cannot add sequence number 1 because it has zero length.
[formatdb] FATAL ERROR: Fatal error when adding sequence to BLAST database.

After going through the output files, I noticed that the RefChunk.fa file that formatdb uses to create the blast-db was empty. This is what causes formatdb to fail.

I hence debugged the code and found the issue.

Source of the problem

The RefChunk.fa file is created by:

  1. reading the reference file,
  2. obtaining the fasta entry that corresponds to the selected chromosome,
  3. joining all of the fasta lines of the chromosome into a single string,
  4. and finally subsetting this string with the start and end coordinates that the user provided.

Step 4, which occurs in line 70 of samFunc.py is the problematic one:

70 refChunk = readRef(refFile,refInds[refIndex])[samPos_s-1:samPos_e-1]

Python is a 0-based language, which the script correctly accounted for by adding a -1 to both coordinates when subsetting the string. However, when using the start coordinate 0, the subset becomes [-1:chrLength], which returns an empty string!

I suspect #2 is related to the same bug.

(temporal) Solution

Simply remove the -1 in line 70. Or, of course, use 1 instead of 0 in the arguments.

A future version of the script should add more information in the documentation or include an exemption to account for chromosome-wide subsets and prevent the start coordinate from being less than 0.

-p option

Hi,

I want to run the whole chromosome, say chr20. I set -p start from 0 to the length of chr20, but it fails. While I give another region, it runs but pretty slow.

So, is that possible to run whole chromosome and also in multi-threads?

Thanks

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.