Giter VIP home page Giter VIP logo

ngspsmc's Introduction

Build Status

===== Program for analysing NGS data.

http://www.popgen.dk/angsd

Installation:

  1. Using a local folder containing htslib
#download htslib
git clone --recurse-submodules https://github.com/samtools/htslib.git;
#download angsd
git clone https://github.com/angsd/angsd.git;

#install htslib
cd htslib
make

#install angsd
cd ../angsd
make HTSSRC=../htslib
  1. Systemwide installation of htslib
git clone https://github.com/angsd/angsd.git;
cd angsd; make HTSSRC=systemwide
  1. Using htslib submodule
git clone https://github.com/angsd/angsd.git;
cd angsd; make

Notes

  • I've switched over to using htslib for parsing single reads (to allow for CRAM reading, while avoid having to write my own CRAM parser). I'm still using my own readpools. Users should therefore also download and install htslib.
  • If you are on a mac computer and the compilation process complains about a missnig crybtolib library then do 'make CRYPTOLIB=""'

Program has a paper

http://www.biomedcentral.com/1471-2105/15/356/abstract

ngspsmc's People

Contributors

angsd avatar douglasgscofield avatar vlshchur avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

ngspsmc's Issues

Error: -> Problem opening file: '-dospline'

I tested out running ngsPSMC using the instructions outlined in the tutorial.

I first ran this script on a single .bam file to generate an input file

./angsd -i S13_2949_trim_cleaned.bam -ref canFam3_withY.fa -out S13_2949_psmcinput -dopsmc 1 -gl 1 -minq 30 -minmapq 30

Looking at the bottom of my .arg file it appears it worked and generated the following output files

abcPSMC.cpp:
-writePSMC 1
1: (still beta, not really working)
->"S13_2949_psmcinput.arg"
->"S13_2949_psmcinput.psmc.gz"
->"S13_2949_psmcinput.psmc.pos.gz"
->"S13_2949_psmcinput.psmc.idx"

    [ALL done] cpu-time used =  4683.03 sec
    [ALL done] walltime used =  4776.00 sec

I then tried running ngsPSMC and am getting the following error:

./ngsPSMC S13_2949_psmcinput.psmc.idx -p "1*4+25*2+1*4+1*6" -dospline 0 -nthreads 8 -nIter 20 -init 1  -theta 0.000233095 -rho 0.005357 > S13_2949.psmc.ml.txt
-> we are in file: main_psmc.cpp function: main_psmc line:187
    -> Version of fname: '/home/sophiepq/GrayFoxWGS/GrayFox1/angsd/ngsPSMC/S13_2949_psmcinput.psmc.idx' is:1
    -> Assuming .psmc.gz file: /home/sophiepq/GrayFoxWGS/GrayFox1/angsd/ngsPSMC/S13_2949_psmcinput.psmc.gz
    -> Assuming .psmc.pos.gz: /home/sophiepq/GrayFoxWGS/GrayFox1/angsd/ngsPSMC/S13_2949_psmcinput.psmc.pos.gz
    -> Problem opening file: '-dospline'

I don't really know what this error means or how to address it. I believe -dospline 0 or -dospline 1 are requirements to run program. I'm not sure whether there is another input file it's looking for that I am missing here.

Install issues (and fixes) for master branch and recent htslib

Hi,
we had problems compiling ngsPSMC on one of our current systems. This was related both to the code in ngsPSMC and htslib. Below is the workaround (or "fix") we tried. For what it's worth.
Cheers
/Johan

(Used g++ (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44), running CentOS Linux release 7.9.2009)

  1. Get htslib from the developers release on GitHub

     $ cd /path/to/folder
     $ wget https://github.com/samtools/htslib/releases/download/1.15/htslib-1.15.tar.bz2
     $ tar -xf htslib-1.15.tar.bz2
     $ rm htslib-1.15.tar.bz2
    
  2. Make changes in htslib linking, and build (need to generate libhts.a)

     $ cd htslib-1.15
     $ sed -i '/htslib_default_libs/ s/$/ -lssl -lcrypto/' Makefile
     $ ./configure
     $ make
    
  3. Clone ngsPSMC from GitHub

     $ cd /path/to/folder
     $ git clone https://github.com/ANGSD/ngsPSMC
     $ cd ngsPSMC
    
  4. Make changes in the code (linking, and add include statement), and build (expect and ignore Warnings).

     $ sed -i '/o ngsPSMC/ s/$/ -lssl -lcrypto/' Makefile
     $ sed -i '/header.h/ s/$/\n#include <stdio.h>/' header.cpp
     $ sed -i '/cstring/ s/$/\n#include <stdio.h>/' header.h
     $ make HTSSRC=../htslib-1.15/
    

Final executable file is /path/to/folder/ngsPSMC/ngsPSMC

Output not clear

Hi,

I have cloned the ngsPSMC into my computer and I have ran a test with the chr38 of a dog. As recommended in README.md, I ran:

$ ../../angsd/angsd -i dog.qatar.chr38.bam -dopsmc 1 -out chr38 -gl 1 -minq 20 -minmapq 30
with output filenames chr38.arg; chr38.psmc.gz, chr38.psmc.poz.gz, chr38.psmc.idx

After running ngsPSMC in this file as recommended in README.md:
../ngsPSMC chr38.psmc.idx -p "14+252+14+16"
-dospline 0 -nthreads 8 -nIter 20 -init 1
-theta 0.000233095 -rho 0.005357 > chr38.psmc.ml.txt

The file seems correct:

$ more chr38.psmc.ml.txt MM ../../ngsPSMC/ngsPSMC chr38.psmc.psmc.idx -p 1*4+25*2+1*4+1*6 -dospline 0 -nthreads 8 -nIt er 20 -init 1 -theta 0.000233095 -rho 0.005357 MM -> ngsPSMC version: v0.02-54-gbcda080 (htslib: 1.9) build(Oct 14 2019 15:57:42) MM TR is theta rho, theta in this context is given by the persite theta, and not the per wind ow theta, this is different from the original PSMC MM filereading took: (wall(min),cpu(min)):(0.050000,0.042487) RD 0 LK -30553205.977373 QD 0.000000 -> 0.000000 RI ? TR 0.000233 0.005357 MT 23.861429 MM buildhmm(wall(min),cpu(min)):(3.450000,3.458922) tk_l:64 RS 0 0.000000 1.000000 1000000.0 1000000.0 1000000.0 RS 1 0.009086 1.000000 1000000.0 1000000.0 1000000.0 RS 2 0.018998 1.000000 1000000.0 1000000.0 1000000.0 RS 3 0.029811 1.000000 1000000.0 1000000.0 1000000.0

But there is no specifications as what to do next. I tried to decompress chr38.psmc.gz into chr38.psmc and run psmc_plot.py:

$ python3.7 psmc_plot.py -psmc ../../test_ngspsmc/testchr38/chr38.psmc
Units: mutation rate = 1.25e-08 binsize = 100.0 N0 = 10000.0 generation time = 29.0
Argument should have 4 or 5 parameters.

Am I doing something wrong or is the code still under development?

Maybe I can directly use the psmc_plot.py code of PSMC (/utils/psmc_plot.py) to run in my chr38?

Thanks

Carlos

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.