<commit_before>#QueryFuse
<li>QueryFuse is software package for gene fusion detection using RNA-Seq data on a list of genes of interested. By using the small gene list, QueryFuse can give report in a fast, accurate and sensitive way, which can also help users focus on the genes they mostly care about. The software use alignment output from general RNA-Seq aligners as the input to avoid unnecessary realignment and save time. Then it uses local aligner to cluster discordant paired end reads and locate the fusion boundary. The software integrates filters and ranking methods to reduce false positive and prioritize important events. Fusion events that have only spanning reads1 will be reported in the second category. Alignment graph with reference template and all the related supporting reads will be generated automatically.</li>
<li>1Spanning reads: We define spanning reads as pair-end-aligned reads that have the fusion boundaries in the gap between the paired ends.</li>


##Publications


##RNA-Seq Datasets
<li>Publicly available datasets are all described in the publication. The TL-03 sample location? (need to ask bejoern)</li>
<li>A simulated test set (with 100 splitting reads and 26 spanning reads for each fusion) is in the simulation-test-data folder. (accepted_hits.bam, unmapped.bam and 1 simulated fusion list) Also, parameter_file.txt for this dataset is provided.(available in: http://smonti.bumc.bu.edu/~montilab/zoho/QueryFuse/simulated_data_example/)</li>



##Setup
<li>To run QueryFuse, you need to have anaconda installed in your Linux system.</li>
<li>Get the QueryFuse code</li>
<li>Download and untar/gunzip the QueryFuse code package to a directory. No further installation is needed for the code itself, but anaconda environment is needed. "dos2unix" (or similar commands) are recommended, in order to confirm all the files are in the correct format for your computer. Now, QueryFuse can only run under Linux/Unix, which supports shell script, because QueryFuse is written in shell, Python, Perl and R.</li>
<li>Setup running environment using anaconda</li>
<li>In each QueryFuse version, there will be a file called "anaconda_env_setting_readme.txt". Please follow it to set up the running environment. There are external tools required for running QueryFuse and they will all be setup by anaconda.</li>



##Reference Dataset (available in: http://smonti.bumc.bu.edu/~montilab/zoho/QueryFuse/reference_files/)
<li>1.	Genome.fa and build the bowtie index. For bowtie website. [Note: the fa file must use "chr*" as chromosome rather than use just 1-22, X, Y and M.] The hg19.fa I used can be also downloaded in the reference folder. (You need to build bowtie index yourself based on the fa by using "bowtie2-build".)</li>
<li>2.	Gene annotation. They can be built in bio-mart. Columns to include and following this order. For example, the one for hg19 (hg19_whole_gene_list.bed in the reference folder). In order to have better extension, I generated a 5k bp extended version on both sides of each gene. (hg19_whole_gene_list_5k_expanded.bed in the reference folder). Because the chrM is shortly, need to pay attention that not to extent the boundary over chrM's length. However, generally, chrM is not considered in fusion detection and should be filtered out.)</li>



##Input data format</li>
<li>QueryFuse now takes only paired end aligned bam file from aligners as input. To convert sam to bam, samtools command "samtools view" can be used.</li>



##How to run
<li>Running QueryFuse is as simple as running a single command line by just typing "python QF_path/QF_multi_query_warpper.py parameter_file". The parameter file should include all the parameters listed below. (But you can also type in the parameter in the command line without changing the parameter file.)</li>
<li>[Details of all parameters: please see the QF_para_file_example.txt in each QueryFuse version.]</li>
<li>*Note: the output directory should be different from the directory containing the input bam file.*</li>



##Output
###Final output
<li>For a specific sample, all the most important outputs are in the "results" folder and each query gene will have its own subfolder. The "whole_fusion_sum_filtered.txt" file is the key one with score and ranked result after filtering. The "whole_fusion_sum_all.txt" file contains all the detect fusions before filtering and has scores of features but no ranks. If you want to have a look at the detail graph of ranked fusion events, you can find it in the "fusion_supporting_graph_final" folder by the fusion details.</li>
<li>There are three other folders in a run: "logs" folder with all running logs; "bams" folder with shared preprocess files for all queries; "intermedias" folder with query specific intermediate files for each query. </li>


###Identification
<li>PARTNER_GENE_NAME: the name of the partner gene, which can be ambiguous.</li>
<li>PARTNER_GENE_ID: the ENSEMBL ID of the partner gene, which is unique.</li>
<li>QUERY_GENE_NAME: the name of the query gene.</li>
<li>QUERY_GENE_ID: the ENSEMBL ID of the query gene.</li>

###Evidence 
<li>SPLIT_NUM: number of splitting reads supporting this fusion event. If it is fusion event with multiple alignments, the sum of all splitting reads is divided by the number of multiple locations.</li>
<li>SPAN_NUM: number of spanning reads supporting this fusion event.</li>
<li>SUPPORT_SUM_NUM: Total supporting read number of this fusion event. It is the sum of SPLIT_NUM and SPAN_NUM.</li>
<li>SPLIT_PVAL: the value to indicate how well the splitting reads spread around the breakpoint. (The bigger, the better.) It is the p-value from the KS-test.</li>
<li>SHIFT_RANGE: the length of shared sequence at the breakpoints of the pair of partners. Shifting the breakpoint in this region will not affect the fusion sequence. Biologically, this is locations that an enzyme can bind on and the double-strand DNA break or splicing event can happen at.</li>
<li>DINUCLEOTIDE_ENTROPY: entropy of 16 possible dinucleotides around the breakpoint.</li>
<li>MULTI-ALIGN_NUM: number of possible alignment locations for this fusion reference.</li>
<li>RANK_SCORE: The sum of ranks of all previous features.</li>


###Annotation
<li>CHR_PARTNER_GENE: the chromosome of the partner gene.</li>
<li>BREAKPOINT_PARTNER_GENE: the breakpoint location of the partner gene.</li>
<li>DIRECTION_PARTNER_GENE: the chromosomal connection direction of the partner gene. ("F" means forward direction, which means it is 3' end on plus strand or 5' end on the minus strand and the detected arm is on the left (side with smaller location number than the breakpoint) of a chromosome. "R" means reverse direction, which means it is 5' end on the plus strand or 3' end on the minus strand and the detected arm is on the right (side with bigger location number than the breakpoint) of a chromosome.</li>
<li>CHR_QUERY_GENE: the chromosome of the query gene</li>
<li>BREAKPOINT_QUERY_GENE: the breakpoint location of the query gene.</li>
<li>DIRECTION_QUERY_GENE: the chromosomal connection direction of the query gene.</li>
<commit_msg>I modified the readme to fit the new package version about setup and run<commit_after>#QueryFuse
<li>QueryFuse is software package for gene fusion detection using RNA-Seq data on a list of genes of interested. By using the small gene list, QueryFuse can give report in a fast, accurate and sensitive way, which can also help users focus on the genes they mostly care about. The software use alignment output from general RNA-Seq aligners as the input to avoid unnecessary realignment and save time. Then it uses local aligner to cluster discordant paired end reads and locate the fusion boundary. The software integrates filters and ranking methods to reduce false positive and prioritize important events. Fusion events that have only spanning reads1 will be reported in the second category. Alignment graph with reference template and all the related supporting reads will be generated automatically.</li>
<li>1Spanning reads: We define spanning reads as pair-end-aligned reads that have the fusion boundaries in the gap between the paired ends.</li>


##Publications


##RNA-Seq Datasets
<li>Publicly available datasets are all described in the publication. The TL-03 sample location? (need to ask bejoern)</li>
<li>A simulated test set (with 100 splitting reads and 26 spanning reads for each fusion) is in the simulation-test-data folder. (accepted_hits.bam, unmapped.bam and 1 simulated fusion list) Also, parameter_file.txt for this dataset is provided.(available in: http://smonti.bumc.bu.edu/~montilab/zoho/QueryFuse/simulated_data_example/)</li>



##Setup
<li>To run QueryFuse, you need to have anaconda installed in your Linux system.</li>
<li>After that, you need to get QueryFuse from binstar and create the running environment by:</li>
<li> conda create -c yuxiang queryfuse -n $env_name #(Recommendation: use QF with version number is the env_name.) </li>
<li>Once it is setup correctly, it will tell you how to activate the environment. </li>




##Reference Dataset (available in: http://smonti.bumc.bu.edu/~montilab/zoho/QueryFuse/reference_files/)
<li>1.	Genome.fa and build the bowtie index. For bowtie website. [Note: the fa file must use "chr*" as chromosome rather than use just 1-22, X, Y and M.] The hg19.fa I used can be also downloaded in the reference folder. (You need to build bowtie index yourself based on the fa by using "bowtie2-build".)</li>
<li>2.	Gene annotation. They can be built in bio-mart. Columns to include and following this order. For example, the one for hg19 (hg19_whole_gene_list.bed in the reference folder). In order to have better extension, I generated a 5k bp extended version on both sides of each gene. (hg19_whole_gene_list_5k_expanded.bed in the reference folder). Because the chrM is shortly, need to pay attention that not to extent the boundary over chrM's length. However, generally, chrM is not considered in fusion detection and should be filtered out.)</li>



##Input data format</li>
<li>QueryFuse now takes only paired end aligned bam file from aligners as input. To convert sam to bam, samtools command "samtools view" can be used.</li>



##How to run
<li>Before running QueryFues, you need to activate the QueryFuse environment by:</li>
<li> source activate $env_name #(The one used in the setup step) </li>
<li>Running QueryFuse is as simple as running a single command line by just typing "QF_wrapper.py -p parameter_file". The parameter file should include all the parameters listed below. (But you can also type in the parameter in the command line without changing the parameter file.)</li>
<li>[Details of all parameters: please see the QF_para_file_example.txt in each QueryFuse version.]</li>
<li>*Note: the output directory should be different from the directory containing the input bam file.*</li>



##Output
###Final output
<li>For a specific sample, all the most important outputs are in the "results" folder and each query gene will have its own subfolder. The "whole_fusion_sum_filtered.txt" file is the key one with score and ranked result after filtering. The "whole_fusion_sum_all.txt" file contains all the detect fusions before filtering and has scores of features but no ranks. If you want to have a look at the detail graph of ranked fusion events, you can find it in the "fusion_supporting_graph_final" folder by the fusion details.</li>
<li>There are three other folders in a run: "logs" folder with all running logs; "bams" folder with shared preprocess files for all queries; "intermedias" folder with query specific intermediate files for each query. </li>


###Identification
<li>PARTNER_GENE_NAME: the name of the partner gene, which can be ambiguous.</li>
<li>PARTNER_GENE_ID: the ENSEMBL ID of the partner gene, which is unique.</li>
<li>QUERY_GENE_NAME: the name of the query gene.</li>
<li>QUERY_GENE_ID: the ENSEMBL ID of the query gene.</li>

###Evidence 
<li>SPLIT_NUM: number of splitting reads supporting this fusion event. If it is fusion event with multiple alignments, the sum of all splitting reads is divided by the number of multiple locations.</li>
<li>SPAN_NUM: number of spanning reads supporting this fusion event.</li>
<li>SUPPORT_SUM_NUM: Total supporting read number of this fusion event. It is the sum of SPLIT_NUM and SPAN_NUM.</li>
<li>SPLIT_PVAL: the value to indicate how well the splitting reads spread around the breakpoint. (The bigger, the better.) It is the p-value from the KS-test.</li>
<li>SHIFT_RANGE: the length of shared sequence at the breakpoints of the pair of partners. Shifting the breakpoint in this region will not affect the fusion sequence. Biologically, this is locations that an enzyme can bind on and the double-strand DNA break or splicing event can happen at.</li>
<li>DINUCLEOTIDE_ENTROPY: entropy of 16 possible dinucleotides around the breakpoint.</li>
<li>MULTI-ALIGN_NUM: number of possible alignment locations for this fusion reference.</li>
<li>RANK_SCORE: The sum of ranks of all previous features.</li>


###Annotation
<li>CHR_PARTNER_GENE: the chromosome of the partner gene.</li>
<li>BREAKPOINT_PARTNER_GENE: the breakpoint location of the partner gene.</li>
<li>DIRECTION_PARTNER_GENE: the chromosomal connection direction of the partner gene. ("F" means forward direction, which means it is 3' end on plus strand or 5' end on the minus strand and the detected arm is on the left (side with smaller location number than the breakpoint) of a chromosome. "R" means reverse direction, which means it is 5' end on the plus strand or 3' end on the minus strand and the detected arm is on the right (side with bigger location number than the breakpoint) of a chromosome.</li>
<li>CHR_QUERY_GENE: the chromosome of the query gene</li>
<li>BREAKPOINT_QUERY_GENE: the breakpoint location of the query gene.</li>
<li>DIRECTION_QUERY_GENE: the chromosomal connection direction of the query gene.</li>

{'fraction_non_alphanumeric': 0.06606069281419982, 'fraction_numerical': 0.00465216146578872, 'mean_word_length': 4.900760135135135, 'pattern_counts': {'":': 0, '<': 147, '<?xml version=': 0, '>': 147, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '691781', 'n_tokens_mistral': 3928, 'n_tokens_neox': 3701, 'n_words': 2007}