Code Monkey home page Code Monkey logo

tagdust's People

Contributors

timolassmann avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

tagdust's Issues

can't make

hi i have a problem.
Making all in src
make[1]: Entering directory '/disk5/lyc/biosoft/tagdust-master/src'
make all-am
make[2]: Entering directory '/disk5/lyc/biosoft/tagdust-master/src'
gcc -O2 -funroll-loops -Wall -std=gnu99 -o tagdust tagdust-kslib.o tagdust-main.o tagdust-interface.o tagdust-nuc_code.o tagdust-misc.o tagdust-io.o tagdust-barcode_hmm.o tagdust-calibrateQ.o tagdust-test_architectures.o -lpthread -lm
/usr/bin/ld: tagdust-nuc_code.o:(.bss+0x20): multiple definition of nuc_code'; tagdust-main.o:(.bss+0x20): first defined here /usr/bin/ld: tagdust-nuc_code.o:(.bss+0x0): multiple definition of rev_nuc_code'; tagdust-main.o:(.bss+0x0): first defined here
/usr/bin/ld: tagdust-misc.o:(.bss+0xfa00): multiple definition of rev_nuc_code'; tagdust-main.o:(.bss+0x0): first defined here /usr/bin/ld: tagdust-misc.o:(.bss+0xfa20): multiple definition of nuc_code'; tagdust-main.o:(.bss+0x20): first defined here
/usr/bin/ld: tagdust-io.o:(.bss+0x20): multiple definition of nuc_code'; tagdust-main.o:(.bss+0x20): first defined here /usr/bin/ld: tagdust-io.o:(.bss+0x0): multiple definition of rev_nuc_code'; tagdust-main.o:(.bss+0x0): first defined here
/usr/bin/ld: tagdust-barcode_hmm.o:(.bss+0x20): multiple definition of nuc_code'; tagdust-main.o:(.bss+0x20): first defined here /usr/bin/ld: tagdust-barcode_hmm.o:(.bss+0x0): multiple definition of rev_nuc_code'; tagdust-main.o:(.bss+0x0): first defined here
/usr/bin/ld: tagdust-test_architectures.o:(.bss+0x0): multiple definition of rev_nuc_code'; tagdust-main.o:(.bss+0x0): first defined here /usr/bin/ld: tagdust-test_architectures.o:(.bss+0x20): multiple definition of nuc_code'; tagdust-main.o:(.bss+0x20): first defined here
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:788: tagdust] Error 1
make[2]: Leaving directory '/disk5/lyc/biosoft/tagdust-master/src'
make[1]: *** [Makefile:668: all] Error 2
make[1]: Leaving directory '/disk5/lyc/biosoft/tagdust-master/src'
make: *** [Makefile:352: all-recursive] Error 1

Core dump on simple example

Hi,
I'm trying to use tagdust on the simplest toy example I can imagine, but always get a core dump result.
Can you tell me what I'm doing wrong ?

Thank you.

Command:
./tagdust -1 B:AACGCTTC -2 R:N sample.fasta -o test

Input sequences (sample.fasta):

>M00234:812:000000000-J36YP:1:1102:17688:2041 1:N:0:GAGTGG
AAAACGCTTCCTTCCGGTACACTTACCATGTTACGACTTGTCTCCTCTATATAAATGCGTAGGGGTTTTAGTTAAATGTCCTTTGAAGTATACTTGAGGAGAGTGACGGGCGGTGTGAAGCGTTG

As you can see, the barcode is present at the 3rd position of the input sequence.
But I got this error:

$ ./tagdust -1 B:AACGCTTC -2 R:N  sample.fasta -o test 
[2020-05-22 12:08:27]	Tagdust 2.32, Copyright (C) 2013-2019 Timo Lassmann <[email protected]>
[2020-05-22 12:08:27]	cmd: ./tagdust -1 B:AACGCTTC -2 R:N -o test /home/ben/Dropbox/SPYGEN/DEMUX_TESTS/vsearc_merged_sample.fasta 
[2020-05-22 12:08:27]	Start Run
--------------------------------------------------
[2020-05-22 12:08:27]	Determining threshold for read0.
[2020-05-22 12:08:39]	Long sequence found. Need to realloc model...
[2020-05-22 12:09:13]	Selected Threshold:: 0.513514
Segmentation fault (core dumped)

tagdust segfaults when output files exists already.

tagdust segfaults when output files exists already.

It crashes in the free_read_structure(param->read_structure) call for read_structure->numseq_in_segment[0]:

$ tagdust -t 8 -e 0.1 -1 O:N -2 S:ACTCGAGCCGAGCAGGCGCGCCGATC -3 R:NNNNNNNNNNNNNNNNN -4 S:GGACCGGG -5 O:N -o test test.fastq.gz

[2019-12-19 17:13:02]	Tagdust 2.32, Copyright (C) 2013-2019 Timo Lassmann <[email protected]>
[2019-12-19 17:13:02]	cmd: tagdust -t 8 -e 0.1 -1 O:N -2 S:ACTCGAGCCGAGCAGGCGCGCCGATC -3 R:NNNNNNNNNNNNNNNNN -4 S:GGACCGGG -5 O:N -o test test.fastq.gz
[2019-12-19 17:13:02]	Start Run
--------------------------------------------------
[2019-12-19 17:13:03]	Determining threshold for read0.
[2019-12-19 17:13:08]	Long sequence found. Need to realloc model...
[2019-12-19 17:13:47]	Selected Threshold:: 0.015063
1
[2019-12-19 17:14:39]	ERROR: some output files already exists.
2
free_param: 1
free_param: 2
free_read_structure: 1
free_read_structure: 1  loop: 0
free_read_structure: 1  loop: 0 read_structure->numseq_in_segment
free_read_structure: 1  loop: 0 0
free_read_structure: 1  loop: 0 0 freed
free_read_structure: 1  loop: 1
free_read_structure: 1  loop: 1 read_structure->numseq_in_segment
free_read_structure: 1  loop: 1 0
free_read_structure: 1  loop: 1 0 freed
free_read_structure: 1  loop: 1 1
free_read_structure: 1  loop: 1 1 freed
free_read_structure: 1  loop: 2
free_read_structure: 1  loop: 2 read_structure->numseq_in_segment
free_read_structure: 1  loop: 2 0
free_read_structure: 1  loop: 2 0 freed
free_read_structure: 1  loop: 3
free_read_structure: 1  loop: 3 read_structure->numseq_in_segment
free_read_structure: 1  loop: 3 0
free_read_structure: 1  loop: 3 0 freed
free_read_structure: 1  loop: 3 1
free_read_structure: 1  loop: 3 1 freed
free_read_structure: 1  loop: 4
free_read_structure: 1  loop: 4 read_structure->numseq_in_segment
free_read_structure: 1  loop: 4 0
free_read_structure: 1  loop: 4 0 freed
free_read_structure: 2
free_read_structure: 3
free_read_structure: 4
free_read_structure: 5
free_read_structure: 6
free_param: 3
free_param: 3.1
free_read_structure: 1
free_read_structure: 1  loop: 1
Segmentation fault (core dumped)

"Debugging" code:

diff --git a/src/interface.c b/src/interface.c
index e18a80d..98ad7d6 100644
--- a/src/interface.c
+++ b/src/interface.c
@@ -710,6 +710,7 @@ int free_param(struct parameters* param)
         char logfile[200];
         FILE* outfile = 0;
         int i,status;
+        printf("free_param: 1\n");
         //if(param->log){
         if(param->outfile){
                 sprintf (logfile, "%s_logfile.txt",param->outfile);
@@ -723,6 +724,7 @@ int free_param(struct parameters* param)
                 fclose(outfile);

         }
+        printf("free_param: 2\n");
         if(param->read_structures){
                 for(i = 0; i < param->infiles;i++){
                         if(param->read_structures[i]){
@@ -731,24 +733,35 @@ int free_param(struct parameters* param)
                 }
                 MFREE(param->read_structures);
         }
+        printf("free_param: 3\n");

         if(param->read_structure){
+            printf("free_param: 3.1\n");
                 free_read_structure(param->read_structure);
+            printf("free_param: 3.2\n");
         }
+        printf("free_param: 4\n");
         if(param->read_structure_R1){
                 free_read_structure(param->read_structure_R1);
         }
+        printf("free_param: 5\n");
         if(param->read_structure_R2){
                 free_read_structure(param->read_structure_R2);
         }
+        printf("free_param: 6\n");
         if(param->confidence_thresholds){
                 MFREE(param->confidence_thresholds);
         }
+        printf("free_param: 7\n");

         MFREE (param->infile);
+        printf("free_param: 8\n");
         MFREE(param->messages);
+        printf("free_param: 9\n");
         MFREE(param->buffer);
+        printf("free_param: 10\n");
         MFREE(param);
+        printf("free_param: 11\n");
         return kslOK;
 ERROR:
         return status;
@@ -861,20 +874,32 @@ ERROR:
 void free_read_structure(struct read_structure* read_structure)
 {
         int i,j;
+        printf("free_read_structure: 1\n");
         for(i = 0; i < 10;i++){
                 if(read_structure->sequence_matrix[i]){
+        printf("free_read_structure: 1  loop: %d\n", i);
+        if (read_structure->numseq_in_segment) {
+            printf("free_read_structure: 1  loop: %d read_structure->numseq_in_segment\n", i);
+        }
                         for(j = 0; j < read_structure->numseq_in_segment[i];j++){
+        printf("free_read_structure: 1  loop: %d %d\n", i, j);
                                 MFREE(read_structure->sequence_matrix[i][j]);
+        printf("free_read_structure: 1  loop: %d %d freed\n", i, j);
                         }

                         MFREE(read_structure->sequence_matrix[i]);
                 }
         }
+        printf("free_read_structure: 2\n");
         MFREE(read_structure->sequence_matrix);

+        printf("free_read_structure: 3\n");
         MFREE(read_structure->numseq_in_segment );
+        printf("free_read_structure: 4\n");
         MFREE(read_structure->type);
+        printf("free_read_structure: 5\n");
         MFREE(read_structure);
+        printf("free_read_structure: 6\n");
 }


diff --git a/src/io.c b/src/io.c
index 5381950..4381f46 100644
--- a/src/io.c
+++ b/src/io.c
@@ -799,10 +799,14 @@ int print_all(struct read_info*** read_info_container,struct parameters* param,
 		i = check_for_existing_demultiplexed_files_multiple(param, num_out_reads);
 		if(i){
 			sprintf(param->buffer,"ERROR: some output files already exists.\n");
+			printf("1\n");
 			param->messages = append_message(param->messages, param->buffer);
+			printf("2\n");
 			free_param(param);
+			printf("3\n");
 			exit(EXIT_FAILURE);
 		}
+		printf("4\n");
 		
 		filemode[0] = 'w';
 		filemode[1] = 0;

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.