From 3b05f23297335fa90d0d6863ad1d3cafd4294748 Mon Sep 17 00:00:00 2001 From: asylvz Date: Wed, 4 Dec 2019 14:52:50 +0300 Subject: [PATCH] Added --no-mei flag to skip MEI clustering --- Makefile | 2 +- bamonly.c | 39 +++++++++++++++++++++------------------ cmdline.c | 7 +++++-- common.h | 1 + 4 files changed, 28 insertions(+), 21 deletions(-) diff --git a/Makefile b/Makefile index fdeea39..193f2ce 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ TARDIS_VERSION := "1.0.6" -TARDIS_UPDATE := "September 26, 2019" +TARDIS_UPDATE := "December 04, 2019" TARDIS_DEBUG := 0 BUILD_DATE := "$(shell date)" CC=gcc diff --git a/bamonly.c b/bamonly.c index 87bb4db..259481d 100644 --- a/bamonly.c +++ b/bamonly.c @@ -653,7 +653,7 @@ void bamonly_vh_clustering( bam_info** in_bams, parameters *params) continue; } else - any_in_bam = 1; + any_in_bam = 1; in_bams[bam_index]->iter = sam_itr_queryi( in_bams[bam_index]->bam_file_index, chr_index_bam, 0, params->this_sonic->chromosome_lengths[chr_index]); if( in_bams[bam_index]->iter == NULL) @@ -787,16 +787,19 @@ void bamonly_vh_clustering( bam_info** in_bams, parameters *params) fflush( stderr); /* Mei */ - fprintf( stderr, "\nPreparing MEI clusters"); - initializeReadMapping_MEI( in_bams, params, chr_index); - fprintf( stderr, ".."); - fflush( stderr); - MEICluster_Region( params, chr_index); - fprintf( stderr, ".."); - fflush( stderr); - vh_finalizeReadMapping_Mei( params->this_sonic->chromosome_lengths[chr_index]); - fprintf( stderr, ".."); - fflush( stderr); + if( params->no_interdup == 0) + { + fprintf( stderr, "\nPreparing MEI clusters"); + initializeReadMapping_MEI( in_bams, params, chr_index); + fprintf( stderr, ".."); + fflush( stderr); + MEICluster_Region( params, chr_index); + fprintf( stderr, ".."); + fflush( stderr); + vh_finalizeReadMapping_Mei( params->this_sonic->chromosome_lengths[chr_index]); + fprintf( stderr, ".."); + fflush( stderr); + } /* NumT */ if( ( strcmp( params->this_sonic->chromosome_names[chr_index], "MT") != 0) @@ -870,18 +873,18 @@ void bamonly_vh_clustering( bam_info** in_bams, parameters *params) free_the_rest( in_bams, params); } - + fprintf( stderr, "\n"); fclose( fpVcf); if ( !any_in_bam) - { - fprintf( stderr, "No chromosome is found in the input BAM/CRAM. Your SONIC and/or reference FASTA files do not match the reference used to generate the alignment file(s).\n"); - fprintf( stderr, "Check the reference genome versions and make sure you use the correct SONIC and reference FASTA files.\n"); - exit(EXIT_WRONG_SONIC); - } + { + fprintf( stderr, "No chromosome is found in the input BAM/CRAM. Your SONIC and/or reference FASTA files do not match the reference used to generate the alignment file(s).\n"); + fprintf( stderr, "Check the reference genome versions and make sure you use the correct SONIC and reference FASTA files.\n"); + exit(EXIT_WRONG_SONIC); + } + - if( debug_mode) fclose( fileOutput); diff --git a/cmdline.c b/cmdline.c index 7d9c086..1615357 100644 --- a/cmdline.c +++ b/cmdline.c @@ -32,7 +32,7 @@ int parse_command_line( int argc, char** argv, parameters* params) { int index; int o; - static int sensitive = 0, no_soft_clip = 0, debug = 0, no_interdup = 0; + static int sensitive = 0, no_soft_clip = 0, debug = 0, no_interdup = 0, no_mei = 0; static int skip_mrfast = 0, quick = 0, ten_x = 0, output_hs = 0, alt_mapping = 0, resolved = 0; static int make_sonic = 0; static int load_sonic = 0; @@ -68,6 +68,7 @@ int parse_command_line( int argc, char** argv, parameters* params) {"read-cluster", required_argument, 0, 'k'}, {"no-soft-clip", no_argument, &no_soft_clip, 1 }, {"no-interdup", no_argument, &no_interdup, 1 }, + {"no-mei", no_argument, &no_mei, 1 }, {"debug", no_argument, &debug, 1 }, {"xa", no_argument, &alt_mapping, 1 }, {"resolved", no_argument, &resolved, 1 }, @@ -333,6 +334,7 @@ int parse_command_line( int argc, char** argv, parameters* params) params->number_of_different_mei_types = count_mei_columns( params->mei); params->alt_mapping = alt_mapping; params->no_interdup = no_interdup; + params->no_mei = no_mei; params->seq_resolved = resolved; debug_mode = debug; @@ -382,8 +384,9 @@ void print_help( void) fprintf( stdout, "\t--mei [\"Alu:L1:SVA\"] : List of mobile element names.\n"); fprintf( stdout, "\t--no-soft-clip : Skip soft clip remapping.\n"); fprintf( stdout, "\t--no-interdup : Skip interspersed duplication clustering.\n"); + fprintf( stdout, "\t--no-mei : Skip mobile element insertion (MEI) clustering.\n"); fprintf( stdout, "\t--resolved : Output sequence resolved vcf calls.\n"); - fprintf( stdout, "\t--xa : Look for the alternative mapping locations in BWA.\n"); + //fprintf( stdout, "\t--xa : Look for the alternative mapping locations in BWA.\n"); fprintf( stdout, "\t--first-chr [chr_index] : Start running from a specific chromosome [0-based index in reference file].\n"); fprintf( stdout, "\t--last-chr [chr_index] : Run up to a specific chromosome [0-based index in reference file].\n"); diff --git a/common.h b/common.h index c74ef6c..9d7e908 100644 --- a/common.h +++ b/common.h @@ -111,6 +111,7 @@ typedef struct _params int alt_mapping; /* check the alternative mapping locations from the xa field in bwa */ int seq_resolved; /* whether to output sequence resolved calls */ int no_interdup; /* whether to cluster interspersed duplications */ + int no_mei; /* whether to cluster mobile element insertions */ char skip_mrfast; /* boolean stand-in to skip mrFast mapping (If you already have the divet file created) */ int threads; /* number of threads to use for parallel mrFAST, and maybe future parallelization of TARDIS */ int num_bams; /* number of input BAM files */