metaDMG-dev / metaDMG-cpp

metaDMG-cpp
2 stars 2 forks source link

Input alignment file is not sorted.(metaDMG) #22

Closed timeresistance1996 closed 5 months ago

timeresistance1996 commented 5 months ago

Hallo,

My .sam has been sorted with "samtools sort" before run "metaDMG-cpp getdamage -l 10 -p 5 --threads 8  sorted_output". But I got an error:

-> metaDMG version: 0.4 (htslib: 1.19.1) build(Nov  1 2023 17:55:14)
-> metaDMG-cpp getdamage -l 10 -p 5 --threads 8 output.sam 
-> ./metaDMG-cpp refName: (null) min_length: 10 print_length: 5 run_mode: 0 out_prefix: meta nthreads: 8 ignore_errors: 0
-> We require a proper header starting with @HD for metadamage
-> We observed: '' will exit

Input alignment file is not sorted.(metaDMG)

I install metaDMG on my Ubuntu with conda. How should I solve this?

miwipe commented 5 months ago

How does the header of the bam file look like?

Try doing samtools view -H filename.bam

There should be a @HD in the first line if not then that is the issue. And which programme did you use to create the bam file?

On 20 Mar 2024, at 15.19, timeresistance1996 @.***> wrote:



Hallo,

My .sam has been sorted with "samtools sort" before run "metaDMG-cpp getdamage -l 10 -p 5 --threads 8 sorted_output". But I got an error:

-> metaDMG version: 0.4 (htslib: 1.19.1) build(Nov 1 2023 17:55:14) -> metaDMG-cpp getdamage -l 10 -p 5 --threads 8 output.sam -> ./metaDMG-cpp refName: (null) min_length: 10 print_length: 5 run_mode: 0 out_prefix: meta nthreads: 8 ignore_errors: 0 -> We require a proper header starting with @HD for metadamage -> We observed: '' will exit

Input alignment file is not sorted.(metaDMG)

I install metaDMG on my Ubuntu with conda. How should I solve this?

— Reply to this email directly, view it on GitHubhttps://github.com/metaDMG-dev/metaDMG-cpp/issues/22, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACXBWEETECBKFL5GYJ5F2YDYZGLH5AVCNFSM6AAAAABE7SMTMGVHI2DSMVQWIX3LMV43ASLTON2WKOZSGE4TONRWGA2DIOA. You are receiving this because you are subscribed to this thread.Message ID: @.***>

timeresistance1996 commented 5 months ago

Thanks for your reply!

The code worked after I sorted with "samtools sort -n". But I still got a fault:

metaDMG-cpp getdamage -l 10 -p 5 --threads 4 output.name.sort.bam -> metaDMG version: 0.4 (htslib: 1.19.1) build(Nov 1 2023 17:55:14) -> metaDMG-cpp getdamage -l 10 -p 5 --threads 4 output.name.sort.bam -> ./metaDMG-cpp refName: (null) min_length: 10 print_length: 5 run_mode: 0 out_prefix: meta nthreads: 4 ignore_errors: 0 skipping: unmapped, this msg is printed: 2 times more skipping: unmapped, this msg is printed: 1 times more skipping: unmapped, this msg is printed: 0 times more Segmentation fault (core dumped)

ANGSD commented 5 months ago

can you please try with the most recent version on github, there has been quite a few changes over the last many months.

Den tors. 21. mar. 2024 kl. 07.21 skrev timeresistance1996 < @.***>:

Thanks for your reply!

The code worked after I sorted with "samtools sort -n". But I still got a fault:

metaDMG-cpp getdamage -l 10 -p 5 --threads 4 output.name.sort.bam -> metaDMG version: 0.4 (htslib: 1.19.1) build(Nov 1 2023 17:55:14) -> metaDMG-cpp getdamage -l 10 -p 5 --threads 4 output.name.sort.bam -> ./metaDMG-cpp refName: (null) min_length: 10 print_length: 5 run_mode: 0 out_prefix: meta nthreads: 4 ignore_errors: 0 skipping: unmapped, this msg is printed: 2 times more skipping: unmapped, this msg is printed: 1 times more skipping: unmapped, this msg is printed: 0 times more Segmentation fault (core dumped)

— Reply to this email directly, view it on GitHub https://github.com/metaDMG-dev/metaDMG-cpp/issues/22#issuecomment-2011298820, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABQOR3VKMQH2Y7ATL6HQLH3YZJ347AVCNFSM6AAAAABE7SMTMGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJRGI4TQOBSGA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

miwipe commented 5 months ago

@timeresistance1996 just noticed, that you wrote you installed metaDMG using conda. This version is not up to date. As this is a project that is still being developed, the most recent update you will find by cloning the repo.

a small comment to the error message above. are you parsing reads that do not align to anything in your database? Another question, what have you mapped to? and what is it you want to get from running metaDMG-cpp? It has several modes.

ANGSD commented 5 months ago

I think we should remove the program from conda until it has reached production status, the conda version is very much out of sync with the main github repos.

Den tors. 21. mar. 2024 kl. 10.37 skrev Mikkel Winther Pedersen < @.***>:

@timeresistance1996 https://github.com/timeresistance1996 just noticed, that you wrote you installed metaDMG using conda. This version is not up to date. As this is a project that is still being developed, the most recent update you will find by cloning the repo.

a small comment to the error message above. are you parsing reads that do not align to anything in your database? Another question, what have you mapped to? and what is it you want to get from running metaDMG-cpp? It has several modes.

— Reply to this email directly, view it on GitHub https://github.com/metaDMG-dev/metaDMG-cpp/issues/22#issuecomment-2011752279, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABQOR3RNDEBXMVCY5XTDYPDYZKS55AVCNFSM6AAAAABE7SMTMGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJRG42TEMRXHE . You are receiving this because you commented.Message ID: @.***>

CCEK150 commented 5 months ago

Hello,I have the same question with writer. And I try with the most recent version on github. But how should I install libgsl-dev libeigen3-dev on CentOS7.3?

ANGSD commented 5 months ago

Make sure, you are using the most recent version. eigen should not be needed in the main parts that gets compiled by default. If you have admin rights, then you can install gsl using the package system, otherwise you will have to do a local installation.

Best regards.

On 22 Mar 2024, at 02.50, CCEK150 @.***> wrote:

Hello,I have the same question with writer. And I try with the most recent version on github. But how should I install libgsl-dev libeigen3-dev on CentOS7.3?

— Reply to this email directly, view it on GitHub https://github.com/metaDMG-dev/metaDMG-cpp/issues/22#issuecomment-2014170038, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABQOR3RIBIBERQPNSPC4XMDYZOE7PAVCNFSM6AAAAABE7SMTMGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJUGE3TAMBTHA. You are receiving this because you commented.

timeresistance1996 commented 5 months ago

Yes, it's the problem that install with conda. I reinstalled metaDMG with git clone and compile successfully.

Thank you for you reply! @miwipe @ANGSD

CCEK150 commented 5 months ago

I try to install metaDMG-cpp like #6:

conda create -n metaDMG-cpp python=3.9 eigen htslib cxx-compiler gsl
conda activate metaDMG-cpp
git clone https://github.com/metaDMG-dev/metaDMG-cpp.git
cd metaDMG-cpp
make HTSSRC=../htslib/`

But I get the error:

gcc -g -Wall -O2 -fvisibility=hidden  -I.  -c -o kfunc.o kfunc.c
gcc -g -Wall -O2 -fvisibility=hidden  -I.  -c -o kstring.o kstring.c
gcc -g -Wall -O2 -fvisibility=hidden  -I.  -c -o bcf_sr_sort.o bcf_sr_sort.c
gcc -g -Wall -O2 -fvisibility=hidden  -I.  -c -o bgzf.o bgzf.c
bgzf.c:38:10: fatal error: zlib.h: No such file or directory
   38 | #include <zlib.h>
      |          ^~~~~~~~
compilation terminated.
make[1]: *** [bgzf.o] Error 1
make[1]: Leaving directory `home/user/metaDMG-cpp/htslib'
make: *** [.activate_module] Error 2

could you please help me to understand how to solve it?

ANGSD commented 5 months ago

i would just do it regularly.

git clone --recursive https://github.com/samtools/htslib cd htslib make cd .. git clone https://github.com/metaDMG-dev/metaDMG-cpp cd metaDMG-cpp make HTSSRCC=../htslib

On 23 Mar 2024, at 11.11, CCEK150 @.***> wrote:

I try to install metaDMG-cpp like #6 https://github.com/metaDMG-dev/metaDMG-cpp/issues/6:

conda create -n metaDMG-cpp python=3.9 eigen htslib cxx-compiler gsl conda activate metaDMG-cpp git clone https://github.com/metaDMG-dev/metaDMG-cpp.git cd metaDMG-cpp make HTSSRC=../htslib/` But I get the error:

gcc -g -Wall -O2 -fvisibility=hidden -I. -c -o kfunc.o kfunc.c gcc -g -Wall -O2 -fvisibility=hidden -I. -c -o kstring.o kstring.c gcc -g -Wall -O2 -fvisibility=hidden -I. -c -o bcf_sr_sort.o bcf_sr_sort.c gcc -g -Wall -O2 -fvisibility=hidden -I. -c -o bgzf.o bgzf.c bgzf.c:38:10: fatal error: zlib.h: No such file or directory 38 | #include | ^~~~ compilation terminated. make[1]: [bgzf.o] Error 1 make[1]: Leaving directory `home/user/metaDMG-cpp/htslib' make: [.activate_module] Error 2 could you please help me to understand how to solve it?

— Reply to this email directly, view it on GitHub https://github.com/metaDMG-dev/metaDMG-cpp/issues/22#issuecomment-2016436377, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABQOR3TTHXS6TBRUGFBS7IDYZVIMLAVCNFSM6AAAAABE7SMTMGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJWGQZTMMZXG4. You are receiving this because you were mentioned.

ANGSD commented 5 months ago

Hi I didnt read the email properly, it looks like you are missing the zlib.h from your operating system. You will need to install that.

From a quick google search, you should be able to install it like:

yum install zlib-devel

On 23 Mar 2024, at 11.55, ANGSD @.***> wrote:

i would just do it regularly.

git clone --recursive https://github.com/samtools/htslib cd htslib make cd .. git clone https://github.com/metaDMG-dev/metaDMG-cpp cd metaDMG-cpp make HTSSRCC=../htslib

On 23 Mar 2024, at 11.11, CCEK150 @.***> wrote:

I try to install metaDMG-cpp like #6 https://github.com/metaDMG-dev/metaDMG-cpp/issues/6:

conda create -n metaDMG-cpp python=3.9 eigen htslib cxx-compiler gsl conda activate metaDMG-cpp git clone https://github.com/metaDMG-dev/metaDMG-cpp.git cd metaDMG-cpp make HTSSRC=../htslib/` But I get the error:

gcc -g -Wall -O2 -fvisibility=hidden -I. -c -o kfunc.o kfunc.c gcc -g -Wall -O2 -fvisibility=hidden -I. -c -o kstring.o kstring.c gcc -g -Wall -O2 -fvisibility=hidden -I. -c -o bcf_sr_sort.o bcf_sr_sort.c gcc -g -Wall -O2 -fvisibility=hidden -I. -c -o bgzf.o bgzf.c bgzf.c:38:10: fatal error: zlib.h: No such file or directory 38 | #include | ^~~~ compilation terminated. make[1]: [bgzf.o] Error 1 make[1]: Leaving directory `home/user/metaDMG-cpp/htslib' make: [.activate_module] Error 2 could you please help me to understand how to solve it?

— Reply to this email directly, view it on GitHub https://github.com/metaDMG-dev/metaDMG-cpp/issues/22#issuecomment-2016436377, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABQOR3TTHXS6TBRUGFBS7IDYZVIMLAVCNFSM6AAAAABE7SMTMGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJWGQZTMMZXG4. You are receiving this because you were mentioned.

— Reply to this email directly, view it on GitHub https://github.com/metaDMG-dev/metaDMG-cpp/issues/22#issuecomment-2016449173, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABQOR3XSUQ5ZM7OHHJ7UZBDYZVNSNAVCNFSM6AAAAABE7SMTMGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJWGQ2DSMJXGM. You are receiving this because you are subscribed to this thread.

CCEK150 commented 5 months ago

Thanks for your answer, but now our system has some problems, we can't use the yum library..., look forward to the version update on conda