New upstream version 1.5.3+dfsg

parent 5ca905c2
This diff is collapsed.
...@@ -36,10 +36,12 @@ ...@@ -36,10 +36,12 @@
#else #else
#ifndef __MINGW32__
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <netinet/in.h>
#include <net/if.h> #include <net/if.h>
#endif
#include <unistd.h> #include <unistd.h>
#include <netinet/in.h>
#endif #endif
...@@ -768,7 +770,7 @@ int strcmp_number(char * s1, char * s2) ...@@ -768,7 +770,7 @@ int strcmp_number(char * s1, char * s2)
int mac_str(char * str_buff) int mac_str(char * str_buff)
{ {
#ifdef FREEBSD #if defined(FREEBSD) || defined(__MINGW32__)
return 1; return 1;
#else #else
#ifdef MACOS #ifdef MACOS
...@@ -980,10 +982,10 @@ double fast_fisher_test_one_side(unsigned int a, unsigned int b, unsigned int c, ...@@ -980,10 +982,10 @@ double fast_fisher_test_one_side(unsigned int a, unsigned int b, unsigned int c,
} }
int load_features_annotation(char * file_name, int file_type, char * gene_id_column, char * feature_name_column, int load_features_annotation(char * file_name, int file_type, char * gene_id_column, char * transcript_id_column, char * used_feature_type,
void * context, int do_add_feature(char * gene_name, char * chro_name, unsigned int start, unsigned int end, int is_negative_strand, void * context) ){ void * context, int do_add_feature(char * gene_name, char * transcript_name, char * chro_name, unsigned int start, unsigned int end, int is_negative_strand, void * context) ){
char * file_line = malloc(MAX_LINE_LENGTH+1); char * file_line = malloc(MAX_LINE_LENGTH+1);
int lineno = 0, is_GFF_warned = 0, loaded_features = 0; int lineno = 0, is_GFF_txid_warned = 0, is_GFF_geneid_warned = 0, loaded_features = 0;
FILE * fp = fopen(file_name, "r"); FILE * fp = fopen(file_name, "r");
if(NULL == fp){ if(NULL == fp){
...@@ -992,9 +994,9 @@ int load_features_annotation(char * file_name, int file_type, char * gene_id_col ...@@ -992,9 +994,9 @@ int load_features_annotation(char * file_name, int file_type, char * gene_id_col
} }
while(1){ while(1){
int is_gene_id_found = 0, is_negative_strand = -1; int is_tx_id_found = 0, is_gene_id_found = 0, is_negative_strand = -1;
char * token_temp = NULL, * feature_name, * chro_name = NULL; char * token_temp = NULL, * feature_name, *transcript_id = NULL, * chro_name = NULL;
char feature_name_tmp[FEATURE_NAME_LENGTH]; char feature_name_tmp[FEATURE_NAME_LENGTH], txid_tmp[FEATURE_NAME_LENGTH];
feature_name = feature_name_tmp; feature_name = feature_name_tmp;
unsigned int start = 0, end = 0; unsigned int start = 0, end = 0;
...@@ -1049,7 +1051,7 @@ int load_features_annotation(char * file_name, int file_type, char * gene_id_col ...@@ -1049,7 +1051,7 @@ int load_features_annotation(char * file_name, int file_type, char * gene_id_col
strtok_r(NULL,"\t", &token_temp);// source strtok_r(NULL,"\t", &token_temp);// source
char * feature_type = strtok_r(NULL,"\t", &token_temp);// feature_type char * feature_type = strtok_r(NULL,"\t", &token_temp);// feature_type
if(strcmp(feature_type, feature_name_column)==0){ if(strcmp(feature_type, used_feature_type)==0){
char * start_ptr = strtok_r(NULL,"\t", &token_temp); char * start_ptr = strtok_r(NULL,"\t", &token_temp);
char * end_ptr = strtok_r(NULL,"\t", &token_temp); char * end_ptr = strtok_r(NULL,"\t", &token_temp);
...@@ -1084,23 +1086,37 @@ int load_features_annotation(char * file_name, int file_type, char * gene_id_col ...@@ -1084,23 +1086,37 @@ int load_features_annotation(char * file_name, int file_type, char * gene_id_col
if(extra_attrs && (strlen(extra_attrs)>2)){ if(extra_attrs && (strlen(extra_attrs)>2)){
int attr_val_len = GTF_extra_column_value(extra_attrs , gene_id_column , feature_name_tmp, FEATURE_NAME_LENGTH); int attr_val_len = GTF_extra_column_value(extra_attrs , gene_id_column , feature_name_tmp, FEATURE_NAME_LENGTH);
if(attr_val_len>0) is_gene_id_found=1; if(attr_val_len>0) is_gene_id_found=1;
if(transcript_id_column){
transcript_id = txid_tmp;
attr_val_len = GTF_extra_column_value(extra_attrs , transcript_id_column , txid_tmp, FEATURE_NAME_LENGTH);
if(attr_val_len>0) is_tx_id_found=1;
else transcript_id = NULL;
}
} }
if(!is_gene_id_found){ if(!is_gene_id_found){
if(!is_GFF_warned) if(!is_GFF_geneid_warned){
{
int ext_att_len = strlen(extra_attrs); int ext_att_len = strlen(extra_attrs);
if(extra_attrs[ext_att_len-1] == '\n') extra_attrs[ext_att_len-1] =0; if(extra_attrs[ext_att_len-1] == '\n') extra_attrs[ext_att_len-1] =0;
SUBREADprintf("\nWarning: failed to find the gene identifier attribute in the 9th column of the provided GTF file.\nThe specified gene identifier attribute is '%s' \nThe attributes included in your GTF annotation are '%s' \n\n", gene_id_column, extra_attrs); SUBREADprintf("\nWarning: failed to find the gene identifier attribute in the 9th column of the provided GTF file.\nThe specified gene identifier attribute is '%s' \nThe attributes included in your GTF annotation are '%s' \n\n", gene_id_column, extra_attrs);
} }
is_GFF_warned++; is_GFF_geneid_warned++;
} }
if(transcript_id_column && !is_tx_id_found){
if(!is_GFF_txid_warned){
int ext_att_len = strlen(extra_attrs);
if(extra_attrs[ext_att_len-1] == '\n') extra_attrs[ext_att_len-1] =0;
SUBREADprintf("\nWarning: failed to find the transcript identifier attribute in the 9th column of the provided GTF file.\nThe specified gene identifier attribute is '%s' \nThe attributes included in your GTF annotation are '%s' \n\n", transcript_id_column, extra_attrs);
}
is_GFF_txid_warned++;
}
} }
} }
if(is_gene_id_found){ if(is_gene_id_found){
do_add_feature(feature_name, chro_name, start, end, is_negative_strand, context); do_add_feature(feature_name, transcript_id, chro_name, start, end, is_negative_strand, context);
loaded_features++; loaded_features++;
} }
......
...@@ -71,8 +71,8 @@ unsigned int find_left_end_cigar(unsigned int right_pos, char * cigar); ...@@ -71,8 +71,8 @@ unsigned int find_left_end_cigar(unsigned int right_pos, char * cigar);
int mac_or_rand_str(char * char_14); int mac_or_rand_str(char * char_14);
double fast_fisher_test_one_side(unsigned int a, unsigned int b, unsigned int c, unsigned int d, long double * frac_buffer, int buffer_size); double fast_fisher_test_one_side(unsigned int a, unsigned int b, unsigned int c, unsigned int d, long double * frac_buffer, int buffer_size);
int load_features_annotation(char * file_name, int file_type, char * gene_id_column, char * feature_name_column, int load_features_annotation(char * file_name, int file_type, char * gene_id_column, char * transcript_id_column, char * used_feature_type,
void * context, int do_add_feature(char * gene_name, char * chro_name, unsigned int start, unsigned int end, int is_negative_strand, void * context) ); void * context, int do_add_feature(char * gene_name, char * transcript_id, char * chrome_name, unsigned int start, unsigned int end, int is_negative_strand, void * context) );
HashTable * load_alias_table(char * fname) ; HashTable * load_alias_table(char * fname) ;
#endif #endif
...@@ -3,7 +3,7 @@ include makefile.version ...@@ -3,7 +3,7 @@ include makefile.version
MACOS = -D FREEBSD MACOS = -D FREEBSD
CCFLAGS = -march=native -mtune=core2 ${MACOS} -O9 -Wall -DMAKE_FOR_EXON -D MAKE_STANDALONE -D SUBREAD_VERSION=\"${SUBREAD_VERSION}\" CCFLAGS = -march=native -mtune=core2 ${MACOS} -O9 -Wall -Wno-maybe-uninitialized -Wno-incompatible-pointer-types -Wno-array-bounds -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unused-result -DMAKE_FOR_EXON -D MAKE_STANDALONE -D SUBREAD_VERSION=\"${SUBREAD_VERSION}\"
LDFLAGS = -pthread -lz -lm ${MACOS} -DMAKE_FOR_EXON -D MAKE_STANDALONE -l compat # -DREPORT_ALL_THE_BEST LDFLAGS = -pthread -lz -lm ${MACOS} -DMAKE_FOR_EXON -D MAKE_STANDALONE -l compat # -DREPORT_ALL_THE_BEST
CC = gcc ${CCFLAGS} -ggdb -fomit-frame-pointer -ffast-math -funroll-loops -mmmx -msse -msse2 -msse3 -fmessage-length=0 CC = gcc ${CCFLAGS} -ggdb -fomit-frame-pointer -ffast-math -funroll-loops -mmmx -msse -msse2 -msse3 -fmessage-length=0
...@@ -14,20 +14,23 @@ ALL_OBJECTS=$(addsuffix .o, ${ALL_LIBS}) ...@@ -14,20 +14,23 @@ ALL_OBJECTS=$(addsuffix .o, ${ALL_LIBS})
ALL_H=$(addsuffix .h, ${ALL_LIBS}) ALL_H=$(addsuffix .h, ${ALL_LIBS})
ALL_C=$(addsuffix .c, ${ALL_LIBS}) ALL_C=$(addsuffix .c, ${ALL_LIBS})
all: featureCounts removeDup exactSNP subread-buildindex subindel subread-align subjunc subtools qualityScores subread-fullscan propmapped coverageCount all: repair featureCounts removeDup exactSNP subread-buildindex subindel subread-align subjunc subtools qualityScores subread-fullscan propmapped coverageCount
mkdir -p ../bin/utilities mkdir -p ../bin/utilities
mv subread-align subjunc featureCounts subindel exactSNP subread-buildindex ../bin/ mv subread-align subjunc featureCounts subindel exactSNP subread-buildindex ../bin/
mv coverageCount subtools qualityScores propmapped subread-fullscan removeDup ../bin/utilities mv repair coverageCount subtools qualityScores propmapped subread-fullscan removeDup ../bin/utilities
@echo @echo
@echo "###########################################################" @echo "###########################################################"
@echo "# #" @echo "# #"
@echo "# Installation complete. #" @echo "# Installation successfully complete. #"
@echo "# #" @echo "# #"
@echo "# Generated executables were copied to directory ../bin/ #" @echo "# Generated executables were copied to directory ../bin/ #"
@echo "# #" @echo "# #"
@echo "###########################################################" @echo "###########################################################"
@echo @echo
repair: read-repair.c ${ALL_OBJECTS}
${CC} -o repair read-repair.c ${ALL_OBJECTS} ${LDFLAGS}
propmapped: propmapped.c ${ALL_OBJECTS} propmapped: propmapped.c ${ALL_OBJECTS}
${CC} -o propmapped propmapped.c ${ALL_OBJECTS} ${LDFLAGS} ${CC} -o propmapped propmapped.c ${ALL_OBJECTS} ${LDFLAGS}
......
...@@ -3,10 +3,10 @@ ...@@ -3,10 +3,10 @@
include makefile.version include makefile.version
OPT_LEVEL = 3 OPT_LEVEL = 3
CCFLAGS = -mtune=core2 ${MACOS} -O${OPT_LEVEL} -Wall -DMAKE_FOR_EXON -D MAKE_STANDALONE -D SUBREAD_VERSION=\"${SUBREAD_VERSION}\" -D_FILE_OFFSET_BITS=64 CCFLAGS = -mtune=core2 ${MACOS} -O${OPT_LEVEL} -DMAKE_FOR_EXON -D MAKE_STANDALONE -D SUBREAD_VERSION=\"${SUBREAD_VERSION}\" -D_FILE_OFFSET_BITS=64 # -w
LDFLAGS = ${STATIC_MAKE} -lpthread -lz -lm ${MACOS} -O${OPT_LEVEL} -DMAKE_FOR_EXON -D MAKE_STANDALONE # -DREPORT_ALL_THE_BEST LDFLAGS = ${STATIC_MAKE} -pthread -lz -lm ${MACOS} -O${OPT_LEVEL} -DMAKE_FOR_EXON -D MAKE_STANDALONE
CC_EXEC = gcc CC_EXEC = gcc
CC = ${CC_EXEC} ${CCFLAGS} -fmessage-length=0 -ggdb # -fomit-frame-pointer -ffast-math -funroll-loops -mmmx -msse -msse2 -msse3 -fmessage-length=0 CC = ${CC_EXEC} ${CCFLAGS} -fmessage-length=0 -ggdb
ALL_LIBS= core core-junction core-indel sambam-file sublog gene-algorithms hashtable input-files sorted-hashtable gene-value-index exon-algorithms HelperFunctions interval_merge long-hashtable core-bigtable seek-zlib ALL_LIBS= core core-junction core-indel sambam-file sublog gene-algorithms hashtable input-files sorted-hashtable gene-value-index exon-algorithms HelperFunctions interval_merge long-hashtable core-bigtable seek-zlib
...@@ -14,20 +14,26 @@ ALL_OBJECTS=$(addsuffix .o, ${ALL_LIBS}) ...@@ -14,20 +14,26 @@ ALL_OBJECTS=$(addsuffix .o, ${ALL_LIBS})
ALL_H=$(addsuffix .h, ${ALL_LIBS}) ALL_H=$(addsuffix .h, ${ALL_LIBS})
ALL_C=$(addsuffix .c, ${ALL_LIBS}) ALL_C=$(addsuffix .c, ${ALL_LIBS})
all: repair featureCounts removeDup exactSNP subread-buildindex subindel subread-align subjunc qualityScores subread-fullscan propmapped coverageCount # samMappedBases mergeVCF testZlib all: repair txUnique featureCounts removeDup exactSNP subread-buildindex subindel subread-align subjunc qualityScores subread-fullscan propmapped coverageCount # samMappedBases mergeVCF testZlib
mkdir -p ../bin/utilities mkdir -p ../bin/utilities
mv subread-align subjunc featureCounts subindel exactSNP subread-buildindex ../bin/ mv subread-align subjunc featureCounts subindel exactSNP subread-buildindex ../bin/
mv repair coverageCount propmapped qualityScores removeDup subread-fullscan ../bin/utilities mv repair coverageCount propmapped qualityScores removeDup subread-fullscan txUnique ../bin/utilities
@echo @echo
@echo "###########################################################" @echo "###########################################################"
@echo "# #" @echo "# #"
@echo "# Installation complete. #" @echo "# Installation successfully complete. #"
@echo "# #" @echo "# #"
@echo "# Generated executables were copied to directory ../bin/ #" @echo "# Generated executables were copied to directory ../bin/ #"
@echo "# #" @echo "# #"
@echo "###########################################################" @echo "###########################################################"
@echo @echo
repair: read-repair.c ${ALL_OBJECTS}
${CC} -o repair read-repair.c ${ALL_OBJECTS} ${LDFLAGS}
txUnique: tx-unique.c tx-unique.h ${ALL_OBJECTS}
${CC} -o txUnique tx-unique.c ${ALL_OBJECTS} ${LDFLAGS}
globalReassembly: global-reassembly.c ${ALL_OBJECTS} globalReassembly: global-reassembly.c ${ALL_OBJECTS}
${CC} -o globalReassembly global-reassembly.c ${ALL_OBJECTS} ${LDFLAGS} ${CC} -o globalReassembly global-reassembly.c ${ALL_OBJECTS} ${LDFLAGS}
...@@ -67,16 +73,5 @@ subread-fullscan: fullscan.c ${ALL_OBJECTS} ...@@ -67,16 +73,5 @@ subread-fullscan: fullscan.c ${ALL_OBJECTS}
coverageCount: coverage_calc.c ${ALL_OBJECTS} coverageCount: coverage_calc.c ${ALL_OBJECTS}
${CC} -o coverageCount coverage_calc.c ${ALL_OBJECTS} ${LDFLAGS} ${CC} -o coverageCount coverage_calc.c ${ALL_OBJECTS} ${LDFLAGS}
#testZlib: test-seek-zlib.c ${ALL_OBJECTS}
# ${CC} -o testZlib test-seek-zlib.c ${ALL_OBJECTS} ${LDFLAGS}
repair: read-repair.c ${ALL_OBJECTS}
${CC} -o repair read-repair.c ${ALL_OBJECTS} ${LDFLAGS}
#samMappedBases: samMappedBases.c ${ALL_OBJECTS}
# ${CC} -o samMappedBases samMappedBases.c ${ALL_OBJECTS} ${LDFLAGS}
#mergeVCF: mergeVCF.c ${ALL_OBJECTS}
# ${CC} -o mergeVCF mergeVCF.c ${ALL_OBJECTS} ${LDFLAGS}
clean: clean:
rm -f core featureCounts exactSNP removeDup subread-buildindex ${ALL_OBJECTS} rm -f core featureCounts exactSNP removeDup subread-buildindex ${ALL_OBJECTS}
MACOS = -D MACOS MACOS = -D MACOS
include makefile.version include makefile.version
CCFLAGS = -mtune=core2 ${MACOS} -O9 -Wall -DMAKE_FOR_EXON -D MAKE_STANDALONE -D SUBREAD_VERSION=\"${SUBREAD_VERSION}\" -D_FILE_OFFSET_BITS=64 CCFLAGS = -mtune=core2 ${MACOS} -O9 -w -DMAKE_FOR_EXON -D MAKE_STANDALONE -D SUBREAD_VERSION=\"${SUBREAD_VERSION}\" -D_FILE_OFFSET_BITS=64
LDFLAGS = -pthread -lz -lm ${MACOS} -DMAKE_FOR_EXON -D MAKE_STANDALONE # -DREPORT_ALL_THE_BEST LDFLAGS = -pthread -lz -lm ${MACOS} -DMAKE_FOR_EXON -D MAKE_STANDALONE # -DREPORT_ALL_THE_BEST
CC = gcc ${CCFLAGS} ${STATIC_MAKE} -ggdb -fomit-frame-pointer -O3 -ffast-math -funroll-loops -mmmx -msse -msse2 -msse3 -fmessage-length=0 CC = gcc ${CCFLAGS} ${STATIC_MAKE} -ggdb -fomit-frame-pointer -O3 -ffast-math -funroll-loops -mmmx -msse -msse2 -msse3 -fmessage-length=0
...@@ -18,7 +18,7 @@ all: repair featureCounts removeDup exactSNP subread-buildindex subindel subrea ...@@ -18,7 +18,7 @@ all: repair featureCounts removeDup exactSNP subread-buildindex subindel subrea
@echo @echo
@echo "###########################################################" @echo "###########################################################"
@echo "# #" @echo "# #"
@echo "# Installation complete. #" @echo "# Installation successfully complete. #"
@echo "# #" @echo "# #"
@echo "# Generated executables were copied to directory ../bin/ #" @echo "# Generated executables were copied to directory ../bin/ #"
@echo "# #" @echo "# #"
...@@ -27,7 +27,7 @@ all: repair featureCounts removeDup exactSNP subread-buildindex subindel subrea ...@@ -27,7 +27,7 @@ all: repair featureCounts removeDup exactSNP subread-buildindex subindel subrea
repair: read-repair.c ${ALL_OBJECTS} repair: read-repair.c ${ALL_OBJECTS}
${CC} -o repair read-repair.c ${ALL_OBJECTS} ${LDFLAGS} ${CC} -o repair read-repair.c ${ALL_OBJECTS} ${LDFLAGS}
propmapped: propmapped.c ${ALL_OBJECTS} propmapped: propmapped.c ${ALL_OBJECTS}
${CC} -o propmapped propmapped.c ${ALL_OBJECTS} ${LDFLAGS} ${CC} -o propmapped propmapped.c ${ALL_OBJECTS} ${LDFLAGS}
......
...@@ -1117,13 +1117,6 @@ int finalise_indel_and_junction_thread(global_context_t * global_context, thread ...@@ -1117,13 +1117,6 @@ int finalise_indel_and_junction_thread(global_context_t * global_context, thread
prev_env = this_event; prev_env = this_event;
} }
if(0){
for(xk1 = 0; xk1 < merge_target_items; xk1++){
chromosome_event_t * pev = merge_target + xk1;
printf("OCT27-MERGERES: %u~%u, indel=%d, nsup=%d, TYPE=%d\n",pev->event_small_side, pev->event_large_side, pev->indel_length, pev->supporting_reads, pev->event_type);
}
}
free(records); free(records);
if(thread_contexts) if(thread_contexts)
...@@ -1238,7 +1231,7 @@ typedef struct { ...@@ -1238,7 +1231,7 @@ typedef struct {
HashTable * feature_sorting_table; HashTable * feature_sorting_table;
} do_load_juncs_context_t; } do_load_juncs_context_t;
int do_juncs_add_feature(char * gene_name, char * chro_name, unsigned int feature_start, unsigned int feature_end, int is_negative_strand, void * context){ int do_juncs_add_feature(char * gene_name, char * transcript_id, char * chro_name, unsigned int feature_start, unsigned int feature_end, int is_negative_strand, void * context){
//#warning ">>>>>>> COMMENt NEXT <<<<<<<<<<<<<<" //#warning ">>>>>>> COMMENt NEXT <<<<<<<<<<<<<<"
//SUBREADprintf("INJ LOCS: %s : %u, %u\n", chro_name, feature_start, feature_end); //SUBREADprintf("INJ LOCS: %s : %u, %u\n", chro_name, feature_start, feature_end);
do_load_juncs_context_t * do_load_juncs_context = context; do_load_juncs_context_t * do_load_juncs_context = context;
...@@ -1336,8 +1329,7 @@ int load_known_junctions(global_context_t * global_context){ ...@@ -1336,8 +1329,7 @@ int load_known_junctions(global_context_t * global_context){
do_load_juncs_context.global_context = global_context; do_load_juncs_context.global_context = global_context;
do_load_juncs_context.feature_sorting_table = feature_sorting_table; do_load_juncs_context.feature_sorting_table = feature_sorting_table;
int features = load_features_annotation(global_context->config.exon_annotation_file , global_context->config.exon_annotation_file_type, global_context->config.exon_annotation_gene_id_column, global_context->config.exon_annotation_feature_name_column, int features = load_features_annotation(global_context->config.exon_annotation_file , global_context->config.exon_annotation_file_type, global_context->config.exon_annotation_gene_id_column, NULL, global_context->config.exon_annotation_feature_name_column, &do_load_juncs_context, do_juncs_add_feature);
&do_load_juncs_context, do_juncs_add_feature);
feature_sorting_table -> appendix1 = global_context; feature_sorting_table -> appendix1 = global_context;
HashTableIteration(feature_sorting_table, add_annotation_to_junctions); HashTableIteration(feature_sorting_table, add_annotation_to_junctions);
...@@ -1476,22 +1468,9 @@ int search_event(global_context_t * global_context, HashTable * event_table, chr ...@@ -1476,22 +1468,9 @@ int search_event(global_context_t * global_context, HashTable * event_table, chr
} }
//#warning ">>>>>>>>>>>>>> COMMENT THIS <<<<<<<<<<<<<<<<<<<<<<<<<<<<" //#warning ">>>>>>>>>>>>>> COMMENT THIS <<<<<<<<<<<<<<<<<<<<<<<<<<<<"
if(0){
indel_context_t * indel_context = (indel_context_t *) global_context -> module_contexts[MODULE_INDEL_ID];
chromosome_event_t * est = indel_context -> event_space_dynamic;
if(est == event_space)
printf("OCT27-STEPRS-EVENT_HIT= %u ; HIT=%d\n", pos, xk2);
}
}else{ }else{
//#warning ">>>>>>>>>>>>>> COMMENT THIS <<<<<<<<<<<<<<<<<<<<<<<<<<<<" //#warning ">>>>>>>>>>>>>> COMMENT THIS <<<<<<<<<<<<<<<<<<<<<<<<<<<<"
if(0){
indel_context_t * indel_context = (indel_context_t *) global_context -> module_contexts[MODULE_INDEL_ID];
chromosome_event_t * est = indel_context -> event_space_dynamic;
if(est == event_space)
printf("OCT27-STEPRS-EVENT_HIT= %u ; HIT=0000\n", pos);
}
} }
return ret; return ret;
...@@ -2275,7 +2254,7 @@ void print_indel_table(global_context_t * global_context){ ...@@ -2275,7 +2254,7 @@ void print_indel_table(global_context_t * global_context){
for(xk1 = 0; xk1 < indel_context -> total_events ; xk1++){ for(xk1 = 0; xk1 < indel_context -> total_events ; xk1++){
chromosome_event_t * event_body = indel_context -> event_space_dynamic +xk1; chromosome_event_t * event_body = indel_context -> event_space_dynamic +xk1;
printf("OCT27-STEP-INTAB-TYPE-%d POS %u~%u GID=%u PV %d %d SUP %d / %d\n", event_body -> event_type, event_body -> event_small_side, event_body -> event_large_side, event_body -> global_event_id, event_body -> connected_next_event_distance, event_body -> connected_previous_event_distance , event_body -> supporting_reads , event_body -> anti_supporting_reads); //printf("OCT27-STEP-INTAB-TYPE-%d POS %u~%u GID=%u PV %d %d SUP %d / %d\n", event_body -> event_type, event_body -> event_small_side, event_body -> event_large_side, event_body -> global_event_id, event_body -> connected_next_event_distance, event_body -> connected_previous_event_distance , event_body -> supporting_reads , event_body -> anti_supporting_reads);
} }
int bucket; int bucket;
...@@ -2288,7 +2267,7 @@ void print_indel_table(global_context_t * global_context){ ...@@ -2288,7 +2267,7 @@ void print_indel_table(global_context_t * global_context){
int env_i; int env_i;
for(env_i = 1; env_array[env_i]; env_i++){ for(env_i = 1; env_array[env_i]; env_i++){
chromosome_event_t * event_body = indel_context -> event_space_dynamic + (env_array[env_i]-1); chromosome_event_t * event_body = indel_context -> event_space_dynamic + (env_array[env_i]-1);
printf("OCT27-STEPQ-ENTAB-%u [%d] to %u ~ %u len=%d VAL=%d PTR=%p\n",entry_pos, env_i, event_body -> event_small_side, event_body -> event_large_side, event_body -> indel_length, env_array[env_i], env_array); // printf("OCT27-STEPQ-ENTAB-%u [%d] to %u ~ %u len=%d VAL=%d PTR=%p\n",entry_pos, env_i, event_body -> event_small_side, event_body -> event_large_side, event_body -> indel_length, env_array[env_i], env_array);
} }
cursor = cursor->next; cursor = cursor->next;
...@@ -2327,8 +2306,8 @@ int write_indel_final_results(global_context_t * global_context) ...@@ -2327,8 +2306,8 @@ int write_indel_final_results(global_context_t * global_context)
chromosome_event_t * event_body = indel_context -> event_space_dynamic +xk1; chromosome_event_t * event_body = indel_context -> event_space_dynamic +xk1;
//#warning " ================= REMOVE '- 1' from the next LINE!!! =========================" //#warning " ================= REMOVE '- 1' from the next LINE!!! ========================="
if((event_body -> event_type != CHRO_EVENT_TYPE_INDEL && event_body->event_type != CHRO_EVENT_TYPE_LONG_INDEL && event_body -> event_type != CHRO_EVENT_TYPE_POTENTIAL_INDEL)|| (event_body -> final_counted_reads < 1 && event_body -> event_type == CHRO_EVENT_TYPE_INDEL) ) if((event_body -> event_type != CHRO_EVENT_TYPE_INDEL && event_body->event_type != CHRO_EVENT_TYPE_LONG_INDEL && event_body -> event_type != CHRO_EVENT_TYPE_POTENTIAL_INDEL)|| (event_body -> final_counted_reads < 1 && event_body -> event_type == CHRO_EVENT_TYPE_INDEL) )
continue; continue;
//assert((-event_body -> indel_length) < MAX_INSERTION_LENGTH); //assert((-event_body -> indel_length) < MAX_INSERTION_LENGTH);
...@@ -4451,6 +4430,7 @@ void init_global_context(global_context_t * context) ...@@ -4451,6 +4430,7 @@ void init_global_context(global_context_t * context)
context->config.do_fusion_detection = 0; context->config.do_fusion_detection = 0;
context->config.do_structural_variance_detection = 0; context->config.do_structural_variance_detection = 0;
context->config.more_accurate_fusions = 1; context->config.more_accurate_fusions = 1;
context->config.report_multi_mapping_reads = 0;
//#warning "============= best values for the SVs application: 8; 5; 32 ===============" //#warning "============= best values for the SVs application: 8; 5; 32 ==============="
context->config.top_scores = 8 - 5; context->config.top_scores = 8 - 5;
...@@ -4471,7 +4451,6 @@ void init_global_context(global_context_t * context) ...@@ -4471,7 +4451,6 @@ void init_global_context(global_context_t * context)
context->will_remove_input_file = 0; context->will_remove_input_file = 0;
context->config.ignore_unmapped_reads = 0; context->config.ignore_unmapped_reads = 0;
context->config.report_unmapped_using_mate_pos = 1; context->config.report_unmapped_using_mate_pos = 1;
context->config.report_multi_mapping_reads = 1;
context->config.downscale_mapping_quality=0; context->config.downscale_mapping_quality=0;
context->config.ambiguous_mapping_tolerance = 39; context->config.ambiguous_mapping_tolerance = 39;
context->config.use_hamming_distance_break_ties = 0; context->config.use_hamming_distance_break_ties = 0;
......
...@@ -59,6 +59,7 @@ static struct option long_options[] = ...@@ -59,6 +59,7 @@ static struct option long_options[] =
{"complexIndels", no_argument, 0, 0}, {"complexIndels", no_argument, 0, 0},
{"minVoteCutoff", required_argument, 0, 0}, {"minVoteCutoff", required_argument, 0, 0},
{"maxRealignLocations", required_argument, 0, 0}, {"maxRealignLocations", required_argument, 0, 0},
{"multiMapping", no_argument, 0, 0},
{0, 0, 0, 0} {0, 0, 0, 0}
}; };
...@@ -68,15 +69,15 @@ void print_usage_core_aligner() ...@@ -68,15 +69,15 @@ void print_usage_core_aligner()
SUBREADprintf("\nVersion %s\n\n", SUBREAD_VERSION); SUBREADprintf("\nVersion %s\n\n", SUBREAD_VERSION);
SUBREADputs("Usage:"); SUBREADputs("Usage:");
SUBREADputs(""); SUBREADputs("");
SUBREADputs("./subread-align [options] -i <index_name> -r <input> -t <type> -o <output>"); SUBREADputs("./subread-align [options] -i <index_name> -r <input> -t <type> -o <output>");
SUBREADputs(""); SUBREADputs("");
SUBREADputs("## Mandatory arguments:"); SUBREADputs("## Mandatory arguments:");
SUBREADputs(" "); SUBREADputs(" ");
SUBREADputs(" -i <string> Base name of the index."); SUBREADputs(" -i <string> Base name of the index.");
SUBREADputs(""); SUBREADputs("");
SUBREADputs(" -r <string> Name of an input read file. If paired-end, this should be"); SUBREADputs(" -r <string> Name of an input read file. If paired-end, this should be");
SUBREADputs(" the first read file (typically containing ‘R1’ in the file"); SUBREADputs(" the first read file (typically containing \"R1\"in the file");
SUBREADputs(" name) and the second should be provided via ‘-R’."); SUBREADputs(" name) and the second should be provided via \"-R\".");
SUBREADputs(" Acceptable formats include gzipped FASTQ, FASTQ and FASTA."); SUBREADputs(" Acceptable formats include gzipped FASTQ, FASTQ and FASTA.");
SUBREADputs(" These formats are identified automatically."); SUBREADputs(" These formats are identified automatically.");
SUBREADputs(" "); SUBREADputs(" ");
...@@ -92,15 +93,15 @@ void print_usage_core_aligner() ...@@ -92,15 +93,15 @@ void print_usage_core_aligner()
SUBREADputs(" STDOUT."); SUBREADputs(" STDOUT.");
SUBREADputs(""); SUBREADputs("");
SUBREADputs(" -R <string> Name of the second read file in paired-end data (typically"); SUBREADputs(" -R <string> Name of the second read file in paired-end data (typically");
SUBREADputs(" containing ‘R2’ in the file name)."); SUBREADputs(" containing \"R2\" the file name).");
SUBREADputs(""); SUBREADputs("");
SUBREADputs(" --SAMinput Input reads are in SAM format."); SUBREADputs(" --SAMinput Input reads are in SAM format.");
SUBREADputs(""); SUBREADputs("");
SUBREADputs(" --BAMinput Input reads are in BAM format."); SUBREADputs(" --BAMinput Input reads are in BAM format.");
SUBREADputs(""); SUBREADputs("");
SUBREADputs(" --SAMoutput Save mapping results in SAM format."); SUBREADputs(" --SAMoutput Save mapping results in SAM format.");
SUBREADputs(""); SUBREADputs("");
SUBREADputs("# offset value added to Phred quality scores of read bases"); SUBREADputs("# Phred offset");
SUBREADputs(""); SUBREADputs("");
SUBREADputs(" -P <3:6> Offset value added to the Phred quality score of each read"); SUBREADputs(" -P <3:6> Offset value added to the Phred quality score of each read");
SUBREADputs(" base. '3' for phred+33 and '6' for phred+64. '3' by default."); SUBREADputs(" base. '3' for phred+33 and '6' for phred+64. '3' by default.");
...@@ -124,14 +125,13 @@ void print_usage_core_aligner() ...@@ -124,14 +125,13 @@ void print_usage_core_aligner()
SUBREADputs(""); SUBREADputs("");
SUBREADputs("# unique mapping and multi-mapping"); SUBREADputs("# unique mapping and multi-mapping");
SUBREADputs(""); SUBREADputs("");
SUBREADputs(" -u Report uniquely mapped reads only. Number of matched bases ("); SUBREADputs(" --multiMapping Report multi-mapping reads in addition to uniquely mapped");
SUBREADputs(" for RNA-seq) or mis-matched bases(for genomic DNA-seq) is"); SUBREADputs(" reads. Use \"-B\" to set the maximum number of equally-best");
SUBREADputs(" used to break the tie when multiple mapping locations are"); SUBREADputs(" alignments to be reported.");
SUBREADputs(" found.");
SUBREADputs(""); SUBREADputs("");
SUBREADputs(" -B <int> Maximal number of equally-best mapping locations to be"); SUBREADputs(" -B <int> Maximum number of equally-best alignments to be reported for");
SUBREADputs(" reported. 1 by default. Note that -u option takes precedence"); SUBREADputs(" a multi-mapping read. Equally-best alignments have the same");
SUBREADputs(" over -B."); SUBREADputs(" number of mis-matched bases. 1 by default.");
SUBREADputs(""); SUBREADputs("");
SUBREADputs("# indel detection"); SUBREADputs("# indel detection");
SUBREADputs(""); SUBREADputs("");
...@@ -317,6 +317,7 @@ int parse_opts_aligner(int argc , char ** argv, global_context_t * global_contex ...@@ -317,6 +317,7 @@ int parse_opts_aligner(int argc , char ** argv, global_context_t * global_contex
global_context->config.max_vote_combinations = max(global_context->config.max_vote_combinations, global_context->config.reported_multi_best_reads + 1); global_context->config.max_vote_combinations = max(global_context->config.max_vote_combinations, global_context->config.reported_multi_best_reads + 1);
global_context->config.max_vote_simples = max(global_context->config.max_vote_simples, global_context->config.reported_multi_best_reads + 1); global_context->config.max_vote_simples = max(global_context->config.max_vote_simples, global_context->config.reported_multi_best_reads + 1);
global_context->config.report_multi_mapping_reads = 1;
break; break;
case 'H': case 'H':
global_context->config.use_hamming_distance_break_ties = 1; global_context->config.use_hamming_distance_break_ties = 1;
...@@ -347,10 +348,6 @@ int parse_opts_aligner(int argc , char ** argv, global_context_t * global_contex ...@@ -347,10 +348,6 @@ int parse_opts_aligner(int argc , char ** argv, global_context_t * global_contex
case 'U': case 'U':
global_context->config.report_no_unpaired_reads = 1; global_context->config.report_no_unpaired_reads = 1;
break; break;
case 'u':
global_context->config.report_multi_mapping_reads = 0;
global_context->config.use_hamming_distance_break_ties = 1;
break;
case 'b': case 'b':
global_context->config.convert_color_to_base = 1; global_context->config.convert_color_to_base = 1;
break; break;
...@@ -466,7 +463,11 @@ int parse_opts_aligner(int argc , char ** argv, global_context_t * global_contex ...@@ -466,7 +463,11 @@ int parse_opts_aligner(int argc , char ** argv, global_context_t * global_contex
break; break;
case 0: case 0:
if(strcmp("memoryMultiplex", long_options[option_index].name)==0) if(strcmp("multiMapping", long_options[option_index].name)==0)
{
global_context->config.report_multi_mapping_reads = 1;
}
else if(strcmp("memoryMultiplex", long_options[option_index].name)==0)
{ {
global_context->config.memory_use_multiplex = atof(optarg); global_context->config.memory_use_multiplex = atof(optarg);
} }
......
...@@ -66,6 +66,7 @@ static struct option long_options[] = ...@@ -66,6 +66,7 @@ static struct option long_options[] =
{"minVoteCutoff", required_argument, 0, 0}, {"minVoteCutoff", required_argument, 0, 0},
{"minMappedFraction", required_argument, 0, 0}, {"minMappedFraction", required_argument, 0, 0},
{"complexIndels", no_argument, 0, 0}, {"complexIndels", no_argument, 0, 0},
{"multiMapping", no_argument, 0, 0},
{0, 0, 0, 0} {0, 0, 0, 0}
}; };
...@@ -81,10 +82,11 @@ void print_usage_core_subjunc() ...@@ -81,10 +82,11 @@ void print_usage_core_subjunc()
SUBREADputs(""); SUBREADputs("");
SUBREADputs(" -i <index> Base name of the index."); SUBREADputs(" -i <index> Base name of the index.");
SUBREADputs(""); SUBREADputs("");
SUBREADputs(" -r <string> Name of the input file. Input formats including gzipped"); SUBREADputs(" -r <string> Name of an input read file. If paired-end, this should be");
SUBREADputs(" fastq, fastq, and fasta can be automatically detected. If"); SUBREADputs(" the first read file (typically containing \"R1\"in the file");
SUBREADputs(" paired-end, this should give the name of file including"); SUBREADputs(" name) and the second should be provided via \"-R\".");
SUBREADputs(" first reads."); SUBREADputs(" Acceptable formats include gzipped FASTQ, FASTQ and FASTA.");
SUBREADputs(" These formats are identified automatically.");
SUBREADputs(""); SUBREADputs("");
SUBREADputs("## Optional arguments:"); SUBREADputs("## Optional arguments:");
SUBREADputs("# input reads and output"); SUBREADputs("# input reads and output");
...@@ -94,15 +96,15 @@ void print_usage_core_subjunc() ...@@ -94,15 +96,15 @@ void print_usage_core_subjunc()
SUBREADputs(" STDOUT."); SUBREADputs(" STDOUT.");
SUBREADputs(""); SUBREADputs("");
SUBREADputs(" -R <string> Name of the second read file in paired-end data (typically"); SUBREADputs(" -R <string> Name of the second read file in paired-end data (typically");
SUBREADputs(" containing ‘R2’ in the file name)."); SUBREADputs(" containing \"R2\" the file name).");
SUBREADputs(""); SUBREADputs("");
SUBREADputs(" --SAMinput Input reads are in SAM format."); SUBREADputs(" --SAMinput Input reads are in SAM format.");
SUBREADputs(""); SUBREADputs("");
SUBREADputs(" --BAMinput Input reads are in BAM format."); SUBREADputs(" --BAMinput Input reads are in BAM format.");
SUBREADputs(""); SUBREADputs("");
SUBREADputs(" --SAMoutput Save mapping results in SAM format."); SUBREADputs(" --SAMoutput Save mapping results in SAM format.");
SUBREADputs(""); SUBREADputs("");
SUBREADputs("# offset value added to Phred quality scores of read bases"); SUBREADputs("# Phred offset");
SUBREADputs(""); SUBREADputs("");
SUBREADputs(" -P <3:6> Offset value added to the Phred quality score of each read"); SUBREADputs(" -P <3:6> Offset value added to the Phred quality score of each read");
SUBREADputs(" base. '3' for phred+33 and '6' for phred+64. '3' by default."); SUBREADputs(" base. '3' for phred+33 and '6' for phred+64. '3' by default.");
...@@ -126,14 +128,13 @@ void print_usage_core_subjunc() ...@@ -126,14 +128,13 @@ void print_usage_core_subjunc()
SUBREADputs(""); SUBREADputs("");
SUBREADputs("# unique mapping and multi-mapping"); SUBREADputs("# unique mapping and multi-mapping");
SUBREADputs(""); SUBREADputs("");
SUBREADputs(" -u Report uniquely mapped reads only. Number of matched bases ("); SUBREADputs(" --multiMapping Report multi-mapping reads in addition to uniquely mapped");
SUBREADputs(" for RNA-seq) or mis-matched bases(for genomic DNA-seq) is"); SUBREADputs(" reads. Use \"-B\" to set the maximum number of equally-best");
SUBREADputs(" used to break the tie when multiple mapping locations are"); SUBREADputs(" alignments to be reported.");
SUBREADputs(" found.");
SUBREADputs(""); SUBREADputs("");
SUBREADputs(" -B <int> Maximal number of equally-best mapping locations to be"); SUBREADputs(" -B <int> Maximum number of equally-best alignments to be reported for");
SUBREADputs(" reported. 1 by default. Note that -u option takes precedence"); SUBREADputs(" a multi-mapping read. Equally-best alignments have the same");
SUBREADputs(" over -B."); SUBREADputs(" number of mis-matched bases. 1 by default.");
SUBREADputs(""); SUBREADputs("");
SUBREADputs("# indel detection"); SUBREADputs("# indel detection");
SUBREADputs(""); SUBREADputs("");
...@@ -353,10 +354,6 @@ int parse_opts_subjunc(int argc , char ** argv, global_context_t * global_contex ...@@ -353,10 +354,6 @@ int parse_opts_subjunc(int argc , char ** argv, global_context_t * global_contex
case 'U': case 'U':
global_context->config.report_no_unpaired_reads = 1; global_context->config.report_no_unpaired_reads = 1;
break; break;
case 'u':
global_context->config.report_multi_mapping_reads = 0;
global_context->config.use_hamming_distance_break_ties = 1;
break;
case 'b': case 'b':
global_context->config.convert_color_to_base = 1; global_context->config.convert_color_to_base = 1;