Imported Upstream version 1.4.6-p1

parents
File added
This diff is collapsed.
Installation
--------------
You may use Subread package by directly downloading a binary release suitable for your operating system (no compilation is needed), or you may build it from the source. Here we describe how to install it from the source.
Download the latest version of Subread package from http://subread.sourceforge.net/. The source release includes a keyword 'source' in the name of the tar ball. Uncompress the tar ball, enter the 'src' directory and issue the following command to build it for Linux OS :
make -f Makefile.Linux
For Mac OS, use command:
make -f Makefile.MacOS
For FreeBSD OS, use command:
gmake -f Makefile.FreeBSD
For OpenSolaris/Oracle Solaris OS, use command:
gmake -f Makefile.SunOS
If the build is successful, a new directory called 'bin' will be created under the home directory of the package (ie. one level up from 'src' directory). The 'bin directory contains all the generated executables. To enable easy access to these executables, you may copy the executables to a system directory such as '/usr/bin' or add the path to the executables to your search path (add path to your environment variable `PATH').
Content
--------------
annotation Directory including NCBI RefSeq gene annotations for genomes 'hg19', 'mm10' and 'mm9'.
Each row is an exon. Entrez gene identifiers and chromosomal coordinates are provided for each exon.
bin Directory including executables after compilation (or directly available from a binary release).
doc Directory including the users manual.
LICENSE The license agreement for using this package.
README.txt This file.
src Directory including source code (binary releases do not have this directory).
test Directory including test data and scripts.
A Quick Start
--------------
An index should be built before carrying out read alignments:
subread-buildindex -o my_index chr1.fa chr2.fa ...
(You may provide a single FASTA file including all chromosomal sequences).
With built index, you can now align reads to the reference genome. Align single-end reads:
subread-align -i my_index -r reads.txt -o subread_results.sam
Align paired-end reads:
subread-align -i my_index -r reads1.txt -R reads2.txt -o subread_results_PE.sam
Detect exon-exon junctions from RNA-seq data (read mapping results are also generated):
subjunc -i my_index -r reads1.txt -R reads2.txt -o subjunc_results.sam
Assign mapped reads to genomic features (eg. genes):
featureCounts -a annotation.gtf -o counts.txt subread_results.sam
Tutorials
-------------------
A short tutorial for Subread - http://bioinf.wehi.edu.au/subread
A short tutorial for Subjunc - http://bioinf.wehi.edu.au/subjunc
A short tutorial for featureCounts - http://bioinf.wehi.edu.au/featureCounts
Users Guide
--------------
Users Guide can be found in the 'doc' subdirectory. It provides comprehensive descriptions to the programs included in this package.
Citation
--------------
If you use Subread or Subjunc aligners, please cite:
Liao Y, Smyth GK and Shi W. The Subread aligner: fast, accurate and scalable read mapping by seed-and-vote. Nucleic Acids Research, 41(10):e108, 2013
If you use the featureCounts program, please cite:
Liao Y, Smyth GK and Shi W. featureCounts: an efficient general-purpose program for assigning sequence reads to genomic features. Bioinformatics, 2013. doi: 10.1093/bioinformatics/btt656
Get help
--------------
You may subscribe to the SeqAnswer forum (http://www.seqanswers.com) or the Bioconductor mailing list (http://bioconductor.org/) to get help. Alternatively, you may directly contact Wei Shi (shi at wehi dot edu dot au) or Yang Liao (liao at wehi dot edu dot au) for help.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#ifndef _SAMBAM_FILE_H_
#define _SAMBAM_FILE_H_
typedef unsigned char BS_uint_8;
typedef unsigned short BS_uint_16;
typedef unsigned int BS_uint_32;
typedef struct
{
FILE * os_file;
unsigned long long next_block_header_offset;
int file_mode;
} BamSam_FILE;
typedef struct
{
BS_uint_8 ID1;
BS_uint_8 ID2;
BS_uint_8 CM;
BS_uint_8 FLG;
BS_uint_32 MTIME;
BS_uint_8 XFL;
BS_uint_8 OS;
BS_uint_16 XLEN;
} BGZF_Header;
typedef struct
{
BS_uint_8 SI1;
BS_uint_8 SI2;
BS_uint_16 SLEN;
BS_uint_16 BSIZE;
} RCF1952_Subfield;
#define SAMBAM_FILE_SAM 10
#define SAMBAM_FILE_BAM 20
// this function returns 0 if OK, or a minus value if the file reaches EOF.
// the file pointer is put to the first byte of the first subfield after the header.
int get_next_BGZF_block_header(BamSam_FILE * fp, BGZF_Header * header);
// The file pointer is put to the first byte of CDATA.
// There should be a BamSam subfield found so the function can return 0; if not, the return value is minus.
int get_RFC1952_subfield(BamSam_FILE * fp, RCF1952_Subfield * field);
// This function moves 8 bytes of fp, putting the file pointer to the first byte of the next BamSam block.
int finalise_BamSam_block(BamSam_FILE * fp);
// This function opens a BamSam file in read-only mode.
// FILE_MODE specifies if it is a SAM file or a BAM file.
// It returns NULL if fopen(fn,"r") == NULL.
BamSam_FILE * fopen_BamSam(const char * fn, int FILE_MODE);
// just like feof(fp)
int feof_BamSam(BamSam_FILE *fp);
#endif
This diff is collapsed.
/***************************************************************
The Subread software package is free software package:
you can redistribute it and/or modify it under the terms
of the GNU General Public License as published by the
Free Software Foundation, either version 3 of the License,
or (at your option) any later version.
Subread is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
Authors: Drs Yang Liao and Wei Shi
***************************************************************/
#ifndef __HELPER_FUNCTIONS_H_
#define __HELPER_FUNCTIONS_H_
// This function parses CIGAR_Str and extract the relative starting points and lengths of all sections (i.e., the sections of read that are separated by 'N').
// CIGAR_Str is a CIGAR string containing 'S', 'M', 'I', 'D' and 'N' operations. Other operations are all ignored. The length of CIGAR_Str should be always less than 100 bytes or "-1" is returned.
// Staring_Points and Section_Length are empty arrays to write the sections. The minimum length of each array is 6 items.
// The length of a section is its length on the chromosome, namely 'I' is ignored but 'D' is added into the length.
// This function ignores all sections from the 7-th.
// This function returns the number of sections found in the CIGAR string. It returns -1 if the CIGAR string cannot be parsed.
int RSubread_parse_CIGAR_string(const char * CIGAR_Str, unsigned int * Staring_Points, unsigned short * Section_Length);
// This function try to find the attribute value of a given attribute name from the extra column string in GTF/GFF.
// If the value is found, it returns the length of the value (must be > 0 by definition), or -1 if no attribute is found or the format is wrong.
int GTF_extra_column_value(const char * Extra_Col, const char * Target_Name, char * Target_Value, int TargVal_Size);
// Replacing `rep' with `with' in `orig'.
// Rhe return value must be freed if it is not NULL.
char *str_replace(char *orig, char *rep, char *with) ;
// rule: the string is ABC123XXXXXX...
// // This is the priroity:
// // First, compare the letters part.
// // Second, compare the pure numeric part.
// // Third, compare the remainder.
int strcmp_number(char * s1, char * s2);
#endif
all:
@echo
@echo " Subread currently supports Linux, Mac OS X, FreeBSD and Solaris. Please choose the correct Makefile to build Subread."
@echo
@echo " For building subread in Linux, please run ' make -f Makefile.Linux '."
@echo " For building subread in Mac OS X, please run ' make -f Makefile.MacOS '."
@echo " For building subread in FreeBSD, please run ' gmake -f Makefile.FreeBSD '."
@echo " For building subread in Oracle Solaris or OpenSolaris, please run ' gmake -f Makefile.SunOS '."
@echo
@echo " The default compiler is gcc; you may change the compailer by editing the makefile."
@echo
@echo " The generated executables are saved to directory (PACKAGE_DIR)/bin"
@echo
include makefile.version
MACOS = -D FREEBSD
CCFLAGS = -march=native -mtune=core2 ${MACOS} -O9 -Wall -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
CC = gcc ${CCFLAGS} -ggdb -fomit-frame-pointer -ffast-math -funroll-loops -mmmx -msse -msse2 -msse3 -fmessage-length=0
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
ALL_OBJECTS=$(addsuffix .o, ${ALL_LIBS})
ALL_H=$(addsuffix .h, ${ALL_LIBS})
ALL_C=$(addsuffix .c, ${ALL_LIBS})
all: featureCounts removeDup exactSNP subread-buildindex subindel subread-align subjunc subtools qualityScores subread-fullscan propmapped coverageCount
mkdir -p ../bin/utilities
mv subread-align subjunc featureCounts subindel exactSNP subread-buildindex ../bin/
mv coverageCount subtools qualityScores propmapped subread-fullscan removeDup ../bin/utilities
propmapped: propmapped.c ${ALL_OBJECTS}
${CC} -o propmapped propmapped.c ${ALL_OBJECTS} ${LDFLAGS}
exactSNP: SNPCalling.c SNPCalling.h ${ALL_OBJECTS}
${CC} -o exactSNP SNPCalling.c ${ALL_OBJECTS} ${LDFLAGS}
subread-buildindex: index-builder.c subread.h ${ALL_OBJECTS}
${CC} -o subread-buildindex index-builder.c ${ALL_OBJECTS} ${LDFLAGS}
removeDup: removeDupReads.c removeDupReads.h subread.h ${ALL_OBJECTS}
${CC} -o removeDup removeDupReads.c ${ALL_OBJECTS} ${LDFLAGS}
subindel: SUBindel.c core.h subread.h ${ALL_OBJECTS}
${CC} -o subindel SUBindel.c ${ALL_OBJECTS} ${LDFLAGS}
featureCounts: readSummary.c subread.h ${ALL_OBJECTS}
${CC} -o featureCounts readSummary.c ${ALL_OBJECTS} ${LDFLAGS}
subread-align: core-interface-aligner.c ${ALL_OBJECTS}
${CC} -o subread-align core-interface-aligner.c ${ALL_OBJECTS} ${LDFLAGS}
subjunc: core-interface-subjunc.c ${ALL_OBJECTS}
${CC} -o subjunc core-interface-subjunc.c ${ALL_OBJECTS} ${LDFLAGS}
qualityScores: qualityScores.c ${ALL_OBJECTS}
${CC} -o qualityScores qualityScores.c ${ALL_OBJECTS} ${LDFLAGS}
subread-fullscan: fullscan.c ${ALL_OBJECTS}
${CC} -o subread-fullscan fullscan.c ${ALL_OBJECTS} ${LDFLAGS}
subtools: subtools.c ${ALL_OBJECTS}
${CC} -o subtools subtools.c ${ALL_OBJECTS} ${LDFLAGS}
coverageCount: coverage_calc.c ${ALL_OBJECTS}
${CC} -o coverageCount coverage_calc.c ${ALL_OBJECTS} ${LDFLAGS}
clean:
rm -f core featureCounts exactSNP removeDup subread-buildindex ${ALL_OBJECTS}
#MACOS = -D MACOS
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 = -D_FORTIFY_SOURCE=2 -mtune=core2 ${MACOS} -O2 -Wall -DMAKE_FOR_EXON -D MAKE_STANDALONE -D SUBREAD_VERSION=\"${SUBREAD_VERSION}\" # -DREPORT_ALL_THE_BEST
LDFLAGS = ${STATIC_MAKE} -lpthread -lz -lm ${MACOS} -O9 -DMAKE_FOR_EXON -D MAKE_STANDALONE # -DREPORT_ALL_THE_BEST
CC = gcc ${CCFLAGS} -ggdb -fomit-frame-pointer -ffast-math -funroll-loops -mmmx -msse -msse2 -msse3 -fmessage-length=0
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
ALL_OBJECTS=$(addsuffix .o, ${ALL_LIBS})
ALL_H=$(addsuffix .h, ${ALL_LIBS})
ALL_C=$(addsuffix .c, ${ALL_LIBS})
all: featureCounts removeDup exactSNP subread-buildindex subindel subread-align subjunc subtools qualityScores subread-fullscan propmapped coverageCount globalReassembly # samMappedBases mergeVCF
mkdir -p ../bin/utilities
mv subread-align subjunc featureCounts subindel exactSNP subread-buildindex ../bin/
mv globalReassembly coverageCount propmapped qualityScores removeDup subread-fullscan subtools ../bin/utilities
globalReassembly: global-reassembly.c ${ALL_OBJECTS}
${CC} -o globalReassembly global-reassembly.c ${ALL_OBJECTS} ${LDFLAGS}
propmapped: propmapped.c ${ALL_OBJECTS}
${CC} -o propmapped propmapped.c ${ALL_OBJECTS} ${LDFLAGS}
exactSNP: SNPCalling.c SNPCalling.h ${ALL_OBJECTS}
${CC} -o exactSNP SNPCalling.c ${ALL_OBJECTS} ${LDFLAGS}
subread-buildindex: index-builder.c subread.h ${ALL_OBJECTS}
${CC} -o subread-buildindex index-builder.c ${ALL_OBJECTS} ${LDFLAGS}
removeDup: removeDupReads.c removeDupReads.h subread.h ${ALL_OBJECTS}
${CC} -o removeDup removeDupReads.c ${ALL_OBJECTS} ${LDFLAGS}
subindel: SUBindel.c core.h subread.h ${ALL_OBJECTS}
${CC} -o subindel SUBindel.c ${ALL_OBJECTS} ${LDFLAGS}
featureCounts: readSummary.c subread.h ${ALL_OBJECTS}
${CC} -o featureCounts readSummary.c ${ALL_OBJECTS} ${LDFLAGS}
subread-align: core-interface-aligner.c ${ALL_OBJECTS}
${CC} -o subread-align core-interface-aligner.c ${ALL_OBJECTS} ${LDFLAGS}
subjunc: core-interface-subjunc.c ${ALL_OBJECTS}
${CC} -o subjunc core-interface-subjunc.c ${ALL_OBJECTS} ${LDFLAGS}
subtools: subtools.c ${ALL_OBJECTS}
${CC} -o subtools subtools.c ${ALL_OBJECTS} ${LDFLAGS}
qualityScores: qualityScores.c ${ALL_OBJECTS}
${CC} -o qualityScores qualityScores.c ${ALL_OBJECTS} ${LDFLAGS}
subread-fullscan: fullscan.c ${ALL_OBJECTS}
${CC} -o subread-fullscan fullscan.c ${ALL_OBJECTS} ${LDFLAGS}
coverageCount: coverage_calc.c ${ALL_OBJECTS}
${CC} -o coverageCount coverage_calc.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:
rm -f core featureCounts exactSNP removeDup subread-buildindex ${ALL_OBJECTS}
MACOS = -D MACOS
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
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
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
ALL_OBJECTS=$(addsuffix .o, ${ALL_LIBS})
ALL_H=$(addsuffix .h, ${ALL_LIBS})
ALL_C=$(addsuffix .c, ${ALL_LIBS})
all: featureCounts removeDup exactSNP subread-buildindex subindel subread-align subjunc subtools qualityScores subread-fullscan propmapped coverageCount # globalReassembly
mkdir -p ../bin/utilities
mv subread-align subjunc featureCounts subindel exactSNP subread-buildindex ../bin/
mv coverageCount subread-fullscan qualityScores removeDup subtools propmapped ../bin/utilities
propmapped: propmapped.c ${ALL_OBJECTS}
${CC} -o propmapped propmapped.c ${ALL_OBJECTS} ${LDFLAGS}
exactSNP: SNPCalling.c SNPCalling.h ${ALL_OBJECTS}
${CC} -o exactSNP SNPCalling.c ${ALL_OBJECTS} ${LDFLAGS}
subread-buildindex: index-builder.c subread.h ${ALL_OBJECTS}
${CC} -o subread-buildindex index-builder.c ${ALL_OBJECTS} ${LDFLAGS}
removeDup: removeDupReads.c removeDupReads.h subread.h ${ALL_OBJECTS}
${CC} -o removeDup removeDupReads.c ${ALL_OBJECTS} ${LDFLAGS}
subindel: SUBindel.c core.h subread.h ${ALL_OBJECTS}
${CC} -o subindel SUBindel.c ${ALL_OBJECTS} ${LDFLAGS}
featureCounts: readSummary.c subread.h ${ALL_OBJECTS}
${CC} -o featureCounts readSummary.c ${ALL_OBJECTS} ${LDFLAGS}
subread-align: core-interface-aligner.c ${ALL_OBJECTS}
${CC} -o subread-align core-interface-aligner.c ${ALL_OBJECTS} ${LDFLAGS}
subtools: subtools.c ${ALL_OBJECTS}
${CC} -o subtools subtools.c ${ALL_OBJECTS} ${LDFLAGS}
subjunc: core-interface-subjunc.c ${ALL_OBJECTS}
${CC} -o subjunc core-interface-subjunc.c ${ALL_OBJECTS} ${LDFLAGS}
qualityScores: qualityScores.c ${ALL_OBJECTS}
${CC} -o qualityScores qualityScores.c ${ALL_OBJECTS} ${LDFLAGS}
subread-fullscan: fullscan.c ${ALL_OBJECTS}
${CC} -o subread-fullscan fullscan.c ${ALL_OBJECTS} ${LDFLAGS}
coverageCount: coverage_calc.c ${ALL_OBJECTS}
${CC} -o coverageCount coverage_calc.c ${ALL_OBJECTS} ${LDFLAGS}
clean:
rm -f subtools core featureCounts exactSNP removeDup subread-buildindex ${ALL_OBJECTS}
This diff is collapsed.
/***************************************************************
The Subread software package is free software package:
you can redistribute it and/or modify it under the terms
of the GNU General Public License as published by the
Free Software Foundation, either version 3 of the License,
or (at your option) any later version.
Subread is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
Authors: Drs Yang Liao and Wei Shi
***************************************************************/
#ifndef __SINGLE_NUCLEODITE_POLYMOREPHISM_H_
#define __SINGLE_NUCLEODITE_POLYMOREPHISM_H_
#endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/***************************************************************
The Subread software package is free software package:
you can redistribute it and/or modify it under the terms
of the GNU General Public License as published by the
Free Software Foundation, either version 3 of the License,
or (at your option) any later version.
Subread is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
Authors: Drs Yang Liao and Wei Shi
***************************************************************/
#ifndef SUBREAD_CORE_INDEL_H_
#define SUBREAD_CORE_INDEL_H_
#include "subread.h"
#include "hashtable.h"
#include "core.h"
// chromosome events can be indels, junctions or fusions.
// if it is an insertion event, event_large_site = event_small_site+1.
//#define MAX_EVENT_ENTRIES_PER_SITE 5
#define MAX_EVENT_ENTRIES_PER_SITE 12
#define CHRO_EVENT_TYPE_REMOVED 0
#define CHRO_EVENT_TYPE_INDEL 8
#define CHRO_EVENT_TYPE_LONG_INDEL 16
#define CHRO_EVENT_TYPE_POTENTIAL_INDEL 32
#define CHRO_EVENT_TYPE_JUNCTION 64
#define CHRO_EVENT_TYPE_FUSION 128
#define CHRO_EVENT_TYPE_SNP 256
#define EVENT_SEARCH_BY_SMALL_SIDE 10
#define EVENT_SEARCH_BY_LARGE_SIDE 20
#define EVENT_SEARCH_BY_BOTH_SIDES 30
#define REASSEMBLY_WINDOW_LENGTH 350
//#define is_target_window_X(x) ((x + 1) * REASSEMBLY_WINDOW_LENGTH / 2 >= (10734463 % BASE_BLOCK_LENGTH) && (x- 1) * REASSEMBLY_WINDOW_LENGTH /2-1 <= (10734463%BASE_BLOCK_LENGTH) )
#define is_target_window_X(x) 0
//#define MAXIMUM_EVENT_NUMBER 300000
typedef struct{
unsigned int event_small_side;
unsigned int event_large_side;
//union
//{
short indel_length;
short junction_flanking_left;
//};
short junction_flanking_right;
unsigned char event_type;
char indel_at_junction;
char is_negative_strand; // this only works to junction detection, according to 'GT/AG' or 'CT/AC' donors. This only applys to junctions.
char is_strand_jumped; // "strand jumped" means that the left and right sides are on different strands. This only applys to fusions.
char is_donor_found; // only for junctions: GT/AG is found at the location.
// Also, if "is_strand_jumped" is true, all coordinates (e.g., splicing points, cover_start, cover_end, etc) are on "reversed read" view.
//char is_ambiguous;
char connected_next_event_distance; // the distance (negative or positive) to the next event in the table. For example, if the cigar string is 10M3I1M1I10M, event "3I" will have 1 here .
char connected_previous_event_distance; // the distance (negative or positive) to the next event in the table. For example, if the cigar string is 10M3I1M1I10M, event "1I" will have 1 here.
//char inserted_bases[(1+MAX_INSERTION_LENGTH) / 4 + 1];
char * inserted_bases;
unsigned short supporting_reads;
unsigned short anti_supporting_reads;
unsigned short final_counted_reads;
unsigned short final_reads_mismatches;
unsigned int global_event_id;
float event_quality;
} chromosome_event_t;
struct reassmebly_window_allele
{
char rebuilt_window[8000];
float allele_quality;
int rebuilt_size;
};
typedef struct{
gehash_t * voting_indexes;
char * chro_name;
unsigned long long int * start_keys;
short * start_offsets;
unsigned int * read_no_counter;
unsigned int block_start_linear_pos;
HashTable * read_sequence_table;
HashTable * read_position_table;
HashTable * read_quality_table;
gene_vote_t * vote_list;
gene_vote_t * vote_list_rectify;
short * read_rectify_space;
char rebuilt_window[2500];
int rebuilt_window_size;
struct reassmebly_window_allele * final_alleles;
unsigned int used_read_ids[2000];
int used_read_number;
int search_cost;
int total_matched_bases;
int max_matched_bases;
unsigned int window_start_pos;
} reassembly_by_voting_block_context_t;
typedef struct{
HashTable ** de_bruijn_graphs;
char * chro_name;
unsigned long long int * start_keys;
short * start_offsets;
unsigned int block_start_linear_pos;
} reassembly_block_context_t;
typedef struct{
HashTable * event_entry_table;
unsigned int total_events;
unsigned int current_max_event_number;
chromosome_event_t * event_space_dynamic;
HashTable * local_reassembly_pileup_files;
short ** dynamic_align_table;
char ** dynamic_align_table_mask;
} indel_context_t;
typedef struct{
HashTable * event_entry_table;
unsigned int total_events;
unsigned int current_max_event_number;
chromosome_event_t * event_space_dynamic;
unsigned short * final_counted_reads_array;
unsigned short * final_reads_mismatches_array;
short ** dynamic_align_table;
char ** dynamic_align_table_mask;
} indel_thread_context_t;
int init_indel_tables(global_context_t * context);
int destroy_indel_module(global_context_t * context);
int init_indel_thread_contexts(global_context_t * global_context, thread_context_t * thread_context, int task);
int finalise_indel_thread(global_context_t * global_context, thread_context_t * thread_context, int task);
int find_new_indels(global_context_t * global_context, thread_context_t * thread_context, int pair_number, char * read_name, char * read_text, char * qual_text, int read_len, int is_second_read, int best_read_id);
int write_indel_final_results(global_context_t * context);
int search_event(global_context_t * global_context,HashTable * event_table, chromosome_event_t * event_space, unsigned int pos, int search_type, char event_type, chromosome_event_t ** return_buffer);
void set_alignment_result(global_context_t * global_context, int pair_number, int is_second_read, int best_read_id, unsigned int position, int votes, gene_vote_number_t * indel_record, short best_cover_start, short best_cover_end, int is_negative_strand, unsigned int minor_position, unsigned int minor_votes, unsigned int minor_coverage_start, unsigned int minor_coverage_end, unsigned int split_point, int inserted_bases, int is_strand_jumped, int is_GT_AG_donors, int used_subreads_in_vote, int noninformative_subreads_in_vote, int major_indel_offset, int minor_indel_offset);
void put_new_event(HashTable * event_table, chromosome_event_t * new_event , int event_no);
void remove_neighbour(global_context_t * global_context);
int build_local_reassembly(global_context_t *global_context , thread_context_t *thread_context , int pair_number, char * read_name_1 , char * read_text_1 ,char * qual_text_1 , int read_len_1, int read_len_2, int is_second_read, int best_read_id, int is_paired_unmapped);
int finalise_long_insertions(global_context_t * global_context);
// This function sets the global context with default values.
void init_global_context(global_context_t * context);
int write_local_reassembly(global_context_t *global_context, HashTable *pileup_fp_table, unsigned int anchor_pos, char * read_name , char * read_text ,char * qual_text , int read_len, int is_anchor_certain);
int finalise_long_insertions_by_hashtable(global_context_t * global_context);
void destroy_pileup_table(HashTable* local_reassembly_pileup_files);
chromosome_event_t * reallocate_event_space(global_context_t* global_context,thread_context_t* thread_context,int event_no);
int there_are_events_in_range(char * bitmap, unsigned int pos, int sec_len);
int anti_supporting_read_scan(global_context_t * global_context);
#endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char ** argv)
{
int chromosomes = atoi(argv[1]);
int x1, chro_offset;
for(x1=0; x1<chromosomes; x1++)
{
if(x1) puts("");
printf(">chr%d", x1+1);
for(chro_offset = 0; chro_offset<500000; chro_offset++)
{
if(chro_offset % 70==0) puts("");
char nch_i = rand() % 4 ;
char nch = nch_i?(nch_i<2?'T':(nch_i < 3?'C':'G')):'A';
putchar(nch);
}
}
return 0;
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/***************************************************************
The Subread software package is free software package:
you can redistribute it and/or modify it under the terms