Skip to content

Commit

Permalink
Added --no-mei flag to skip MEI clustering
Browse files Browse the repository at this point in the history
  • Loading branch information
asylvz committed Dec 4, 2019
1 parent 7896d8d commit 3b05f23
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 21 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
39 changes: 21 additions & 18 deletions bamonly.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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);

Expand Down
7 changes: 5 additions & 2 deletions cmdline.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 },
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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");

Expand Down
1 change: 1 addition & 0 deletions common.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 3b05f23

Please sign in to comment.